ソースを参照

新增2个控制状态的接口 跃渊表去掉revision相关字段

王苗苗 6 ヶ月 前
コミット
cf768fa719

+ 42 - 0
src/main/java/com/xlht/xlhtproject/controller/FrontController.java

@@ -1,12 +1,19 @@
 package com.xlht.xlhtproject.controller;
 
 
+import com.xlht.xlhtproject.domain.TTbDu;
+import com.xlht.xlhtproject.mapper.TTbDuMapper;
 import com.xlht.xlhtproject.respParse.bean.AjaxResult;
+import com.xlht.xlhtproject.respParse.bean.R;
 import com.xlht.xlhtproject.service.IFrontService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Objects;
+
+import static com.xlht.xlhtproject.enums.MyConstants.LONG_1;
+
 /**
  * 前端用户相关接口
  */
@@ -18,6 +25,9 @@ public class FrontController {
     @Autowired
     private IFrontService frontService;
 
+    @Autowired
+    private TTbDuMapper tTbDuMapper;
+
 
     /**
      *
@@ -56,4 +66,36 @@ public class FrontController {
 
 
 
+    /**
+     *获取碳源投加 是否在本系统中允许投放(用于部分场景:计算异常 或者 想手动中断等)
+     * @return
+     */
+    @GetMapping("/bigModel/smartAdd/getSwitchStatus")
+    public R<Integer> getSwitchStatus()
+    {
+        log.info("进入了 获取碳源投加 是否在本系统中允许投放(用于部分场景:计算异常 或者 想手动中断等) 接口");
+        TTbDu tTbDu = tTbDuMapper.selectTTbDuByID(LONG_1);
+        if(Objects.isNull(tTbDu))
+            throw new RuntimeException("未查询到碳源投放配置开关");
+        return R.ok(tTbDu.getACTIVE());
+    }
+
+
+    /**
+     *修改碳源投加 是否在本系统中允许投放(用于部分场景:计算异常 或者 想手动中断等)
+     * @return
+     */
+    @PutMapping("/bigModel/smartAdd/updateSwitchStatus")
+    public R<String> updateSwitchStatus(@RequestBody TTbDu tTbDu)
+    {
+        log.info("进入了 修改碳源投加 是否在本系统中允许投放(用于部分场景:计算异常 或者 想手动中断等) 接口");
+        if(Objects.isNull(tTbDu.getACTIVE()))
+            throw new RuntimeException("请输入要更改的状态");
+        tTbDu.setID(LONG_1);
+        this.tTbDuMapper.updateTTbDu(tTbDu);
+        return R.ok("修改成功");
+    }
+
+
+
 }

+ 1 - 1
src/main/java/com/xlht/xlhtproject/domain/TTbDu.java

@@ -39,7 +39,7 @@ public class TTbDu
     private String c2TjLlTime;
 
     /** 是否允许投放(0否  1是) */
-    private Long ACTIVE;
+    private Integer ACTIVE;
 
     /** 创建者 */
     private String createBy;

+ 2 - 0
src/main/java/com/xlht/xlhtproject/enums/MyConstants.java

@@ -5,6 +5,8 @@ import java.math.BigDecimal;
 public class MyConstants {
 
 
+    public static final long LONG_1 = 1L;
+
     public static final int INT_3 = 3;
 
 

+ 0 - 1
src/main/resources/mapper/TShuju1Mapper.xml

@@ -171,7 +171,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="jqrSwcZhenglin != null">JQR_SWC_ZHENGLIN = #{jqrSwcZhenglin},</if>
             <if test="jqrSwcZhenglinTime != null">JQR_SWC_ZHENGLIN_TIME = #{jqrSwcZhenglinTime},</if>
         </trim>
-        ,revision = revision + 1
         where ID = #{ID}
     </update>
 

+ 0 - 1
src/main/resources/mapper/TTbDuMapper.xml

@@ -64,7 +64,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="c2TjLlTime != null">C2_TJ_LL_TIME = #{c2TjLlTime},</if>
             <if test="ACTIVE != null">ACTIVE = #{ACTIVE},</if>
         </trim>
-        ,revision = revision + 1
         where ID = #{ID}
     </update>
 

+ 0 - 1
src/main/resources/mapper/TTbXieMapper.xml

@@ -64,7 +64,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="jqrLcId != null">jqr_lc_ID = #{jqrLcId},</if>
             <if test="jqrLcBj != null">jqr_lc_bj = #{jqrLcBj},</if>
         </trim>
-        ,revision = revision + 1
         where ID = #{ID}
     </update>
 

+ 0 - 1
src/main/resources/mapper/ZAssayFaultMapper.xml

@@ -130,7 +130,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stepInfo2 != null">step_info2 = #{stepInfo2},</if>
             <if test="stepInfo3 != null">step_info3 = #{stepInfo3},</if>
         </trim>
-        ,revision = revision + 1
         where fault_id = #{faultId}
     </update>
 

+ 0 - 1
src/main/resources/mapper/ZAssayMapper.xml

@@ -145,7 +145,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="assayStatus != null">assay_status = #{assayStatus},</if>
             <if test="assayMethod != null">assay_method = #{assayMethod},</if>
         </trim>
-        ,revision = revision + 1
         where assay_id = #{assayId}
     </update>
 

+ 0 - 1
src/main/resources/mapper/ZAssayResultMapper.xml

@@ -220,7 +220,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="readFlag != null">read_flag = #{readFlag},</if>
             <if test="tongbuZt != null">tongbu_zt = #{tongbuZt},</if>
         </trim>
-        ,revision = revision + 1
         where result_id = #{resultId}
     </update>