소스 검색

光伏表底值计算修改

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);