瀏覽代碼

光伏表底值计算修改

wangchangsheng 3 年之前
父節點
當前提交
74b75e2b74
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      src/main/java/cn/gyee/tamplate/service/analysis/AnalysisNewService.java

+ 12 - 2
src/main/java/cn/gyee/tamplate/service/analysis/AnalysisNewService.java

@@ -216,7 +216,12 @@ public class AnalysisNewService {
                     analysissubtablebottom.setRecorddate(DateUtils.parseDate(day));
                     analysissubtablebottom.setStopcode(m.getNow());
                     analysissubtablebottom.setStopcodemodify(m.getNow());
-                    double dayvalue = DoubleUtils.GetResult(DoubleUtils.GetResult(m.getNow(),m.getDay(),"-"),meterMap.get(m.getMeterid()).getMagnification(),"*");
+
+                    QueryWrapper<Analysissubtablebottom1> wrapperDay = new QueryWrapper<>();
+                    wrapperDay.eq("recorddate", DateUtils.addDays(selDate, -1)).eq("meterid",m.getMeterid());
+                    Analysissubtablebottom1 one = analysissubtablebottom1Service.getOne(wrapperDay);
+
+                    double dayvalue = DoubleUtils.GetResult(DoubleUtils.GetResult(m.getNow(),one.getStopcodemodify(),"-"),meterMap.get(m.getMeterid()).getMagnification(),"*");
                     analysissubtablebottom.setDayvalue(dayvalue);
                     analysissubtablebottom.setDayvaluemodify(dayvalue);
                     analysissubtablebottom1Service.save(analysissubtablebottom);
@@ -264,7 +269,12 @@ public class AnalysisNewService {
                     analysissubtablebottom.setRecorddate(DateUtils.parseDate(day));
                     analysissubtablebottom.setStopcode(m.getNow());
                     analysissubtablebottom.setStopcodemodify(m.getNow());
-                    double dayvalue = DoubleUtils.GetResult(DoubleUtils.GetResult(m.getNow(),m.getDay(),"-"),meterMap.get(m.getMeterid()).getMagnification(),"*");
+
+                    QueryWrapper<Analysissubtablebottom> wrapperDay = new QueryWrapper<>();
+                    wrapperDay.eq("recorddate", DateUtils.addDays(selDate, -1)).eq("meterid",m.getMeterid());
+                    Analysissubtablebottom one = analysissubtablebottomService.getOne(wrapperDay);
+
+                    double dayvalue = DoubleUtils.GetResult(DoubleUtils.GetResult(m.getNow(),one.getStopcodemodify(),"-"),meterMap.get(m.getMeterid()).getMagnification(),"*");
                     analysissubtablebottom.setDayvalue(dayvalue);
                     analysissubtablebottom.setDayvaluemodify(dayvalue);
                     analysissubtablebottomService.save(analysissubtablebottom);