Commit 3891d88f by 宋祥

1.生产库存收发存统计

parent 2bf7b156
...@@ -189,7 +189,7 @@ public class HPSqlConstant { ...@@ -189,7 +189,7 @@ public class HPSqlConstant {
public class HPKC010A { public class HPKC010A {
// 按日期删除 // 按日期删除
public static final String DELETE_BY_TIME = "HPKC009.deleteByTime"; public static final String DELETE_BY_TIME = "HPKC010A.deleteByTime";
// 备份数量 // 备份数量
public static final String BACKUP = "HPKC010A.backup"; public static final String BACKUP = "HPKC010A.backup";
} }
...@@ -207,6 +207,20 @@ public class HPSqlConstant { ...@@ -207,6 +207,20 @@ public class HPSqlConstant {
} }
/** /**
* HPKC011A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC011A {
// 按日期删除
public static final String DELETE_BY_TIME = "HPKC011A.deleteByTime";
// 备份数量
public static final String BACKUP = "HPKC011A.backup";
}
/**
* HPPZ010 SQL 定义 * HPPZ010 SQL 定义
* *
* @author:songx * @author:songx
......
package com.baosight.hpjx.hp.kc.domain; package com.baosight.hpjx.hp.kc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/** /**
* Project: <br> * Project: <br>
...@@ -17,7 +16,7 @@ import java.util.Map; ...@@ -17,7 +16,7 @@ import java.util.Map;
* 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-02-23 13:43:22 create * @history 2024-02-23 16:22:11 create
*/ */
public class HPKC009A extends DaoEPBase { public class HPKC009A extends DaoEPBase {
...@@ -38,10 +37,10 @@ public class HPKC009A extends DaoEPBase { ...@@ -38,10 +37,10 @@ public class HPKC009A extends DaoEPBase {
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
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_PRDT_CODE = "prdtCode"; /* 产品编码*/ public static final String FIELD_INVENT_CODE = "inventCode"; /* 部件编码*/
public static final String FIELD_PRDT_NAME = "prdtName"; /* 产品名称*/ public static final String FIELD_INVENT_NAME = "inventName"; /* 部件名称*/
public static final String FIELD_PART_CODE = "partCode"; /* 零件编码*/ public static final String FIELD_SUB_INVENT_CODE = "subInventCode"; /* 零件编码*/
public static final String FIELD_PART_NAME = "partName"; /* 零件名称*/ public static final String FIELD_SUB_INVENT_NAME = "subInventName"; /* 零件名称*/
public static final String FIELD_INIT_AMOUNT = "initAmount"; /* 期初数量*/ public static final String FIELD_INIT_AMOUNT = "initAmount"; /* 期初数量*/
public static final String FIELD_INIT_WEIGHT = "initWeight"; /* 期初重量*/ public static final String FIELD_INIT_WEIGHT = "initWeight"; /* 期初重量*/
public static final String FIELD_ENTER_AMOUNT = "enterAmount"; /* 入库数量*/ public static final String FIELD_ENTER_AMOUNT = "enterAmount"; /* 入库数量*/
...@@ -68,10 +67,10 @@ public class HPKC009A extends DaoEPBase { ...@@ -68,10 +67,10 @@ public class HPKC009A extends DaoEPBase {
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/ public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
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_PRDT_CODE = "PRDT_CODE"; /* 产品编码*/ public static final String COL_INVENT_CODE = "INVENT_CODE"; /* 部件编码*/
public static final String COL_PRDT_NAME = "PRDT_NAME"; /* 产品名称*/ public static final String COL_INVENT_NAME = "INVENT_NAME"; /* 部件名称*/
public static final String COL_PART_CODE = "PART_CODE"; /* 零件编码*/ public static final String COL_SUB_INVENT_CODE = "SUB_INVENT_CODE"; /* 零件编码*/
public static final String COL_PART_NAME = "PART_NAME"; /* 零件名称*/ public static final String COL_SUB_INVENT_NAME = "SUB_INVENT_NAME"; /* 零件名称*/
public static final String COL_INIT_AMOUNT = "INIT_AMOUNT"; /* 期初数量*/ public static final String COL_INIT_AMOUNT = "INIT_AMOUNT"; /* 期初数量*/
public static final String COL_INIT_WEIGHT = "INIT_WEIGHT"; /* 期初重量*/ public static final String COL_INIT_WEIGHT = "INIT_WEIGHT"; /* 期初重量*/
public static final String COL_ENTER_AMOUNT = "ENTER_AMOUNT"; /* 入库数量*/ public static final String COL_ENTER_AMOUNT = "ENTER_AMOUNT"; /* 入库数量*/
...@@ -104,10 +103,10 @@ public class HPKC009A extends DaoEPBase { ...@@ -104,10 +103,10 @@ public class HPKC009A extends DaoEPBase {
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String projCode = " "; /* 项目编码*/ private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String prdtCode = " "; /* 产品编码*/ private String inventCode = " "; /* 部件编码*/
private String prdtName = " "; /* 产品名称*/ private String inventName = " "; /* 部件名称*/
private String partCode = " "; /* 零件编码*/ private String subInventCode = " "; /* 零件编码*/
private String partName = " "; /* 零件名称*/ private String subInventName = " "; /* 零件名称*/
private BigDecimal initAmount = new BigDecimal(0.000); /* 期初数量*/ private BigDecimal initAmount = new BigDecimal(0.000); /* 期初数量*/
private BigDecimal initWeight = new BigDecimal(0.000); /* 期初重量*/ private BigDecimal initWeight = new BigDecimal(0.000); /* 期初重量*/
private BigDecimal enterAmount = new BigDecimal(0.000); /* 入库数量*/ private BigDecimal enterAmount = new BigDecimal(0.000); /* 入库数量*/
...@@ -186,19 +185,19 @@ public class HPKC009A extends DaoEPBase { ...@@ -186,19 +185,19 @@ public class HPKC009A extends DaoEPBase {
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_CODE); eiColumn = new EiColumn(FIELD_INVENT_CODE);
eiColumn.setDescName("产品编码"); eiColumn.setDescName("部件编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PRDT_NAME); eiColumn = new EiColumn(FIELD_INVENT_NAME);
eiColumn.setDescName("产品名称"); eiColumn.setDescName("部件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_CODE); eiColumn = new EiColumn(FIELD_SUB_INVENT_CODE);
eiColumn.setDescName("零件编码"); eiColumn.setDescName("零件编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PART_NAME); eiColumn = new EiColumn(FIELD_SUB_INVENT_NAME);
eiColumn.setDescName("零件名称"); eiColumn.setDescName("零件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -523,68 +522,68 @@ public class HPKC009A extends DaoEPBase { ...@@ -523,68 +522,68 @@ public class HPKC009A extends DaoEPBase {
this.projName = projName; this.projName = projName;
} }
/** /**
* get the prdtCode - 产品编码. * get the inventCode - 部件编码.
* @return the prdtCode * @return the inventCode
*/ */
public String getPrdtCode() { public String getInventCode() {
return this.prdtCode; return this.inventCode;
} }
/** /**
* set the prdtCode - 产品编码. * set the inventCode - 部件编码.
* *
* @param prdtCode - 产品编码 * @param inventCode - 部件编码
*/ */
public void setPrdtCode(String prdtCode) { public void setInventCode(String inventCode) {
this.prdtCode = prdtCode; this.inventCode = inventCode;
} }
/** /**
* get the prdtName - 产品名称. * get the inventName - 部件名称.
* @return the prdtName * @return the inventName
*/ */
public String getPrdtName() { public String getInventName() {
return this.prdtName; return this.inventName;
} }
/** /**
* set the prdtName - 产品名称. * set the inventName - 部件名称.
* *
* @param prdtName - 产品名称 * @param inventName - 部件名称
*/ */
public void setPrdtName(String prdtName) { public void setInventName(String inventName) {
this.prdtName = prdtName; this.inventName = inventName;
} }
/** /**
* get the partCode - 零件编码. * get the subInventCode - 零件编码.
* @return the partCode * @return the subInventCode
*/ */
public String getPartCode() { public String getSubInventCode() {
return this.partCode; return this.subInventCode;
} }
/** /**
* set the partCode - 零件编码. * set the subInventCode - 零件编码.
* *
* @param partCode - 零件编码 * @param subInventCode - 零件编码
*/ */
public void setPartCode(String partCode) { public void setSubInventCode(String subInventCode) {
this.partCode = partCode; this.subInventCode = subInventCode;
} }
/** /**
* get the partName - 零件名称. * get the subInventName - 零件名称.
* @return the partName * @return the subInventName
*/ */
public String getPartName() { public String getSubInventName() {
return this.partName; return this.subInventName;
} }
/** /**
* set the partName - 零件名称. * set the subInventName - 零件名称.
* *
* @param partName - 零件名称 * @param subInventName - 零件名称
*/ */
public void setPartName(String partName) { public void setSubInventName(String subInventName) {
this.partName = partName; this.subInventName = subInventName;
} }
/** /**
* get the initAmount - 期初数量. * get the initAmount - 期初数量.
...@@ -769,10 +768,10 @@ public class HPKC009A extends DaoEPBase { ...@@ -769,10 +768,10 @@ public class HPKC009A extends DaoEPBase {
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName)); setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
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));
setPrdtCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_CODE)), prdtCode)); setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setPrdtName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRDT_NAME)), prdtName)); setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setPartCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_CODE)), partCode)); setSubInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUB_INVENT_CODE)), subInventCode));
setPartName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PART_NAME)), partName)); setSubInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUB_INVENT_NAME)), subInventName));
setInitAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INIT_AMOUNT)), initAmount)); setInitAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INIT_AMOUNT)), initAmount));
setInitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INIT_WEIGHT)), initWeight)); setInitWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_INIT_WEIGHT)), initWeight));
setEnterAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTER_AMOUNT)), enterAmount)); setEnterAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_ENTER_AMOUNT)), enterAmount));
...@@ -807,10 +806,10 @@ public class HPKC009A extends DaoEPBase { ...@@ -807,10 +806,10 @@ public class HPKC009A extends DaoEPBase {
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME))); map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
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_PRDT_CODE, StringUtils.toString(prdtCode, eiMetadata.getMeta(FIELD_PRDT_CODE))); map.put(FIELD_INVENT_CODE, StringUtils.toString(inventCode, eiMetadata.getMeta(FIELD_INVENT_CODE)));
map.put(FIELD_PRDT_NAME, StringUtils.toString(prdtName, eiMetadata.getMeta(FIELD_PRDT_NAME))); map.put(FIELD_INVENT_NAME, StringUtils.toString(inventName, eiMetadata.getMeta(FIELD_INVENT_NAME)));
map.put(FIELD_PART_CODE, StringUtils.toString(partCode, eiMetadata.getMeta(FIELD_PART_CODE))); map.put(FIELD_SUB_INVENT_CODE, StringUtils.toString(subInventCode, eiMetadata.getMeta(FIELD_SUB_INVENT_CODE)));
map.put(FIELD_PART_NAME, StringUtils.toString(partName, eiMetadata.getMeta(FIELD_PART_NAME))); map.put(FIELD_SUB_INVENT_NAME, StringUtils.toString(subInventName, eiMetadata.getMeta(FIELD_SUB_INVENT_NAME)));
map.put(FIELD_INIT_AMOUNT, StringUtils.toString(initAmount, eiMetadata.getMeta(FIELD_INIT_AMOUNT))); map.put(FIELD_INIT_AMOUNT, StringUtils.toString(initAmount, eiMetadata.getMeta(FIELD_INIT_AMOUNT)));
map.put(FIELD_INIT_WEIGHT, StringUtils.toString(initWeight, eiMetadata.getMeta(FIELD_INIT_WEIGHT))); map.put(FIELD_INIT_WEIGHT, StringUtils.toString(initWeight, eiMetadata.getMeta(FIELD_INIT_WEIGHT)));
map.put(FIELD_ENTER_AMOUNT, StringUtils.toString(enterAmount, eiMetadata.getMeta(FIELD_ENTER_AMOUNT))); map.put(FIELD_ENTER_AMOUNT, StringUtils.toString(enterAmount, eiMetadata.getMeta(FIELD_ENTER_AMOUNT)));
......
...@@ -3,19 +3,16 @@ package com.baosight.hpjx.hp.kc.service; ...@@ -3,19 +3,16 @@ package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.kc.domain.HPKC002;
import com.baosight.hpjx.hp.kc.domain.HPKC003; import com.baosight.hpjx.hp.kc.domain.HPKC003;
import com.baosight.hpjx.hp.kc.domain.HPKC004; import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC005;
import com.baosight.hpjx.hp.kc.domain.HPKC006;
import com.baosight.hpjx.hp.kc.domain.HPKC007;
import com.baosight.hpjx.hp.kc.domain.HPKC009; import com.baosight.hpjx.hp.kc.domain.HPKC009;
import com.baosight.hpjx.hp.kc.domain.HPKC009A; import com.baosight.hpjx.hp.kc.domain.HPKC009A;
import com.baosight.hpjx.hp.kc.domain.HPKC010A; import com.baosight.hpjx.hp.kc.domain.HPKC011A;
import com.baosight.hpjx.hp.pz.domain.HPPZ004; import com.baosight.hpjx.hp.pz.domain.HPPZ004;
import com.baosight.hpjx.hp.pz.domain.HPPZ007; import com.baosight.hpjx.hp.pz.domain.HPPZ007;
import com.baosight.hpjx.hp.pz.tools.HPPZTools; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.tools.HPSCTools;
import com.baosight.hpjx.util.BeanUtils; import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
...@@ -166,98 +163,64 @@ public class ServiceHPKC009A extends ServiceBase { ...@@ -166,98 +163,64 @@ public class ServiceHPKC009A extends ServiceBase {
List<HPKC009A> newKc009As = new ArrayList<>(); List<HPKC009A> newKc009As = new ArrayList<>();
// 1.1、期末库存 // 1.1、期末库存
queryMap.put("dateProc", queryMap.get("yesterTo")); queryMap.put("dateProc", queryMap.get("yesterTo"));
List<HPKC010A> endKcs = dao.query(HPKC010A.QUERY, queryMap); List<HPKC011A> endKcs = dao.query(HPKC011A.QUERY, queryMap);
// 1.2、采购入库
queryMap.put("createdTimeFrom", queryMap.get("yesterFrom") + "000000"); queryMap.put("createdTimeFrom", queryMap.get("yesterFrom") + "000000");
queryMap.put("createdTimeTo", queryMap.get("yesterTo") + "235959"); queryMap.put("createdTimeTo", queryMap.get("yesterTo") + "235959");
List<HPKC001> cgRks = dao.query(HPSqlConstant.HPKC001.STAT_DATE, queryMap);
Map<String, HPKC001> cgRkMap = cgRks.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(),
item.getWhCode(), item.getInventRecordId()), item -> item));
// 1.3、生产入库 // 1.3、生产入库
// List<HPKC003> scRks = dao.query(HPSqlConstant.HPKC003.STAT_DATE, queryMap); List<HPKC003> scRks = dao.query(HPSqlConstant.HPKC003.STAT_DATE, queryMap);
// Map<String, HPKC003> scRkMap = scRks.stream().collect(Collectors.toMap(item -> Map<String, HPKC003> scRkMap = scRks.stream().collect(Collectors.toMap(item ->
// buildKey(item.getCompanyCode(), item.getDepCode(), item.getPartType(), item.getPartCode(), buildKey(item.getCompanyCode(), item.getDepCode(), item.getWhCode(), item.getProjCode(),
// item.getWhCode(), null), item -> item)); item.getPrdtCode(), item.getPartCode()), item -> item));
// 1.4、其他入库
List<HPKC006> qtRks = dao.query(HPSqlConstant.HPKC006.STAT_DATE, queryMap);
Map<String, HPKC006> qtRkMap = qtRks.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(),
item.getWhCode(), item.getInventRecordId()), item -> item));
// 1.5、生产领料
List<HPKC002> scCks = dao.query(HPSqlConstant.HPKC002.STAT_DATE, queryMap);
Map<String, HPKC002> scCkMap = scCks.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(),
item.getWhCode(), item.getInventRecordId()), item -> item));
// 1.6、销售出库 // 1.6、销售出库
// List<HPKC004> xsCks = dao.query(HPSqlConstant.HPKC004.STAT_DATE, queryMap); List<HPKC004> xsCks = dao.query(HPSqlConstant.HPKC004.STAT_DATE, queryMap);
// Map<String, HPKC004> xsCkMap = xsCks.stream().collect(Collectors.toMap(item -> Map<String, HPKC004> xsCkMap = xsCks.stream().collect(Collectors.toMap(item ->
// buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventCode(), item.getSubInventCode(), buildKey(item.getCompanyCode(), item.getDepCode(), item.getWhCode(), item.getProjCode(),
// item.getWhCode(), ""), item -> item)); item.getInventCode(), item.getSubInventCode()), item -> item));
// 1.7、其它出库
List<HPKC007> qtCks = dao.query(HPSqlConstant.HPKC007.STAT_DATE, queryMap);
Map<String, HPKC007> qtCkMap = qtCks.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(),
item.getWhCode(), item.getInventRecordId()), item -> item));
// 1.8、盘点差异数量 // 1.8、盘点差异数量
List<HPKC005> pdDiffs = dao.query(HPSqlConstant.HPKC005.STAT_DATE, queryMap); // List<HPKC005> pdDiffs = dao.query(HPSqlConstant.HPKC005.STAT_DATE, queryMap);
Map<String, HPKC005> pdDiffMap = pdDiffs.stream().collect(Collectors.toMap(item -> // Map<String, HPKC005> pdDiffMap = pdDiffs.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(), // buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(),
item.getWhCode(), item.getInventRecordId()), item -> item)); // item.getWhCode(), item.getInventRecordId()), item -> item));
// 1.9、期初库存 // 1.9、期初库存
queryMap.put("dateProc", queryMap.get("beforeDate")); queryMap.put("dateProc", queryMap.get("beforeDate"));
List<HPKC009> initKcs = dao.query(HPKC009.QUERY, new HashMap<>()); List<HPKC009A> initKcs = dao.query(HPKC009A.QUERY, new HashMap<>());
Map<String, HPKC009> initKcMap = initKcs.stream().collect(Collectors.toMap(item -> Map<String, HPKC009A> initKcMap = initKcs.stream().collect(Collectors.toMap(item ->
buildKey(item.getCompanyCode(), item.getDepCode(), item.getInventType(), item.getInventCode(), buildKey(item.getCompanyCode(), item.getDepCode(), item.getWhCode(), item.getProjCode(),
item.getWhCode(), item.getInventRecordId()), item -> item)); item.getInventCode(), item.getSubInventCode()), item -> item));
// 根据期末库存生成收发存对象 // 根据期末库存生成收发存对象
for (HPKC010A endKc : endKcs) { for (HPKC011A endKc : endKcs) {
String key = buildKey(endKc.getCompanyCode(), endKc.getDepCode(), endKc.getInventType(), String key = buildKey(endKc.getCompanyCode(), endKc.getDepCode(), endKc.getWhCode(),
endKc.getInventCode(), endKc.getWhCode(), endKc.getInventRecordId()); endKc.getProjCode(), endKc.getInventCode(), endKc.getSubInventCode());
HPKC009A kc009 = BeanUtils.copy(endKc, HPKC009A.class); HPKC009A newKc009a = BeanUtils.copy(endKc, HPKC009A.class);
kc009.setDateType(queryMap.get("dateType").toString()); newKc009a.setDateType(queryMap.get("dateType").toString());
kc009.setDateProc(queryMap.get("yesterDate").toString()); newKc009a.setDateProc(queryMap.get("yesterDate").toString());
// 1.1期末 // 1.1、期末
kc009.setEndAmount(endKc.getAmount()); newKc009a.setEndAmount(endKc.getAmount());
kc009.setEndWeight(endKc.getWeight()); newKc009a.setEndWeight(endKc.getWeight());
// 1.4、入库 // 1.2、入库
// kc009.setEnterAmount(kc009.getCgEnterAmount().add(kc009.getScEnterAmount()) HPKC003 scRk = scRkMap.get(key);
// .add(kc009.getQtEnterAmount())); newKc009a.setEnterAmount(scRk == null ? BigDecimal.ZERO : scRk.getAmount());
// kc009.setEnterWeight(kc009.getCgEnterWeight().add(kc009.getScEnterWeight()) newKc009a.setEnterWeight(scRk == null ? BigDecimal.ZERO : scRk.getWeight());
// .add(kc009.getQtEnterWeight())); // 1.3、出库
// // 1.5、生产领料 HPKC004 xsCk = xsCkMap.get(key);
// HPKC002 scCk = scCkMap.get(key); newKc009a.setOuterAmount(xsCk == null ? BigDecimal.ZERO : xsCk.getAmount());
// kc009.setScOuterAmount(scCk == null ? BigDecimal.ZERO : scCk.getAmount()); newKc009a.setOuterWeight(xsCk == null ? BigDecimal.ZERO : xsCk.getWeight());
// kc009.setScOuterWeight(scCk == null ? BigDecimal.ZERO : scCk.getWeight());
// // 1.6、销售出库
// HPKC004 xsCk = null;//xsCkMap.get(key);
// kc009.setXsOuterAmount(xsCk == null ? BigDecimal.ZERO : xsCk.getAmount());
// kc009.setXsOuterWeight(xsCk == null ? BigDecimal.ZERO : xsCk.getWeight());
// // 1.7、其他出库
// HPKC007 qtCk = qtCkMap.get(key);
// kc009.setQtOuterAmount(qtCk == null ? BigDecimal.ZERO : qtCk.getAmount());
// kc009.setQtOuterWeight(qtCk == null ? BigDecimal.ZERO : qtCk.getWeight());
// // 1.8、出库
// kc009.setOuterAmount(kc009.getScOuterAmount().add(kc009.getXsOuterAmount())
// .add(kc009.getQtOuterAmount()));
// kc009.setOuterWeight(kc009.getScOuterWeight().add(kc009.getXsOuterWeight())
// .add(kc009.getQtOuterWeight()));
// 1.8、盘点差异数量 // 1.8、盘点差异数量
HPKC005 pdDiff = pdDiffMap.get(key); // HPKC005 pdDiff = pdDiffMap.get(key);
kc009.setPdDiffAmount(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffAmount()); // kc009.setPdDiffAmount(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffAmount());
kc009.setPdDiffWeight(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffWeight()); // kc009.setPdDiffWeight(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffWeight());
// 1.9、期初 // 1.9、期初
HPKC009 initKc = initKcMap.get(key); HPKC009A initKc = initKcMap.get(key);
if (initKc != null) { if (initKc != null) {
kc009.setInitAmount(initKc.getEndAmount()); newKc009a.setInitAmount(initKc.getEndAmount());
kc009.setInitWeight(initKc.getEndWeight()); newKc009a.setInitWeight(initKc.getEndWeight());
} else { } else {
kc009.setInitAmount(kc009.getEndAmount().subtract(kc009.getPdDiffAmount()) newKc009a.setInitAmount(newKc009a.getEndAmount().subtract(newKc009a.getPdDiffAmount())
.add(kc009.getOuterAmount()).subtract(kc009.getEnterAmount())); .add(newKc009a.getOuterAmount()).subtract(newKc009a.getEnterAmount()));
kc009.setInitWeight(kc009.getEndWeight().subtract(kc009.getPdDiffWeight()) newKc009a.setInitWeight(newKc009a.getEndWeight().subtract(newKc009a.getPdDiffWeight())
.add(kc009.getOuterWeight()).subtract(kc009.getEnterWeight())); .add(newKc009a.getOuterWeight()).subtract(newKc009a.getEnterWeight()));
} }
newKc009As.add(kc009); newKc009As.add(newKc009a);
} }
return newKc009As; return newKc009As;
} }
...@@ -265,28 +228,42 @@ public class ServiceHPKC009A extends ServiceBase { ...@@ -265,28 +228,42 @@ public class ServiceHPKC009A extends ServiceBase {
/** /**
* 设置基础信息 * 设置基础信息
* *
* @param kc009s * @param kc009as
*/ */
private void setBaseInfo(List<HPKC009A> kc009s) { private void setBaseInfo(List<HPKC009A> kc009as) {
// 仓库名称 // 仓库名称
List<String> whCodes = kc009s.stream().map(HPKC009A::getWhCode).collect(Collectors.toList()); List<String> whCodes = kc009as.stream().map(HPKC009A::getWhCode).collect(Collectors.toList());
Map<String, HPPZ007> mapPz007 = HPPZTools.HpPz007.map(whCodes); Map<String, HPPZ007> mapPz007 = HPPZTools.HpPz007.map(whCodes);
// 存货名称 // 项目名称
List<String> inventCodes = kc009s.stream().map(HPKC009A::getPrdtCode).collect(Collectors.toList()); List<String> projCodes = kc009as.stream().map(HPKC009A::getProjCode).collect(Collectors.toList());
Map<String, HPPZ004> mapPz004 = HPPZTools.HpPz004.map(inventCodes); Map<String, HPSC001> sc001Map = HPSCTools.HpSc001.map(projCodes);
for (HPKC009A kc009 : kc009s) { // 部件名称
List<String> inventCodes = kc009as.stream().map(HPKC009A::getInventCode).collect(Collectors.toList());
Map<String, HPPZ004> pz004Map = HPPZTools.HpPz004.map(inventCodes);
// 零件名称
List<String> subInventCodes = kc009as.stream().map(HPKC009A::getSubInventCode).collect(Collectors.toList());
Map<String, HPPZ004> subPz004Map = HPPZTools.HpPz004.map(subInventCodes);
for (HPKC009A kc009a : kc009as) {
// 仓库名称 // 仓库名称
String whCode = kc009.getWhCode(); String whCode = kc009a.getWhCode();
HPPZ007 pz007 = mapPz007 == null ? null : mapPz007.get(whCode); HPPZ007 pz007 = mapPz007 == null ? null : mapPz007.get(whCode);
kc009.setWhName(pz007 == null ? "" : pz007.getWhName()); kc009a.setWhName(pz007 == null ? "" : pz007.getWhName());
// 存货名称 // 项目名称
String inventCode = kc009.getPrdtCode(); String projCode = kc009a.getProjCode();
HPPZ004 pz004 = mapPz004 == null ? null : mapPz004.get(inventCode); HPSC001 sc001 = sc001Map == null ? null : sc001Map.get(projCode);
kc009.setPrdtName(pz004 == null ? "" : pz004.getInventName()); kc009a.setProjName(sc001 == null ? "" : sc001.getProjName());
// 部件名称
String inventCode = kc009a.getInventCode();
HPPZ004 pz004 = pz004Map == null ? null : pz004Map.get(inventCode);
kc009a.setInventName(pz004 == null ? "" : pz004.getInventName());
// 零件名称
String subInventCode = kc009a.getSubInventCode();
HPPZ004 subPz004 = subPz004Map == null ? null : subPz004Map.get(subInventCode);
kc009a.setSubInventName(subPz004 == null ? "" : subPz004.getInventName());
// 创建时间 // 创建时间
kc009.setCreatedBy(UserSession.getLoginName()); kc009a.setCreatedBy(UserSession.getLoginName());
kc009.setCreatedName(UserSession.getLoginCName()); kc009a.setCreatedName(UserSession.getLoginCName());
kc009.setCreatedTime(DateUtils.shortDateTime()); kc009a.setCreatedTime(DateUtils.shortDateTime());
} }
} }
...@@ -295,19 +272,19 @@ public class ServiceHPKC009A extends ServiceBase { ...@@ -295,19 +272,19 @@ public class ServiceHPKC009A extends ServiceBase {
* *
* @param companyCode * @param companyCode
* @param depCode * @param depCode
* @param inventType
* @param inventCode
* @param whCode * @param whCode
* @param inventRecordId * @param projCode
* @param inventCode
* @param subInventCode
* @return * @return
*/ */
private String buildKey(Object companyCode, Object depCode, Object inventType, Object inventCode, private String buildKey(Object companyCode, Object depCode, Object whCode, Object projCode, Object inventCode,
Object whCode, Object inventRecordId) { Object subInventCode) {
return ObjectUtils.trimToEmpty(companyCode) + "#" return ObjectUtils.trimToEmpty(companyCode) + "#"
+ ObjectUtils.trimToEmpty(depCode) + "#" + ObjectUtils.trimToEmpty(depCode) + "#"
+ ObjectUtils.trimToEmpty(inventType) + "#"
+ ObjectUtils.trimToEmpty(inventCode) + "#"
+ ObjectUtils.trimToEmpty(whCode) + "#" + ObjectUtils.trimToEmpty(whCode) + "#"
+ ObjectUtils.trimToEmpty(inventRecordId); + ObjectUtils.trimToEmpty(projCode) + "#"
+ ObjectUtils.trimToEmpty(inventCode) + "#"
+ ObjectUtils.trimToEmpty(subInventCode);
} }
} }
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,18:49
*/
public class ServiceHPKC011A extends ServiceBase {
/**
* 备份数据
*
* @param inInfo
* @return
*/
public EiInfo backup(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("dateProc", LocalDate.now().minusDays(1).format(DateUtils.SHORT_DATE));
// 清除数据
dao.delete(HPSqlConstant.HPKC011A.DELETE_BY_TIME, queryMap);
// 备份数据
dao.insert(HPSqlConstant.HPKC011A.BACKUP, queryMap);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("备份数据成功");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
}
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
WH_NAME as "whName", <!-- 仓库名称 --> WH_NAME as "whName", <!-- 仓库名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 --> INVENT_CODE as "inventCode", <!-- 部件编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 --> INVENT_NAME as "inventName", <!-- 部件名称 -->
PART_CODE as "partCode", <!-- 零件编码 --> SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 --> SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
INIT_AMOUNT as "initAmount", <!-- 期初数量 --> INIT_AMOUNT as "initAmount", <!-- 期初数量 -->
INIT_WEIGHT as "initWeight", <!-- 期初重量 --> INIT_WEIGHT as "initWeight", <!-- 期初重量 -->
ENTER_AMOUNT as "enterAmount", <!-- 入库数量 --> ENTER_AMOUNT as "enterAmount", <!-- 入库数量 -->
...@@ -80,17 +80,17 @@ ...@@ -80,17 +80,17 @@
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName# PROJ_NAME = #projName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode"> <isNotEmpty prepend=" AND " property="inventCode">
PRDT_CODE = #prdtCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName"> <isNotEmpty prepend=" AND " property="inventName">
PRDT_NAME = #prdtName# INVENT_NAME = #inventName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partCode"> <isNotEmpty prepend=" AND " property="subInventCode">
PART_CODE = #partCode# SUB_INVENT_CODE = #subInventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partName"> <isNotEmpty prepend=" AND " property="subInventName">
PART_NAME = #partName# SUB_INVENT_NAME = #subInventName#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</dynamic> </dynamic>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.gxzl.common.mc.domain.THpkc009a"> <select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC009A">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPKC009A FROM ${hpjxSchema}.T_HPKC009A
...@@ -151,10 +151,10 @@ ...@@ -151,10 +151,10 @@
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
PRDT_CODE, <!-- 产品编码 --> INVENT_CODE, <!-- 部件编码 -->
PRDT_NAME, <!-- 产品名称 --> INVENT_NAME, <!-- 部件名称 -->
PART_CODE, <!-- 零件编码 --> SUB_INVENT_CODE, <!-- 零件编码 -->
PART_NAME, <!-- 零件名称 --> SUB_INVENT_NAME, <!-- 零件名称 -->
INIT_AMOUNT, <!-- 期初数量 --> INIT_AMOUNT, <!-- 期初数量 -->
INIT_WEIGHT, <!-- 期初重量 --> INIT_WEIGHT, <!-- 期初重量 -->
ENTER_AMOUNT, <!-- 入库数量 --> ENTER_AMOUNT, <!-- 入库数量 -->
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#dateType#, #dateProc#, #whCode#, #whName#, #projCode#, #projName#, #dateType#, #dateProc#, #whCode#, #whName#, #projCode#, #projName#,
#prdtCode#, #prdtName#, #partCode#, #partName#, #initAmount#, #initWeight#, #inventCode#, #inventName#, #subInventCode#, #subInventName#, #initAmount#, #initWeight#,
#enterAmount#, #enterWeight#, #outerAmount#, #outerWeight#, #pdDiffAmount#, #enterAmount#, #enterWeight#, #outerAmount#, #outerWeight#, #pdDiffAmount#,
#pdDiffWeight#, #endAmount#, #endWeight# #pdDiffWeight#, #endAmount#, #endWeight#
) )
......
...@@ -191,16 +191,16 @@ ...@@ -191,16 +191,16 @@
<!-- 备份数据 --> <!-- 备份数据 -->
<insert id="backup"> <insert id="backup">
INSERT INTO ${hpjxSchema}.T_HPKC011A ( INSERT INTO ${hpjxSchema}.T_HPKC011A (
COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME, INVENT_TYPE, COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME, PROD_NO, PROJ_CODE,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT, PROJ_NAME, INVENT_CODE, INVENT_NAME, SUB_INVENT_CODE, SUB_INVENT_NAME, LENGTH,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME, WIDTH, THICK, AMOUNT, UNIT_WEIGHT, WEIGHT, REMARK, CREATED_BY, CREATED_NAME,
UPDATED_TIME, VERSION CREATED_TIME, UPDATED_BY, UPDATED_NAME, UPDATED_TIME, VERSION
) )
SELECT SELECT
COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME, INVENT_TYPE, COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME, PROD_NO, PROJ_CODE,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT, PROJ_NAME, INVENT_CODE, INVENT_NAME, SUB_INVENT_CODE, SUB_INVENT_NAME, LENGTH,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME, WIDTH, THICK, AMOUNT, UNIT_WEIGHT, WEIGHT, REMARK, CREATED_BY, CREATED_NAME,
UPDATED_TIME, VERSION CREATED_TIME, UPDATED_BY, UPDATED_NAME, UPDATED_TIME, VERSION
FROM ${hpjxSchema}.T_HPKC011 FROM ${hpjxSchema}.T_HPKC011
</insert> </insert>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 9:33:44
Version : 1.0
tableName :hpjx.t_hpsc001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
PROJ_TYPE TINYINT,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRINC1 VARCHAR,
PRINC2 VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPSC001"> <sqlMap namespace="HPSC001">
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -66,6 +48,9 @@ ...@@ -66,6 +48,9 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCodes">
PROJ_CODE IN <iterate close=")" open="(" conjunction="," property="projCodes">#projCodes[]#</iterate>
</isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc CREATED_TIME desc
...@@ -101,6 +86,9 @@ ...@@ -101,6 +86,9 @@
<isNotEmpty prepend=" AND " property="materialStatus"> <isNotEmpty prepend=" AND " property="materialStatus">
MATERIAL_STATUS = #materialStatus# MATERIAL_STATUS = #materialStatus#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCodes">
PROJ_CODE IN <iterate close=")" open="(" conjunction="," property="projCodes">#projCodes[]#</iterate>
</isNotEmpty>
</select> </select>
<!-- <!--
......
...@@ -3,7 +3,16 @@ package com.baosight.hpjx.hp.sc.tools; ...@@ -3,7 +3,16 @@ package com.baosight.hpjx.hp.sc.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.sc.domain.*; import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.HPSC005C;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC007;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.StringUtils; import com.baosight.hpjx.util.StringUtils;
...@@ -137,6 +146,35 @@ public class HPSCTools { ...@@ -137,6 +146,35 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode)); AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0); return results.get(0);
} }
/**
* 查询
*
* @param projCodes
* @return
*/
public static List<HPSC001> list(List<String> projCodes) {
if (CollectionUtils.isEmpty(projCodes)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("projCodes", projCodes);
return DaoBase.getInstance().query("HPSC001.query", queryMap);
}
/**
* 查询
*
* @param projCodes
* @return
*/
public static Map<String, HPSC001> map(List<String> projCodes) {
List<HPSC001> results = list(projCodes);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPSC001::getProjCode, item -> item));
}
} }
/** /**
......
...@@ -78,7 +78,7 @@ function tearAssign(prodOrderNo) { ...@@ -78,7 +78,7 @@ function tearAssign(prodOrderNo) {
/** /**
* 生产订单详情 * 生产订单详情
* *
* @param productionOrderNo * @param prodOrderNo
*/ */
function tearDetails(prodOrderNo) { function tearDetails(prodOrderNo) {
JSColorbox.open({ JSColorbox.open({
......
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