diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java index cbe7991..a7f1130 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java @@ -16,6 +16,7 @@ import com.ningdatech.pmapi.user.constant.UserAvailableEnum; import com.ningdatech.pmapi.user.entity.UserInfo; import com.ningdatech.pmapi.user.service.IUserInfoService; import com.ningdatech.zwdd.ZwddIntegrationProperties; +import com.ningdatech.zwdd.client.ZwddAuthClient; import com.ningdatech.zwdd.client.ZwddClient; import com.ningdatech.zwdd.model.Page; import com.ningdatech.zwdd.model.dto.EmployeeAccountIdDTO; @@ -52,6 +53,9 @@ public class EmployeeBatchGetTask { private ZwddClient zwddClient; @Autowired + private ZwddAuthClient zwddAuthClient; + + @Autowired private IDingOrganizationService iDingOrganizationService; @Autowired @@ -420,13 +424,19 @@ public class EmployeeBatchGetTask { * @param empCode */ public void getEmployeeByCode(String empCode) { - GenericResult result = zwddClient.getEmployeeByCode(empCode); + GenericResult result = zwddAuthClient.getEmployeeByCode(empCode); log.error("请求员工信息 result:{}",JSON.toJSONString(result)); if(!result.isSuccess()){ log.error("请求员工信息失败 :{},mesg:{}",empCode,result.getMsg()); + return; } EmployeeInfoDTO data = result.getData(); + if(Objects.isNull(data)){ + log.error("请求员工信息失败 返回为空"); + return; + } + DingEmployeeInfo emp = iDingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class) .eq(DingEmployeeInfo::getEmployeeCode, empCode) .last(BizConst.LIMIT_1));