【安眼】用户信息同步
This commit is contained in:
+18
@@ -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<EmergencyContactVO> emergencyContactVOIPage = anYanClient.queryEmergencyContact(param);
|
||||
if (emergencyContactVOIPage != null && emergencyContactVOIPage.getRecords() != null && !emergencyContactVOIPage.getRecords().isEmpty()) {
|
||||
for (EmergencyContactVO emergencyContactVO : emergencyContactVOIPage.getRecords()) {
|
||||
healthUserEmployeeExService.update(new LambdaUpdateWrapper<HealthUserEmployeeEx>()
|
||||
.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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user