|
@@ -1,5 +1,6 @@
|
|
|
package com.jeeplus.human.enrollment.enrollmentRegistration.service;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.TypeReference;
|
|
@@ -17,6 +18,7 @@ import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentSoci
|
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentWageCard;
|
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.mapper.EnrollmentRegistrationMapper;
|
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.mapper.EnrollmentSocialSecurityCardMapper;
|
|
|
+import com.jeeplus.human.enrollment.enrollmentRegistration.mapper.EnrollmentWageCardMapper;
|
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
|
|
|
import com.jeeplus.human.practice.register.domain.Registration;
|
|
|
import com.jeeplus.sys.feign.IOfficeApi;
|
|
@@ -56,6 +58,9 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
@Resource
|
|
|
private EnrollmentKeyCardService keyCardService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private EnrollmentWageCardMapper wageCardMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 实习人员登记表信息
|
|
|
* @param page
|
|
@@ -465,6 +470,24 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
public EnrollmentRegistration findById(String id) throws Exception {
|
|
|
// 查询基础信息表
|
|
|
EnrollmentRegistration info = mapper.getById(id);
|
|
|
+ //根据用户查询岗位和角色信息
|
|
|
+ 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;
|
|
|
}
|
|
|
|
|
@@ -557,6 +580,24 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 修改工资卡信息
|
|
|
+ */
|
|
|
+ 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);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 修改用户信息
|
|
|
*/
|
|
|
EnrollmentRegistration registration = mapper.getById(reportData.getId());
|
|
@@ -577,32 +618,51 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
OfficeDTO officeDTO1 = new OfficeDTO();
|
|
|
officeDTO1.setId(officeDTO.getParent().getId());
|
|
|
dto1.setCompanyDTO(officeDTO1);
|
|
|
+ //角色和岗位信息
|
|
|
List <RoleDTO> roleIdList = new ArrayList<>();
|
|
|
-
|
|
|
- if (null != officeDTO) {
|
|
|
- Map<String,String> keyMap = new HashMap<>();
|
|
|
- TenantDTO tenantDTO = new TenantDTO();
|
|
|
- tenantDTO.setId(officeDTO.getTenantId());
|
|
|
- dto1.setTenantDTO(tenantDTO);
|
|
|
- if (officeDTO.getTenantId().equals("10003")){
|
|
|
- keyMap.put("name", "兴光会计员工,共有权限(会计)");
|
|
|
- keyMap.put("tenantId", officeDTO.getTenantId());
|
|
|
- roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
- }else if (officeDTO.getTenantId().equals("10004")) {
|
|
|
- keyMap.put("name", "中审员工,共有权限(中审)");
|
|
|
- keyMap.put("tenantId", officeDTO.getTenantId());
|
|
|
- roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
- }else if (officeDTO.getTenantId().equals("10001")) {
|
|
|
- keyMap.put("name", "评估员工,共有权限(评估)");
|
|
|
- keyMap.put("tenantId", officeDTO.getTenantId());
|
|
|
- roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
+ List <PostDTO> postDTOList = new ArrayList<>();
|
|
|
+ if (CollectionUtil.isNotEmpty(reportData.getPostIdList())){
|
|
|
+ for (String post : reportData.getPostIdList()) {
|
|
|
+ PostDTO postDTO = new PostDTO();
|
|
|
+ postDTO.setId(post);
|
|
|
+ postDTOList.add(postDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(reportData.getRoleIdList())){
|
|
|
+ for (String role : reportData.getRoleIdList()) {
|
|
|
+ RoleDTO roleDTO = SpringUtil.getBean(IRoleApi.class).getRoleDTOById(role);
|
|
|
+ roleIdList.add(roleDTO);
|
|
|
}
|
|
|
- } else {
|
|
|
- TenantDTO tenantDTO = new TenantDTO();
|
|
|
- tenantDTO.setId("10002");
|
|
|
- dto1.setTenantDTO(tenantDTO);
|
|
|
}
|
|
|
+ //所属租户
|
|
|
+ TenantDTO tenantDTO = new TenantDTO();
|
|
|
+ tenantDTO.setId(officeDTO.getTenantId());
|
|
|
+ dto1.setTenantDTO(tenantDTO);
|
|
|
+// if (null != officeDTO) {
|
|
|
+// Map<String,String> keyMap = new HashMap<>();
|
|
|
+// TenantDTO tenantDTO = new TenantDTO();
|
|
|
+// tenantDTO.setId(officeDTO.getTenantId());
|
|
|
+// dto1.setTenantDTO(tenantDTO);
|
|
|
+// if (officeDTO.getTenantId().equals("10003")){
|
|
|
+// keyMap.put("name", "兴光会计员工,共有权限(会计)");
|
|
|
+// keyMap.put("tenantId", officeDTO.getTenantId());
|
|
|
+// roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
+// }else if (officeDTO.getTenantId().equals("10004")) {
|
|
|
+// keyMap.put("name", "中审员工,共有权限(中审)");
|
|
|
+// keyMap.put("tenantId", officeDTO.getTenantId());
|
|
|
+// roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
+// }else if (officeDTO.getTenantId().equals("10001")) {
|
|
|
+// keyMap.put("name", "评估员工,共有权限(评估)");
|
|
|
+// keyMap.put("tenantId", officeDTO.getTenantId());
|
|
|
+// roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// TenantDTO tenantDTO = new TenantDTO();
|
|
|
+// tenantDTO.setId("10002");
|
|
|
+// dto1.setTenantDTO(tenantDTO);
|
|
|
+// }
|
|
|
dto1.setRoleDTOList(roleIdList);
|
|
|
+ dto1.setPostDTOList(postDTOList);
|
|
|
SpringUtil.getBean ( IUserApi.class ).saveOrUpdate(dto1);
|
|
|
|
|
|
|