Browse Source

fix:“优化报警短信字数,设备列表添加分组搜索“

soobin 1 year ago
parent
commit
a1f6672109

+ 4 - 4
src/main/java/com/szwl/controller/AlarmRecordIndexController.java

@@ -110,14 +110,14 @@ public class AlarmRecordIndexController {
                     String[] split = messageReceiver.split(",");
                     for (int i = 0; i < split.length; i++) {
                         if (StringUtils.isNotEmpty(split[i])) {
-                            Long id = alarmRecord.getId();
-                            String mess = ";序号:"+String.valueOf(id);
+//                            Long id = alarmRecord.getId();
+//                            String mess = ";序号:"+String.valueOf(id);
                             if (StringUtils.isNotEmpty(companyType) && companyType.equals("1")) {
                                 // 如果是七云科技的用户
-                                result = YunPianSms.sendSms(appid, getSCMessage(alarmContent, name, clientId), split[i]);
+                                result = YunPianSms.sendSms(appid, getSCMessage(alarmContent, name, clientId.substring(clientId.length() - 6)), split[i]);
                             } else {
                                 // 如果是申泽智能的用户
-                                result = YunPianSms.sendSms(appid, getMessage(alarmContent+mess, name, clientId), split[i]);
+                                result = YunPianSms.sendSms(appid, getMessage(alarmContent, name, clientId.substring(clientId.length() - 6)), split[i]);
                             }
                         }
                     }

+ 12 - 1
src/main/java/com/szwl/controller/TEquipmentController.java

@@ -101,6 +101,9 @@ public class TEquipmentController {
     @Autowired
     TDiyFlowerService tDiyFlowerService;
 
+    @Autowired
+    TLabelService labelService;
+
     TokenManager tokenManager;
 
     private int j;
@@ -150,7 +153,7 @@ public class TEquipmentController {
     @PostMapping("/findList")
     public ResponseModel<IPage<?>> findList(Long id, String clientId, String adminName, String equipmentName,
                                             String areaName, String eqeStatus, String machineType, String equimentType,
-                                            String channel, String companyType, String todayDate, long current, long size) {
+                                            String channel, String companyType, String labelId, String todayDate, long current, long size) {
 
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
         TAdmin admin = tAdminService.getById(id);
@@ -219,6 +222,14 @@ public class TEquipmentController {
                 query.eq(TEquipment::getCompanyType, companyType);
             }
         }
+        // 分组ID
+        if (StringUtils.isNotEmpty(labelId)) {
+            TLabel label = labelService.getById(labelId);
+            String equipmentIds = label.getEquipmentIds();
+            equipmentIds = equipmentIds.replace("\"", "").replace("[","").replace("]","");
+            String[] split = equipmentIds.split(",");
+            query.in(TEquipment::getId, split);
+        }
         query.orderByDesc(TEquipment::getCreateDate);
         Page<TEquipment> page = new Page<>(current, size, true);
         IPage<TEquipment> iPage = tEquipmentService.page(page, query);

+ 1 - 1
src/main/java/com/szwl/service/impl/SysRoleServiceImpl.java

@@ -65,7 +65,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
         query.eq(SysRole::getAdminId, adminId);
         int count = this.count(query);
         if(count>0){
-            throw new BizException(ResponseCodesEnum.B0002,"角色名称已存在");
+            throw new BizException(ResponseCodesEnum.A0500);
         }
     }