|
@@ -1,5 +1,7 @@
|
|
package org.jeecg.modules.ctop.controller;
|
|
package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
|
|
+import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
|
|
|
|
+import cn.com.ctop.alarm.modules.service.IRuleAccountTemplateService;
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
|
|
import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
import cn.com.ctop.common.module.entity.CtopOauthToken;
|
|
@@ -362,6 +364,9 @@ public class UserAllocationController {
|
|
* @param userAllocation
|
|
* @param userAllocation
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
|
|
+ @Autowired
|
|
|
|
+ private IRuleAccountTemplateService ruleAccountTemplateService;
|
|
|
|
+
|
|
@AutoLog(value = "用户分配-编辑")
|
|
@AutoLog(value = "用户分配-编辑")
|
|
@ApiOperation(value = "用户分配-编辑", notes = "用户分配-编辑")
|
|
@ApiOperation(value = "用户分配-编辑", notes = "用户分配-编辑")
|
|
@PutMapping(value = "/edit")
|
|
@PutMapping(value = "/edit")
|
|
@@ -372,6 +377,17 @@ public class UserAllocationController {
|
|
result.error500("未找到对应实体");
|
|
result.error500("未找到对应实体");
|
|
} else {
|
|
} else {
|
|
boolean ok = userAllocationService.updateById(userAllocation);
|
|
boolean ok = userAllocationService.updateById(userAllocation);
|
|
|
|
+ Integer accountStatus = userAllocation.getAccountStatus();
|
|
|
|
+ if (!Check.isNull(accountStatus)) {
|
|
|
|
+ if (accountStatus == 1) {
|
|
|
|
+ QueryWrapper<RuleAccountTemplate> ruleAccountTemplateQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ ruleAccountTemplateQueryWrapper.eq("account_id", userAllocationEntity.getAccountId());
|
|
|
|
+ RuleAccountTemplate updateRuleAccountTemplate = new RuleAccountTemplate();
|
|
|
|
+ updateRuleAccountTemplate.setTemplateStatus(1);
|
|
|
|
+ ruleAccountTemplateService.update(updateRuleAccountTemplate, ruleAccountTemplateQueryWrapper);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
UserAllocation update = userAllocationService.getById(userAllocation.getId());
|
|
UserAllocation update = userAllocationService.getById(userAllocation.getId());
|
|
QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
|
|
memberQueryWrapper.eq("user_id", update.getUserId());
|
|
memberQueryWrapper.eq("user_id", update.getUserId());
|
|
@@ -478,30 +494,30 @@ public class UserAllocationController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 账户绑定是否开启删评论开关
|
|
|
|
|
|
+ * 账户绑定是否开启删评论开关
|
|
*/
|
|
*/
|
|
@PostMapping(value = "/onOrOffDeleteComment")
|
|
@PostMapping(value = "/onOrOffDeleteComment")
|
|
- public Result<Object> onOrOffMonitoringLink(@RequestParam Long accountId, @RequestParam Integer switchType){
|
|
|
|
- Result<Object> result=new Result<>();
|
|
|
|
- UserAllocation userAllocation=new UserAllocation();
|
|
|
|
|
|
+ public Result<Object> onOrOffMonitoringLink(@RequestParam Long accountId, @RequestParam Integer switchType) {
|
|
|
|
+ Result<Object> result = new Result<>();
|
|
|
|
+ UserAllocation userAllocation = new UserAllocation();
|
|
userAllocation.setAccountId(accountId);
|
|
userAllocation.setAccountId(accountId);
|
|
- UpdateWrapper<UserAllocation> wrapper=new UpdateWrapper<>();
|
|
|
|
|
|
+ UpdateWrapper<UserAllocation> wrapper = new UpdateWrapper<>();
|
|
//开启删评论
|
|
//开启删评论
|
|
- if(switchType==0){
|
|
|
|
- wrapper.set("delete_comment",0);
|
|
|
|
|
|
+ if (switchType == 0) {
|
|
|
|
+ wrapper.set("delete_comment", 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==1){
|
|
|
|
- wrapper.set("delete_comment",1);
|
|
|
|
|
|
+ } else if (switchType == 1) {
|
|
|
|
+ wrapper.set("delete_comment", 1);
|
|
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 {
|
|
|
|
|
|
+ } else {
|
|
result.error500("未知操作");
|
|
result.error500("未知操作");
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|