|
@@ -3,6 +3,7 @@ package com.ruoyi.powerdistribution.controller;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
+import com.ruoyi.common.utils.bean.BeanUtils;
|
|
import com.ruoyi.common.utils.uuid.UUID;
|
|
import com.ruoyi.common.utils.uuid.UUID;
|
|
import com.ruoyi.powerdistribution.domain.*;
|
|
import com.ruoyi.powerdistribution.domain.*;
|
|
import com.ruoyi.powerdistribution.domain.dto.PdmWorkPlanDTO;
|
|
import com.ruoyi.powerdistribution.domain.dto.PdmWorkPlanDTO;
|
|
@@ -24,6 +25,7 @@ import java.io.*;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
* 周报导出
|
|
* 周报导出
|
|
@@ -67,44 +69,117 @@ public class WeeklyReportController extends BaseController {
|
|
dataMap.put("endDay",month+"月"+new SimpleDateFormat("dd").format(cvrtEndDate)+"日");
|
|
dataMap.put("endDay",month+"月"+new SimpleDateFormat("dd").format(cvrtEndDate)+"日");
|
|
|
|
|
|
|
|
|
|
- dataMap.put("jobRecNum",0);
|
|
|
|
- dataMap.put("weekPlanJobReNum",0);
|
|
|
|
- dataMap.put("cancelRecNum",0);
|
|
|
|
- dataMap.put("implRate",0);
|
|
|
|
- dataMap.put("lowImplUnit","");
|
|
|
|
- dataMap.put("lowImplRate","");
|
|
|
|
- dataMap.put("tmpPlanRecNum",0);
|
|
|
|
- dataMap.put("repairRecNum",0);
|
|
|
|
- dataMap.put("operateRecNum",0);
|
|
|
|
- dataMap.put("maintenanceNum",0);
|
|
|
|
- dataMap.put("expanRelocationNum",0);
|
|
|
|
- dataMap.put("networkReformNum",0);
|
|
|
|
- dataMap.put("tmpPlanRate",0);
|
|
|
|
- dataMap.put("cancelTmpPlanRecNum",0);
|
|
|
|
- dataMap.put("tmpPlanImplRate",0);
|
|
|
|
PdmReportPlanWeek pdmReportPlan = new PdmReportPlanWeek();
|
|
PdmReportPlanWeek pdmReportPlan = new PdmReportPlanWeek();
|
|
pdmReportPlan.setReportDate(beingDate);
|
|
pdmReportPlan.setReportDate(beingDate);
|
|
pdmReportPlan.setReportEndDate(endDate);
|
|
pdmReportPlan.setReportEndDate(endDate);
|
|
List<PdmReportPlanWeek> planlist = pdmReportPlanWeekService.selectPdmReportPlanWeekList(pdmReportPlan);
|
|
List<PdmReportPlanWeek> planlist = pdmReportPlanWeekService.selectPdmReportPlanWeekList(pdmReportPlan);
|
|
dataMap.put("planlist",planlist);
|
|
dataMap.put("planlist",planlist);
|
|
|
|
+ long jobRecNum=0;
|
|
|
|
+ long weekPlanJobReNum=0;
|
|
|
|
+ long cancelRecNum=0;
|
|
|
|
+ String implRate="";
|
|
|
|
+ long tmpPlanRecNum=0;
|
|
|
|
+ String tmpPlanRate="";
|
|
|
|
+ long cancelTmpPlanRecNum=0;
|
|
|
|
+ String tmpPlanImplRate="";
|
|
|
|
+ String lowImplUnit="";
|
|
|
|
+ String lowImplRate="";
|
|
|
|
+
|
|
|
|
+ if(planlist!=null && planlist.size()>1){
|
|
|
|
+ pdmReportPlan=planlist.get(planlist.size()-1);
|
|
|
|
+ jobRecNum=pdmReportPlan.getTotal();
|
|
|
|
+ weekPlanJobReNum=pdmReportPlan.getWeekSum();
|
|
|
|
+ cancelRecNum=pdmReportPlan.getWeekCancelSum();
|
|
|
|
+ implRate=pdmReportPlan.getWeekRatio();
|
|
|
|
+ tmpPlanRecNum=pdmReportPlan.getTemporarySum();
|
|
|
|
+ tmpPlanRate=pdmReportPlan.getTemporaryPlanRatio();
|
|
|
|
+ cancelTmpPlanRecNum=pdmReportPlan.getTemporaryCancelSum();
|
|
|
|
+ tmpPlanImplRate=pdmReportPlan.getTemporaryRatio();
|
|
|
|
+ List<PdmReportPlanWeek> planlist2=new ArrayList<>();
|
|
|
|
+ planlist.forEach(plan->{
|
|
|
|
+ if(!plan.getCompany().equals("总计")){
|
|
|
|
+ PdmReportPlanWeek planWeek=new PdmReportPlanWeek();
|
|
|
|
+ BeanUtils.copyBeanProp(planWeek,plan);
|
|
|
|
+ planlist2.add(planWeek);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ Collections.sort(planlist2, new Comparator<PdmReportPlanWeek>(){
|
|
|
|
+ public int compare(PdmReportPlanWeek o1, PdmReportPlanWeek o2) {
|
|
|
|
+
|
|
|
|
+ if((o1.getWeekSum()-o1.getWeekCancelSum())/o1.getWeekSum() > (o2.getWeekSum()-o2.getWeekCancelSum())/o2.getWeekSum()){
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+ if((o1.getWeekSum()-o1.getWeekCancelSum())/o1.getWeekSum() < (o2.getWeekSum()-o2.getWeekCancelSum())/o2.getWeekSum()){
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ PdmReportPlanWeek lowPdmReportPlan=planlist2.get(planlist2.size()-1);
|
|
|
|
+ lowImplUnit=lowPdmReportPlan.getCompany();
|
|
|
|
+ lowImplRate=lowPdmReportPlan.getWeekRatio();
|
|
|
|
+ }
|
|
|
|
+ dataMap.put("jobRecNum",jobRecNum);
|
|
|
|
+ dataMap.put("weekPlanJobReNum",weekPlanJobReNum);
|
|
|
|
+ dataMap.put("cancelRecNum",cancelRecNum);
|
|
|
|
+ dataMap.put("implRate",implRate);
|
|
|
|
+ dataMap.put("lowImplUnit",lowImplUnit);
|
|
|
|
+ dataMap.put("lowImplRate",lowImplRate);
|
|
|
|
+ dataMap.put("tmpPlanRecNum",tmpPlanRecNum);
|
|
|
|
+ dataMap.put("repairRecNum",0);
|
|
|
|
+ dataMap.put("operateRecNum",0);
|
|
|
|
+ dataMap.put("maintenanceNum",0);
|
|
|
|
+ dataMap.put("expanRelocationNum",0);
|
|
|
|
+ dataMap.put("networkReformNum",0);
|
|
|
|
+ dataMap.put("tmpPlanRate",tmpPlanRate);
|
|
|
|
+ dataMap.put("cancelTmpPlanRecNum",cancelTmpPlanRecNum);
|
|
|
|
+ dataMap.put("tmpPlanImplRate",tmpPlanImplRate);
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
String nextMonday=DateUtils.getNextMonday(beingDate,"yyyyMMdd");
|
|
String nextMonday=DateUtils.getNextMonday(beingDate,"yyyyMMdd");
|
|
- String nextSunday=DateUtils.getNextSunday(beingDate,"yyyyMMdd");
|
|
+ String nextSunday=DateUtils.getNextSunday(endDate,"yyyyMMdd");
|
|
Date cvrtNextMonday = sdf.parse(nextMonday);
|
|
Date cvrtNextMonday = sdf.parse(nextMonday);
|
|
Date cvrtNextSunday = sdf.parse(nextSunday);
|
|
Date cvrtNextSunday = sdf.parse(nextSunday);
|
|
|
|
+
|
|
|
|
+ long nextWeekJobRecNum=0;
|
|
|
|
+ long nextWeekSwitchingNum=0;
|
|
|
|
+ long distribuNetworkEngineNum=0;
|
|
|
|
+ long nextWeekExpanRelocationNum=0;
|
|
|
|
+ long nextWeekMaintenanceNum=0;
|
|
|
|
+ String threeLevelRiskNum="0";
|
|
|
|
+ String fourLevelRiskNum="0";
|
|
|
|
+ String fiveLevelRiskNum="0";
|
|
|
|
+ long liveWorkingNum=0;
|
|
|
|
+ PdmReportPlanNextWeek next = new PdmReportPlanNextWeek();
|
|
|
|
+ next.setReportDate(nextMonday);
|
|
|
|
+ next.setReportEndDate(nextSunday);
|
|
|
|
+ List<PdmReportPlanNextWeek> nextList = pdmReportPlanNextWeekService.selectPdmReportPlanNextWeekList(next);
|
|
|
|
+ if(nextList!=null && nextList.size()>1){
|
|
|
|
+ next=nextList.get(nextList.size()-1);
|
|
|
|
+ nextWeekJobRecNum=next.getWorkTotal();
|
|
|
|
+ nextWeekSwitchingNum=next.getWorkType1Sum();
|
|
|
|
+ distribuNetworkEngineNum=next.getWorkType2Sum();
|
|
|
|
+ nextWeekExpanRelocationNum=next.getWorkType3Sum();
|
|
|
|
+ nextWeekMaintenanceNum=next.getWorkType4Sum();
|
|
|
|
+ threeLevelRiskNum=next.getPlanLeve3();
|
|
|
|
+ fourLevelRiskNum=next.getPlanLeve4();
|
|
|
|
+ fiveLevelRiskNum=next.getPlanLeve5();
|
|
|
|
+ liveWorkingNum=next.getElePlanSum();
|
|
|
|
+ }
|
|
|
|
+
|
|
month=new SimpleDateFormat("MM").format(cvrtNextMonday);
|
|
month=new SimpleDateFormat("MM").format(cvrtNextMonday);
|
|
dataMap.put("nextWeekBeginDay",month+"月"+new SimpleDateFormat("dd").format(cvrtNextMonday)+"日");
|
|
dataMap.put("nextWeekBeginDay",month+"月"+new SimpleDateFormat("dd").format(cvrtNextMonday)+"日");
|
|
dataMap.put("nextWeekEndDay",month+"月"+new SimpleDateFormat("dd").format(cvrtNextSunday)+"日");
|
|
dataMap.put("nextWeekEndDay",month+"月"+new SimpleDateFormat("dd").format(cvrtNextSunday)+"日");
|
|
- dataMap.put("nextWeekJobRecNum",0);
|
|
+ dataMap.put("nextWeekJobRecNum",nextWeekJobRecNum);
|
|
- dataMap.put("nextWeekSwitchingNum",0);
|
|
+ dataMap.put("nextWeekSwitchingNum",nextWeekSwitchingNum);
|
|
- dataMap.put("distribuNetworkEngineNum",0);
|
|
+ dataMap.put("distribuNetworkEngineNum",distribuNetworkEngineNum);
|
|
- dataMap.put("nextWeekExpanRelocationNum",0);
|
|
+ dataMap.put("nextWeekExpanRelocationNum",nextWeekExpanRelocationNum);
|
|
- dataMap.put("nextWeekMaintenanceNum",0);
|
|
+ dataMap.put("nextWeekMaintenanceNum",nextWeekMaintenanceNum);
|
|
- dataMap.put("threeLevelRiskNum",0);
|
|
+ dataMap.put("threeLevelRiskNum",threeLevelRiskNum);
|
|
- dataMap.put("fourLevelRiskNum",0);
|
|
+ dataMap.put("fourLevelRiskNum",fourLevelRiskNum);
|
|
- dataMap.put("fiveLevelRiskNum",0);
|
|
+ dataMap.put("fiveLevelRiskNum",fiveLevelRiskNum);
|
|
- dataMap.put("liveWorkingNum",0);
|
|
+ dataMap.put("liveWorkingNum",liveWorkingNum);
|
|
dataMap.put("liveDisconnectLeadNum",0);
|
|
dataMap.put("liveDisconnectLeadNum",0);
|
|
dataMap.put("assemDeviceNum",0);
|
|
dataMap.put("assemDeviceNum",0);
|
|
|
|
|
|
@@ -126,46 +201,72 @@ public class WeeklyReportController extends BaseController {
|
|
String fousMaintenanceInfo="";
|
|
String fousMaintenanceInfo="";
|
|
dataMap.put("fousMaintenanceInfo", StringUtils.isEmpty(fousMaintenanceInfo)?"无":fousMaintenanceInfo);
|
|
dataMap.put("fousMaintenanceInfo", StringUtils.isEmpty(fousMaintenanceInfo)?"无":fousMaintenanceInfo);
|
|
|
|
|
|
- PdmReportPlanNextWeek next = new PdmReportPlanNextWeek();
|
|
|
|
- next.setReportDate(nextMonday);
|
|
|
|
- next.setReportEndDate(nextSunday);
|
|
|
|
- List<PdmReportPlanNextWeek> nextList = pdmReportPlanNextWeekService.selectPdmReportPlanNextWeekList(next);
|
|
|
|
dataMap.put("nextWeekWorkList",nextList);
|
|
dataMap.put("nextWeekWorkList",nextList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- dataMap.put("investPunishRecAllNum",0);
|
|
+ long provinceInvestSeriousRecNum=0;
|
|
- dataMap.put("provinceInvestPunishRecNum",0);
|
|
+ long provinceInvestGeneralRecNum=0;
|
|
- dataMap.put("cityInvestPunishRecNum",0);
|
|
+ long cityInvestSeriousRecNum=0;
|
|
- dataMap.put("cityInvestSeriousRecNum",0);
|
|
+ long cityInvestGeneralRecNum=0;
|
|
- dataMap.put("cityInvestGeneralRecNum",0);
|
|
+ long countyInvestSeriousRecNum=0;
|
|
- dataMap.put("countyInvestPunishRecNum",0);
|
|
+ long countyInvestGeneralRecNum=0;
|
|
- dataMap.put("countyInvestSeriousRecNum",0);
|
|
|
|
- dataMap.put("countyInvestGeneralRecNum",0);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
PdmReportIllegalWeek pdmReportIllegal = new PdmReportIllegalWeek();
|
|
PdmReportIllegalWeek pdmReportIllegal = new PdmReportIllegalWeek();
|
|
pdmReportIllegal.setReportDate(beingDate);
|
|
pdmReportIllegal.setReportDate(beingDate);
|
|
pdmReportIllegal.setReportEndDate(endDate);
|
|
pdmReportIllegal.setReportEndDate(endDate);
|
|
List<PdmReportIllegalWeek> illegalList = pdmReportIllegalWeekService.selectPdmReportIllegalWeekList(pdmReportIllegal);
|
|
List<PdmReportIllegalWeek> illegalList = pdmReportIllegalWeekService.selectPdmReportIllegalWeekList(pdmReportIllegal);
|
|
|
|
+ if(illegalList!=null && illegalList.size()>1){
|
|
|
|
+ pdmReportIllegal=illegalList.get(illegalList.size()-1);
|
|
|
|
+ provinceInvestSeriousRecNum=pdmReportIllegal.getProvinceNum1();
|
|
|
|
+ provinceInvestGeneralRecNum=pdmReportIllegal.getProvinceNum2();
|
|
|
|
+ cityInvestSeriousRecNum=pdmReportIllegal.getCityNum1();
|
|
|
|
+ cityInvestGeneralRecNum=pdmReportIllegal.getCityNum2();
|
|
|
|
+ countyInvestSeriousRecNum=pdmReportIllegal.getCountyNum1();
|
|
|
|
+ countyInvestGeneralRecNum=pdmReportIllegal.getCountyNum2();
|
|
|
|
+ }
|
|
|
|
+ dataMap.put("investPunishRecAllNum",(provinceInvestSeriousRecNum+provinceInvestGeneralRecNum+cityInvestSeriousRecNum+cityInvestGeneralRecNum+countyInvestSeriousRecNum+countyInvestGeneralRecNum));
|
|
|
|
+ dataMap.put("provinceInvestPunishRecNum",(provinceInvestSeriousRecNum+provinceInvestGeneralRecNum));
|
|
|
|
+ dataMap.put("cityInvestPunishRecNum",(cityInvestSeriousRecNum+cityInvestGeneralRecNum));
|
|
|
|
+ dataMap.put("cityInvestSeriousRecNum",cityInvestSeriousRecNum);
|
|
|
|
+ dataMap.put("cityInvestGeneralRecNum",cityInvestGeneralRecNum);
|
|
|
|
+ dataMap.put("countyInvestPunishRecNum",(countyInvestSeriousRecNum+countyInvestGeneralRecNum));
|
|
|
|
+ dataMap.put("countyInvestSeriousRecNum",countyInvestSeriousRecNum);
|
|
|
|
+ dataMap.put("countyInvestGeneralRecNum",countyInvestGeneralRecNum);
|
|
|
|
+
|
|
dataMap.put("illegalList",illegalList);
|
|
dataMap.put("illegalList",illegalList);
|
|
String typicalIllegal="";
|
|
String typicalIllegal="";
|
|
dataMap.put("typicalIllegal",StringUtils.isEmpty(typicalIllegal)?"无":typicalIllegal);
|
|
dataMap.put("typicalIllegal",StringUtils.isEmpty(typicalIllegal)?"无":typicalIllegal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- dataMap.put("supervTimes",0);
|
|
+ long leaderSupervTimes=0;
|
|
- dataMap.put("leaderSupervTimes",0);
|
|
+ long manageSupervTimes=0;
|
|
- dataMap.put("manageSupervTimes",0);
|
|
+ long problemNum=0;
|
|
- dataMap.put("problemNum",0);
|
|
+ long cityFindProblemNum=0;
|
|
- dataMap.put("cityFindProblemNum",0);
|
|
+ long derelictionDutyNum=0;
|
|
- dataMap.put("derelictionDutyNum",0);
|
|
|
|
-
|
|
|
|
PdmReportAppointmentWeek pdmReportAppointment = new PdmReportAppointmentWeek();
|
|
PdmReportAppointmentWeek pdmReportAppointment = new PdmReportAppointmentWeek();
|
|
pdmReportAppointment.setReportDate(beingDate);
|
|
pdmReportAppointment.setReportDate(beingDate);
|
|
pdmReportAppointment.setReportEndDate(endDate);
|
|
pdmReportAppointment.setReportEndDate(endDate);
|
|
List<PdmReportAppointmentWeek> appointmentlist = pdmReportAppointmentWeekService.selectPdmReportAppointmentWeekList(pdmReportAppointment);
|
|
List<PdmReportAppointmentWeek> appointmentlist = pdmReportAppointmentWeekService.selectPdmReportAppointmentWeekList(pdmReportAppointment);
|
|
|
|
+
|
|
|
|
+ if(appointmentlist!=null && appointmentlist.size()>1) {
|
|
|
|
+ pdmReportAppointment=appointmentlist.get(appointmentlist.size()-1);
|
|
|
|
+ leaderSupervTimes=pdmReportAppointment.getBossSum();
|
|
|
|
+ manageSupervTimes=pdmReportAppointment.getManageSum();
|
|
|
|
+ problemNum=pdmReportAppointment.getProblemSum();
|
|
|
|
+ cityFindProblemNum=pdmReportAppointment.getCityCheckSum();
|
|
|
|
+ derelictionDutyNum=pdmReportAppointment.getAbsentSum();
|
|
|
|
+
|
|
|
|
+ }
|
|
dataMap.put("appointmentlist",appointmentlist);
|
|
dataMap.put("appointmentlist",appointmentlist);
|
|
|
|
+ dataMap.put("supervTimes",(leaderSupervTimes+manageSupervTimes));
|
|
|
|
+ dataMap.put("leaderSupervTimes",leaderSupervTimes);
|
|
|
|
+ dataMap.put("manageSupervTimes",manageSupervTimes);
|
|
|
|
+ dataMap.put("problemNum",problemNum);
|
|
|
|
+ dataMap.put("cityFindProblemNum",cityFindProblemNum);
|
|
|
|
+ dataMap.put("derelictionDutyNum",derelictionDutyNum);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
File descFile=null;
|
|
File descFile=null;
|
|
try {
|
|
try {
|