1、AlertMessage入库修复字段和库表不匹配问题,增加display_id

2、command增加display_id
3、规则、任务、配置增加新建时(批量导入除外)、任务运行状态、审核状态改变时的历史记录
This commit is contained in:
PushM
2024-06-04 20:07:29 +08:00
parent 25ade2ef06
commit a756f9aedb
27 changed files with 1063 additions and 59 deletions

View File

@@ -58,7 +58,7 @@ public class AlertMessageTest {
null, null, null, null, null, null, null, 1, 1);
DynamicRuleObject object = new DynamicRuleObject();
object.setDynamicRuleName("测试动态任务规则"+n);
object.setDynamicRuleName("测试display_id"+n);
object.setDescription("动态规则新建测试");
object.setDynamicRuleSourceSystem("BW");
object.setBwSql("select * from test where event_id = 1");

View File

@@ -26,7 +26,7 @@ public class StaticRuleServiceTest extends ProtectionApplicationTests {
@BeforeEach
void setUp() {
staticRuleTest = new StaticRuleObject();
staticRuleTest.setStaticRuleName("test_staticrule");
staticRuleTest.setStaticRuleName("test_stasticrule");
staticRuleTest.setStaticRuleCreateUsername("mh");
staticRuleTest.setStaticRuleCreateDepart("mmeess");
staticRuleTest.setStaticRuleCreateUserId(2);
@@ -64,11 +64,20 @@ public class StaticRuleServiceTest extends ProtectionApplicationTests {
@Test
void testNewStaticRules(){
List<StaticRuleObject> staticRuleObjects = new ArrayList<>();
for (int i = 0; i < 2; i++) {
for (int i = 1; i < 10; i++) {
staticRuleTest = new StaticRuleObject();
staticRuleTest.setStaticRuleName("test_staticrule"+i);
staticRuleTest.setStaticRuleCreateUsername("NSADD管理员");
staticRuleTest.setStaticRuleCreateDepart("组织树");
staticRuleTest.setStaticRuleCreateUserId(22222222);
staticRuleTest.setAuditStatus(0);
staticRuleTest.setStaticRuleSip("32.2.3."+i);
staticRuleTest.setStaticRuleDip(i+".2.3.2");
staticRuleObjects.add(staticRuleTest);
}
// Boolean success = staticRuleService.newStaticRuleObjects(staticRuleObjects);
// assertTrue(success);
Boolean success = staticRuleService.newStaticRuleObjects(staticRuleObjects);
assertTrue(success);
}
@Test
@@ -116,13 +125,13 @@ public class StaticRuleServiceTest extends ProtectionApplicationTests {
}
@Test
void testUpdateStaticRuleAuditStatusBatch(){
// Map<Integer, Integer> map = new HashMap<>();
// map.put(1300, 0);
// map.put(1326, 1);
// map.put(1328, 1);
//
//
// System.out.println(staticRuleService.updateAuditStatusBatch(map));
Map<Integer, Integer> map = new HashMap<>();
map.put(1398, 2);
map.put(1399, 2);
map.put(1400, 2);
System.out.println(staticRuleService.updateAuditStatusBatch(map));
}
@Test
void testQueryAuditStatusByIds(){

View File

@@ -145,8 +145,10 @@ class TaskServiceTest extends ProtectionApplicationTests {
// }
//
//
List<Task> tasks = taskService.queryTasks(null, null, null, null, null, null, null, null, null,null,null,null,null,1, 10);
assertEquals(10, tasks.size());
List<Task> tasks = taskService.queryTasks(null, null, null, null, null, null, null, null, "eee",null,null,null,null,1, 10);
assertEquals(1, tasks.size());
Integer tasksnum = taskService.queryTaskTotalNum(null, null, "", "", null, "", "", "", "上述",null,null,null,null);
System.out.println(tasksnum);
//
// tasks = taskService.queryTasks(0, null, null, null, null,null, null, null, null, 1, 10);
// assertEquals(10, tasks.size());