|
@@ -80,23 +80,27 @@ public class FrontServiceImpl implements IFrontService {
|
|
|
String begin = formatterDate.format(nowTime.plusDays(-7));
|
|
|
String end = formatterDate.format(nowTime.plusDays(-1));
|
|
|
HashMap<String, BigDecimal> lastWeek = this.xinyiDailyMapper.selectAvgWater(begin, end);
|
|
|
- BigDecimal lastJSL = lastWeek.get("JSL");
|
|
|
- BigDecimal lastCSL = lastWeek.get("CSL");
|
|
|
- //获取上上周的统计进出水品均值
|
|
|
- begin = formatterDate.format(nowTime.plusDays(-14));
|
|
|
- end = formatterDate.format(nowTime.plusDays(-8));
|
|
|
- HashMap<String, BigDecimal> beforeLastWeek = this.xinyiDailyMapper.selectAvgWater(begin, end);
|
|
|
- BigDecimal beforeLastJSL = beforeLastWeek.get("JSL");
|
|
|
- BigDecimal beforeLastCSL = beforeLastWeek.get("CSL");
|
|
|
- if(!Objects.isNull(lastJSL)){
|
|
|
- xinyiIndustrySimple.setSzZJSAvg(lastJSL);
|
|
|
- if(!Objects.isNull(beforeLastJSL))
|
|
|
- xinyiIndustrySimple.setSzZJSHb((lastJSL.subtract(beforeLastJSL)).divide(beforeLastJSL, 4, RoundingMode.HALF_UP));
|
|
|
- }
|
|
|
- if(!Objects.isNull(lastCSL)){
|
|
|
- xinyiIndustrySimple.setSzZCSAvg(lastCSL);
|
|
|
- if(!Objects.isNull(beforeLastCSL))
|
|
|
- xinyiIndustrySimple.setSzZCSHb((lastCSL.subtract(beforeLastCSL)).divide(beforeLastCSL, 4, RoundingMode.HALF_UP));
|
|
|
+ if(!Objects.isNull(lastWeek)){
|
|
|
+ BigDecimal lastJSL = lastWeek.get("JSL");
|
|
|
+ BigDecimal lastCSL = lastWeek.get("CSL");
|
|
|
+ //获取上上周的统计进出水品均值
|
|
|
+ begin = formatterDate.format(nowTime.plusDays(-14));
|
|
|
+ end = formatterDate.format(nowTime.plusDays(-8));
|
|
|
+ HashMap<String, BigDecimal> beforeLastWeek = this.xinyiDailyMapper.selectAvgWater(begin, end);
|
|
|
+ if(!Objects.isNull(beforeLastWeek)){
|
|
|
+ BigDecimal beforeLastJSL = beforeLastWeek.get("JSL");
|
|
|
+ BigDecimal beforeLastCSL = beforeLastWeek.get("CSL");
|
|
|
+ if(!Objects.isNull(lastJSL)){
|
|
|
+ xinyiIndustrySimple.setSzZJSAvg(lastJSL);
|
|
|
+ if(!Objects.isNull(beforeLastJSL))
|
|
|
+ xinyiIndustrySimple.setSzZJSHb((lastJSL.subtract(beforeLastJSL)).divide(beforeLastJSL, 4, RoundingMode.HALF_UP));
|
|
|
+ }
|
|
|
+ if(!Objects.isNull(lastCSL)){
|
|
|
+ xinyiIndustrySimple.setSzZCSAvg(lastCSL);
|
|
|
+ if(!Objects.isNull(beforeLastCSL))
|
|
|
+ xinyiIndustrySimple.setSzZCSHb((lastCSL.subtract(beforeLastCSL)).divide(beforeLastCSL, 4, RoundingMode.HALF_UP));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|