|
|
|
@ -70,20 +70,23 @@ public class LawEnforcementWarningListServiceImpl implements ILawEnforcementWarn |
|
|
|
|
|
|
|
List<LawEnforcementWarningList> finalList = list; |
|
|
|
collect.forEach((id, values) -> { |
|
|
|
LawEnforcementWarningList warningList = new LawEnforcementWarningList(); |
|
|
|
BeanUtils.copyProperties(values.get(0), warningList); |
|
|
|
|
|
|
|
//此时取每个公司每个月级别最高的一条预警累加 循环得到全部预警条数
|
|
|
|
Collection<LawEnforcementWarningList> values1 = values.stream().collect( |
|
|
|
Collectors.toMap(LawEnforcementWarningList::getWarningTime, |
|
|
|
Function.identity(), (t1, t2) -> t1.getEnforcementNumber() > t2.getEnforcementNumber() ? t1 : t2) |
|
|
|
).values(); |
|
|
|
|
|
|
|
warningList.setEnforcementNumber(values1.stream() |
|
|
|
.map(LawEnforcementWarningList::getEnforcementNumber).reduce(Integer::sum).get()); |
|
|
|
warningList.setWarningCause("对该企业已检查" + warningList.getEnforcementNumber() + "次"); |
|
|
|
finalList.add(warningList); |
|
|
|
for (LawEnforcementWarningList enforcementWarningList : values1) { |
|
|
|
LawEnforcementWarningList warningList = new LawEnforcementWarningList(); |
|
|
|
BeanUtils.copyProperties(enforcementWarningList, warningList); |
|
|
|
finalList.add(warningList); |
|
|
|
} |
|
|
|
// warningList.setEnforcementNumber(values1.stream()
|
|
|
|
// .map(LawEnforcementWarningList::getEnforcementNumber).reduce(Integer::sum).get());
|
|
|
|
// warningList.setWarningCause("对该企业已检查" + warningList.getEnforcementNumber() + "次");
|
|
|
|
}); |
|
|
|
list = finalList.stream().sorted(Comparator.comparing(LawEnforcementWarningList::getCreateTime) |
|
|
|
.reversed()).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
@ -117,6 +120,10 @@ public class LawEnforcementWarningListServiceImpl implements ILawEnforcementWarn |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<LawEnforcementWarningList> selectLawEnforcementWarningByEnterpriseNumberNew(LawEnforcementWarningList lawEnforcementWarningList) { |
|
|
|
if (Objects.nonNull(lawEnforcementWarningList.getSearchDate())) { |
|
|
|
lawEnforcementWarningList.setSearchDate(DateUtils.parseDateToStr("yyyy-MM", |
|
|
|
DateUtils.parseDate(lawEnforcementWarningList.getSearchDate()))); |
|
|
|
} |
|
|
|
List<LawEnforcementWarningList> list = |
|
|
|
lawEnforcementWarningListMapper.selectLawEnforcementWarningListList3(lawEnforcementWarningList); |
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
|