Commit 811f2fe1 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

 Conflicts:
	src/main/java/com/baosight/hggp/hg/constant/HGSqlConstant.java
parents d43340b6 f4f4e26c
...@@ -107,6 +107,7 @@ public class HGSqlConstant { ...@@ -107,6 +107,7 @@ public class HGSqlConstant {
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
/*public class HgKc003 { /*public class HgKc003 {
public class HGKC003 {
// 模块名称 // 模块名称
private static final String MODULE_NAME = "HGKC003."; private static final String MODULE_NAME = "HGKC003.";
...@@ -114,6 +115,42 @@ public class HGSqlConstant { ...@@ -114,6 +115,42 @@ public class HGSqlConstant {
public static final String LOCK = MODULE_NAME + "lock"; public static final String LOCK = MODULE_NAME + "lock";
}*/ }*/
// 统计
public static final String STAT_DATE = "HGKC003.statDate";
}
/**
* HPKC003 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc003A {
// 统计
public static final String STAT_DATE = "HGKC003A.statDate";
// 锁
public static final String LOCK = "HGKC003A.lock";
}
/**
* HGKC010 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HgKc010 {
// 模块名称
private static final String MODULE_NAME = "HGKC010.";
// 锁
public static final String LOCK = MODULE_NAME + "lock";
// 锁
public static final String LOCKS = MODULE_NAME + "locks";
// 修改库存
public static final String UPDATE_INV = MODULE_NAME + "updateInv";
}
/** /**
* HGKC011 SQL 定义 * HGKC011 SQL 定义
...@@ -132,7 +169,7 @@ public class HGSqlConstant { ...@@ -132,7 +169,7 @@ public class HGSqlConstant {
// 修改库存 // 修改库存
public static final String UPDATE_INV = MODULE_NAME + "updateInv"; public static final String UPDATE_INV = MODULE_NAME + "updateInv";
} }
/** /**
* HGZL001 SQL 定义 * HGZL001 SQL 定义
* *
...@@ -140,7 +177,7 @@ public class HGSqlConstant { ...@@ -140,7 +177,7 @@ public class HGSqlConstant {
* @date:2024/5/18,15:13 * @date:2024/5/18,15:13
*/ */
public class HgZl001 { public class HgZl001 {
// 模块名称 // 模块名称
private static final String MODULE_NAME = "HGZL001."; private static final String MODULE_NAME = "HGZL001.";
// 锁 // 锁
...@@ -148,7 +185,8 @@ public class HGSqlConstant { ...@@ -148,7 +185,8 @@ public class HGSqlConstant {
// 已处理 // 已处理
public static final String PROCESS = MODULE_NAME + "process"; public static final String PROCESS = MODULE_NAME + "process";
} }
/** /**
* HGKC002 SQL 定义 * HGKC002 SQL 定义
* *
...@@ -194,6 +232,22 @@ public class HGSqlConstant { ...@@ -194,6 +232,22 @@ public class HGSqlConstant {
} }
/** /**
* HGKC004 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HGKC004A {
// 统计
public static final String STAT_DATE = "HGKC004A.statDate";
// 锁
public static final String LOCK = "HGKC004A.lock";
// 修改打印状态
public static final String UPDATE_PRINT = "HGKC004A.updatePrint";
}
/**
* HGKC005 SQL 定义 * HGKC005 SQL 定义
* *
* @author:songx * @author:songx
......
...@@ -38,6 +38,8 @@ public class HGKC004 extends DaoEPBase { ...@@ -38,6 +38,8 @@ public class HGKC004 extends DaoEPBase {
public static final String FIELD_SALE_OUT_CODE = "saleOutCode"; /* 销售出库单号*/ public static final String FIELD_SALE_OUT_CODE = "saleOutCode"; /* 销售出库单号*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
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_NAME = "projName"; /* 项目名称*/
public static final String FIELD_STATUS = "status"; /* 状态 0-停止 1-启用*/ public static final String FIELD_STATUS = "status"; /* 状态 0-停止 1-启用*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
...@@ -57,6 +59,8 @@ public class HGKC004 extends DaoEPBase { ...@@ -57,6 +59,8 @@ public class HGKC004 extends DaoEPBase {
public static final String COL_SALE_OUT_CODE = "SALE_OUT_CODE"; /* 销售出库单号*/ public static final String COL_SALE_OUT_CODE = "SALE_OUT_CODE"; /* 销售出库单号*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/ public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
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_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_STATUS = "STATUS"; /* 状态 0-停止 1-启用*/ public static final String COL_STATUS = "STATUS"; /* 状态 0-停止 1-启用*/
public static final String QUERY = "HGKC004.query"; public static final String QUERY = "HGKC004.query";
...@@ -84,6 +88,8 @@ public class HGKC004 extends DaoEPBase { ...@@ -84,6 +88,8 @@ public class HGKC004 extends DaoEPBase {
private String saleOutCode = " "; /* 销售出库单号*/ private String saleOutCode = " "; /* 销售出库单号*/
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer status = 0; /* 状态 0-未提交 1-已提交*/ private Integer status = 0; /* 状态 0-未提交 1-已提交*/
/** /**
...@@ -161,6 +167,14 @@ public class HGKC004 extends DaoEPBase { ...@@ -161,6 +167,14 @@ public class HGKC004 extends DaoEPBase {
eiColumn.setDescName("仓库名称"); eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-停止 1-启用"); eiColumn.setDescName("状态 0-停止 1-启用");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -463,6 +477,23 @@ public class HGKC004 extends DaoEPBase { ...@@ -463,6 +477,23 @@ public class HGKC004 extends DaoEPBase {
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
public String getProjCode() {
return projCode;
}
public void setProjCode(String projCode) {
this.projCode = projCode;
}
public String getProjName() {
return projName;
}
public void setProjName(String projName) {
this.projName = projName;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -488,6 +519,8 @@ public class HGKC004 extends DaoEPBase { ...@@ -488,6 +519,8 @@ public class HGKC004 extends DaoEPBase {
setSaleOutCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALE_OUT_CODE)), saleOutCode)); setSaleOutCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALE_OUT_CODE)), saleOutCode));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode)); setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
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));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
} }
...@@ -515,6 +548,8 @@ public class HGKC004 extends DaoEPBase { ...@@ -515,6 +548,8 @@ public class HGKC004 extends DaoEPBase {
map.put(FIELD_SALE_OUT_CODE, StringUtils.toString(saleOutCode, eiMetadata.getMeta(FIELD_SALE_OUT_CODE))); map.put(FIELD_SALE_OUT_CODE, StringUtils.toString(saleOutCode, eiMetadata.getMeta(FIELD_SALE_OUT_CODE)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE))); map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
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_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map; return map;
......
...@@ -49,6 +49,11 @@ public class HGKC004A extends DaoEPBase { ...@@ -49,6 +49,11 @@ public class HGKC004A extends DaoEPBase {
public static final String FIELD_PRICE = "price"; /* 单价*/ public static final String FIELD_PRICE = "price"; /* 单价*/
public static final String FIELD_AMOUNT = "amount"; /* 金额*/ public static final String FIELD_AMOUNT = "amount"; /* 金额*/
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
...@@ -76,6 +81,12 @@ public class HGKC004A extends DaoEPBase { ...@@ -76,6 +81,12 @@ public class HGKC004A extends DaoEPBase {
public static final String COL_PRICE = "PRICE"; /* 单价*/ public static final String COL_PRICE = "PRICE"; /* 单价*/
public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/ public static final String COL_AMOUNT = "AMOUNT"; /* 金额*/
public static final String COL_WH_CODE = "WH_CODE"; /* 仓库编码*/
public static final String COL_WH_NAME = "WH_NAME"; /* 仓库名称*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String QUERY = "HGKC004A.query"; public static final String QUERY = "HGKC004A.query";
public static final String COUNT = "HGKC004A.count"; public static final String COUNT = "HGKC004A.count";
public static final String INSERT = "HGKC004A.insert"; public static final String INSERT = "HGKC004A.insert";
...@@ -110,6 +121,13 @@ public class HGKC004A extends DaoEPBase { ...@@ -110,6 +121,13 @@ public class HGKC004A extends DaoEPBase {
private BigDecimal price = new BigDecimal("0"); /* 单价*/ private BigDecimal price = new BigDecimal("0"); /* 单价*/
private BigDecimal amount = new BigDecimal("0"); /* 金额*/ private BigDecimal amount = new BigDecimal("0"); /* 金额*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -246,6 +264,23 @@ public class HGKC004A extends DaoEPBase { ...@@ -246,6 +264,23 @@ public class HGKC004A extends DaoEPBase {
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_CODE);
eiColumn.setDescName("仓库编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WH_NAME);
eiColumn.setDescName("仓库名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -671,6 +706,39 @@ public class HGKC004A extends DaoEPBase { ...@@ -671,6 +706,39 @@ public class HGKC004A extends DaoEPBase {
public void setAmount(BigDecimal amount) { public void setAmount(BigDecimal amount) {
this.amount = amount; this.amount = amount;
} }
public String getWhCode() {
return whCode;
}
public void setWhCode(String whCode) {
this.whCode = whCode;
}
public String getWhName() {
return whName;
}
public void setWhName(String whName) {
this.whName = whName;
}
public String getProjCode() {
return projCode;
}
public void setProjCode(String projCode) {
this.projCode = projCode;
}
public String getProjName() {
return projName;
}
public void setProjName(String projName) {
this.projName = projName;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -705,6 +773,11 @@ public class HGKC004A extends DaoEPBase { ...@@ -705,6 +773,11 @@ public class HGKC004A extends DaoEPBase {
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId)); setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price)); setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount)); setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
} }
/** /**
...@@ -741,6 +814,11 @@ public class HGKC004A extends DaoEPBase { ...@@ -741,6 +814,11 @@ public class HGKC004A extends DaoEPBase {
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE))); map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT))); map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
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_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
return map; return map;
} }
} }
...@@ -33,8 +33,8 @@ import java.util.Map; ...@@ -33,8 +33,8 @@ import java.util.Map;
* @date:2022/7/11,11:08 * @date:2022/7/11,11:08
*/ */
public class ServiceHGKC002A extends ServiceEPBase { public class ServiceHGKC002A extends ServiceEPBase {
/** /**
* 初始化 * 初始化
* *
...@@ -57,7 +57,7 @@ public class ServiceHGKC002A extends ServiceEPBase { ...@@ -57,7 +57,7 @@ public class ServiceHGKC002A extends ServiceEPBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询数据列表 * 查询数据列表
* *
...@@ -75,7 +75,7 @@ public class ServiceHGKC002A extends ServiceEPBase { ...@@ -75,7 +75,7 @@ public class ServiceHGKC002A extends ServiceEPBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 生成出库单 * 生成出库单
* *
...@@ -85,47 +85,47 @@ public class ServiceHGKC002A extends ServiceEPBase { ...@@ -85,47 +85,47 @@ public class ServiceHGKC002A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "库存查询", operType = "插入", operDesc = "生产领料单-库存查询-生成出库单") @OperationLogAnnotation(operModul = "库存查询", operType = "插入", operDesc = "生产领料单-库存查询-生成出库单")
public EiInfo select(EiInfo inInfo) { public EiInfo select(EiInfo inInfo) {
try { try {
List<HGKC010A> hc010as = MapUtils.toDaoEPBase(inInfo, HGKC010A.class); List<HGKC010A> hc010s = MapUtils.toDaoEPBase(inInfo, HGKC010A.class);
// 获取库存信息 // 获取库存信息
Map<Long, HGKC010> dbKc010Map = HGKCUtils.HgKc010.lockGetDataEp(hc010as); Map<Long, HGKC010A> dbKc010Map = HGKCUtils.HgKc010A.lockGetDataEp(hc010s);
// 状态校验 // 状态校验
this.checkData(hc010as, dbKc010Map); this.checkData(hc010s, dbKc010Map);
// 生成销售库单 // 生成销售库单
this.saveData(hc010as, dbKc010Map); this.saveData(hc010s, dbKc010Map);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成领料单失败"); LogUtils.setMsg(inInfo, e, "生成领料单失败");
} }
return inInfo; return inInfo;
} }
/** /**
* 数据校验 * 数据校验
* *
* @param fKc010as * @param fKc010as
* @param dbKc010Map * @param dbKc010Map
*/ */
private void checkData(List<HGKC010A> fKc010as, Map<Long, HGKC010> dbKc010Map) { private void checkData(List<HGKC010A> fKc010as, Map<Long, HGKC010A> dbKc010Map) {
for (HGKC010A fKc010a : fKc010as) { for (HGKC010A fKc010a : fKc010as) {
Long id = fKc010a.getId(); Long id = fKc010a.getId();
HGKC010 dbKc010 = dbKc010Map.get(id); HGKC010A dbKc010 = dbKc010Map.get(id);
AssertUtils.isNull(dbKc010, String.format("库存号[%s]不存在!", id)); AssertUtils.isNull(dbKc010, String.format("库存号[%s]不存在!", id));
// 校验数量 // 校验数量
AssertUtils.isGt(fKc010a.getApplyQty(), dbKc010.getInvQty(), AssertUtils.isGt(fKc010a.getApplyQty(), dbKc010.getInvQty(),
String.format("库存号【%s】可用数量(%s)不足!", id, dbKc010.getInvQty())); String.format("库存号【%s】可用数量(%s)不足!", id, dbKc010.getInvQty()));
} }
} }
/** /**
* 保存数据 * 保存数据
* *
* @param fKc010as * @param fKc010as
* @param dbKc010Map * @param dbKc010Map
*/ */
private void saveData(List<HGKC010A> fKc010as, Map<Long, HGKC010> dbKc010Map) { private void saveData(List<HGKC010A> fKc010as, Map<Long, HGKC010A> dbKc010Map) {
for (HGKC010A fKc010a : fKc010as) { for (HGKC010A fKc010a : fKc010as) {
BigDecimal applyQty = fKc010a.getApplyQty(); BigDecimal applyQty = fKc010a.getApplyQty();
Long invId = fKc010a.getId(); Long invId = fKc010a.getId();
HGKC010 dbKc010 = dbKc010Map.get(invId); HGKC010A dbKc010 = dbKc010Map.get(invId);
HGKC002 newKc002 = BeanUtils.copy(dbKc010, HGKC002.class); HGKC002 newKc002 = BeanUtils.copy(dbKc010, HGKC002.class);
newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_REQ_NO)); newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_REQ_NO));
newKc002.setReceiptDate(DateUtils.shortDate()); newKc002.setReceiptDate(DateUtils.shortDate());
......
...@@ -5,7 +5,6 @@ import com.baosight.hggp.common.DdynamicEnum; ...@@ -5,7 +5,6 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005; import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ007; import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.tools.HGPZTools; import com.baosight.hggp.hg.pz.tools.HGPZTools;
...@@ -48,9 +47,9 @@ public class ServiceHGKC009 extends ServiceBase { ...@@ -48,9 +47,9 @@ public class ServiceHGKC009 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
// CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID), null);
// CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), null); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC009().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC009().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
...@@ -163,21 +162,26 @@ public class ServiceHGKC009 extends ServiceBase { ...@@ -163,21 +162,26 @@ public class ServiceHGKC009 extends ServiceBase {
*/ */
private List<HGKC009> statData(Map queryMap) { private List<HGKC009> statData(Map queryMap) {
// 1.1、期末库存 // 1.1、期末库存
Map<String, HGKC010A> endKcs = this.listInvData(queryMap, HGKC010A.QUERY); Map<String, HGKC010> endKcs = this.listInvData(queryMap, HGKC010.QUERY);
// 1.2、采购入库 // 1.2、采购入库
Map<String, HGKC001> cgRkMap = this.listInvData(queryMap, HGSqlConstant.HGKC001.STAT_DATE); Map<String, HGKC001> cgRkMap = this.listInvData(queryMap, HGSqlConstant.HGKC001.STAT_DATE);
// 1.4、其他入库 // 1.4、其他入库
Map<String, HGKC006A> qtRkMap = this.listInvData(queryMap, HGSqlConstant.HGKC006A.STAT_DATE); Map<String, HGKC006A> qtRkMap = this.listInvData(queryMap, HGSqlConstant.HGKC006A.STAT_DATE);
// 1.5、生产领料 // 1.5、生产领料
Map<String, HGKC008A> scCkMap = this.listInvData(queryMap, HGSqlConstant.HGKC008A.STAT_DATE); Map<String, HGKC008A> scCkMap = this.listInvData(queryMap, HGSqlConstant.HGKC008A.STAT_DATE);
// 1.6、生产入库
Map<String, HGKC003> scRkMap = this.listInvData(queryMap, HGSqlConstant.HGKC003.STAT_DATE);
// 1.7、其它出库 // 1.7、其它出库
Map<String, HGKC007A> qtCkMap = this.listInvData(queryMap, HGSqlConstant.HGKC007A.STAT_DATE); Map<String, HGKC007A> qtCkMap = this.listInvData(queryMap, HGSqlConstant.HGKC007A.STAT_DATE);
// 1.8、盘点差异数量 // 1.8、盘点差异数量
Map<String, HGKC005> pdDiffMap = this.listInvData(queryMap, HGSqlConstant.HGKC005.STAT_DATE); // Map<String, HGKC005> pdDiffMap = this.listInvData(queryMap, HGSqlConstant.HGKC005.STAT_DATE);
Map<String, HGKC005> pdDiffMap = null;
// 1.9、期初库存 // 1.9、期初库存
Map<String, HGKC009> initKcMap = this.listInvData(queryMap, HGKC009.QUERY); Map<String, HGKC009> initKcMap = this.listInvData(queryMap, HGKC009.QUERY);
// 2.0 销售出库
Map<String, HGKC004A> xsCkMap = this.listInvData(queryMap, HGSqlConstant.HGKC004A.STAT_DATE);
// 根据期末库存生成收发存对象 // 根据期末库存生成收发存对象
return buildKcBean(queryMap, endKcs, cgRkMap, qtRkMap, scCkMap, qtCkMap, pdDiffMap, initKcMap); return buildKcBean(queryMap, endKcs, cgRkMap, qtRkMap, scCkMap, qtCkMap, pdDiffMap, initKcMap,scRkMap,xsCkMap);
} }
/** /**
...@@ -186,21 +190,25 @@ public class ServiceHGKC009 extends ServiceBase { ...@@ -186,21 +190,25 @@ public class ServiceHGKC009 extends ServiceBase {
* @param queryMap * @param queryMap
* @param endKcs * @param endKcs
* @param cgRkMap * @param cgRkMap
* @param qtCkMap
* @param scCkMap
* @param qtRkMap * @param qtRkMap
* @param scCkMap
* @param qtCkMap
* @param pdDiffMap * @param pdDiffMap
* @param initKcMap * @param initKcMap
* @param scRkMap
* @param xsCkMap
* @return * @return
*/ */
private List<HGKC009> buildKcBean(Map queryMap, Map<String, HGKC010A> endKcs, Map<String, HGKC001> cgRkMap, private List<HGKC009> buildKcBean(Map queryMap, Map<String, HGKC010> endKcs, Map<String, HGKC001> cgRkMap,
Map<String, HGKC006A> qtRkMap, Map<String, HGKC008A> scCkMap, Map<String, HGKC007A> qtCkMap, Map<String, HGKC006A> qtRkMap, Map<String, HGKC008A> scCkMap, Map<String, HGKC007A> qtCkMap,
Map<String, HGKC005> pdDiffMap, Map<String, HGKC009> initKcMap) { Map<String, HGKC005> pdDiffMap, Map<String, HGKC009> initKcMap, Map<String, HGKC003> scRkMap,
Map<String, HGKC004A> xsCkMap) {
List<HGKC009> newKc009s = new ArrayList<>(); List<HGKC009> newKc009s = new ArrayList<>();
for (Map.Entry<String, HGKC010A> entry : endKcs.entrySet()) { for (Map.Entry<String, HGKC010> entry : endKcs.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
HGKC010A endKc = entry.getValue(); HGKC010 endKc = entry.getValue();
HGKC009 kc009 = BeanUtils.copy(endKc, HGKC009.class); HGKC009 kc009 = BeanUtils.copy(endKc, HGKC009.class);
kc009.setInventRecordId(endKc.getSpecId());
kc009.setDateType(queryMap.get("dateType").toString()); kc009.setDateType(queryMap.get("dateType").toString());
kc009.setDateProc(queryMap.get("yesterDate").toString()); kc009.setDateProc(queryMap.get("yesterDate").toString());
// 1.1期末 // 1.1期末
...@@ -223,19 +231,31 @@ public class ServiceHGKC009 extends ServiceBase { ...@@ -223,19 +231,31 @@ public class ServiceHGKC009 extends ServiceBase {
HGKC008A scCk = scCkMap.get(key); HGKC008A scCk = scCkMap.get(key);
kc009.setScOuterAmount(scCk == null ? BigDecimal.ZERO : scCk.getInvQty()); kc009.setScOuterAmount(scCk == null ? BigDecimal.ZERO : scCk.getInvQty());
kc009.setScOuterWeight(scCk == null ? BigDecimal.ZERO : scCk.getInvWeight()); kc009.setScOuterWeight(scCk == null ? BigDecimal.ZERO : scCk.getInvWeight());
// 1.6、生产入库
HGKC003 scRk = scRkMap.get(key);
kc009.setScEnterAmount(scRk == null ? BigDecimal.ZERO : scRk.getInvQty());
kc009.setScEnterWeight(scRk == null ? BigDecimal.ZERO : scRk.getInvWeight());
// 1.7、其他出库 // 1.7、其他出库
HGKC007A qtCk = qtCkMap.get(key); HGKC007A qtCk = qtCkMap.get(key);
kc009.setQtOuterAmount(qtCk == null ? BigDecimal.ZERO : qtCk.getInvQty()); kc009.setQtOuterAmount(qtCk == null ? BigDecimal.ZERO : qtCk.getInvQty());
kc009.setQtOuterWeight(qtCk == null ? BigDecimal.ZERO : qtCk.getInvWeight()); kc009.setQtOuterWeight(qtCk == null ? BigDecimal.ZERO : qtCk.getInvWeight());
// 2.0、销售出库
HGKC004A xsCk = xsCkMap.get(key);
kc009.setXsOuterAmount(xsCk == null ? BigDecimal.ZERO : xsCk.getQuantity());
kc009.setXsOuterWeight(xsCk == null ? BigDecimal.ZERO : xsCk.getWeight());
// 1.8、出库 // 1.8、出库
kc009.setOuterAmount(kc009.getScOuterAmount().add(kc009.getXsOuterAmount()) kc009.setOuterAmount(kc009.getScOuterAmount().add(kc009.getXsOuterAmount())
.add(kc009.getQtOuterAmount())); .add(kc009.getQtOuterAmount()));
kc009.setOuterWeight(kc009.getScOuterWeight().add(kc009.getXsOuterWeight()) kc009.setOuterWeight(kc009.getScOuterWeight().add(kc009.getXsOuterWeight())
.add(kc009.getQtOuterWeight())); .add(kc009.getQtOuterWeight()));
// 1.8、盘点差异数量 // 1.8、盘点差异数量
HGKC005 pdDiff = pdDiffMap.get(key); // HGKC005 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、期初
HGKC009 initKc = initKcMap.get(key); HGKC009 initKc = initKcMap.get(key);
kc009.setInitAmount(initKc != null ? initKc.getEndAmount() : kc009.getEndAmount() kc009.setInitAmount(initKc != null ? initKc.getEndAmount() : kc009.getEndAmount()
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.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 ServiceHGKC010A extends ServiceBase {
/**
* 备份数据
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "库存管理",operType = "插入",operDesc = "实时库存管理-备份数据")
public EiInfo backup(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("dateProc", LocalDate.now().minusDays(1).format(DateUtils.SHORT_DATE));
// 清除数据
dao.delete(HGSqlConstant.HGKC010A.DELETE_BY_TIME, queryMap);
// 备份数据
dao.insert(HGSqlConstant.HGKC010A.BACKUP, queryMap);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("备份数据成功");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
}
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE,SPEC_ID
</select> </select>
</sqlMap> </sqlMap>
...@@ -358,4 +358,22 @@ ...@@ -358,4 +358,22 @@
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC003 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC003
</select> </select>
<!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC003">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
PROJ_CODE AS "projCode",
PART_CODE AS "partCode",
COALESCE(SUM(INV_QTY), 0) AS "invQty",
COALESCE(SUM(INV_WEIGHT), 0) AS "invWeight"
FROM ${hggpSchema}.HGKC003
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, PART_CODE
</select>
</sqlMap> </sqlMap>
<?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">
Generate time : 2024-05-28 10:42:29
Version : 1.0
schema : hggp
tableName : HGKC004
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PARENT_ID BIGINT NOT NULL,
RECEIPT_DATE VARCHAR,
SALE_OUT_CODE VARCHAR,
WH_CODE VARCHAR,
WH_NAME VARCHAR,
STATUS TINYINT
-->
<sqlMap namespace="HGKC004"> <sqlMap namespace="HGKC004">
<typeAlias alias="HGKC004" type="com.baosight.hggp.hg.kc.domain.HGKC004"/> <typeAlias alias="HGKC004" type="com.baosight.hggp.hg.kc.domain.HGKC004"/>
...@@ -45,6 +22,8 @@ ...@@ -45,6 +22,8 @@
SALE_OUT_CODE as "saleOutCode", <!-- 销售出库单号 --> SALE_OUT_CODE as "saleOutCode", <!-- 销售出库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 --> WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 --> WH_NAME as "whName", <!-- 仓库名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
STATUS as "status" <!-- 状态 0-停止 1-启用 --> STATUS as "status" <!-- 状态 0-停止 1-启用 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -100,6 +79,12 @@ ...@@ -100,6 +79,12 @@
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
</isNotEmpty> </isNotEmpty>
...@@ -119,7 +104,7 @@ ...@@ -119,7 +104,7 @@
<select id="query" parameterClass="HashMap" resultClass="HGKC004"> <select id="query" parameterClass="HashMap" resultClass="HGKC004">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hggpSchema}.HGKC004 WHERE 1=1 FROM ${hggpSchema}.HGKC004 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -155,11 +140,13 @@ ...@@ -155,11 +140,13 @@
SALE_OUT_CODE, <!-- 销售出库单号 --> SALE_OUT_CODE, <!-- 销售出库单号 -->
WH_CODE, <!-- 仓库编码 --> WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
STATUS <!-- 状态 0-停止 1-启用 --> STATUS <!-- 状态 0-停止 1-启用 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #parentId#, #receiptDate#, #saleOutCode#, #whCode#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #parentId#, #receiptDate#, #saleOutCode#, #whCode#,
#whName#, #status#) #whName#,#projCode#,#projName#, #status#)
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC004 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC004
</selectKey> </selectKey>
...@@ -199,6 +186,8 @@ ...@@ -199,6 +186,8 @@
SALE_OUT_CODE = #saleOutCode#, <!-- 销售出库单号 --> SALE_OUT_CODE = #saleOutCode#, <!-- 销售出库单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 --> WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 --> WH_NAME = #whName#, <!-- 仓库名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
STATUS = #status# <!-- 状态 0-停止 1-启用 --> STATUS = #status# <!-- 状态 0-停止 1-启用 -->
WHERE WHERE
ID = #id# ID = #id#
...@@ -236,27 +225,6 @@ ...@@ -236,27 +225,6 @@
WHERE ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> WHERE ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</update> </update>
<!-- 统计库存 -->
<select id="statDate" resultClass="HGKC004">
SELECT
ACCOUNT_CODE AS "accountCode",
COMPANY_CODE as "companyCode",
COMPANY_NAME as "companyName",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
PROJ_CODE AS "projCode",
INVENT_CODE AS "inventCode",
SUB_INVENT_CODE AS "subInventCode",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(WEIGHT), 0) AS "weight"
FROM ${hggpSchema}.HGKC004
WHERE 1=1
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, INVENT_CODE, SUB_INVENT_CODE,FACTORY_CODE,FACTORY_NAME
</select>
<select id="queryList" parameterClass="HashMap" resultClass="HGKC004"> <select id="queryList" parameterClass="HashMap" resultClass="HGKC004">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
...@@ -297,6 +265,12 @@ ...@@ -297,6 +265,12 @@
<isNotEmpty prepend=" AND " property="whName"> <isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName# WH_NAME = #whName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
</isNotEmpty> </isNotEmpty>
...@@ -309,61 +283,5 @@ ...@@ -309,61 +283,5 @@
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiptDate">
RECEIPT_DATE = #receiptDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="saleOutCode">
SALE_OUT_CODE = #saleOutCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
-->
</sqlMap> </sqlMap>
<?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">
Generate time : 2024-05-28 10:42:29
Version : 1.0
schema : hggp
tableName : HGKC004A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
INVENT_RECORD_ID BIGINT,
INVENT_TYPE VARCHAR,
INVENT_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
INV_QTY DECIMAL,
INV_UNIT_WEIGHT DECIMAL,
INV_WEIGHT DECIMAL,
PARENT_ID BIGINT,
PRICE DECIMAL,
AMOUNT DECIMAL
-->
<sqlMap namespace="HGKC004A"> <sqlMap namespace="HGKC004A">
<typeAlias alias="HGKC004A" type="com.baosight.hggp.hg.kc.domain.HGKC004A"/> <typeAlias alias="HGKC004A" type="com.baosight.hggp.hg.kc.domain.HGKC004A"/>
...@@ -242,85 +215,24 @@ ...@@ -242,85 +215,24 @@
ID = #id# ID = #id#
</update> </update>
<!-- <!-- 统计库存 -->
<isNotEmpty prepend=" AND " property="id"> <select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC004A">
ID = #id# SELECT
</isNotEmpty> a.ACCOUNT_CODE AS "accountCode",
<isNotEmpty prepend=" AND " property="accountCode"> a.COMPANY_CODE as "companyCode",
ACCOUNT_CODE = #accountCode# a.COMPANY_NAME as "companyName",
</isNotEmpty> a.DEP_CODE AS "depCode",
<isNotEmpty prepend=" AND " property="depCode"> b.WH_CODE AS "whCode",
DEP_CODE = #depCode# b.PROJ_CODE AS "projCode",
</isNotEmpty> a.INVENT_CODE AS "inventCode",
<isNotEmpty prepend=" AND " property="createdBy"> COALESCE(SUM(QUANTITY), 0) AS "quantity",
CREATED_BY = #createdBy# COALESCE(SUM(WEIGHT), 0) AS "weight"
</isNotEmpty> FROM ${hggpSchema}.HGKC004A a LEFT JOIN ${hggpSchema}.HGKC004 b on a.PARENT_ID = b.ID
<isNotEmpty prepend=" AND " property="createdName"> WHERE 1=1
CREATED_NAME = #createdName# <isNotEmpty prepend=" AND " property="createdTimeFrom">
</isNotEmpty> a.CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
<isNotEmpty prepend=" AND " property="createdTime"> </isNotEmpty>
CREATED_TIME = #createdTime# GROUP BY a.ACCOUNT_CODE,a.COMPANY_CODE,a.COMPANY_NAME, a.DEP_CODE, b.WH_CODE, b.PROJ_CODE, a.INVENT_CODE
</isNotEmpty> </select>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
QUANTITY = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitWeight">
UNIT_WEIGHT = #unitWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="weight">
WEIGHT = #weight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="price">
PRICE = #price#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
-->
</sqlMap> </sqlMap>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
INVENT_CODE = #inventCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName"> <isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName# INVENT_NAME like CONCAT('%',#inventName#,'%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId"> <isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId# INVENT_RECORD_ID = #inventRecordId#
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
</sql> </sql>
<!-- 查询 --> <!-- 查询 -->
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HGKC009"> <select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC009">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hggpSchema}.HGKC009 FROM ${hggpSchema}.HGKC009
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
</select> </select>
<!-- 查询统计 --> <!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HGKC009"> <select id="querySum" resultClass="com.baosight.hggp.hg.kc.domain.HGKC009">
SELECT SELECT
COALESCE(SUM(INIT_AMOUNT), 0) AS "initAmount", <!-- 期初数量 --> COALESCE(SUM(INIT_AMOUNT), 0) AS "initAmount", <!-- 期初数量 -->
COALESCE(SUM(INIT_WEIGHT), 0) AS "initWeight", <!-- 期初重量 --> COALESCE(SUM(INIT_WEIGHT), 0) AS "initWeight", <!-- 期初重量 -->
......
<?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">
<sqlMap namespace="HGKC010A">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC_ID as "specId", <!-- 规格ID -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
INV_QTY as "invQty", <!-- 库存数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
INV_WEIGHT as "invWeight", <!-- 库存重量 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 厂区名称 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<include refid="idCondition"/>
<include refid="customCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dateProc">
DATE_PROC = #dateProc#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="specId">
SPEC_ID = #specId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="BaseCondition.specCondition"/>
<include refid="BaseCondition.createdTimeCondition"/>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC010A">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC010A
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC010A WHERE 1=1
<include refid="condition"/>
</select>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGKC010A WHERE ID = #id#
</delete>
<!-- 按时间删除数据 -->
<delete id="deleteByTime">
DELETE FROM ${hggpSchema}.HGKC010A WHERE DATE_PROC = #dateProc#
</delete>
<!-- 备份数据 -->
<insert id="backup">
INSERT INTO ${hggpSchema}.HGKC010A (
ACCOUNT_CODE,COMPANY_CODE,COMPANY_NAME, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME, INVENT_TYPE,
INVENT_CODE, INVENT_NAME, SPEC_ID,SPEC, MATERIAL, UNIT,LENGTH,WIDTH,THICK, INV_QTY, INV_UNIT_WEIGHT, INV_WEIGHT,
FACTORY_CODE, FACTORY_NAME,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME,UPDATED_TIME
)
SELECT
ACCOUNT_CODE,COMPANY_CODE,COMPANY_NAME, DEP_CODE, #dateProc#, WH_CODE, WH_NAME, INVENT_TYPE,
INVENT_CODE, INVENT_NAME, SPEC_ID,SPEC, MATERIAL, UNIT,LENGTH,WIDTH,THICK, INV_QTY, INV_UNIT_WEIGHT, INV_WEIGHT,
FACTORY_CODE, FACTORY_NAME,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME, UPDATED_TIME
FROM ${hggpSchema}.HGKC010
</insert>
</sqlMap>
...@@ -734,6 +734,37 @@ public class HGKCTools { ...@@ -734,6 +734,37 @@ public class HGKCTools {
} }
/** /**
* HGKC010 工具类
*
* @author:songx
* @date:2024/5/9,14:33
*/
public static class HgKc010A {
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC010A> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "库存ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC010A.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC010A> map(List<Long> ids) {
List<HGKC010A> results = list(ids);
return results.stream().collect(Collectors.toMap(HGKC010A::getId, item -> item));
}
}
/**
* HGKC011 工具类 * HGKC011 工具类
* *
* @author:songx * @author:songx
......
...@@ -365,6 +365,36 @@ public class HGKCUtils { ...@@ -365,6 +365,36 @@ public class HGKCUtils {
} }
/** /**
* HGKC010 工具类
*
* @author:songx
* @date:2024/5/9,16:58
*/
public static class HgKc010A {
/**
* 锁并且获取数据
*
* @param kc010s
* @return
*/
public static Map<Long, HGKC010A> lockGetDataEp(List<HGKC010A> kc010s) {
return lockGetData(ObjectUtils.listEpKey(kc010s, HGKC010A.FIELD_ID));
}
/**
* 锁并且获取数据
*
* @param ids
* @return
*/
public static Map<Long, HGKC010A> lockGetData(List<Long> ids) {
// 锁
HGKCTools.HgKc010.lock(ids);
// db数据
return HGKCTools.HgKc010A.map(ids);
}
}
/**
* HGKC011 工具类 * HGKC011 工具类
* *
* @author:songx * @author:songx
......
...@@ -877,7 +877,7 @@ public class HGSCTools { ...@@ -877,7 +877,7 @@ public class HGSCTools {
} }
private static void checkDeleteDate(List<Long> ids){ private static void checkDeleteDate(List<Long> ids){
List<HGZL002> hgzl002s = HGZLTools.THGZL002.list(ids); List<HGZL002> hgzl002s = HGZLTools.THGZL002.listByWorkIds(ids);
List<String> workCodes = hgzl002s.stream().filter(o -> o.getCheckStatus().compareTo(CheckStatusEnum.CHECKED.getCode())==0).map(HGZL002::getWorkCode).collect(Collectors.toList()); List<String> workCodes = hgzl002s.stream().filter(o -> o.getCheckStatus().compareTo(CheckStatusEnum.CHECKED.getCode())==0).map(HGZL002::getWorkCode).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(workCodes)){ if(CollectionUtils.isNotEmpty(workCodes)){
AssertUtils.isNotEmpty(workCodes,String.format("生产报工单[%s]已经质检完成,无法删除!",String.join(",",workCodes))); AssertUtils.isNotEmpty(workCodes,String.format("生产报工单[%s]已经质检完成,无法删除!",String.join(",",workCodes)));
......
...@@ -5,6 +5,9 @@ import com.baosight.hggp.common.CheckStatusEnum; ...@@ -5,6 +5,9 @@ import com.baosight.hggp.common.CheckStatusEnum;
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.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.zl.domain.HGZL002; import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.tools.HGZLTools; import com.baosight.hggp.hg.zl.tools.HGZLTools;
...@@ -12,8 +15,10 @@ import com.baosight.hggp.util.*; ...@@ -12,8 +15,10 @@ import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
...@@ -32,6 +37,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -32,6 +37,7 @@ public class ServiceHGZL002 extends ServiceBase {
@OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "初始化查询") @OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "初始化查询")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
handleQueryParam(inInfo);
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002()); inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class); EiInfoUtils.addBlock(inInfo,"userBlockId", UserSessionUtils.getUser(), User.class);
} catch (Exception e) { } catch (Exception e) {
...@@ -40,6 +46,17 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -40,6 +46,17 @@ public class ServiceHGZL002 extends ServiceBase {
return inInfo; return inInfo;
} }
private void handleQueryParam(EiInfo inInfo){
Long taskId = MapUtils.getLong(EiInfoUtils.getFirstRow(inInfo),HGSC008.FIELD_task_id);
if(Objects.nonNull(taskId)&&taskId>0){
List<HGSC008> hgsc008s = HGSCTools.THGSC008.getByTaskId(taskId);
List<Long> workIds = Optional.ofNullable(hgsc008s).orElse(new ArrayList<>()).stream().map(HGSC008::getId).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(workIds)){
EiInfoUtils.setFirstRow(inInfo,"workIds",workIds);
}
}
}
/** /**
* 查询操作 * 查询操作
* *
...@@ -50,6 +67,7 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -50,6 +67,7 @@ public class ServiceHGZL002 extends ServiceBase {
@OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "查询") @OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
handleQueryParam(inInfo);
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002()); inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
id asc id desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
id asc id desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
id asc id desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
......
...@@ -125,7 +125,7 @@ public class HGZLTools { ...@@ -125,7 +125,7 @@ public class HGZLTools {
hgzl002.setId(null); hgzl002.setId(null);
} }
public static List<HGZL002> list(List<Long> workIds) { public static List<HGZL002> listByWorkIds(List<Long> workIds) {
if (CollectionUtils.isEmpty(workIds)) { if (CollectionUtils.isEmpty(workIds)) {
return null; return null;
} }
...@@ -135,7 +135,7 @@ public class HGZLTools { ...@@ -135,7 +135,7 @@ public class HGZLTools {
} }
public static void deleteByWorkIds(List<Long> workIds) { public static void deleteByWorkIds(List<Long> workIds) {
List<HGZL002> hgzl002s = list(workIds); List<HGZL002> hgzl002s = listByWorkIds(workIds);
THGZL004.deleteByCheckIds(hgzl002s.stream().map(HGZL002::getId).collect(Collectors.toList()), CheckTypeEnum.PROCESS_CHECK); THGZL004.deleteByCheckIds(hgzl002s.stream().map(HGZL002::getId).collect(Collectors.toList()), CheckTypeEnum.PROCESS_CHECK);
DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String, Object>() {{ DaoUtils.update(HGZL002.DELETE_BY_WORKS, new HashMap<String, Object>() {{
put("workIds", workIds); put("workIds", workIds);
......
...@@ -92,6 +92,17 @@ public class EiInfoUtils { ...@@ -92,6 +92,17 @@ public class EiInfoUtils {
public static void setFirstRow(EiInfo eiInfo, String key, String value) { public static void setFirstRow(EiInfo eiInfo, String key, String value) {
setFirstRow(eiInfo, EiConstant.queryBlock, key, value); setFirstRow(eiInfo, EiConstant.queryBlock, key, value);
} }
/**
* inqu_status 填充值
*
* @param eiInfo
* @param key
* @param value
*/
public static void setFirstRow(EiInfo eiInfo, String key, Object value) {
setFirstRow(eiInfo, EiConstant.queryBlock, key, value);
}
/** /**
* inqu_status 填充值 * inqu_status 填充值
...@@ -109,6 +120,23 @@ public class EiInfoUtils { ...@@ -109,6 +120,23 @@ public class EiInfoUtils {
} }
rowMap.put(key, value); rowMap.put(key, value);
} }
/**
* inqu_status 填充值
*
* @param eiInfo
* @param blockId
* @param key
* @param value
*/
public static void setFirstRow(EiInfo eiInfo, String blockId, String key, Object value) {
Map rowMap = eiInfo.getRow(blockId, 0);
if (rowMap == null) {
rowMap = new HashMap();
eiInfo.addRow(blockId, rowMap);
}
rowMap.put(key, value);
}
/** /**
* eiinfo中新增block * eiinfo中新增block
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004A.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013A.xml"/> <sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC013A.xml"/>
......
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
}
// 查询
$("#QUERY").on("click", query);
//手动触发按天统计
$("#STARTDAY").on("click",function () {
JSUtils.confirm("确定手动触发按天统计自动任务? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC009", "statDay", true);
}
});
});
//手动触发按月统计
$("#STARTMONTH").on("click",function () {
JSUtils.confirm("确定手动触发按天统计自动任务? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC009", "statMonth", true);
}
});
});
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 删除
*/
let startDay = function () {
JSUtils.confirm("确定手动触发按天统计自动任务? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC009", "statDay", true);
}
});
}
<!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">
<EF:EFDatePicker cname="单据日期" ename="inqu_status-0-dateProc" colWidth="3"
role="date" format="yyyy-MM" readonly="true" start="year" depth="year" />
<EF:EFSelect cname="存货类型" ename="inqu_status-0-inventType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput ename="inqu_status-0-inventName" cname="存货名称" colWidth="3"/>
<%-- <EF:EFSelect cname="存货名称" ename="inqu_status-0-inventCode" colWidth="3" filter="contains">--%>
<%-- <EF:EFOption label="全部" value=""/>--%>
<%-- <EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>--%>
<%-- </EF:EFSelect>--%>
</div>
<div class="row">
<EF:EFSelect cname="规格" ename="inqu_status-0-inventRecordId" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="spec_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="dateProc" cname="日期" enable="false" width="90" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="120" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="100" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="false" width="100" align="center"
blockName="invent_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventRecordId" cname="规格" enable="false" width="120" align="center"
blockName="spec_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="initAmount" cname="期初数量" enable="false" width="100" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="initWeight" cname="期初重量(T)" enable="false" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="cgEnterAmount" cname="采购入库数量" enable="false" width="100" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="cgEnterWeight" cname="采购入库重量(T)" enable="false" width="100" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtEnterAmount" cname="其它入库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="qtEnterWeight" cname="其它入库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="enterAmount" cname="入库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="enterWeight" cname="入库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="scOuterAmount" cname="生产领料数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="scOuterWeight" cname="生产领料重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="qtOuterAmount" cname="其它出库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="qtOuterWeight" cname="其它出库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="outerAmount" cname="出库数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="outerWeight" cname="出库重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="pdDiffAmount" cname="盘点差异数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="pdDiffWeight" cname="盘点差异重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="endAmount" cname="期末数量" enable="false" width="90" align="right" format="{0:N0}"
sumType="all"/>
<EF:EFColumn ename="endWeight" cname="期末重量(T)" enable="false" width="90" align="right" format="{0:N3}"
sumType="all"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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