From dbd5fb04ddc94084a9882406a732e1a6aaee0753 Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 13 Aug 2024 09:08:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9F=B9=E8=AE=AD=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=AB=99=E7=82=B9=E9=87=8D=E5=A4=8D=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/service/impl/TrainPlanServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 40fb225..9987b46 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -20,6 +20,7 @@ import com.hnac.hzims.safeproduct.service.ITrainPlanService; import com.hnac.hzims.safeproduct.service.ITrainRecordService; import com.hnac.hzims.safeproduct.vo.TrainMonthVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; +import org.apache.commons.collections4.map.HashedMap; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.utils.DateUtil; @@ -34,10 +35,7 @@ import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; /** @@ -105,7 +103,7 @@ public class TrainPlanServiceImpl extends ServiceImpl unitMonthDataList = baseMapper.selectFinishedDataByUnit(unitList, year); // 将各单位每个月的培训计划数据写入统计列表 - List res = new ArrayList<>(); + HashedMap map = new HashedMap<>(); unitMonthDataList.forEach(data -> { TrainYearVO trainYearVO = records.stream().filter(x -> x.getUnit().equals(data.getUnit())) .collect(Collectors.toList()).get(0); @@ -161,9 +159,11 @@ public class TrainPlanServiceImpl extends ServiceImpl list = new ArrayList<>(map.values()); + List res = list.stream().sorted(Comparator.comparing(TrainYearVO::getUnit)).collect(Collectors.toList()); unitPage.setRecords(res); return unitPage; }