Commit cab09948 authored by ZWT's avatar ZWT

feat[零碳项目]: 松原演示

[
1.修改日耗电日产液信息定时任务及井口生产情况表表结构,增加来源系统字段,同时修改代码批量插入逻辑;
2.修改日用电趋势计算定时任务,修改代码逻辑,增加区分来源系统逻辑;
3.修改能耗分析定时任务定时任务,修改代码逻辑,增加区分来源系统逻辑;
4.修改第三方有功功率定时任务,修改代码逻辑,增加区分来源系统逻辑;
5.修改第三方当日油井状态定时任务,修改代码逻辑,增加区分来源系统逻辑;
6.修改第三方井场日累计数据定时任务,修改代码逻辑,增加区分来源系统逻辑;
7.修改第三方光伏日发电量定时任务,修改代码逻辑,增加区分来源系统逻辑;
8.修改第三井平均有功功率作业定时任务,修改代码逻辑,增加区分来源系统逻辑;
9.修改日耗电日产液信息定时任务,修改代码逻辑,增加区分来源系统逻辑;
10.修改查15分钟电站实际功率接口,修改代码逻辑,增加区分来源系统逻辑;
]
parent 22fc10c7
......@@ -3,6 +3,8 @@ package pps.cloud.base.service.data.config_oil_field;
import lombok.Data;
import xstartup.annotation.XText;
import java.util.Date;
/**
* 油田配置输出
*
......@@ -20,4 +22,10 @@ public class GetConfigOilFieldOutput {
@XText("首页路由")
private String homePagePath;
@XText("是否演示修改(1_否,0_是)")
private Integer isDemo;
@XText("演示日期")
private Date demoDate;
}
......@@ -8,6 +8,7 @@ import lombok.Data;
import xstartup.annotation.XText;
import java.io.Serializable;
import java.util.Date;
/**
* 油田配置表
......@@ -38,4 +39,12 @@ public class ConfigOilFieldEnt implements Serializable {
@XText("首页路由")
@TableField
private String homePagePath;
@XText("是否演示修改(1_否,0_是)")
@TableField
private Integer isDemo;
@XText("演示日期")
@TableField
private Date demoDate;
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import lombok.Data;
import xstartup.annotation.XText;
import java.io.Serializable;
import java.util.Date;
/**
* 油田配置表
......@@ -33,4 +34,12 @@ public class ConfigOilFieldView implements Serializable {
@XText("首页路由")
@TableField
private String homePagePath;
@XText("是否演示修改(1_否,0_是)")
@TableField
private Integer isDemo;
@XText("演示日期")
@TableField
private Date demoDate;
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package pps.core.base.service.data.config_oil_field;
import lombok.Data;
import xstartup.annotation.XText;
import java.util.Date;
/**
* 油田配置输出
*
......@@ -20,4 +22,10 @@ public class GetConfigOilFieldOutput {
@XText("首页路由")
private String homePagePath;
@XText("是否演示修改(1_否,0_是)")
private Integer isDemo;
@XText("演示日期")
private Date demoDate;
}
......@@ -7,6 +7,8 @@
<result column="oil_field_name" property="oilFieldName" jdbcType="VARCHAR"/>
<result column="oil_field_code" property="oilFieldCode" jdbcType="VARCHAR"/>
<result column="home_page_path" property="homePagePath" jdbcType="VARCHAR"/>
<result column="is_demo" property="isDemo" jdbcType="TINYINT"/>
<result column="demo_date" property="demoDate" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id
......@@ -14,7 +16,9 @@
is_enable,
oil_field_name,
oil_field_code,
home_page_path
home_page_path,
is_demo,
demo_date
</sql>
<select id="selectOne" parameterType="pps.core.base.entity.ConfigOilFieldView" resultMap="BaseResultMap">
select
......
package pps.core.prediction.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import xstartup.annotation.XText;
import java.io.Serializable;
import java.util.Date;
/**
* 演示用配置表
*
* @author ZWT
* @date 2024/06/03
*/
@Data
@TableName("config_show")
public class ConfigShowEnt implements Serializable {
@XText("ID")
@TableId(type = IdType.AUTO)
private Long id;
@XText("是否启用(1_否,0_是)")
@TableField
private Integer isEnable;
@XText("日期选择")
@TableField
private Date choiceDate;
}
package pps.core.prediction.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import xstartup.annotation.XText;
import java.io.Serializable;
import java.util.Date;
/**
* 演示用配置表
*
* @author ZWT
* @date 2024/06/03
*/
@Data
public class ConfigShowView implements Serializable {
@XText("ID")
@TableId(type = IdType.AUTO)
private Long id;
@XText("是否启用(1_否,0_是)")
@TableField
private Integer isEnable;
@XText("日期选择")
@TableField
private Date choiceDate;
}
package pps.core.prediction.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import pps.core.prediction.entity.ConfigShowEnt;
/**
* 演示用配置表
*
* @author ZWT
* @date 2024/06/03
*/
@Repository(value = "pps.core.prediction.mapper.ConfigShowMapper")
public interface ConfigShowMapper extends BaseMapper<ConfigShowEnt> {
}
package pps.core.prediction.mapper;
import org.springframework.stereotype.Repository;
import pps.core.prediction.entity.ConfigShowView;
import java.util.List;
/**
* 演示用配置表
*
* @author ZWT
* @date 2024/06/03
*/
@Repository(value = "pps.core.prediction.mapper.ConfigShowViewMapper")
public interface ConfigShowViewMapper {
/**
* 选择一个
*
* @param record 记录
* @return {@link ConfigShowView }
*/
ConfigShowView selectOne(ConfigShowView record);
/**
* 选择列表
*
* @param record 记录
* @return {@link List }<{@link ConfigShowView }>
*/
List<ConfigShowView> selectList(ConfigShowView record);
}
......@@ -24,6 +24,7 @@ import pps.cloud.base.service.data.base_power_line_wellhead.DynamicQueryBasePowe
import pps.cloud.base.service.data.base_power_line_wellhead.DynamicQueryBasePowerLineWellheadViewOutput;
import pps.cloud.base.service.data.base_wellhead.DynamicQueryBaseWellheadInput;
import pps.cloud.base.service.data.base_wellhead.DynamicQueryBaseWellheadOutput;
import pps.cloud.base.service.data.config_oil_field.GetConfigOilFieldOutput;
import pps.cloud.space.service.IDailyElectricityTrendCloudService;
import pps.cloud.space.service.data.line_daily_electricity_trend.GetLineDailyElectricityTrendInput;
import pps.cloud.space.service.data.line_daily_electricity_trend.GetLineDailyElectricityTrendOutput;
......@@ -426,12 +427,10 @@ public class HomePageService {
DateTime date = DateUtil.date();
DateTime day = DateUtil.beginOfDay(date);
//判断是否需要启用演示配置
ConfigShowMapper configMapper = context.getBean(ConfigShowMapper.class);
ConfigShowEnt configShowEnt = configMapper.selectOne(new LambdaQueryWrapper<ConfigShowEnt>()
.last("LIMIT 1"));
GetConfigOilFieldOutput currentConfig = ServiceUtil.getCurrentConfig(context);
Date showTime = null;
if (ObjectUtil.isAllNotEmpty(configShowEnt, configShowEnt.getIsEnable(), configShowEnt.getChoiceDate())) {
day = configShowEnt.getIsEnable().equals(0) ? DateUtil.date(configShowEnt.getChoiceDate()) : day;
if (ObjectUtil.isNotNull(currentConfig.getDemoDate())) {
day = currentConfig.getIsDemo().equals(0) ? DateUtil.date(currentConfig.getDemoDate()) : day;
showTime = DateUtil.parse(day.toString(BusinessConstant.DATE_FORMAT_DAY) + " " + date.toString(BusinessConstant.TIME_FORMAT));
}
//预测发电量
......
......@@ -4,10 +4,8 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import pps.cloud.base.service.data.config_oil_field.GetConfigOilFieldOutput;
import pps.core.common.constant.BusinessConstant;
import pps.core.prediction.entity.ConfigShowEnt;
import pps.core.prediction.mapper.ConfigShowMapper;
import pps.core.prediction.service.data.plant_predicted_power_data.GetPredictedPowerOutput;
import pps.core.prediction.service.data.plant_predicted_power_ultra_term.GetPlantPredictedPowerUltraTermInput;
import pps.core.prediction.utils.ServiceUtil;
......@@ -45,15 +43,13 @@ public class PlantPredictedPowerUltraTermService {
inputTime = DateUtil.parse(now.toString(BusinessConstant.DATE_FORMAT_DAY) + " " + inputStartTime + BusinessConstant.INITIALIZATION_SECOND);
}
//检查演示配置
ConfigShowMapper configMapper = context.getBean(ConfigShowMapper.class);
ConfigShowEnt configShowEnt = configMapper.selectOne(new LambdaQueryWrapper<ConfigShowEnt>()
.last("LIMIT 1"));
GetConfigOilFieldOutput currentConfig = ServiceUtil.getCurrentConfig(context);
//时间出力截至时间
Date showTime = inputTime;
int betweenDay = 0;
DateTime day = inputTime;
if (ObjectUtil.isAllNotEmpty(configShowEnt, configShowEnt.getIsEnable(), configShowEnt.getChoiceDate())) {
day = configShowEnt.getIsEnable().equals(0) ? DateUtil.parse(DateUtil.date(configShowEnt.getChoiceDate()).toString(BusinessConstant.DATE_FORMAT_DAY) + " " + inputTime.toString(BusinessConstant.TIME_FORMAT)) : inputTime;
if (ObjectUtil.isNotNull(currentConfig.getDemoDate())) {
day = currentConfig.getIsDemo().equals(0) ? DateUtil.parse(DateUtil.date(currentConfig.getDemoDate()).toString(BusinessConstant.DATE_FORMAT_DAY) + " " + inputTime.toString(BusinessConstant.TIME_FORMAT)) : inputTime;
showTime = DateUtil.parse(day.toString(BusinessConstant.DATE_FORMAT_DAY) + " " + now.toString(BusinessConstant.TIME_FORMAT));
//计算偏移
betweenDay = (int) DateUtil.betweenDay(inputTime, day, true);
......
......@@ -16,8 +16,14 @@ import pps.core.auth.HttpRequestClient;
import pps.core.common.cache.ThirdPartyConfigCache;
import pps.core.common.constant.BusinessConstant;
import pps.core.prediction.constant.ThirdPartyApiConstant;
import pps.core.prediction.entity.*;
import pps.core.prediction.mapper.*;
import pps.core.prediction.entity.PlantPredictedPowerMidTermEnt;
import pps.core.prediction.entity.PlantPredictedPowerShortTermEnt;
import pps.core.prediction.entity.PlantPredictedPowerUltraTermEnt;
import pps.core.prediction.entity.ThirdActivePowerView;
import pps.core.prediction.mapper.PlantPredictedPowerMidTermMapper;
import pps.core.prediction.mapper.PlantPredictedPowerShortTermMapper;
import pps.core.prediction.mapper.PlantPredictedPowerUltraTermMapper;
import pps.core.prediction.mapper.ThirdActivePowerViewMapper;
import pps.core.prediction.service.data.plant_predicted_power_data.GetPredictedPowerOutput;
import xstartup.base.XContext;
import xstartup.base.XStartup;
......@@ -103,11 +109,9 @@ public class ServiceUtil {
int betweenDay = 0;
//输入时间等于当日时间时,进行演示开关校验
if (0 == DateUtil.compare(DateUtil.beginOfDay(date), inputTime)) {
ConfigShowMapper configMapper = context.getBean(ConfigShowMapper.class);
ConfigShowEnt configShowEnt = configMapper.selectOne(new LambdaQueryWrapper<ConfigShowEnt>()
.last("LIMIT 1"));
if (ObjectUtil.isAllNotEmpty(configShowEnt, configShowEnt.getIsEnable(), configShowEnt.getChoiceDate())) {
day = configShowEnt.getIsEnable().equals(0) ? DateUtil.date(configShowEnt.getChoiceDate()) : inputTime;
GetConfigOilFieldOutput currentConfig = ServiceUtil.getCurrentConfig(context);
if (ObjectUtil.isNotNull(currentConfig.getDemoDate())) {
day = currentConfig.getIsDemo().equals(0) ? DateUtil.date(currentConfig.getDemoDate()) : inputTime;
showTime = DateUtil.parse(day.toString(BusinessConstant.DATE_FORMAT_DAY) + " " + date.toString(BusinessConstant.TIME_FORMAT));
//计算偏移
betweenDay = (int) DateUtil.betweenDay(inputTime, day, false);
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.prediction.mapper.ConfigShowViewMapper">
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ConfigShowView">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="is_enable" property="isEnable" jdbcType="TINYINT"/>
<result column="choice_date" property="choiceDate" jdbcType="DATE"/>
</resultMap>
<sql id="Base_Column_List">
id
,
is_enable,
choice_date
</sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.ConfigShowView" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from config_show
where
id=#{id}
</select>
<select id="selectList" parameterType="pps.core.prediction.entity.ConfigShowView" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from config_show
where
id=#{id}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment