Selaa lähdekoodia

【增加按手机号同步刷新接口-人员判空&新增日志输出语句】

wuyx 3 päivää sitten
vanhempi
commit
2317783385

+ 13 - 6
uas-office-qywx/src/main/java/com/usoftchina/uas/office/qywx/service/UasEmployeeService.java

@@ -569,12 +569,19 @@ public class UasEmployeeService extends AbstractService {
             }
         }
         if(!employeeList.isEmpty()) {
-            List<GetUserOpenIDListResp.OpenUser> userList = addrBookSdk.convert_openUserId(employeeList.stream().filter(emp->StringUtils.hasText(emp.getEm_plainqywx())).map(Employee::getEm_plainqywx).collect(Collectors.toList())).getOpen_userid_list();
-            for (GetUserOpenIDListResp.OpenUser openUser : userList) {
-                Employee employee = employeeList.stream().filter(emp->StringUtils.hasText(emp.getEm_plainqywx())&&emp.getEm_plainqywx().equals(openUser.getUserid())).findFirst().orElse(null);
-                if(employee!= null){
-                    employee.setEm_qywx(openUser.getOpen_userid());
-                    setQywxWithPlain(employee);
+            List<String> openUserIdList = employeeList.stream().filter(emp->StringUtils.hasText(emp.getEm_plainqywx())).map(Employee::getEm_plainqywx).collect(Collectors.toList());
+            if(!CollectionUtils.isEmpty(openUserIdList)){
+                List<GetUserOpenIDListResp.OpenUser> userList = addrBookSdk.convert_openUserId(openUserIdList).getOpen_userid_list();
+                logger.info("convert_openUserId userList-size:{} ",userList.size());
+                for (GetUserOpenIDListResp.OpenUser openUser : userList) {
+                    if(StringUtils.hasText(mobile)){
+                        logger.info("convert_openUserId user:{} ",openUser.toString());
+                    }
+                    Employee employee = employeeList.stream().filter(emp->StringUtils.hasText(emp.getEm_plainqywx())&&emp.getEm_plainqywx().equals(openUser.getUserid())).findFirst().orElse(null);
+                    if(employee!= null){
+                        employee.setEm_qywx(openUser.getOpen_userid());
+                        setQywxWithPlain(employee);
+                    }
                 }
             }
         }