Commit f4f4e26c by 江和松

收发库存汇总页面提交

parent a8a4c433
......@@ -335,17 +335,6 @@ public class HGSqlConstant {
public static final String QUERY_SUM = "HGKC009A.querySum";
}
/**
* HGKC010 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HGKC010 {
// 锁
public static final String LOCK = "HGKC010.lock";
}
/**
* HGKC010A SQL 定义
......@@ -362,18 +351,6 @@ public class HGSqlConstant {
}
/**
* HGKC011 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HGKC011 {
// 锁
public static final String LOCK = "HGKC011.lock";
}
/**
* HGKC011A SQL 定义
*
* @author:songx
......
......@@ -38,6 +38,8 @@ public class HGKC004 extends DaoEPBase {
public static final String FIELD_SALE_OUT_CODE = "saleOutCode"; /* 销售出库单号*/
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 FIELD_STATUS = "status"; /* 状态 0-停止 1-启用*/
public static final String COL_ID = "ID"; /* ID*/
......@@ -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_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 COL_STATUS = "STATUS"; /* 状态 0-停止 1-启用*/
public static final String QUERY = "HGKC004.query";
......@@ -84,6 +88,8 @@ public class HGKC004 extends DaoEPBase {
private String saleOutCode = " "; /* 销售出库单号*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer status = 0; /* 状态 0-未提交 1-已提交*/
/**
......@@ -161,6 +167,14 @@ public class HGKC004 extends DaoEPBase {
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);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态 0-停止 1-启用");
eiMetadata.addMeta(eiColumn);
......@@ -463,6 +477,23 @@ public class HGKC004 extends DaoEPBase {
public void setStatus(Integer 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.
*
......@@ -488,6 +519,8 @@ public class HGKC004 extends DaoEPBase {
setSaleOutCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALE_OUT_CODE)), saleOutCode));
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));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
}
......@@ -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_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)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map;
......
......@@ -49,6 +49,11 @@ public class HGKC004A extends DaoEPBase {
public static final String FIELD_PRICE = "price"; /* 单价*/
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_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
......@@ -76,6 +81,12 @@ public class HGKC004A extends DaoEPBase {
public static final String COL_PRICE = "PRICE"; /* 单价*/
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 COUNT = "HGKC004A.count";
public static final String INSERT = "HGKC004A.insert";
......@@ -110,6 +121,13 @@ public class HGKC004A extends DaoEPBase {
private BigDecimal price = new BigDecimal("0"); /* 单价*/
private BigDecimal amount = new BigDecimal("0"); /* 金额*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
/**
* initialize the metadata.
*/
......@@ -246,6 +264,23 @@ public class HGKC004A extends DaoEPBase {
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 {
public void setAmount(BigDecimal 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.
*
......@@ -705,6 +773,11 @@ public class HGKC004A extends DaoEPBase {
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
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 {
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_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;
}
}
......@@ -33,8 +33,8 @@ import java.util.Map;
* @date:2022/7/11,11:08
*/
public class ServiceHGKC002A extends ServiceEPBase {
/**
* 初始化
*
......@@ -57,7 +57,7 @@ public class ServiceHGKC002A extends ServiceEPBase {
}
return inInfo;
}
/**
* 查询数据列表
*
......@@ -75,7 +75,7 @@ public class ServiceHGKC002A extends ServiceEPBase {
}
return inInfo;
}
/**
* 生成出库单
*
......@@ -85,47 +85,47 @@ public class ServiceHGKC002A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "库存查询", operType = "插入", operDesc = "生产领料单-库存查询-生成出库单")
public EiInfo select(EiInfo inInfo) {
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) {
LogUtils.setMsg(inInfo, e, "生成领料单失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fKc010as
* @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) {
Long id = fKc010a.getId();
HGKC010 dbKc010 = dbKc010Map.get(id);
HGKC010A dbKc010 = dbKc010Map.get(id);
AssertUtils.isNull(dbKc010, String.format("库存号[%s]不存在!", id));
// 校验数量
AssertUtils.isGt(fKc010a.getApplyQty(), dbKc010.getInvQty(),
String.format("库存号【%s】可用数量(%s)不足!", id, dbKc010.getInvQty()));
}
}
/**
* 保存数据
*
* @param fKc010as
* @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) {
BigDecimal applyQty = fKc010a.getApplyQty();
Long invId = fKc010a.getId();
HGKC010 dbKc010 = dbKc010Map.get(invId);
HGKC010A dbKc010 = dbKc010Map.get(invId);
HGKC002 newKc002 = BeanUtils.copy(dbKc010, HGKC002.class);
newKc002.setReqNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_REQ_NO));
newKc002.setReceiptDate(DateUtils.shortDate());
......
......@@ -47,9 +47,9 @@ public class ServiceHGKC009 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
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_SPEC_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC009().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......@@ -162,7 +162,7 @@ public class ServiceHGKC009 extends ServiceBase {
*/
private List<HGKC009> statData(Map queryMap) {
// 1.1、期末库存
Map<String, HGKC010A> endKcs = this.listInvData(queryMap, HGKC010A.QUERY);
Map<String, HGKC010> endKcs = this.listInvData(queryMap, HGKC010.QUERY);
// 1.2、采购入库
Map<String, HGKC001> cgRkMap = this.listInvData(queryMap, HGSqlConstant.HGKC001.STAT_DATE);
// 1.4、其他入库
......@@ -174,7 +174,8 @@ public class ServiceHGKC009 extends ServiceBase {
// 1.7、其它出库
Map<String, HGKC007A> qtCkMap = this.listInvData(queryMap, HGSqlConstant.HGKC007A.STAT_DATE);
// 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、期初库存
Map<String, HGKC009> initKcMap = this.listInvData(queryMap, HGKC009.QUERY);
// 2.0 销售出库
......@@ -198,15 +199,16 @@ public class ServiceHGKC009 extends ServiceBase {
* @param xsCkMap
* @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, HGKC005> pdDiffMap, Map<String, HGKC009> initKcMap, Map<String, HGKC003> scRkMap,
Map<String, HGKC004A> xsCkMap) {
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();
HGKC010A endKc = entry.getValue();
HGKC010 endKc = entry.getValue();
HGKC009 kc009 = BeanUtils.copy(endKc, HGKC009.class);
kc009.setInventRecordId(endKc.getSpecId());
kc009.setDateType(queryMap.get("dateType").toString());
kc009.setDateProc(queryMap.get("yesterDate").toString());
// 1.1期末
......@@ -251,9 +253,9 @@ public class ServiceHGKC009 extends ServiceBase {
kc009.setOuterWeight(kc009.getScOuterWeight().add(kc009.getXsOuterWeight())
.add(kc009.getQtOuterWeight()));
// 1.8、盘点差异数量
HGKC005 pdDiff = pdDiffMap.get(key);
kc009.setPdDiffAmount(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffAmount());
kc009.setPdDiffWeight(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffWeight());
// HGKC005 pdDiff = pdDiffMap.get(key);
// kc009.setPdDiffAmount(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffAmount());
// kc009.setPdDiffWeight(pdDiff == null ? BigDecimal.ZERO : pdDiff.getDiffWeight());
// 1.9、期初
HGKC009 initKc = initKcMap.get(key);
kc009.setInitAmount(initKc != null ? initKc.getEndAmount() : kc009.getEndAmount()
......
......@@ -215,7 +215,7 @@
<isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</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>
</sqlMap>
......@@ -22,6 +22,8 @@
SALE_OUT_CODE as "saleOutCode", <!-- 销售出库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
STATUS as "status" <!-- 状态 0-停止 1-启用 -->
</sql>
<sql id="condition">
......@@ -77,6 +79,12 @@
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
......@@ -132,11 +140,13 @@
SALE_OUT_CODE, <!-- 销售出库单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
STATUS <!-- 状态 0-停止 1-启用 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #parentId#, #receiptDate#, #saleOutCode#, #whCode#,
#whName#, #status#)
#whName#,#projCode#,#projName#, #status#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGKC004
</selectKey>
......@@ -176,6 +186,8 @@
SALE_OUT_CODE = #saleOutCode#, <!-- 销售出库单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
STATUS = #status# <!-- 状态 0-停止 1-启用 -->
WHERE
ID = #id#
......@@ -253,6 +265,12 @@
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
......@@ -265,61 +283,5 @@
</isEmpty>
</dynamic>
</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>
......@@ -216,7 +216,7 @@
</update>
<!-- 统计库存 -->
<select id="statDate" resultClass="HGKC004">
<select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC004A">
SELECT
a.ACCOUNT_CODE AS "accountCode",
a.COMPANY_CODE as "companyCode",
......
......@@ -80,7 +80,7 @@
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
INVENT_NAME like CONCAT('%',#inventName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventRecordId">
INVENT_RECORD_ID = #inventRecordId#
......@@ -99,7 +99,7 @@
</sql>
<!-- 查询 -->
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HGKC009">
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC009">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC009
......@@ -114,7 +114,7 @@
</select>
<!-- 查询统计 -->
<select id="querySum" resultClass="com.baosight.hpjx.hp.kc.domain.HGKC009">
<select id="querySum" resultClass="com.baosight.hggp.hg.kc.domain.HGKC009">
SELECT
COALESCE(SUM(INIT_AMOUNT), 0) AS "initAmount", <!-- 期初数量 -->
COALESCE(SUM(INIT_WEIGHT), 0) AS "initWeight", <!-- 期初重量 -->
......
......@@ -613,6 +613,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 工具类
*
* @author:songx
......
......@@ -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 工具类
*
* @author:songx
......
......@@ -28,6 +28,7 @@
<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/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/HGKC013.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