浏览代码

调整超短期代码

xusl 1 年之前
父节点
当前提交
af0b793b0d

+ 1 - 1
ipp-common/ipp-common-data/src/main/java/com/jiayue/ipp/common/data/entity/ForecastPowerShortTermHis.java

@@ -41,7 +41,7 @@ public class ForecastPowerShortTermHis extends NotLogicBaseEntity<ForecastPowerS
      * 生成日期
      */
     @ApiModelProperty(value = "生成日期")
-    private LocalDate genDate;
+    private Date genDate;
 
 
     /**

+ 2 - 4
ipp-common/ipp-common-data/src/main/java/com/jiayue/ipp/common/data/entity/ForecastPowerUltraShortTerm.java

@@ -3,15 +3,13 @@ package com.jiayue.ipp.common.data.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.jiayue.ipp.common.mybatis.base.BaseDataEntity;
+import com.jiayue.ipp.common.mybatis.base.NotLogicBaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
 import java.util.Date;
 
 import javax.validation.constraints.Digits;
@@ -26,7 +24,7 @@ import javax.validation.constraints.Digits;
 @TableName("idp_forecast_power_ultra_short_term")
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "idp_forecast_power_ultra_short_term")
-public class ForecastPowerUltraShortTerm extends BaseDataEntity<ForecastPowerUltraShortTerm> {
+public class ForecastPowerUltraShortTerm extends NotLogicBaseEntity<ForecastPowerUltraShortTerm> {
     private static final long serialVersionUID = 1L;
 
 

+ 2 - 3
ipp-common/ipp-common-data/src/main/java/com/jiayue/ipp/common/data/entity/ForecastPowerUltraShortTermHis.java

@@ -3,14 +3,13 @@ package com.jiayue.ipp.common.data.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.jiayue.ipp.common.mybatis.base.BaseDataEntity;
+import com.jiayue.ipp.common.mybatis.base.NotLogicBaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
-import java.time.LocalDateTime;
 import java.util.Date;
 
 import javax.validation.constraints.Digits;
@@ -25,7 +24,7 @@ import javax.validation.constraints.Digits;
 @TableName("idp_forecast_power_ultra_short_term_his")
 @EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "idp_forecast_power_ultra_short_term_his")
-public class ForecastPowerUltraShortTermHis extends BaseDataEntity<ForecastPowerUltraShortTermHis> {
+public class ForecastPowerUltraShortTermHis extends NotLogicBaseEntity<ForecastPowerUltraShortTermHis> {
     private static final long serialVersionUID = 1L;
 
 

+ 9 - 6
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/impl/an/ParsingCdqInfoServiceImpl.java

@@ -79,10 +79,12 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
                     List<BigDecimal> bigDecimals = parsingFpValue(parsingCdqInfo.getFpValue(), fileContent);
 
                     if (!bigDecimals.isEmpty()) {
-                        Date genDate = parsingGenDate(parsingCdqInfo.getGenDate(), fileContent);
+//                        Date genDate = parsingGenDate(parsingCdqInfo.getGenDate(), fileContent);
                         Long forecastTime = parsingForecastTime(parsingCdqInfo.getForecastTime(), fileContent);
-
                         if (forecastTime != 0L) {
+                            // 所属产生时刻用第一个点位减去15分钟
+                            long genDate = forecastTime-1000*60*15L;
+
                             int ago = 1;
                             List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = new ArrayList<>();
                             List<ForecastPowerUltraShortTerm> forecastPowerUltraShortTermList = new ArrayList<>();
@@ -90,7 +92,7 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
                             for (BigDecimal bigDecimal : bigDecimals) {
                                 // 构造ForecastPowerUltraShortTermHis对象
                                 ForecastPowerUltraShortTermHis forecastPowerUltraShortTermHis = new ForecastPowerUltraShortTermHis();
-                                forecastPowerUltraShortTermHis.setGenDate(genDate);
+                                forecastPowerUltraShortTermHis.setGenDate(new Date(genDate));
                                 forecastPowerUltraShortTermHis.setStationCode(parsingUrl.getStationCode());
                                 forecastPowerUltraShortTermHis.setAbleValue(bigDecimal);
                                 Date localDateTime = new Date(forecastTime);
@@ -104,7 +106,7 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
                                 forecastPowerUltraShortTerm.setForecastTime(localDateTime);
                                 forecastPowerUltraShortTerm.setStationCode(parsingUrl.getStationCode());
                                 forecastPowerUltraShortTerm.setFpValue(bigDecimal);
-                                forecastPowerUltraShortTerm.setGenDate(genDate);
+                                forecastPowerUltraShortTerm.setGenDate(new Date(genDate));
                                 forecastPowerUltraShortTerm.setForecastManufactor(parsingUrl.getForecastManufactor());
                                 forecastPowerUltraShortTermList.add(forecastPowerUltraShortTerm);
 
@@ -118,16 +120,17 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
                             // 删除之前的ForecastPowerUltraShortTerm记录
                             LambdaQueryWrapper<ForecastPowerUltraShortTerm> lambdaQueryWrapper = new LambdaQueryWrapper<>();
                             lambdaQueryWrapper.eq(ForecastPowerUltraShortTerm::getStationCode, parsingUrl.getStationCode());
+                            lambdaQueryWrapper.eq(ForecastPowerUltraShortTerm::getForecastManufactor, parsingUrl.getForecastManufactor());
                             lambdaQueryWrapper.between(ForecastPowerUltraShortTerm::getForecastTime, forecastPowerUltraShortTermList.get(0).getForecastTime(), forecastPowerUltraShortTermList.get(forecastPowerUltraShortTermList.size() - 1).getForecastTime());
                             forecastPowerUltraShortTermService.remove(lambdaQueryWrapper);
                             // 批量保存新的ForecastPowerUltraShortTerm记录
                             forecastPowerUltraShortTermService.saveBatch(forecastPowerUltraShortTermList);
 
-                            LocalDate today = LocalDate.now();
                             // 删除当天的ForecastPowerUltraShortTermHis记录
                             LambdaQueryWrapper<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisLambdaQueryWrapper = new LambdaQueryWrapper<>();
-                            forecastPowerUltraShortTermHisLambdaQueryWrapper.between(ForecastPowerUltraShortTermHis::getGenDate, today.atStartOfDay(), today.atTime(LocalTime.MAX));
+                            forecastPowerUltraShortTermHisLambdaQueryWrapper.eq(ForecastPowerUltraShortTermHis::getGenDate, new Date(genDate));
                             forecastPowerUltraShortTermHisLambdaQueryWrapper.eq(ForecastPowerUltraShortTermHis::getStationCode, parsingUrl.getStationCode());
+                            forecastPowerUltraShortTermHisLambdaQueryWrapper.eq(ForecastPowerUltraShortTermHis::getForecastManufactor, parsingUrl.getForecastManufactor());
                             forecastPowerUltraShortTermHisService.remove(forecastPowerUltraShortTermHisLambdaQueryWrapper);
                             // 批量保存新的ForecastPowerUltraShortTermHis记录
                             forecastPowerUltraShortTermHisService.saveBatch(forecastPowerUltraShortTermHisList);