diff --git a/functional-modules/xj-anyan-api/src/main/java/com/renkang/anyan/model/dto/EmergencyContactParam.java b/functional-modules/xj-anyan-api/src/main/java/com/renkang/anyan/model/dto/EmergencyContactParam.java index ae7e607..0cbc8f5 100644 --- a/functional-modules/xj-anyan-api/src/main/java/com/renkang/anyan/model/dto/EmergencyContactParam.java +++ b/functional-modules/xj-anyan-api/src/main/java/com/renkang/anyan/model/dto/EmergencyContactParam.java @@ -11,6 +11,11 @@ public class EmergencyContactParam { */ @Schema(title = "员工ID") private String emId; + /** + * 工号 + */ + @Schema(title = "工号") + private String employeeNum; /** * 身份证号 */ diff --git a/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/LoginAnYanServiceImpl.java b/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/LoginAnYanServiceImpl.java index 3b56529..1a7c4cd 100644 --- a/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/LoginAnYanServiceImpl.java +++ b/jeecg-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/LoginAnYanServiceImpl.java @@ -5,10 +5,13 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.renkang.anyan.client.AnYanClient; +import com.renkang.anyan.model.dto.EmergencyContactParam; import com.renkang.anyan.model.vo.AnYanUserEmployee; import com.renkang.anyan.model.vo.AnYanUserInfoResult; import com.renkang.anyan.model.vo.AuthResult; +import com.renkang.anyan.model.vo.EmergencyContactVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -407,6 +410,21 @@ public class LoginAnYanServiceImpl implements ILoginAnYanService { .eq(SysUser::getId, userId) .set(StringUtils.isNotBlank(anYanUserEmployee.getBirthday()), SysUser::getBirthday, anYanUserEmployee.getBirthday()) ); + EmergencyContactParam param = new EmergencyContactParam(); + param.setEmployeeNum(workNo); + IPage emergencyContactVOIPage = anYanClient.queryEmergencyContact(param); + if (emergencyContactVOIPage != null && emergencyContactVOIPage.getRecords() != null && !emergencyContactVOIPage.getRecords().isEmpty()) { + for (EmergencyContactVO emergencyContactVO : emergencyContactVOIPage.getRecords()) { + healthUserEmployeeExService.update(new LambdaUpdateWrapper() + .eq(HealthUserEmployeeEx::getId, userId) + .set(StringUtils.isNotBlank(emergencyContactVO.getRelationEmpName()), HealthUserEmployeeEx::getCareLiaisonName, emergencyContactVO.getRelationEmpName()) + .set(StringUtils.isNotBlank(emergencyContactVO.getRelationEmpPostsText()), HealthUserEmployeeEx::getCareLiaisonJob, emergencyContactVO.getRelationEmpPostsText()) + .set(StringUtils.isNotBlank(emergencyContactVO.getRelationEmpPhone()), HealthUserEmployeeEx::getCareLiaisonPhone, emergencyContactVO.getRelationEmpPhone()) + .set(StringUtils.isNotBlank(emergencyContactVO.getFirstAiderName()), HealthUserEmployeeEx::getLifeguardName, emergencyContactVO.getFirstAiderName()) + .set(StringUtils.isNotBlank(emergencyContactVO.getFirstAiderPhone()), HealthUserEmployeeEx::getLifeguardPhone, emergencyContactVO.getFirstAiderPhone()) + ); + } + } } catch (Exception e) { log.error("更新员工其他信息异常,userId={}, workNo={}", userId, workNo, e); }