|
@@ -2,6 +2,7 @@ package cn.com.ctop.alarm.modules.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -28,14 +29,14 @@ public class RuleSwitchController {
|
|
UpdateWrapper<UserAllocation> wrapper=new UpdateWrapper<>();
|
|
UpdateWrapper<UserAllocation> wrapper=new UpdateWrapper<>();
|
|
//开启预警
|
|
//开启预警
|
|
if(switchType.equals("on")){
|
|
if(switchType.equals("on")){
|
|
- wrapper.set("landing_page",0);
|
|
|
|
|
|
+ wrapper.set("monitoring_link",0);
|
|
wrapper.setEntity(userAllocation);
|
|
wrapper.setEntity(userAllocation);
|
|
boolean update = userAllocationService.update(wrapper);
|
|
boolean update = userAllocationService.update(wrapper);
|
|
if(update){
|
|
if(update){
|
|
result.success("监测链接预警开启成功");
|
|
result.success("监测链接预警开启成功");
|
|
}
|
|
}
|
|
}else if(switchType.equals("off")){
|
|
}else if(switchType.equals("off")){
|
|
- wrapper.set("landing_page",1);
|
|
|
|
|
|
+ wrapper.set("monitoring_link",1);
|
|
wrapper.setEntity(userAllocation);
|
|
wrapper.setEntity(userAllocation);
|
|
boolean update = userAllocationService.update(wrapper);
|
|
boolean update = userAllocationService.update(wrapper);
|
|
if(update){
|
|
if(update){
|
|
@@ -76,4 +77,20 @@ public class RuleSwitchController {
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 开关预警配置回显
|
|
|
|
+ */
|
|
|
|
+ @PostMapping(value = "/echoSwitchStatus")
|
|
|
|
+ public Result<JSONObject> echoSwitchStatus(Long accountId){
|
|
|
|
+ Result<JSONObject> result =new Result<>();
|
|
|
|
+ JSONObject switchStatus= userAllocationService.getSwitchStatusByAccount(accountId);
|
|
|
|
+ if(switchStatus.isEmpty()){
|
|
|
|
+ result.error500("未找到该账户");
|
|
|
|
+ }else {
|
|
|
|
+ result.setResult(switchStatus);
|
|
|
|
+ result.setSuccess(true);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
}
|
|
}
|