Commit bd0f7c51 by 江和松

Merge remote-tracking branch 'origin/dev' into dev

parents be66b73e 1aff9cbe
package com.baosight.hggp.hg.kc.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/16
*/
public class HGKC012 extends HGKC010{
private static final long serialVersionUID = 1L;
public static final String FIELD_WARN_NUM = "warnNum"; /* 预警数量*/
public static final String FIELD_PRINC = "princ"; /* 负责人*/
public static final String COL_WARN_NUM = "WARN_NUM"; /* 预警数量*/
public static final String COL_PRINC = "PRINC"; /* 负责人*/
public static final String QUERY = "HGKC012.query";
private BigDecimal warnNum = new BigDecimal("0"); /* 预警数量*/
private String princ = " "; /* 负责人*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_WARN_NUM);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("预警数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRINC);
eiColumn.setDescName("负责人");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGKC012() {
super.initMetaData();
initMetaData();
}
/**
* get the warnNum - 预警数量.
* @return the warnNum
*/
public BigDecimal getWarnNum() {
return this.warnNum;
}
/**
* set the warnNum - 预警数量.
*
* @param warnNum - 预警数量
*/
public void setWarnNum(BigDecimal warnNum) {
this.warnNum = warnNum;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
/**
* get the princ - 负责人.
* @return the princ
*/
public String getPrinc() {
return this.princ;
}
/**
* set the princ - 负责人.
*
* @param princ - 负责人
*/
public void setPrinc(String princ) {
this.princ = princ;
}
@Override
public void fromMap(Map map) {
super.fromMap(map);
setWarnNum(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_WARN_NUM)), warnNum));
setPrinc(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRINC)), princ));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_WARN_NUM, StringUtils.toString(warnNum, eiMetadata.getMeta(FIELD_WARN_NUM)));
map.put(FIELD_PRINC, StringUtils.toString(princ, eiMetadata.getMeta(FIELD_PRINC)));
return map;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeEnum;
import com.baosight.hggp.hg.kc.domain.HGKC012;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/5/16
*/
public class ServiceHGKC012 extends ServiceEPBase {
// 指定存货类型
private static final Integer[] DEFAULT_INVENT_CODE = {InventTypeEnum.RAW.getCode(),
InventTypeEnum.CONSUMABLE.getCode()};
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo = super.query(inInfo, HGKC012.QUERY);
Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null,true);
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.INVENT_RECORD_BLOCK_ID,
DdynamicEnum.SPEC_NAME_BLOCK_ID,
DdynamicEnum.INVENT_TYPE_BLOCK_ID), queryMap);
inInfo.getBlock(EiConstant.resultBlock).setBlockMeta(new HGKC012().eiMetadata);
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
return super.query(inInfo,HGKC012.QUERY,new HGKC012());
}
}
<?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">
<sqlMap namespace="HGKC012">
<sql id="column">
A.ID as "id",
A.COMPANY_CODE as "companyCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 -->
A.CREATED_BY as "createdBy", <!-- 记录创建者 -->
A.CREATED_NAME as "createdName", <!-- 记录创建名称 -->
A.CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
A.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
A.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.WH_CODE as "whCode", <!-- 仓库编码 -->
A.WH_NAME as "whName", <!-- 仓库名称 -->
A.INVENT_TYPE as "inventType", <!-- 存货类型 -->
A.INVENT_CODE as "inventCode", <!-- 存货编码 -->
A.INVENT_NAME as "inventName", <!-- 存货名称 -->
A.SPEC_ID as "specId", <!-- 规格ID -->
A.SPEC as "spec", <!-- 规格 -->
A.MATERIAL as "material", <!-- 材质 -->
A.UNIT as "unit", <!-- 单位 -->
A.LENGTH as "length", <!-- 长度 -->
A.WIDTH as "width", <!-- 宽度 -->
A.THICK as "thick", <!-- 厚度 -->
A.INV_QTY as "invQty", <!-- 库存数量 -->
A.INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
A.INV_WEIGHT as "invWeight", <!-- 库存重量 -->
A.FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
A.FACTORY_NAME as "factoryName", <!-- 厂区名称 -->
B.WARN_NUM as warnNum, <!-- 预警值 -->
C.PRINC as "princ" <!-- 负责人 -->
</sql>
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
A.CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="specId">
A.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
A.WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
</sql>
<!--<sql id="customCondition">
<isNotEmpty prepend=" AND " property="inventTypes">
A.INVENT_TYPE IN <iterate close=")" open="(" conjunction="," property="inventTypes">#inventTypes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
<isEqual property="spec" compareValue="无规格">
A.SPEC_ID IN (SELECT ID FROM ${hggpSchema}.HGPZ006 WHERE SPEC = '')
</isEqual>
<isNotEqual property="spec" compareValue="无规格">
A.SPEC_ID IN (SELECT ID FROM ${hggpSchema}.HGPZ006 WHERE SPEC = #spec#)
</isNotEqual>
</isNotEmpty>
</sql>-->
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
A.CREATED_TIME DESC, A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.kc.domain.HGKC012">
SELECT <include refid="column"/>
FROM ${hggpSchema}.HGKC010 A
INNER JOIN ${hggpSchema}.HGPZ010 B ON A.SPEC_ID = B.INVENT_RECORD_ID
LEFT JOIN ${hggpSchema}.hgpz007 C ON A.WH_CODE = C.WH_CODE
WHERE A.INV_QTY &lt;= B.WARN_NUM
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="spec">
A.SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
A.SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
A.WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
A.WH_NAME LIKE '%' || #whName# || '%'
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
A.INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
A.INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
A.INVENT_NAME = #inventName#
</isNotEmpty>
<include refid="order"/>
</select>
</sqlMap>
\ No newline at end of file
...@@ -35,6 +35,7 @@ public class HGPZ005A extends DaoEPBase { ...@@ -35,6 +35,7 @@ public class HGPZ005A extends DaoEPBase {
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/ public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/ public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/ public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_INVENT_CODE = "inventCode"; /* 存货编码*/
public static final String FIELD_PROCESS_CODE = "processCode"; /* 工序编码*/ public static final String FIELD_PROCESS_CODE = "processCode"; /* 工序编码*/
public static final String FIELD_PROCESS_NAME = "processName"; /* 工序名称*/ public static final String FIELD_PROCESS_NAME = "processName"; /* 工序名称*/
public static final String FIELD_COMPOSING_COEFF = "composingCoeff"; /* 排产系数*/ public static final String FIELD_COMPOSING_COEFF = "composingCoeff"; /* 排产系数*/
...@@ -52,6 +53,7 @@ public class HGPZ005A extends DaoEPBase { ...@@ -52,6 +53,7 @@ public class HGPZ005A extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/ public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 存货编码*/
public static final String COL_PROCESS_CODE = "PROCESS_CODE"; /* 工序编码*/ public static final String COL_PROCESS_CODE = "PROCESS_CODE"; /* 工序编码*/
public static final String COL_PROCESS_NAME = "PROCESS_NAME"; /* 工序名称*/ public static final String COL_PROCESS_NAME = "PROCESS_NAME"; /* 工序名称*/
public static final String COL_COMPOSING_COEFF = "COMPOSING_COEFF"; /* 排产系数*/ public static final String COL_COMPOSING_COEFF = "COMPOSING_COEFF"; /* 排产系数*/
...@@ -78,6 +80,7 @@ public class HGPZ005A extends DaoEPBase { ...@@ -78,6 +80,7 @@ public class HGPZ005A extends DaoEPBase {
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/ private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private String companyCode = " "; /* 公司编码*/ private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/ private String companyName = " "; /* 公司名称*/
private String inventCode = " ";; /* 存货编码*/
private String processCode = " "; /* 工序编码*/ private String processCode = " "; /* 工序编码*/
private String processName = " "; /* 工序名称*/ private String processName = " "; /* 工序名称*/
private BigDecimal composingCoeff = new BigDecimal(0); /* 排产系数*/ private BigDecimal composingCoeff = new BigDecimal(0); /* 排产系数*/
...@@ -140,6 +143,10 @@ public class HGPZ005A extends DaoEPBase { ...@@ -140,6 +143,10 @@ public class HGPZ005A extends DaoEPBase {
eiColumn.setDescName("公司名称"); eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("存货编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROCESS_CODE); eiColumn = new EiColumn(FIELD_PROCESS_CODE);
eiColumn.setDescName("工序编码"); eiColumn.setDescName("工序编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -357,6 +364,14 @@ public class HGPZ005A extends DaoEPBase { ...@@ -357,6 +364,14 @@ public class HGPZ005A extends DaoEPBase {
this.companyName = companyName; this.companyName = companyName;
} }
public String getInventCode() {
return inventCode;
}
public void setInventCode(String inventCode) {
this.inventCode = inventCode;
}
/** /**
* get the processCode - 工序编码. * get the processCode - 工序编码.
* @return the processCode * @return the processCode
...@@ -473,6 +488,7 @@ public class HGPZ005A extends DaoEPBase { ...@@ -473,6 +488,7 @@ public class HGPZ005A extends DaoEPBase {
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode)); setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName)); setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setProcessCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROCESS_CODE)), processCode)); setProcessCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROCESS_CODE)), processCode));
setProcessName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROCESS_NAME)), processName)); setProcessName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROCESS_NAME)), processName));
setComposingCoeff(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COMPOSING_COEFF)), composingCoeff)); setComposingCoeff(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_COMPOSING_COEFF)), composingCoeff));
...@@ -500,6 +516,7 @@ public class HGPZ005A extends DaoEPBase { ...@@ -500,6 +516,7 @@ public class HGPZ005A extends DaoEPBase {
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG))); map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE))); map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME))); map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_PROCESS_CODE, StringUtils.toString(processCode, eiMetadata.getMeta(FIELD_PROCESS_CODE))); map.put(FIELD_PROCESS_CODE, StringUtils.toString(processCode, eiMetadata.getMeta(FIELD_PROCESS_CODE)));
map.put(FIELD_PROCESS_NAME, StringUtils.toString(processName, eiMetadata.getMeta(FIELD_PROCESS_NAME))); map.put(FIELD_PROCESS_NAME, StringUtils.toString(processName, eiMetadata.getMeta(FIELD_PROCESS_NAME)));
map.put(FIELD_COMPOSING_COEFF, StringUtils.toString(composingCoeff, eiMetadata.getMeta(FIELD_COMPOSING_COEFF))); map.put(FIELD_COMPOSING_COEFF, StringUtils.toString(composingCoeff, eiMetadata.getMeta(FIELD_COMPOSING_COEFF)));
......
...@@ -316,6 +316,7 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -316,6 +316,7 @@ public class ServiceHGPZ005 extends ServiceBase {
hgpz005A.setCompanyName(hgsj002.getFactoryName()); hgpz005A.setCompanyName(hgsj002.getFactoryName());
hgpz005A.setProcessCode(hgsj002a.getProcessCode()); hgpz005A.setProcessCode(hgsj002a.getProcessCode());
hgpz005A.setProcessName(hgsj002a.getProcessName()); hgpz005A.setProcessName(hgsj002a.getProcessName());
hgpz005A.setInventCode(hppz005.getInventCode());
hgpz005A.setUnitCoeff(BigDecimal.ONE); hgpz005A.setUnitCoeff(BigDecimal.ONE);
hgpz005A.setComposingCoeff(BigDecimal.ONE); hgpz005A.setComposingCoeff(BigDecimal.ONE);
hgpz005A.setParentId(hppz005.getId()); hgpz005A.setParentId(hppz005.getId());
......
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
<isNotEmpty prepend=" AND " property="companyName"> <isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME LIKE CONCAT('%', #companyName#, '%') COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode"> <isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode# PROCESS_CODE = #processCode#
</isNotEmpty> </isNotEmpty>
...@@ -95,6 +98,7 @@ ...@@ -95,6 +98,7 @@
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 --> DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 --> COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 --> COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
PROCESS_CODE as "processCode", <!-- 工序编码 --> PROCESS_CODE as "processCode", <!-- 工序编码 -->
PROCESS_NAME as "processName", <!-- 工序名称 --> PROCESS_NAME as "processName", <!-- 工序名称 -->
COMPOSING_COEFF as "composingCoeff", <!-- 排产系数 --> COMPOSING_COEFF as "composingCoeff", <!-- 排产系数 -->
...@@ -183,6 +187,7 @@ ...@@ -183,6 +187,7 @@
DELETE_FLAG, <!-- 是否删除0.否1.是 --> DELETE_FLAG, <!-- 是否删除0.否1.是 -->
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
INVENT_CODE,
PROCESS_CODE, <!-- 工序编码 --> PROCESS_CODE, <!-- 工序编码 -->
PROCESS_NAME, <!-- 工序名称 --> PROCESS_NAME, <!-- 工序名称 -->
COMPOSING_COEFF, <!-- 排产系数 --> COMPOSING_COEFF, <!-- 排产系数 -->
...@@ -190,7 +195,7 @@ ...@@ -190,7 +195,7 @@
PROCESS_CLASS, <!-- 工序类别 --> PROCESS_CLASS, <!-- 工序类别 -->
PARENT_ID <!-- 上级ID --> PARENT_ID <!-- 上级ID -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #processCode#, #processName#, #composingCoeff#, #unitCoeff#, #processClass#, #parentId#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #inventCode#, #processCode#, #processName#, #composingCoeff#, #unitCoeff#, #processClass#, #parentId#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -216,6 +221,7 @@ ...@@ -216,6 +221,7 @@
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 --> DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 --> COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 --> COMPANY_NAME = #companyName#, <!-- 公司名称 -->
INVENT_CODE = #inventCode#,
PROCESS_CODE = #processCode#, <!-- 工序编码 --> PROCESS_CODE = #processCode#, <!-- 工序编码 -->
PROCESS_NAME = #processName#, <!-- 工序名称 --> PROCESS_NAME = #processName#, <!-- 工序名称 -->
COMPOSING_COEFF = #composingCoeff#, <!-- 排产系数 --> COMPOSING_COEFF = #composingCoeff#, <!-- 排产系数 -->
......
...@@ -6,10 +6,9 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -6,10 +6,9 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.ValidFlagEnum; import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ004; import com.baosight.hggp.hg.pz.domain.*;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.pz.domain.HGPZ007; import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.sj.domain.HGSJ003; import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
import com.baosight.iplat4j.common.ed.domain.TEDCM01; import com.baosight.iplat4j.common.ed.domain.TEDCM01;
...@@ -391,4 +390,21 @@ public class HGPZTools { ...@@ -391,4 +390,21 @@ public class HGPZTools {
} }
} }
} }
public static class HgPz005A{
/**
* 通过存货编码查询存货工序*
* @param inventCode
* @return
*/
public static List<HGPZ005A> queryByInventCode(String inventCode){
AssertUtils.isEmpty(inventCode, "存货编码不能为空!");
Map paramMap = new HashMap();
paramMap.put(HGPZ005A.FIELD_INVENT_CODE, inventCode);
List<HGPZ005A> results = DaoBase.getInstance().query(HGPZ005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
}
} }
...@@ -89,7 +89,7 @@ public class HGSC005 extends DaoEPBase { ...@@ -89,7 +89,7 @@ public class HGSC005 extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/ private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private List<HGSC005A> hgsc005AList; // private List<HGSC005A> hgsc005AList;
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -482,13 +482,13 @@ public class HGSC005 extends DaoEPBase { ...@@ -482,13 +482,13 @@ public class HGSC005 extends DaoEPBase {
this.updatedTime = updatedTime; this.updatedTime = updatedTime;
} }
public List<HGSC005A> getHgsc005AList() { // public List<HGSC005A> getHgsc005AList() {
return hgsc005AList; // return hgsc005AList;
} // }
//
public void setHgsc005AList(List<HGSC005A> hgsc005AList) { // public void setHgsc005AList(List<HGSC005A> hgsc005AList) {
this.hgsc005AList = hgsc005AList; // this.hgsc005AList = hgsc005AList;
} // }
/** /**
* get the value from Map. * get the value from Map.
......
package com.baosight.hggp.hg.sc.domain; package com.baosight.hggp.hg.sc.domain;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn; import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
...@@ -16,15 +15,19 @@ import com.baosight.iplat4j.core.util.StringUtils; ...@@ -16,15 +15,19 @@ import com.baosight.iplat4j.core.util.StringUtils;
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br> * Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
* *
* @version 1.0 * @version 1.0
* @history 2024-05-16 16:50:12 create * @history 2024-05-17 17:03:29 create
*/ */
public class HGSC005A extends DaoEPBase { public class HGSC005A extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_id = "id"; public static final String FIELD_id = "id";
public static final String FIELD_mat_id = "matId"; /* 物料清单ID*/
public static final String FIELD_mat_detail_id = "matDetailId"; /* 物料清单明细ID*/ public static final String FIELD_mat_detail_id = "matDetailId"; /* 物料清单明细ID*/
public static final String FIELD_tech_flow_id = "techFlowId"; /* 工艺流程ID*/ public static final String FIELD_tech_flow_id = "techFlowId"; /* 工艺流程ID*/
public static final String FIELD_tech_flow_name = "techFlowName"; /* 工艺流程名称*/
public static final String FIELD_invent_process_id = "inventProcessId"; /* 存货工序ID,对应HGPZ005A.id*/
public static final String FIELD_process_name = "processName"; /* 工序名称*/
public static final String FIELD_company_code = "companyCode"; /* 公司编码*/ public static final String FIELD_company_code = "companyCode"; /* 公司编码*/
public static final String FIELD_company_name = "companyName"; /* 公司名称*/ public static final String FIELD_company_name = "companyName"; /* 公司名称*/
public static final String FIELD_dep_code = "depCode"; /* 部门编码*/ public static final String FIELD_dep_code = "depCode"; /* 部门编码*/
...@@ -32,6 +35,7 @@ public class HGSC005A extends DaoEPBase { ...@@ -32,6 +35,7 @@ public class HGSC005A extends DaoEPBase {
public static final String FIELD_proj_code = "projCode"; /* 项目编码*/ public static final String FIELD_proj_code = "projCode"; /* 项目编码*/
public static final String FIELD_proj_name = "projName"; /* 项目名称*/ public static final String FIELD_proj_name = "projName"; /* 项目名称*/
public static final String FIELD_plan_code = "planCode"; /* 计划编码*/ public static final String FIELD_plan_code = "planCode"; /* 计划编码*/
public static final String FIELD_product_type = "productType"; /* 产品类型*/
public static final String FIELD_product_code = "productCode"; /* 产品编号*/ public static final String FIELD_product_code = "productCode"; /* 产品编号*/
public static final String FIELD_product_name = "productName"; /* 产品名称*/ public static final String FIELD_product_name = "productName"; /* 产品名称*/
public static final String FIELD_finish_date = "finishDate"; /* 完工日期*/ public static final String FIELD_finish_date = "finishDate"; /* 完工日期*/
...@@ -49,8 +53,12 @@ public class HGSC005A extends DaoEPBase { ...@@ -49,8 +53,12 @@ public class HGSC005A extends DaoEPBase {
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/ public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String COL_id = "id"; public static final String COL_id = "id";
public static final String COL_mat_id = "mat_id"; /* 物料清单ID*/
public static final String COL_mat_detail_id = "mat_detail_id"; /* 物料清单明细ID*/ public static final String COL_mat_detail_id = "mat_detail_id"; /* 物料清单明细ID*/
public static final String COL_tech_flow_id = "tech_flow_id"; /* 工艺流程ID*/ public static final String COL_tech_flow_id = "tech_flow_id"; /* 工艺流程ID*/
public static final String COL_tech_flow_name = "tech_flow_name"; /* 工艺流程名称*/
public static final String COL_invent_process_id = "invent_process_id"; /* 存货工序ID,对应HGPZ005A.id*/
public static final String COL_process_name = "process_name"; /* 工序名称*/
public static final String COL_company_code = "company_code"; /* 公司编码*/ public static final String COL_company_code = "company_code"; /* 公司编码*/
public static final String COL_company_name = "company_name"; /* 公司名称*/ public static final String COL_company_name = "company_name"; /* 公司名称*/
public static final String COL_dep_code = "dep_code"; /* 部门编码*/ public static final String COL_dep_code = "dep_code"; /* 部门编码*/
...@@ -58,6 +66,7 @@ public class HGSC005A extends DaoEPBase { ...@@ -58,6 +66,7 @@ public class HGSC005A extends DaoEPBase {
public static final String COL_proj_code = "proj_code"; /* 项目编码*/ public static final String COL_proj_code = "proj_code"; /* 项目编码*/
public static final String COL_proj_name = "proj_name"; /* 项目名称*/ public static final String COL_proj_name = "proj_name"; /* 项目名称*/
public static final String COL_plan_code = "plan_code"; /* 计划编码*/ public static final String COL_plan_code = "plan_code"; /* 计划编码*/
public static final String COL_product_type = "product_type"; /* 产品类型*/
public static final String COL_product_code = "product_code"; /* 产品编号*/ public static final String COL_product_code = "product_code"; /* 产品编号*/
public static final String COL_product_name = "product_name"; /* 产品名称*/ public static final String COL_product_name = "product_name"; /* 产品名称*/
public static final String COL_finish_date = "finish_date"; /* 完工日期*/ public static final String COL_finish_date = "finish_date"; /* 完工日期*/
...@@ -79,12 +88,14 @@ public class HGSC005A extends DaoEPBase { ...@@ -79,12 +88,14 @@ public class HGSC005A extends DaoEPBase {
public static final String INSERT = "HGSC005A.insert"; public static final String INSERT = "HGSC005A.insert";
public static final String UPDATE = "HGSC005A.update"; public static final String UPDATE = "HGSC005A.update";
public static final String DELETE = "HGSC005A.delete"; public static final String DELETE = "HGSC005A.delete";
public static final String DELETE_BY_MAT_DETAIL_ID = "HGSC005A.deleteByMatDetailId";
private Long id = new Long(0); private Long id = new Long(0);
private Long matId = new Long(0); /* 物料清单ID*/
private Long matDetailId = new Long(0); /* 物料清单明细ID*/ private Long matDetailId = new Long(0); /* 物料清单明细ID*/
private Long techFlowId = new Long(0); /* 工艺流程ID*/ private Long techFlowId = new Long(0); /* 工艺流程ID*/
private Long techFlowName = new Long(0); /* 工艺流程名称*/
private Long inventProcessId = new Long(0); /* 存货工序ID,对应HGPZ005A.id*/
private Long processName = new Long(0); /* 工序名称*/
private String companyCode = " "; /* 公司编码*/ private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/ private String companyName = " "; /* 公司名称*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
...@@ -92,6 +103,7 @@ public class HGSC005A extends DaoEPBase { ...@@ -92,6 +103,7 @@ public class HGSC005A extends DaoEPBase {
private String projCode = " "; /* 项目编码*/ private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String planCode = " "; /* 计划编码*/ private String planCode = " "; /* 计划编码*/
private Integer productType = new Integer(0); /* 产品类型*/
private String productCode = " "; /* 产品编号*/ private String productCode = " "; /* 产品编号*/
private String productName = " "; /* 产品名称*/ private String productName = " "; /* 产品名称*/
private String finishDate = " "; /* 完工日期*/ private String finishDate = " "; /* 完工日期*/
...@@ -119,6 +131,10 @@ public class HGSC005A extends DaoEPBase { ...@@ -119,6 +131,10 @@ public class HGSC005A extends DaoEPBase {
eiColumn.setDescName(" "); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_mat_id);
eiColumn.setDescName("物料清单ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_mat_detail_id); eiColumn = new EiColumn(FIELD_mat_detail_id);
eiColumn.setDescName("物料清单明细ID"); eiColumn.setDescName("物料清单明细ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -127,6 +143,18 @@ public class HGSC005A extends DaoEPBase { ...@@ -127,6 +143,18 @@ public class HGSC005A extends DaoEPBase {
eiColumn.setDescName("工艺流程ID"); eiColumn.setDescName("工艺流程ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_tech_flow_name);
eiColumn.setDescName("工艺流程名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_invent_process_id);
eiColumn.setDescName("存货工序ID,对应HGPZ005A.id");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_process_name);
eiColumn.setDescName("工序名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_company_code); eiColumn = new EiColumn(FIELD_company_code);
eiColumn.setDescName("公司编码"); eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -155,6 +183,10 @@ public class HGSC005A extends DaoEPBase { ...@@ -155,6 +183,10 @@ public class HGSC005A extends DaoEPBase {
eiColumn.setDescName("计划编码"); eiColumn.setDescName("计划编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_type);
eiColumn.setDescName("产品类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_product_code); eiColumn = new EiColumn(FIELD_product_code);
eiColumn.setDescName("产品编号"); eiColumn.setDescName("产品编号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -242,6 +274,22 @@ public class HGSC005A extends DaoEPBase { ...@@ -242,6 +274,22 @@ public class HGSC005A extends DaoEPBase {
this.id = id; this.id = id;
} }
/** /**
* get the matId - 物料清单ID.
* @return the matId
*/
public Long getMatId() {
return this.matId;
}
/**
* set the matId - 物料清单ID.
*
* @param matId - 物料清单ID
*/
public void setMatId(Long matId) {
this.matId = matId;
}
/**
* get the matDetailId - 物料清单明细ID. * get the matDetailId - 物料清单明细ID.
* @return the matDetailId * @return the matDetailId
*/ */
...@@ -274,6 +322,54 @@ public class HGSC005A extends DaoEPBase { ...@@ -274,6 +322,54 @@ public class HGSC005A extends DaoEPBase {
this.techFlowId = techFlowId; this.techFlowId = techFlowId;
} }
/** /**
* get the techFlowName - 工艺流程名称.
* @return the techFlowName
*/
public Long getTechFlowName() {
return this.techFlowName;
}
/**
* set the techFlowName - 工艺流程名称.
*
* @param techFlowName - 工艺流程名称
*/
public void setTechFlowName(Long techFlowName) {
this.techFlowName = techFlowName;
}
/**
* get the inventProcessId - 存货工序ID,对应HGPZ005A.id.
* @return the inventProcessId
*/
public Long getInventProcessId() {
return this.inventProcessId;
}
/**
* set the inventProcessId - 存货工序ID,对应HGPZ005A.id.
*
* @param inventProcessId - 存货工序ID,对应HGPZ005A.id
*/
public void setInventProcessId(Long inventProcessId) {
this.inventProcessId = inventProcessId;
}
/**
* get the processName - 工序名称.
* @return the processName
*/
public Long getProcessName() {
return this.processName;
}
/**
* set the processName - 工序名称.
*
* @param processName - 工序名称
*/
public void setProcessName(Long processName) {
this.processName = processName;
}
/**
* get the companyCode - 公司编码. * get the companyCode - 公司编码.
* @return the companyCode * @return the companyCode
*/ */
...@@ -386,6 +482,22 @@ public class HGSC005A extends DaoEPBase { ...@@ -386,6 +482,22 @@ public class HGSC005A extends DaoEPBase {
this.planCode = planCode; this.planCode = planCode;
} }
/** /**
* get the productType - 产品类型.
* @return the productType
*/
public Integer getProductType() {
return this.productType;
}
/**
* set the productType - 产品类型.
*
* @param productType - 产品类型
*/
public void setProductType(Integer productType) {
this.productType = productType;
}
/**
* get the productCode - 产品编号. * get the productCode - 产品编号.
* @return the productCode * @return the productCode
*/ */
...@@ -634,8 +746,12 @@ public class HGSC005A extends DaoEPBase { ...@@ -634,8 +746,12 @@ public class HGSC005A extends DaoEPBase {
public void fromMap(Map map) { public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_id)), id));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_mat_id)), matId));
setMatDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_mat_detail_id)), matDetailId)); setMatDetailId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_mat_detail_id)), matDetailId));
setTechFlowId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_tech_flow_id)), techFlowId)); setTechFlowId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_tech_flow_id)), techFlowId));
setTechFlowName(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_tech_flow_name)), techFlowName));
setInventProcessId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_invent_process_id)), inventProcessId));
setProcessName(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_process_name)), processName));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_code)), companyCode)); setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_code)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_name)), companyName)); setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_company_name)), companyName));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_dep_code)), depCode));
...@@ -643,6 +759,7 @@ public class HGSC005A extends DaoEPBase { ...@@ -643,6 +759,7 @@ public class HGSC005A extends DaoEPBase {
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode)); setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_code)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_proj_name)), projName));
setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_plan_code)), planCode)); setPlanCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_plan_code)), planCode));
setProductType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_product_type)), productType));
setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode)); setProductCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_code)), productCode));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName)); setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_product_name)), productName));
setFinishDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_finish_date)), finishDate)); setFinishDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_finish_date)), finishDate));
...@@ -668,8 +785,12 @@ public class HGSC005A extends DaoEPBase { ...@@ -668,8 +785,12 @@ public class HGSC005A extends DaoEPBase {
Map map = new HashMap(); Map map = new HashMap();
map.put(FIELD_id, StringUtils.toString(id, eiMetadata.getMeta(FIELD_id))); map.put(FIELD_id, StringUtils.toString(id, eiMetadata.getMeta(FIELD_id)));
map.put(FIELD_mat_id, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_mat_id)));
map.put(FIELD_mat_detail_id, StringUtils.toString(matDetailId, eiMetadata.getMeta(FIELD_mat_detail_id))); map.put(FIELD_mat_detail_id, StringUtils.toString(matDetailId, eiMetadata.getMeta(FIELD_mat_detail_id)));
map.put(FIELD_tech_flow_id, StringUtils.toString(techFlowId, eiMetadata.getMeta(FIELD_tech_flow_id))); map.put(FIELD_tech_flow_id, StringUtils.toString(techFlowId, eiMetadata.getMeta(FIELD_tech_flow_id)));
map.put(FIELD_tech_flow_name, StringUtils.toString(techFlowName, eiMetadata.getMeta(FIELD_tech_flow_name)));
map.put(FIELD_invent_process_id, StringUtils.toString(inventProcessId, eiMetadata.getMeta(FIELD_invent_process_id)));
map.put(FIELD_process_name, StringUtils.toString(processName, eiMetadata.getMeta(FIELD_process_name)));
map.put(FIELD_company_code, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_company_code))); map.put(FIELD_company_code, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_company_code)));
map.put(FIELD_company_name, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_company_name))); map.put(FIELD_company_name, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_company_name)));
map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code))); map.put(FIELD_dep_code, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_dep_code)));
...@@ -677,6 +798,7 @@ public class HGSC005A extends DaoEPBase { ...@@ -677,6 +798,7 @@ public class HGSC005A extends DaoEPBase {
map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code))); map.put(FIELD_proj_code, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_proj_code)));
map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name))); map.put(FIELD_proj_name, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_proj_name)));
map.put(FIELD_plan_code, StringUtils.toString(planCode, eiMetadata.getMeta(FIELD_plan_code))); map.put(FIELD_plan_code, StringUtils.toString(planCode, eiMetadata.getMeta(FIELD_plan_code)));
map.put(FIELD_product_type, StringUtils.toString(productType, eiMetadata.getMeta(FIELD_product_type)));
map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code))); map.put(FIELD_product_code, StringUtils.toString(productCode, eiMetadata.getMeta(FIELD_product_code)));
map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name))); map.put(FIELD_product_name, StringUtils.toString(productName, eiMetadata.getMeta(FIELD_product_name)));
map.put(FIELD_finish_date, StringUtils.toString(finishDate, eiMetadata.getMeta(FIELD_finish_date))); map.put(FIELD_finish_date, StringUtils.toString(finishDate, eiMetadata.getMeta(FIELD_finish_date)));
......
<?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.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-16 19:32:42 Generate time : 2024-05-17 17:03:29
Version : 1.0 Version : 1.0
schema : hggp schema : hggp
tableName : HGSC005A tableName : HGSC005A
id BIGINT NOT NULL primarykey, id BIGINT NOT NULL primarykey,
mat_id BIGINT NOT NULL,
mat_detail_id BIGINT NOT NULL, mat_detail_id BIGINT NOT NULL,
tech_flow_id BIGINT, tech_flow_id BIGINT,
tech_flow_name BIGINT,
invent_process_id BIGINT,
process_name BIGINT,
company_code VARCHAR NOT NULL, company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL, company_name VARCHAR NOT NULL,
dep_code VARCHAR, dep_code VARCHAR,
...@@ -14,6 +18,7 @@ ...@@ -14,6 +18,7 @@
proj_code VARCHAR, proj_code VARCHAR,
proj_name VARCHAR, proj_name VARCHAR,
plan_code VARCHAR, plan_code VARCHAR,
product_type TINYINT,
product_code VARCHAR, product_code VARCHAR,
product_name VARCHAR, product_name VARCHAR,
finish_date VARCHAR, finish_date VARCHAR,
...@@ -36,12 +41,24 @@ ...@@ -36,12 +41,24 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matDetailId"> <isNotEmpty prepend=" AND " property="matDetailId">
mat_detail_id = #matDetailId# mat_detail_id = #matDetailId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowId"> <isNotEmpty prepend=" AND " property="techFlowId">
tech_flow_id = #techFlowId# tech_flow_id = #techFlowId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowName">
tech_flow_name = #techFlowName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventProcessId">
invent_process_id = #inventProcessId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode# company_code = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -63,6 +80,9 @@ ...@@ -63,6 +80,9 @@
<isNotEmpty prepend=" AND " property="planCode"> <isNotEmpty prepend=" AND " property="planCode">
plan_code = #planCode# plan_code = #planCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode"> <isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode# product_code = #productCode#
</isNotEmpty> </isNotEmpty>
...@@ -114,8 +134,12 @@ ...@@ -114,8 +134,12 @@
resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A"> resultClass="com.baosight.hggp.hg.sc.domain.HGSC005A">
SELECT SELECT
id as "id", id as "id",
mat_id as "matId", <!-- 物料清单ID -->
mat_detail_id as "matDetailId", <!-- 物料清单明细ID --> mat_detail_id as "matDetailId", <!-- 物料清单明细ID -->
tech_flow_id as "techFlowId", <!-- 工艺流程ID --> tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
process_name as "processName", <!-- 工序名称 -->
company_code as "companyCode", <!-- 公司编码 --> company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 --> company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 --> dep_code as "depCode", <!-- 部门编码 -->
...@@ -123,6 +147,7 @@ ...@@ -123,6 +147,7 @@
proj_code as "projCode", <!-- 项目编码 --> proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 --> proj_name as "projName", <!-- 项目名称 -->
plan_code as "planCode", <!-- 计划编码 --> plan_code as "planCode", <!-- 计划编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 --> product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 --> product_name as "productName", <!-- 产品名称 -->
finish_date as "finishDate", <!-- 完工日期 --> finish_date as "finishDate", <!-- 完工日期 -->
...@@ -160,12 +185,24 @@ ...@@ -160,12 +185,24 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matDetailId"> <isNotEmpty prepend=" AND " property="matDetailId">
mat_detail_id = #matDetailId# mat_detail_id = #matDetailId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowId"> <isNotEmpty prepend=" AND " property="techFlowId">
tech_flow_id = #techFlowId# tech_flow_id = #techFlowId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowName">
tech_flow_name = #techFlowName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventProcessId">
invent_process_id = #inventProcessId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode# company_code = #companyCode#
</isNotEmpty> </isNotEmpty>
...@@ -187,6 +224,9 @@ ...@@ -187,6 +224,9 @@
<isNotEmpty prepend=" AND " property="planCode"> <isNotEmpty prepend=" AND " property="planCode">
plan_code = #planCode# plan_code = #planCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode"> <isNotEmpty prepend=" AND " property="productCode">
product_code = #productCode# product_code = #productCode#
</isNotEmpty> </isNotEmpty>
...@@ -236,8 +276,12 @@ ...@@ -236,8 +276,12 @@
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGSC005A (id, INSERT INTO ${hggpSchema}.HGSC005A (id,
mat_id, <!-- 物料清单ID -->
mat_detail_id, <!-- 物料清单明细ID --> mat_detail_id, <!-- 物料清单明细ID -->
tech_flow_id, <!-- 工艺流程ID --> tech_flow_id, <!-- 工艺流程ID -->
tech_flow_name, <!-- 工艺流程名称 -->
invent_process_id, <!-- 存货工序ID,对应HGPZ005A.id -->
process_name, <!-- 工序名称 -->
company_code, <!-- 公司编码 --> company_code, <!-- 公司编码 -->
company_name, <!-- 公司名称 --> company_name, <!-- 公司名称 -->
dep_code, <!-- 部门编码 --> dep_code, <!-- 部门编码 -->
...@@ -245,6 +289,7 @@ ...@@ -245,6 +289,7 @@
proj_code, <!-- 项目编码 --> proj_code, <!-- 项目编码 -->
proj_name, <!-- 项目名称 --> proj_name, <!-- 项目名称 -->
plan_code, <!-- 计划编码 --> plan_code, <!-- 计划编码 -->
product_type, <!-- 产品类型 -->
product_code, <!-- 产品编号 --> product_code, <!-- 产品编号 -->
product_name, <!-- 产品名称 --> product_name, <!-- 产品名称 -->
finish_date, <!-- 完工日期 --> finish_date, <!-- 完工日期 -->
...@@ -261,7 +306,7 @@ ...@@ -261,7 +306,7 @@
updated_name, <!-- 修改人名称 --> updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 --> updated_time <!-- 更新时间 -->
) )
VALUES (#id#, #matDetailId#, #techFlowId#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #planCode#, #productCode#, #productName#, #finishDate#, #planStartDate#, #planEndDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#) VALUES (#id#, #matId#, #matDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processName#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #planCode#, #productType#, #productCode#, #productName#, #finishDate#, #planStartDate#, #planEndDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -269,16 +314,15 @@ ...@@ -269,16 +314,15 @@
id = #id# id = #id#
</delete> </delete>
<delete id="deleteByMatDetailId">
DELETE FROM ${hggpSchema}.HGSC005A WHERE
mat_detail_id = #matDetailId#
</delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGSC005A UPDATE ${hggpSchema}.HGSC005A
SET SET
mat_id = #matId#, <!-- 物料清单ID -->
mat_detail_id = #matDetailId#, <!-- 物料清单明细ID --> mat_detail_id = #matDetailId#, <!-- 物料清单明细ID -->
tech_flow_id = #techFlowId#, <!-- 工艺流程ID --> tech_flow_id = #techFlowId#, <!-- 工艺流程ID -->
tech_flow_name = #techFlowName#, <!-- 工艺流程名称 -->
invent_process_id = #inventProcessId#, <!-- 存货工序ID,对应HGPZ005A.id -->
process_name = #processName#, <!-- 工序名称 -->
company_code = #companyCode#, <!-- 公司编码 --> company_code = #companyCode#, <!-- 公司编码 -->
company_name = #companyName#, <!-- 公司名称 --> company_name = #companyName#, <!-- 公司名称 -->
dep_code = #depCode#, <!-- 部门编码 --> dep_code = #depCode#, <!-- 部门编码 -->
...@@ -286,6 +330,7 @@ ...@@ -286,6 +330,7 @@
proj_code = #projCode#, <!-- 项目编码 --> proj_code = #projCode#, <!-- 项目编码 -->
proj_name = #projName#, <!-- 项目名称 --> proj_name = #projName#, <!-- 项目名称 -->
plan_code = #planCode#, <!-- 计划编码 --> plan_code = #planCode#, <!-- 计划编码 -->
product_type = #productType#, <!-- 产品类型 -->
product_code = #productCode#, <!-- 产品编号 --> product_code = #productCode#, <!-- 产品编号 -->
product_name = #productName#, <!-- 产品名称 --> product_name = #productName#, <!-- 产品名称 -->
finish_date = #finishDate#, <!-- 完工日期 --> finish_date = #finishDate#, <!-- 完工日期 -->
......
...@@ -4,10 +4,13 @@ import com.baosight.hggp.core.dao.DaoBase; ...@@ -4,10 +4,13 @@ import com.baosight.hggp.core.dao.DaoBase;
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.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC001A; import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.sc.domain.HGSC005; import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.domain.HGSC005A; import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
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.collections.MapUtils; import org.apache.commons.collections.MapUtils;
...@@ -114,9 +117,9 @@ public class HGSCTools { ...@@ -114,9 +117,9 @@ public class HGSCTools {
checkSaveData(hgsc005); checkSaveData(hgsc005);
hgsc005.setPlanCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC005_PLAN_CODE)); hgsc005.setPlanCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC005_PLAN_CODE));
DaoUtils.insert(HGSC005.INSERT,hgsc005); DaoUtils.insert(HGSC005.INSERT,hgsc005);
hgsc005.getHgsc005AList().forEach(hgsc005A -> { // hgsc005.getHgsc005AList().forEach(hgsc005A -> {
DaoUtils.insert(HGSC005A.INSERT,THGSC005A.constructObj(hgsc005A,hgsc005)); // DaoUtils.insert(HGSC005A.INSERT,THGSC005A.constructObj(hgsc005A,hgsc005));
}); // });
return hgsc005; return hgsc005;
} }
...@@ -134,52 +137,142 @@ public class HGSCTools { ...@@ -134,52 +137,142 @@ public class HGSCTools {
// AssertUtils.isEmpty(hgsc005.getDepCode(), "部门不能为空!"); // AssertUtils.isEmpty(hgsc005.getDepCode(), "部门不能为空!");
AssertUtils.isEmpty(hgsc005.getProjCode(), "项目编号不能为空!"); AssertUtils.isEmpty(hgsc005.getProjCode(), "项目编号不能为空!");
AssertUtils.isEmpty(hgsc005.getProjName(), "项目名称不能为空!"); AssertUtils.isEmpty(hgsc005.getProjName(), "项目名称不能为空!");
AssertUtils.isEmpty(hgsc005.getHgsc005AList(), "计划明细不能为空"); // AssertUtils.isEmpty(hgsc005.getHgsc005AList(), "计划明细不能为空");
hgsc005.getHgsc005AList().forEach(hgsc005A -> { // hgsc005.getHgsc005AList().forEach(hgsc005A -> {
AssertUtils.isTrue(Objects.isNull(hgsc005A.getMatDetailId())||hgsc005A.getMatDetailId()<=0, "物料清单明细ID不能为空!"); // AssertUtils.isTrue(Objects.isNull(hgsc005A.getMatDetailId())||hgsc005A.getMatDetailId()<=0, "物料清单明细ID不能为空!");
AssertUtils.isEmpty(hgsc005A.getProductCode(), "产品编码不能为空!"); // AssertUtils.isEmpty(hgsc005A.getProductCode(), "产品编码不能为空!");
AssertUtils.isEmpty(hgsc005A.getProductName(), "产品名称不能为空!"); // AssertUtils.isEmpty(hgsc005A.getProductName(), "产品名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005A.getTechFlowId())||hgsc005A.getTechFlowId()<=0, "工艺流程ID不能为空!"); // AssertUtils.isTrue(Objects.isNull(hgsc005A.getTechFlowId())||hgsc005A.getTechFlowId()<=0, "工艺流程ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005A.getQuantity())||hgsc005A.getQuantity()<=0, "数量不能为空!"); // AssertUtils.isTrue(Objects.isNull(hgsc005A.getQuantity())||hgsc005A.getQuantity()<=0, "数量不能为空!");
// AssertUtils.isTrue(Objects.isNull(hgsc005A.getFinishQuantity())||hgsc005A.getFinishQuantity()<=0, "完工数量不能为空!"); //// AssertUtils.isTrue(Objects.isNull(hgsc005A.getFinishQuantity())||hgsc005A.getFinishQuantity()<=0, "完工数量不能为空!");
// AssertUtils.isTrue(Objects.isNull(hgsc005A.getUnfinishQuantity())||hgsc005A.getUnfinishQuantity()<=0, "未完工数量不能为空!"); //// AssertUtils.isTrue(Objects.isNull(hgsc005A.getUnfinishQuantity())||hgsc005A.getUnfinishQuantity()<=0, "未完工数量不能为空!");
}); // });
}
public static HGSC005 queryByMatId(Long matId){
AssertUtils.isTrue(Objects.isNull(matId)||matId<=0, "物料清单ID不能为空!");
HGSC005 result = (HGSC005) DaoBase.getInstance().get(HGSC005.QUERY, HGSC005.FIELD_mat_id, matId);
return result;
} }
} }
public static class THGSC005A{ public static class THGSC005A{
public static List<HGSC005A> queryByPlanCodes(List<String> planCodes){ public static List<HGSC005A> queryByPlanCodes(List<String> planCodes){
AssertUtils.isEmpty(planCodes, "计划编码不能为空!"); AssertUtils.isEmpty(planCodes, "计划编码不能为空!");
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("planCodes", planCodes); paramMap.put("planCodes", planCodes);
List<HGSC005A> results = DaoBase.getInstance().query(HGSC001A.QUERY, paramMap); List<HGSC005A> results = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results; return CollectionUtils.isEmpty(results) ? null : results;
} }
public static HGSC005A save(HGSC005A hgsc005a, Long matId){
AssertUtils.isTrue(Objects.isNull(matId)||matId<=0, "物料清单ID不能为空!"); private static List<HGSC005A> generatorNewPlanDetail(HGSC005A hgsc005a){
//通过存货档案编码查询存货档案工序
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(hgsc005a.getProductCode());
AssertUtils.isEmpty(hgpz005AList, String.format("产品[%s]工序不存在,请先到存货档案配置产品工序!",hgsc005a.getProductName()));
List<HGSC005A> hgsc005AList = new ArrayList<>();
hgpz005AList.forEach(pz -> {
HGSC005A obj = new HGSC005A();
BeanUtils.copyProperties(hgsc005a,obj);
obj.setProcessId(pz.getId());
obj.setProcessName(pz.getProcessName());
hgsc005AList.add(obj);
});
return hgsc005AList;
}
private static Map<Long,Optional<HGSC005A>> queryOldPlanDetail(HGSC005A hgsc005a){
Map paramMap = new HashMap();
paramMap.put(HGSC005A.FIELD_plan_code, hgsc005a.getPlanCode());
paramMap.put(HGSC005A.FIELD_product_code, hgsc005a.getProductCode());
//构建计划物料明细ID唯一 TODO
if(hgsc005a.getProductType()==1){
paramMap.put(HGSC005A.FIELD_product_code, hgsc005a.getMatDetailId());
}
List<HGSC005A> oldObjList = DaoBase.getInstance().query(HGSC005A.QUERY, paramMap);
Map<Long,Optional<HGSC005A>> oldObjMap = Optional.ofNullable(oldObjList).orElse(new ArrayList<>()).stream()
.collect(Collectors.groupingBy(HGSC005A::getProcessId,Collectors.maxBy(
Comparator.comparingInt(HGSC005A::getQuantity))));
return oldObjMap;
}
public static HGSC005A save(HGSC005A hgsc005a){
checkUpdateData(hgsc005a); checkUpdateData(hgsc005a);
HGSC005 hgsc005 = (HGSC005) DaoBase.getInstance().get(HGSC005.QUERY,HGSC005.FIELD_mat_id, matId); constructObj(hgsc005a);
DaoUtils.insert(HGSC005A.INSERT,THGSC005A.constructObj(hgsc005a,hgsc005)); List<HGSC005A> hgsc005AList = generatorNewPlanDetail(hgsc005a);
Map<Long,Optional<HGSC005A>> oldObjMap = queryOldPlanDetail(hgsc005a);
List<HGSC005A> createList = new ArrayList<>();
List<HGSC005A> updateList = new ArrayList<>();
hgsc005AList.forEach(o -> {
Optional<HGSC005A> op = oldObjMap.get(o.getProcessId());
if(Objects.nonNull(op)){
HGSC005A uo = op.get();
uo.setQuantity(uo.getQuantity()+o.getQuantity());
uo.setUnfinishQuantity(uo.getUnfinishQuantity()+o.getQuantity());
updateList.add(uo);
}else{
createList.add(o);
}
});
if(CollectionUtils.isNotEmpty(createList)){
createList.forEach(obj -> {
DaoUtils.insert(HGSC005A.INSERT,obj);
});
}
if(CollectionUtils.isNotEmpty(updateList)){
updateList.forEach(obj -> {
DaoUtils.insert(HGSC005A.UPDATE,obj);
});
}
return hgsc005a; return hgsc005a;
} }
public static HGSC005A update(HGSC005A hgsc005a){ public static HGSC005A update(HGSC005A hgsc005a){
checkUpdateData(hgsc005a); checkUpdateData(hgsc005a);
HGSC005A result = (HGSC005A) DaoBase.getInstance().get(HGSC005A.QUERY,HGSC005A.FIELD_mat_detail_id, hgsc005a.getMatDetailId()); constructObj(hgsc005a);
result.setProductCode(hgsc005a.getProductCode()); List<HGSC005A> hgsc005AList = generatorNewPlanDetail(hgsc005a);
result.setProductName(hgsc005a.getProductName()); Map<Long,Optional<HGSC005A>> oldObjMap = queryOldPlanDetail(hgsc005a);
result.setQuantity(hgsc005a.getQuantity()); List<HGSC005A> createList = new ArrayList<>();
result.setUnfinishQuantity(hgsc005a.getQuantity()); List<HGSC005A> updateList = new ArrayList<>();
result.setFinishQuantity(0); hgsc005AList.forEach(o -> {
DaoUtils.update(HGSC005A.UPDATE,result); Optional<HGSC005A> op = oldObjMap.get(o.getProcessId());
return result; if(Objects.nonNull(op)){
HGSC005A uo = op.get();
uo.setQuantity(o.getQuantity());
uo.setUnfinishQuantity(o.getQuantity()-uo.getFinishQuantity());
updateList.add(uo);
}else{
createList.add(o);
}
});
if(CollectionUtils.isNotEmpty(createList)){
createList.forEach(obj -> {
DaoUtils.insert(HGSC005A.INSERT,obj);
});
}
if(CollectionUtils.isNotEmpty(updateList)){
updateList.forEach(obj -> {
DaoUtils.update(HGSC005A.UPDATE,obj);
});
}
return hgsc005a;
} }
public static void delete(Long matDetailId){ public static void delete(HGSC005A hgsc005a){
AssertUtils.isTrue(Objects.isNull(matDetailId)||matDetailId<=0, "物料清单明细ID不能为空!"); checkUpdateData(hgsc005a);
DaoUtils.update(HGSC005A.DELETE,matDetailId); Map<Long,Optional<HGSC005A>> oldObjMap = queryOldPlanDetail(hgsc005a);
oldObjMap.forEach((k,v)->{
HGSC005A oldObj = v.get();
if(oldObj.getQuantity()-hgsc005a.getQuantity()<=0){
DaoUtils.update(HGSC005A.DELETE, new HashMap<String,Object>(){{put(HGSC005A.FIELD_id,oldObj.getId());}});
}else{
oldObj.setQuantity(oldObj.getQuantity()-hgsc005a.getQuantity());
oldObj.setUnfinishQuantity(oldObj.getQuantity()-oldObj.getFinishQuantity());
DaoUtils.update(HGSC005A.UPDATE,oldObj);
}
});
} }
/** /**
...@@ -188,6 +281,7 @@ public class HGSCTools { ...@@ -188,6 +281,7 @@ public class HGSCTools {
* @param hgsc005a * @param hgsc005a
*/ */
private static void checkUpdateData(HGSC005A hgsc005a) { private static void checkUpdateData(HGSC005A hgsc005a) {
AssertUtils.isTrue(Objects.isNull(hgsc005a.getMatId())||hgsc005a.getMatId()<=0, "物料清单ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getMatDetailId())||hgsc005a.getMatDetailId()<=0, "物料清单明细ID不能为空!"); AssertUtils.isTrue(Objects.isNull(hgsc005a.getMatDetailId())||hgsc005a.getMatDetailId()<=0, "物料清单明细ID不能为空!");
AssertUtils.isEmpty(hgsc005a.getProductCode(), "产品编码不能为空!"); AssertUtils.isEmpty(hgsc005a.getProductCode(), "产品编码不能为空!");
AssertUtils.isEmpty(hgsc005a.getProductName(), "产品名称不能为空!"); AssertUtils.isEmpty(hgsc005a.getProductName(), "产品名称不能为空!");
...@@ -195,7 +289,8 @@ public class HGSCTools { ...@@ -195,7 +289,8 @@ public class HGSCTools {
AssertUtils.isTrue(Objects.isNull(hgsc005a.getQuantity())||hgsc005a.getQuantity()<=0, "数量不能为空!"); AssertUtils.isTrue(Objects.isNull(hgsc005a.getQuantity())||hgsc005a.getQuantity()<=0, "数量不能为空!");
} }
public static HGSC005A constructObj(HGSC005A hgsc005a, HGSC005 hgsc005){ public static HGSC005A constructObj(HGSC005A hgsc005a){
HGSC005 hgsc005 = THGSC005.queryByMatId(hgsc005a.getMatId());
hgsc005a.setPlanCode(hgsc005.getPlanCode()); hgsc005a.setPlanCode(hgsc005.getPlanCode());
hgsc005a.setCompanyCode(hgsc005.getCompanyCode()); hgsc005a.setCompanyCode(hgsc005.getCompanyCode());
hgsc005a.setCompanyName(hgsc005.getCompanyName()); hgsc005a.setCompanyName(hgsc005.getCompanyName());
......
$(function() {
IPLATUI.EFGrid = {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
"result": {
columns: [],
loadComplete: function (grid) {
// 此grid对象
/*grid.dataSource.bind("change", function(e) {
if (e.field == "inventRecordId") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field'])
}
}
}
});*/
}
}
}
// 查询
$("#QUERY").on("click", query);
});
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/16
Time: 18:15
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="库存预警查询">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<div class="row">
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3"
filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="规格" blockId="inqu_status" ename="spec" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_name_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案ID" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
filter="contains">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#"
blockName="invent_record_block_id" textField="textField" valueField="valueField"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="120" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="120" align="center"/>
<EF:EFColumn ename="warnNum" cname="预警值" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="90" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invWeight" cname="库存重量(T)" enable="false" width="90" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="princ" cname="仓库负责人" width="120" align="center" enable="false"
blockName="user_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"
filter="contains">
</EF:EFComboColumn>
<%--<EF:EFColumn ename="princ" cname="仓库负责人" width="120" align="center"/>--%>
<%-- <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>--%>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -16,7 +16,7 @@ $(function() { ...@@ -16,7 +16,7 @@ $(function() {
let template = ''; let template = '';
if (item.id){ if (item.id){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFlowDetail(' + item.id + ')" >工艺流程</a>'; + 'onclick="showFlowDetail(' + item.id + ',\''+item.inventCode+'\')" >工艺流程</a>';
if (item.flowId>0){ if (item.flowId>0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ')" >工艺流程详情</a>'; + 'onclick="showDetail(' + item.id + ')" >工艺流程详情</a>';
...@@ -223,9 +223,9 @@ function showDetail(id) { ...@@ -223,9 +223,9 @@ function showDetail(id) {
}); });
} }
function showFlowDetail(id) { function showFlowDetail(id,inventCode) {
JSColorbox.open({ JSColorbox.open({
href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentId=" + id, href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-inventCode="+inventCode,
title: "<div style='text-align: center;'>工艺流程</div>", title: "<div style='text-align: center;'>工艺流程</div>",
width: "75%", width: "75%",
height: "80%", height: "80%",
...@@ -239,6 +239,7 @@ function showFlowDetail(id) { ...@@ -239,6 +239,7 @@ function showFlowDetail(id) {
function cllback(result) { function cllback(result) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", result.id); inEiInfo.set("result-0-id", result.id);
inEiInfo.set("result-0-inventCode", result.inventCode);
inEiInfo.set("result-0-flow", result.rows); inEiInfo.set("result-0-flow", result.rows);
EiCommunicator.send('HGPZ005', 'updateFlowId', inEiInfo, { EiCommunicator.send('HGPZ005', 'updateFlowId', inEiInfo, {
onSuccess(ei) { onSuccess(ei) {
......
...@@ -55,8 +55,9 @@ $(function (){ ...@@ -55,8 +55,9 @@ $(function (){
$("#result").on("click", function () { $("#result").on("click", function () {
let id = $("#inqu_status-0-parentId").val(); let id = $("#inqu_status-0-parentId").val();
let inventCode = $("#inqu_status-0-inventCode").val();
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
parent.JSColorbox.setValueCallback({"id":id,"rows":rows[0]}); parent.JSColorbox.setValueCallback({"id":id,"inventCode":inventCode,"rows":rows[0]});
parent.JSColorbox.close(); parent.JSColorbox.close();
}); });
}) })
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inventCode" cname="存货编码" colWidth="3" type="hidden"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
......
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