|
@@ -165,32 +165,41 @@ public class IvPvCurveFittingService {
|
|
|
private List<PhotovoltaicInfo> file2Info(String path, boolean isAll) {
|
|
|
List<String> strings = FileUtil.readFile(path, isAll);
|
|
|
List<PhotovoltaicInfo> infos = new ArrayList<>();
|
|
|
- for (int i = 1; i < strings.size(); i++) {
|
|
|
- String[] split = strings.get(i).split(",");
|
|
|
- PhotovoltaicInfo info = new PhotovoltaicInfo();
|
|
|
- try {
|
|
|
- info.setStation(split[0]);
|
|
|
- info.setInverter(split[1]);
|
|
|
- if (!"".equals(split[2])) {
|
|
|
- info.setTime(DateUtils.string2DateL(split[2]).getTime());
|
|
|
- info.setDatetime(split[2]);
|
|
|
+
|
|
|
+
|
|
|
+ try {
|
|
|
+ for (int i = 1; i < strings.size(); i++) {
|
|
|
+ String[] split = strings.get(i).split(",");
|
|
|
+ PhotovoltaicInfo info = new PhotovoltaicInfo();
|
|
|
+ try {
|
|
|
+ info.setStation(split[0]);
|
|
|
+ info.setInverter(split[1]);
|
|
|
+// System.out.println(split[2]);
|
|
|
+ if ("时间".equals(split[2])) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!"".equals(split[2])) {
|
|
|
+ info.setTime(DateUtils.string2DateL(split[2]).getTime());
|
|
|
+ info.setDatetime(split[2]);
|
|
|
+ }
|
|
|
+ info.setT(StringUtils.isBlank(split[3]) ? 0 : Double.parseDouble(split[3]));
|
|
|
+ info.setS(StringUtils.isBlank(split[4]) ? 0 : Double.parseDouble(split[4]));
|
|
|
+ info.setI(StringUtils.isBlank(split[5]) ? 0 : Double.parseDouble(split[5]));
|
|
|
+ info.setV(StringUtils.isBlank(split[6]) ? 0 : Double.parseDouble(split[6]));
|
|
|
+ info.setActualP(StringUtils.isBlank(split[7]) ? 0 : Double.parseDouble(split[7]));
|
|
|
+ info.setAI(StringUtils.isBlank(split[8]) ? 0 : Double.parseDouble(split[8]));
|
|
|
+ info.setAV(StringUtils.isBlank(split[9]) ? 0 : Double.parseDouble(split[9]));
|
|
|
+ info.setBI(StringUtils.isBlank(split[10]) ? 0 : Double.parseDouble(split[10]));
|
|
|
+ info.setBV(StringUtils.isBlank(split[11]) ? 0 : Double.parseDouble(split[11]));
|
|
|
+ info.setCI(StringUtils.isBlank(split[12]) ? 0 : Double.parseDouble(split[12]));
|
|
|
+ info.setCV(StringUtils.isBlank(split[13]) ? 0 : Double.parseDouble(split[13]));
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e);
|
|
|
}
|
|
|
- info.setT(StringUtils.isBlank(split[3]) ? 0 : Double.parseDouble(split[3]));
|
|
|
- info.setS(StringUtils.isBlank(split[4]) ? 0 : Double.parseDouble(split[4]));
|
|
|
- info.setI(StringUtils.isBlank(split[5]) ? 0 : Double.parseDouble(split[5]));
|
|
|
- info.setV(StringUtils.isBlank(split[6]) ? 0 : Double.parseDouble(split[6]));
|
|
|
- info.setActualP(StringUtils.isBlank(split[7]) ? 0 : Double.parseDouble(split[7]));
|
|
|
- info.setAI(StringUtils.isBlank(split[8]) ? 0 : Double.parseDouble(split[8]));
|
|
|
- info.setAV(StringUtils.isBlank(split[9]) ? 0 : Double.parseDouble(split[9]));
|
|
|
- info.setBI(StringUtils.isBlank(split[10]) ? 0 : Double.parseDouble(split[10]));
|
|
|
- info.setBV(StringUtils.isBlank(split[11]) ? 0 : Double.parseDouble(split[11]));
|
|
|
- info.setCI(StringUtils.isBlank(split[12]) ? 0 : Double.parseDouble(split[12]));
|
|
|
- info.setCV(StringUtils.isBlank(split[13]) ? 0 : Double.parseDouble(split[13]));
|
|
|
- } catch (Exception e) {
|
|
|
- System.out.println();
|
|
|
+ infos.add(info);
|
|
|
}
|
|
|
-
|
|
|
- infos.add(info);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.getMessage();
|
|
|
}
|
|
|
return infos;
|
|
|
}
|
|
@@ -204,7 +213,7 @@ public class IvPvCurveFittingService {
|
|
|
|
|
|
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()));
|
|
|
+ Map<String, PhotovoltaicInfo> bzcldMap = bzclds.stream().collect(Collectors.toMap(PhotovoltaicInfo::getInverter, Function.identity(),(key1, key2) -> key2));
|
|
|
|
|
|
String fs = config.getGfDataPath();
|
|
|
Map<String, List<PhotovoltaicInfo>> stringListMap = new HashMap<>();
|