Commit 3891d88f by 宋祥

1.生产库存收发存统计

parent 2bf7b156
...@@ -189,7 +189,7 @@ public class HPSqlConstant { ...@@ -189,7 +189,7 @@ public class HPSqlConstant {
public class HPKC010A { public class HPKC010A {
// 按日期删除 // 按日期删除
public static final String DELETE_BY_TIME = "HPKC009.deleteByTime"; public static final String DELETE_BY_TIME = "HPKC010A.deleteByTime";
// 备份数量 // 备份数量
public static final String BACKUP = "HPKC010A.backup"; public static final String BACKUP = "HPKC010A.backup";
} }
...@@ -207,6 +207,20 @@ public class HPSqlConstant { ...@@ -207,6 +207,20 @@ public class HPSqlConstant {
} }
/** /**
* HPKC011A SQL 定义
*
* @author:songx
* @date:2024/1/20,16:45
*/
public class HPKC011A {
// 按日期删除
public static final String DELETE_BY_TIME = "HPKC011A.deleteByTime";
// 备份数量
public static final String BACKUP = "HPKC011A.backup";
}
/**
* HPPZ010 SQL 定义 * HPPZ010 SQL 定义
* *
* @author:songx * @author:songx
......
package com.baosight.hpjx.hp.kc.service;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
/**
* @author:songx
* @date:2024/1/25,18:49
*/
public class ServiceHPKC011A extends ServiceBase {
/**
* 备份数据
*
* @param inInfo
* @return
*/
public EiInfo backup(EiInfo inInfo) {
try {
Map queryMap = new HashMap();
queryMap.put("dateProc", LocalDate.now().minusDays(1).format(DateUtils.SHORT_DATE));
// 清除数据
dao.delete(HPSqlConstant.HPKC011A.DELETE_BY_TIME, queryMap);
// 备份数据
dao.insert(HPSqlConstant.HPKC011A.BACKUP, queryMap);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("备份数据成功");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
}
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
WH_NAME as "whName", <!-- 仓库名称 --> WH_NAME as "whName", <!-- 仓库名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 --> INVENT_CODE as "inventCode", <!-- 部件编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 --> INVENT_NAME as "inventName", <!-- 部件名称 -->
PART_CODE as "partCode", <!-- 零件编码 --> SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 --> SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
INIT_AMOUNT as "initAmount", <!-- 期初数量 --> INIT_AMOUNT as "initAmount", <!-- 期初数量 -->
INIT_WEIGHT as "initWeight", <!-- 期初重量 --> INIT_WEIGHT as "initWeight", <!-- 期初重量 -->
ENTER_AMOUNT as "enterAmount", <!-- 入库数量 --> ENTER_AMOUNT as "enterAmount", <!-- 入库数量 -->
...@@ -80,17 +80,17 @@ ...@@ -80,17 +80,17 @@
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName# PROJ_NAME = #projName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtCode"> <isNotEmpty prepend=" AND " property="inventCode">
PRDT_CODE = #prdtCode# INVENT_CODE = #inventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="prdtName"> <isNotEmpty prepend=" AND " property="inventName">
PRDT_NAME = #prdtName# INVENT_NAME = #inventName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partCode"> <isNotEmpty prepend=" AND " property="subInventCode">
PART_CODE = #partCode# SUB_INVENT_CODE = #subInventCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="partName"> <isNotEmpty prepend=" AND " property="subInventName">
PART_NAME = #partName# SUB_INVENT_NAME = #subInventName#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</dynamic> </dynamic>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.gxzl.common.mc.domain.THpkc009a"> <select id="query" parameterClass="java.util.HashMap" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC009A">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPKC009A FROM ${hpjxSchema}.T_HPKC009A
...@@ -151,10 +151,10 @@ ...@@ -151,10 +151,10 @@
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
PRDT_CODE, <!-- 产品编码 --> INVENT_CODE, <!-- 部件编码 -->
PRDT_NAME, <!-- 产品名称 --> INVENT_NAME, <!-- 部件名称 -->
PART_CODE, <!-- 零件编码 --> SUB_INVENT_CODE, <!-- 零件编码 -->
PART_NAME, <!-- 零件名称 --> SUB_INVENT_NAME, <!-- 零件名称 -->
INIT_AMOUNT, <!-- 期初数量 --> INIT_AMOUNT, <!-- 期初数量 -->
INIT_WEIGHT, <!-- 期初重量 --> INIT_WEIGHT, <!-- 期初重量 -->
ENTER_AMOUNT, <!-- 入库数量 --> ENTER_AMOUNT, <!-- 入库数量 -->
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#dateType#, #dateProc#, #whCode#, #whName#, #projCode#, #projName#, #dateType#, #dateProc#, #whCode#, #whName#, #projCode#, #projName#,
#prdtCode#, #prdtName#, #partCode#, #partName#, #initAmount#, #initWeight#, #inventCode#, #inventName#, #subInventCode#, #subInventName#, #initAmount#, #initWeight#,
#enterAmount#, #enterWeight#, #outerAmount#, #outerWeight#, #pdDiffAmount#, #enterAmount#, #enterWeight#, #outerAmount#, #outerWeight#, #pdDiffAmount#,
#pdDiffWeight#, #endAmount#, #endWeight# #pdDiffWeight#, #endAmount#, #endWeight#
) )
......
...@@ -191,16 +191,16 @@ ...@@ -191,16 +191,16 @@
<!-- 备份数据 --> <!-- 备份数据 -->
<insert id="backup"> <insert id="backup">
INSERT INTO ${hpjxSchema}.T_HPKC011A ( INSERT INTO ${hpjxSchema}.T_HPKC011A (
COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME, INVENT_TYPE, COMPANY_CODE, DEP_CODE, DATE_PROC, WH_CODE, WH_NAME, PROD_NO, PROJ_CODE,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT, PROJ_NAME, INVENT_CODE, INVENT_NAME, SUB_INVENT_CODE, SUB_INVENT_NAME, LENGTH,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME, WIDTH, THICK, AMOUNT, UNIT_WEIGHT, WEIGHT, REMARK, CREATED_BY, CREATED_NAME,
UPDATED_TIME, VERSION CREATED_TIME, UPDATED_BY, UPDATED_NAME, UPDATED_TIME, VERSION
) )
SELECT SELECT
COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME, INVENT_TYPE, COMPANY_CODE, DEP_CODE, #dateProc#, WH_CODE, WH_NAME, PROD_NO, PROJ_CODE,
INVENT_CODE, INVENT_NAME, INVENT_RECORD_ID, AMOUNT, WEIGHT, PROJ_NAME, INVENT_CODE, INVENT_NAME, SUB_INVENT_CODE, SUB_INVENT_NAME, LENGTH,
CREATED_BY, CREATED_NAME, CREATED_TIME, UPDATED_BY, UPDATED_NAME, WIDTH, THICK, AMOUNT, UNIT_WEIGHT, WEIGHT, REMARK, CREATED_BY, CREATED_NAME,
UPDATED_TIME, VERSION CREATED_TIME, UPDATED_BY, UPDATED_NAME, UPDATED_TIME, VERSION
FROM ${hpjxSchema}.T_HPKC011 FROM ${hpjxSchema}.T_HPKC011
</insert> </insert>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-01-10 9:33:44
Version : 1.0
tableName :hpjx.t_hpsc001
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
PROJ_TYPE TINYINT,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PRINC1 VARCHAR,
PRINC2 VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_TIME DATETIME,
UPDATED_BY VARCHAR,
UPDATED_TIME DATETIME,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HPSC001"> <sqlMap namespace="HPSC001">
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -66,6 +48,9 @@ ...@@ -66,6 +48,9 @@
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCodes">
PROJ_CODE IN <iterate close=")" open="(" conjunction="," property="projCodes">#projCodes[]#</iterate>
</isNotEmpty>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isEmpty property="orderBy"> <isEmpty property="orderBy">
CREATED_TIME desc CREATED_TIME desc
...@@ -101,6 +86,9 @@ ...@@ -101,6 +86,9 @@
<isNotEmpty prepend=" AND " property="materialStatus"> <isNotEmpty prepend=" AND " property="materialStatus">
MATERIAL_STATUS = #materialStatus# MATERIAL_STATUS = #materialStatus#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="projCodes">
PROJ_CODE IN <iterate close=")" open="(" conjunction="," property="projCodes">#projCodes[]#</iterate>
</isNotEmpty>
</select> </select>
<!-- <!--
......
...@@ -3,7 +3,16 @@ package com.baosight.hpjx.hp.sc.tools; ...@@ -3,7 +3,16 @@ package com.baosight.hpjx.hp.sc.tools;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.sc.domain.*; import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.sc.domain.HPSC002;
import com.baosight.hpjx.hp.sc.domain.HPSC003;
import com.baosight.hpjx.hp.sc.domain.HPSC004;
import com.baosight.hpjx.hp.sc.domain.HPSC005;
import com.baosight.hpjx.hp.sc.domain.HPSC005A;
import com.baosight.hpjx.hp.sc.domain.HPSC005B;
import com.baosight.hpjx.hp.sc.domain.HPSC005C;
import com.baosight.hpjx.hp.sc.domain.HPSC006;
import com.baosight.hpjx.hp.sc.domain.HPSC007;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.StringUtils; import com.baosight.hpjx.util.StringUtils;
...@@ -137,6 +146,35 @@ public class HPSCTools { ...@@ -137,6 +146,35 @@ public class HPSCTools {
AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode)); AssertUtils.isNull(results, String.format("项目编码[%s]信息不存在", projCode));
return results.get(0); return results.get(0);
} }
/**
* 查询
*
* @param projCodes
* @return
*/
public static List<HPSC001> list(List<String> projCodes) {
if (CollectionUtils.isEmpty(projCodes)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("projCodes", projCodes);
return DaoBase.getInstance().query("HPSC001.query", queryMap);
}
/**
* 查询
*
* @param projCodes
* @return
*/
public static Map<String, HPSC001> map(List<String> projCodes) {
List<HPSC001> results = list(projCodes);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HPSC001::getProjCode, item -> item));
}
} }
/** /**
......
...@@ -78,7 +78,7 @@ function tearAssign(prodOrderNo) { ...@@ -78,7 +78,7 @@ function tearAssign(prodOrderNo) {
/** /**
* 生产订单详情 * 生产订单详情
* *
* @param productionOrderNo * @param prodOrderNo
*/ */
function tearDetails(prodOrderNo) { function tearDetails(prodOrderNo) {
JSColorbox.open({ JSColorbox.open({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment