Commit 01197d04 by 江和松

Merge remote-tracking branch 'origin/dev' into dev

parents 60f12331 64d215fe
...@@ -70,7 +70,7 @@ public enum DdynamicEnum { ...@@ -70,7 +70,7 @@ public enum DdynamicEnum {
* 用途:存货类型下拉框 (不默认状态) * 用途:存货类型下拉框 (不默认状态)
* 编写: * 编写:
*/ */
INVENT_TYPE_BOX_BLOCK_ID("invent_type_box_block_id","inventType","inventTypeName","status","HGPZ004.queryInventTypeBox"), INVENT_TYPE_BOX_BLOCK_ID("invent_type_box_block_id","inventType","inventTypeName","status","parInventType","HGPZ004.queryInventTypeBox"),
/** /**
* 模块:存货类型 * 模块:存货类型
...@@ -84,14 +84,14 @@ public enum DdynamicEnum { ...@@ -84,14 +84,14 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框 * 用途:存货档案下拉框
* 编写: * 编写:
*/ */
INVENT_RECORD_BLOCK_ID("invent_record_block_id","inventCode","inventName","HGPZ005.queryComboBox"), INVENT_RECORD_BLOCK_ID("invent_record_block_id","inventCode","inventName","inventType","spec","HGPZ005.queryComboBox"),
/** /**
* 模块:存货档案 * 模块:存货档案
* 用途:存货档案下拉框 (不默认状态) * 用途:存货档案下拉框 (不默认状态)
* 编写: * 编写:
*/ */
INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","status","HGPZ005.queryInventCodeBox"), INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","status","id","inventType","spec","material","unit","HGPZ005.queryInventCodeBox"),
/** /**
* 模块:存货档案 * 模块:存货档案
...@@ -189,7 +189,7 @@ public enum DdynamicEnum { ...@@ -189,7 +189,7 @@ public enum DdynamicEnum {
* 用途:仓库档案下拉框 不默认状态 * 用途:仓库档案下拉框 不默认状态
* 编写: * 编写:
*/ */
WH_CODE_BLOCK_ID("wh_code_block_id", "whCode", "whName","status", "HGPZ007.queryWhCodeBox"), WH_CODE_BLOCK_ID("wh_code_block_id", "whCode", "whName","status","whType", "HGPZ007.queryWhCodeBox"),
/** /**
* 模块:厂区管理 * 模块:厂区管理
......
...@@ -183,10 +183,11 @@ public class ServiceHGKC006 extends ServiceBase { ...@@ -183,10 +183,11 @@ public class ServiceHGKC006 extends ServiceBase {
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!"); eiInfo.setMsg("提交成功!");
} catch (PlatException e) { } catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE); //eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("提交失败,原因参见详细错误描述!"); //eiInfo.setMsg("提交失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage()); //eiInfo.setDetailMsg(e.getMessage());
logError("提交失败!", e.getMessage()); LogUtils.setDetailMsg(eiInfo, e, "提交失败");
//logError("提交失败!", e.getMessage());
return eiInfo; return eiInfo;
} }
return eiInfo; return eiInfo;
......
...@@ -26,7 +26,7 @@ public class ServiceHGKC012 extends ServiceEPBase { ...@@ -26,7 +26,7 @@ public class ServiceHGKC012 extends ServiceEPBase {
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
inInfo = super.query(inInfo, HGKC012.QUERY); inInfo = super.query(inInfo, HGKC012.QUERY);
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("inventTypes", DEFAULT_INVENT_CODE); //queryMap.put("inventTypes", DEFAULT_INVENT_CODE);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null,true); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_BLOCK_ID), null,true);
CommonMethod.initBlock(inInfo, Arrays.asList( CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID, DdynamicEnum.WH_RECORD_BLOCK_ID,
......
package com.baosight.hggp.hg.mt.service;
import com.baosight.hggp.hg.pz.domain.HGPZ009A;
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.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/6/19
*/
public class ServiceHGMT002 extends ServiceBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return super.initLoad(inInfo);
}
/**
* 生产管理-滚动图片
*
* @param inInfo
* @return
*/
public Map pmBannerList(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String companyCode = inInfo.getString(HGPZ009A.FIELD_ACCOUNT_CODE);
Map sqlMap = new HashMap();
sqlMap.put(HGPZ009A.FIELD_ACCOUNT_CODE, companyCode);
List<Map> rows = this.dao.query("HGMT002.pmBannerList", sqlMap);
resultMap.put(EiConstant.resultBlock,rows);
resultMap.put(EiConstant.status, EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put(EiConstant.status, 500);
resultMap.put("message", LogUtils.getMsg(e));
return resultMap;
}
}
}
<?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="HGMT002">
<select id="pmProject" resultClass="java.util.HashMap">
<!-- SELECT * FROM (-->
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PLAN_INFO_NO as "planInfoNo", <!-- 生产计划单号 -->
PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
STATUS as "status", <!-- 状态 0-计划中,1-生产中 -->
CONCAT((
SELECT
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
FROM
${hggpSchema}.T_HPSC004
WHERE
PARENT_ID = ${hggpSchema}.T_HPSC003.PLAN_INFO_NO
),'%') AS "schedule", <!-- 进度 -->
(
SELECT
IFNULL( SUM( ACTUAL_COMPLETION_UNIT_WT ), 0 )
FROM
${hggpSchema}.T_HPSC004
WHERE
PARENT_ID = ${hggpSchema}.T_HPSC003.PLAN_INFO_NO
) AS "actualCompletionNum" <!-- 完成重量 -->
,
(
SELECT
IFNULL( SUM( TOTAL_WT ),2)
FROM
${hggpSchema}.T_HPSC004
WHERE
PARENT_ID = ${hggpSchema}.T_HPSC003.PLAN_INFO_NO
) AS "num" <!-- 计划重量 -->
FROM ${hggpSchema}.T_HPSC003 WHERE COMPANY_CODE= #companyCode#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
order by STATUS,PLAN_COMPLETION_DATE
<!-- ) AS A WHERE actualCompletionNum!=num-->
limit #offset#, #pageSize#
</select>
<select id="pmProjectCount" resultClass="java.util.HashMap">
<!-- SELECT * FROM (-->
SELECT
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
PROJ_TYPE as "projType", <!-- 项目类型 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PLAN_INFO_NO as "planInfoNo", <!-- 生产计划单号 -->
PLAN_COMPLETION_DATE as "planCompletionDate", <!-- 计划完成日期 -->
STATUS as "status", <!-- 状态 0-计划中,1-生产中 -->
CONCAT((
SELECT
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
FROM
${hggpSchema}.T_HPSC004
WHERE
PARENT_ID = ${hggpSchema}.T_HPSC003.PLAN_INFO_NO
),'%') AS "schedule", <!-- 进度 -->
(
SELECT
IFNULL( SUM( ACTUAL_COMPLETION_UNIT_WT ), 0 )
FROM
${hggpSchema}.T_HPSC004
WHERE
PARENT_ID = ${hggpSchema}.T_HPSC003.PLAN_INFO_NO
) AS "actualCompletionNum" <!-- 完成重量 -->
,
(
SELECT
IFNULL( SUM( TOTAL_WT ),2)
FROM
${hggpSchema}.T_HPSC004
WHERE
PARENT_ID = ${hggpSchema}.T_HPSC003.PLAN_INFO_NO
) AS "num" <!-- 计划重量 -->
FROM ${hggpSchema}.T_HPSC003 WHERE COMPANY_CODE= #companyCode#
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
order by STATUS,PLAN_COMPLETION_DATE
<!-- ) AS A WHERE actualCompletionNum!=num-->
</select>
<select id="pmQuality" resultClass="java.util.HashMap">
SELECT
POOR_TYPE,<!-- 不良品类 -->
COUNT(POOR_TYPE) AS POOR_TYPE_NUM,<!-- 单种不良品类数量 -->
CONCAT( FORMAT(COUNT(POOR_TYPE)/ (
SELECT COUNT(*) FROM ${hggpSchema}.t_hpzl001 WHERE
COMPANY_CODE=#companyCode#
<isNotEmpty prepend=" AND " property="queryMonth">
SUBSTR(CREATED_TIME,1,6) = #queryMonth#
</isNotEmpty>
and SUBSTR(CREATED_TIME,1,6) = #queryMonth# )* 100,2),'%') AS NUM,
ITEM_CNAME AS ITEM_CNAME
FROM ${hggpSchema}.t_hpzl001 A LEFT JOIN (
SELECT
ITEM_CODE,
ITEM_CNAME
FROM ${platSchema}.TEDCM01
WHERE CODESET_CODE = '${hggpSchema}.${hggpSchema}.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# AND DELETE_FLAG =0
<isNotEmpty prepend=" AND " property="queryMonth">
SUBSTR(CREATED_TIME,1,6) = #queryMonth#
</isNotEmpty>
GROUP BY POOR_TYPE
</select>
<select id="pmQualityList" resultClass="java.util.HashMap">
SELECT
ID as "id",
CHECK_NO as "checkNo", <!-- 检查单号 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
POOR_TYPE as "poorType", <!-- 不良品类 -->
STATUS as "status", <!-- 单据状态 0未处理 1已处理 -->
B.ITEM_CNAME AS "itemCname"
FROM ${hggpSchema}.t_hpzl001 A LEFT JOIN (
SELECT
ITEM_CODE,
ITEM_CNAME
FROM ${platSchema}.TEDCM01
WHERE CODESET_CODE = '${hggpSchema}.${hggpSchema}.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
order by STATUS
limit #offset#, #pageSize#
</select>
<select id="pmQualityCount" resultClass="int">
SELECT
COUNT(*)
FROM ${hggpSchema}.t_hpzl001
WHERE COMPANY_CODE= #companyCode# AND STATUS=#status# AND DELETE_FLAG =0
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
</select>
<select id="pmQualityDetail" resultClass="java.util.HashMap">
SELECT
ID as "id",
CHECK_NO as "checkNo", <!-- 检查单号 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
INVENT_CODE as "inventCode", <!-- 部件编码 -->
INVENT_NAME as "inventName", <!-- 部件名称 -->
SUB_INVENT_CODE as "subInventCode", <!-- 零件编码 -->
SUB_INVENT_NAME as "subInventName", <!-- 零件名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ORG_NO as "orgNo", <!-- 生产组编码 -->
ORG_NAME as "orgName", <!-- 生产组名称 -->
POOR_TYPE as "poorType", <!-- 不良品类 -->
PROBLEM_DESC as "problemDesc", <!-- 质量问题描述 -->
CHECK_USER as "checkUser", <!-- 检查人 -->
CHECK_USER_NAME as "checkUserName", <!-- 检查人名称 -->
STATUS as "status", <!-- 单据状态 0未处理 1已处理 -->
B.ITEM_CNAME AS "itemCname"
FROM ${hggpSchema}.t_hpzl001 A LEFT JOIN (
SELECT
ITEM_CODE,
ITEM_CNAME
FROM ${platSchema}.TEDCM01
WHERE CODESET_CODE = '${hggpSchema}.${hggpSchema}.poorType'
) B ON A.POOR_TYPE =B.ITEM_CODE
WHERE COMPANY_CODE= #companyCode#
AND DELETE_FLAG = 0 AND ID = #id#
order by STATUS
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.t_hpzl001 (
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
RECEIPT_DATE, <!-- 单据日期 -->
CHECK_NO, <!-- 检查单号 -->
PROD_ORDER_NO, <!-- 生产订单号 -->
PROD_TASK_NO, <!-- 生产任务号 -->
PROJ_CODE, <!-- 项目号 -->
PROJ_NAME, <!-- 项目名称 -->
INVENT_CODE, <!-- 部件编码 -->
INVENT_NAME, <!-- 部件名称 -->
SUB_INVENT_CODE, <!-- 零件编码 -->
SUB_INVENT_NAME, <!-- 零件名称 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂 -->
ORG_NO, <!-- 生产组编码 -->
ORG_NAME, <!-- 生产组名称 -->
POOR_TYPE, <!-- 不良品类 -->
PROBLEM_DESC, <!-- 质量问题描述 -->
CHECK_USER , <!-- 检查人 -->
CHECK_USER_NAME, <!-- 检查人名称 -->
STATUS, <!-- 单据状态 0未处理 1已处理 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG <!-- 是否删除 -->
) VALUES (
#companyCode#, #depCode#, #receiptDate#, #checkNo#, #prodOrderNo#, #prodTaskNo#,
#projCode#, #projName#, #inventCode#, #inventName#, #subInventCode#, #subInventName#,
#orgNo#, #orgName#, #poorType#, #problemDesc#,#checkUser#,#checkUserName#, #status#,
#createdBy#, #createdName#, #createdTime#, #deleteFlag#)
</insert>
<select id="queryFile" resultClass="java.util.HashMap">
SELECT URL FROM ${platSchema}.TEUDM05 where RES_ID=#docId#
</select>
<select id="queryFactory" resultClass="java.util.HashMap">
SELECT DISTINCT
B.FACTORY_CODE as "factoryCode",
B.FACTORY_NAME as "factoryName"
FROM ${hggpSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hggpSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
</select>
<select id="queryOrgNo" resultClass="java.util.HashMap">
SELECT DISTINCT
B.ORG_NO as "orgNo",
B.ORG_NAME as "orgName"
FROM ${hggpSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hggpSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
</select>
<select id="queryProjCode" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PROJ_CODE as "projCode",
A.PROJ_NAME as "projName"
FROM ${hggpSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hggpSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
</select>
<select id="queryPrdtCode" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PRDT_CODE as "prdtCode",
A.PRDT_NAME as "prdtName",
A.PRDT_SPEC as "prdtSpec"
FROM ${hggpSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hggpSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodCode">
A.PROJ_CODE = #prodCode#
</isNotEmpty>
</select>
<select id="queryPartCode" resultClass="java.util.HashMap">
SELECT DISTINCT
A.PART_CODE as "partCode",
A.PART_NAME as "partName",
A.PART_SPEC as "partSpec"
FROM ${hggpSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hggpSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodCode">
A.PROJ_CODE = #prodCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtCode">
A.PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
</select>
<select id="queryProdTaskNo" resultClass="java.util.HashMap">
SELECT DISTINCT
B.PROD_TASK_NO as "prodTaskNo",
B.PROD_ORDER_NO as "prodorderNo"
FROM ${hggpSchema}.`t_hpsc005` A LEFT JOIN (
SELECT * FROM ${hggpSchema}.`t_hpsc005a` WHERE COMPANY_CODE=#companyCode#
) B ON A.PROD_ORDER_NO=B.PROD_ORDER_NO WHERE A.COMPANY_CODE=#companyCode#
AND A.STATUS IN('1','2') AND B.NUM!=B.COMPLETE_NUM
<isNotEmpty prepend=" AND " property="factoryCode">
B.FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orgNo">
B.ORG_NO = #orgNo#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prodCode">
A.PROJ_CODE = #prodCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentPrdtCode">
A.PRDT_CODE = #parentPrdtCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subInventCode">
A.PART_CODE = #subInventCode#
</isNotEmpty>
LIMIT 1
</select>
<select id="queryFvalue" resultClass="java.util.HashMap">
SELECT DISTINCT FVALUE AS "fvalue" FROM ${platSchema}.TEDCC03 WHERE FKEY='docRootDir'
</select>
<select id="pmBannerList" resultClass="java.util.HashMap">
select DOC_ID from ${hggpSchema}.HGPZ009A where 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
</select>
<select id="pmStatusList" resultClass="java.util.HashMap">
select a.*,b.PROJ_STATUS,c.PARENT_ID
from ${hggpSchema}.t_hpsc001 a
left join
(select A.COMPANY_CODE,A.PROJ_CODE ,sum(ifnull(A.NUM,0)) as JHNUM,sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) as RKNUM,sum(ifnull(B.AMOUNT,0)) as CKNUM,
case when sum(ifnull(A.NUM,0)) <![CDATA[ <> ]]> sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) and sum(ifnull(A.NUM,0)) <![CDATA[ <> ]]> sum(ifnull(B.AMOUNT,0)) then 1
when sum(ifnull(A.NUM,0)) = sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) and sum(ifnull(A.NUM,0)) <![CDATA[ <> ]]> sum(ifnull(B.AMOUNT,0)) then 2
when sum(ifnull(A.NUM,0)) = sum(ifnull(A.ACTUAL_COMPLETION_NUM,0)) and sum(ifnull(A.NUM,0)) = sum(ifnull(B.AMOUNT,0)) then 3 else 0 end as PROJ_STATUS
from ${hggpSchema}.T_HPSC004 a
left join ${hggpSchema}.T_HPKC004 b on a.PROJ_CODE = b.PROJ_CODE and a.PRDT_CODE = b.SUB_INVENT_CODE
group by COMPANY_CODE,PROJ_CODE) b on a.COMPANY_CODE = b.COMPANY_CODE and a.PROJ_CODE = b.PROJ_CODE
left join ( select COMPANY_CODE,PROJ_CODE,PARENT_ID
from ${hggpSchema}.T_HPSC002 where PARENT_ID NOT IN ('root') AND DEL_STATUS = 0 and PRDT_TYPE = 4
group by COMPANY_CODE,PROJ_CODE,PARENT_ID) c on a.COMPANY_CODE = c.COMPANY_CODE and a.PROJ_CODE = c.PROJ_CODE
WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projStatus">
b.PROJ_STATUS = #projStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
a.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
</select>
<select id="scOrderPmList" resultClass="java.util.HashMap">
select distinct PROJ_CODE as "projCode",PROJ_NAME as "projName"
from ${hggpSchema}.t_hpsc005
where COMPANY_CODE = #companyCode#
</select>
<select id="scOrderPrdtList" resultClass="java.util.HashMap">
select distinct PRDT_CODE as "prdtCode",PRDT_NAME as "prdtName" from ${hggpSchema}.t_hpsc005
where PROJ_CODE = #projCode# and COMPANY_CODE = #companyCode#
</select>
<select id="scOrderPartList" resultClass="java.util.HashMap">
select distinct PART_CODE as "partCode",PART_NAME as "partName" from ${hggpSchema}.t_hpsc005
where PROJ_CODE = #projCode# and COMPANY_CODE = #companyCode# and PRDT_CODE = #prdtCode#
</select>
<select id="kcPickInventList" resultClass="java.util.HashMap">
select distinct INVENT_CODE as "inventCode",INVENT_NAME as "inventName"
from ${hggpSchema}.T_HPKC010
where COMPANY_CODE = #companyCode# and AMOUNT != 0
</select>
<select id="kcEnterPmList" resultClass="java.util.HashMap">
select distinct A.PROJ_CODE as "projCode",A.PROJ_NAME as "projName"
FROM ${hggpSchema}.T_HPSC005 A
INNER JOIN ${hggpSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
where A.COMPANY_CODE = #companyCode# AND B.NUM - B.COMPLETE_NUM > 0
AND B.ORG_NO != 'R24050801'
</select>
<select id="kcEnterPrdtList" resultClass="java.util.HashMap">
select distinct A.PRDT_CODE as "prdtCode",A.PRDT_NAME as "prdtName"
FROM ${hggpSchema}.T_HPSC005 A
INNER JOIN ${hggpSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
where A.PROJ_CODE = #projCode# and A.COMPANY_CODE = #companyCode#
AND B.NUM - B.COMPLETE_NUM > 0 AND B.ORG_NO != 'R24050801'
</select>
<select id="kcEnterPartList" resultClass="java.util.HashMap">
select distinct A.PART_CODE as "partCode",A.PART_NAME as "partName"
FROM ${hggpSchema}.T_HPSC005 A
INNER JOIN ${hggpSchema}.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
where A.PROJ_CODE = #projCode# and A.COMPANY_CODE = #companyCode#
and A.PRDT_CODE = #prdtCode# AND B.NUM - B.COMPLETE_NUM > 0 AND B.ORG_NO != 'R24050801'
</select>
</sqlMap>
package com.baosight.hggp.hg.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgpz009a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-06-19 16:49:55 create
*/
public class HGPZ009A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* 主键ID*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父级ID*/
public static final String FIELD_MAT_ID = "matId"; /* 物料ID*/
public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件名称*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 修改人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
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"; /* 部门编码 预留*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父级ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件文件*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 修改人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String QUERY = "HGPZ009A.query";
public static final String QUERY_RUN = "HGPZ009A.queryRun";
public static final String QUERY_DEV = "HGPZ009A.queryDev";
public static final String COUNT = "HGPZ009A.count";
public static final String INSERT = "HGPZ009A.insert";
public static final String UPDATE = "HGPZ009A.update";
public static final String DELETE = "HGPZ009A.delete";
private Long id = new Long(0); /* 主键ID*/
private String accountCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private Long parentId = new Long(0); /* 父级ID*/
private String docId = " "; /* 文件ID*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/
private Long matId = new Long(0); /* 物料ID*/
private String docName = " "; /* 文件名称*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("主键ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("父级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("文件ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("修改人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_ID);
eiColumn.setDescName("物料ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGPZ009A() {
initMetaData();
}
/**
* get the id - 主键ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - 主键ID.
*
* @param id - 主键ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 企业编码 预留.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码 预留.
*
* @param accountCode - 企业编码 预留
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码 预留.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码 预留.
*
* @param depCode - 部门编码 预留
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the parentId - 父级ID.
* @return the parentId
*/
public Long getParentId() {
return this.parentId;
}
/**
* set the parentId - 父级ID.
*
* @param parentId - 父级ID
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* get the docId - 文件ID.
* @return the docId
*/
public String getDocId() {
return this.docId;
}
/**
* set the docId - 文件ID.
*
* @param docId - 文件ID
*/
public void setDocId(String docId) {
this.docId = docId;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 修改人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 修改人.
*
* @param updatedBy - 修改人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 修改人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 修改人名称.
*
* @param updatedName - 修改人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 修改时间.
*
* @param updatedTime - 修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
public Long getMatId() {
return matId;
}
public void setMatId(Long matId) {
this.matId = matId;
}
public String getDocName() {
return docName;
}
public void setDocName(String docName) {
this.docName = docName;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
return map;
}
}
...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.pz.service; ...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
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.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
...@@ -132,7 +133,11 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -132,7 +133,11 @@ public class ServiceHGPZ005 extends ServiceBase {
* @throws Exception * @throws Exception
*/ */
private void add(HGPZ005 hgpz005) throws Exception { private void add(HGPZ005 hgpz005) throws Exception {
hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE)); //hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE));
Map<String, Object> params = new HashMap<>();
params.put(HGPZ005.FIELD_INVENT_CODE, hgpz005.getInventCode());
List list = DaoBase.getInstance().query(HGPZ005.QUERY, params);
AssertUtils.isNotEmpty(list, String.format("存货编码[%s]已存在", hgpz005.getInventCode()));
DaoUtils.insert(HGPZ005.INSERT, hgpz005); DaoUtils.insert(HGPZ005.INSERT, hgpz005);
} }
......
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.pz.domain.HGPZ009A;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/6/19
*/
public class ServiceHGPZ009A extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "banner清单",operType = "查询",operDesc = "物料清单-banner清单A-初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ009A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "banner清单",operType = "查询",operDesc = "物料清单-banner清单A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, HGPZ009A.QUERY_RUN, new HGPZ009A());
} else {
inInfo = super.query(inInfo, HGPZ009A.QUERY_DEV, new HGPZ009A());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "banner清单",operType = "新增",operDesc = "物料清单-banner清单A-新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ009A hppz009A = new HGPZ009A();
hppz009A.fromMap(resultRows.get(i));
hppz009A.setCreatedBy(UserSession.getLoginName());
hppz009A.setCreatedName(UserSession.getLoginCName());
hppz009A.setCreatedTime(DateUtils.shortDateTime());
dao.insert(HGPZ009A.INSERT, hppz009A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "banner清单",operType = "删除",operDesc = "物料清单-banner清单A-删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGPZ009A hppz009A = new HGPZ009A();
hppz009A.fromMap(resultRows.get(i));
DaoUtils.update(HGPZ009A.DELETE, hppz009A);
if (!hppz009A.getDocId().isEmpty()) {
this.delectDoc(hppz009A.getDocId());
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "banner清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGPZ009A.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
...@@ -232,6 +232,7 @@ ...@@ -232,6 +232,7 @@
SELECT DISTINCT SELECT DISTINCT
INVENT_TYPE as "inventType", INVENT_TYPE as "inventType",
INVENT_TYPE_NAME as "inventTypeName", INVENT_TYPE_NAME as "inventTypeName",
PAR_INVENT_TYPE as "parInventType",
STATUS AS "status" STATUS AS "status"
FROM ${hggpSchema}.HGPZ004 FROM ${hggpSchema}.HGPZ004
WHERE DELETE_FLAG = 0 WHERE DELETE_FLAG = 0
......
...@@ -299,8 +299,10 @@ ...@@ -299,8 +299,10 @@
<select id="queryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryComboBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT SELECT DISTINCT
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", INVENT_CODE as "inventCode",
INVENT_NAME as "inventName" INVENT_NAME as "inventName",
SPEC as "spec" <!-- 规格 -->
FROM ${hggpSchema}.HGPZ005 FROM ${hggpSchema}.HGPZ005
WHERE DELETE_FLAG = 0 WHERE DELETE_FLAG = 0
AND STATUS=1 AND STATUS=1
...@@ -317,6 +319,11 @@ ...@@ -317,6 +319,11 @@
SELECT DISTINCT SELECT DISTINCT
INVENT_CODE as "inventCode", INVENT_CODE as "inventCode",
INVENT_NAME as "inventName", INVENT_NAME as "inventName",
ID as "id",
INVENT_TYPE as "inventType", <!-- 存货类型 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit",
STATUS as "status" STATUS as "status"
FROM ${hggpSchema}.HGPZ005 FROM ${hggpSchema}.HGPZ005
WHERE DELETE_FLAG = 0 WHERE DELETE_FLAG = 0
......
...@@ -243,6 +243,7 @@ ...@@ -243,6 +243,7 @@
SELECT DISTINCT SELECT DISTINCT
WH_CODE as "whCode", WH_CODE as "whCode",
WH_NAME as "whName", WH_NAME as "whName",
WH_TYPE as "whType",
STATUS as "status" STATUS as "status"
FROM ${hggpSchema}.HGPZ007 FROM ${hggpSchema}.HGPZ007
WHERE DELETE_FLAG = 0 WHERE DELETE_FLAG = 0
......
<?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
Generate time : 2024-06-19 16:49:55
Version : 1.0
schema : hggp
tableName : HGPZ009A
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR NOT NULL,
DEP_CODE VARCHAR NOT NULL,
PARENT_ID BIGINT,
DOC_ID VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR
-->
<sqlMap namespace="HGPZ009A">
<typeAlias alias="HGPZ009A" type="com.baosight.hggp.hg.pz.domain.HGPZ009A"/>
<sql id="column">
A.ID as "id", <!-- 主键ID -->
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
A.DEP_CODE as "depCode", <!-- 部门编码 预留 -->
A.PARENT_ID as "parentId", <!-- 父级ID -->
A.DOC_ID as "docId", <!-- 文件ID -->
A.CREATED_BY as "createdBy", <!-- 创建人 -->
A.CREATED_NAME as "createdName", <!-- 创建人名称 -->
A.CREATED_TIME as "createdTime", <!-- 创建时间 -->
A.UPDATED_BY as "updatedBy", <!-- 修改人 -->
A.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime" <!-- 修改时间 -->
</sql>
<sql id="columnDev">
<include refid="column"/>,
B.DOC_NAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="columnRun">
<include refid="column"/>,
B.RES_CNAME as "docName" <!-- 文件名称 -->
</sql>
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
A.DEP_CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
A.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
A.PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
A.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
A.CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
A.CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
A.CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
A.UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
A.UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
A.UPDATED_TIME = #updatedTime#
</isNotEmpty>
</sql>
<!-- 开发环境 -->
<sql id="conditionDev">
AND A.DOC_ID = B.DOC_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<!-- 正式环境 -->
<sql id="conditionRun">
AND A.DOC_ID = B.RES_ID
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
B.RES_CNAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="createdDateFrom">
A.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
A.CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
A.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="queryDev" resultClass="HGPZ009A">
SELECT
<include refid="columnDev"/>
FROM ${hggpSchema}.HGPZ009A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countDev" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ009A A, ${platSchema}.TEUDM02 B
WHERE 1=1
<include refid="conditionDev"/>
<include refid="customCondition"/>
</select>
<select id="queryRun" resultClass="HGPZ009A">
SELECT
<include refid="columnRun"/>
FROM ${hggpSchema}.HGPZ009A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="countRun" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ009A A, ${platSchema}.TEUDM05 B
WHERE 1=1
<include refid="conditionRun"/>
<include refid="customCondition"/>
</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="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</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>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ009A (ID, <!-- 主键ID -->
ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
PARENT_ID, <!-- 父级ID -->
DOC_ID, <!-- 文件ID -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME <!-- 修改时间 -->
)
VALUES (#id#, #accountCode#, #depCode#, #parentId#, #docId#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ009A WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGPZ009A
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
PARENT_ID = #parentId#, <!-- 父级ID -->
DOC_ID = #docId#, <!-- 文件ID -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
...@@ -31,10 +31,7 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -31,10 +31,7 @@ import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Arrays; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -589,8 +586,10 @@ public class HGPZTools { ...@@ -589,8 +586,10 @@ public class HGPZTools {
* @param list * @param list
*/ */
public static void add(List<Map> list){ public static void add(List<Map> list){
List<HGPZ004> hgpz004s = DaoBase.getInstance().query(HGPZ004.QUERY, new HashMap<>()); List<HGPZ004> hgpz004s = DaoBase.getInstance().query(HGPZ004.QUERY, new HashMap<String, Object>(){{
Map parmap = hgpz004s.stream().collect(Collectors.toMap(HGPZ004::getInventTypeName, HGPZ004::getInventType)); put(HGPZ004.FIELD_STATUS, CommonConstant.YesNo.YES_1);
}});
Map parmap = hgpz004s.stream().filter(item-> !Objects.equals(item.getParInventType(), "root")).collect(Collectors.toMap(HGPZ004::getInventTypeName, HGPZ004::getInventType,(v1, v2) -> v2));
for (Map map:list) { for (Map map:list) {
String inventType = MapUtils.getString(parmap, StringUtils.trimToEmpty(map.get(HGPZ005.FIELD_INVENT_TYPE).toString())); String inventType = MapUtils.getString(parmap, StringUtils.trimToEmpty(map.get(HGPZ005.FIELD_INVENT_TYPE).toString()));
AssertUtils.isEmpty(inventType, String.format("存货类型[%s]代码不存在,添加失败!", inventType)); AssertUtils.isEmpty(inventType, String.format("存货类型[%s]代码不存在,添加失败!", inventType));
...@@ -598,7 +597,11 @@ public class HGPZTools { ...@@ -598,7 +597,11 @@ public class HGPZTools {
hgpz005.fromMap(map); hgpz005.fromMap(map);
hgpz005.setInventType(inventType); hgpz005.setInventType(inventType);
hgpz005.setStatus(1); //默认启用 hgpz005.setStatus(1); //默认启用
hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE)); Map<String, Object> params = new HashMap<>();
params.put(HGPZ005.FIELD_INVENT_CODE, hgpz005.getInventCode());
List hgpz005s = DaoBase.getInstance().query(HGPZ005.QUERY, params);
AssertUtils.isNotEmpty(hgpz005s, String.format("存货编码[%s]已存在", hgpz005.getInventCode()));
//hgpz005.setInventCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INVENT_CODE));
// 设置规格 // 设置规格
if (StringUtils.isBlank(hgpz005.getSpec())) { if (StringUtils.isBlank(hgpz005.getSpec())) {
hgpz005.setSpec(HGPZTools.HgPz005.jointSpec(hgpz005.getLength(), hgpz005.getWidth(), hgpz005.getThick())); hgpz005.setSpec(HGPZTools.HgPz005.jointSpec(hgpz005.getLength(), hgpz005.getWidth(), hgpz005.getThick()));
......
...@@ -37,9 +37,9 @@ $(function () { ...@@ -37,9 +37,9 @@ $(function () {
minLength: 0, minLength: 0,
dataTextField: "textField", dataTextField: "textField",
dataValueField: "valueField", dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#", optionLabelTemplate: "[#:valueField#]#:textField#[#:param2Field#]",
valueTemplate: "[#:valueField#]#:textField#", valueTemplate: "[#:valueField#]#:textField#[#:param2Field#]",
template: "[#:valueField#]#:textField#", template: "[#:valueField#]#:textField#[#:param2Field#]",
filter: "contains" filter: "contains"
}); });
} }
...@@ -77,7 +77,10 @@ $(function () { ...@@ -77,7 +77,10 @@ $(function () {
{ {
field: "invQty", field: "invQty",
template: function (item) { template: function (item) {
if (Number(item.invQty)>0){
calUnitWeight(item,item.partLength,item.partWidth,item.partThick,item.partCoefficient); calUnitWeight(item,item.partLength,item.partWidth,item.partThick,item.partCoefficient);
}
return item.invQty == 0 ? "-" : item.invQty; return item.invQty == 0 ? "-" : item.invQty;
} }
}, },
...@@ -154,7 +157,8 @@ $(function () { ...@@ -154,7 +157,8 @@ $(function () {
if (e.field == "inventCode") { if (e.field == "inventCode") {
for(let i=0;i<inventRecordBoxBlocks.length;i++){ for(let i=0;i<inventRecordBoxBlocks.length;i++){
if(item.inventCode === inventRecordBoxBlocks[i]['valueField']){ if(item.inventCode === inventRecordBoxBlocks[i]['valueField']){
resultGrid.setCellValue(item, 'inventName', inventRecordBoxBlocks[i]['textField']) resultGrid.setCellValue(item, 'inventType', inventRecordBoxBlocks[i]['param1Field']);
resultGrid.setCellValue(item, 'inventName', inventRecordBoxBlocks[i]['textField']);
} }
} }
let specInInfo = new EiInfo(); let specInInfo = new EiInfo();
...@@ -167,15 +171,17 @@ $(function () { ...@@ -167,15 +171,17 @@ $(function () {
onFail: function (ei) { onFail: function (ei) {
} }
}, {async: false}); }, {async: false});
resultGrid.setCellValue(item, 'partSpecId', "") resultGrid.setCellValue(item, 'partSpecId', specBoxBlocks[0]['param5Field']);
resultGrid.setCellValue(item, 'partSpec', "") resultGrid.setCellValue(item, 'partSpec', specBoxBlocks[0]['valueField']);
resultGrid.setCellValue(item, 'partLength', "") resultGrid.setCellValue(item, 'partLength', specBoxBlocks[0]['param1Field']);
resultGrid.setCellValue(item, 'partWidth', "") resultGrid.setCellValue(item, 'partWidth', specBoxBlocks[0]['param2Field']);
resultGrid.setCellValue(item, 'partThick', "") resultGrid.setCellValue(item, 'partThick', specBoxBlocks[0]['param3Field']);
resultGrid.setCellValue(item, 'partCoefficient', specBoxBlocks[0]['param4Field'])
resultGrid.setCellValue(item, 'invQty', "") resultGrid.setCellValue(item, 'invQty', "")
resultGrid.setCellValue(item, 'invUnitWeight', "") resultGrid.setCellValue(item, 'invUnitWeight', "")
resultGrid.setCellValue(item, 'invWeight', "") resultGrid.setCellValue(item, 'invWeight', "")
loadChange(grid,e,"partSpec"); calUnitWeight(item,item.partLength,item.partWidth,item.partThick,item.partCoefficient);
loadChange(grid,e,"invQty");
} }
if (e.field == "partSpec") { if (e.field == "partSpec") {
for(let i=0;i<specBoxBlocks.length;i++){ for(let i=0;i<specBoxBlocks.length;i++){
...@@ -241,6 +247,8 @@ let calUnitWeight = function (item,length,width,thick,coefficient) { ...@@ -241,6 +247,8 @@ let calUnitWeight = function (item,length,width,thick,coefficient) {
let amount = length * width * thick * coefficient/1000000; let amount = length * width * thick * coefficient/1000000;
//item['amount'] = amount.toString(); //item['amount'] = amount.toString();
resultGrid.setCellValue(item, 'invUnitWeight', amount); resultGrid.setCellValue(item, 'invUnitWeight', amount);
resultGrid.setCellValue(item, 'invWeight', item.invQty*amount);
} }
} }
/** /**
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventCode" cname="存货编码" width="220" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" enable="false"/> <EF:EFColumn ename="inventName" cname="存货名称" width="160" align="center" required="true" enable="false"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" required="true" enable="true"/> <EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" required="true" enable="true"/>
<EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/> <EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="存货档案id" width="120" align="center" required="true" enable="false" hidden="true"/> <EF:EFColumn ename="inventRecordId" cname="存货档案id" width="120" align="center" required="true" enable="false" hidden="true"/>
......
...@@ -19,6 +19,7 @@ $(function () { ...@@ -19,6 +19,7 @@ $(function () {
if(item.inventCode){ if(item.inventCode){
for(let i=0;i<inventRecordBoxBlocks.length;i++){ for(let i=0;i<inventRecordBoxBlocks.length;i++){
if(item.inventCode === inventRecordBoxBlocks[i]['valueField']){ if(item.inventCode === inventRecordBoxBlocks[i]['valueField']){
item.inventName = inventRecordBoxBlocks[i]['textField'];
template = inventRecordBoxBlocks[i]['valueField']; template = inventRecordBoxBlocks[i]['valueField'];
} }
} }
...@@ -35,9 +36,9 @@ $(function () { ...@@ -35,9 +36,9 @@ $(function () {
minLength: 0, minLength: 0,
dataTextField: "textField", dataTextField: "textField",
dataValueField: "valueField", dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#", optionLabelTemplate: "[#:valueField#]#:textField#[#:param3Field#]",
valueTemplate: "[#:valueField#]#:textField#", valueTemplate: "[#:valueField#]#:textField#[#:param3Field#]",
template: "[#:valueField#]#:textField#", template: "[#:valueField#]#:textField#[#:param3Field#]",
filter: "contains" filter: "contains"
}); });
} }
...@@ -159,18 +160,19 @@ $(function () { ...@@ -159,18 +160,19 @@ $(function () {
if (e.field == "inventCode") { if (e.field == "inventCode") {
for(let i=0;i<inventRecordBoxBlocks.length;i++){ for(let i=0;i<inventRecordBoxBlocks.length;i++){
if(item.inventCode === inventRecordBoxBlocks[i]['valueField']){ if(item.inventCode === inventRecordBoxBlocks[i]['valueField']){
resultGrid.setCellValue(item, 'inventName', inventRecordBoxBlocks[i]['textField']) resultGrid.setCellValue(item, 'inventType', inventRecordBoxBlocks[i]['param1Field']);
resultGrid.setCellValue(item, 'inventName', inventRecordBoxBlocks[i]['textField']);
resultGrid.setCellValue(item, 'partSpecId', inventRecordBoxBlocks[i]['param2Field']);
resultGrid.setCellValue(item, 'partSpec', inventRecordBoxBlocks[i]['param3Field']);
resultGrid.setCellValue(item, 'partLength', inventRecordBoxBlocks[i]['param4Field']);
resultGrid.setCellValue(item, 'partWidth', inventRecordBoxBlocks[i]['param5Field']);
resultGrid.setCellValue(item, 'partThick', inventRecordBoxBlocks[i]['param6Field']);
resultGrid.setCellValue(item, 'invQty', inventRecordBoxBlocks[i]['param7Field']);
resultGrid.setCellValue(item, 'invUnitWeight', inventRecordBoxBlocks[i]['param8Field']);
resultGrid.setCellValue(item, 'invWeight', inventRecordBoxBlocks[i]['param9Field']);
} }
} }
resultGrid.setCellValue(item, 'partSpecId', "") loadChange(grid,e,"price");
resultGrid.setCellValue(item, 'partSpec', "")
resultGrid.setCellValue(item, 'partLength', "")
resultGrid.setCellValue(item, 'partWidth', "")
resultGrid.setCellValue(item, 'partThick', "")
resultGrid.setCellValue(item, 'invQty', "")
resultGrid.setCellValue(item, 'invUnitWeight', "")
resultGrid.setCellValue(item, 'invWeight', "")
loadChange(grid,e,"partSpec");
} }
if (e.field == "partSpec") { if (e.field == "partSpec") {
for(let i=0;i<specBoxBlocks.length;i++){ for(let i=0;i<specBoxBlocks.length;i++){
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventCode" cname="存货编码" width="220" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" enable="false"/> <EF:EFColumn ename="inventName" cname="存货名称" width="160" align="center" required="true" enable="false"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" enable="true" required="true"/> <EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" enable="true" required="true"/>
<EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/> <EF:EFColumn ename="partSpecId" cname="规格id" hidden="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格id" width="120" align="center" required="true" enable="false" hidden="true"/> <EF:EFColumn ename="inventRecordId" cname="规格id" width="120" align="center" required="true" enable="false" hidden="true"/>
......
...@@ -30,7 +30,7 @@ $(function() { ...@@ -30,7 +30,7 @@ $(function() {
field: "inventType", field: "inventType",
filter: function (options) { filter: function (options) {
return _.filter(inventTypeBox, function (item) { return _.filter(inventTypeBox, function (item) {
return item["param1Field"]=="true"; return item["param1Field"]=="true" && item["param2Field"] != "root";
}) })
}, },
editor: function (container, options) { editor: function (container, options) {
...@@ -164,6 +164,7 @@ let save = function () { ...@@ -164,6 +164,7 @@ let save = function () {
let flag = true; let flag = true;
$.each(rows, function(index, item) { $.each(rows, function(index, item) {
let inventType= item.get("inventType"); let inventType= item.get("inventType");
let inventCode= item.get("inventCode");
let inventName= item.get("inventName"); let inventName= item.get("inventName");
let length= item.get("length"); let length= item.get("length");
let width= item.get("width"); let width= item.get("width");
...@@ -174,6 +175,11 @@ let save = function () { ...@@ -174,6 +175,11 @@ let save = function () {
flag = false; flag = false;
return false; return false;
} }
if(isBlank(inventCode)){
message("选中的第"+(index+1)+"行\"存货编码\",不能为空!");
flag = false;
return false;
}
if(isBlank(inventName)){ if(isBlank(inventName)){
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!"); message("选中的第"+(index+1)+"行\"存货名称\",不能为空!");
flag = false; flag = false;
...@@ -184,7 +190,6 @@ let save = function () { ...@@ -184,7 +190,6 @@ let save = function () {
flag = false; flag = false;
return false; return false;
} }
if(!isBlank(length) && !isNumber(length)){ if(!isBlank(length) && !isNumber(length)){
message("选中的第" + (i + 1) + "行\"\",必须是数值!"); message("选中的第" + (i + 1) + "行\"\",必须是数值!");
flag = false; flag = false;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>
<EF:EFColumn cname="存货编码" ename="inventCode" width="140" align="center" enable="false"/> <EF:EFColumn cname="存货编码" ename="inventCode" width="140" align="center" enable="true" required="true" readonly="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
...@@ -12,6 +12,18 @@ $(function () { ...@@ -12,6 +12,18 @@ $(function () {
pageSizes: [10, 20, 50, 70, 100], pageSizes: [10, 20, 50, 70, 100],
}, },
columns: [{ columns: [{
field: "operator",
template: function (item) {
let template = '';
debugger;
// banner清单
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ',\''+item.accountCode+'\')" >banner清单</a>';
}
return template
}
}, {
field: "docIdPc", field: "docIdPc",
title: "PC端log", title: "PC端log",
template: function (item) { template: function (item) {
...@@ -170,6 +182,20 @@ let query = function () { ...@@ -170,6 +182,20 @@ let query = function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}; };
/**
* 附件清单
*
* @param id
*/
function showUploadFile(id,accountCode) {
JSColorbox.open({
href: "HGPZ009A?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-accountCode="+accountCode,
title: "<div style='text-align: center;'>banner清单</div>",
width: "80%",
height: "80%",
});
}
let save = function (){ let save = function (){
var btnNode = $(this); var btnNode = $(this);
btnNode.attr("disabled", true); btnNode.attr("disabled", true);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="single" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" checkMode="single" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="170" locked="true" align="center"/>
<EF:EFColumn cname="企业编码" ename="accountCode" enable="false" width="120" height="50" align="center"/> <EF:EFColumn cname="企业编码" ename="accountCode" enable="false" width="120" height="50" align="center"/>
<EF:EFColumn cname="企业名称" ename="accountName" width="140" align="center" required="true"/> <EF:EFColumn cname="企业名称" ename="accountName" width="140" align="center" required="true"/>
<EF:EFColumn cname="登录前缀" ename="loginPrefix" width="80" align="center" readonly="true"/> <EF:EFColumn cname="登录前缀" ename="loginPrefix" width="80" align="center" readonly="true"/>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 查询
$("#BTN_DELETE").on("click", deleteFunc);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGPZ099?methodName=initLoad&inqu_status-0-matId="+$("#inqu_status-0-parentId").val()+"&inqu_status-0-accountCode="+$("#inqu_status-0-accountCode").val(),
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-parentId", $("#inqu_status-0-parentId").val());
inEiInfo.set("result-0-accountCode", $("#inqu_status-0-accountCode").val());
inEiInfo.set("result-0-docId", docId);
EiCommunicator.send('HGPZ009A', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ009A", "delete", true);
}
})
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/6/19
Time: 17:26
To change this template use File | Settings | File Templates.
--%>
<!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="查询区域" type="query">
<EF:EFInput cname="父级ID" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="企业编码" ename="accountCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -70,6 +70,8 @@ $(function() { ...@@ -70,6 +70,8 @@ $(function() {
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) { for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) { if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
dataItem['material'] = InventNameGlobalData[i]['param5Field'];
dataItem['unit'] = InventNameGlobalData[i]['param6Field'];
return InventNameGlobalData[i]['textField']; return InventNameGlobalData[i]['textField'];
} }
} }
...@@ -80,10 +82,36 @@ $(function() { ...@@ -80,10 +82,36 @@ $(function() {
inInfo.set("inqu_status-0-inventType", options.model["inventType"]); inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false); inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ005"); inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox"); inInfo.set("methodName", "queryInventCodeBox");
inInfo.set("blockId", "invent_record_block_id"); inInfo.set("blockId", "invent_record_box_block_id");
inInfo.set("field", options.field); inInfo.set("field", options.field);
refreshSelect(container, inInfo); //refreshSelect(container, inInfo);
let grid = container.closest(".k-grid").data("kendoGrid");
let cellIndex = grid.cellIndex(container);
let input = $('<input />');
let field = inInfo.get("field");
input.attr("name", field);
input.attr("id", field);
input.appendTo(container);
let dataSource;
let serviceName = inInfo.get("serviceName");
let methodName = inInfo.get("methodName");
let blockId = inInfo.get("blockId");
EiCommunicator.send(serviceName, methodName, inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock(blockId).getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
dataSource: dataSource,
template: "#=textField#-#=param4Field#",
filter: "contains"
});
} }
},{ },{
field: "inventRecordId", field: "inventRecordId",
...@@ -98,7 +126,7 @@ $(function() { ...@@ -98,7 +126,7 @@ $(function() {
return inventAllGlobalData[i]['textField']; return inventAllGlobalData[i]['textField'];
} }
} }
return ""; return dataItem["inventRecordId"];
}, },
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
...@@ -117,7 +145,7 @@ $(function() { ...@@ -117,7 +145,7 @@ $(function() {
return inventAllGlobalData[i]['param1Field']; return inventAllGlobalData[i]['param1Field'];
} }
} }
return ""; return dataItem["material"];
} }
}, { }, {
field: "unit", field: "unit",
...@@ -127,7 +155,7 @@ $(function() { ...@@ -127,7 +155,7 @@ $(function() {
return inventAllGlobalData[i]['param2Field']; return inventAllGlobalData[i]['param2Field'];
} }
} }
return ""; return dataItem["unit"];
} }
},{ },{
field: "createdName", field: "createdName",
...@@ -145,7 +173,27 @@ $(function() { ...@@ -145,7 +173,27 @@ $(function() {
// 此grid对象 // 此grid对象
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
if (e.field === "inventCode"){ if (e.field === "inventCode"){
loadChange(grid,e,"inventRecordId"); let item = e.items[0];
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === item['inventCode']) {
resultGrid.setCellValue(item, 'inventType', InventNameGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'inventRecordId', InventNameGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'inventName', InventNameGlobalData[i]['textField']);
resultGrid.setCellValue(item, 'material', InventNameGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'unit', InventNameGlobalData[i]['param6Field']);
}
}
loadChange(grid,e,"warnNum");
}
else if (e.field === "whCode"){
let item = e.items[0];
for (let i = 0; i < WhNameGlobalData.length; i++) {
if (WhNameGlobalData[i]['valueField'] === item.whCode) {
resultGrid.setCellValue(item, 'whType', WhNameGlobalData[i]['param2Field'])
resultGrid.setCellValue(item, 'whName', WhNameGlobalData[i]['textField'])
}
}
loadChange(grid,e,"inventCode");
} }
else if (e.field == "inventRecordId") { else if (e.field == "inventRecordId") {
var tr,index; var tr,index;
...@@ -231,7 +279,7 @@ let initInvent = function () { ...@@ -231,7 +279,7 @@ let initInvent = function () {
*/ */
let initSpec = function () { let initSpec = function () {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]); //inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false); inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, { EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
......
...@@ -34,17 +34,16 @@ ...@@ -34,17 +34,16 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains"> filter="contains">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventCode" cname="存货名称" width="200" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/> <EF:EFColumn ename="material" cname="材质" width="120" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/> <EF:EFColumn ename="unit" cname="单位" width="120" align="center" enable="false"/>
<EF:EFColumn ename="warnNum" cname="预警值" width="100" align="right" format="{0:N3}" maxLength="20" <EF:EFColumn ename="warnNum" cname="预警值" width="100" align="right" format="{0:N3}" maxLength="20" required="true"/>
required="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150"/> <EF:EFColumn ename="remark" cname="备注" width="150"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" align="center"/> <EF:EFColumn ename="updatedName" cname="修改人" enable="false" width="120" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="140" align="center" <EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid> </EF:EFGrid>
......
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