Browse Source

[feat]

1、增加预警删除按钮权限①
pull/4/head
杨威 4 months ago
parent
commit
caae858c5a
  1. 9
      dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertController.java
  2. 2
      dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertService.java
  3. 9
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java

9
dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertController.java

@ -1,5 +1,6 @@
package org.dromara.business.controller; package org.dromara.business.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -52,6 +53,14 @@ public class BusinessAlertController extends BaseController {
return R.ok(businessAlertService.getTodoBusinessAlert(alertId)); return R.ok(businessAlertService.getTodoBusinessAlert(alertId));
} }
@SaCheckPermission("business:alert:delete")
@Operation(summary ="删除预警",description = "删除预警")
@GetMapping("/{alertId}/delete")
public R<Boolean> deleteFalseAlert(@PathVariable("alertId") Long alertId) {
return R.ok(businessAlertService.deleteFalseAlert(alertId));
}
/** /**
* 查询全部预警/待办/已完成/忽略 * 查询全部预警/待办/已完成/忽略
*/ */

2
dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertService.java

@ -84,4 +84,6 @@ public interface IBusinessAlertService {
List<BusinessAlert> listTodoAlert(BusinessAlertBo businessAlertBo); List<BusinessAlert> listTodoAlert(BusinessAlertBo businessAlertBo);
BusinessAlert getTodoBusinessAlert(Long alertId); BusinessAlert getTodoBusinessAlert(Long alertId);
Boolean deleteFalseAlert(Long alertId);
} }

9
dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java

@ -380,6 +380,7 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
//排除状态为验证状态预警 //排除状态为验证状态预警
wrapper.ne("t.handle_type", BusinessStatusEnum.VERIFY.getStatus()); wrapper.ne("t.handle_type", BusinessStatusEnum.VERIFY.getStatus());
wrapper.eq("t.del_flag", 0);
if (ObjectUtil.isNotEmpty(bo.getHandleType())){ if (ObjectUtil.isNotEmpty(bo.getHandleType())){
wrapper.eq("t.handle_type", bo.getHandleType()); wrapper.eq("t.handle_type", bo.getHandleType());
@ -647,6 +648,14 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
return businessAlert; return businessAlert;
} }
@Override
public Boolean deleteFalseAlert(Long alertId) {
LambdaUpdateWrapper<BusinessAlert> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(BusinessAlert::getId, alertId);
wrapper.set(BusinessAlert::getDelFlag,1);
return this.baseMapper.update(wrapper) > 0;
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(getLastSixDays()); System.out.println(getLastSixDays());

Loading…
Cancel
Save