1、统计接口,增加已退回的数据
2、增加规则、任务、配置的历史状态变化表查询 3、任务结束后,其选择规则再次使用报错正在使用中问题解决。修改规则审计状态同时,删去used_tasl_id的值 4、任务结束,修改is——delete报错解决,doris要使用unique key 5、分页查询逆序返回
This commit is contained in:
@@ -236,6 +236,9 @@ public class DynamicRuleController implements DynamicRuleControllerApi {
|
||||
))
|
||||
.setData("dynamic_rule_unaudit_num", dynamicRuleService.queryAuditDynamicRuleTotalNum(
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.PENDING.getState())
|
||||
))
|
||||
.setData("dynamic_rule_returned_num", dynamicRuleService.queryAuditDynamicRuleTotalNum(
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.RETURNED.getState())
|
||||
));
|
||||
}
|
||||
|
||||
@@ -257,4 +260,14 @@ public class DynamicRuleController implements DynamicRuleControllerApi {
|
||||
.setData("auditInfo", dynamicRuleService.queryAuditInfo(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("/{id}/history")
|
||||
public ResponseResult queryHistory(@PathVariable Integer id,
|
||||
@RequestParam(value = "page", required = true) Integer page,
|
||||
@RequestParam(value = "page_size", required = true) Integer pageSize) {
|
||||
|
||||
return ResponseResult.ok()
|
||||
.setData("history", dynamicRuleService.queryHistory(id, page, pageSize));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -505,4 +505,29 @@ public interface DynamicRuleControllerApi {
|
||||
@GetMapping("/auditInfo/{id}")
|
||||
ResponseResult queryAuditInfo(@PathVariable Integer id);
|
||||
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "查询历史变化",
|
||||
description = "查询历史变化,只接收一个id",
|
||||
responses = {
|
||||
@io.swagger.v3.oas.annotations.responses.ApiResponse(
|
||||
description = "返回是否成功",
|
||||
content = @Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = ResponseResult.class)
|
||||
)
|
||||
)
|
||||
},
|
||||
parameters = {
|
||||
@Parameter(name = "page", description = "页数", example = "2"),
|
||||
@Parameter(name = "page_size", description = "每页个数", example = "10"),
|
||||
}
|
||||
)
|
||||
@GetMapping("/{id}/history")
|
||||
ResponseResult queryHistory(@PathVariable Integer id,
|
||||
@RequestParam(value = "page", required = true) Integer page,
|
||||
@RequestParam(value = "page_size", required = true) Integer pageSize);
|
||||
|
||||
|
||||
}
|
||||
@@ -73,4 +73,8 @@ public interface DynamicRuleMapper {
|
||||
void insertStatusLogBatch(List<Integer> ids);
|
||||
|
||||
void updateStatusLogExpireTimeBatch(List<Integer> ids);
|
||||
|
||||
List<DynamicRuleObject> queryHistory(Integer id, Integer page, Integer pageSize);
|
||||
|
||||
void removeUsedTaskId(Long taskId);
|
||||
}
|
||||
|
||||
@@ -362,4 +362,7 @@ public class DynamicRuleService {
|
||||
}
|
||||
|
||||
|
||||
public List<DynamicRuleObject> queryHistory(Integer id, Integer page, Integer pageSize) {
|
||||
return dynamicRuleMapper.queryHistory(id, page, pageSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,9 @@ public class StaticRuleController implements StaticRuleControllerApi {
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.AUDITED.getState())
|
||||
))
|
||||
.setData("static_rule_unaudit_num", staticRuleService.queryAuditStaticRuleTotalNum(
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.PENDING.getState())));
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.PENDING.getState())))
|
||||
.setData("static_rule_returned_num", staticRuleService.queryAuditStaticRuleTotalNum(
|
||||
AuditStatusEnum.getNumByState(AuditStatusEnum.RETURNED.getState())));
|
||||
}
|
||||
|
||||
|
||||
@@ -301,4 +303,14 @@ public class StaticRuleController implements StaticRuleControllerApi {
|
||||
.setData("auditInfo", staticRuleService.queryAuditInfo(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping("/{id}/history")
|
||||
public ResponseResult queryHistory(@PathVariable Integer id,
|
||||
@RequestParam(value = "page", required = true) Integer page,
|
||||
@RequestParam(value = "page_size", required = true) Integer pageSize) {
|
||||
|
||||
return ResponseResult.ok()
|
||||
.setData("history", staticRuleService.queryHistory(id, page, pageSize));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -413,4 +413,29 @@ public interface StaticRuleControllerApi {
|
||||
)
|
||||
@GetMapping("/auditInfo/{id}")
|
||||
ResponseResult queryAuditInfo(@PathVariable Integer id);
|
||||
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "查询历史变化",
|
||||
description = "查询历史变化,只接收一个id",
|
||||
responses = {
|
||||
@io.swagger.v3.oas.annotations.responses.ApiResponse(
|
||||
description = "返回是否成功",
|
||||
content = @Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = ResponseResult.class)
|
||||
)
|
||||
)
|
||||
},
|
||||
parameters = {
|
||||
@Parameter(name = "page", description = "页数", example = "2"),
|
||||
@Parameter(name = "page_size", description = "每页个数", example = "10"),
|
||||
}
|
||||
)
|
||||
@GetMapping("/{id}/history")
|
||||
ResponseResult queryHistory(@PathVariable Integer id,
|
||||
@RequestParam(value = "page", required = true) Integer page,
|
||||
@RequestParam(value = "page_size", required = true) Integer pageSize);
|
||||
|
||||
}
|
||||
|
||||
@@ -76,4 +76,8 @@ public interface StaticRuleMapper {
|
||||
void insertStaticRuleStatusLogBatch(List<Integer> ids);
|
||||
|
||||
void updateStaticRuleStatusLogExpireTimeBatch(List<Integer> ids);
|
||||
|
||||
List<StaticRuleObject> queryHistory(Integer id, Integer page, Integer pageSize);
|
||||
|
||||
void removeUsedTaskId(Long taskId);
|
||||
}
|
||||
|
||||
@@ -420,4 +420,8 @@ public class StaticRuleService {
|
||||
staticRuleMapper.updateStaticRuleStatusLogExpireTimeBatch(ids);
|
||||
staticRuleMapper.insertStaticRuleStatusLogBatch(ids);
|
||||
}
|
||||
|
||||
public List<StaticRuleObject> queryHistory(Integer id, Integer page, Integer pageSize) {
|
||||
return staticRuleMapper.queryHistory(id, page, pageSize);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user