Commit be982b8d by yukang

Merge branch 'dev' of https://gitlab.baocloud.cn/bggf/smart/hp-smart into dev

# Conflicts:
#	src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC005A.java
parents 60f240e6 acd22d14
......@@ -56,7 +56,7 @@ public enum DdynamicEnum {
* 编写:wwl
*/
INVENT_ALL_BLOCK_ID("invent_all_block_id", "id", "spec", "material", "unit", "length", "width", "thick",
"HPPZ006.queryComboBoxAll"),
"coefficient", "HPPZ006.queryComboBoxAll"),
/**
* 模块:存货档案部件名称
......@@ -220,6 +220,8 @@ public enum DdynamicEnum {
private String param4;
private String param5;
private String param6;
/** 数据源 */
private final String dbSource;
......@@ -272,6 +274,20 @@ public enum DdynamicEnum {
this.param5 = param5;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String param1, String param2, String param3, String param4,
String param5, String param6,String dbSource) {
this.blockId = blockId;
this.value = value;
this.text = text;
this.param1 = param1;
this.param2 = param2;
this.param3 = param3;
this.param4 = param4;
this.param5 = param5;
this.param6 = param6;
this.dbSource = dbSource;
}
DdynamicEnum(String blockId, String value, String text, String dbSource){
this.blockId = blockId;
......@@ -337,4 +353,12 @@ public enum DdynamicEnum {
public void setParam5(String param5) {
this.param5 = param5;
}
public String getParam6() {
return param6;
}
public void setParam6(String param6) {
this.param6 = param6;
}
}
......@@ -50,7 +50,9 @@ public class HPConstants {
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM5_FIELD = "param5Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String PARAM6_FIELD = "param6Field";
/** 前后台交互下拉框字段 字段名 dzg */
public static final String VALUE_FIELD = "valueField";
......
......@@ -18,16 +18,24 @@
<select id="queryDay" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT '工厂' AS SERIES,FACTORY_NAME AS VALUE,PROJ_CODE, 1 AS SORT
FROM ( SELECT A.COMPANY_CODE, B.FACTORY_CODE,
B.FACTORY_NAME, A.PROJ_NAME, A.PROJ_CODE, MAX(A.TOTAL_WT) AS TOTAL_WT, SUM(WEIGHT) AS WEIGHT, MAX(C.NUM) AS NUM
FROM (
SELECT
A.COMPANY_CODE, B.FACTORY_CODE,
B.FACTORY_NAME, A.PROJ_NAME,
A.PROJ_CODE, MAX(A.TOTAL_WT) AS TOTAL_WT,
SUM(WEIGHT) AS WEIGHT, MAX(C.NUM) AS NUM
FROM hpjx.t_hpsc005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
JOIN (SELECT A.FACTORY_CODE, COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID WHERE A.DELETE_FLAG = 0 GROUP BY A.FACTORY_CODE
) C ON C.FACTORY_CODE=B.FACTORY_CODE
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) C ON C.FACTORY_CODE=B.FACTORY_CODE AND C.GROUP_ID = B.ORG_NO
JOIN hpjx.t_hpkc003 D ON A.PROD_ORDER_NO = D.PROD_ORDER_NO
WHERE ifnull(D.DOCUMENT_DATE,'') <![CDATA[<>]]> ''
<isNotEmpty prepend=" AND " property="date">
......@@ -45,17 +53,25 @@
UNION ALL
SELECT '生产项目' AS SERIES,PROJ_NAME AS VALUE,PROJ_CODE, 2 AS SORT FROM (
SELECT A.COMPANY_CODE, B.FACTORY_CODE,
B.FACTORY_NAME, A.PROJ_NAME, A.PROJ_CODE, MAX(A.TOTAL_WT) AS TOTAL_WT, SUM(WEIGHT) AS WEIGHT, MAX(C.NUM) AS NUM
SELECT '生产项目' AS SERIES,PROJ_NAME AS VALUE,PROJ_CODE, 2 AS SORT
FROM (
SELECT
A.COMPANY_CODE,B.FACTORY_CODE,
B.FACTORY_NAME,A.PROJ_NAME,
A.PROJ_CODE,MAX(A.TOTAL_WT) AS TOTAL_WT,SUM(WEIGHT) AS WEIGHT,
MAX(C.NUM) AS NUM
FROM hpjx.t_hpsc005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
JOIN (SELECT A.FACTORY_CODE, COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID WHERE A.DELETE_FLAG = 0 GROUP BY A.FACTORY_CODE
) C ON C.FACTORY_CODE=B.FACTORY_CODE
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) C ON C.FACTORY_CODE=B.FACTORY_CODE AND C.GROUP_ID = B.ORG_NO
JOIN hpjx.t_hpkc003 D ON A.PROD_ORDER_NO = D.PROD_ORDER_NO
WHERE ifnull(D.DOCUMENT_DATE,'') <![CDATA[<>]]> ''
<isNotEmpty prepend=" AND " property="date">
......@@ -78,16 +94,24 @@
'生产产量' AS SERIES,
concat('计划产量:',TOTAL_WT,'吨 , 实际产量',WEIGHT,'吨') as VALUE,
PROJ_CODE, 3 AS SORT
FROM ( SELECT A.COMPANY_CODE, B.FACTORY_CODE,
B.FACTORY_NAME, A.PROJ_NAME, A.PROJ_CODE, MAX(A.TOTAL_WT) AS TOTAL_WT, SUM(WEIGHT) AS WEIGHT, MAX(C.NUM) AS NUM
FROM (
SELECT
A.COMPANY_CODE,B.FACTORY_CODE,
B.FACTORY_NAME,A.PROJ_NAME,
A.PROJ_CODE,MAX(A.TOTAL_WT) AS TOTAL_WT,
SUM(WEIGHT) AS WEIGHT,MAX(C.NUM) AS NUM
FROM hpjx.t_hpsc005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
JOIN (SELECT A.FACTORY_CODE, COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID WHERE A.DELETE_FLAG = 0 GROUP BY A.FACTORY_CODE
) C ON C.FACTORY_CODE=B.FACTORY_CODE
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) C ON C.FACTORY_CODE=B.FACTORY_CODE AND C.GROUP_ID = B.ORG_NO
JOIN hpjx.t_hpkc003 D ON A.PROD_ORDER_NO = D.PROD_ORDER_NO
WHERE ifnull(D.DOCUMENT_DATE,'') <![CDATA[<>]]> ''
<isNotEmpty prepend=" AND " property="date">
......@@ -110,16 +134,24 @@
'生产人数' AS SERIES,
concat(NUM,'人') as VALUE,
PROJ_CODE, 4 AS SORT
FROM ( SELECT A.COMPANY_CODE, B.FACTORY_CODE,
B.FACTORY_NAME, A.PROJ_NAME, A.PROJ_CODE, MAX(A.TOTAL_WT) AS TOTAL_WT, SUM(WEIGHT) AS WEIGHT, MAX(C.NUM) AS NUM
FROM (
SELECT
A.COMPANY_CODE,B.FACTORY_CODE,
B.FACTORY_NAME,A.PROJ_NAME,
A.PROJ_CODE,MAX(A.TOTAL_WT) AS TOTAL_WT,
SUM(WEIGHT) AS WEIGHT,MAX(C.NUM) AS NUM
FROM hpjx.t_hpsc005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
JOIN (SELECT A.FACTORY_CODE, COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID WHERE A.DELETE_FLAG = 0 GROUP BY A.FACTORY_CODE
) C ON C.FACTORY_CODE=B.FACTORY_CODE
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) C ON C.FACTORY_CODE=B.FACTORY_CODE AND C.GROUP_ID = B.ORG_NO
JOIN hpjx.t_hpkc003 D ON A.PROD_ORDER_NO = D.PROD_ORDER_NO
WHERE ifnull(D.DOCUMENT_DATE,'') <![CDATA[<>]]> ''
<isNotEmpty prepend=" AND " property="date">
......@@ -131,8 +163,8 @@
<isNotEmpty prepend=" AND " property="company_code">
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY A.COMPANY_CODE, A.FACTORY_CODE, A.PLAN_COMPLETION_DATE,
B.FACTORY_NAME, A.PROJ_NAME, A.FACTORY_CODE, A.PROJ_CODE
GROUP BY A.COMPANY_CODE,A.FACTORY_CODE,A.PLAN_COMPLETION_DATE,
B.FACTORY_NAME,A.PROJ_NAME,A.FACTORY_CODE,A.PROJ_CODE
LIMIT 1
) A
......@@ -143,16 +175,24 @@
'人均日产' AS SERIES,
concat(ifnull(WEIGHT,0)/NUM,'吨') as VALUE,
PROJ_CODE, 5 AS SORT
FROM ( SELECT A.COMPANY_CODE, B.FACTORY_CODE,
B.FACTORY_NAME, A.PROJ_NAME, A.PROJ_CODE, MAX(A.TOTAL_WT) AS TOTAL_WT, SUM(WEIGHT) AS WEIGHT, MAX(C.NUM) AS NUM
FROM (
SELECT
A.COMPANY_CODE, B.FACTORY_CODE,
B.FACTORY_NAME, A.PROJ_NAME,
A.PROJ_CODE, MAX(A.TOTAL_WT) AS TOTAL_WT,
SUM(WEIGHT) AS WEIGHT, MAX(C.NUM) AS NUM
FROM hpjx.t_hpsc005 A
INNER JOIN HPJX.T_HPSC005A B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
JOIN (SELECT A.FACTORY_CODE, COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID WHERE A.DELETE_FLAG = 0 GROUP BY A.FACTORY_CODE
) C ON C.FACTORY_CODE=B.FACTORY_CODE
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) C ON C.FACTORY_CODE=B.FACTORY_CODE AND C.GROUP_ID = B.ORG_NO
JOIN hpjx.t_hpkc003 D ON A.PROD_ORDER_NO = D.PROD_ORDER_NO
WHERE ifnull(D.DOCUMENT_DATE,'') <![CDATA[<>]]> ''
<isNotEmpty prepend=" AND " property="date">
......@@ -164,8 +204,8 @@
<isNotEmpty prepend=" AND " property="company_code">
A.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY A.COMPANY_CODE, A.FACTORY_CODE, A.PLAN_COMPLETION_DATE,
B.FACTORY_NAME, A.PROJ_NAME, A.FACTORY_CODE, A.PROJ_CODE
GROUP BY A.COMPANY_CODE,A.FACTORY_CODE,A.PLAN_COMPLETION_DATE,
B.FACTORY_NAME,A.PROJ_NAME,A.FACTORY_CODE,A.PROJ_CODE
LIMIT 1
) A
<dynamic prepend="ORDER BY">
......@@ -181,7 +221,7 @@
'生产人数(人)' AS indNmae,
(select
NUM as VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -198,21 +238,21 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY DOCUMENT_DATE,C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
GROUP BY DOCUMENT_DATE,C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS dayValue,
(select
NUM as VALUE
FROM (select C.FACTORY_CODE,sum(ifnull(WEIGHT,0)) as VAULE
FROM (select C.FACTORY_CODE,C.ORG_NO,sum(ifnull(WEIGHT,0)) as VAULE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -230,21 +270,21 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS monValue,
(select
NUM as VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -262,17 +302,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS yearValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '01' THEN NUM ELSE 0 END) as janValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '02' THEN NUM ELSE 0 END) as febValue,
......@@ -286,7 +326,7 @@
MAX(case when substring(DOCUMENT_DATE,5,2) = '10' THEN NUM ELSE 0 END) as octValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '11' THEN NUM ELSE 0 END) as novValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '12' THEN NUM ELSE 0 END) as decValue
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -304,17 +344,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
UNION ALL
......@@ -323,7 +363,7 @@
'生产产量(吨)' AS indNmae,
(select
VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -340,21 +380,21 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS dayValue,
(select
VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -372,21 +412,21 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS monValue,
(select
VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -404,17 +444,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS yearValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '01' THEN VALUE ELSE 0 END) as janValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '02' THEN VALUE ELSE 0 END) as febValue,
......@@ -428,7 +468,7 @@
MAX(case when substring(DOCUMENT_DATE,5,2) = '10' THEN VALUE ELSE 0 END) as octValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '11' THEN VALUE ELSE 0 END) as novValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '12' THEN VALUE ELSE 0 END) as decValue
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -446,17 +486,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
UNION ALL
......@@ -465,7 +505,7 @@
'人均产量(kg)' AS indNmae,
(select
VALUE/NUM AS VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -482,21 +522,21 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS dayValue,
(select
VALUE/NUM AS VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -514,21 +554,21 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS monValue,
(select
VALUE/NUM AS VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -546,17 +586,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
) AS yearValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '01' THEN VALUE/NUM ELSE 0 END) as janValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '02' THEN VALUE/NUM ELSE 0 END) as febValue,
......@@ -570,7 +610,7 @@
MAX(case when substring(DOCUMENT_DATE,5,2) = '10' THEN VALUE/NUM ELSE 0 END) as octValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '11' THEN VALUE/NUM ELSE 0 END) as novValue,
MAX(case when substring(DOCUMENT_DATE,5,2) = '12' THEN VALUE/NUM ELSE 0 END) as decValue
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VALUE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -588,17 +628,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
<dynamic prepend="ORDER BY">
<isEmpty property="orderBy">
indNmae desc
......@@ -618,7 +658,7 @@
else concat(substring(DOCUMENT_DATE,5,2),'月')
end as X,
VAULE as VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -635,17 +675,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
UNION ALL
......@@ -657,7 +697,7 @@
else concat(substring(DOCUMENT_DATE,5,2),'月')
end as X,
NUM as VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -674,17 +714,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
UNION ALL
......@@ -696,7 +736,7 @@
else concat(substring(DOCUMENT_DATE,5,2),'月')
end as X,
VAULE/NUM as VALUE
FROM (select C.FACTORY_CODE,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM (select C.FACTORY_CODE,C.ORG_NO,DOCUMENT_DATE,sum(ifnull(WEIGHT,0)) as VAULE
FROM hpjx.t_hpkc003 A
JOIN hpjx.t_hpsc005 B ON A.PROD_ORDER_NO = B.PROD_ORDER_NO
INNER JOIN HPJX.T_HPSC005A C ON B.PROD_ORDER_NO = C.PROD_ORDER_NO
......@@ -713,17 +753,17 @@
<isNotEmpty prepend=" AND " property="company_code">
B.COMPANY_CODE LIKE CONCAT('%',CONCAT( #company_code#,'%'))
</isNotEmpty>
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE) A
join (SELECT
A.FACTORY_CODE,
COUNT(*) AS NUM
FROM hpjx.T_HPPZ011 A
JOIN iplat.TXSOG01 B ON A.GROUP_CODE = B.ORG_ID
GROUP BY left(DOCUMENT_DATE,6),C.FACTORY_CODE,C.ORG_NO) A
JOIN (
SELECT
A.ORG_ID AS FACTORY_CODE, C.ORG_ID AS GROUP_ID,COUNT(*) AS NUM
FROM iplat.TXSOG01 A
JOIN iplat.TXSOG01 B ON A.ORG_ID = B.PARENT_ORG_ID
JOIN iplat.TXSOG02 C ON B.ORG_ID = C.ORG_ID
JOIN iplat.XS_USER D ON C.USER_ID = D.USER_ID
WHERE A.DELETE_FLAG = 0
GROUP BY A.FACTORY_CODE
) B ON A.FACTORY_CODE=B.FACTORY_CODE
WHERE A.ORG_TYPE = 'factory' AND B.ORG_TYPE = 'prodGroup'
GROUP BY A.ORG_ID ,C.ORG_ID
) B ON B.FACTORY_CODE=B.FACTORY_CODE AND B.GROUP_ID = A.ORG_NO
<dynamic prepend="ORDER BY">
<isEmpty property="orderBy">
......
......@@ -89,7 +89,7 @@ public class HPKC001 extends DaoEPBase {
private String receiptDate = " "; /* 单据日期*/
private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/
private String inventType = " "; /* 存货类型*/
private Integer inventType; /* 存货类型*/
private String inventCode = " "; /* 存货编码*/
private String inventName = " "; /* 存货名称*/
private Long inventRecordId; /* 存货档案ID*/
......@@ -430,7 +430,7 @@ public class HPKC001 extends DaoEPBase {
* get the inventType - 存货类型.
* @return the inventType
*/
public String getInventType() {
public Integer getInventType() {
return this.inventType;
}
......@@ -439,7 +439,7 @@ public class HPKC001 extends DaoEPBase {
*
* @param inventType - 存货类型
*/
public void setInventType(String inventType) {
public void setInventType(Integer inventType) {
this.inventType = inventType;
}
/**
......@@ -607,7 +607,7 @@ public class HPKC001 extends DaoEPBase {
setReceiptDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIPT_DATE)), receiptDate));
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setInventType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE)), inventType));
setInventCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_CODE)), inventCode));
setInventName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVENT_NAME)), inventName));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
......
......@@ -8,6 +8,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
......@@ -16,6 +17,7 @@ import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -80,6 +82,8 @@ public class ServiceHPKC001 extends ServiceBase {
inInfo = super.query(inInfo, HPKC001.QUERY, new HPKC001());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
// 设置规格信息
HPPZTools.HpPz006.setSpecInfo(inInfo, HPKC001.FIELD_INVENT_RECORD_ID);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -118,8 +122,10 @@ public class ServiceHPKC001 extends ServiceBase {
for (Map resultRow : resultRows) {
HPKC001 fKc001 = new HPKC001();
fKc001.fromMap(resultRow);
HPPZ006 fPz006 = new HPPZ006();
fPz006.fromMap(resultRow);
if (fKc001.getId() == null || fKc001.getId() == 0) {
this.addData(fKc001);
this.addData(fKc001, fPz006);
} else {
// TODO 采购入库不支持修改
}
......@@ -130,12 +136,25 @@ public class ServiceHPKC001 extends ServiceBase {
* 写入数据
*
* @param fKc001
* @param fPz006
*/
private void addData(HPKC001 fKc001) {
private void addData(HPKC001 fKc001, HPPZ006 fPz006) {
// 设置基础信息
this.setBaseInfo(fKc001);
// 检查存货名称是新增还是已存在
if (StringUtils.isBlank(fKc001.getInventCode())) {
String inventCode = HPPZTools.HpPz004.checkAndSave(fKc001.getInventType(), fKc001.getInventName());
fKc001.setInventCode(inventCode);
fPz006.setInventCode(inventCode);
}
// 检查规格是否已存在,不存在就新增
HPPZ006 dbPz006 = HPPZTools.HpPz006.checkAndSave(fPz006);
fKc001.setInventRecordId(dbPz006.getId());
// 计算重量
this.calcWeight(fKc001);
// 生成入库单号
fKc001.setPurchaseNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC001_NUMBER));
fKc001.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPKC001.INSERT, fKc001);
// 修改库存
HPKCTools.updateStock(fKc001.getWhCode(), fKc001.getInventRecordId(), fKc001.getAmount(),
......@@ -152,10 +171,8 @@ public class ServiceHPKC001 extends ServiceBase {
HPKC001 fKc001 = new HPKC001();
fKc001.fromMap(resultRow);
AssertUtils.isEmpty(fKc001.getWhCode(), "仓库名称不能为空");
AssertUtils.isEmpty(fKc001.getInventCode(), "存货名称不能为空");
// AssertUtils.isNull(fKc001.getInventRecordId(), "规格不能为空");
// AssertUtils.isEmpty(fKc001.getInventCode(), "存货名称不能为空");
AssertUtils.isGt(BigDecimal.ZERO, fKc001.getAmount(), "数量必须大于0");
AssertUtils.isGt(BigDecimal.ZERO, fKc001.getWeight(), "重量必须大于0");
}
}
......@@ -170,7 +187,15 @@ public class ServiceHPKC001 extends ServiceBase {
// 仓库名称
fKc001.setWhName(HPPZTools.HpPz007.getByCode(fKc001.getWhCode()).getWhName());
// 存货名称
fKc001.setInventName(HPPZTools.HpPz004.getByCode(fKc001.getInventCode()).getInventName());
// fKc001.setInventName(HPPZTools.HpPz004.getByCode(fKc001.getInventCode()).getInventName());
}
/**
* 计算重量
*
* @param fKc001
*/
private void calcWeight(HPKC001 fKc001) {
// 根据规格计算单重
fKc001.setUnitWeight(HPPZTools.HpPz006.calcUnitWeight(fKc001.getInventRecordId()));
// 计算总重
......
......@@ -104,8 +104,10 @@ public class ServiceHPKC002 extends ServiceBase {
HPKC002 dbKc002 = dbMapKc002.get(fKc002.getReqNo());
HPKC002 newKc002 = BeanUtils.copy(dbKc002, HPKC002.class);
newKc002.setReqNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.HPKC002_NUMBER));
newKc002.setAmount(dbKc002.getAmount());
newKc002.setWeight(dbKc002.getWeight());
newKc002.setAmount(dbKc002.getAmount().negate());
newKc002.setWeight(dbKc002.getWeight().negate());
newKc002.setProjCode(dbKc002.getProjCode());
newKc002.setHpsc006Id(dbKc002.getHpsc006Id());
newKc002.setOldReqNo(dbKc002.getReqNo());
newKc002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HPKC002.INSERT, newKc002);
......
......@@ -109,6 +109,8 @@ public class ServiceHPKC004 extends ServiceBase {
newKc004.setAmount(dbKc004.getAmount().negate());
newKc004.setWeight(dbKc004.getWeight().negate());
newKc004.setOldSaleNo(dbKc004.getSaleNo());
newKc004.setProjCode(dbKc004.getProjCode());
newKc004.setProjName(dbKc004.getProjName());
newKc004.setIsPrint(CommonConstant.YesNo.NO_0);
newKc004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HPKC004.INSERT, newKc004);
......
......@@ -18,6 +18,7 @@ import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -83,6 +84,8 @@ public class ServiceHPKC006 extends ServiceBase {
inInfo = super.query(inInfo, HPKC006.QUERY, new HPKC006());
List sum = dao.query(HPSqlConstant.HPKC006.QUERY_SUM, queryRow);
inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
// 设置规格信息
HPPZTools.HpPz006.setSpecInfo(inInfo, HPKC006.FIELD_INVENT_RECORD_ID);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -105,8 +108,10 @@ public class ServiceHPKC006 extends ServiceBase {
for (Map resultRow : resultRows) {
HPKC006 fKc006 = new HPKC006();
fKc006.fromMap(resultRow);
HPPZ006 fPz006 = new HPPZ006();
fPz006.fromMap(resultRow);
if (fKc006.getId() == null || fKc006.getId() == 0) {
this.add(fKc006);
this.add(fKc006, fPz006);
} else {
// TODO 库存不支持修改
}
......@@ -124,18 +129,20 @@ public class ServiceHPKC006 extends ServiceBase {
* 新增操作
*
* @param fKc006
* @param fPz006
* @return
*/
private void add(HPKC006 fKc006) {
private void add(HPKC006 fKc006, HPPZ006 fPz006) {
// 设置基础信息
this.setBaseInfo(fKc006);
// 生成入库单号
fKc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_ENTER_NO));
// 检查存货名称是新增还是已存在
if (StringUtils.isBlank(fKc006.getInventCode())) {
String inventCode = HPPZTools.HpPz004.checkAndSave(fKc006.getInventType(), fKc006.getInventName());
fKc006.setInventCode(inventCode);
fPz006.setInventCode(inventCode);
}
// 检查规格,如果不存在就新增
HPPZ006 dbPz006 = HPPZTools.HpPz006.checkAndSave(fKc006.getInventType(), fKc006.getInventName(),
fKc006.getLength(), fKc006.getWidth(), fKc006.getThick(), fKc006.getCoefficient(), fKc006.getMaterial(),
fKc006.getUnit()
);
HPPZ006 dbPz006 = HPPZTools.HpPz006.checkAndSave(fPz006);
// 根据规格计算单重
fKc006.setUnitWeight(HPPZTools.HpPz006.calcUnitWeight(dbPz006));
// 计算总重
......@@ -143,6 +150,8 @@ public class ServiceHPKC006 extends ServiceBase {
fKc006.setInventRecordId(dbPz006.getId());
fKc006.setInventCode(dbPz006.getInventCode());
fKc006.setDeleteFlag(CommonConstant.YesNo.NO_0);
// 生成入库单号
fKc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HPConstant.SequenceId.OTHER_ENTER_NO));
DaoUtils.insert(HPKC006.INSERT, fKc006);
// 修改库存
HPKCTools.updateStock(fKc006.getWhCode(), fKc006.getInventRecordId(), fKc006.getAmount(),
......
......@@ -61,7 +61,7 @@ public class ServiceHPPZ006 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, "HPPZ006.query", new HPPZ006());
inInfo = super.query(inInfo, HPPZ006.QUERY, new HPPZ006());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -266,6 +266,7 @@
LENGTH AS "length" , <!-- 长 -->
WIDTH AS "width" , <!-- 宽 -->
THICK AS "thick" , <!-- 厚 -->
COEFFICIENT AS "coefficient" , <!-- 系数 -->
MATERIAL AS "material" , <!-- 材质 -->
UNIT AS "unit" <!-- 单位 -->
FROM hpjx.t_hppz006
......
......@@ -287,18 +287,40 @@ public class HPPZTools {
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HPPZ006> results = DaoBase.getInstance().query(HPPZ006.QUERY, queryMap);
AssertUtils.isNull(results, String.format("规格[%s]不存在", id));
AssertUtils.isEmpty(results, String.format("规格[%s]不存在", id));
return results.get(0);
}
/**
* 查询
*
* @param inventCode
* @param spec
* @return
*/
public static HPPZ006 getBySpec(String inventCode, String spec) {
AssertUtils.isEmpty(inventCode, "存货编码不能为空");
Map queryMap = new HashMap();
queryMap.put("inventCode", inventCode);
if (StringUtils.isBlank(spec)) {
queryMap.put("notSpec", CommonConstant.YesNo.YES);
} else {
queryMap.put("spec", spec);
}
List<HPPZ006> results = DaoBase.getInstance().query(HPPZ006.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HPPZ006> list(List<Long> ids) {
AssertUtils.isNull(ids, "规格ID不能为空");
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HPPZ006.QUERY, queryMap);
......@@ -360,6 +382,19 @@ public class HPPZTools {
/**
* 拼接规格
*
* @param pz006
*/
public static void jointSpec(HPPZ006 pz006) {
if (StringUtils.isNotBlank(pz006.getSpec())) {
return;
}
pz006.setSpec(jointSpec(pz006.getLength(), pz006.getWidth(), pz006.getThick()));
}
/**
* 拼接规格
*
* @param length
* @param width
* @param thick
......@@ -386,6 +421,26 @@ public class HPPZTools {
}
/**
* 检查不存在就新增
*
* @param newPz006
* @return
*/
public static HPPZ006 checkAndSave(HPPZ006 newPz006) {
// 检查存货名称是否存在
jointSpec(newPz006);
HPPZ006 specPz006 = getBySpec(newPz006.getInventCode(), newPz006.getSpec());
if (specPz006 != null) {
return specPz006;
} else {
// 生成编码
newPz006.setStatus(CommonConstant.YesNo.YES_1.intValue());
DaoUtils.insert(HPPZ006.INSERT, newPz006);
return newPz006;
}
}
/**
* 判断存货档案是否存在,如果存在返回存货档案,否则新增并返回存货档案
*
* @param inventType 存货类型
......@@ -433,13 +488,7 @@ public class HPPZTools {
*/
public static void setSpecInfo(EiInfo inInfo, String idName) {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
if (CollectionUtils.isEmpty(resultRows)) {
return;
}
List<Long> ids = ObjectUtils.listKey(resultRows, idName);
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map<Long, HPPZ006> resultMap = map(ids);
if (MapUtils.isEmpty(resultMap)) {
return;
......@@ -447,10 +496,18 @@ public class HPPZTools {
for (Map resultRow : resultRows) {
Long id = MapUtils.getLong(resultRow, idName);
HPPZ006 dbPz006 = resultMap.get(id);
resultRow.put(HPPZ006.FIELD_SPEC, dbPz006 == null ? "" : dbPz006.getSpec());
if (dbPz006 == null) {
resultRow.put(HPPZ006.FIELD_SPEC, "");
} else {
resultRow.put(HPPZ006.FIELD_SPEC, "".equals(StringUtils.trim(dbPz006.getSpec()))
? "无规格" : dbPz006.getSpec());
}
resultRow.put(HPPZ006.FIELD_LENGTH, dbPz006 == null ? "" : dbPz006.getLength());
resultRow.put(HPPZ006.FIELD_WIDTH, dbPz006 == null ? "" : dbPz006.getWidth());
resultRow.put(HPPZ006.FIELD_THICK, dbPz006 == null ? "" : dbPz006.getThick());
resultRow.put(HPPZ006.FIELD_COEFFICIENT, dbPz006 == null ? "" : dbPz006.getCoefficient());
resultRow.put(HPPZ006.FIELD_MATERIAL, dbPz006 == null ? "" : dbPz006.getMaterial());
resultRow.put(HPPZ006.FIELD_UNIT, dbPz006 == null ? "" : dbPz006.getUnit());
}
}
......
......@@ -84,7 +84,7 @@ public class CommonMethod {
row.put(HPConstants.PARAM3_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam3())));
row.put(HPConstants.PARAM4_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam4())));
row.put(HPConstants.PARAM5_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam5())));
row.put(HPConstants.PARAM6_FIELD, (tryValue.get(tableParam.getValue()) + HPConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam6())));
} else {
row.put(HPConstants.TEXT_FIELD, String.valueOf(tryValue.get(tableParam.getText())));
row.put(HPConstants.PARAM1_FIELD, String.valueOf(tryValue.get(tableParam.getParam1())));
......@@ -92,6 +92,7 @@ public class CommonMethod {
row.put(HPConstants.PARAM3_FIELD, String.valueOf(tryValue.get(tableParam.getParam3())));
row.put(HPConstants.PARAM4_FIELD, String.valueOf(tryValue.get(tableParam.getParam4())));
row.put(HPConstants.PARAM5_FIELD, String.valueOf(tryValue.get(tableParam.getParam5())));
row.put(HPConstants.PARAM6_FIELD, String.valueOf(tryValue.get(tableParam.getParam6())));
}
resultRows.add(row);
}
......
package com.baosight.hpjx.util;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -110,6 +112,9 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
* @return
*/
public static <T> List<T> listKey(List<Map> items, String keyName) {
if (CollectionUtils.isEmpty(items)) {
return null;
}
return items.stream().map(item -> (T) item.get(keyName)).filter(ObjectUtils::isNotBlank).distinct()
.collect(Collectors.toList());
}
......
......@@ -40,27 +40,31 @@ $(function() {
refreshSelect(container, inInfo);
}
}, {
field: "inventCode",
template: function (dataItem) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return inventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
// 1.原料,2.耗材
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ006");
inInfo.set("methodName", "queryMaterialComboBox");
inInfo.set("blockId", "material_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
field: "inventName",
title: "存货名称",
template: function (dataItem) {
for (let i = 0; i < inventNameGlobalData.length; i++) {
if (inventNameGlobalData[i]['textField'] === dataItem['inventName']) {
dataItem['inventCode'] = inventNameGlobalData[i]['valueField']
return inventNameGlobalData[i]['textField'];
} else {
dataItem['inventCode'] = '';
}
}
return dataItem['inventName'];
},
editor: function (container, options) {
let inInfo = new EiInfo();
// 1.原料,2.耗材,5.废料
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPPZ004");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_name_block_id");
inInfo.set("field", options.field);
refreshInputSelect(container, inInfo);
}
}, {
field: "spec",
template: function (dataItem) {
......@@ -83,73 +87,50 @@ $(function() {
inInfo.set("methodName", "queryComboBoxSpec");
inInfo.set("blockId", "invent_spec_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
refreshInputSelect(container, inInfo);
}
}, {
field: "unitWeight",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}, {
field: "weight",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}, {
field: "length",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param3Field'];
}
}
return "";
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}, {
field: "width",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param4Field'];
}
}
return "";
template: function (options) {
return options.width == 0 ? "-" : options.width;
}
}, {
field: "thick",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param5Field'];
}
}
return "";
template: function (options) {
return options.thick == 0 ? "-" : options.thick;
}
}, {
field: "material",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param1Field'];
}
}
return "";
}
}, {
field: "unit",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['param2Field'];
}
}
return "";
}
}],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field == "inventRecordId") {
if (e.field == "spec") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field'])
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field'])
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field'])
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh();
}
}
}
......@@ -265,18 +246,29 @@ let save = function () {
message("勾选的第" + (i + 1) + "行仓库名称不能为空");
return;
}
if (isBlank(rows[i]['inventCode'])) {
if (isBlank(rows[i]['inventName'])) {
message("勾选的第" + (i + 1) + "行存货名称不能为空");
return;
}
if (isBlank(rows[i]['inventRecordId'])) {
message("勾选的第" + (i + 1) + "行规格不能为空");
return;
}
if (!isPositiveInteger(rows[i]['amount'])) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的整数");
return;
}
let length = rows[i]['length'];
if (!isBlank(length) && (!isNumber(length) || length < 0)) {
message("勾选的第" + (i + 1) + "行长必须是不小于0的数字");
return;
}
let width = rows[i]['width'];
if (!isBlank(width) && (!isNumber(width) || width < 0)) {
message("勾选的第" + (i + 1) + "行宽必须是不小于0的数字");
return;
}
let thick = rows[i]['thick'];
if (!isBlank(width) && (!isNumber(thick) || thick < 0)) {
message("勾选的第" + (i + 1) + "行厚必须是不小于0的数字");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
......
......@@ -44,28 +44,30 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" autoFit="true" isFloat="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="purchaseNo" cname="采购单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="purchaseNo" cname="采购单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="90" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
<EF:EFComboColumn ename="inventType" cname="存货类型" width="80" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" align="center" readonly="true" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="120" align="right" format="{0:N3}"/>
<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="spec" cname="规格" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N0}" maxLength="20" width="100" align="right"
required="true" readonly="true"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量(KG)" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="oldPurchaseNo" cname="原采购单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
......
......@@ -68,7 +68,10 @@
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N0}" maxLength="20" width="100"
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFColumn ename="amount" cname="数量" enable="false" format="{0:N0}" maxLength="20" width="100"
align="right"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" format="{0:N3}" maxLength="20" width="100"
align="right"/>
......
......@@ -46,6 +46,9 @@
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" width="300" align="center" defaultValue="" required="true"
filter="contains" >
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField" />
......
......@@ -45,6 +45,9 @@
blockName="invent_spec_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="20" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" width="300" align="center" defaultValue="" required="true"
filter="contains" >
<EF:EFOptions blockId="proj_record_block_id" valueField="valueField" textField="textField" />
......
......@@ -66,8 +66,13 @@ let select = function () {
}
for (let i = 0; i < rows.length; i++) {
let entityAmount = rows[i]['entityAmount'];
let amount = rows[i]['amount'];
if (!isPositiveInteger(entityAmount)) {
message("勾选的第" + (i + 1) + "行数量必须是大于0的整数");
message("勾选的第" + (i + 1) + "行实物数量必须是大于0的整数");
return;
}
if (parseFloat(entityAmount) > parseFloat(amount)) {
message("第" + (i + 1) + "行实物数量不能大于库存数量");
return;
}
}
......
......@@ -69,14 +69,17 @@ $(function() {
refreshInputSelect(container, inInfo);
}
}, {
field: "inventRecordId",
field: "spec",
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
if (inventAllGlobalData[i]['textField'] === dataItem['spec']) {
dataItem['inventRecordId'] = inventAllGlobalData[i]['valueField']
return inventAllGlobalData[i]['textField'];
} else {
dataItem['inventRecordId'] = '';
}
}
return "";
return dataItem['spec'] == null ? "" : dataItem['spec'];
},
editor: function (container, options) {
let inInfo = new EiInfo();
......@@ -87,7 +90,32 @@ $(function() {
inInfo.set("methodName", "queryComboBoxSpec");
inInfo.set("blockId", "invent_spec_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
refreshInputSelect(container, inInfo);
}
}, {
field: "unitWeight",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}, {
field: "weight",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}, {
field: "length",
template: function (options) {
return options.length == 0 ? "-" : options.length;
}
}, {
field: "width",
template: function (options) {
return options.width == 0 ? "-" : options.width;
}
}, {
field: "thick",
template: function (options) {
return options.thick == 0 ? "-" : options.thick;
}
}],
loadComplete: function (grid) {
......@@ -98,30 +126,21 @@ $(function() {
save();
},
afterEdit: function (e) {
if (e.field === "inventRecordId") {
let inventRecordId = e.model.inventRecordId;
if (isBlank(inventRecordId)) {
return;
}
let inInfo = new EiInfo();
// ID为空的情况下需要返回一条空数据
inInfo.set("inqu_status-0-id", inventRecordId);
EiCommunicator.send("HPPZ006", "query", inInfo, {
onSuccess: function (ei) {
let data = ei.blocks.result.rows;
if (data.length > 0) {
resultGrid.setCellValue(e.model, "length", data[0][8])
resultGrid.setCellValue(e.model, "width", data[0][9])
resultGrid.setCellValue(e.model, "thick", data[0][10])
resultGrid.setCellValue(e.model, "material", data[0][11])
resultGrid.setCellValue(e.model, "coefficient", data[0][12])
resultGrid.setCellValue(e.model, "unit", data[0][13])
}
firstLoad = 0;
},
onFail: function (ei) {
if (e.field == "spec") {
var tr,index;
// 获取此model元素信息
var item = e.model;
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['textField'] === item.spec) {
resultGrid.setCellValue(item, 'material', inventAllGlobalData[i]['param1Field']);
resultGrid.setCellValue(item, 'unit', inventAllGlobalData[i]['param2Field']);
resultGrid.setCellValue(item, 'length', inventAllGlobalData[i]['param3Field']);
resultGrid.setCellValue(item, 'width', inventAllGlobalData[i]['param4Field']);
resultGrid.setCellValue(item, 'thick', inventAllGlobalData[i]['param5Field']);
resultGrid.setCellValue(item, 'coefficient', inventAllGlobalData[i]['param6Field']);
resultGrid.refresh();
}
}, {async: false});
}
}
},
onSuccess: function (e) {
......@@ -231,7 +250,7 @@ let save = function () {
message("勾选的第" + (i + 1) + "行仓库名称不能为空");
return;
}
if (isBlank(rows[i]['inventCode'])) {
if (isBlank(rows[i]['inventName'])) {
message("勾选的第" + (i + 1) + "行存货名称不能为空");
return;
}
......@@ -239,6 +258,21 @@ let save = function () {
message("勾选的第" + (i + 1) + "行数量必须是大于0的整数");
return;
}
let length = rows[i]['length'];
if (!isBlank(length) && (!isNumber(length) || length < 0)) {
message("勾选的第" + (i + 1) + "行长必须是不小于0的数字");
return;
}
let width = rows[i]['width'];
if (!isBlank(width) && (!isNumber(width) || width < 0)) {
message("勾选的第" + (i + 1) + "行宽必须是不小于0的数字");
return;
}
let thick = rows[i]['thick'];
if (!isBlank(width) && (!isNumber(thick) || thick < 0)) {
message("勾选的第" + (i + 1) + "行厚必须是不小于0的数字");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
......
......@@ -48,28 +48,28 @@
<EF:EFColumn ename="otherEnterNo" cname="入库单号" enable="false" width="150" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" editType="date" dateFormat="yyyy-MM-dd"
parseFormats="['yyyyMMdd']" width="90" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="100" align="center" required="true"
<EF:EFComboColumn ename="inventType" cname="存货类型" width="80" align="center" required="true"
readonly="true">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('1', '2', '5')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"
hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" hidden="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格Id" width="120" align="center" readonly="true" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="amount" cname="数量" format="{0:N0}" maxLength="20" width="100" align="right"
sumType="all" required="true" readonly="true"/>
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" width="100" align="right" format="{0:N3}"
<EF:EFColumn ename="unitWeight" cname="单重" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="重量" enable="false" width="120" align="right" format="{0:N3}"
sumType="all"/>
<EF:EFColumn ename="length" cname="长" width="120" align="center" format="{0:N3}" required="false"
<EF:EFColumn ename="length" cname="长" width="100" align="center" format="{0:N3}" required="false"
readonly="true"/>
<EF:EFColumn ename="width" cname="宽" width="120" align="center" format="{0:N3}" required="false"
<EF:EFColumn ename="width" cname="宽" width="100" align="center" format="{0:N3}" required="false"
readonly="true"/>
<EF:EFColumn ename="thick" cname="厚" width="120" align="center" format="{0:N3}" required="false"
<EF:EFColumn ename="thick" cname="厚" width="100" align="center" format="{0:N3}" required="false"
readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="120" align="center" required="false" readonly="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="120" align="center" format="{0:N3}" required="false"
<EF:EFColumn ename="material" cname="材质" width="80" align="center" required="false" readonly="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="center" format="{0:N3}" required="false"
readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="120" align="center" required="false" readonly="true"/>
<EF:EFColumn ename="remark" cname="备注" width="150" maxLength="255" readonly="true"/>
......
......@@ -10,6 +10,11 @@ $(function() {
pageSizes: [10, 20, 30, 50, 100, 200]
},
columns: [{
field: "spec",
template: function (options) {
return $.trim(options.spec) == "" ? "无规格" : options.spec;
}
}, {
field: "length",
template: function (options) {
return options.length == 0 ? "-" : options.length;
......
......@@ -45,6 +45,16 @@ function isPositiveInteger(input) {
}
/**
* 正数校验
*
* @param input
* @returns {boolean}
*/
function isPositiveNumber(input) {
return !isBlank(input) && isNumber(input) && (input > 0);
}
/**
* 消息提示
*
* @param msg
......
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