|
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.tofly.nb.sew.model.po.SsBbMonth;
|
|
|
import com.tofly.nb.sew.mapper.SsBbMonthMapper;
|
|
|
import com.tofly.nb.sew.model.po.SsYywsclc;
|
|
|
-import com.tofly.nb.sew.model.po.SsYywsclcCczb;
|
|
|
import com.tofly.nb.sew.model.vo.*;
|
|
|
import com.tofly.nb.sew.service.ISsBbMonthService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -36,8 +35,8 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
|
|
|
@Override
|
|
|
public List<SsBbMonth> getYearDetail() {
|
|
|
-
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
+
|
|
|
+ LocalDateTime now = LocalDateTime.now().minusMonths(1);
|
|
|
LocalDateTime fixValue = now.minusMonths(12);
|
|
|
|
|
|
String lostDate = DateTimeUtil.getLocalDateTime(now, DateTimeUtil.MONTHS_YEARS_FORMAT);
|
|
@@ -45,8 +44,8 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
QueryWrapper<SsBbMonth> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("SHBZ", "1");
|
|
|
queryWrapper.eq("JHZT", "1");
|
|
|
- queryWrapper.lt("UMONTH", lostDate);
|
|
|
- queryWrapper.gt("UMONTH", beginDate);
|
|
|
+ queryWrapper.le("UMONTH", lostDate);
|
|
|
+ queryWrapper.ge("UMONTH", beginDate);
|
|
|
return monthMapper.selectList(queryWrapper);
|
|
|
}
|
|
|
|
|
@@ -128,7 +127,7 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
BigDecimal totalSewageTreatment = monthGroupMap.values().stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
|
|
|
- BigDecimal totalAccountedRate = bigDecimal.divide(totalSewageTreatment, 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ BigDecimal totalAccountedRate = bigDecimal.divide(totalSewageTreatment, 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
productionStatisticsVo.setTotalSewLastMonth(bigDecimal);
|
|
|
productionStatisticsVo.setTotalSewageTreatment(totalSewageTreatment);
|
|
@@ -161,7 +160,7 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
}
|
|
|
|
|
|
|
|
|
- return decimal.multiply(BigDecimal.valueOf(100)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
|
+ return decimal.multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -196,7 +195,7 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
informationVo.setDealWaterSupply(dealWaterSupply.get());
|
|
|
informationVo.setTotalDissipatedPower(totalDissipatedPower.get());
|
|
|
|
|
|
- informationVo.setDbl(BigDecimal.valueOf(standard.get()).divide(BigDecimal.valueOf(normal.get()), 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
+ informationVo.setDbl(BigDecimal.valueOf(standard.get()).divide(BigDecimal.valueOf(normal.get()), 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
|
|
|
return informationVo;
|
|
|
}
|
|
@@ -205,19 +204,26 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
@Override
|
|
|
public List<SludgeJuneInfoVo> juneSludgeInfo(List<SsBbMonth> list) {
|
|
|
Map<String, BigDecimal> map = new HashMap<>(12);
|
|
|
+ Map<String, BigDecimal> dehydrationMap = new HashMap<>(12);
|
|
|
int now = Integer.parseInt(Objects.requireNonNull(DateTimeUtil.getLocalDateTime(LocalDateTime.now(), DateTimeUtil.MONTHS_YEARS_FORMAT)));
|
|
|
int begin = Integer.parseInt(Objects.requireNonNull(DateTimeUtil.getLocalDateTime(LocalDateTime.now().minusMonths(6), DateTimeUtil.MONTHS_YEARS_FORMAT)));
|
|
|
|
|
|
-
|
|
|
+
|
|
|
list.stream().filter(dto -> begin <= Integer.parseInt(dto.getUmonth()) && Integer.parseInt(dto.getUmonth()) <= now).
|
|
|
forEach(dto -> {
|
|
|
String umonth = dto.getUmonth();
|
|
|
BigDecimal ywnczl = dto.getYclsl() == null ? BigDecimal.ZERO : BigDecimal.valueOf(dto.getYwnczl());
|
|
|
+ BigDecimal ytswncl = dto.getYtswncl() == null ? BigDecimal.ZERO : BigDecimal.valueOf(dto.getYtswncl());
|
|
|
+
|
|
|
if (map.containsKey(umonth)) {
|
|
|
BigDecimal decimal = map.get(umonth);
|
|
|
+ BigDecimal bigDecimal = dehydrationMap.get(umonth);
|
|
|
decimal = decimal.add(ywnczl);
|
|
|
+ bigDecimal = bigDecimal.add(ytswncl);
|
|
|
map.put(umonth, decimal);
|
|
|
+ dehydrationMap.put(umonth, bigDecimal);
|
|
|
} else {
|
|
|
+ dehydrationMap.put(umonth, ytswncl);
|
|
|
map.put(umonth, ywnczl);
|
|
|
}
|
|
|
});
|
|
@@ -226,9 +232,10 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
SludgeJuneInfoVo vo = new SludgeJuneInfoVo();
|
|
|
vo.setUmonth(k);
|
|
|
vo.setYwnczl(map.get(k));
|
|
|
+ vo.setYtswncl(dehydrationMap.get(k));
|
|
|
result.add(vo);
|
|
|
});
|
|
|
- return result.stream().sorted(Comparator.comparing(SludgeJuneInfoVo::getUmonth).reversed()).collect(Collectors.toList());
|
|
|
+ return result.stream().sorted(Comparator.comparing(SludgeJuneInfoVo::getUmonth)).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -258,12 +265,12 @@ public class SsBbMonthServiceImpl extends ServiceImpl<SsBbMonthMapper, SsBbMonth
|
|
|
Integer dbpfts = saveDbpfts.get(k);
|
|
|
Integer zcyxts = saveZcyxts.get(k);
|
|
|
vo.setUmonth(k);
|
|
|
- vo.setDbl(BigDecimal.valueOf(dbpfts).divide(BigDecimal.valueOf(zcyxts), 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
+ vo.setDbl(BigDecimal.valueOf(dbpfts).divide(BigDecimal.valueOf(zcyxts), 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
waterQualityJuneInfoVoList.add(vo);
|
|
|
});
|
|
|
|
|
|
|
|
|
- return waterQualityJuneInfoVoList.stream().sorted(Comparator.comparing(WaterQualityJuneInfoVo::getUmonth).reversed()).collect(Collectors.toList());
|
|
|
+ return waterQualityJuneInfoVoList.stream().sorted(Comparator.comparing(WaterQualityJuneInfoVo::getUmonth)).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
|