给系统参数表增加超出关联单据启用标记
This commit is contained in:
@@ -10,7 +10,7 @@ Target Server Type : MYSQL
|
||||
Target Server Version : 50704
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2023-03-21 22:20:03
|
||||
Date: 2023-05-10 23:21:02
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
@@ -854,6 +854,7 @@ CREATE TABLE `jsh_system_config` (
|
||||
`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启用',
|
||||
`over_link_bill_flag` varchar(1) DEFAULT '0' COMMENT '超出关联单据启用标记,0未启用,1启用',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
|
||||
`delete_flag` varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
|
||||
PRIMARY KEY (`id`)
|
||||
@@ -862,7 +863,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', '1', '63', '0');
|
||||
INSERT INTO `jsh_system_config` VALUES ('11', '公司test', '小李', '地址1', '12345678', null, null, '注:本单为我公司与客户约定账期内结款的依据,由客户或其单位员工签字生效,并承担法律责任。', '0', '0', '1', '0', '0', '', '0', '1', '0', '63', '0');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for jsh_tenant
|
||||
|
||||
@@ -1474,3 +1474,10 @@ insert into `jsh_function` (`number`, `name`, `parent_number`, `url`, `component
|
||||
-- 给系统参数表增加更新单价启用标记
|
||||
-- --------------------------------------------------------
|
||||
alter table jsh_system_config add update_unit_price_flag varchar(1) DEFAULT '1' COMMENT '更新单价启用标记,0未启用,1启用' after force_approval_flag;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
-- 时间 2023年05月10日
|
||||
-- by jishenghua
|
||||
-- 给系统参数表增加超出关联单据启用标记
|
||||
-- --------------------------------------------------------
|
||||
alter table jsh_system_config add over_link_bill_flag varchar(1) DEFAULT '0' COMMENT '超出关联单据启用标记,0未启用,1启用' after update_unit_price_flag;
|
||||
@@ -1,11 +1,6 @@
|
||||
package com.jsh.erp.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.Depot;
|
||||
import com.jsh.erp.datasource.entities.SystemConfig;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.service.depot.DepotService;
|
||||
import com.jsh.erp.service.systemConfig.SystemConfigService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
@@ -19,10 +14,12 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
@@ -33,6 +33,8 @@ public class SystemConfig {
|
||||
|
||||
private String updateUnitPriceFlag;
|
||||
|
||||
private String overLinkBillFlag;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private String deleteFlag;
|
||||
@@ -165,6 +167,14 @@ public class SystemConfig {
|
||||
this.updateUnitPriceFlag = updateUnitPriceFlag == null ? null : updateUnitPriceFlag.trim();
|
||||
}
|
||||
|
||||
public String getOverLinkBillFlag() {
|
||||
return overLinkBillFlag;
|
||||
}
|
||||
|
||||
public void setOverLinkBillFlag(String overLinkBillFlag) {
|
||||
this.overLinkBillFlag = overLinkBillFlag == null ? null : overLinkBillFlag.trim();
|
||||
}
|
||||
|
||||
public Long getTenantId() {
|
||||
return tenantId;
|
||||
}
|
||||
|
||||
@@ -1214,6 +1214,76 @@ public class SystemConfigExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagIsNull() {
|
||||
addCriterion("over_link_bill_flag is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagIsNotNull() {
|
||||
addCriterion("over_link_bill_flag is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagEqualTo(String value) {
|
||||
addCriterion("over_link_bill_flag =", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagNotEqualTo(String value) {
|
||||
addCriterion("over_link_bill_flag <>", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagGreaterThan(String value) {
|
||||
addCriterion("over_link_bill_flag >", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("over_link_bill_flag >=", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagLessThan(String value) {
|
||||
addCriterion("over_link_bill_flag <", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagLessThanOrEqualTo(String value) {
|
||||
addCriterion("over_link_bill_flag <=", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagLike(String value) {
|
||||
addCriterion("over_link_bill_flag like", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagNotLike(String value) {
|
||||
addCriterion("over_link_bill_flag not like", value, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagIn(List<String> values) {
|
||||
addCriterion("over_link_bill_flag in", values, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagNotIn(List<String> values) {
|
||||
addCriterion("over_link_bill_flag not in", values, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagBetween(String value1, String value2) {
|
||||
addCriterion("over_link_bill_flag between", value1, value2, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOverLinkBillFlagNotBetween(String value1, String value2) {
|
||||
addCriterion("over_link_bill_flag not between", value1, value2, "overLinkBillFlag");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTenantIdIsNull() {
|
||||
addCriterion("tenant_id is null");
|
||||
return (Criteria) this;
|
||||
|
||||
@@ -521,9 +521,11 @@ public class DepotItemService {
|
||||
BigDecimal preNumber = rowObj.getBigDecimal("preNumber");
|
||||
BigDecimal finishNumber = rowObj.getBigDecimal("finishNumber");
|
||||
if(depotItem.getOperNumber().add(finishNumber).compareTo(preNumber)>0) {
|
||||
if(!systemConfigService.getOverLinkBillFlag()) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode));
|
||||
}
|
||||
}
|
||||
} else if("update".equals(actionType)) {
|
||||
//当前单据的类型
|
||||
String currentSubType = depotHead.getSubType();
|
||||
@@ -535,11 +537,13 @@ public class DepotItemService {
|
||||
//除去此单据之外的已入库|已出库
|
||||
BigDecimal realFinishNumber = getRealFinishNumber(currentSubType, depotItem.getMaterialExtendId(), depotItem.getLinkId(), preHeaderId, headerId, unitInfo, unit);
|
||||
if(depotItem.getOperNumber().add(realFinishNumber).compareTo(preNumber)>0) {
|
||||
if(!systemConfigService.getOverLinkBillFlag()) {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtil.isExist(rowObj.get("unitPrice"))) {
|
||||
BigDecimal unitPrice = rowObj.getBigDecimal("unitPrice");
|
||||
depotItem.setUnitPrice(unitPrice);
|
||||
@@ -679,7 +683,7 @@ public class DepotItemService {
|
||||
if(materialAndSum.getOperNumber().compareTo(BigDecimal.ZERO) != 0) {
|
||||
BigDecimal materialSum = materialSumMap.get(materialAndSum.getMaterialExtendId());
|
||||
if (materialSum != null) {
|
||||
if (materialSum.compareTo(materialAndSum.getOperNumber()) != 0) {
|
||||
if (materialSum.compareTo(materialAndSum.getOperNumber()) < 0) {
|
||||
res = BusinessConstants.BILLS_STATUS_SKIPING;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -217,6 +217,23 @@ public class SystemConfigService {
|
||||
return updateUnitPriceFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取超出关联单据开关
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public boolean getOverLinkBillFlag() throws Exception {
|
||||
boolean overLinkBillFlag = false;
|
||||
List<SystemConfig> list = getSystemConfig();
|
||||
if(list.size()>0) {
|
||||
String flag = list.get(0).getOverLinkBillFlag();
|
||||
if(("1").equals(flag)) {
|
||||
overLinkBillFlag = true;
|
||||
}
|
||||
}
|
||||
return overLinkBillFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取强审核开关
|
||||
* @return
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<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="over_link_bill_flag" jdbcType="VARCHAR" property="overLinkBillFlag" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
<result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
|
||||
</resultMap>
|
||||
@@ -83,7 +84,7 @@
|
||||
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, update_unit_price_flag,
|
||||
tenant_id, delete_flag
|
||||
over_link_bill_flag, tenant_id, delete_flag
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -122,14 +123,16 @@
|
||||
customer_flag, minus_stock_flag, purchase_by_sale_flag,
|
||||
multi_level_approval_flag, multi_bill_type,
|
||||
force_approval_flag, update_unit_price_flag,
|
||||
tenant_id, delete_flag)
|
||||
over_link_bill_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}, #{updateUnitPriceFlag,jdbcType=VARCHAR},
|
||||
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
|
||||
#{overLinkBillFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
|
||||
insert into jsh_system_config
|
||||
@@ -182,6 +185,9 @@
|
||||
<if test="updateUnitPriceFlag != null">
|
||||
update_unit_price_flag,
|
||||
</if>
|
||||
<if test="overLinkBillFlag != null">
|
||||
over_link_bill_flag,
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
@@ -238,6 +244,9 @@
|
||||
<if test="updateUnitPriceFlag != null">
|
||||
#{updateUnitPriceFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="overLinkBillFlag != null">
|
||||
#{overLinkBillFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
#{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
@@ -303,6 +312,9 @@
|
||||
<if test="record.updateUnitPriceFlag != null">
|
||||
update_unit_price_flag = #{record.updateUnitPriceFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.overLinkBillFlag != null">
|
||||
over_link_bill_flag = #{record.overLinkBillFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.tenantId != null">
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
@@ -332,6 +344,7 @@
|
||||
multi_bill_type = #{record.multiBillType,jdbcType=VARCHAR},
|
||||
force_approval_flag = #{record.forceApprovalFlag,jdbcType=VARCHAR},
|
||||
update_unit_price_flag = #{record.updateUnitPriceFlag,jdbcType=VARCHAR},
|
||||
over_link_bill_flag = #{record.overLinkBillFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{record.tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
@@ -386,6 +399,9 @@
|
||||
<if test="updateUnitPriceFlag != null">
|
||||
update_unit_price_flag = #{updateUnitPriceFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="overLinkBillFlag != null">
|
||||
over_link_bill_flag = #{overLinkBillFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="tenantId != null">
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
</if>
|
||||
@@ -412,6 +428,7 @@
|
||||
multi_bill_type = #{multiBillType,jdbcType=VARCHAR},
|
||||
force_approval_flag = #{forceApprovalFlag,jdbcType=VARCHAR},
|
||||
update_unit_price_flag = #{updateUnitPriceFlag,jdbcType=VARCHAR},
|
||||
over_link_bill_flag = #{overLinkBillFlag,jdbcType=VARCHAR},
|
||||
tenant_id = #{tenantId,jdbcType=BIGINT},
|
||||
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
|
||||
Reference in New Issue
Block a user