|
@@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.jeeplus.common.SecurityUtils;
|
|
import com.jeeplus.common.SecurityUtils;
|
|
import com.jeeplus.common.TokenProvider;
|
|
import com.jeeplus.common.TokenProvider;
|
|
|
|
+import com.jeeplus.common.constant.CacheNames;
|
|
|
|
+import com.jeeplus.common.redis.RedisUtils;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.service.EnrollmentRegistrationService;
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.service.EnrollmentRegistrationService;
|
|
@@ -27,6 +29,7 @@ import com.jeeplus.sys.feign.*;
|
|
import com.jeeplus.sys.service.dto.*;
|
|
import com.jeeplus.sys.service.dto.*;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -60,6 +63,9 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
|
|
@Resource
|
|
@Resource
|
|
private EnrollmentRegistrationService enrollmentRegistrationService;
|
|
private EnrollmentRegistrationService enrollmentRegistrationService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private RedisUtils redisUtils;
|
|
|
|
+
|
|
public Integer findIdCardOnly(String idCard) throws Exception {
|
|
public Integer findIdCardOnly(String idCard) throws Exception {
|
|
QueryWrapper<Registration> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<Registration> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("id_card", idCard);
|
|
queryWrapper.eq("id_card", idCard);
|
|
@@ -88,12 +94,19 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
|
|
}
|
|
}
|
|
|
|
|
|
public String remove(String id) {
|
|
public String remove(String id) {
|
|
|
|
+ //根据手机号获取用户
|
|
|
|
+ Registration registration = mapper.getById(id);
|
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByMobile(registration.getMobilePhone());
|
|
|
|
+ if (userDTO != null){
|
|
|
|
+ SpringUtil.getBean(IUserApi.class).deleteById(userDTO.getId());
|
|
|
|
+ }
|
|
//删除实习经验表的数据
|
|
//删除实习经验表的数据
|
|
experienceMapper.deleteByRegisterId(id);
|
|
experienceMapper.deleteByRegisterId(id);
|
|
//删除家庭成员表的数据
|
|
//删除家庭成员表的数据
|
|
familyMembersMapper.deleteByRegisterId(id);
|
|
familyMembersMapper.deleteByRegisterId(id);
|
|
// 删除基础信息表
|
|
// 删除基础信息表
|
|
mapper.removeById(id);
|
|
mapper.removeById(id);
|
|
|
|
+
|
|
return "操作成功";
|
|
return "操作成功";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -566,6 +579,54 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
|
|
});
|
|
});
|
|
}
|
|
}
|
|
mapper.updateById(report);
|
|
mapper.updateById(report);
|
|
|
|
+
|
|
|
|
+ //根据用户手机号查询出用户信息
|
|
|
|
+ UserDTO userInfo = SpringUtil.getBean(IUserApi.class).getByMobile(report.getMobilePhone());
|
|
|
|
+ if (userInfo != null){
|
|
|
|
+ //往用户表中新增一条数据
|
|
|
|
+ UserDTO dto = new UserDTO();
|
|
|
|
+ dto.setId(userInfo.getId());
|
|
|
|
+ dto.setName(report.getName());
|
|
|
|
+ dto.setLoginName(report.getName());
|
|
|
|
+ dto.setMobile(report.getMobilePhone());
|
|
|
|
+ dto.setNo(report.getMobilePhone());
|
|
|
|
+ dto.setPhoto("");
|
|
|
|
+ //根据实习部门获取部门信息
|
|
|
|
+ OfficeDTO officeDTO = SpringUtil.getBean(IOfficeApi.class).getOfficeById(report.getPracticeOffice());
|
|
|
|
+ dto.setOfficeDTO(officeDTO);
|
|
|
|
+ OfficeDTO officeDTO1 = new OfficeDTO();
|
|
|
|
+ officeDTO1.setId(officeDTO.getParent().getId());
|
|
|
|
+ dto.setCompanyDTO(officeDTO1);
|
|
|
|
+ List <RoleDTO> roleIdList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ if (null != officeDTO) {
|
|
|
|
+ Map<String,String> keyMap = new HashMap<>();
|
|
|
|
+ TenantDTO tenantDTO = new TenantDTO();
|
|
|
|
+ tenantDTO.setId(officeDTO.getTenantId());
|
|
|
|
+ dto.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");
|
|
|
|
+ dto.setTenantDTO(tenantDTO);
|
|
|
|
+ }
|
|
|
|
+ dto.setRoleDTOList(roleIdList);
|
|
|
|
+ SpringUtil.getBean ( IUserApi.class ).saveOrUpdate(dto);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -621,6 +682,50 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
|
|
});
|
|
});
|
|
}
|
|
}
|
|
mapper.insert(report);
|
|
mapper.insert(report);
|
|
|
|
+
|
|
|
|
+ //往用户表中新增一条数据
|
|
|
|
+ UserDTO dto = new UserDTO();
|
|
|
|
+ dto.setId(SnowFlake.getId());
|
|
|
|
+ dto.setName(report.getName());
|
|
|
|
+ dto.setPassword(SecurityUtils.encryptPassword("123456"));
|
|
|
|
+ dto.setLoginName(report.getName());
|
|
|
|
+ dto.setLoginFlag("1");
|
|
|
|
+ dto.setMobile(report.getMobilePhone());
|
|
|
|
+ dto.setNo(report.getMobilePhone());
|
|
|
|
+ dto.setPhoto("");
|
|
|
|
+ //根据实习部门获取部门信息
|
|
|
|
+ OfficeDTO officeDTO = SpringUtil.getBean(IOfficeApi.class).getOfficeById(report.getPracticeOffice());
|
|
|
|
+ dto.setOfficeDTO(officeDTO);
|
|
|
|
+ OfficeDTO officeDTO1 = new OfficeDTO();
|
|
|
|
+ officeDTO1.setId(officeDTO.getParent().getId());
|
|
|
|
+ dto.setCompanyDTO(officeDTO1);
|
|
|
|
+ List <RoleDTO> roleIdList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ if (null != officeDTO) {
|
|
|
|
+ Map<String,String> keyMap = new HashMap<>();
|
|
|
|
+ TenantDTO tenantDTO = new TenantDTO();
|
|
|
|
+ tenantDTO.setId(officeDTO.getTenantId());
|
|
|
|
+ dto.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");
|
|
|
|
+ dto.setTenantDTO(tenantDTO);
|
|
|
|
+ }
|
|
|
|
+ dto.setRoleDTOList(roleIdList);
|
|
|
|
+ SpringUtil.getBean ( IUserApi.class ).saveOrUpdate(dto);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|