Commit 0364fded by 江和松

收发存汇总表代码提交70%,缺少盘点、以及合并生产库存统计

parent 7f40fb81
...@@ -75,12 +75,15 @@ public class HGSqlConstant { ...@@ -75,12 +75,15 @@ public class HGSqlConstant {
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HgKc001 { public class HGKC001 {
// 模块名称 // 模块名称
private static final String MODULE_NAME = "HGKC001."; private static final String MODULE_NAME = "HGKC001.";
// 统计
public static final String STAT_DATE = "HGKC001.statDate";
// 锁 // 锁
public static final String LOCK = MODULE_NAME + "lock"; public static final String LOCK = "HGKC001.lock";
} }
/** /**
...@@ -163,50 +166,37 @@ public class HGSqlConstant { ...@@ -163,50 +166,37 @@ public class HGSqlConstant {
public static final String PROCESS = MODULE_NAME + "process"; public static final String PROCESS = MODULE_NAME + "process";
} }
/**
* HPKC001 SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC001 {
// 统计
public static final String STAT_DATE = "HPKC001.statDate";
// 锁
public static final String LOCK = "HPKC001.lock";
}
/** /**
* HPKC002 SQL 定义 * HGKC002 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC002 { public class HGKC008A {
// 统计 // 统计
public static final String STAT_DATE = "HPKC002.statDate"; public static final String STAT_DATE = "HGKC008A.statDate";
// 锁 // 锁
public static final String LOCK = "HPKC002.lock"; public static final String LOCK = "HGKC008A.lock";
} }
/** /**
* HPKC003 SQL 定义 * HGKC003 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC003 { public class HGKC003 {
// 统计 // 统计
public static final String STAT_DATE = "HPKC003.statDate"; public static final String STAT_DATE = "HGKC003.statDate";
// 锁 // 锁
public static final String LOCK = "HPKC003.lock"; public static final String LOCK = "HGKC003.lock";
} }
/** /**
* HPKC004 SQL 定义 * HGKC004 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
...@@ -222,183 +212,183 @@ public class HGSqlConstant { ...@@ -222,183 +212,183 @@ public class HGSqlConstant {
} }
/** /**
* HPKC005 SQL 定义 * HGKC005 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC005 { public class HGKC005 {
// 查询 // 查询
public static final String QUERY_SUM = "HPKC005.querySum"; public static final String QUERY_SUM = "HGKC005.querySum";
// 锁 // 锁
public static final String LOCK = "HPKC005.lock"; public static final String LOCK = "HGKC005.lock";
// 统计 // 统计
public static final String STAT_DATE = "HPKC005.statDate"; public static final String STAT_DATE = "HGKC005.statDate";
} }
/** /**
* HPKC005A SQL 定义 * HGKC005A SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC005A { public class HGKC005A {
// 锁 // 锁
public static final String LOCK = "HPKC005A.lock"; public static final String LOCK = "HGKC005A.lock";
} }
/** /**
* HPKC006 SQL 定义 * HGKC006 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC006 { public class HGKC006A {
// 查询 // 查询
public static final String QUERY_SUM = "HPKC006.querySum"; public static final String QUERY_SUM = "HGKC006A.querySum";
// 锁 // 锁
public static final String LOCK = "HPKC006.lock"; public static final String LOCK = "HGKC006A.lock";
// 统计 // 统计
public static final String STAT_DATE = "HPKC006.statDate"; public static final String STAT_DATE = "HGKC006A.statDate";
} }
/** /**
* HPKC007 SQL 定义 * HGKC007 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC007 { public class HGKC007A {
// 查询 // 查询
public static final String QUERY_SUM = "HPKC007.querySum"; public static final String QUERY_SUM = "HGKC007A.querySum";
// 锁 // 锁
public static final String LOCK = "HPKC007.lock"; public static final String LOCK = "HGKC007A.lock";
// 统计 // 统计
public static final String STAT_DATE = "HPKC007.statDate"; public static final String STAT_DATE = "HGKC007A.statDate";
} }
/** /**
* HPKC008 SQL 定义 * HGKC008 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC008 { public class HGKC008 {
// 查询 // 查询
public static final String QUERY_SUM = "HPKC008.querySum"; public static final String QUERY_SUM = "HGKC008.querySum";
} }
/** /**
* HPKC009 SQL 定义 * HGKC009 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC009 { public class HGKC009 {
// 按日期删除 // 按日期删除
public static final String DELETE_BY_TIME = "HPKC009.deleteByTime"; public static final String DELETE_BY_TIME = "HGKC009.deleteByTime";
// 查询 // 查询
public static final String QUERY = "HPKC009.query"; public static final String QUERY = "HGKC009.query";
// 查询统计 // 查询统计
public static final String QUERY_SUM = "HPKC009.querySum"; public static final String QUERY_SUM = "HGKC009.querySum";
} }
/** /**
* HPKC009A SQL 定义 * HGKC009A SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC009A { public class HGKC009A {
// 按日期删除 // 按日期删除
public static final String DELETE_BY_TIME = "HPKC009A.deleteByTime"; public static final String DELETE_BY_TIME = "HGKC009A.deleteByTime";
// 查询 // 查询
public static final String QUERY = "HPKC009A.query"; public static final String QUERY = "HGKC009A.query";
// 查询统计 // 查询统计
public static final String QUERY_SUM = "HPKC009A.querySum"; public static final String QUERY_SUM = "HGKC009A.querySum";
} }
/** /**
* HPKC010 SQL 定义 * HGKC010 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC010 { public class HGKC010 {
// 锁 // 锁
public static final String LOCK = "HPKC010.lock"; public static final String LOCK = "HGKC010.lock";
} }
/** /**
* HPKC010A SQL 定义 * HGKC010A SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC010A { public class HGKC010A {
// 按日期删除 // 按日期删除
public static final String DELETE_BY_TIME = "HPKC010A.deleteByTime"; public static final String DELETE_BY_TIME = "HGKC010A.deleteByTime";
// 备份数量 // 备份数量
public static final String BACKUP = "HPKC010A.backup"; public static final String BACKUP = "HGKC010A.backup";
} }
/** /**
* HPKC011 SQL 定义 * HGKC011 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC011 { public class HGKC011 {
// 锁 // 锁
public static final String LOCK = "HPKC011.lock"; public static final String LOCK = "HGKC011.lock";
} }
/** /**
* HPKC011A SQL 定义 * HGKC011A SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC011A { public class HGKC011A {
// 按日期删除 // 按日期删除
public static final String DELETE_BY_TIME = "HPKC011A.deleteByTime"; public static final String DELETE_BY_TIME = "HGKC011A.deleteByTime";
// 备份数量 // 备份数量
public static final String BACKUP = "HPKC011A.backup"; public static final String BACKUP = "HGKC011A.backup";
} }
/** /**
* HPKC012 SQL 定义 * HGKC012 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC012 { public class HGKC012 {
// 锁 // 锁
public static final String QUERY = "HPKC012.query"; public static final String QUERY = "HGKC012.query";
} }
/** /**
* HPKC013 SQL 定义 * HGKC013 SQL 定义
* *
* @author:songx * @author:songx
* @date:2024/1/20,16:45 * @date:2024/1/20,16:45
*/ */
public class HPKC013 { public class HGKC013 {
// 锁 // 锁
public static final String UPDATE_STATUS = "HPKC013.updateStatus"; public static final String UPDATE_STATUS = "HGKC013.updateStatus";
} }
/** /**
......
...@@ -199,4 +199,23 @@ ...@@ -199,4 +199,23 @@
<include refid="idCondition"/> <include refid="idCondition"/>
</update> </update>
<!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC001">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
SPEC_ID AS "specId",
COALESCE(SUM(DEPOSIT_QTY), 0) AS "depositQty",
COALESCE(SUM(DEPOSIT_WEIGHT), 0) AS "depositWeight"
FROM ${hggpSchema}.HGKC001
WHERE 1=1
<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
</select>
</sqlMap> </sqlMap>
...@@ -342,4 +342,23 @@ ...@@ -342,4 +342,23 @@
ID = #id# ID = #id#
</update> </update>
<!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC006A">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(AMOUNT), 0) AS "amount",
COALESCE(SUM(INV_WEIGHT), 0) AS "invWeight"
FROM ${hggpSchema}.HGKC006A
WHERE 1=1
<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
</select>
</sqlMap> </sqlMap>
...@@ -335,4 +335,24 @@ ...@@ -335,4 +335,24 @@
ID = #id# ID = #id#
</update> </update>
<!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC007A">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(INV_QTY), 0) AS "invQty",
COALESCE(SUM(INV_WEIGHT), 0) AS "invWeight"
FROM ${hggpSchema}.HGKC007A
WHERE 1=1
<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
</select>
</sqlMap> </sqlMap>
...@@ -233,4 +233,23 @@ ...@@ -233,4 +233,23 @@
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete> </delete>
<!-- 统计库存 -->
<select id="statDate" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008A">
SELECT
COMPANY_CODE AS "companyCode",
DEP_CODE AS "depCode",
WH_CODE AS "whCode",
INVENT_TYPE AS "inventType",
INVENT_CODE AS "inventCode",
INVENT_RECORD_ID AS "inventRecordId",
COALESCE(SUM(INV_QTY), 0) AS "invQty",
COALESCE(SUM(INV_WEIGHT), 0) AS "invWeight"
FROM ${hggpSchema}.HGKC008A
WHERE 1=1
<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
</select>
</sqlMap> </sqlMap>
...@@ -48,7 +48,7 @@ public class HGKCTools { ...@@ -48,7 +48,7 @@ public class HGKCTools {
} }
Map paramMap = new HashMap(); Map paramMap = new HashMap();
paramMap.put("depositNos", depositNos); paramMap.put("depositNos", depositNos);
DaoBase.getInstance().update(HGSqlConstant.HgKc001.LOCK, paramMap); DaoBase.getInstance().update(HGSqlConstant.HGKC001.LOCK, paramMap);
} }
/** /**
......
package com.baosight.hggp.hg.pz.tools; package com.baosight.hggp.hg.pz.tools;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
...@@ -81,6 +82,63 @@ public class HGPZTools { ...@@ -81,6 +82,63 @@ public class HGPZTools {
} }
/** /**
* HGPZ004 公共DAO定义
*
* @author:songx
* @date:2024/2/6,13:37
*/
public static class hgpz004 {
/**
* 查询存货
*
* @param inventCode
* @return
*/
public static HGPZ004 getByCode(String inventCode) {
AssertUtils.isEmpty(inventCode, "存货编码不能为空");
Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode);
List<HGPZ004> pz004s = DaoBase.getInstance().query(HGPZ004.QUERY, queryMap);
if(pz004s!=null&&pz004s.size()==0){
pz004s = null;
}
AssertUtils.isEmpty(pz004s, String.format("存货编码[%s]不存在", inventCode));
return pz004s.get(0);
}
/**
* 查询存货信息
*
* @param inventCodes
* @return
*/
public static List<HGPZ004> list(List<String> inventCodes) {
if (CollectionUtils.isEmpty(inventCodes)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("inventCodes", inventCodes);
return DaoBase.getInstance().query(HGPZ004.QUERY, queryMap);
}
/**
* 查询存货信息
*
* @param inventCodes
* @return
*/
public static Map<String, HGPZ004> map(List<String> inventCodes) {
List<HGPZ004> pz004s = list(inventCodes);
if (CollectionUtils.isEmpty(pz004s)) {
return null;
}
return pz004s.stream().collect(Collectors.toMap(HGPZ004::getInventType, item -> item));
}
}
/**
* 仓库管理 * 仓库管理
* HPPZ007 公共DAO定义 * HPPZ007 公共DAO定义
* *
...@@ -102,6 +160,35 @@ public class HGPZTools { ...@@ -102,6 +160,35 @@ public class HGPZTools {
List<HGPZ007> results = DaoBase.getInstance().query(HGPZ007.QUERY, queryMap); List<HGPZ007> results = DaoBase.getInstance().query(HGPZ007.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
/**
* 查询仓库信息
*
* @param whCodes
* @return
*/
public static List<HGPZ007> list(List<String> whCodes) {
if (CollectionUtils.isEmpty(whCodes)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("whCodes", whCodes);
return DaoBase.getInstance().query("HGPZ007.query", queryMap);
}
/**
* 查询仓库信息
*
* @param whCodes
* @return
*/
public static Map<String, HGPZ007> map(List<String> whCodes) {
List<HGPZ007> pz007s = list(whCodes);
if (CollectionUtils.isEmpty(pz007s)) {
return null;
}
return pz007s.stream().collect(Collectors.toMap(HGPZ007::getWhCode, item -> item));
}
} }
/** /**
...@@ -344,7 +431,7 @@ public class HGPZTools { ...@@ -344,7 +431,7 @@ public class HGPZTools {
public static HGPZ005 checkAndSave(Integer inventType, String inventName, BigDecimal length, public static HGPZ005 checkAndSave(Integer inventType, String inventName, BigDecimal length,
BigDecimal width, BigDecimal thick, BigDecimal coefficient, String material, String unit) { BigDecimal width, BigDecimal thick, BigDecimal coefficient, String material, String unit) {
// 检查存货名称是否存在 // 检查存货名称是否存在
//String inventCode = HGPZTools.HpPz004.checkAndSave(inventType, inventName); //String inventCode = HGPZTools.HGPZ004.checkAndSave(inventType, inventName);
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("inventType", inventType); queryMap.put("inventType", inventType);
//queryMap.put("inventCode", inventCode); //queryMap.put("inventCode", inventCode);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/> <EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center"/> <EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/> <EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="true" width="120" align="center" required="true"/> <EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="false" width="120" align="center"/> <EF:EFColumn ename="blueprintName" cname="蓝图名称" enable="false" width="120" align="center"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment