|
@@ -14,11 +14,9 @@ import com.gyee.power.fitting.common.util.PowerFittingUtil;
|
|
|
import com.gyee.power.fitting.model.*;
|
|
|
import com.gyee.power.fitting.model.anno.AnnotationTool;
|
|
|
import com.gyee.power.fitting.model.anno.FixedVo;
|
|
|
-import com.gyee.power.fitting.model.custom.FjjxbVo;
|
|
|
-import com.gyee.power.fitting.model.custom.PhotovoltaicInfo;
|
|
|
-import com.gyee.power.fitting.model.custom.TableTitle;
|
|
|
-import com.gyee.power.fitting.model.custom.TsDoubleData;
|
|
|
+import com.gyee.power.fitting.model.custom.*;
|
|
|
import com.gyee.power.fitting.service.*;
|
|
|
+import com.gyee.power.fitting.service.custom.curve.DataScangfService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.math3.fitting.WeightedObservedPoints;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -62,20 +60,37 @@ public class NewIvPvCurveFittingService {
|
|
|
private List<FixedVo> fixedVos;
|
|
|
private Map<String, String> uniforcodes;
|
|
|
|
|
|
- public void getDatas2File(String stationid, long start, long end) {
|
|
|
+ @Resource
|
|
|
+ private DataScangfService dataScangfService;
|
|
|
+
|
|
|
+ public void getDatas2File(String stationid, long start, long end ,int interval) {
|
|
|
|
|
|
int daym = 24 * 60 * 60 * 1000;
|
|
|
|
|
|
//按天
|
|
|
for (long i = start; i < end; i += daym) {
|
|
|
|
|
|
- List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym);
|
|
|
+ List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym,interval);
|
|
|
infos2File(datas);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+ public List<List<List<PhotovoltaicInfo>>> getDatas2File1(String stationid, long start, long end ,int interval) {
|
|
|
+
|
|
|
+ int daym = 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ List<List<List<PhotovoltaicInfo>>> wj = new ArrayList<>();
|
|
|
+ //按天
|
|
|
+ for (long i = start; i < end; i += daym) {
|
|
|
+
|
|
|
+ List<List<PhotovoltaicInfo>> datas = getDatas(stationid, i, i + daym,interval);
|
|
|
+ wj.add(datas);
|
|
|
+// infos2File(datas);
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+ return wj;
|
|
|
+ }
|
|
|
|
|
|
private void infos2File(List<List<PhotovoltaicInfo>> datas) {
|
|
|
|
|
@@ -86,7 +101,7 @@ public class NewIvPvCurveFittingService {
|
|
|
for (List<PhotovoltaicInfo> data : datas) {
|
|
|
PhotovoltaicInfo info = data.get(0);
|
|
|
String station = info.getStation();
|
|
|
- String fileName = config.getFilePathPrepare() + "gf"+File.separator + station + "-" + info.getInverter() + "-" + DateUtils.date2StringS(new Date(info.getTime())) + ".csv";
|
|
|
+ String fileName = config.getFilePathPrepare() + "gf" +File.separator+ "一秒" +File.separator + station + "-" + info.getInverter() + "-" + DateUtils.date2StringS(new Date(info.getTime())) + ".csv";
|
|
|
File file = new File(fileName);
|
|
|
if (file.exists()) continue;
|
|
|
StringBuilder sb = new StringBuilder();
|
|
@@ -102,10 +117,15 @@ public class NewIvPvCurveFittingService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public List<String> getFileList(String station, List<String> nbq, long startdate, long enddate, boolean isOffline) {
|
|
|
+ public List<String> getFileList(String station, List<String> nbq, long startdate,int interval, long enddate, boolean isOffline) {
|
|
|
List<String> fileList = new ArrayList<>();
|
|
|
- //获取文件位置
|
|
|
- File file = new File(config.getFilePathPrepare() + "gf" +File.separator);
|
|
|
+ File file = null;
|
|
|
+ //获取文件位置
|
|
|
+ if (interval == 1) {
|
|
|
+ file = new File(config.getFilePathPrepare() + "gf" + File.separator + "一秒" + File.separator);
|
|
|
+ }else if (interval == 1){
|
|
|
+ file = new File(config.getFilePathPrepare() + "gf" + File.separator + "一秒" + File.separator);
|
|
|
+ }
|
|
|
//获取文件列表
|
|
|
File[] files = file.listFiles();
|
|
|
//如果文件不够,返回null
|
|
@@ -205,6 +225,34 @@ public class NewIvPvCurveFittingService {
|
|
|
return stringListMap;
|
|
|
}
|
|
|
|
|
|
+// public Map<String, List<PhotovoltaicInfo>> calculatAnalysis1(List<List<List<PhotovoltaicInfo>>> feill) {
|
|
|
+//
|
|
|
+// 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()));
|
|
|
+//
|
|
|
+// String fs = config.getFilePathPrepare() + "gf" +File.separator;
|
|
|
+// Map<String, List<PhotovoltaicInfo>> stringListMap = new HashMap<>();
|
|
|
+// for (String s : fileList) {
|
|
|
+// //读取一个文件
|
|
|
+// List<PhotovoltaicInfo> infos = file2Info(fs + s, true);
|
|
|
+// List<PhotovoltaicInfo> theoryInfos;
|
|
|
+// if (s.contains("HZJ_GDC") || s.contains("AK_GDC")) {
|
|
|
+// theoryInfos = CurrentVoltageCalc.CalcTheoryPowerHZJ(infos, bzcldMap);
|
|
|
+// } else {
|
|
|
+// theoryInfos = CurrentVoltageCalc.CalcTheoryPower(infos, bzcldMap);
|
|
|
+// }
|
|
|
+// //按逆变器聚合数据
|
|
|
+// if (stringListMap.containsKey(theoryInfos.get(0).getInverter())) {
|
|
|
+// stringListMap.get(theoryInfos.get(0).getInverter()).addAll(theoryInfos);
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// stringListMap.put(theoryInfos.get(0).getInverter(), theoryInfos);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return stringListMap;
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 合并同逆变器文件
|
|
|
*
|
|
@@ -253,7 +301,7 @@ public class NewIvPvCurveFittingService {
|
|
|
|
|
|
public List<String> getAllFileList() {
|
|
|
//获取文件位置
|
|
|
- File file = new File(config.getFilePathPrepare() + "gf" );
|
|
|
+ File file = new File(config.getFilePathPrepare() + "gf" + "一秒" );
|
|
|
//获取文件列表
|
|
|
File[] files = file.listFiles();
|
|
|
List<String> fileList = Arrays.stream(files).map(f -> f.getName()).collect(Collectors.toList());
|
|
@@ -363,7 +411,7 @@ public class NewIvPvCurveFittingService {
|
|
|
* @param startdate
|
|
|
* @param enddate
|
|
|
*/
|
|
|
- public List<FjjxbVo> getPhotovoltaicPerformanceList(long startdate, long enddate) {
|
|
|
+ public List<FjjxbVo> getPhotovoltaicPerformanceList(long startdate, long enddate,int interval) {
|
|
|
int oneday = 24 * 60 * 60;
|
|
|
|
|
|
String bzcldPath = config.getFilePathPrepare() + "bzd"+File.separator+"标准点.csv";
|
|
@@ -394,7 +442,7 @@ public class NewIvPvCurveFittingService {
|
|
|
int i = 0;
|
|
|
double t = 5 / 60;
|
|
|
|
|
|
- List<List<PhotovoltaicInfo>> datas = getDatas(stationid, startdate, enddate);
|
|
|
+ List<List<PhotovoltaicInfo>> datas = getDatas(stationid, startdate, enddate,interval);
|
|
|
//遍历逆变器
|
|
|
for (List<PhotovoltaicInfo> data : datas) {
|
|
|
|
|
@@ -423,9 +471,10 @@ public class NewIvPvCurveFittingService {
|
|
|
*
|
|
|
* @return 逆变器,列表
|
|
|
*/
|
|
|
- public List<List<PhotovoltaicInfo>> getDatas(String stationid, long start, long end) {
|
|
|
+ public List<List<PhotovoltaicInfo>> getDatas(String stationid, long start, long end ,int interval) {
|
|
|
//间隔
|
|
|
- int interval = 5 * 60;
|
|
|
+ interval = 5 * 60; //5分钟-300
|
|
|
+
|
|
|
//获得测点
|
|
|
Map<String, String> zglpoints = getPoints(stationid, "zgl");
|
|
|
Map<String, String> llglpoints = getPoints(stationid, "llgl");
|
|
@@ -637,4 +686,29 @@ public class NewIvPvCurveFittingService {
|
|
|
|
|
|
return equipmentList;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过大点的key获取小散点
|
|
|
+ * @param yk
|
|
|
+ * @param wk
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<PhotovoltaicInfo> dataOrigin(String yk, String wk) {
|
|
|
+ List<PhotovoltaicInfo> list = new ArrayList<>();
|
|
|
+
|
|
|
+ if (!StringUtils.isEmpty(yk)){
|
|
|
+ String[] key = yk.split(",");
|
|
|
+ for (String k : key){
|
|
|
+ list.addAll(dataScangfService.getMapYY().get(k));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(wk)){
|
|
|
+ String[] kew = wk.split(",");
|
|
|
+ for (String k : kew){
|
|
|
+ list.addAll(dataScangfService.getMapWY().get(k));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|