Commit d3b8eafd by liuyang

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

parents 2d529a84 7614697d
......@@ -318,6 +318,9 @@ public class ServiceHPMT003 extends ServiceBase {
sqlMap.put("companyCode", companyCode);
sqlMap.put("factorycode", factorycode);
List<Map> rows = this.dao.query("HPMT003.queryMaxDate", sqlMap);
if(rows.get(0).get("registerDate")==null){
rows.get(0).put("registerDate",DateUtils.yesterday());
}
List<Map> maps = new ArrayList<>();
resultMap.put("result",rows);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
......
......@@ -4,20 +4,20 @@
<select id="queryPmRCLInfo" resultClass="java.util.HashMap">
select
concat(ifnull(YGL,0),'工') as YGL,
concat(format(ifnull(JHCL,0),2),'T') as JHCL,
concat(format(ifnull(SJCL,0),2),'T') as SJCL,
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as RJCL
concat(ifnull(YGL,0),'工') as YGL,
concat(format(ifnull(JHCL,0),2),'T') as JHCL,
concat(format(ifnull(SJCL,0),2),'T') as SJCL,
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as RJCL
from (select
(select count(*) FROM hpjx.T_HPPZ014
where COMPANY_CODE = #companyCode# and REG_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as YGL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE) as SJCL
from dual) a
(select sum(USER_COUNT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and REGISTER_DATE = #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
<select id="queryPmYCLinfo" resultClass="java.util.HashMap">
......@@ -28,13 +28,11 @@
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as LJRJCL
from (select
(select count(*) FROM hpjx.T_HPPZ014
where COMPANY_CODE = #companyCode# and left(REG_DATE,6) = left(#date#,6) and REG_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REG_DATE,6)) as YGL,
(select sum(USER_COUNT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REGISTER_DATE,6)) as SJCL
(select sum(WEIGHT) FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,6) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -46,13 +44,15 @@
case when ifnull(YGL,0) = 0 then '0.00T'
else concat(format(ifnull(SJCL,0)/ifnull(YGL,0),2),'T') end as NLJRJCL
from (select
(select count(*) FROM hpjx.T_HPPZ014
where COMPANY_CODE = #companyCode# and left(REG_DATE,4) = left(#date#,4) and REG_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REG_DATE,4)) as YGL,
(select
sum(USER_COUNT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as YGL,
0 as JHCL,
(select sum(WEIGHT) FROM hpjx.T_HPXS001
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,4) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode#
group by FACTORY_CODE,left(REGISTER_DATE,4)) as SJCL
(select
sum(WEIGHT)
FROM hpjx.t_hpsc008
where COMPANY_CODE = #companyCode# and left(REGISTER_DATE,6) = left(#date#,4) and REGISTER_DATE <![CDATA[<=]]> #date# and FACTORY_CODE = #factorycode# ) as SJCL
from dual) a
</select>
......@@ -245,10 +245,10 @@
select
a.PROJ_NAME,
concat(left(max(a.PLAN_COMPLETION_DATE),4),'年',substring(max(a.PLAN_COMPLETION_DATE),5,2),'月',right(max(a.PLAN_COMPLETION_DATE),2),'日') as JHDATE,
concat(format(ifnull(sum(b.TOTAL_WT ),0),2),'吨') as JHCL,
concat(format(ifnull(sum(b.NUM*b.UNIT_WT ),0),2),'吨') as JHCL,
concat(format(ifnull(sum(c.WEIGHT),0),2),'吨') as SJCL,
concat(format((ifnull( sum( c.AMOUNT ), 0 ) / ifnull( sum( b.NUM ), 0 ) * 100),2),'%') as SCJD,
concat(format((ifnull( sum( d.AMOUNT ), 0 ) / ifnull( sum( b.NUM ), 0 ) * 100),2),'%') as FHJD
concat(format((ifnull( sum( c.WEIGHT ), 0 ) / ifnull( sum( b.NUM*b.UNIT_WT ), 0 ) * 100),2),'%') as SCJD,
concat(format((ifnull( sum( d.WEIGHT ), 0 ) / ifnull( sum( b.NUM*b.UNIT_WT ), 0 ) * 100),2),'%') as FHJD
from hpjx.T_HPSC003 a
join hpjx.T_HPSC004 b on b.PARENT_ID = a.PLAN_INFO_NO
left join hpjx.T_HPkC003 c on c.PROD_ORDER_NO = b.PROD_ORDER_NO
......
......@@ -8,6 +8,7 @@ import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.sc.domain.HPSC008;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.contants.ACConstants;
......@@ -191,7 +192,12 @@ public class ServiceHPSC008 extends ServiceEPBase {
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
List<Map> result = this.dao.query("HPSC008.queryMaxDate", sqlMap);
String registerDate = (String) result.get(0).get("registerDate");
String registerDate = "";
if(result==null||result.size()==0||result.get(0).get("registerDate")==null){
registerDate = DateUtils.yesterday();
}else{
registerDate = (String) result.get(0).get("registerDate");
}
registerDate = registerDate.substring(0,4)+"-"+registerDate.substring(4,6)+"-"+registerDate.substring(6,8);
inInfo.set("registerDate",registerDate);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -60,7 +60,15 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static String date() {
return date(null);
}
/**
* 获取前一天日期字符串(yyyy-MM-dd)
*
* @return
*/
public static String yesterday() {
return LocalDate.now().minusDays(1).format(DATE);
}
/**
* 获取日期字符串(yyyy-MM-dd)
*
......
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