From c82aec961c16cf72e9389230468b0e1adcc0798b Mon Sep 17 00:00:00 2001 From: zhangjun Date: Thu, 27 Aug 2020 18:23:46 +0800 Subject: [PATCH] =?UTF-8?q?APP=E4=B8=9A=E5=8A=A1=E6=B5=81=E8=BD=AC?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=94=B1=E7=A7=92=E6=94=B9=E4=B8=BA=E6=97=B6?= =?UTF-8?q?=E5=B9=B6=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../change/initiate/service/impl/ApplyChangeServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/service/impl/ApplyChangeServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/service/impl/ApplyChangeServiceImpl.java index d75e9c196..dfe6f83d0 100644 --- a/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/service/impl/ApplyChangeServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/service/impl/ApplyChangeServiceImpl.java @@ -59,11 +59,11 @@ public class ApplyChangeServiceImpl implements ApplyChangeService{ String disSql = "SELECT distributor_no FROM distributor_info WHERE orgid=(SELECT belongorg FROM user_info WHERE userid='"+userId+"' )"; List> disList = DataOperatorUtil.getDataBySql(disSql); if(disList.size()>0){ - String listSql = "SELECT lci.contract_no contract_no,dis.distributorTime distime,cus.distributorTime custime FROM lb_contract_info lci LEFT JOIN lb_project_info lpi ON lci.project_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND (ft.phaseno='0010' OR ft.phaseno='0020')) OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno='0010'))GROUP BY fbo.proj_id ) dis ON dis.proj_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND ft.phaseno<>'0010' AND ft.phaseno<>'0020' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000') OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno<>'0010' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000'))GROUP BY fbo.proj_id) cus ON cus.proj_id=lpi.id WHERE lci.CONTRACT_STATUS>=31 AND lci.distributor_id='"+disList.get(0).get("distributor_no")+"' ORDER BY dis.distributorTime DESC "; + String listSql = "SELECT lci.contract_no contract_no,dis.distributorTime distime,cus.distributorTime custime FROM lb_contract_info lci LEFT JOIN lb_project_info lpi ON lci.project_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,ROUND((SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) / 3600),1) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND (ft.phaseno='0010' OR ft.phaseno='0020')) OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno='0010'))GROUP BY fbo.proj_id ) dis ON dis.proj_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,ROUND((SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) / 3600),1) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND ft.phaseno<>'0010' AND ft.phaseno<>'0020' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000') OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno<>'0010' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000'))GROUP BY fbo.proj_id) cus ON cus.proj_id=lpi.id WHERE lci.CONTRACT_STATUS>=31 AND lci.distributor_id='"+disList.get(0).get("distributor_no")+"' ORDER BY dis.distributorTime DESC "; List> dataList = DataOperatorUtil.getDataBySql(listSql); body.put("listdatas", dataList); //String averageSql = "select * from ( SELECT LEFT(lpi.INPUTTIME,7) yearmonth,SUM(dis.distributorTime)/COUNT(lpi.INPUTTIME) averagedistim,SUM(cus.distributorTime)/COUNT(lpi.INPUTTIME) averagecustime FROM lb_contract_info lci LEFT JOIN lb_project_info lpi ON lci.project_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND (ft.phaseno='0010' OR ft.phaseno='0020')) OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno='0010'))GROUP BY fbo.proj_id ) dis ON dis.proj_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND ft.phaseno<>'0010' AND ft.phaseno<>'0020' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000') OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno<>'0010' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000'))GROUP BY fbo.proj_id) cus ON cus.proj_id=lpi.id WHERE lci.CONTRACT_STATUS>=31 AND LEFT(lpi.INPUTTIME,7)<='"+month+"' AND lci.distributor_id='"+disList.get(0).get("distributor_no")+"' GROUP BY LEFT(lpi.INPUTTIME,7) ORDER BY LEFT(lpi.INPUTTIME,7) DESC LIMIT 0,6 ) t ORDER BY yearmonth ASC"; - String averageSql ="SELECT VED.xtime AS yearmonth,IFNULL(t.averagedistim,0) AS averagedistim,IFNULL(t.averagecustime,0) AS averagecustime FROM (SELECT LEFT(EVERY_DAY,7) xtime FROM VI_EVERY_DAY WHERE LEFT(EVERY_DAY,7)<='"+month+"' GROUP BY LEFT(EVERY_DAY,7) ORDER BY LEFT(EVERY_DAY,7) DESC LIMIT 0,6) VED LEFT JOIN ( SELECT LEFT(lpi.INPUTTIME,7) yearmonth,SUM(dis.distributorTime)/COUNT(lpi.INPUTTIME) averagedistim,SUM(cus.distributorTime)/COUNT(lpi.INPUTTIME) averagecustime FROM lb_contract_info lci LEFT JOIN lb_project_info lpi ON lci.project_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND (ft.phaseno='0010' OR ft.phaseno='0020')) OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno='0010'))GROUP BY fbo.proj_id ) dis ON dis.proj_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND ft.phaseno<>'0010' AND ft.phaseno<>'0020' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000') OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno<>'0010' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000'))GROUP BY fbo.proj_id) cus ON cus.proj_id=lpi.id WHERE lci.CONTRACT_STATUS>=31 AND lci.distributor_id='"+disList.get(0).get("distributor_no")+"' GROUP BY LEFT(lpi.INPUTTIME,7) ORDER BY LEFT(lpi.INPUTTIME,7) ) t ON VED.xtime=LEFT(t.yearmonth,7) ORDER BY VED.xtime "; + String averageSql ="SELECT VED.xtime AS yearmonth,IFNULL(t.averagedistim,0) AS averagedistim,IFNULL(t.averagecustime,0) AS averagecustime FROM (SELECT LEFT(EVERY_DAY,7) xtime FROM VI_EVERY_DAY WHERE LEFT(EVERY_DAY,7)<='"+month+"' GROUP BY LEFT(EVERY_DAY,7) ORDER BY LEFT(EVERY_DAY,7) DESC LIMIT 0,6) VED LEFT JOIN ( SELECT LEFT(lpi.INPUTTIME,7) yearmonth,SUM(dis.distributorTime)/COUNT(lpi.INPUTTIME) averagedistim,SUM(cus.distributorTime)/COUNT(lpi.INPUTTIME) averagecustime FROM lb_contract_info lci LEFT JOIN lb_project_info lpi ON lci.project_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,ROUND((SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) / 3600),1) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND (ft.phaseno='0010' OR ft.phaseno='0020')) OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno='0010'))GROUP BY fbo.proj_id ) dis ON dis.proj_id=lpi.id LEFT JOIN (SELECT fbo.proj_id,ROUND((SUM(TIMESTAMPDIFF(SECOND,ft.begintime,ft.endtime)) / 3600),1) distributorTime FROM flow_bussiness_object fbo LEFT JOIN flow_task ft ON fbo.flow_unid=ft.objectno WHERE ((fbo.flow_name IN ('业务申请流程','业务变更流程') AND ft.phaseno<>'0010' AND ft.phaseno<>'0020' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000') OR (fbo.flow_name IN ('合同制作流程','合同变更流程','付款申请(汽车)') AND ft.phaseno<>'0010' AND ft.phaseno<>'1000' AND ft.phaseno<>'8000'))GROUP BY fbo.proj_id) cus ON cus.proj_id=lpi.id WHERE lci.CONTRACT_STATUS>=31 AND lci.distributor_id='"+disList.get(0).get("distributor_no")+"' GROUP BY LEFT(lpi.INPUTTIME,7) ORDER BY LEFT(lpi.INPUTTIME,7) ) t ON VED.xtime=LEFT(t.yearmonth,7) ORDER BY VED.xtime "; List> averageSqldataList = DataOperatorUtil.getDataBySql(averageSql); body.put("averagedatas", averageSqldataList);