diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index 08c858e..662feba 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -20,6 +20,7 @@ import com.hnac.hzims.safeproduct.service.IRehearsalPlanService; import com.hnac.hzims.safeproduct.service.IRehearsalRecordService; import com.hnac.hzims.safeproduct.vo.RehearsalMonthVO; import com.hnac.hzims.safeproduct.vo.RehearsalYearVO; +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; /** @@ -119,7 +117,7 @@ public class RehearsalPlanServiceImpl extends ServiceImpl unitMonthDataList = baseMapper.selectFinishedDataByUnit(unitList, year); // 将各单位每个月的演练数据写入统计列表 - List res = new ArrayList<>(); + HashedMap map = new HashedMap<>(); unitMonthDataList.forEach(data -> { RehearsalYearVO rehearsalYearVO = records.stream().filter(x -> x.getUnit().equals(data.getUnit())) .collect(Collectors.toList()).get(0); @@ -175,9 +173,11 @@ public class RehearsalPlanServiceImpl extends ServiceImpl list = new ArrayList<>(map.values()); + List res = list.stream().sorted(Comparator.comparing(RehearsalYearVO::getUnit)).collect(Collectors.toList()); unitPage.setRecords(res); return unitPage; } @@ -299,18 +299,18 @@ public class RehearsalPlanServiceImpl extends ServiceImpl wrapper.eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.UNFINISHED.getValue()) .or() .eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.WAITING.getValue()));