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; }