|
@@ -1,15 +1,15 @@
|
|
|
package com.gyee.runeconomy.service.Application;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.gyee.common.contant.ContantXk;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
+import com.gyee.common.util.DateUtils;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
-import com.gyee.runeconomy.model.auto.ProBasicPowerstation;
|
|
|
-import com.gyee.runeconomy.model.auto.ProBasicPowerstationPoint;
|
|
|
-import com.gyee.runeconomy.model.auto.ProBasicProjectPlan;
|
|
|
-import com.gyee.runeconomy.model.auto.ProEconPowerstationInfoDay5;
|
|
|
+import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicPowerstationPointService;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicProjectPlanService;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconPowerstationInfoDay5Service;
|
|
|
+import com.gyee.runeconomy.service.auto.IProEconStationPowerService;
|
|
|
import com.gyee.runeconomy.util.MathUtil;
|
|
|
import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -32,6 +32,9 @@ public class ApplicationService {
|
|
|
private IProBasicProjectPlanService planService;
|
|
|
|
|
|
@Resource
|
|
|
+ private IProEconStationPowerService powerService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
private IEdosUtil edosUtil;
|
|
|
|
|
|
|
|
@@ -168,9 +171,9 @@ public class ApplicationService {
|
|
|
njhdl = year.stream().mapToDouble(ProBasicProjectPlan::getGeneratingCapacity).sum();
|
|
|
rjhdl = yjhdl / 30;
|
|
|
|
|
|
- zb.put("rfdl",rfdl);
|
|
|
- zb.put("yfdl",yfdl);
|
|
|
- zb.put("nfdl",nfdl);
|
|
|
+ zb.put("rfdl",MathUtil.twoBit(rfdl / 10000));
|
|
|
+ zb.put("yfdl",MathUtil.twoBit(yfdl / 10000));
|
|
|
+ zb.put("nfdl",MathUtil.twoBit(nfdl / 10000));
|
|
|
|
|
|
zb.put("rjhdl",rjhdl);
|
|
|
zb.put("yjhdl",yjhdl);
|
|
@@ -182,4 +185,35 @@ public class ApplicationService {
|
|
|
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ public Map forecast(String type,String wpId) throws Exception {
|
|
|
+
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ Map<Integer,Object> zb = new HashMap<>();
|
|
|
+ long longDate = System.currentTimeMillis();
|
|
|
+ Date nowDate = new Date(longDate);
|
|
|
+
|
|
|
+ List<ProEconStationPower> qwt = null;
|
|
|
+ for (int i = 0; i < 3; i++) {
|
|
|
+ zb = new HashMap<>();
|
|
|
+ if (type.equals("0")) {
|
|
|
+ QueryWrapper<ProEconStationPower> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(ProEconStationPower::getRecordDate, nowDate);
|
|
|
+ qwt = powerService.list();
|
|
|
+ zb.put(i,qwt);
|
|
|
+ }else {
|
|
|
+ QueryWrapper<ProEconStationPower> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(ProEconStationPower::getRecordDate, nowDate);
|
|
|
+ qw.lambda().eq(ProEconStationPower::getWindpowerstationId,wpId);
|
|
|
+ qwt = powerService.list();
|
|
|
+ zb.put(i,qwt);
|
|
|
+ }
|
|
|
+ nowDate = DateUtils.addDays(nowDate, +1);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|