Эх сурвалжийг харах

新增字段 接口调整

王苗苗 5 сар өмнө
parent
commit
82eb23182f

+ 16 - 0
src/main/java/com/xlht/xlhtproject/domain/TXlhtConf.java

@@ -43,6 +43,22 @@ public class TXlhtConf extends BaseEntity
     /** 最大进水cod量 */
     private BigDecimal maxJsCod;
 
+
+    /** 小于最小值停止投放(0否 1是) */
+    private Long stopAddFlag;
+
+    /** 控制目标偏离报警值 */
+    private BigDecimal kzmbplbjz;
+
+    /** 好氧池硝酸盐管控值 */
+    private BigDecimal hycxsygkz;
+
+    /** 硝化异常报警值 */
+    private BigDecimal xhycbjz;
+
+    /** 加药量偏移报警值 */
+    private BigDecimal jylpybjz;
+
     /** 删除标志(0代表存在 2代表删除) */
     private Long delFlag;
 

+ 4 - 0
src/main/java/com/xlht/xlhtproject/domain/TXlhtMedicineParam.java

@@ -227,6 +227,10 @@ public class TXlhtMedicineParam
     //二池投加运行方式(0组态不允许系统投放  1组态允许系统投放)
     private Integer addTypeTwo;
 
+    //2024年10月23日10:18:25 新增返回字段[实际投药和反馈的差值]
+    private BigDecimal addDifferenceOne;
+    private BigDecimal addDifferenceTwo;
+
     //请求参数
 
     /**  开始时间 */

+ 2 - 0
src/main/java/com/xlht/xlhtproject/mapper/TXlhtAddRecordMapper.java

@@ -59,4 +59,6 @@ public interface TXlhtAddRecordMapper
      * @return 结果
      */
     public int deleteTXlhtAddRecordByIds(Long[] ids);
+
+    TXlhtAddRecord selectLatestTXlhtAddRecord();
 }

+ 19 - 9
src/main/java/com/xlht/xlhtproject/service/impl/TXlhtMedicineParamServiceImpl.java

@@ -1,14 +1,8 @@
 package com.xlht.xlhtproject.service.impl;
 
 
-import com.xlht.xlhtproject.domain.SmartAdd;
-import com.xlht.xlhtproject.domain.TTbDu;
-import com.xlht.xlhtproject.domain.TTbXie;
-import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
-import com.xlht.xlhtproject.mapper.TShuju1Mapper;
-import com.xlht.xlhtproject.mapper.TTbDuMapper;
-import com.xlht.xlhtproject.mapper.TTbXieMapper;
-import com.xlht.xlhtproject.mapper.TXlhtMedicineParamMapper;
+import com.xlht.xlhtproject.domain.*;
+import com.xlht.xlhtproject.mapper.*;
 import com.xlht.xlhtproject.service.ITXlhtMedicineParamService;
 import com.xlht.xlhtproject.utils.CalculateUtils;
 import com.xlht.xlhtproject.utils.DateUtils;
@@ -48,6 +42,9 @@ public class TXlhtMedicineParamServiceImpl implements ITXlhtMedicineParamService
     @Autowired
     private TTbXieMapper tTbXieMapper;
 
