|
@@ -1,20 +1,26 @@
|
|
|
package com.gyee.generation.service;//package com.gyee.generation.service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.generation.init.CacheContext;
|
|
|
import com.gyee.generation.model.auto.*;
|
|
|
import com.gyee.generation.model.vo.CompanyType;
|
|
|
import com.gyee.generation.model.vo.Location;
|
|
|
import com.gyee.generation.model.vo.WpType;
|
|
|
+import com.gyee.generation.service.auto.IProEconAnalysisSubtableBottomService;
|
|
|
import com.gyee.generation.service.auto.IProEconEquipmentInfoDay1Service;
|
|
|
import com.gyee.generation.service.auto.IProEconPowerstationInfoDay1Service;
|
|
|
import com.gyee.generation.util.DateUtils;
|
|
|
import com.gyee.generation.util.realtimesource.IEdosUtil;
|
|
|
import com.gyee.generation.util.statisticcs.Initial;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -31,6 +37,14 @@ public class WindPowerInfo1Service {
|
|
|
@Resource
|
|
|
private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
|
|
|
|
|
|
+ @Value("${ndgfzb.gf}")
|
|
|
+ private String gf;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private IProEconAnalysisSubtableBottomService iProEconAnalysisSubtableBottomService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 计算区域日信息
|
|
|
*/
|
|
@@ -1239,6 +1253,45 @@ public class WindPowerInfo1Service {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public void writegf(Date date) throws Exception {
|
|
|
+ LocalDate localDate = LocalDateTime.now().toLocalDate();
|
|
|
+ String[] split = gf.split(",");
|
|
|
+ List<PointData> realData = edosUtil.getRealData(split);
|
|
|
+ QueryWrapper<ProEconAnalysisSubtableBottom> qw = new QueryWrapper<>();
|
|
|
+ qw.lambda().eq(ProEconAnalysisSubtableBottom::getRecordDate, localDate);
|
|
|
+ List<ProEconAnalysisSubtableBottom> sel = iProEconAnalysisSubtableBottomService.sel(qw);
|
|
|
+ List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
|
|
|
+ if (null == sel || sel.isEmpty()) {
|
|
|
+ for (PointData real : realData) {
|
|
|
+ ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
|
+ date = new Date(real.getPointTime());
|
|
|
+ pb.setRecordDate(date);
|
|
|
+ String[] split1 = real.getPointName().split("\\.");
|
|
|
+ if ("曙光储能电站".equals(split1[2]) || "宁东33光伏场站".equals(split1[2])) {
|
|
|
+ pb.setWpid("GJNY_NXGS_SGB_GDC_STA");
|
|
|
+ }else if("霞光储能电站".equals(split1[2]) || "宁东32光伏场站".equals(split1[2])){
|
|
|
+ pb.setWpid("GJNY_NXGS_XGB_GDC_STA");
|
|
|
+ }else {
|
|
|
+ pb.setWpid("GJNY_NXGS_QZB_GDC_STA");
|
|
|
+ }
|
|
|
+ pb.setMeterId(real.getPointName());
|
|
|
+ pb.setMeterName(real.getPointName());
|
|
|
+ pb.setStopCode(real.getPointValueInDouble());
|
|
|
+ ls.add(pb);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ for (PointData real : realData) {
|
|
|
+ for (ProEconAnalysisSubtableBottom s : sel) {
|
|
|
+ ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
|
+ if (real.getPointName().equals(s.getMeterId())) {
|
|
|
+ pb.setStopCode(real.getPointValueInDouble());
|
|
|
+ }
|
|
|
+ ls.add(pb);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ boolean b = iProEconAnalysisSubtableBottomService.batchAdd(ls);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|