|
@@ -19,6 +19,7 @@ import com.ningdatech.zwdd.ZwddIntegrationProperties; |
|
|
import com.ningdatech.zwdd.client.ZwddClient; |
|
|
import com.ningdatech.zwdd.client.ZwddClient; |
|
|
import com.ningdatech.zwdd.model.Page; |
|
|
import com.ningdatech.zwdd.model.Page; |
|
|
import com.ningdatech.zwdd.model.dto.EmployeeAccountIdDTO; |
|
|
import com.ningdatech.zwdd.model.dto.EmployeeAccountIdDTO; |
|
|
|
|
|
import com.ningdatech.zwdd.model.dto.EmployeeInfoDTO; |
|
|
import com.ningdatech.zwdd.model.query.PageOrganizationEmployeePositionsQuery; |
|
|
import com.ningdatech.zwdd.model.query.PageOrganizationEmployeePositionsQuery; |
|
|
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition; |
|
|
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition; |
|
|
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition.GovEmployeePosition; |
|
|
import com.ningdatech.zwdd.model.response.OrganizationEmployeePosition.GovEmployeePosition; |
|
@@ -245,6 +246,7 @@ public class EmployeeBatchGetTask { |
|
|
.createOn(LocalDateTime.now()) |
|
|
.createOn(LocalDateTime.now()) |
|
|
.updateOn(LocalDateTime.now()) |
|
|
.updateOn(LocalDateTime.now()) |
|
|
.empPosUnitCode(dingEmployeeInfo.getEmpPosUnitCode()) |
|
|
.empPosUnitCode(dingEmployeeInfo.getEmpPosUnitCode()) |
|
|
|
|
|
.avatar(dingEmployeeInfo.getAvatar()) |
|
|
.build(); |
|
|
.build(); |
|
|
if(StringUtils.isNotBlank(userInfo.getEmpPosUnitCode()) && organizationMap.containsKey(userInfo.getEmpPosUnitCode())){ |
|
|
if(StringUtils.isNotBlank(userInfo.getEmpPosUnitCode()) && organizationMap.containsKey(userInfo.getEmpPosUnitCode())){ |
|
|
DingOrganization dingOrganization = organizationMap.get(userInfo.getEmpPosUnitCode()); |
|
|
DingOrganization dingOrganization = organizationMap.get(userInfo.getEmpPosUnitCode()); |
|
@@ -252,6 +254,10 @@ public class EmployeeBatchGetTask { |
|
|
userInfo.setRegionCode(dingOrganization.getDivisionCode()); |
|
|
userInfo.setRegionCode(dingOrganization.getDivisionCode()); |
|
|
} |
|
|
} |
|
|
iUserInfoService.save(userInfo); |
|
|
iUserInfoService.save(userInfo); |
|
|
|
|
|
}else{ |
|
|
|
|
|
userInfo.setAvatar(dingEmployeeInfo.getAvatar()); |
|
|
|
|
|
userInfo.setUpdateOn(LocalDateTime.now()); |
|
|
|
|
|
iUserInfoService.updateById(userInfo); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -409,4 +415,48 @@ public class EmployeeBatchGetTask { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 更新员工信息 主要是头像 |
|
|
|
|
|
* @param empCode |
|
|
|
|
|
*/ |
|
|
|
|
|
public void getEmployeeByCode(String empCode) { |
|
|
|
|
|
GenericResult<EmployeeInfoDTO> result = zwddClient.getEmployeeByCode(empCode); |
|
|
|
|
|
log.error("请求员工信息 result:{}",JSON.toJSONString(result)); |
|
|
|
|
|
if(!result.isSuccess()){ |
|
|
|
|
|
log.error("请求员工信息失败 :{},mesg:{}",empCode,result.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
EmployeeInfoDTO data = result.getData(); |
|
|
|
|
|
|
|
|
|
|
|
DingEmployeeInfo emp = iDingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
|
|
|
.eq(DingEmployeeInfo::getEmployeeCode, empCode) |
|
|
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
|
|
|
|
|
|
|
|
if(Objects.nonNull(emp)){ |
|
|
|
|
|
emp.setAvatar(data.getGovEmpAvatar()); |
|
|
|
|
|
iDingEmployeeInfoService.updateById(emp); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UserInfo user = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
|
|
.eq(UserInfo::getEmployeeCode, empCode) |
|
|
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
|
|
|
|
|
|
|
|
if(Objects.nonNull(user)){ |
|
|
|
|
|
user.setAvatar(data.getGovEmpAvatar()); |
|
|
|
|
|
iUserInfoService.updateById(user); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 更新一整个单位的 |
|
|
|
|
|
* @param orgCode |
|
|
|
|
|
*/ |
|
|
|
|
|
public void getBatchEmployeeByCode(String orgCode) { |
|
|
|
|
|
|
|
|
|
|
|
List<DingEmployeeInfo> employees = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
|
|
|
.eq(DingEmployeeInfo::getEmpPosUnitCode, orgCode)); |
|
|
|
|
|
|
|
|
|
|
|
for(DingEmployeeInfo employee : employees){ |
|
|
|
|
|
getEmployeeByCode(employee.getEmployeeCode()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |