给系统参数表增加更新单价启用标记,默认开启

This commit is contained in:
季圣华 2023-03-21 22:22:54 +08:00
parent 7eb8a7a528
commit cc19ceab7f
7 changed files with 144 additions and 21 deletions

View File

@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50704
File Encoding : 65001
Date: 2023-03-17 22:17:41
Date: 2023-03-21 22:20:03
*/
SET FOREIGN_KEY_CHECKS=0;
@ -853,6 +853,7 @@ CREATE TABLE `jsh_system_config` (
`multi_level_approval_flag` varchar(1) DEFAULT '0' COMMENT '多级审核启用标记0未启用1启用',
`multi_bill_type` varchar(200) DEFAULT NULL COMMENT '流程类型,可多选',
`force_approval_flag` varchar(1) DEFAULT '0' COMMENT '强审核启用标记0未启用1启用',
`update_unit_price_flag` varchar(1) DEFAULT '1' COMMENT '更新单价启用标记0未启用1启用',
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
`delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记0未删除1删除',
PRIMARY KEY (`id`)
@ -861,7 +862,7 @@ CREATE TABLE `jsh_system_config` (
-- ----------------------------
-- Records of jsh_system_config
-- ----------------------------
INSERT INTO `jsh_system_config` VALUES ('11', '公司test', '小李', '地址1', '12345678', null, null, '注:本单为我公司与客户约定账期内结款的依据,由客户或其单位员工签字生效,并承担法律责任。', '0', '0', '1', '0', '0', '', '0', '63', '0');
INSERT INTO `jsh_system_config` VALUES ('11', '公司test', '小李', '地址1', '12345678', null, null, '注:本单为我公司与客户约定账期内结款的依据,由客户或其单位员工签字生效,并承担法律责任。', '0', '0', '1', '0', '0', '', '0', '1', '63', '0');
-- ----------------------------
-- Table structure for jsh_tenant

View File

@ -1466,4 +1466,11 @@ alter table jsh_account_head add source varchar(1) DEFAULT '0' COMMENT '单据
-- 增加零售统计菜单
-- --------------------------------------------------------
alter table jsh_system_config change amount_approval_flag force_approval_flag varchar(1) DEFAULT '0' COMMENT '强审核启用标记0未启用1启用';
insert into `jsh_function` (`number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('030105', '零售统计', '0301', '/report/retail_out_report', '/report/RetailOutReport', b'0', '0615', b'1', '电脑版', '', 'profile', '0');
insert into `jsh_function` (`number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('030105', '零售统计', '0301', '/report/retail_out_report', '/report/RetailOutReport', b'0', '0615', b'1', '电脑版', '', 'profile', '0');
-- --------------------------------------------------------
-- 时间 2023年03月08日
-- by jishenghua
-- 给系统参数表增加更新单价启用标记
-- --------------------------------------------------------
alter table jsh_system_config add update_unit_price_flag varchar(1) DEFAULT '1' COMMENT '更新单价启用标记0未启用1启用' after force_approval_flag;

View File

@ -31,6 +31,8 @@ public class SystemConfig {
private String forceApprovalFlag;
private String updateUnitPriceFlag;
private Long tenantId;
private String deleteFlag;
@ -155,6 +157,14 @@ public class SystemConfig {
this.forceApprovalFlag = forceApprovalFlag == null ? null : forceApprovalFlag.trim();
}
public String getUpdateUnitPriceFlag() {
return updateUnitPriceFlag;
}
public void setUpdateUnitPriceFlag(String updateUnitPriceFlag) {
this.updateUnitPriceFlag = updateUnitPriceFlag == null ? null : updateUnitPriceFlag.trim();
}
public Long getTenantId() {
return tenantId;
}

View File

@ -1144,6 +1144,76 @@ public class SystemConfigExample {
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagIsNull() {
addCriterion("update_unit_price_flag is null");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagIsNotNull() {
addCriterion("update_unit_price_flag is not null");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagEqualTo(String value) {
addCriterion("update_unit_price_flag =", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagNotEqualTo(String value) {
addCriterion("update_unit_price_flag <>", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagGreaterThan(String value) {
addCriterion("update_unit_price_flag >", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagGreaterThanOrEqualTo(String value) {
addCriterion("update_unit_price_flag >=", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagLessThan(String value) {
addCriterion("update_unit_price_flag <", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagLessThanOrEqualTo(String value) {
addCriterion("update_unit_price_flag <=", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagLike(String value) {
addCriterion("update_unit_price_flag like", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagNotLike(String value) {
addCriterion("update_unit_price_flag not like", value, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagIn(List<String> values) {
addCriterion("update_unit_price_flag in", values, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagNotIn(List<String> values) {
addCriterion("update_unit_price_flag not in", values, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagBetween(String value1, String value2) {
addCriterion("update_unit_price_flag between", value1, value2, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andUpdateUnitPriceFlagNotBetween(String value1, String value2) {
addCriterion("update_unit_price_flag not between", value1, value2, "updateUnitPriceFlag");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return (Criteria) this;

View File

@ -826,20 +826,22 @@ public class DepotItemService {
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void updateMaterialExtendPrice(Long meId, String subType, JSONObject rowObj) throws Exception {
if (StringUtil.isExist(rowObj.get("unitPrice"))) {
BigDecimal unitPrice = rowObj.getBigDecimal("unitPrice");
MaterialExtend materialExtend = new MaterialExtend();
materialExtend.setId(meId);
if(BusinessConstants.SUB_TYPE_PURCHASE.equals(subType)) {
materialExtend.setPurchaseDecimal(unitPrice);
if(systemConfigService.getUpdateUnitPriceFlag()) {
if (StringUtil.isExist(rowObj.get("unitPrice"))) {
BigDecimal unitPrice = rowObj.getBigDecimal("unitPrice");
MaterialExtend materialExtend = new MaterialExtend();
materialExtend.setId(meId);
if(BusinessConstants.SUB_TYPE_PURCHASE.equals(subType)) {
materialExtend.setPurchaseDecimal(unitPrice);
}
if(BusinessConstants.SUB_TYPE_SALES.equals(subType)) {
materialExtend.setWholesaleDecimal(unitPrice);
}
if(BusinessConstants.SUB_TYPE_RETAIL.equals(subType)) {
materialExtend.setCommodityDecimal(unitPrice);
}
materialExtendService.updateMaterialExtend(materialExtend);
}
if(BusinessConstants.SUB_TYPE_SALES.equals(subType)) {
materialExtend.setWholesaleDecimal(unitPrice);
}
if(BusinessConstants.SUB_TYPE_RETAIL.equals(subType)) {
materialExtend.setCommodityDecimal(unitPrice);
}
materialExtendService.updateMaterialExtend(materialExtend);
}
}

View File

@ -200,6 +200,23 @@ public class SystemConfigService {
return minusStockFlag;
}
/**
* 获取更新单价开关
* @return
* @throws Exception
*/
public boolean getUpdateUnitPriceFlag() throws Exception {
boolean updateUnitPriceFlag = true;
List<SystemConfig> list = getSystemConfig();
if(list.size()>0) {
String flag = list.get(0).getUpdateUnitPriceFlag();
if(("0").equals(flag)) {
updateUnitPriceFlag = false;
}
}
return updateUnitPriceFlag;
}
/**
* 获取强审核开关
* @return

View File

@ -17,6 +17,7 @@
<result column="multi_level_approval_flag" jdbcType="VARCHAR" property="multiLevelApprovalFlag" />
<result column="multi_bill_type" jdbcType="VARCHAR" property="multiBillType" />
<result column="force_approval_flag" jdbcType="VARCHAR" property="forceApprovalFlag" />
<result column="update_unit_price_flag" jdbcType="VARCHAR" property="updateUnitPriceFlag" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
@ -81,7 +82,8 @@
<sql id="Base_Column_List">
id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code,
sale_agreement, depot_flag, customer_flag, minus_stock_flag, purchase_by_sale_flag,
multi_level_approval_flag, multi_bill_type, force_approval_flag, tenant_id, delete_flag
multi_level_approval_flag, multi_bill_type, force_approval_flag, update_unit_price_flag,
tenant_id, delete_flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
select
@ -119,15 +121,15 @@
company_post_code, sale_agreement, depot_flag,
customer_flag, minus_stock_flag, purchase_by_sale_flag,
multi_level_approval_flag, multi_bill_type,
force_approval_flag, tenant_id, delete_flag
)
force_approval_flag, update_unit_price_flag,
tenant_id, delete_flag)
values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR},
#{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR},
#{companyPostCode,jdbcType=VARCHAR}, #{saleAgreement,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR},
#{customerFlag,jdbcType=VARCHAR}, #{minusStockFlag,jdbcType=VARCHAR}, #{purchaseBySaleFlag,jdbcType=VARCHAR},
#{multiLevelApprovalFlag,jdbcType=VARCHAR}, #{multiBillType,jdbcType=VARCHAR},
#{forceApprovalFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
#{forceApprovalFlag,jdbcType=VARCHAR}, #{updateUnitPriceFlag,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
insert into jsh_system_config
@ -177,6 +179,9 @@
<if test="forceApprovalFlag != null">
force_approval_flag,
</if>
<if test="updateUnitPriceFlag != null">
update_unit_price_flag,
</if>
<if test="tenantId != null">
tenant_id,
</if>
@ -230,6 +235,9 @@
<if test="forceApprovalFlag != null">
#{forceApprovalFlag,jdbcType=VARCHAR},
</if>
<if test="updateUnitPriceFlag != null">
#{updateUnitPriceFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
@ -292,6 +300,9 @@
<if test="record.forceApprovalFlag != null">
force_approval_flag = #{record.forceApprovalFlag,jdbcType=VARCHAR},
</if>
<if test="record.updateUnitPriceFlag != null">
update_unit_price_flag = #{record.updateUnitPriceFlag,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
@ -320,6 +331,7 @@
multi_level_approval_flag = #{record.multiLevelApprovalFlag,jdbcType=VARCHAR},
multi_bill_type = #{record.multiBillType,jdbcType=VARCHAR},
force_approval_flag = #{record.forceApprovalFlag,jdbcType=VARCHAR},
update_unit_price_flag = #{record.updateUnitPriceFlag,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
@ -371,6 +383,9 @@
<if test="forceApprovalFlag != null">
force_approval_flag = #{forceApprovalFlag,jdbcType=VARCHAR},
</if>
<if test="updateUnitPriceFlag != null">
update_unit_price_flag = #{updateUnitPriceFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
@ -396,6 +411,7 @@
multi_level_approval_flag = #{multiLevelApprovalFlag,jdbcType=VARCHAR},
multi_bill_type = #{multiBillType,jdbcType=VARCHAR},
force_approval_flag = #{forceApprovalFlag,jdbcType=VARCHAR},
update_unit_price_flag = #{updateUnitPriceFlag,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}