Browse Source

[101905] 批次表加 file 列, 状态扩展 3/4/5/9 及 DDL

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
taosj 2 days ago
parent
commit
594018dac9

+ 26 - 1
forecast-backend-server/src/main/java/com/ufo/project/forecast/fileupload/domain/DataPowerForecastReportBatch.java

@@ -18,6 +18,18 @@ public class DataPowerForecastReportBatch
     /** 已确认 */
     public static final int STATUS_CONFIRMED = 2;
 
+    /** 文件生成中 */
+    public static final int STATUS_FILE_GENERATING = 3;
+
+    /** 文件上传中 */
+    public static final int STATUS_FILE_UPLOADING = 4;
+
+    /** 文件上传成功 */
+    public static final int STATUS_FILE_UPLOAD_SUCCESS = 5;
+
+    /** 文件上传失败 */
+    public static final int STATUS_FILE_UPLOAD_FAILED = 9;
+
     /** 短期 */
     public static final String TYPE_SHORT = "short";
 
@@ -45,7 +57,7 @@ public class DataPowerForecastReportBatch
     /** 预计上报时间(HH:mm:ss,北京时间) */
     private String estReportTime;
 
-    /** 状态(1待确认,2已确认) */
+    /** 状态(1待确认,2已确认,3文件生成中,4文件上传中,5文件上传成功,9文件上传失败) */
     private Integer status;
 
     /** 生成来源(auto自动,manually手动) */
@@ -60,6 +72,9 @@ public class DataPowerForecastReportBatch
     /** 备注 */
     private String remark;
 
+    /** 文件保存路径 */
+    private String file;
+
     /** 上报日起始(查询用, yyyyMMdd) */
     private Integer startDay;
 
@@ -174,6 +189,15 @@ public class DataPowerForecastReportBatch
     {
         return remark;
     }
+    public void setFile(String file)
+    {
+        this.file = file;
+    }
+
+    public String getFile()
+    {
+        return file;
+    }
     public void setStartDay(Integer startDay)
     {
         this.startDay = startDay;
@@ -208,6 +232,7 @@ public class DataPowerForecastReportBatch
             .append("createTime", getCreateTime())
             .append("updateTime", getUpdateTime())
             .append("remark", getRemark())
+            .append("file", getFile())
             .toString();
     }
 }

+ 3 - 1
forecast-backend-server/src/main/resources/mybatis/fileupload/DataPowerForecastReportBatchMapper.xml

@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
+        <result property="file"    column="file"    />
     </resultMap>
 
     <sql id="selectDataPowerForecastReportBatchVo">
-        select id, station_code, station_name, batch_no, type, report_day, est_report_time, status, generate_source, create_time, update_time, remark from data_power_forecast_report_batch
+        select id, station_code, station_name, batch_no, type, report_day, est_report_time, status, generate_source, create_time, update_time, remark, file from data_power_forecast_report_batch
     </sql>
 
     <select id="selectDataPowerForecastReportBatchList" parameterType="DataPowerForecastReportBatch" resultMap="DataPowerForecastReportBatchResult">
@@ -66,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null ">status = #{status},</if>
             <if test="generateSource != null and generateSource != ''">generate_source = #{generateSource},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="file != null">file = #{file},</if>
             update_time = now()
         </trim>
         where id = #{id}

+ 25 - 0
release_note/20261020/20261020_power_forecast_report_file.sql

@@ -0,0 +1,25 @@
+-- 101905 文件上报流程: 上报批次表加 file 列, 状态扩展 3/4/5/9 (aicoding/101905.md)
+-- 可重复执行
+
+-- -----------------------------------------------------
+-- 1. 上报批次表 data_power_forecast_report_batch 加 file 列
+-- -----------------------------------------------------
+DO $$
+BEGIN
+    IF NOT EXISTS (
+        SELECT 1
+        FROM information_schema.columns
+        WHERE table_schema = current_schema()
+          AND table_name   = 'data_power_forecast_report_batch'
+          AND column_name  = 'file'
+    ) THEN
+        ALTER TABLE data_power_forecast_report_batch
+            ADD COLUMN file VARCHAR(512);
+
+        COMMENT ON COLUMN data_power_forecast_report_batch.file IS '文件保存路径';
+    END IF;
+END
+$$;
+
+-- 状态扩展: 3文件生成中, 4文件上传中, 5文件上传成功, 9文件上传失败
+COMMENT ON COLUMN data_power_forecast_report_batch.status IS '状态(1待确认,2已确认,3文件生成中,4文件上传中,5文件上传成功,9文件上传失败)';