Browse Source

修复更换区域主管,消息推送错误问题

wanghaicheng 5 years ago
parent
commit
6c1cf0f49e

+ 4 - 4
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/region/service/impl/RegionServiceImpl.java

@@ -154,12 +154,12 @@ public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> impleme
         //添加新老区域主管
         userInfos.add(pushUserService.listByUserId(byId.getMtCompanyId(), byId.getUserId()));
         userInfos.add(pushUserService.listByUserId(byId.getMtCompanyId(), region.getUserId()));
-        String[] stringIds = byId.getClerk().replace(" ", "").split(",");
+        String[] clerkIds = byId.getClerk().replace(" ", "").split(",");
         List<PushUserInfo> clerks = new ArrayList<>();
-        if (stringIds.length > 0) {
+        if (clerkIds.length > 0 && !"".equals(clerkIds[0])) {
             List<Long> ids = new ArrayList<>();
-            for (String stringId : stringIds) {
-                ids.add(Long.valueOf(stringId));
+            for (String clerkId : clerkIds) {
+                ids.add(Long.valueOf(clerkId));
             }
             clerks = pushUserService.listByUserIds(byId.getMtCompanyId(), ids);
         }