Commit 5482fb35 by 宋祥

1.委外入库质检回写入库和加工

parent a760876a
...@@ -70,6 +70,8 @@ public class HgKcSqlConst { ...@@ -70,6 +70,8 @@ public class HgKcSqlConst {
public static final String LOCK = "HGKC014A.lock"; public static final String LOCK = "HGKC014A.lock";
// 修改状态 // 修改状态
public static final String UPDATE_STATUS = "HGKC014A.updateStatus"; public static final String UPDATE_STATUS = "HGKC014A.updateStatus";
// 修改状态
public static final String UPDATE_STATUS_BY_PARENT = "HGKC014A.updateStatusByParent";
// 批量删除 // 批量删除
public static final String BATCH_DELETE = "HGKC014A.batchDelete"; public static final String BATCH_DELETE = "HGKC014A.batchDelete";
// 实际入库数量 // 实际入库数量
......
...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant; ...@@ -6,6 +6,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.constant.HgKcSqlConstant; import com.baosight.hggp.hg.kc.constant.HgKcSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC014; import com.baosight.hggp.hg.kc.domain.HGKC014;
import com.baosight.hggp.hg.kc.domain.HGKC014A; import com.baosight.hggp.hg.kc.domain.HGKC014A;
...@@ -13,8 +14,13 @@ import com.baosight.hggp.hg.kc.tools.HGKCTools; ...@@ -13,8 +14,13 @@ import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sc.domain.HGSC010A; import com.baosight.hggp.hg.sc.domain.HGSC010A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -23,7 +29,10 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -23,7 +29,10 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import java.util.*; import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -174,14 +183,16 @@ public class ServiceHGKC014 extends ServiceEPBase { ...@@ -174,14 +183,16 @@ public class ServiceHGKC014 extends ServiceEPBase {
List<HGKC014> resultMaps = MapUtils.toDaoEPBases(inInfo, HGKC014.class); List<HGKC014> resultMaps = MapUtils.toDaoEPBases(inInfo, HGKC014.class);
List<Long> ids = ObjectUtils.listEpKey(resultMaps, HGKC014.FIELD_ID); List<Long> ids = ObjectUtils.listEpKey(resultMaps, HGKC014.FIELD_ID);
List<HGKC014A> hgkc014AList = HGKCTools.HgKc014A.getByParentId(ids); List<HGKC014A> hgkc014AList = HGKCTools.HgKc014A.getByParentId(ids);
AssertUtils.isTrue(Objects.isNull(hgkc014AList), "请先添加入库明细"); AssertUtils.isTrue(Objects.isNull(hgkc014AList), "请先添加入库明细");
for (HGKC014 hgkc014: resultMaps) { for (HGKC014 hgkc014 : resultMaps) {
List<HGKC014A> hgkc14As = hgkc014AList.stream().filter(item -> item.getParentId().equals(hgkc014.getId())).collect(Collectors.toList()); List<HGKC014A> hgkc14As = hgkc014AList.stream()
AssertUtils.isTrue(hgkc14As.size()<= 0, "请先添加入库明细"); .filter(item -> item.getParentId().equals(hgkc014.getId())).collect(Collectors.toList());
AssertUtils.isTrue(hgkc14As.size() <= 0, "请先添加入库明细");
hgkc014.setStatus(CommonConstant.YesNo.YES_1); hgkc014.setStatus(HgKcConst.HgKc014.Status.S1);
DaoUtils.update(HgKcSqlConstant.HgKc014.UPDATE_STATUS, hgkc014); DaoUtils.update(HgKcSqlConstant.HgKc014.UPDATE_STATUS, hgkc014);
} // 更新明细状态
HGKCTools.HgKc014A.updateStatusByParent(hgkc014.getId(), HgKcConst.HgKc014.Status.S1);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(resultMaps.size()), I18nMessages.getText("label.update", "提交")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(resultMaps.size()), I18nMessages.getText("label.update", "提交")});
} catch (PlatException e) { } catch (PlatException e) {
......
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
UPDATED_NAME, <!-- 修改人名称 --> UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 --> UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 --> DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS,
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
WH_CODE, <!-- 公司编码 --> WH_CODE, <!-- 公司编码 -->
...@@ -185,7 +186,7 @@ ...@@ -185,7 +186,7 @@
PCS_ID PCS_ID
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #whCode#, #whName#, #parentId#, #contractCode#, #updatedTime#, #deleteFlag#, #status#, #companyCode#, #companyName#, #whCode#, #whName#, #parentId#, #contractCode#,
#depositCode#,#inventType#, #productCode#, #productName#, #specId#, #spec#, #unit#, #depositQty#, #depositUnitWeight#, #depositWeight#, #depositCode#,#inventType#, #productCode#, #productName#, #specId#, #spec#, #unit#, #depositQty#, #depositUnitWeight#, #depositWeight#,
#deliverQty#, #actualQty#, #pcsId#) #deliverQty#, #actualQty#, #pcsId#)
</insert> </insert>
...@@ -249,16 +250,24 @@ ...@@ -249,16 +250,24 @@
<include refid="idCondition"/> <include refid="idCondition"/>
</update> </update>
<!-- 修改状态 -->
<update id="updateStatusByParent">
UPDATE ${hggpSchema}.HGKC014A
SET
STATUS = #status#,
<include refid="SqlBase.updateRevise"/>
WHERE PARENT_ID = #parentId#
</update>
<!-- 实际入库数量 --> <!-- 实际入库数量 -->
<update id="updateActualQty"> <update id="updateActualQty">
UPDATE ${hggpSchema}.HGKC014A UPDATE ${hggpSchema}.HGKC014A
SET SET
STATUS = #status#, STATUS = #status#,
ACTUAL_QTY = #actualQty# ACTUAL_QTY = #actualQty#,
DELIVER_QTY = #deliverQty# DELIVER_QTY = #deliverQty#,
<include refid="SqlBase.updateRevise"/> <include refid="SqlBase.updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
</update> </update>
</sqlMap> </sqlMap>
...@@ -1608,6 +1608,22 @@ public class HGKCTools { ...@@ -1608,6 +1608,22 @@ public class HGKCTools {
} }
/** /**
* 修改状态
*
* @param parentId
* @param status
* @return
*/
public static void updateStatusByParent(Long parentId, Integer status) {
AssertUtils.isNull(parentId, "入库单ID不能为空");
AssertUtils.isNull(status, "状态不能为空");
Map paramMap = new HashMap();
paramMap.put(HGKC014A.FIELD_PARENT_ID, parentId);
paramMap.put(HGKC014A.FIELD_STATUS, status);
DaoBase.getInstance().update(HgKcSqlConst.HgKc014A.UPDATE_STATUS_BY_PARENT, paramMap);
}
/**
* 实际入库数量 * 实际入库数量
* *
* @param id * @param id
...@@ -1624,7 +1640,7 @@ public class HGKCTools { ...@@ -1624,7 +1640,7 @@ public class HGKCTools {
paramMap.put(HGKC014A.FIELD_STATUS, status); paramMap.put(HGKC014A.FIELD_STATUS, status);
paramMap.put(HGKC014A.FIELD_ACTUAL_QTY, actualQty); paramMap.put(HGKC014A.FIELD_ACTUAL_QTY, actualQty);
paramMap.put(HGKC014A.FIELD_DELIVER_QTY, deliverQty); paramMap.put(HGKC014A.FIELD_DELIVER_QTY, deliverQty);
DaoBase.getInstance().update(HgKcSqlConst.HgKc014A.UPDATE_STATUS, paramMap); DaoBase.getInstance().update(HgKcSqlConst.HgKc014A.UPDATE_ACTUAL_QTY, paramMap);
} }
/** /**
......
...@@ -82,4 +82,19 @@ public class HgScSqlConstant { ...@@ -82,4 +82,19 @@ public class HgScSqlConstant {
// 修改入库状态 // 修改入库状态
public static final String UPDATE_DEPOSIT_STATUS = "HGSC010.updateByDepositStatus"; public static final String UPDATE_DEPOSIT_STATUS = "HGSC010.updateByDepositStatus";
} }
/**
* HGSC010A 定义
*
* @author:songx
* @date:2024/10/8,11:17
*/
public static class HgSc010A {
// 锁
public static final String LOCK = "HGSC010A.lock";
// 更新退货
public static final String UPDATE_DELIVER = "HGSC010A.updateDeliver";
}
} }
...@@ -51,6 +51,7 @@ public class HGSC010A extends DaoEPBase { ...@@ -51,6 +51,7 @@ public class HGSC010A extends DaoEPBase {
public static final String FIELD_REMAINING_QTY = "remainingQty"; /* 剩余数量*/ public static final String FIELD_REMAINING_QTY = "remainingQty"; /* 剩余数量*/
public static final String FIELD_REMAINING_UNIT_WEIGHT = "remainingUnitWeight"; /* 剩余单量*/ public static final String FIELD_REMAINING_UNIT_WEIGHT = "remainingUnitWeight"; /* 剩余单量*/
public static final String FIELD_REMAINING_WEIGHT = "remainingWeight"; /* 剩余重量*/ public static final String FIELD_REMAINING_WEIGHT = "remainingWeight"; /* 剩余重量*/
public static final String FIELD_DELIVER_QTY = "deliverQty"; /* 退货数量*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
...@@ -77,6 +78,7 @@ public class HGSC010A extends DaoEPBase { ...@@ -77,6 +78,7 @@ public class HGSC010A extends DaoEPBase {
public static final String COL_DEPOSIT_WEIGHT = "DEPOSIT_WEIGHT"; /* 入库重量*/ public static final String COL_DEPOSIT_WEIGHT = "DEPOSIT_WEIGHT"; /* 入库重量*/
public static final String COL_REMAINING_QTY = "REMAINING_QTY"; /* 剩余数量*/ public static final String COL_REMAINING_QTY = "REMAINING_QTY"; /* 剩余数量*/
public static final String COL_REMAINING_WEIGHT = "REMAINING_WEIGHT"; /* 剩余重量*/ public static final String COL_REMAINING_WEIGHT = "REMAINING_WEIGHT"; /* 剩余重量*/
public static final String COL_DELIVER_WEIGHT = "DELIVER_WEIGHT"; /* 退货数量*/
public static final String QUERY = "HGSC010A.query"; public static final String QUERY = "HGSC010A.query";
public static final String COUNT = "HGSC010A.count"; public static final String COUNT = "HGSC010A.count";
...@@ -113,6 +115,7 @@ public class HGSC010A extends DaoEPBase { ...@@ -113,6 +115,7 @@ public class HGSC010A extends DaoEPBase {
private BigDecimal remainingQty = new BigDecimal("0"); /* 剩余数量*/ private BigDecimal remainingQty = new BigDecimal("0"); /* 剩余数量*/
private BigDecimal remainingUnitWeight = new BigDecimal("0"); /* 剩余单量*/ private BigDecimal remainingUnitWeight = new BigDecimal("0"); /* 剩余单量*/
private BigDecimal remainingWeight = new BigDecimal("0"); /* 剩余重量*/ private BigDecimal remainingWeight = new BigDecimal("0"); /* 剩余重量*/
private BigDecimal deliverQty = new BigDecimal("0"); /* 退货数量*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -263,8 +266,13 @@ public class HGSC010A extends DaoEPBase { ...@@ -263,8 +266,13 @@ public class HGSC010A extends DaoEPBase {
eiColumn.setFieldLength(17); eiColumn.setFieldLength(17);
eiColumn.setDescName("剩余重量"); eiColumn.setDescName("剩余重量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELIVER_QTY);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(17);
eiColumn.setDescName("退货数量");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -706,7 +714,15 @@ public class HGSC010A extends DaoEPBase { ...@@ -706,7 +714,15 @@ public class HGSC010A extends DaoEPBase {
public void setRemainingUnitWeight(BigDecimal remainingUnitWeight) { public void setRemainingUnitWeight(BigDecimal remainingUnitWeight) {
this.remainingUnitWeight = remainingUnitWeight; this.remainingUnitWeight = remainingUnitWeight;
} }
public BigDecimal getDeliverQty() {
return deliverQty;
}
public void setDeliverQty(BigDecimal deliverQty) {
this.deliverQty = deliverQty;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -744,6 +760,7 @@ public class HGSC010A extends DaoEPBase { ...@@ -744,6 +760,7 @@ public class HGSC010A extends DaoEPBase {
setRemainingQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_QTY)), remainingQty)); setRemainingQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_QTY)), remainingQty));
setRemainingUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_UNIT_WEIGHT)), remainingUnitWeight)); setRemainingUnitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_UNIT_WEIGHT)), remainingUnitWeight));
setRemainingWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_WEIGHT)), remainingWeight)); setRemainingWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_WEIGHT)), remainingWeight));
setDeliverQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DELIVER_QTY)), deliverQty));
} }
/** /**
...@@ -782,6 +799,7 @@ public class HGSC010A extends DaoEPBase { ...@@ -782,6 +799,7 @@ public class HGSC010A extends DaoEPBase {
map.put(FIELD_REMAINING_QTY, StringUtils.toString(remainingQty, eiMetadata.getMeta(FIELD_REMAINING_QTY))); map.put(FIELD_REMAINING_QTY, StringUtils.toString(remainingQty, eiMetadata.getMeta(FIELD_REMAINING_QTY)));
map.put(FIELD_REMAINING_UNIT_WEIGHT, StringUtils.toString(remainingUnitWeight, eiMetadata.getMeta(FIELD_REMAINING_UNIT_WEIGHT))); map.put(FIELD_REMAINING_UNIT_WEIGHT, StringUtils.toString(remainingUnitWeight, eiMetadata.getMeta(FIELD_REMAINING_UNIT_WEIGHT)));
map.put(FIELD_REMAINING_WEIGHT, StringUtils.toString(remainingWeight, eiMetadata.getMeta(FIELD_REMAINING_WEIGHT))); map.put(FIELD_REMAINING_WEIGHT, StringUtils.toString(remainingWeight, eiMetadata.getMeta(FIELD_REMAINING_WEIGHT)));
map.put(FIELD_DELIVER_QTY, StringUtils.toString(deliverQty, eiMetadata.getMeta(FIELD_DELIVER_QTY)));
return map; return map;
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-09-29 14:12:44
Version : 1.0
schema : hggp
tableName : HGSC010A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PARENT_ID BIGINT NOT NULL,
CONTRACT_CODE VARCHAR,
INVENT_TYPE TINYINT,
PRODUCT_CODE VARCHAR,
PRODUCT_NAME VARCHAR,
SPEC VARCHAR,
UNIT VARCHAR,
PCS_QTY DECIMAL,
PCS_WEIGHT DECIMAL,
DEPOSIT_QTY DECIMAL,
DEPOSIT_WEIGHT DECIMAL,
REMAINING_QTY DECIMAL,
REMAINING_WEIGHT DECIMAL
-->
<sqlMap namespace="HGSC010A"> <sqlMap namespace="HGSC010A">
<sql id="condition"> <sql id="column">
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PARENT_ID as "parentId", <!-- 委托ID -->
CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
PRODUCT_CODE as "productCode", <!-- 成品编码 -->
PRODUCT_NAME as "productName", <!-- 成品名称 -->
SPEC_ID as "specId",
SPEC as "spec", <!-- 规格 -->
UNIT as "unit", <!-- 单位 -->
PCS_QTY as "pcsQty", <!-- 加工数量 -->
PCS_UNIT_WEIGHT as "pcsUnitWeight",
PCS_WEIGHT as "pcsWeight", <!-- 加工重量 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
DEPOSIT_UNIT_WEIGHT as "depositUnitWeight", <!-- 入库单量 -->
DEPOSIT_WEIGHT as "depositWeight", <!-- 入库重量 -->
REMAINING_QTY as "remainingQty", <!-- 剩余数量 -->
REMAINING_UNIT_WEIGHT as "remainingUnitWeight", <!-- 剩余单量 -->
REMAINING_WEIGHT as "remainingWeight", <!-- 剩余重量 -->
DELIVER_QTY as "deliverQty" <!-- 退货数量 -->
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -128,133 +131,34 @@ ...@@ -128,133 +131,34 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="idCondition">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC010A"> <isNotEmpty prepend=" AND " property="id">
SELECT ID = #id#
ID as "id", <!-- ID --> </isNotEmpty>
ACCOUNT_CODE as "accountCode", <!-- 账套 --> <isNotEmpty prepend=" AND " property="ids">
DEP_CODE as "depCode", <!-- 部门编码 --> ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
CREATED_BY as "createdBy", <!-- 创建人 --> </isNotEmpty>
CREATED_NAME as "createdName", <!-- 创建人名称 --> </sql>
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PARENT_ID as "parentId", <!-- 委托ID -->
CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
PRODUCT_CODE as "productCode", <!-- 成品编码 -->
PRODUCT_NAME as "productName", <!-- 成品名称 -->
SPEC_ID as "specId",
SPEC as "spec", <!-- 规格 -->
UNIT as "unit", <!-- 单位 -->
PCS_QTY as "pcsQty", <!-- 加工数量 -->
PCS_UNIT_WEIGHT as "pcsUnitWeight",
PCS_WEIGHT as "pcsWeight", <!-- 加工重量 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
DEPOSIT_UNIT_WEIGHT as "depositUnitWeight", <!-- 入库单量 -->
DEPOSIT_WEIGHT as "depositWeight", <!-- 入库重量 -->
REMAINING_QTY as "remainingQty", <!-- 剩余数量 -->
REMAINING_UNIT_WEIGHT as "remainingUnitWeight", <!-- 剩余单量 -->
REMAINING_WEIGHT as "remainingWeight" <!-- 剩余重量 -->
FROM ${hggpSchema}.HGSC010A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select> <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC010A">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC010A WHERE 1=1
<include refid="condition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC010A WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGSC010A WHERE 1=1
<include refid="condition" /> <include refid="condition"/>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
CONTRACT_CODE = #contractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
PRODUCT_CODE = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
PRODUCT_NAME = #productName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pcsQty">
PCS_QTY = #pcsQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="pcsWeight">
PCS_WEIGHT = #pcsWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositQty">
DEPOSIT_QTY = #depositQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositWeight">
DEPOSIT_WEIGHT = #depositWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingQty">
REMAINING_QTY = #remainingQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="remainingWeight">
REMAINING_WEIGHT = #remainingWeight#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGSC010A (ID, <!-- ID --> INSERT INTO ${hggpSchema}.HGSC010A (ID, <!-- ID -->
...@@ -328,4 +232,26 @@ ...@@ -328,4 +232,26 @@
ID = #id# ID = #id#
</update> </update>
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGSC010A
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
<!-- 更新退货 -->
<update id="updateDeliver">
UPDATE ${hggpSchema}.HGSC010A
SET
DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
DEPOSIT_WEIGHT = #depositWeight#, <!-- 入库重量 -->
REMAINING_QTY = #remainingQty#, <!-- 剩余数量 -->
REMAINING_WEIGHT = #remainingWeight#, <!-- 剩余重量 -->
DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
<include refid="SqlBase.updateRevise"/>
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap> </sqlMap>
...@@ -17,7 +17,26 @@ import com.baosight.hggp.hg.pz.domain.HGPZ005; ...@@ -17,7 +17,26 @@ import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A; import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant; import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.*; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.domain.HGSC004B;
import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.domain.HGSC006;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC007B;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.domain.HGSC009;
import com.baosight.hggp.hg.sc.domain.HGSC009A;
import com.baosight.hggp.hg.sc.domain.HGSC010;
import com.baosight.hggp.hg.sc.domain.HGSC010A;
import com.baosight.hggp.hg.sc.domain.HGSC010B;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sc.util.HgScUtils;
import com.baosight.hggp.hg.sj.domain.HGSJ001; import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.tools.HGSJTools; import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.hg.zl.domain.HGZL002; import com.baosight.hggp.hg.zl.domain.HGZL002;
...@@ -35,7 +54,6 @@ import com.baosight.iplat4j.core.ProjectInfo; ...@@ -35,7 +54,6 @@ import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -1948,9 +1966,50 @@ public class HGSCTools { ...@@ -1948,9 +1966,50 @@ public class HGSCTools {
} }
} }
public static class Hgsc010a { /**
*
* @author:songx
* @date:2024/10/8,11:10
*/
public static class Hgsc010a {
/**
* 锁
*
* @param id
*/
public static void lock(Long id){
AssertUtils.isNull(id, "加工ID不能为空");
Map paramMap = new HashMap();
paramMap.put(HGSC010A.FIELD_ID, id);
DaoUtils.update(HgScSqlConstant.HgSc010A.LOCK, paramMap);
}
/**
* 更新退货
*
* @param id
* @param deliverQty
*/
public static void updateDeliver(Long id, BigDecimal deliverQty){
AssertUtils.isNull(id, "加工ID不能为空");
AssertUtils.isNull(deliverQty, "退货数量不能为空");
HGSC010A dbSc010A = HgScUtils.HgSc010A.lockAndGet(id);
Map paramMap = new HashMap();
paramMap.put(HGSC010A.FIELD_ID, id);
paramMap.put(HGSC010A.FIELD_DELIVER_QTY, dbSc010A.getDeliverQty().add(deliverQty));
// 剩余数量
BigDecimal remainingQty = dbSc010A.getRemainingQty().add(deliverQty);
paramMap.put(HGSC010A.FIELD_REMAINING_QTY, remainingQty);
paramMap.put(HGSC010A.FIELD_REMAINING_WEIGHT, remainingQty.multiply(dbSc010A.getRemainingUnitWeight()));
// 入库数量
BigDecimal depositQty = dbSc010A.getDepositQty().subtract(deliverQty);
paramMap.put(HGSC010A.FIELD_DEPOSIT_QTY, depositQty);
paramMap.put(HGSC010A.FIELD_DEPOSIT_WEIGHT, depositQty.multiply(dbSc010A.getDepositUnitWeight()));
DaoUtils.update(HgScSqlConstant.HgSc010A.UPDATE_DELIVER, paramMap);
}
public static HGSC010A getById(Long id){ public static HGSC010A getById(Long id){
AssertUtils.isTrue(Objects.isNull(id)||id<=0, "委托加工ID不能为空!"); AssertUtils.isTrue(Objects.isNull(id)||id<=0, "委托加工ID不能为空!");
return (HGSC010A) DaoBase.getInstance().get(HGSC010A.QUERY, HGSC010A.FIELD_ID, id); return (HGSC010A) DaoBase.getInstance().get(HGSC010A.QUERY, HGSC010A.FIELD_ID, id);
......
...@@ -7,10 +7,13 @@ import com.baosight.hggp.core.security.UserSessionUtils; ...@@ -7,10 +7,13 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant; import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC007; import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC007B; import com.baosight.hggp.hg.sc.domain.HGSC007B;
import com.baosight.hggp.hg.sc.domain.HGSC010A;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.HGXS007;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.BeanUtils; import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.xservices.xs.util.LoginUserDetails; import com.baosight.xservices.xs.util.LoginUserDetails;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -26,7 +29,6 @@ import java.util.stream.Collectors; ...@@ -26,7 +29,6 @@ import java.util.stream.Collectors;
public class HgScUtils { public class HgScUtils {
/** /**
*
* @author:songx * @author:songx
* @date:2024/8/22,16:17 * @date:2024/8/22,16:17
*/ */
...@@ -118,4 +120,23 @@ public class HgScUtils { ...@@ -118,4 +120,23 @@ public class HgScUtils {
} }
/**
* @author:songx
* @date:2024/8/22,16:17
*/
public static class HgSc010A {
/**
* 锁并获取数据
*
* @param id
* @return
*/
public static HGSC010A lockAndGet(Long id) {
// 锁
HGSCTools.Hgsc010a.lock(id);
// 查询数据
return HGSCTools.Hgsc010a.getById(id);
}
}
} }
...@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.kc.constant.HgKcConst; ...@@ -10,6 +10,7 @@ import com.baosight.hggp.hg.kc.constant.HgKcConst;
import com.baosight.hggp.hg.kc.domain.HGKC014A; import com.baosight.hggp.hg.kc.domain.HGKC014A;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils; import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.zl.constant.HgZlConst; import com.baosight.hggp.hg.zl.constant.HgZlConst;
import com.baosight.hggp.hg.zl.constant.HgZlSqlConst; import com.baosight.hggp.hg.zl.constant.HgZlSqlConst;
...@@ -252,6 +253,10 @@ public class ServiceHGZL012 extends ServiceBase { ...@@ -252,6 +253,10 @@ public class ServiceHGZL012 extends ServiceBase {
dbKc014A.getProductCode(), fZl012.getQualityQty(), fZl012.getApplyUnitWeight(), dbKc014A.getProductCode(), fZl012.getQualityQty(), fZl012.getApplyUnitWeight(),
qualityWeight); qualityWeight);
} }
// 不合格量大于0,更新委外加工
if (fZl012.getUnQualityQty().compareTo(BigDecimal.ZERO) > 0) {
HGSCTools.Hgsc010a.updateDeliver(dbKc014A.getPcsId(), fZl012.getUnQualityQty());
}
} }
/** /**
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC009.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC009.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC101.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC101.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC010.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC010.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC010A.xml"/>
<!-- 財務 --> <!-- 財務 -->
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/>
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="180" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="180" align="center"/>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/> <EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment