|
@@ -6,14 +6,17 @@ import com.alibaba.fastjson.TypeReference;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.model.fitting.ProBasicOrganizeEquipment;
|
|
|
+import com.gyee.runeconomy.model.fitting.ProEconInPowerCurveFitting;
|
|
|
import com.gyee.runeconomy.service.auto.*;
|
|
|
import com.gyee.runeconomy.service.fitting.IProBasicOrganizeEquipmentService;
|
|
|
+import com.gyee.runeconomy.service.fitting.IProEconInPowerCurveFittingService;
|
|
|
import com.gyee.runeconomy.service.fitting.ProBasicOrganizeEquipmentServiceImpl;
|
|
|
import com.gyee.runeconomy.service.realtimelibrary.TheoreticalPowerService;
|
|
|
import com.gyee.runeconomy.util.redis.RedisService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
+import org.springframework.core.annotation.Order;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -28,6 +31,7 @@ import java.util.stream.Collectors;
|
|
|
* @Description : 缓存
|
|
|
*/
|
|
|
@Component
|
|
|
+@Order(1)
|
|
|
public class CacheContext implements CommandLineRunner {
|
|
|
Logger logger = LoggerFactory.getLogger(CacheContext.class);
|
|
|
|
|
@@ -88,6 +92,8 @@ public class CacheContext implements CommandLineRunner {
|
|
|
private IProEconPowerstationInfoDay1Service proEconPowerstationInfoDay1Service;
|
|
|
@Resource
|
|
|
private IProEconWtPowerCurveFittingService wtPowerCurveFittingService;
|
|
|
+ @Resource
|
|
|
+ private IProEconInPowerCurveFittingService inPowerCurveFittingService;
|
|
|
|
|
|
public static List<ProBasicBranch> bnls = new ArrayList<>();
|
|
|
// public static List<ProBasicEquipment> wtls = new ArrayList<>();
|
|
@@ -178,6 +184,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
public static Map<String, ProBasicOrganizeTree> proBasicOrganizeTreesMap;
|
|
|
public static List<ProBasicOrganizeEquipment> organizeEquipmentList;//把树形展开的设备列表
|
|
|
public static List<ProEconWtPowerCurveFitting> wtPowerCurveFittingList;
|
|
|
+ public static List<ProEconInPowerCurveFitting> inPowerCurveFittingList;
|
|
|
|
|
|
@Override
|
|
|
public void run(String... args) throws Exception {
|
|
@@ -188,6 +195,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
organizeEquipmentList = proBasicOrganizeEquipmentService.list().stream().filter(pboe -> pboe.getIsAble() == 1).collect(Collectors.toList());
|
|
|
wtPowerCurveFittingList = wtPowerCurveFittingService.list();
|
|
|
+ inPowerCurveFittingList = inPowerCurveFittingService.list();
|
|
|
|
|
|
//List<String> pbotids = proBasicOrganizeTrees.stream().map(pbot -> pbot.getId()).collect(Collectors.toList());
|
|
|
//Map<String, Object> pbotidMap = redisService.batchGetKeys(pbotids);
|
|
@@ -195,7 +203,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
bnls = proBasicBranchService.list();
|
|
|
//List<String> bnlids = bnls.stream().map(bnl -> bnl.getId()).collect(Collectors.toList());
|
|
|
//Map<String, Object> objectMap = redisService.batchGetKeys(bnlids);
|
|
|
- bnls.stream().forEach(bn -> {
|
|
|
+ /*bnls.stream().forEach(bn -> {
|
|
|
String bnString = redisService.get(bn.getId());
|
|
|
Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(bnString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
});
|
|
@@ -208,7 +216,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
bns.add(bn);
|
|
|
wtbnmap.put(bn.getInteverId(), bns);
|
|
|
}
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
equipmentmodels = proEconEquipmentmodelService.list();
|
|
|
equipmentmodels.stream().forEach(e -> {
|
|
@@ -395,7 +403,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
wtmap.put(wt.getId(), wt);
|
|
|
//标杆风机初始化
|
|
|
wtstandardmap.put(wt.getId(), wt.getId());
|
|
|
- String wtString = redisService.get(wt.getId());
|
|
|
+ /*String wtString = redisService.get(wt.getId());
|
|
|
Map<String, ProBasicEquipmentPoint> stringWindturbinetestingpointnewMap = JSONObject.parseObject(wtString, new TypeReference<Map<String, ProBasicEquipmentPoint>>() {
|
|
|
});
|
|
|
wtpAimap.put(wt.getId(), stringWindturbinetestingpointnewMap);
|
|
@@ -453,7 +461,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
Map<String, ProBasicOrganizeTree> map = new HashMap<>();
|
|
|
map.put(wt.getId(), wt);
|
|
|
cmwtmap.put(wt.getOrgType().contains("ZGS"), map);
|
|
|
- }
|
|
|
+ }*/
|
|
|
});
|
|
|
|
|
|
|
|
@@ -503,28 +511,28 @@ public class CacheContext implements CommandLineRunner {
|
|
|
prolist.add(p);
|
|
|
wppromap.put(p.getOrgType().contains("STA"), prolist);
|
|
|
}
|
|
|
- String pjString = redisService.get(p.getId());
|
|
|
+ /*String pjString = redisService.get(p.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(pjString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
- propointmap.put(p.getId(), stringWindpowerstationpointnewMap);
|
|
|
+ propointmap.put(p.getId(), stringWindpowerstationpointnewMap);*/
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
subwpls = proBasicOrganizeTreeService.list().stream().filter(i-> i.getIsAble()==1 && i.getOrgType().contains("SBS")).collect(Collectors.toList());
|
|
|
- subwpls.stream().forEach(sub->{
|
|
|
+ /*subwpls.stream().forEach(sub->{
|
|
|
|
|
|
String subString = redisService.get(sub.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
subwppointmap.put(sub.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
|
|
|
weawpls = proBasicWeatherStationService.list().stream().filter(i -> i.getIsAble() == 1).collect(Collectors.toList());
|
|
|
- weawpls.stream().forEach(weather -> {
|
|
|
+ /*weawpls.stream().forEach(weather -> {
|
|
|
|
|
|
String subString = redisService.get(weather.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(subString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
@@ -532,13 +540,13 @@ public class CacheContext implements CommandLineRunner {
|
|
|
weatherwppointmap.put(weather.getId(), stringWindpowerstationpointnewMap);
|
|
|
|
|
|
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
|
|
|
|
|
|
//树形线路
|
|
|
lnls = proBasicOrganizeTrees.stream().filter(i -> StringUtils.isNotNull(pjmap.get(i.getParentCode()))).collect(Collectors.toList());
|
|
|
- lnls.stream().forEach(l -> {
|
|
|
+ /*lnls.stream().forEach(l -> {
|
|
|
lnmap.put(l.getId(), l);
|
|
|
if (prolinemap.containsKey(l.getOrgType().contains("EG"))) {
|
|
|
prolinemap.get(l.getOrgType().contains("EG")).add(l);
|
|
@@ -551,7 +559,7 @@ public class CacheContext implements CommandLineRunner {
|
|
|
Map<String, ProBasicPowerstationPoint> stringWindpowerstationpointnewMap = JSONObject.parseObject(lnString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
linepointmap.put(l.getId(), stringWindpowerstationpointnewMap);
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
|
|
|
for (ProBasicOrganizeTree wp : wpls) {
|
|
@@ -568,14 +576,14 @@ public class CacheContext implements CommandLineRunner {
|
|
|
meterpointMap.put(meterpoint.getId(), meterpoint);
|
|
|
});
|
|
|
|
|
|
- wpls.stream().forEach(wp->{
|
|
|
+ /*wpls.stream().forEach(wp->{
|
|
|
|
|
|
wpmap.put(wp.getId(), wp);
|
|
|
String wpString = redisService.get(wp.getId());
|
|
|
Map<String, ProBasicPowerstationPoint> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, ProBasicPowerstationPoint>>() {
|
|
|
});
|
|
|
wppointmap.put(wp.getId(), stringMapMap);
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
|
|
|
|
|
@@ -618,4 +626,4 @@ public class CacheContext implements CommandLineRunner {
|
|
|
|
|
|
logger.info("缓存结束------------------------------------------------------------");
|
|
|
}
|
|
|
-}
|
|
|
+}
|