|
@@ -5,8 +5,10 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
|
|
@@ -634,6 +636,33 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
return integer;
|
|
|
}
|
|
|
|
|
|
+ public EnrollmentRegistration findInfoByUserId(String id) throws Exception {
|
|
|
+ // 查询基础信息表
|
|
|
+ EnrollmentRegistration info = mapper.getInfoByUserId(id);
|
|
|
+ //根据用户查询岗位和角色信息
|
|
|
+ if (ObjectUtil.isNotEmpty(info)) {
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(info.getUserId());
|
|
|
+ ArrayList<String> roles = new ArrayList<>();
|
|
|
+ ArrayList<String> posts = new ArrayList<>();
|
|
|
+ if (userDTO != null) {
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
|
|
|
+ for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
|
|
|
+ roles.add(roleDTO.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())) {
|
|
|
+ for (PostDTO postDTO : userDTO.getPostDTOList()) {
|
|
|
+ posts.add(postDTO.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ info.setRoleIdList(roles);
|
|
|
+ info.setPostIdList(posts);
|
|
|
+ }
|
|
|
+
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
public void updateStatusById(EnrollmentRegistration dto) {
|
|
|
EnrollmentRegistration registration = mapper.getById(dto.getId());
|
|
|
mapper.updateStatusById(dto.getId(), dto.getType());
|
|
@@ -754,6 +783,10 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
mapper.updateById(report);
|
|
|
|
|
|
if (StringUtils.isNotBlank(report.getSocialSecurityNumber())) {
|
|
|
+ LambdaQueryWrapper<EnrollmentSocialSecurityCard> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(EnrollmentSocialSecurityCard::getEnrollmentRegistrationId, report.getId())
|
|
|
+ .eq(EnrollmentSocialSecurityCard::getDelFlag, "0"); // 加上有效标志条件(如果有)
|
|
|
+ EnrollmentSocialSecurityCard existing = securityCardService.getOne(queryWrapper);
|
|
|
EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
|
|
|
String amountId = SnowFlake.getId();
|
|
|
securityCard.setId(amountId);
|
|
@@ -766,13 +799,38 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
securityCard.setSocialSecurityPictureFront(report.getSocialSecurityPictureFront());
|
|
|
securityCard.setSocialSecurityPictureOpposite(report.getSocialSecurityPictureOpposite());
|
|
|
securityCard.setEnrollmentRegistrationId(report.getId());
|
|
|
-
|
|
|
- socialSecurityCardMapper.insert(securityCard);
|
|
|
+ if (existing != null) {
|
|
|
+ securityCard.setId(existing.getId());
|
|
|
+ securityCardService.updateById(securityCard);
|
|
|
+ } else {
|
|
|
+ // 不存在,走 insert
|
|
|
+ securityCardService.save(securityCard);
|
|
|
+ }
|
|
|
+ //socialSecurityCardMapper.insert(securityCard);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 修改工资卡信息
|
|
|
*/
|
|
|
+ //EnrollmentWageCard wageCard = new EnrollmentWageCard();
|
|
|
+ //wageCard.setEnrollmentRegistrationId(report.getId());
|
|
|
+ //wageCard.setId(report.getWageCardId());
|
|
|
+ //wageCard.setAccountHolderFront(report.getAccountHolderFront());
|
|
|
+ //wageCard.setAccountHolderOpposite(report.getAccountHolderOpposite());
|
|
|
+ //wageCard.setZxAccountHolder(report.getZxAccountHolder());
|
|
|
+ //wageCard.setGsAccountHolder(report.getGsAccountHolder());
|
|
|
+ //wageCard.setGsAccountHolderFront(report.getGsAccountHolderFront());
|
|
|
+ //wageCard.setGsAccountHolderOpposite(report.getGsAccountHolderOpposite());
|
|
|
+ //wageCard.setZxBankCardNumber(report.getZxBankCardNumber());
|
|
|
+ //wageCard.setGsBankCardNumber(report.getGsBankCardNumber());
|
|
|
+ //wageCardService.saveOrUpdate(wageCard);
|
|
|
+
|
|
|
+
|
|
|
+ //// 先根据 reg_id 查找是否已存在
|
|
|
+ LambdaQueryWrapper<EnrollmentWageCard> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(EnrollmentWageCard::getEnrollmentRegistrationId, report.getId())
|
|
|
+ .eq(EnrollmentWageCard::getDelFlag, "0"); // 加上有效标志条件(如果有)
|
|
|
+ EnrollmentWageCard existing = wageCardService.getOne(queryWrapper);
|
|
|
EnrollmentWageCard wageCard = new EnrollmentWageCard();
|
|
|
wageCard.setEnrollmentRegistrationId(report.getId());
|
|
|
wageCard.setId(report.getWageCardId());
|
|
@@ -784,8 +842,13 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
wageCard.setGsAccountHolderOpposite(report.getGsAccountHolderOpposite());
|
|
|
wageCard.setZxBankCardNumber(report.getZxBankCardNumber());
|
|
|
wageCard.setGsBankCardNumber(report.getGsBankCardNumber());
|
|
|
- wageCardService.saveOrUpdate(wageCard);
|
|
|
-
|
|
|
+ if (existing != null) {
|
|
|
+ wageCard.setId(existing.getId());
|
|
|
+ wageCardService.updateById(wageCard);
|
|
|
+ } else {
|
|
|
+ // 不存在,走 insert
|
|
|
+ wageCardService.save(wageCard);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 修改用户信息
|