Browse Source

代码优化

Koishi 1 year ago
parent
commit
8543e89fbb

+ 7 - 3
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/agc/AgcDeviateService.java

@@ -1,8 +1,10 @@
 package com.gyee.power.fitting.service.custom.agc;
 
+import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.TypeReference;
 import com.gyee.power.fitting.common.feign.IDataAdapter;
 import com.gyee.power.fitting.mapper.AgcDeviateMapper;
+import com.gyee.power.fitting.model.AgcDeviateModel;
 import com.gyee.power.fitting.model.agc.AgcDeviateConfig;
 import com.gyee.power.fitting.model.agc.AgcDeviateTag;
 import com.gyee.power.fitting.model.agc.AiPoints;
@@ -48,9 +50,11 @@ public class AgcDeviateService {
     @Resource
     private IDataAdapter iDataAdapter;
 
+    @Resource
+    private AgcDeviateMapper agcDeviateMapper;
+
 
-//    public AgcDeviateService(AgcDeviateMapper agcDeviateMapper1, FileService fs, Environment env) {
-//        this.agcDeviateMapper = agcDeviateMapper;
+//    public AgcDeviateService( FileService fs, Environment env) {
 //        fileService = fs;
 //        agcDeviateConfigMap = new HashMap<>();
 //
@@ -63,7 +67,7 @@ public class AgcDeviateService {
 //            initFiles();
 //        } else {
 //            AgcDeviateModel adm = agcDeviateMapper.selectById("agc_info_net");
-//            adcs = JSON.parseObject(adm.getValue(), AgcDeviateConfig[].class);
+//            adcs = JSONObject.parseObject(adm.getValue(), AgcDeviateConfig[].class);
 //        }
 //        for (AgcDeviateConfig adc : adcs) {
 //            agcDeviateConfigMap.put(adc.getId(), adc);

+ 4 - 4
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/IvPvCurveFittingService.java

@@ -102,7 +102,7 @@ public class IvPvCurveFittingService {
         String columnName = getFixedVos().stream().map(FixedVo::getDes).collect(Collectors.joining(","));
         //遍历逆变器
         for (List<PhotovoltaicInfo> data : datas) {
-            PhotovoltaicInfo info = data.get(data.size()-1);
+            PhotovoltaicInfo info = data.get(0);
             String station = info.getStation();
             String fileName = config.getGfDataPath() + station + "-" + info.getInverter() + "-" + DateUtils.date2StringS(new Date(info.getTime())) + ".csv";
             File file = new File(fileName);
@@ -198,7 +198,7 @@ public class IvPvCurveFittingService {
      */
     public Map<String, List<PhotovoltaicInfo>> calculatAnalysis(List<String> fileList) {
 
-        String bzcldPath = config.getFilePathPrepare() + "bzd/标准点.csv";
+        String bzcldPath = config.getFilePathPrepare() + "bzd" + File.separator + "标准点.csv";
         List<PhotovoltaicInfo> bzclds = file2Info(bzcldPath, true);
         Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity()));
 
@@ -511,9 +511,9 @@ public class IvPvCurveFittingService {
         ProBasicPowerstationPoint zjwdPoint = InitialRunner.newzjwdMap.get(station);
 
         //总辐射
-        List<TsDoubleData> zfsDatas = remoteService.adapterfd().getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
+        List<TsDoubleData> zfsDatas = remoteService.adaptergf().getHistorySnap(zfsPoint.getNemCode(), start, end, interval);
         //组件温度
-        List<TsDoubleData> zjwdDatas = remoteService.adapterfd().getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
+        List<TsDoubleData> zjwdDatas = remoteService.adaptergf().getHistorySnap(zjwdPoint.getNemCode(), start, end, interval);
         List<List<PhotovoltaicInfo>> infosLit = new ArrayList<>();
         //按逆变器
         for (String wtid : zglpoints.keySet()) {