+    @Autowired
+    private TXlhtAddRecordMapper xlhtAddRecordMapper;
+
 
     /**
      * 查询智能投药参数设置
@@ -318,7 +315,20 @@ public class TXlhtMedicineParamServiceImpl implements ITXlhtMedicineParamService
                     latestRecord.setAddTypeTwo(0);
                 }
             }
-
+        }
+        //2024年10月23日10:23:08 额外返回[实际投药和反馈的差值]
+        TXlhtAddRecord xlhtAddRecord = this.xlhtAddRecordMapper.selectLatestTXlhtAddRecord();
+        if(!Objects.isNull(xlhtAddRecord)){
+            BigDecimal oneAmount = xlhtAddRecord.getOneAmount();
+            BigDecimal realOneAmount = xlhtAddRecord.getRealOneAmount();
+            BigDecimal twoAmount = xlhtAddRecord.getTwoAmount();
+            BigDecimal realTwoAmount = xlhtAddRecord.getRealTwoAmount();
+            if(!Objects.isNull(oneAmount) && !Objects.isNull(realOneAmount)){
+                latestRecord.setAddDifferenceOne(oneAmount.subtract(realOneAmount).abs());
+            }
+            if(!Objects.isNull(twoAmount) && !Objects.isNull(realTwoAmount)){
+                latestRecord.setAddDifferenceTwo(twoAmount.subtract(realTwoAmount).abs());
+            }
         }
     }
 

+ 5 - 0
src/main/resources/mapper/TXlhtAddRecordMapper.xml

@@ -118,4 +118,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         and del_flag = 0 order by id ASC
     </select>
+
+
+    <select id="selectLatestTXlhtAddRecord" resultMap="TXlhtAddRecordResult">
+        select top 1 id, one_system_add, two_system_add, one_amount, two_amount, real_one_amount, real_two_amount, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_xlht_add_record order by id desc
+    </select>
 </mapper>

+ 30 - 5
src/main/resources/mapper/TXlhtConfMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xlht.xlhtproject.mapper.TXlhtConfMapper">
-    
+
     <resultMap type="TXlhtConf" id="TXlhtConfResult">
         <result property="id"    column="id"    />
         <result property="minAddAmount"    column="min_add_amount"    />
@@ -12,6 +12,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="maxJsll"    column="max_jsll"    />
         <result property="minJsCod"    column="min_js_cod"    />
         <result property="maxJsCod"    column="max_js_cod"    />
+        <result property="stopAddFlag"    column="stop_add_flag"    />
+        <result property="kzmbplbjz"    column="kzmbplbjz"    />
+        <result property="hycxsygkz"    column="hycxsygkz"    />
+        <result property="xhycbjz"    column="xhycbjz"    />
+        <result property="jylpybjz"    column="jylpybjz"    />
         <result property="delFlag"    column="del_flag"    />
         <result property="revision"    column="revision"    />
         <result property="createBy"    column="create_by"    />
@@ -22,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectTXlhtConfVo">
-        select id, min_add_amount, max_add_amount, min_jsll, max_jsll, min_js_cod, max_js_cod, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_xlht_conf
+        select id, min_add_amount, max_add_amount, min_jsll, max_jsll, min_js_cod, max_js_cod, stop_add_flag, kzmbplbjz, hycxsygkz, xhycbjz, jylpybjz, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_xlht_conf
     </sql>
 
     <select id="selectTXlhtConfList" parameterType="TXlhtConf" resultMap="TXlhtConfResult">
@@ -35,16 +40,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maxJsll != null "> and max_jsll = #{maxJsll}</if>
             <if test="minJsCod != null "> and min_js_cod = #{minJsCod}</if>
             <if test="maxJsCod != null "> and max_js_cod = #{maxJsCod}</if>
+            <if test="stopAddFlag != null "> and stop_add_flag = #{stopAddFlag}</if>
+            <if test="kzmbplbjz != null "> and kzmbplbjz = #{kzmbplbjz}</if>
+            <if test="hycxsygkz != null "> and hycxsygkz = #{hycxsygkz}</if>
+            <if test="xhycbjz != null "> and xhycbjz = #{xhycbjz}</if>
+            <if test="jylpybjz != null "> and jylpybjz = #{jylpybjz}</if>
             <if test="revision != null "> and revision = #{revision}</if>
         </where>
         and del_flag = 0 order by id desc
     </select>
-    
+
     <select id="selectTXlhtConfById" parameterType="Long" resultMap="TXlhtConfResult">
         <include refid="selectTXlhtConfVo"/>
         where id = #{id} and del_flag = 0
     </select>
-        
+
     <insert id="insertTXlhtConf" parameterType="TXlhtConf" useGeneratedKeys="true" keyProperty="id">
         insert into t_xlht_conf
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -54,6 +64,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maxJsll != null">max_jsll,</if>
             <if test="minJsCod != null">min_js_cod,</if>
             <if test="maxJsCod != null">max_js_cod,</if>
+            <if test="stopAddFlag != null">stop_add_flag,</if>
+            <if test="kzmbplbjz != null">kzmbplbjz,</if>
+            <if test="hycxsygkz != null">hycxsygkz,</if>
+            <if test="xhycbjz != null">xhycbjz,</if>
+            <if test="jylpybjz != null">jylpybjz,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="revision != null">revision,</if>
             <if test="createBy != null">create_by,</if>
@@ -69,6 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maxJsll != null">#{maxJsll},</if>
             <if test="minJsCod != null">#{minJsCod},</if>
             <if test="maxJsCod != null">#{maxJsCod},</if>
+            <if test="stopAddFlag != null">#{stopAddFlag},</if>
+            <if test="kzmbplbjz != null">#{kzmbplbjz},</if>
+            <if test="hycxsygkz != null">#{hycxsygkz},</if>
+            <if test="xhycbjz != null">#{xhycbjz},</if>
+            <if test="jylpybjz != null">#{jylpybjz},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="revision != null">#{revision},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -88,6 +108,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maxJsll != null">max_jsll = #{maxJsll},</if>
             <if test="minJsCod != null">min_js_cod = #{minJsCod},</if>
             <if test="maxJsCod != null">max_js_cod = #{maxJsCod},</if>
+            <if test="stopAddFlag != null">stop_add_flag = #{stopAddFlag},</if>
+            <if test="kzmbplbjz != null">kzmbplbjz = #{kzmbplbjz},</if>
+            <if test="hycxsygkz != null">hycxsygkz = #{hycxsygkz},</if>
+            <if test="xhycbjz != null">xhycbjz = #{xhycbjz},</if>
+            <if test="jylpybjz != null">jylpybjz = #{jylpybjz},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="revision != null">revision = #{revision},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
@@ -100,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
-    
+
 
     <delete id="deleteTXlhtConfById" parameterType="Long">
         update t_xlht_conf set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}