Commit bca5f0c1 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hp-smart into dev-ly

parents 741e9fee 8bf5e8f4
...@@ -149,6 +149,42 @@ ...@@ -149,6 +149,42 @@
from ( from (
select select
a.GROUP_NAME as SERIES, a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-',''),7,2)) as X,
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from iplat.TXSOG01 a
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode#) a
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 6 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-',''),7,2)) as X,
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-','') as date,
case when right(a.GROUP_NAME,2) = '一组' then 1
when right(a.GROUP_NAME,2) = '二组' then 2
when right(a.GROUP_NAME,2) = '三组' then 3
else 4 end as SORT
from (select a.ORG_ID as FACTORY_CODE,c.ORG_ID as GROUP_CODE,c.ORG_CNAME as GROUP_NAME,a.COMPANY_CODE
from iplat.TXSOG01 a
join iplat.TXSOG01 b on a.ORG_ID = b.PARENT_ORG_ID
join iplat.TXSOG01 c on b.ORG_ID = c.PARENT_ORG_ID
where a.ORG_TYPE = 'factory' and b.ORG_TYPE = 'dept' and c.ORG_TYPE = 'prodGroup' and a.IS_DELETED = 0 and b.IS_DELETED =0 and c.IS_DELETED = 0 and a.ORG_ID = #factorycode#) a
left join hpjx.t_hpsc009 b on b.FACTORY_CODE = a.FACTORY_CODE and b.GROUP_CODE = a.GROUP_CODE and b.COMPANY_CODE = #companyCode# and b.DELETE_FLAG = 0
and b.REGISTER_DATE = replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 5 day),'-','') and b.FACTORY_CODE = #factorycode#
group by a.GROUP_NAME,b.REGISTER_DATE
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),7,2)) as X, concat(substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),5,2),'/',substring(replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-',''),7,2)) as X,
sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE sum(ifnull(WEIGHT,0)+ifnull(WEIGHT_JH,0))/2 as VALUE
,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') as date, ,replace(date_sub(str_to_date(#date#,'%Y%m%d'), INTERVAL 4 day),'-','') as date,
......
...@@ -49,7 +49,7 @@ public class ServiceHPSC005A extends ServiceBase { ...@@ -49,7 +49,7 @@ public class ServiceHPSC005A extends ServiceBase {
String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO); String prodOrderNo = MapUtils.getString(queryMap, CommonConstant.Field.PROD_ORDER_NO);
HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo); HPSC005 dbSc005 = HPSCTools.HpSc005.get(prodOrderNo);
inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005); inInfo.addBlock(CommonConstant.Field.DETAIL).addRow(dbSc005);
queryMap.put("userId", dbSc005.getFactoryCode()); queryMap.put("userId", UserSessionUtils.getUserId());
queryMap.put("orgType", "prodGroup"); queryMap.put("orgType", "prodGroup");
queryMap.put(HPSC005.FIELD_FACTORY_CODE, dbSc005.getFactoryCode()); queryMap.put(HPSC005.FIELD_FACTORY_CODE, dbSc005.getFactoryCode());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_GROUP_BLOCK_ID), queryMap, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_GROUP_BLOCK_ID), queryMap, false);
......
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