From e6a8ba2802f844e92926aff340ca2b1e46f1ebd3 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期三, 13 十二月 2023 14:49:58 +0800
Subject: [PATCH] 炉类报告上传
---
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java
index b2adeef..95e1d70 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java
@@ -1,9 +1,7 @@
package org.jeecg.modules.mdc.service.impl;
-import com.alipay.api.domain.NewsfeedMediaGiftInfo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.StringUtils;
-import org.checkerframework.checker.units.qual.A;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.mdc.dto.*;
@@ -11,8 +9,8 @@
import org.jeecg.modules.mdc.mapper.MdcEfficiencyReportMapper;
import org.jeecg.modules.mdc.service.*;
import org.jeecg.modules.mdc.util.DateUtils;
-import org.jeecg.modules.mdc.vo.*;
import org.jeecg.modules.mdc.vo.MdcUtilizationRateDto;
+import org.jeecg.modules.mdc.vo.*;
import org.jeecg.modules.system.entity.MdcProduction;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.IMdcProductionService;
@@ -21,8 +19,7 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
+import java.text.Collator;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
@@ -110,7 +107,7 @@
// 閮ㄩ棬灞傜骇
List<MdcEquDepDto> equipmentList = mdcEquipmentService.findEquDepList(vo.getEquipmentIdList());
// 鏌ヨ鎵�鏈夐儴闂ㄤ俊鎭�
- List<SysDepart> departList = sysDepartService.list(new LambdaQueryWrapper<SysDepart>().ne(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_1.toString()));
+ List<SysDepart> departList = sysDepartService.list(new LambdaQueryWrapper<SysDepart>().ne(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_1.toString()).orderByAsc(SysDepart::getDepartName));
for (MdcEquDepDto mdcEquDepDto : equipmentList) {
MdcEfficiencyListDto mdcEfficiencyListDto = new MdcEfficiencyListDto();
@@ -230,7 +227,7 @@
listDtos.add(mdcEfficiencyListDto);
}
}
-
+ listDtos.sort(((o1, o2) -> Collator.getInstance(Locale.TRADITIONAL_CHINESE).compare(o1.getLevel3(), o2.getLevel3())));
result.setMdcEfficiencyList(listDtos);
}
@@ -290,7 +287,7 @@
// 閮ㄩ棬灞傜骇
List<MdcEquDepDto> equipmentList = mdcEquipmentService.findEquDepList(vo.getEquipmentIdList());
// 鏌ヨ鎵�鏈夐儴闂ㄤ俊鎭�
- List<SysDepart> departList = sysDepartService.list(new LambdaQueryWrapper<SysDepart>().ne(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_1.toString()));
+ List<SysDepart> departList = sysDepartService.list(new LambdaQueryWrapper<SysDepart>().ne(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_1.toString()).orderByAsc(SysDepart::getDepartName));
for (MdcEquDepDto mdcEquDepDto : equipmentList) {
MdcEfficiencyListDto mdcEfficiencyListDto = new MdcEfficiencyListDto();
@@ -410,7 +407,7 @@
listDtos.add(mdcEfficiencyListDto);
}
}
-
+ listDtos.sort(((o1, o2) -> Collator.getInstance(Locale.TRADITIONAL_CHINESE).compare(o1.getLevel3(), o2.getLevel3())));
result.setMdcEfficiencyList(listDtos);
}
@@ -470,7 +467,7 @@
// 閮ㄩ棬灞傜骇
List<MdcEquDepDto> equipmentList = mdcEquipmentService.findEquDepList(vo.getEquipmentIdList());
// 鏌ヨ鎵�鏈夐儴闂ㄤ俊鎭�
- List<SysDepart> departList = sysDepartService.list(new LambdaQueryWrapper<SysDepart>().ne(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_1.toString()));
+ List<SysDepart> departList = sysDepartService.list(new LambdaQueryWrapper<SysDepart>().ne(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_1.toString()).orderByAsc(SysDepart::getDepartName));
// 鐝鍚嶇О鏄剧ず澶勭悊
String shiftSubName = "";
if (StringUtils.isBlank(vo.getShiftId())) {
@@ -633,6 +630,7 @@
listDtos.add(mdcEfficiencyShiftListDto);
}
}
+ listDtos.sort(((o1, o2) -> Collator.getInstance(Locale.TRADITIONAL_CHINESE).compare(o1.getLevel3(), o2.getLevel3())));
result.setMdcEfficiencyList(listDtos);
}
return result;
@@ -769,10 +767,10 @@
}
result = this.efficiencyStatisticalRate(efficiencyList);
if (result.getOpenRate().compareTo(new BigDecimal("0")) > 0) {
- result.setOpenRate(result.getOpenRate().multiply(new BigDecimal("100")).divide(new BigDecimal(equipmentIds.size()), 2, BigDecimal.ROUND_HALF_UP));
+ result.setOpenRate(result.getOpenRate().multiply(new BigDecimal("100")).divide(new BigDecimal(vo.getEquipmentIdList().size()), 2, BigDecimal.ROUND_HALF_UP));
}
if (result.getUtilizationRate().compareTo(new BigDecimal("0")) > 0) {
- result.setUtilizationRate(result.getUtilizationRate().multiply(new BigDecimal(100)).divide(new BigDecimal(equipmentIds.size()), 2, BigDecimal.ROUND_HALF_UP));
+ result.setUtilizationRate(result.getUtilizationRate().multiply(new BigDecimal(100)).divide(new BigDecimal(vo.getEquipmentIdList().size()), 2, BigDecimal.ROUND_HALF_UP));
}
if (result.getOpenLong().compareTo(new BigDecimal(0)) > 0 && result.getProcessLong().compareTo(new BigDecimal(0)) > 0) {
result.setUsedOpenRate(result.getProcessLong().divide(result.getOpenLong(), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)));
@@ -1246,6 +1244,9 @@
dto.setColor(mdcUtilizationRate.getRateParameterColor());
}
}
+ if (StringUtils.isBlank(dto.getColor())) {
+ dto.setColor(mdcUtilizationRateList.get(mdcUtilizationRateList.size() - 1).getRateParameterColor());
+ }
return dto;
}
--
Gitblit v1.9.3