|
@@ -15,17 +15,26 @@ import com.gyee.generation.util.DateUtils;
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
import com.gyee.generation.util.statisticcs.Initial;
|
|
import com.gyee.generation.util.statisticcs.Initial;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.boot.ApplicationArguments;
|
|
|
|
+import org.springframework.boot.ApplicationRunner;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
+import java.time.Instant;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
+import java.time.ZoneId;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class WindPowerInfo1Service {
|
|
public class WindPowerInfo1Service {
|
|
|
|
+// @Override
|
|
|
|
+// public void run(ApplicationArguments args) throws Exception {
|
|
|
|
+// Date date = new Date();
|
|
|
|
+// writegf(date);
|
|
|
|
+// }
|
|
|
|
|
|
// private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
|
|
// private static final Logger logger = LoggerFactory.getLogger(WindPowerInfo1Service.class);
|
|
@Resource
|
|
@Resource
|
|
@@ -44,7 +53,6 @@ public class WindPowerInfo1Service {
|
|
private IProEconAnalysisSubtableBottomService iProEconAnalysisSubtableBottomService;
|
|
private IProEconAnalysisSubtableBottomService iProEconAnalysisSubtableBottomService;
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 计算区域日信息
|
|
* 计算区域日信息
|
|
*/
|
|
*/
|
|
@@ -1256,42 +1264,55 @@ public class WindPowerInfo1Service {
|
|
public void writegf(Date date) throws Exception {
|
|
public void writegf(Date date) throws Exception {
|
|
LocalDate localDate = LocalDateTime.now().toLocalDate();
|
|
LocalDate localDate = LocalDateTime.now().toLocalDate();
|
|
String[] split = gf.split(",");
|
|
String[] split = gf.split(",");
|
|
- List<PointData> realData = edosUtil.getRealData(Arrays.asList(split));
|
|
|
|
|
|
+ List<String> str = new ArrayList<>(Arrays.asList(split));
|
|
|
|
+ List<PointData> realData = edosUtil.getRealData(str);
|
|
QueryWrapper<ProEconAnalysisSubtableBottom> qw = new QueryWrapper<>();
|
|
QueryWrapper<ProEconAnalysisSubtableBottom> qw = new QueryWrapper<>();
|
|
qw.lambda().eq(ProEconAnalysisSubtableBottom::getRecordDate, localDate);
|
|
qw.lambda().eq(ProEconAnalysisSubtableBottom::getRecordDate, localDate);
|
|
List<ProEconAnalysisSubtableBottom> sel = iProEconAnalysisSubtableBottomService.sel(qw);
|
|
List<ProEconAnalysisSubtableBottom> sel = iProEconAnalysisSubtableBottomService.sel(qw);
|
|
- List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
|
|
|
|
|
|
+ List<ProEconAnalysisSubtableBottom> ls = null;
|
|
if (null == sel || sel.isEmpty()) {
|
|
if (null == sel || sel.isEmpty()) {
|
|
|
|
+ ls = new ArrayList<>();
|
|
for (PointData real : realData) {
|
|
for (PointData real : realData) {
|
|
ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
- date = new Date(real.getPointTime());
|
|
|
|
- pb.setRecordDate(date);
|
|
|
|
|
|
+ pb.setRecordDate(new Date(real.getPointTime()));
|
|
String[] split1 = real.getPointName().split("\\.");
|
|
String[] split1 = real.getPointName().split("\\.");
|
|
if ("曙光储能电站".equals(split1[2]) || "宁东33光伏场站".equals(split1[2])) {
|
|
if ("曙光储能电站".equals(split1[2]) || "宁东33光伏场站".equals(split1[2])) {
|
|
pb.setWpid("GJNY_NXGS_SGB_GDC_STA");
|
|
pb.setWpid("GJNY_NXGS_SGB_GDC_STA");
|
|
- }else if("霞光储能电站".equals(split1[2]) || "宁东32光伏场站".equals(split1[2])){
|
|
|
|
|
|
+ } else if ("霞光储能电站".equals(split1[2]) || "宁东32光伏场站".equals(split1[2])) {
|
|
pb.setWpid("GJNY_NXGS_XGB_GDC_STA");
|
|
pb.setWpid("GJNY_NXGS_XGB_GDC_STA");
|
|
|
|
+ } else if ("电度表".equals(split1[3]) ) {
|
|
|
|
+ pb.setWpid("NX_FGS_HA_FDC_STA");
|
|
}else {
|
|
}else {
|
|
pb.setWpid("GJNY_NXGS_QZB_GDC_STA");
|
|
pb.setWpid("GJNY_NXGS_QZB_GDC_STA");
|
|
}
|
|
}
|
|
pb.setMeterId(real.getPointName());
|
|
pb.setMeterId(real.getPointName());
|
|
pb.setMeterName(real.getPointName());
|
|
pb.setMeterName(real.getPointName());
|
|
pb.setStopCode(real.getPointValueInDouble());
|
|
pb.setStopCode(real.getPointValueInDouble());
|
|
|
|
+ pb.setStopCodeModify(real.getPointValueInDouble());
|
|
ls.add(pb);
|
|
ls.add(pb);
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
|
|
+ ls = new ArrayList<>();
|
|
for (PointData real : realData) {
|
|
for (PointData real : realData) {
|
|
for (ProEconAnalysisSubtableBottom s : sel) {
|
|
for (ProEconAnalysisSubtableBottom s : sel) {
|
|
- ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
|
|
if (real.getPointName().equals(s.getMeterId())) {
|
|
if (real.getPointName().equals(s.getMeterId())) {
|
|
|
|
+ ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
|
|
+ pb.setId(s.getId());
|
|
pb.setStopCode(real.getPointValueInDouble());
|
|
pb.setStopCode(real.getPointValueInDouble());
|
|
|
|
+ pb.setStopCodeModify(real.getPointValueInDouble());
|
|
|
|
+ pb.setRecordDate(new Date(real.getPointTime()));
|
|
|
|
+ pb.setMeterName(real.getPointName());
|
|
|
|
+ pb.setMeterId(real.getPointName());
|
|
|
|
+ ls.add(pb);
|
|
}
|
|
}
|
|
- ls.add(pb);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
boolean b = iProEconAnalysisSubtableBottomService.batchAdd(ls);
|
|
boolean b = iProEconAnalysisSubtableBottomService.batchAdd(ls);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|