|
|
@@ -1,17 +1,26 @@
|
|
|
package com.steerinfo.meterwork.meterworkdatacount.service.impl;
|
|
|
|
|
|
-import com.google.inject.internal.cglib.core.$RejectModifierPredicate;
|
|
|
-import com.ibm.wsdl.extensions.schema.SchemaImpl;
|
|
|
+import com.steerinfo.baseinfo.meterbaseoperationlog.mapper.MeterBaseOperationLogMapper;
|
|
|
+import com.steerinfo.baseinfo.meterbasespotinfo.mapper.MeterBaseSpotInfoMapper;
|
|
|
+import com.steerinfo.baseinfo.meterbasespotinfo.model.MeterBaseSpotInfo;
|
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
import com.steerinfo.framework.user.UserPayload;
|
|
|
+import com.steerinfo.meterwork.meterworkcaractual.mapper.MeterWorkCarActualMapper;
|
|
|
+import com.steerinfo.meterwork.meterworkcaractual.model.MeterWorkCarActual;
|
|
|
+import com.steerinfo.meterwork.meterworkcaractualfirst.mapper.MeterWorkCarActualFirstMapper;
|
|
|
+import com.steerinfo.meterwork.meterworkcaractualfirst.model.MeterWorkCarActualFirst;
|
|
|
import com.steerinfo.meterwork.meterworkdatacount.mapper.MeterWorkDataCountMapper;
|
|
|
import com.steerinfo.meterwork.meterworkdatacount.model.CarRegularComparison;
|
|
|
+import com.steerinfo.meterwork.meterworkdatacount.model.WorkLoadReportInfo;
|
|
|
import com.steerinfo.meterwork.meterworkdatacount.service.IMeterWorkDataCountService;
|
|
|
-import org.apache.shiro.crypto.hash.Hash;
|
|
|
+import com.steerinfo.meterwork.meterworkrailwayactfirst.mapper.MeterWorkRailwayActFirstMapper;
|
|
|
+import com.steerinfo.meterwork.meterworkrailwayactfirst.model.MeterWorkRailwayActFirst;
|
|
|
+import com.steerinfo.meterwork.meterworkrailwayactual.mapper.MeterWorkRailwayActualMapper;
|
|
|
+import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
|
|
|
+import com.steerinfo.util.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import javax.validation.Payload;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
@@ -23,6 +32,23 @@ public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService
|
|
|
@Resource
|
|
|
private MeterWorkDataCountMapper meterWorkDataCountMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private MeterBaseSpotInfoMapper meterBaseSpotInfoMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private MeterWorkCarActualMapper meterWorkCarActualMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private MeterWorkCarActualFirstMapper meterWorkCarActualFirstMaper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private MeterBaseOperationLogMapper meterBaseOperationLogMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private MeterWorkRailwayActualMapper meterWorkRailwayActualMapper;
|
|
|
+ @Resource
|
|
|
+ private MeterWorkRailwayActFirstMapper meterWorkRailwayActFirstMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public List<HashMap> countFirstAndActual(HashMap<String, Object> params) {
|
|
|
List<HashMap> models = meterWorkDataCountMapper.countFirstAndActual(params);
|
|
|
@@ -61,8 +87,8 @@ public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService
|
|
|
Calendar afterTime = Calendar.getInstance();
|
|
|
beforeTime.setTime(model.getCreateTime()); //设置时间
|
|
|
afterTime.setTime(model.getCreateTime()); //设置时间
|
|
|
- beforeTime.add(Calendar.MINUTE, -5);// 5分钟之前的时间
|
|
|
- afterTime.add(Calendar.MINUTE, 5);// 5分钟之后的时间
|
|
|
+ beforeTime.add(Calendar.MINUTE, -30);// 5分钟之前的时间
|
|
|
+ afterTime.add(Calendar.MINUTE, 30);// 5分钟之后的时间
|
|
|
Date beforeD = beforeTime.getTime();
|
|
|
Date afterD = afterTime.getTime();
|
|
|
String startTime = sdf.format(beforeD);
|
|
|
@@ -85,14 +111,46 @@ public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService
|
|
|
long count = models.stream().filter(item -> item.getActualFirstNo().equals(modelsB.get(0).getActualFirstNo())).count();
|
|
|
//一次作业编号不存在,则添加,否者,跳过
|
|
|
if(count < 1) {
|
|
|
- if(modelsB.get(0).getSpotAreaNo().equals(model.getSpotAreaNo())) {
|
|
|
- model.setMemo("双秤比对");
|
|
|
- }else {
|
|
|
- model.setMemo("异地比对");
|
|
|
+ SimpleDateFormat simpleFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date timeDate1 = simpleFormat.parse(sdf.format(modelsB.get(0).getCreateTime()));
|
|
|
+ Date timeDate2 = simpleFormat.parse(sdf.format(model.getCreateTime()));
|
|
|
+ long time1 = timeDate1.getTime();
|
|
|
+ long time2 = timeDate2.getTime();
|
|
|
+ int minutes = Math.abs((int) ((time1 - time2) / (1000 * 60)));
|
|
|
+ if(StringUtils.isEmpty(model.getWeightType()) || StringUtils.isEmpty(modelsB.get(0).getWeightType())){
|
|
|
+ if(modelsB.get(0).getSpotAreaNo().equals(model.getSpotAreaNo())
|
|
|
+ && minutes <= 20) {
|
|
|
+ model.setMemo("双秤比对");
|
|
|
+ model.setSubstract(model.getMeterWeight().subtract(modelsB.get(0).getMeterWeight()));
|
|
|
+ models.add(model);
|
|
|
+ models.add(modelsB.get(0));
|
|
|
+ }else if(!modelsB.get(0).getSpotAreaNo().equals(model.getSpotAreaNo())
|
|
|
+ && minutes >= 30 && minutes <= 60){
|
|
|
+ model.setMemo("异地比对");
|
|
|
+ model.setSubstract(model.getMeterWeight().subtract(modelsB.get(0).getMeterWeight()));
|
|
|
+ models.add(model);
|
|
|
+ models.add(modelsB.get(0));
|
|
|
+ }
|
|
|
+ }else if(StringUtils.isNotEmpty(model.getWeightType()) && StringUtils.isNotEmpty(modelsB.get(0).getWeightType())
|
|
|
+ && !(modelsB.get(0).getWeightType().equals("0") && model.getWeightType().equals("1"))
|
|
|
+ && !(modelsB.get(0).getWeightType().equals("1") && model.getWeightType().equals("0"))
|
|
|
+ && !(modelsB.get(0).getWeightType().equals("0") && model.getWeightType().equals("2"))
|
|
|
+ && !(modelsB.get(0).getWeightType().equals("2") && model.getWeightType().equals("0"))) {
|
|
|
+ if(modelsB.get(0).getSpotAreaNo().equals(model.getSpotAreaNo())
|
|
|
+ && minutes <= 20) {
|
|
|
+ model.setMemo("双秤比对");
|
|
|
+ model.setSubstract(model.getMeterWeight().subtract(modelsB.get(0).getMeterWeight()));
|
|
|
+ models.add(model);
|
|
|
+ models.add(modelsB.get(0));
|
|
|
+ }else if(!modelsB.get(0).getSpotAreaNo().equals(model.getSpotAreaNo())
|
|
|
+ && minutes >= 30 && minutes <= 60){
|
|
|
+ model.setMemo("异地比对");
|
|
|
+ model.setSubstract(model.getMeterWeight().subtract(modelsB.get(0).getMeterWeight()));
|
|
|
+ models.add(model);
|
|
|
+ models.add(modelsB.get(0));
|
|
|
+ }
|
|
|
}
|
|
|
- model.setSubstract(model.getMeterWeight().subtract(modelsB.get(0).getMeterWeight()));
|
|
|
- models.add(model);
|
|
|
- models.add(modelsB.get(0));
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -106,4 +164,971 @@ public class MeterWorkDataCountServiceImpl implements IMeterWorkDataCountService
|
|
|
}
|
|
|
return rm;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<HashMap> countDayAllSpot(HashMap<String, Object> params) {
|
|
|
+
|
|
|
+ if(params.get("netSpot3NoStr") != null) {
|
|
|
+ String[] spotNoStr = params.get("netSpot3NoStr").toString().split(",");
|
|
|
+ params.put("spotNoStr", spotNoStr);
|
|
|
+ }
|
|
|
+ List<HashMap> paramsList = new ArrayList<>();
|
|
|
+ long countActualTemp = 0L;
|
|
|
+ long countFirstTemp = 0L;
|
|
|
+ long countActualValidTemp = 0L;
|
|
|
+ long countFirstValidTemp = 0L;
|
|
|
+ {
|
|
|
+ HashMap params01 = new HashMap();
|
|
|
+ List<HashMap> paramsList02 = new ArrayList<>();
|
|
|
+ List<MeterBaseSpotInfo> spotModelList = meterBaseSpotInfoMapper.carSpotGroupByActualAndFirst(params);
|
|
|
+
|
|
|
+ //总结净数
|
|
|
+ HashMap<String, Object> actualMap = new HashMap<>();
|
|
|
+ actualMap.put("startTime", params.get("startTime"));
|
|
|
+ actualMap.put("endTime", params.get("endTime"));
|
|
|
+ List<HashMap> carActualTotal = meterWorkCarActualMapper.countDayAllState(actualMap);
|
|
|
+ if(carActualTotal.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carActualTotal) {
|
|
|
+ countActualValidTemp += Long.parseLong(modelTemp.get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //作废结净总数
|
|
|
+ HashMap<String, Object> actualVoidMap = new HashMap<>();
|
|
|
+ actualVoidMap.put("startTime", params.get("startTime"));
|
|
|
+ actualVoidMap.put("endTime", params.get("endTime"));
|
|
|
+ actualVoidMap.put("valueFlag", "0");
|
|
|
+ List<HashMap> carActualVoidTotal = meterWorkCarActualMapper.countDayAllState(actualVoidMap);
|
|
|
+ //结净未匹配委托总数
|
|
|
+ HashMap<String, Object> actualNotMatchScaleMap = new HashMap<>();
|
|
|
+ actualNotMatchScaleMap.put("startTime", params.get("startTime"));
|
|
|
+ actualNotMatchScaleMap.put("endTime", params.get("endTime"));
|
|
|
+ actualNotMatchScaleMap.put("isPreScale", "0");
|
|
|
+ List<HashMap> carActualNotMatchTotal = meterWorkCarActualMapper.countDayAllState(actualNotMatchScaleMap);
|
|
|
+ if(carActualNotMatchTotal.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carActualNotMatchTotal) {
|
|
|
+ countActualValidTemp += Long.parseLong(modelTemp.get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //一次计量总数
|
|
|
+ HashMap<String, Object> firstMap = new HashMap<>();
|
|
|
+ firstMap.put("startTime", params.get("startTime"));
|
|
|
+ firstMap.put("endTime", params.get("endTime"));
|
|
|
+ List<HashMap> carFirstTotal = meterWorkCarActualFirstMaper.countDayAllState(firstMap);
|
|
|
+ if(carFirstTotal.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carFirstTotal) {
|
|
|
+ countFirstTemp += Long.parseLong(modelTemp.get("COUNT_FIRST").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //未结净有效一次总数
|
|
|
+ HashMap<String, Object> firstNotNetMap = new HashMap<>();
|
|
|
+ firstNotNetMap.put("startTime", params.get("startTime"));
|
|
|
+ firstNotNetMap.put("endTime", params.get("endTime"));
|
|
|
+ firstNotNetMap.put("valueFlag", "1");
|
|
|
+ List<HashMap> carFirst = meterWorkCarActualFirstMaper.countDayAllState(firstNotNetMap);
|
|
|
+ if(carFirst.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carFirst) {
|
|
|
+ countFirstValidTemp += Long.parseLong(modelTemp.get("COUNT_FIRST").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ HashMap<String, Object> firstResetMap = new HashMap<>();
|
|
|
+ firstResetMap.put("startTime", params.get("startTime"));
|
|
|
+ firstResetMap.put("endTime", params.get("endTime"));
|
|
|
+ List<HashMap> carFirstLog = meterBaseOperationLogMapper.countAllFirstState02(firstResetMap);
|
|
|
+
|
|
|
+ HashMap<String, Object> obj = new HashMap<>();
|
|
|
+ obj.put("startTime", params.get("startTime"));
|
|
|
+ obj.put("endTime", params.get("endTime"));
|
|
|
+ List<WorkLoadReportInfo> models = meterWorkDataCountMapper.groupByDayCarReportInfo(obj);
|
|
|
+ if (spotModelList.size() >= 1) {
|
|
|
+ for (MeterBaseSpotInfo spotModel : spotModelList) {
|
|
|
+ //写入返回值
|
|
|
+ HashMap<String, Object> params02 = new HashMap<>();
|
|
|
+ params02.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ params02.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+ List<HashMap> carMap02List = new ArrayList<>();
|
|
|
+
|
|
|
+ //根据秤点和时间查询操作人编号、操作人名称、计量方式编号、计量方式名称、计量类型
|
|
|
+ List<WorkLoadReportInfo> modelTemp = models.stream()
|
|
|
+ .filter(item -> item.getBaseSpotNo().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getBaseSpotName().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ if (modelTemp.size() >= 1) {
|
|
|
+ //总结净数
|
|
|
+ List<HashMap> carActualTotalTemp01 = carActualTotal.stream().filter(item ->
|
|
|
+ item.get("NET_SPOT3_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("NET_SPOT3_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ //作废结净总数
|
|
|
+ List<HashMap> carActualVoidTotalTemp01 = carActualVoidTotal.stream().filter(item ->
|
|
|
+ item.get("NET_SPOT3_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("NET_SPOT3_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ //一次计量总数
|
|
|
+ List<HashMap> carFirstTotalTemp01 = carFirstTotal.stream().filter(item ->
|
|
|
+ item.get("BASE_SPOT_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("BASE_SPOT_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ //修改车号总数
|
|
|
+ List<HashMap> carFirstLogTemp01 = carFirstLog.stream().filter(item ->
|
|
|
+ item.get("BASE_SPOT_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("BASE_SPOT_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ for (WorkLoadReportInfo model : modelTemp) {
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", model.getMeterMode());
|
|
|
+ carMap.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+ carMap.put("meterTypeName", model.getMeterTypeName());
|
|
|
+ carMap.put("createManNo", model.getCreateManNo());
|
|
|
+ carMap.put("createManName", model.getCreateManName());
|
|
|
+ carMap02List.add(carMap);
|
|
|
+
|
|
|
+ long countActualSum = 0L;
|
|
|
+ long countActualValidSum = 0L;
|
|
|
+ long countFirstSum = 0L;
|
|
|
+// long countFirsValidtSum = 0L;
|
|
|
+ long carFirstLogSum = 0L;
|
|
|
+ if (carActualTotalTemp01 != null && carActualTotalTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carActualTotalTemp02 = carActualTotalTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if(carActualTotalTemp02 != null && carActualTotalTemp02.size() >= 1) {
|
|
|
+ countActualSum = Long.parseLong(carActualTotalTemp02.get(0).get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (carActualVoidTotalTemp01 != null && carActualVoidTotalTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carActualVoidTotalTemp02 = carActualVoidTotalTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if(carActualVoidTotalTemp02 != null && carActualVoidTotalTemp02.size() >= 1) {
|
|
|
+ countActualValidSum = Long.parseLong(carActualVoidTotalTemp02.get(0).get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (carFirstTotalTemp01 != null && carFirstTotalTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carFirstTotalTemp02 = carFirstTotalTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if(carFirstTotalTemp02 != null && carFirstTotalTemp02.size() >= 1) {
|
|
|
+ countFirstSum = Long.parseLong(carFirstTotalTemp02.get(0).get("COUNT_FIRST").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (carFirstLogTemp01 != null && carFirstLogTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carFirstLogTemp02 = carFirstLogTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").toString().equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").toString().equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").toString().equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").toString().equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").toString().equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if (carFirstLogTemp02 != null && carFirstLogTemp02.size() >= 1) {
|
|
|
+ carFirstLogSum = Long.parseLong(carFirstLogTemp02.get(0).get("COUNT_RESETCAR").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ carMap.put("countActualSum", countActualSum);
|
|
|
+ carMap.put("countActualValidSum", countActualValidSum);
|
|
|
+ carMap.put("countFirstSum", countFirstSum);
|
|
|
+ carMap.put("carFirstLogSum", carFirstLogSum);
|
|
|
+
|
|
|
+ countActualTemp += countActualSum;
|
|
|
+ countFirstTemp += countFirstSum;
|
|
|
+ countActualValidTemp += countActualValidSum;
|
|
|
+// countFirstValidTemp += countFirsValidtSum;
|
|
|
+ }
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }else {
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", null);
|
|
|
+ carMap.put("meterTypeNo", null);
|
|
|
+ carMap.put("meterTypeName", null);
|
|
|
+ carMap.put("createManNo", null);
|
|
|
+ carMap.put("createManName", null);
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ carMap.put("countActualSum", 0L);
|
|
|
+ carMap.put("countFirstSum", 0L);
|
|
|
+ carMap.put("carFirstLogSum", 0L);
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }
|
|
|
+ paramsList02.add(params02);
|
|
|
+ }
|
|
|
+ params01.put("countActualTemp", countActualTemp);
|
|
|
+ params01.put("countFirstTemp", countFirstTemp);
|
|
|
+ params01.put("type", "汽车衡");
|
|
|
+ params01.put("countFirst", countFirstValidTemp);
|
|
|
+ params01.put("countActual", countActualValidTemp);
|
|
|
+ params01.put("children", paramsList02);
|
|
|
+ paramsList.add(params01);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ String[][] railwayTypeNoList = new String[][]{{"001019001"},{"001019002"}, {"001019003", "001019004"}, {"001019005"}};
|
|
|
+ for(int i = 0; i <= railwayTypeNoList.length-1; i++) {
|
|
|
+ String[] railwayTypeNo = railwayTypeNoList[i];
|
|
|
+ HashMap params01 = new HashMap();
|
|
|
+ List<HashMap> paramsList02 = new ArrayList<>();
|
|
|
+ countActualTemp = 0L;
|
|
|
+ countFirstTemp = 0L;
|
|
|
+ countActualValidTemp = 0L;
|
|
|
+ countFirstValidTemp = 0L;
|
|
|
+ //静态轨道衡
|
|
|
+// String[] railwayTypeNo = new String[]{"001019001"};
|
|
|
+ HashMap<String, Object> spotModelMap = new HashMap<>();
|
|
|
+ spotModelMap.put("startTime", params.get("startTime"));
|
|
|
+ spotModelMap.put("endTime", params.get("endTime"));
|
|
|
+ spotModelMap.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ List<MeterBaseSpotInfo> spotModelList = meterBaseSpotInfoMapper.staticSpotGroupByActualAndFirst(spotModelMap);
|
|
|
+
|
|
|
+ //总结净数
|
|
|
+ HashMap<String, Object> actualMap = new HashMap<>();
|
|
|
+ actualMap.put("startTime", params.get("startTime"));
|
|
|
+ actualMap.put("endTime", params.get("endTime"));
|
|
|
+ actualMap.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ List<HashMap> carActualTotal = meterWorkRailwayActualMapper.countDayAllState(actualMap);
|
|
|
+ if(carActualTotal.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carActualTotal) {
|
|
|
+ countActualValidTemp += Long.parseLong(modelTemp.get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //作废结净总数
|
|
|
+ HashMap<String, Object> actualVoidMap = new HashMap<>();
|
|
|
+ actualVoidMap.put("startTime", params.get("startTime"));
|
|
|
+ actualVoidMap.put("endTime", params.get("endTime"));
|
|
|
+ actualVoidMap.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ actualVoidMap.put("valueFlag", "0");
|
|
|
+ List<HashMap> carActualVoidTotal = meterWorkRailwayActualMapper.countDayAllState(actualVoidMap);
|
|
|
+ //结净未匹配委托总数
|
|
|
+ HashMap<String, Object> actualNotMatchScaleMap = new HashMap<>();
|
|
|
+ actualNotMatchScaleMap.put("startTime", params.get("startTime"));
|
|
|
+ actualNotMatchScaleMap.put("endTime", params.get("endTime"));
|
|
|
+ actualNotMatchScaleMap.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ actualNotMatchScaleMap.put("isPreScale", "0");
|
|
|
+ List<HashMap> carActualNotMatchTotal = meterWorkRailwayActualMapper.countDayAllState(actualNotMatchScaleMap);
|
|
|
+ if(carActualNotMatchTotal.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carActualNotMatchTotal) {
|
|
|
+ countActualValidTemp += Long.parseLong(modelTemp.get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //一次计量总数
|
|
|
+ HashMap<String, Object> firstMap = new HashMap<>();
|
|
|
+ firstMap.put("startTime", params.get("startTime"));
|
|
|
+ firstMap.put("endTime", params.get("endTime"));
|
|
|
+ firstMap.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ List<HashMap> carFirstTotal = meterWorkRailwayActFirstMapper.countDayAllState(firstMap);
|
|
|
+ if(carFirstTotal.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carFirstTotal) {
|
|
|
+ countFirstTemp += Long.parseLong(modelTemp.get("COUNT_FIRST").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //未结净有效一次总数
|
|
|
+ HashMap<String, Object> firstNotNetMap = new HashMap<>();
|
|
|
+ firstNotNetMap.put("startTime", params.get("startTime"));
|
|
|
+ firstNotNetMap.put("endTime", params.get("endTime"));
|
|
|
+ firstNotNetMap.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ firstNotNetMap.put("valueFlag", "1");
|
|
|
+ List<HashMap> carFirst = meterWorkRailwayActFirstMapper.countDayAllState(firstNotNetMap);
|
|
|
+ if(carFirst.size() >= 1) {
|
|
|
+ for(HashMap modelTemp: carFirst) {
|
|
|
+ countFirstValidTemp += Long.parseLong(modelTemp.get("COUNT_FIRST").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ HashMap<String, Object> firstResetMap = new HashMap<>();
|
|
|
+ firstResetMap.put("startTime", params.get("startTime"));
|
|
|
+ firstResetMap.put("endTime", params.get("endTime"));
|
|
|
+ firstResetMap.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ List<HashMap> carFirstLog = meterBaseOperationLogMapper.countAllFirstState03(firstResetMap);
|
|
|
+
|
|
|
+ HashMap<String, Object> obj = new HashMap<>();
|
|
|
+ obj.put("startTime", params.get("startTime"));
|
|
|
+ obj.put("endTime", params.get("endTime"));
|
|
|
+ obj.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ List<WorkLoadReportInfo> models = meterWorkDataCountMapper.groupByDayStaticReportInfo(obj);
|
|
|
+ if(spotModelList.size() >= 1) {
|
|
|
+ for(MeterBaseSpotInfo spotModel: spotModelList) {
|
|
|
+ //写入返回值
|
|
|
+ HashMap<String, Object> params02 = new HashMap<>();
|
|
|
+ params02.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ params02.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+ List<HashMap> carMap02List = new ArrayList<>();
|
|
|
+ //根据秤点和时间查询操作人编号、操作人名称、计量方式编号、计量方式名称、计量类型
|
|
|
+ List<WorkLoadReportInfo> modelTemp = models.stream()
|
|
|
+ .filter(item -> item.getBaseSpotNo().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getBaseSpotName().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ if(modelTemp.size() >= 1) {
|
|
|
+ //总结净数
|
|
|
+ List<HashMap> carActualTotalTemp01 = carActualTotal.stream().filter(item ->
|
|
|
+ item.get("NET_SPOT3_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("NET_SPOT3_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ //作废结净总数
|
|
|
+ List<HashMap> carActualVoidTotalTemp01 = carActualVoidTotal.stream().filter(item ->
|
|
|
+ item.get("NET_SPOT3_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("NET_SPOT3_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ //一次计量总数
|
|
|
+ List<HashMap> carFirstTotalTemp01 = carFirstTotal.stream().filter(item ->
|
|
|
+ item.get("BASE_SPOT_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("BASE_SPOT_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ //修改车号总数
|
|
|
+ List<HashMap> carFirstLogTemp01 = carFirstLog.stream().filter(item ->
|
|
|
+ item.get("BASE_SPOT_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("BASE_SPOT_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ for(WorkLoadReportInfo model: modelTemp) {
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", model.getMeterMode());
|
|
|
+ carMap.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+ carMap.put("meterTypeName", model.getMeterTypeName());
|
|
|
+ carMap.put("createManNo", model.getCreateManNo());
|
|
|
+ carMap.put("createManName", model.getCreateManName());
|
|
|
+ carMap02List.add(carMap);
|
|
|
+
|
|
|
+ long countActualSum = 0L;
|
|
|
+ long countActualValidSum = 0L;
|
|
|
+ long countFirstSum = 0L;
|
|
|
+// long countFirsValidtSum = 0L;
|
|
|
+ long carFirstLogSum = 0L;
|
|
|
+ if (carActualTotalTemp01 != null && carActualTotalTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carActualTotalTemp02 = carActualTotalTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if(carActualTotalTemp02 != null && carActualTotalTemp02.size() >= 1) {
|
|
|
+ countActualSum = Long.parseLong(carActualTotalTemp02.get(0).get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (carActualVoidTotalTemp01 != null && carActualVoidTotalTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carActualVoidTotalTemp02 = carActualVoidTotalTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if(carActualVoidTotalTemp02 != null && carActualVoidTotalTemp02.size() >= 1) {
|
|
|
+ countActualValidSum = Long.parseLong(carActualVoidTotalTemp02.get(0).get("COUNT_ACTUAL").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (carFirstTotalTemp01 != null && carFirstTotalTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carFirstTotalTemp02 = carFirstTotalTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ || StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if(carFirstTotalTemp02 != null && carFirstTotalTemp02.size() >= 1) {
|
|
|
+ countFirstSum = Long.parseLong(carFirstTotalTemp02.get(0).get("COUNT_FIRST").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (carFirstLogTemp01 != null && carFirstLogTemp01.size() >= 1) {
|
|
|
+ List<HashMap> carFirstLogTemp02 = carFirstLogTemp01.stream().filter(item ->
|
|
|
+ (item.get("METER_MODE") == null || StringUtils.isEmpty(item.get("METER_MODE").toString())
|
|
|
+ || StringUtils.isEmpty(model.getMeterMode()) || item.get("METER_MODE").toString().equals(model.getMeterMode()))
|
|
|
+ && (item.get("METER_TYPE_NO") == null || StringUtils.isEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getMeterTypeNo()) || item.get("METER_TYPE_NO").toString().equals(model.getMeterTypeNo()))
|
|
|
+ && (item.get("METER_TYPE_NAME") == null || StringUtils.isEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getMeterTypeName()) || item.get("METER_TYPE_NAME").toString().equals(model.getMeterTypeName()))
|
|
|
+ && (item.get("CREATE_MAN_NO") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getCreateManNo()) || item.get("CREATE_MAN_NO").toString().equals(model.getCreateManNo()))
|
|
|
+ && (item.get("CREATE_MAN_NAME") == null || StringUtils.isEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ ||StringUtils.isEmpty(model.getCreateManName()) || item.get("CREATE_MAN_NAME").toString().equals(model.getCreateManName()))).collect(Collectors.toList());
|
|
|
+ if (carFirstLogTemp02 != null && carFirstLogTemp02.size() >= 1) {
|
|
|
+ carFirstLogSum = Long.parseLong(carFirstLogTemp02.get(0).get("COUNT_RESETCAR").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ carMap.put("countActualSum", countActualSum);
|
|
|
+ carMap.put("countActualValidSum", countActualValidSum);
|
|
|
+ carMap.put("countFirstSum", countFirstSum);
|
|
|
+ carMap.put("carFirstLogSum", carFirstLogSum);
|
|
|
+
|
|
|
+ countActualTemp += countActualSum;
|
|
|
+ countFirstTemp += countFirstSum;
|
|
|
+ countActualValidTemp += countActualValidSum;
|
|
|
+// countFirstValidTemp += countFirsValidtSum;
|
|
|
+ }
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }else {
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", null);
|
|
|
+ carMap.put("meterTypeNo", null);
|
|
|
+ carMap.put("meterTypeName", null);
|
|
|
+ carMap.put("createManNo", null);
|
|
|
+ carMap.put("createManName", null);
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ carMap.put("countActualSum", 0L);
|
|
|
+ carMap.put("countFirstSum", 0L);
|
|
|
+ carMap.put("carFirstLogSum", 0L);
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }
|
|
|
+ paramsList02.add(params02);
|
|
|
+ }
|
|
|
+ params01.put("countActualTemp", countActualTemp);
|
|
|
+ params01.put("countFirstTemp", countFirstTemp);
|
|
|
+ if(i == 0) {
|
|
|
+ params01.put("type", "静态轨轨道衡");
|
|
|
+ }else if(i == 1){
|
|
|
+ params01.put("type", "动态轨轨道衡");
|
|
|
+ }else if(i == 2){
|
|
|
+ params01.put("type", "铁水衡");
|
|
|
+ }else if(i == 3){
|
|
|
+ params01.put("type", "吊钩秤");
|
|
|
+ }
|
|
|
+ params01.put("countFirst", countFirstValidTemp);
|
|
|
+ params01.put("countActual", countActualValidTemp);
|
|
|
+ params01.put("children", paramsList02);
|
|
|
+ paramsList.add(params01);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ {
|
|
|
+ HashMap params01 = new HashMap();
|
|
|
+ List<HashMap> paramsList02 = new ArrayList<>();
|
|
|
+ countActualTemp = 0L;
|
|
|
+ countFirstTemp = 0L;
|
|
|
+ countActualValidTemp = 0L;
|
|
|
+ countFirstValidTemp = 0L;
|
|
|
+ List<MeterBaseSpotInfo> spotModelList = meterBaseSpotInfoMapper.staticSpotGroupByActualAndFirst(params);
|
|
|
+ if(spotModelList.size() >= 1) {
|
|
|
+ for(MeterBaseSpotInfo spotModel: spotModelList) {
|
|
|
+ HashMap<String, Object> params02 = new HashMap<>();
|
|
|
+ params02.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ params02.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+
|
|
|
+ HashMap<String, Object> obj = new HashMap<>();
|
|
|
+ obj.put("startTime", params.get("startTime"));
|
|
|
+ obj.put("endTime", params.get("endTime"));
|
|
|
+ String[] railwayTypeNo = new String[]{"001019002"};
|
|
|
+ obj.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ obj.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ obj.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+ List<WorkLoadReportInfo> models = meterWorkDataCountMapper.groupByDayStaticReportInfo(obj);
|
|
|
+
|
|
|
+ HashMap<String, Object> objB = new HashMap<>();
|
|
|
+ objB.put("startTime", params.get("startTime"));
|
|
|
+ objB.put("endTime", params.get("endTime"));
|
|
|
+ objB.put("railwayTypeNo", railwayTypeNo);
|
|
|
+// objB.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+// objB.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+// objB.put("meterMode", model.getMeterMode());
|
|
|
+// objB.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+// objB.put("meterTypeName", model.getMeterTypeName());
|
|
|
+// objB.put("createManNo", model.getCreateManNo());
|
|
|
+// objB.put("createManName", model.getCreateManName());
|
|
|
+ List<MeterWorkRailwayActual> carActual = meterWorkRailwayActualMapper.countDayAllState(objB);
|
|
|
+ List<MeterWorkRailwayActFirst> carFirst = meterWorkRailwayActFirstMapper.countDayAllState(objB);
|
|
|
+ List<HashMap> carFirstLog = meterBaseOperationLogMapper.countAllFirstState03(objB);
|
|
|
+ List<HashMap> carMap02List = new ArrayList<>();
|
|
|
+ if(models.size() >= 1) {
|
|
|
+ List<MeterWorkRailwayActual> carActualTemp = carActual.stream().filter(item -> item.getNetSpot3No().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getNetSpot3Name().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ List<MeterWorkRailwayActFirst> carFirstTemp = carFirst.stream().filter(item -> item.getBaseSpotNo().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getBaseSpotName().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ List<HashMap> carFirstLogTemp = carFirstLog.stream().filter(item -> item.get("BASE_SPOT_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("BASE_SPOT_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ for(WorkLoadReportInfo model: models) {
|
|
|
+// objB.put("startTime", params.get("startTime"));
|
|
|
+// objB.put("endTime", params.get("endTime"));
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", model.getMeterMode());
|
|
|
+ carMap.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+ carMap.put("meterTypeName", model.getMeterTypeName());
|
|
|
+ carMap.put("createManNo", model.getCreateManNo());
|
|
|
+ carMap.put("createManName", model.getCreateManName());
|
|
|
+
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ long countActualSum = 0L;
|
|
|
+ long countActualValidSum = 0L;
|
|
|
+ long countFirstSum = 0L;
|
|
|
+ long countFirsValidtSum = 0L;
|
|
|
+ long carFirstLogSum = 0L;
|
|
|
+ boolean T = StringUtils.isNotEmpty(model.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(model.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(model.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(model.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(model.getCreateManName());
|
|
|
+ if(carActual != null && carActual.size() >= 1) {
|
|
|
+ countActualSum = carActualTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getNetMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManName())
|
|
|
+ && item.getNetMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getNetManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getNetManName().equals(model.getCreateManName())).count();
|
|
|
+ countActualValidSum = carActualTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getNetMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManName())
|
|
|
+ && item.getNetMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getNetManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getNetManName().equals(model.getCreateManName())
|
|
|
+ && (item.getIsPreSacale().equals("0") || StringUtils.isEmpty(item.getIsPreSacale()))).count();
|
|
|
+ }
|
|
|
+ if(carFirst != null && carFirst.size() >= 1) {
|
|
|
+ countFirstSum = carFirstTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManName())
|
|
|
+ && item.getMeterMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getCreateManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getCreateManName().equals(model.getCreateManName())).count();
|
|
|
+ //一次毛重
|
|
|
+ countFirsValidtSum = carFirstTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManName())
|
|
|
+ && item.getMeterMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getCreateManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getCreateManName().equals(model.getCreateManName())
|
|
|
+ && item.getValueFlag().equals("1")).count();
|
|
|
+ }
|
|
|
+ if(carFirstLog != null && carFirstLog.size() >= 1) {
|
|
|
+ carFirstLogSum = carFirstLogTemp.stream().filter(item -> T
|
|
|
+ && item.get("METER_MODE") != null
|
|
|
+ && item.get("METER_TYPE_NO") != null
|
|
|
+ && item.get("METER_TYPE_NAME") != null
|
|
|
+ && item.get("CREATE_MAN_NO") != null
|
|
|
+ && item.get("CREATE_MAN_NAMEss") != null
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_MODE").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ && item.get("METER_MODE").toString().equals(model.getMeterMode())
|
|
|
+ && item.get("METER_TYPE_NO").toString().equals(model.getMeterTypeNo())
|
|
|
+ && item.get("METER_TYPE_NAME").toString().equals(model.getMeterTypeName())
|
|
|
+ && item.get("CREATE_MAN_NO").toString().equals(model.getCreateManNo())
|
|
|
+ && item.get("CREATE_MAN_NAME").toString().equals(model.getCreateManName())).count();
|
|
|
+ }
|
|
|
+ carMap.put("countActualSum", countActualSum);
|
|
|
+ carMap.put("countFirstSum", countFirstSum);
|
|
|
+ carMap.put("carFirstLogSum", carFirstLogSum);
|
|
|
+
|
|
|
+ countActualTemp += countActualSum;
|
|
|
+ countFirstTemp += countFirstSum;
|
|
|
+ countActualValidTemp += countActualValidSum;
|
|
|
+ countFirstValidTemp += countFirsValidtSum;
|
|
|
+ }
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }else {
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", null);
|
|
|
+ carMap.put("meterTypeNo", null);
|
|
|
+ carMap.put("meterTypeName", null);
|
|
|
+ carMap.put("createManNo", null);
|
|
|
+ carMap.put("createManName", null);
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ carMap.put("countActualSum", 0L);
|
|
|
+ carMap.put("countFirstSum", 0L);
|
|
|
+ carMap.put("carFirstLogSum", 0L);
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }
|
|
|
+ paramsList02.add(params02);
|
|
|
+ }
|
|
|
+ params01.put("countActualTemp", countActualTemp);
|
|
|
+ params01.put("countFirstTemp", countFirstTemp);
|
|
|
+ params01.put("type", "动态轨道衡");
|
|
|
+ params01.put("countFirst", countFirstValidTemp);
|
|
|
+ params01.put("countActual", countActualValidTemp);
|
|
|
+ params01.put("children", paramsList02);
|
|
|
+ paramsList.add(params01);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ {
|
|
|
+ HashMap params01 = new HashMap();
|
|
|
+ List<HashMap> paramsList02 = new ArrayList<>();
|
|
|
+ countActualTemp = 0L;
|
|
|
+ countFirstTemp = 0L;
|
|
|
+ countActualValidTemp = 0L;
|
|
|
+ countFirstValidTemp = 0L;
|
|
|
+ List<MeterBaseSpotInfo> spotModelList = meterBaseSpotInfoMapper.staticSpotGroupByActualAndFirst(params);
|
|
|
+ if(spotModelList.size() >= 1) {
|
|
|
+ for(MeterBaseSpotInfo spotModel: spotModelList) {
|
|
|
+ HashMap<String, Object> params02 = new HashMap<>();
|
|
|
+ params02.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ params02.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+
|
|
|
+ HashMap<String, Object> obj = new HashMap<>();
|
|
|
+ obj.put("startTime", params.get("startTime"));
|
|
|
+ obj.put("endTime", params.get("endTime"));
|
|
|
+ String[] railwayTypeNo = new String[]{"001019003", "001019004"};
|
|
|
+ obj.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ obj.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ obj.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+ List<WorkLoadReportInfo> models = meterWorkDataCountMapper.groupByDayStaticReportInfo(obj);
|
|
|
+
|
|
|
+ HashMap<String, Object> objB = new HashMap<>();
|
|
|
+ objB.put("startTime", params.get("startTime"));
|
|
|
+ objB.put("endTime", params.get("endTime"));
|
|
|
+ objB.put("railwayTypeNo", railwayTypeNo);
|
|
|
+// objB.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+// objB.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+// objB.put("meterMode", model.getMeterMode());
|
|
|
+// objB.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+// objB.put("meterTypeName", model.getMeterTypeName());
|
|
|
+// objB.put("createManNo", model.getCreateManNo());
|
|
|
+// objB.put("createManName", model.getCreateManName());
|
|
|
+ List<MeterWorkRailwayActual> carActual = meterWorkRailwayActualMapper.countDayAllState(objB);
|
|
|
+ List<MeterWorkRailwayActFirst> carFirst = meterWorkRailwayActFirstMapper.countDayAllState(objB);
|
|
|
+ List<HashMap> carFirstLog = meterBaseOperationLogMapper.countAllFirstState03(objB);
|
|
|
+ List<HashMap> carMap02List = new ArrayList<>();
|
|
|
+ if(models.size() >= 1) {
|
|
|
+ List<MeterWorkRailwayActual> carActualTemp = carActual.stream().filter(item -> item.getNetSpot3No().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getNetSpot3Name().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ List<MeterWorkRailwayActFirst> carFirstTemp = carFirst.stream().filter(item -> item.getBaseSpotNo().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getBaseSpotName().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ List<HashMap> carFirstLogTemp = carFirstLog.stream().filter(item -> item.get("BASE_SPOT_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("BASE_SPOT_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ for(WorkLoadReportInfo model: models) {
|
|
|
+// objB.put("startTime", params.get("startTime"));
|
|
|
+// objB.put("endTime", params.get("endTime"));
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", model.getMeterMode());
|
|
|
+ carMap.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+ carMap.put("meterTypeName", model.getMeterTypeName());
|
|
|
+ carMap.put("createManNo", model.getCreateManNo());
|
|
|
+ carMap.put("createManName", model.getCreateManName());
|
|
|
+
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ long countActualSum = 0L;
|
|
|
+ long countActualValidSum = 0L;
|
|
|
+ long countFirstSum = 0L;
|
|
|
+ long countFirsValidtSum = 0L;
|
|
|
+ long carFirstLogSum = 0L;
|
|
|
+ boolean T = StringUtils.isNotEmpty(model.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(model.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(model.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(model.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(model.getCreateManName());
|
|
|
+ if(carActual != null && carActual.size() >= 1) {
|
|
|
+ countActualSum = carActualTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getNetMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManName())
|
|
|
+ && item.getNetMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getNetManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getNetManName().equals(model.getCreateManName())).count();
|
|
|
+ countActualValidSum = carActualTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getNetMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManName())
|
|
|
+ && item.getNetMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getNetManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getNetManName().equals(model.getCreateManName())
|
|
|
+ && (item.getIsPreSacale().equals("0") || StringUtils.isEmpty(item.getIsPreSacale()))).count();
|
|
|
+ }
|
|
|
+ if(carFirst != null && carFirst.size() >= 1) {
|
|
|
+ countFirstSum = carFirstTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManName())
|
|
|
+ && item.getMeterMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getCreateManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getCreateManName().equals(model.getCreateManName())).count();
|
|
|
+ //一次毛重
|
|
|
+ countFirsValidtSum = carFirstTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManName())
|
|
|
+ && item.getMeterMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getCreateManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getCreateManName().equals(model.getCreateManName())
|
|
|
+ && item.getValueFlag().equals("1")).count();
|
|
|
+ }
|
|
|
+ if(carFirstLog != null && carFirstLog.size() >= 1) {
|
|
|
+ carFirstLogSum = carFirstLogTemp.stream().filter(item -> T
|
|
|
+ && item.get("METER_MODE") != null
|
|
|
+ && item.get("METER_TYPE_NO") != null
|
|
|
+ && item.get("METER_TYPE_NAME") != null
|
|
|
+ && item.get("CREATE_MAN_NO") != null
|
|
|
+ && item.get("CREATE_MAN_NAMEss") != null
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_MODE").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ && item.get("METER_MODE").toString().equals(model.getMeterMode())
|
|
|
+ && item.get("METER_TYPE_NO").toString().equals(model.getMeterTypeNo())
|
|
|
+ && item.get("METER_TYPE_NAME").toString().equals(model.getMeterTypeName())
|
|
|
+ && item.get("CREATE_MAN_NO").toString().equals(model.getCreateManNo())
|
|
|
+ && item.get("CREATE_MAN_NAME").toString().equals(model.getCreateManName())).count();
|
|
|
+ }
|
|
|
+ carMap.put("countActualSum", countActualSum);
|
|
|
+ carMap.put("countFirstSum", countFirstSum);
|
|
|
+ carMap.put("carFirstLogSum", carFirstLogSum);
|
|
|
+
|
|
|
+ countActualTemp += countActualSum;
|
|
|
+ countFirstTemp += countFirstSum;
|
|
|
+ countActualValidTemp += countActualValidSum;
|
|
|
+ countFirstValidTemp += countFirsValidtSum;
|
|
|
+ }
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }else {
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", null);
|
|
|
+ carMap.put("meterTypeNo", null);
|
|
|
+ carMap.put("meterTypeName", null);
|
|
|
+ carMap.put("createManNo", null);
|
|
|
+ carMap.put("createManName", null);
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ carMap.put("countActualSum", 0L);
|
|
|
+ carMap.put("countFirstSum", 0L);
|
|
|
+ carMap.put("carFirstLogSum", 0L);
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }
|
|
|
+ paramsList02.add(params02);
|
|
|
+ }
|
|
|
+ params01.put("countActualTemp", countActualTemp);
|
|
|
+ params01.put("countFirstTemp", countFirstTemp);
|
|
|
+ params01.put("type", "铁水衡");
|
|
|
+ params01.put("countFirst", countFirstValidTemp);
|
|
|
+ params01.put("countActual", countActualValidTemp);
|
|
|
+ params01.put("children", paramsList02);
|
|
|
+ paramsList.add(params01);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ {
|
|
|
+ HashMap params01 = new HashMap();
|
|
|
+ List<HashMap> paramsList02 = new ArrayList<>();
|
|
|
+ countActualTemp = 0L;
|
|
|
+ countFirstTemp = 0L;
|
|
|
+ countActualValidTemp = 0L;
|
|
|
+ countFirstValidTemp = 0L;
|
|
|
+ List<MeterBaseSpotInfo> spotModelList = meterBaseSpotInfoMapper.staticSpotGroupByActualAndFirst(params);
|
|
|
+ if(spotModelList.size() >= 1) {
|
|
|
+ for(MeterBaseSpotInfo spotModel: spotModelList) {
|
|
|
+ HashMap<String, Object> params02 = new HashMap<>();
|
|
|
+ params02.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ params02.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+
|
|
|
+ HashMap<String, Object> obj = new HashMap<>();
|
|
|
+ obj.put("startTime", params.get("startTime"));
|
|
|
+ obj.put("endTime", params.get("endTime"));
|
|
|
+ String[] railwayTypeNo = new String[]{"001019005"};
|
|
|
+ obj.put("railwayTypeNo", railwayTypeNo);
|
|
|
+ obj.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+ obj.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+ List<WorkLoadReportInfo> models = meterWorkDataCountMapper.groupByDayStaticReportInfo(obj);
|
|
|
+
|
|
|
+ HashMap<String, Object> objB = new HashMap<>();
|
|
|
+ objB.put("startTime", params.get("startTime"));
|
|
|
+ objB.put("endTime", params.get("endTime"));
|
|
|
+ objB.put("railwayTypeNo", railwayTypeNo);
|
|
|
+// objB.put("baseSpotNo", spotModel.getBaseSpotNo());
|
|
|
+// objB.put("baseSpotName", spotModel.getBaseSpotName());
|
|
|
+// objB.put("meterMode", model.getMeterMode());
|
|
|
+// objB.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+// objB.put("meterTypeName", model.getMeterTypeName());
|
|
|
+// objB.put("createManNo", model.getCreateManNo());
|
|
|
+// objB.put("createManName", model.getCreateManName());
|
|
|
+ List<MeterWorkRailwayActual> carActual = meterWorkRailwayActualMapper.countDayAllState(objB);
|
|
|
+ List<MeterWorkRailwayActFirst> carFirst = meterWorkRailwayActFirstMapper.countDayAllState(objB);
|
|
|
+ List<HashMap> carFirstLog = meterBaseOperationLogMapper.countAllFirstState03(objB);
|
|
|
+ List<HashMap> carMap02List = new ArrayList<>();
|
|
|
+ if(models.size() >= 1) {
|
|
|
+ List<MeterWorkRailwayActual> carActualTemp = carActual.stream().filter(item -> item.getNetSpot3No().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getNetSpot3Name().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ List<MeterWorkRailwayActFirst> carFirstTemp = carFirst.stream().filter(item -> item.getBaseSpotNo().equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.getBaseSpotName().equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ List<HashMap> carFirstLogTemp = carFirstLog.stream().filter(item -> item.get("BASE_SPOT_NO").equals(spotModel.getBaseSpotNo())
|
|
|
+ && item.get("BASE_SPOT_NAME").equals(spotModel.getBaseSpotName())).collect(Collectors.toList());
|
|
|
+ for(WorkLoadReportInfo model: models) {
|
|
|
+// objB.put("startTime", params.get("startTime"));
|
|
|
+// objB.put("endTime", params.get("endTime"));
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", model.getMeterMode());
|
|
|
+ carMap.put("meterTypeNo", model.getMeterTypeNo());
|
|
|
+ carMap.put("meterTypeName", model.getMeterTypeName());
|
|
|
+ carMap.put("createManNo", model.getCreateManNo());
|
|
|
+ carMap.put("createManName", model.getCreateManName());
|
|
|
+
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ long countActualSum = 0L;
|
|
|
+ long countActualValidSum = 0L;
|
|
|
+ long countFirstSum = 0L;
|
|
|
+ long countFirsValidtSum = 0L;
|
|
|
+ long carFirstLogSum = 0L;
|
|
|
+ boolean T = StringUtils.isNotEmpty(model.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(model.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(model.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(model.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(model.getCreateManName());
|
|
|
+ if(carActual != null && carActual.size() >= 1) {
|
|
|
+ countActualSum = carActualTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getNetMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManName())
|
|
|
+ && item.getNetMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getNetManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getNetManName().equals(model.getCreateManName())).count();
|
|
|
+ countActualValidSum = carActualTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getNetMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getNetManName())
|
|
|
+ && item.getNetMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getNetManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getNetManName().equals(model.getCreateManName())
|
|
|
+ && (item.getIsPreSacale().equals("0") || StringUtils.isEmpty(item.getIsPreSacale()))).count();
|
|
|
+ }
|
|
|
+ if(carFirst != null && carFirst.size() >= 1) {
|
|
|
+ countFirstSum = carFirstTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManName())
|
|
|
+ && item.getMeterMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getCreateManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getCreateManName().equals(model.getCreateManName())).count();
|
|
|
+ //一次毛重
|
|
|
+ countFirsValidtSum = carFirstTemp.stream().filter(item -> T
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterMode())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getMeterTypeName())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManNo())
|
|
|
+ && StringUtils.isNotEmpty(item.getCreateManName())
|
|
|
+ && item.getMeterMode().equals(model.getMeterMode())
|
|
|
+ && item.getMeterTypeNo().equals(model.getMeterTypeNo())
|
|
|
+ && item.getMeterTypeName().equals(model.getMeterTypeName())
|
|
|
+ && item.getCreateManNo().equals(model.getCreateManNo())
|
|
|
+ && item.getCreateManName().equals(model.getCreateManName())
|
|
|
+ && item.getValueFlag().equals("1")).count();
|
|
|
+ }
|
|
|
+ if(carFirstLog != null && carFirstLog.size() >= 1) {
|
|
|
+ carFirstLogSum = carFirstLogTemp.stream().filter(item -> T
|
|
|
+ && item.get("METER_MODE") != null
|
|
|
+ && item.get("METER_TYPE_NO") != null
|
|
|
+ && item.get("METER_TYPE_NAME") != null
|
|
|
+ && item.get("CREATE_MAN_NO") != null
|
|
|
+ && item.get("CREATE_MAN_NAMEss") != null
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_MODE").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_TYPE_NO").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("METER_TYPE_NAME").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("CREATE_MAN_NO").toString())
|
|
|
+ && StringUtils.isNotEmpty(item.get("CREATE_MAN_NAME").toString())
|
|
|
+ && item.get("METER_MODE").toString().equals(model.getMeterMode())
|
|
|
+ && item.get("METER_TYPE_NO").toString().equals(model.getMeterTypeNo())
|
|
|
+ && item.get("METER_TYPE_NAME").toString().equals(model.getMeterTypeName())
|
|
|
+ && item.get("CREATE_MAN_NO").toString().equals(model.getCreateManNo())
|
|
|
+ && item.get("CREATE_MAN_NAME").toString().equals(model.getCreateManName())).count();
|
|
|
+ }
|
|
|
+ carMap.put("countActualSum", countActualSum);
|
|
|
+ carMap.put("countFirstSum", countFirstSum);
|
|
|
+ carMap.put("carFirstLogSum", carFirstLogSum);
|
|
|
+
|
|
|
+ countActualTemp += countActualSum;
|
|
|
+ countFirstTemp += countFirstSum;
|
|
|
+ countActualValidTemp += countActualValidSum;
|
|
|
+ countFirstValidTemp += countFirsValidtSum;
|
|
|
+ }
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }else {
|
|
|
+ HashMap<String, Object> carMap = new HashMap<>();
|
|
|
+ carMap.put("meterMode", null);
|
|
|
+ carMap.put("meterTypeNo", null);
|
|
|
+ carMap.put("meterTypeName", null);
|
|
|
+ carMap.put("createManNo", null);
|
|
|
+ carMap.put("createManName", null);
|
|
|
+ carMap02List.add(carMap);
|
|
|
+ carMap.put("countActualSum", 0L);
|
|
|
+ carMap.put("countFirstSum", 0L);
|
|
|
+ carMap.put("carFirstLogSum", 0L);
|
|
|
+ params02.put("childrenBase", carMap02List);
|
|
|
+ }
|
|
|
+ paramsList02.add(params02);
|
|
|
+ }
|
|
|
+ params01.put("countActualTemp", countActualTemp);
|
|
|
+ params01.put("countFirstTemp", countFirstTemp);
|
|
|
+ params01.put("type", "吊钩秤");
|
|
|
+ params01.put("countFirst", countFirstValidTemp);
|
|
|
+ params01.put("countActual", countActualValidTemp);
|
|
|
+ params01.put("children", paramsList02);
|
|
|
+ paramsList.add(params01);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+ return paramsList;
|
|
|
+ }
|
|
|
}
|