Browse Source

Merge remote-tracking branch 'origin/v2.2.0' into v2.2.0

xujiaheng 3 years ago
parent
commit
41b139f142

+ 1 - 1
src/main/java/com/persagy/apm/alarmservice/group/alarmrecord/controller/AlarmCommnetController.java

@@ -41,7 +41,7 @@ import java.util.stream.Collectors;
 @Validated
 @RestController
 @RequestMapping("alarm_comments")
-public class AlarmCommnetController {
+public class AlarmCommentController {
     @Autowired
     AlarmCommentServiceImpl alarmCommentService;
     @Autowired

+ 1 - 15
src/main/java/com/persagy/apm/alarmservice/group/alarmrecord/controller/AlarmRecordController.java

@@ -185,17 +185,6 @@ public class AlarmRecordController {
         return queryAlarmRecord(pageQueryAlarmRecordDTO);
     }
 
-    @ApiOperation(value = "已忽略报警列表")
-    @PostMapping("/ignored_list")
-    public CommonResult<PageList<AlarmRecordListItem>> queryIgnoredAlarmRecord(
-            @Valid @RequestBody PageQueryAlarmRecordDTO pageQueryAlarmRecordDTO) throws Exception {
-        // 历史报警的默认查询条件为:报警处理状态为已忽略
-        pageQueryAlarmRecordDTO.setAlarmTreatState(Lists.newArrayList(
-                EnumAlarmTreatState.IGNORE.getType()
-        ));
-        return queryAlarmRecord(pageQueryAlarmRecordDTO);
-    }
-
     @ApiOperation(value = "关闭报警")
     @PostMapping("/close")
     public CommonResult<AlarmRecordIdsItem> closeAlarmRecord(
@@ -267,7 +256,7 @@ public class AlarmRecordController {
             @Valid @RequestBody IgnoreAlarmRecordDTO ignoreAlarmRecordDTO) throws Exception {
         // 报警处理方式更新为忽略,报警状态更新为已忽略
         String treatMode = EnumAlarmTreatMode.IGNORE.getType();
-        String treatState = EnumAlarmTreatState.IGNORE.getType();
+        String treatState = EnumAlarmTreatState.DONE.getType();
         List<String> recordIds = ignoreAlarmRecordDTO.getIds();
 
         return updateAlarmRecordTreatState(treatMode, treatState,null,null, recordIds);
@@ -299,9 +288,6 @@ public class AlarmRecordController {
         if (listType.equals(EnumDownloadAlarmListType.HISTORY.getType())) {
             result = queryHistoryAlarmRecord(pageQueryAlarmRecordDTO);
         }
-        if (listType.equals(EnumDownloadAlarmListType.IGNORE.getType())) {
-            result = queryIgnoredAlarmRecord(pageQueryAlarmRecordDTO);
-        }
 
         List<AlarmRecordListItem> alarmRecordItemList = new ArrayList<>();
         if (result != null) {

+ 3 - 3
src/main/java/com/persagy/apm/alarmservice/group/alarmrecord/enums/EnumAlarmTreatState.java

@@ -18,9 +18,9 @@ public enum EnumAlarmTreatState {
      */
     UN_HANDLE("1", "未处理"),
     HANDLING("2", "处理中"),
-    DONE("3", "处理完成"),
-    // 用于兼容子系统业务,后期会移除该状态
-    IGNORE("4", "已忽略");
+    DONE("3", "处理完成");
+//    // 用于兼容子系统业务,后期会移除该状态
+//    IGNORE("4", "已忽略");
 
     @Setter
     @Getter

+ 5 - 3
src/main/java/com/persagy/apm/alarmservice/group/alarmrule/controller/PressureMeasurementController.java

@@ -37,9 +37,11 @@ public class PressureMeasurementController {
     public void createAlarmProject() {
         try {
             List<ProjectVO> projects = projectAlarmRuleService.getProject();
-            if (projects.size() < 200){
+            // 压测需要的项目总数
+            int projectCount = 400;
+            if (projects.size() < projectCount){
                 StringBuffer sb = new StringBuffer();
-                for (int i = projects.size(); i < 210; i++) {
+                for (int i = projects.size(); i < projectCount; i++) {
                    int num = 1000+i;
                    String projectId = "Pm202112"+num;
                    String projectName = projectId+"广场";
@@ -47,7 +49,7 @@ public class PressureMeasurementController {
                     sb.append("'"+num+"',");
                     sb.append("'"+projectId+"',");
                     sb.append("'"+projectName+"',");
-                    sb.append("'WD'");
+                    sb.append("'YL'");
                     sb.append("),");
                 }
                 String substring = sb.substring(0, sb.length() - 1);

+ 3 - 1
src/main/java/com/persagy/apm/alarmservice/project/alarmrule/service/impl/ProjectAlarmRuleServiceImpl.java

@@ -594,7 +594,9 @@ public class ProjectAlarmRuleServiceImpl extends ServiceImpl<ProjectAlarmRuleMap
             queryEquipDTO.setClassCode(classCode);
             queryEquipDTO.setCondition(condition);
             List<EquipItem> records = groupManagementService.getEquipList(queryEquipDTO);
-            for (int i = 100; i < 1500; i++) {
+            // 压测模拟的设备数量
+            int equipCount = 2000;
+            for (int i = 100; i < equipCount; i++) {
                 String objId = i+"-"+UUID.randomUUID().toString().replace("-","");
                 AddProjectAlarmRuleObjRelDTO addProjectAlarmRuleObjRelDTO = new AddProjectAlarmRuleObjRelDTO();
                 addProjectAlarmRuleObjRelDTO.setProjectAlarmRuleId(projectAlarmRule.getId());