|
@@ -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("修改成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|