1、指令新增白名单判断,命中白名单后加入到t_whitelist_hit表中,不加到t_command
2、指令新增时,记录到t_command_log表中 3、配置增加创建人、审核人 4、任务停止、结束时,规则的used_task_id也变为空 5、规则update后更新审核状态bug修复
This commit is contained in:
@@ -40,7 +40,7 @@ public interface StaticRuleMapper {
|
||||
|
||||
Integer queryAuditStatusById(Integer id);
|
||||
|
||||
Boolean updateAuditStatusById(Integer id, Integer auditStatus,
|
||||
Boolean updateAuditStatusByIdWithUser(Integer id, Integer auditStatus,
|
||||
String auditUserName,
|
||||
Integer auditUserId,
|
||||
String auditUserDepart);
|
||||
@@ -80,4 +80,6 @@ public interface StaticRuleMapper {
|
||||
List<StaticRuleObject> queryHistory(Integer id, Integer page, Integer pageSize);
|
||||
|
||||
void removeUsedTaskId(Long taskId);
|
||||
|
||||
// boolean queryStaticRuleRepeat(StaticRuleObject object);
|
||||
}
|
||||
|
||||
@@ -63,13 +63,12 @@ public class StaticRuleService {
|
||||
新建静态规则
|
||||
*/
|
||||
@SneakyThrows
|
||||
@Transactional
|
||||
public Integer newStaticRuleObject(StaticRuleObject object) {
|
||||
|
||||
object.setStaticRuleCreateTime(LocalDateTime.now());
|
||||
object.setAuditStatus(0);
|
||||
/*
|
||||
待开发:设置静态规则对象的创建用户、用户所属部门等属性
|
||||
*/
|
||||
|
||||
if (!isIpMaskValid(object.getStaticRuleSip(),object.getStaticRuleMsip()) ||
|
||||
!isIpMaskValid(object.getStaticRuleDip(),object.getStaticRuleMdip())
|
||||
){
|
||||
@@ -78,6 +77,10 @@ public class StaticRuleService {
|
||||
if (!RuleEnum.checkValidate(object)) {
|
||||
throw new IllegalArgumentException("静态规则不符合指定的配置方法,请参考规则模板以配置静态规则");
|
||||
}
|
||||
|
||||
// if(!staticRuleMapper.queryStaticRuleRepeat(object)){
|
||||
// throw new IllegalArgumentException("静态规则重复");
|
||||
// }
|
||||
/*
|
||||
新建静态规则,过一下白名单审核
|
||||
*/
|
||||
@@ -103,7 +106,7 @@ public class StaticRuleService {
|
||||
|
||||
return object.getStaticRuleId();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Object deleteStaticRules(List<Integer> staticRuleIds) {
|
||||
//判断当前静态规则是否能够删除---是否存在任务选择的静态规则??
|
||||
|
||||
@@ -144,8 +147,8 @@ public class StaticRuleService {
|
||||
throw new IllegalArgumentException("未知的静态规则ID");
|
||||
}
|
||||
|
||||
if (!staticRuleObject.getAuditStatus().equals(AuditStatusEnum.AUDITED.getNum())) {
|
||||
throw new IllegalStateException("无法修改该静态规则,因为其审核状态未处于" + AuditStatusEnum.AUDITED);
|
||||
if (staticRuleObject.getAuditStatus().equals(AuditStatusEnum.USING.getNum())) {
|
||||
throw new IllegalStateException("无法修改该静态规则,因为其状态处于" + AuditStatusEnum.USING);
|
||||
}
|
||||
|
||||
if (!RuleEnum.checkValidate(object)) {
|
||||
@@ -241,7 +244,7 @@ public class StaticRuleService {
|
||||
if (!AuditStatusValidator.setOriginal(originalAuditStatus).checkValidate(auditStatus)) {
|
||||
throw new IllegalArgumentException("invalid audit status");
|
||||
}
|
||||
Boolean success = staticRuleMapper.updateAuditStatusById(id, auditStatus, auditUserName, auditUserId, auditUserDepart);
|
||||
Boolean success = staticRuleMapper.updateAuditStatusByIdWithUser(id, auditStatus, auditUserName, auditUserId, auditUserDepart);
|
||||
//记录状态历史
|
||||
insertStaticRuleStatusLog(id);
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
Reference in New Issue
Block a user