|
@@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
|
|
|
+import com.dingtalk.api.response.OapiV2UserCreateResponse;
|
|
|
+import com.dingtalk.api.response.OapiV2UserGetResponse;
|
|
|
import com.jeeplus.common.SecurityUtils;
|
|
|
import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
@@ -20,13 +23,18 @@ import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentWage
|
|
|
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.service.dto.DingTalkUserDTO;
|
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.service.dto.ExportDTO;
|
|
|
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.DingTalkUtils;
|
|
|
import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
|
|
|
+import com.jeeplus.sys.domain.User;
|
|
|
import com.jeeplus.sys.feign.IOfficeApi;
|
|
|
import com.jeeplus.sys.feign.IPostApi;
|
|
|
import com.jeeplus.sys.feign.IRoleApi;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.service.dto.*;
|
|
|
+import com.jeeplus.sys.utils.DictUtils;
|
|
|
+import com.taobao.api.ApiException;
|
|
|
import javafx.geometry.Pos;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -65,27 +73,31 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
@Resource
|
|
|
private EnrollmentWageCardMapper wageCardMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private DingTalkUtils dingTalkUtils;
|
|
|
+
|
|
|
/**
|
|
|
* 实习人员登记表信息
|
|
|
+ *
|
|
|
* @param page
|
|
|
* @param projectReportData
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public IPage<EnrollmentRegistration> findList(Page<EnrollmentRegistration> page, EnrollmentRegistration projectReportData) throws Exception{
|
|
|
- QueryWrapper<EnrollmentRegistration> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,EnrollmentRegistration.class);
|
|
|
- queryWrapper.eq("a.del_flag","0");
|
|
|
+ public IPage<EnrollmentRegistration> findList(Page<EnrollmentRegistration> page, EnrollmentRegistration projectReportData) throws Exception {
|
|
|
+ QueryWrapper<EnrollmentRegistration> queryWrapper = QueryWrapperGenerator.buildQueryCondition(projectReportData, EnrollmentRegistration.class);
|
|
|
+ queryWrapper.eq("a.del_flag", "0");
|
|
|
if (StringUtils.isNotBlank(projectReportData.getMobilePhone())) {
|
|
|
- queryWrapper.like("a.mobile_phone",projectReportData.getMobilePhone());
|
|
|
+ queryWrapper.like("a.mobile_phone", projectReportData.getMobilePhone());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getName())) {
|
|
|
- queryWrapper.like("a.name",projectReportData.getName());
|
|
|
+ queryWrapper.like("a.name", projectReportData.getName());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getDepartment())) {
|
|
|
- queryWrapper.eq("a.department",projectReportData.getDepartment());
|
|
|
+ queryWrapper.eq("a.department", projectReportData.getDepartment());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getCompanyId())) {
|
|
|
- queryWrapper.eq("so.parent_id",projectReportData.getCompanyId());
|
|
|
+ queryWrapper.eq("so.parent_id", projectReportData.getCompanyId());
|
|
|
}
|
|
|
IPage<EnrollmentRegistration> list = mapper.findList(page, queryWrapper);
|
|
|
return list;
|
|
@@ -95,37 +107,38 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
/**
|
|
|
* 导出实习人员登记表信息
|
|
|
+ *
|
|
|
* @param page
|
|
|
* @param projectReportData
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public IPage<ExportDTO> exportList(Page<ExportDTO> page, ExportDTO projectReportData) throws Exception{
|
|
|
- QueryWrapper<ExportDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition (projectReportData,ExportDTO.class);
|
|
|
- queryWrapper.eq("a.del_flag","0");
|
|
|
+ public IPage<ExportDTO> exportList(Page<ExportDTO> page, ExportDTO projectReportData) throws Exception {
|
|
|
+ QueryWrapper<ExportDTO> queryWrapper = QueryWrapperGenerator.buildQueryCondition(projectReportData, ExportDTO.class);
|
|
|
+ queryWrapper.eq("a.del_flag", "0");
|
|
|
if (StringUtils.isNotBlank(projectReportData.getMobilePhone())) {
|
|
|
- queryWrapper.like("a.mobile_phone",projectReportData.getMobilePhone());
|
|
|
+ queryWrapper.like("a.mobile_phone", projectReportData.getMobilePhone());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getName())) {
|
|
|
- queryWrapper.like("a.name",projectReportData.getName());
|
|
|
+ queryWrapper.like("a.name", projectReportData.getName());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getDepartment())) {
|
|
|
- queryWrapper.eq("a.department",projectReportData.getDepartment());
|
|
|
+ queryWrapper.eq("a.department", projectReportData.getDepartment());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(projectReportData.getCompanyId())) {
|
|
|
- queryWrapper.eq("so.parent_id",projectReportData.getCompanyId());
|
|
|
+ queryWrapper.eq("so.parent_id", projectReportData.getCompanyId());
|
|
|
}
|
|
|
IPage<ExportDTO> list = mapper.exportList(page, queryWrapper);
|
|
|
for (ExportDTO record : list.getRecords()) {
|
|
|
//根据用户查询岗位和角色信息
|
|
|
- if (ObjectUtil.isNotEmpty(record)){
|
|
|
+ if (ObjectUtil.isNotEmpty(record)) {
|
|
|
UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getById(record.getUserId());
|
|
|
- if (userDTO != null){
|
|
|
- if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())){
|
|
|
+ if (userDTO != null) {
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
|
|
|
StringBuilder roleBuilder = new StringBuilder();
|
|
|
for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
|
|
|
RoleDTO dto = SpringUtil.getBean(IRoleApi.class).getRoleDTOByIdForApp(roleDTO.getId());
|
|
|
- if (ObjectUtil.isNotEmpty(dto)){
|
|
|
+ if (ObjectUtil.isNotEmpty(dto)) {
|
|
|
roleBuilder.append(dto.getName()).append(",");
|
|
|
}
|
|
|
}
|
|
@@ -137,11 +150,11 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
record.setRole(roleBuilder.toString());
|
|
|
}
|
|
|
- if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())){
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())) {
|
|
|
StringBuilder postBuilder = new StringBuilder();
|
|
|
for (PostDTO postDTO : userDTO.getPostDTOList()) {
|
|
|
PostDTO dto = SpringUtil.getBean(IPostApi.class).getPostDTOById(postDTO.getId());
|
|
|
- if (ObjectUtil.isNotEmpty(dto)){
|
|
|
+ if (ObjectUtil.isNotEmpty(dto)) {
|
|
|
postBuilder.append(dto.getName()).append(",");
|
|
|
}
|
|
|
}
|
|
@@ -160,10 +173,11 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
|
|
|
public EnrollmentRegistration saveRegistration(EnrollmentRegistration registration) throws Exception {
|
|
|
- if (StringUtils.isNotEmpty(registration.getId())){
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(registration.getId())) {
|
|
|
|
|
|
EnrollmentRegistration report = mapper.getById(registration.getId());
|
|
|
- if (report != null){
|
|
|
+ if (report != null) {
|
|
|
return update(registration);
|
|
|
}
|
|
|
}
|
|
@@ -171,10 +185,10 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
|
|
|
public EnrollmentRegistration saveRegistration2(EnrollmentRegistration registration) throws Exception {
|
|
|
- if (StringUtils.isNotEmpty(registration.getId())){
|
|
|
+ if (StringUtils.isNotEmpty(registration.getId())) {
|
|
|
|
|
|
EnrollmentRegistration report = mapper.getById(registration.getId());
|
|
|
- if (report != null){
|
|
|
+ if (report != null) {
|
|
|
return update2(registration);
|
|
|
}
|
|
|
}
|
|
@@ -185,7 +199,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
* 新增
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public EnrollmentRegistration add(EnrollmentRegistration reportData) throws Exception{
|
|
|
+ public EnrollmentRegistration add(EnrollmentRegistration reportData) throws Exception {
|
|
|
|
|
|
String currentToken = TokenProvider.getCurrentToken();
|
|
|
|
|
@@ -197,11 +211,11 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
Integer integer = mapper.selectCount(queryWrapper);
|
|
|
Integer mobilePhoneOnly = SpringUtil.getBean(IUserApi.class).selectCountByMobile(reportData.getMobilePhone());
|
|
|
|
|
|
- UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
|
|
EnrollmentRegistration report = new EnrollmentRegistration();
|
|
|
|
|
|
- if (integer <=0 && mobilePhoneOnly <=0 ) {
|
|
|
+ if (integer <= 0 && mobilePhoneOnly <= 0) {
|
|
|
//为空则表示移动端扫码登录
|
|
|
if (StringUtils.isBlank(reportData.getIsPc())) {
|
|
|
reportData.setIsPc("2");
|
|
@@ -214,7 +228,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
report.setUpdateById("1");
|
|
|
report.setUpdateTime(new Date());
|
|
|
|
|
|
- if (StringUtils.isNotBlank(report.getSocialSecurityNumber())){
|
|
|
+ if (StringUtils.isNotBlank(report.getSocialSecurityNumber())) {
|
|
|
EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
|
|
|
String amountId = SnowFlake.getId();
|
|
|
securityCard.setId(amountId);
|
|
@@ -233,29 +247,29 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
//if (null == currentToken) {
|
|
|
|
|
|
- //发起员工入职流程
|
|
|
- Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("员工入职");
|
|
|
- String procDefId = map.get("id") + "";
|
|
|
+ //发起员工入职流程
|
|
|
+ Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("员工入职");
|
|
|
+ String procDefId = map.get("id") + "";
|
|
|
|
|
|
- report.setProcessDefinitionId(procDefId);
|
|
|
- report.setProcessType("0");
|
|
|
- mapper.insert(report);
|
|
|
+ report.setProcessDefinitionId(procDefId);
|
|
|
+ report.setProcessType("0");
|
|
|
+ mapper.insert(report);
|
|
|
|
|
|
- Map<String, Map<String, String>> allMap = new HashMap<>();
|
|
|
+ Map<String, Map<String, String>> allMap = new HashMap<>();
|
|
|
|
|
|
- String procDefKey = map.get("key") + "";
|
|
|
- String businessTable = "human_resources_enrollment_registration";
|
|
|
+ String procDefKey = map.get("key") + "";
|
|
|
+ String businessTable = "human_resources_enrollment_registration";
|
|
|
|
|
|
- String businessId = id;
|
|
|
- String title = "管理员发起了- [" + report.getName() + "员工入职]";
|
|
|
+ String businessId = id;
|
|
|
+ String title = "管理员发起了- [" + report.getName() + "员工入职]";
|
|
|
|
|
|
- //获取实习信息审核员信息
|
|
|
- RoleDTO roleDTO = SpringUtil.getBean(IRoleApi.class).getRoleDTOByName2("实习信息审核员");
|
|
|
- String assignee = getAssignee(roleDTO.getId());
|
|
|
- String recordType = "";
|
|
|
+ //获取实习信息审核员信息
|
|
|
+ RoleDTO roleDTO = SpringUtil.getBean(IRoleApi.class).getRoleDTOByName2("实习信息审核员");
|
|
|
+ String assignee = getAssignee(roleDTO.getId());
|
|
|
+ String recordType = "";
|
|
|
|
|
|
- Map<String, String> newMap = pingMap(procDefId, procDefKey, businessTable, businessId, title, assignee, recordType);
|
|
|
- allMap.put("入职", newMap);
|
|
|
+ Map<String, String> newMap = pingMap(procDefId, procDefKey, businessTable, businessId, title, assignee, recordType);
|
|
|
+ allMap.put("入职", newMap);
|
|
|
if (StringUtils.isBlank(reportData.getIsPc())) {
|
|
|
SpringUtil.getBean(IFlowableApi.class).startForFenNew(allMap);
|
|
|
}
|
|
@@ -267,7 +281,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
return report;
|
|
|
}
|
|
|
|
|
|
- public String getAssignee(String roleId){
|
|
|
+ public String getAssignee(String roleId) {
|
|
|
List<UserDTO> userDTOS = SpringUtil.getBean(IUserApi.class).findListByRoleId(roleId);
|
|
|
StringJoiner idJoiner = new StringJoiner(",");
|
|
|
for (UserDTO user : userDTOS) {
|
|
@@ -277,7 +291,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
return idJoiner.toString();
|
|
|
}
|
|
|
|
|
|
- public String getAssignee2(String roleId){
|
|
|
+ public String getAssignee2(String roleId) {
|
|
|
List<UserDTO> userDTOS = SpringUtil.getBean(IUserApi.class).findListFlowAbleByPostId(roleId);
|
|
|
StringJoiner idJoiner = new StringJoiner(",");
|
|
|
for (UserDTO user : userDTOS) {
|
|
@@ -286,9 +300,10 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
return idJoiner.toString();
|
|
|
}
|
|
|
- public Map<String,String> pingMap(String procDefId,String procDefKey,String businessTable,
|
|
|
- String businessId,String title,String assignee,String recordType){
|
|
|
- Map<String,String> map = new HashMap();
|
|
|
+
|
|
|
+ public Map<String, String> pingMap(String procDefId, String procDefKey, String businessTable,
|
|
|
+ String businessId, String title, String assignee, String recordType) {
|
|
|
+ Map<String, String> map = new HashMap();
|
|
|
map.put("procDefId", procDefId);
|
|
|
map.put("procDefKey", procDefKey);
|
|
|
map.put("businessTable", businessTable);
|
|
@@ -303,9 +318,9 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
* 修改
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public EnrollmentRegistration update(EnrollmentRegistration reportData) throws Exception{
|
|
|
+ public EnrollmentRegistration update(EnrollmentRegistration reportData) throws Exception {
|
|
|
//获取当前登录人信息
|
|
|
- UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
|
|
EnrollmentRegistration report = new EnrollmentRegistration();
|
|
|
BeanUtils.copyProperties(reportData, report);
|
|
@@ -323,8 +338,8 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (StringUtils.isNotBlank(report.getType()) && !userDTO.isAdmin()){
|
|
|
- if (report.getType().equals("5")){
|
|
|
+ if (StringUtils.isNotBlank(report.getType()) && !userDTO.isAdmin()) {
|
|
|
+ if (report.getType().equals("5")) {
|
|
|
//获取当前的用户,审核的人
|
|
|
UserDTO dto = new UserDTO();
|
|
|
//设置信息
|
|
@@ -346,11 +361,10 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
OfficeDTO companyDto = new OfficeDTO();
|
|
|
companyDto.setId(office.getParent().getId());
|
|
|
dto.setCompanyDTO(companyDto);
|
|
|
-
|
|
|
dto.setNo(report.getMobilePhone());
|
|
|
|
|
|
String name = "兴光会计员工";
|
|
|
- List <RoleDTO> roleIdList = new ArrayList<>();
|
|
|
+ List<RoleDTO> roleIdList = new ArrayList<>();
|
|
|
|
|
|
// roleIdList.add(roleInfo);
|
|
|
|
|
@@ -358,35 +372,35 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
String officeName = "";
|
|
|
String networkAddress = "";
|
|
|
if (null != office) {
|
|
|
- Map<String,String> keyMap = new HashMap<>();
|
|
|
+ Map<String, String> keyMap = new HashMap<>();
|
|
|
TenantDTO tenantDTO = new TenantDTO();
|
|
|
tenantDTO.setId(office.getTenantId());
|
|
|
dto.setTenantDTO(tenantDTO);
|
|
|
- if (office.getTenantId().equals("10003")){
|
|
|
+ if (office.getTenantId().equals("10003")) {
|
|
|
officeName = "会计业务管理公司";
|
|
|
networkAddress = "cpapmis.xgccpm.com";
|
|
|
keyMap.put("name", "兴光会计员工,共有权限(会计)");
|
|
|
keyMap.put("tenantId", office.getTenantId());
|
|
|
roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
- }else if (office.getTenantId().equals("10004")) {
|
|
|
+ } else if (office.getTenantId().equals("10004")) {
|
|
|
officeName = "中审管理公司";
|
|
|
networkAddress = "zs.xgccpm.com";
|
|
|
keyMap.put("name", "中审员工,共有权限(中审)");
|
|
|
keyMap.put("tenantId", office.getTenantId());
|
|
|
roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
- }else if (office.getTenantId().equals("10001")) {
|
|
|
+ } else if (office.getTenantId().equals("10001")) {
|
|
|
officeName = "评估管理公司";
|
|
|
networkAddress = "http://amc.xgccpm.com";
|
|
|
keyMap.put("name", "评估员工,共有权限(评估)");
|
|
|
keyMap.put("tenantId", office.getTenantId());
|
|
|
roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
- }else if (office.getTenantId().equals("10006")) {
|
|
|
+ } else if (office.getTenantId().equals("10006")) {
|
|
|
officeName = "苏州分公司";
|
|
|
networkAddress = "sz.xgccpm.com";
|
|
|
keyMap.put("name", "审计员工,共有权限(苏州)");
|
|
|
keyMap.put("tenantId", office.getTenantId());
|
|
|
roleIdList = SpringUtil.getBean(IRoleApi.class).getRoleDTOByNameAndTenantId(keyMap);
|
|
|
- }else if (office.getTenantId().equals("10005")) {
|
|
|
+ } else if (office.getTenantId().equals("10005")) {
|
|
|
officeName = "兴光项目公司";
|
|
|
networkAddress = "xm.xgccpm.com";
|
|
|
keyMap.put("name", "项目公司综合管理部员工,共有权限(项目)");
|
|
@@ -400,9 +414,43 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
officeName = "综合管理公司";
|
|
|
}
|
|
|
dto.setRoleDTOList(roleIdList);
|
|
|
+ String dictValue = DictUtils.getDictValue("dd_status", "dd_status", "0");
|
|
|
+ if("1".equals(dictValue)){
|
|
|
+ //钉钉逻辑
|
|
|
+ //判断用户是否为 评估 或者 会计 员工
|
|
|
+ if (office.getTenantId().equals("10003") || office.getTenantId().equals("10001")) {
|
|
|
+ //获取用户所在部门信息
|
|
|
+ OfficeDTO officeDto = SpringUtil.getBean(IOfficeApi.class).getOfficeById(dto.getOfficeDTO().getId());
|
|
|
+ //获取钉钉所有部门信息
|
|
|
+ List<OapiV2DepartmentListsubResponse.DeptBaseResponse> deptBaseResponses = dingTalkUtils.deptList(office.getTenantId());
|
|
|
+ for (OapiV2DepartmentListsubResponse.DeptBaseResponse dept : deptBaseResponses) {
|
|
|
+ //找到用户所在的钉钉部门
|
|
|
+ if (officeDto.getName().equals(dept.getName())) {
|
|
|
+ DingTalkUserDTO dingTalkUserDTO = new DingTalkUserDTO();
|
|
|
+ dingTalkUserDTO.setMobile(dto.getMobile());
|
|
|
+ dingTalkUserDTO.setName(dto.getName());
|
|
|
+ dingTalkUserDTO.setDeptIdList(String.valueOf(dept.getDeptId()));
|
|
|
+ //通过用户手机号查询钉钉是否存在用户信息,判断是更新还是新增
|
|
|
+ if (StringUtils.isNotBlank(report.getDdId())) {
|
|
|
+ dingTalkUserDTO.setUserid(report.getDdId());
|
|
|
+ dingTalkUtils.updateUser(dingTalkUserDTO,office.getTenantId());
|
|
|
+ } else {
|
|
|
+ //将手机号作为用户钉钉userID
|
|
|
+ dingTalkUserDTO.setUserid(dingTalkUserDTO.getMobile());
|
|
|
+ //添加钉钉用户,暂时无需处理返回
|
|
|
+ OapiV2UserCreateResponse oapiV2UserCreateResponse = dingTalkUtils.addUser(dingTalkUserDTO,office.getTenantId());
|
|
|
+ //数插入ddid
|
|
|
+ dto.setDdId(dingTalkUserDTO.getMobile());
|
|
|
+ report.setDdId(dingTalkUserDTO.getMobile());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //钉钉逻辑
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- SpringUtil.getBean ( IUserApi.class ).saveOrUpdate(dto);
|
|
|
+ SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
|
|
|
|
|
|
|
|
|
// report.setOnJobStatus("正式");
|
|
@@ -413,21 +461,21 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
String randomCode = report.getName() + "你好!欢迎入职" + officeName + ",请尽快登录公司系统:" + networkAddress
|
|
|
+ "完善个人信息(包括社保卡号与工资卡号)并修改初始密码,系统初始账号密码为:" + report.getName() +
|
|
|
- "/123456,人事部门已在为你办理门禁卡,办理成功后将由系统告知,在收到系统通知后,请及时到信息部"+ listByPostId.get(0).getName() +"处领取门禁卡!"+
|
|
|
+ "/123456,人事部门已在为你办理门禁卡,办理成功后将由系统告知,在收到系统通知后,请及时到信息部" + listByPostId.get(0).getName() + "处领取门禁卡!" +
|
|
|
"注:工资卡需同时提供中信银行、招商银行卡号";
|
|
|
Map<String, Object> stringObjectMap = SpringUtil.getBean(IUserApi.class).sendRandomCodes(report.getMobilePhone(), randomCode);
|
|
|
String statusCode = (String) stringObjectMap.get("statusCode");
|
|
|
if (("000000").equals(statusCode)) {
|
|
|
System.out.println("短信发送成功!");
|
|
|
- }else if(statusCode.equals("160040")){
|
|
|
+ } else if (statusCode.equals("160040")) {
|
|
|
System.out.println("手机号获取验证码次数已达每日上限!");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
System.out.println("短信发送失败,错误代码:101,请联系管理员!");
|
|
|
}
|
|
|
|
|
|
//当流程结束的时候,发起工资卡信息完善流程
|
|
|
Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("工资卡信息完善");
|
|
|
- String procDefId = map.get("id")+"";
|
|
|
+ String procDefId = map.get("id") + "";
|
|
|
|
|
|
//当流程结束的时候,发起工资卡信息完善流程
|
|
|
String uid = SnowFlake.getId();
|
|
@@ -439,13 +487,13 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
wageCard.setEnrollmentRegistrationId(report.getId());
|
|
|
wageCardService.save(wageCard);
|
|
|
|
|
|
- String procDefKey = map.get("key")+"";
|
|
|
+ String procDefKey = map.get("key") + "";
|
|
|
String businessTable = "human_resources_enrollment_wage_card";
|
|
|
String businessId = uid;
|
|
|
String title = "工资卡信息完善";
|
|
|
String assignee = amountId;
|
|
|
String recordType = "";
|
|
|
- Map<String,String> newMap = new HashMap();
|
|
|
+ Map<String, String> newMap = new HashMap();
|
|
|
newMap.put("procDefId", procDefId);
|
|
|
newMap.put("procDefKey", procDefKey);
|
|
|
newMap.put("businessTable", businessTable);
|
|
@@ -460,9 +508,9 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
wageCardService.saveOrUpdate(wageCard);
|
|
|
|
|
|
//发起社保流程
|
|
|
- if (StringUtils.isBlank(report.getSocialSecurityNumber())){
|
|
|
+ if (StringUtils.isBlank(report.getSocialSecurityNumber())) {
|
|
|
Map cardMap = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("社保登记");
|
|
|
- String procDefId2 = cardMap.get("id")+"";
|
|
|
+ String procDefId2 = cardMap.get("id") + "";
|
|
|
|
|
|
//当流程结束的时候,发起工资卡信息完善流程
|
|
|
String uuid = SnowFlake.getId();
|
|
@@ -474,13 +522,13 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
securityCard.setEnrollmentRegistrationId(report.getId());
|
|
|
securityCardService.save(securityCard);
|
|
|
|
|
|
- String procDefKey2 = cardMap.get("key")+"";
|
|
|
+ String procDefKey2 = cardMap.get("key") + "";
|
|
|
String businessTable2 = "human_resources_enrollment_social_security_card";
|
|
|
String businessId2 = uuid;
|
|
|
String title2 = "社保卡信息完善";
|
|
|
String assignee2 = amountId;
|
|
|
String recordType2 = "";
|
|
|
- Map<String,String> newMap2 = new HashMap();
|
|
|
+ Map<String, String> newMap2 = new HashMap();
|
|
|
newMap2.put("procDefId", procDefId2);
|
|
|
newMap2.put("procDefKey", procDefKey2);
|
|
|
newMap2.put("businessTable", businessTable2);
|
|
@@ -496,7 +544,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
//发起门卡办理通知流程
|
|
|
Map keyMap = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("门卡办理");
|
|
|
- String keyProcDefId = keyMap.get("id")+"";
|
|
|
+ String keyProcDefId = keyMap.get("id") + "";
|
|
|
|
|
|
//当流程结束的时候,发起工资卡信息完善流程
|
|
|
String keyUid = SnowFlake.getId();
|
|
@@ -508,10 +556,10 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
keyCard.setEnrollmentRegistrationId(report.getId());
|
|
|
keyCardService.save(keyCard);
|
|
|
|
|
|
- String keyProcDefKey = keyMap.get("key")+"";
|
|
|
+ String keyProcDefKey = keyMap.get("key") + "";
|
|
|
String keyBusinessTable = "human_resources_enrollment_key_card";
|
|
|
String keyBusinessId = keyUid;
|
|
|
- String keyTitle = report.getName() + "的门卡办理";
|
|
|
+ String keyTitle = report.getName() + "的门卡办理";
|
|
|
|
|
|
// UserDTO userInfo = SpringUtil.getBean(IUserApi.class).getByLoginNameNotTenantId("赵俐");
|
|
|
// String keyAssignee = userInfo.getId();
|
|
@@ -520,7 +568,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
String keyAssignee = getAssignee2(postInfo.getId());
|
|
|
|
|
|
String keyRecordType = "";
|
|
|
- Map<String,String> keyMap2 = new HashMap();
|
|
|
+ Map<String, String> keyMap2 = new HashMap();
|
|
|
keyMap2.put("procDefId", keyProcDefId);
|
|
|
keyMap2.put("procDefKey", keyProcDefKey);
|
|
|
keyMap2.put("businessTable", keyBusinessTable);
|
|
@@ -535,6 +583,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
mapper.updateById(report);
|
|
|
return report;
|
|
|
}
|
|
@@ -543,9 +592,9 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
* 修改
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public EnrollmentRegistration update2(EnrollmentRegistration reportData) throws Exception{
|
|
|
+ public EnrollmentRegistration update2(EnrollmentRegistration reportData) throws Exception {
|
|
|
//获取当前登录人信息
|
|
|
- UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
|
|
EnrollmentRegistration report = new EnrollmentRegistration();
|
|
|
BeanUtils.copyProperties(reportData, report);
|
|
@@ -560,17 +609,17 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
// 查询基础信息表
|
|
|
EnrollmentRegistration info = mapper.getById(id);
|
|
|
//根据用户查询岗位和角色信息
|
|
|
- if (ObjectUtil.isNotEmpty(info)){
|
|
|
+ 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())){
|
|
|
+ if (userDTO != null) {
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getRoleDTOList())) {
|
|
|
for (RoleDTO roleDTO : userDTO.getRoleDTOList()) {
|
|
|
roles.add(roleDTO.getId());
|
|
|
}
|
|
|
}
|
|
|
- if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())){
|
|
|
+ if (CollectionUtil.isNotEmpty(userDTO.getPostDTOList())) {
|
|
|
for (PostDTO postDTO : userDTO.getPostDTOList()) {
|
|
|
posts.add(postDTO.getId());
|
|
|
}
|
|
@@ -603,16 +652,27 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public String remove(String id) {
|
|
|
//先删除用户表中的信息
|
|
|
EnrollmentRegistration registration = mapper.getById(id);
|
|
|
- if (registration != null){
|
|
|
+ if (registration != null) {
|
|
|
UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByMobile(registration.getMobilePhone());
|
|
|
- if (userDTO!=null){
|
|
|
+ //设置角色
|
|
|
+ if (userDTO != null) {
|
|
|
SpringUtil.getBean(IUserApi.class).deleteById(userDTO.getId());
|
|
|
+ String dictValue = DictUtils.getDictValue("dd_status", "dd_status", "0");
|
|
|
+ if("1".equals(dictValue)){
|
|
|
+ //删除钉钉表中的数据
|
|
|
+ //判断用户是否为 评估 或者 会计 员工
|
|
|
+ if (userDTO.getTenantDTO().getId().equals("10003") || userDTO.getTenantDTO().getId().equals("10001")) {
|
|
|
+ DingTalkUserDTO dingTalkUserDTO = new DingTalkUserDTO();
|
|
|
+ dingTalkUserDTO.setUserid(userDTO.getDdId());
|
|
|
+ dingTalkUtils.deleteUser(dingTalkUserDTO,userDTO.getTenantDTO().getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
// 删除基础信息表
|
|
@@ -637,24 +697,54 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
/**
|
|
|
* 获取正式工在职状态为离职的,并且user表中未删除的
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
public List<EnrollmentRegistration> getFormalUserInfo() {
|
|
|
return mapper.getFormalUserInfo();
|
|
|
}
|
|
|
|
|
|
- public void updateRegistration(EnrollmentRegistration reportData) {
|
|
|
+ public void updateRegistration(EnrollmentRegistration reportData) throws ApiException {
|
|
|
+
|
|
|
//获取当前登录人信息
|
|
|
- UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
|
|
|
EnrollmentRegistration report = new EnrollmentRegistration();
|
|
|
BeanUtils.copyProperties(reportData, report);
|
|
|
report.setUpdateById(userDTO.getId());
|
|
|
report.setUpdateTime(new Date());
|
|
|
|
|
|
+ String dictValue = DictUtils.getDictValue("dd_status", "dd_status", "0");
|
|
|
+ if("1".equals(dictValue)){
|
|
|
+ //钉钉逻辑
|
|
|
+ //获取用户所在部门信息
|
|
|
+ OfficeDTO officeDto = SpringUtil.getBean(IOfficeApi.class).getOfficeById(report.getDepartment());
|
|
|
+ String tenantId = officeDto.getTenantId();
|
|
|
+ //判断用户是否为 评估 或者 会计 的公司
|
|
|
+ if (tenantId.equals("10003") || tenantId.equals("10001")) {
|
|
|
+ //获取钉钉所有部门信息
|
|
|
+ List<OapiV2DepartmentListsubResponse.DeptBaseResponse> deptBaseResponses = dingTalkUtils.deptList(tenantId);
|
|
|
+ for (OapiV2DepartmentListsubResponse.DeptBaseResponse dept : deptBaseResponses) {
|
|
|
+ //找到用户所在的钉钉部门
|
|
|
+ if (officeDto.getName().equals(dept.getName())) {
|
|
|
+ // 相应逻辑
|
|
|
+ DingTalkUserDTO dingTalkUserDTO = new DingTalkUserDTO();
|
|
|
+ dingTalkUserDTO.setMobile(report.getMobilePhone());
|
|
|
+ dingTalkUserDTO.setName(report.getName());
|
|
|
+ dingTalkUserDTO.setDeptIdList(String.valueOf(dept.getDeptId()));
|
|
|
+ if (StringUtils.isNotBlank(report.getDdId())) {
|
|
|
+ dingTalkUserDTO.setUserid(report.getDdId());
|
|
|
+ dingTalkUtils.updateUser(dingTalkUserDTO,tenantId);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //钉钉逻辑
|
|
|
+ }
|
|
|
mapper.updateById(report);
|
|
|
|
|
|
- if (StringUtils.isNotBlank(report.getSocialSecurityNumber())){
|
|
|
+ if (StringUtils.isNotBlank(report.getSocialSecurityNumber())) {
|
|
|
EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
|
|
|
String amountId = SnowFlake.getId();
|
|
|
securityCard.setId(amountId);
|
|
@@ -688,14 +778,13 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
wageCardService.saveOrUpdate(wageCard);
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 修改用户信息
|
|
|
*/
|
|
|
EnrollmentRegistration registration = mapper.getById(reportData.getId());
|
|
|
- if (StringUtils.isNotBlank(registration.getUserId())){
|
|
|
+ if (StringUtils.isNotBlank(registration.getUserId())) {
|
|
|
UserDTO dto = SpringUtil.getBean(IUserApi.class).getById(registration.getUserId());
|
|
|
- if (dto != null){
|
|
|
+ if (dto != null) {
|
|
|
//往用户表中新增一条数据
|
|
|
UserDTO dto1 = new UserDTO();
|
|
|
dto1.setId(dto.getId());
|
|
@@ -711,16 +800,16 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
officeDTO1.setId(officeDTO.getParent().getId());
|
|
|
dto1.setCompanyDTO(officeDTO1);
|
|
|
//角色和岗位信息
|
|
|
- List <RoleDTO> roleIdList = new ArrayList<>();
|
|
|
- List <PostDTO> postDTOList = new ArrayList<>();
|
|
|
- if (CollectionUtil.isNotEmpty(reportData.getPostIdList())){
|
|
|
+ List<RoleDTO> roleIdList = new ArrayList<>();
|
|
|
+ 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())){
|
|
|
+ if (CollectionUtil.isNotEmpty(reportData.getRoleIdList())) {
|
|
|
for (String role : reportData.getRoleIdList()) {
|
|
|
RoleDTO roleDTO = SpringUtil.getBean(IRoleApi.class).getRoleDTOById(role);
|
|
|
roleIdList.add(roleDTO);
|
|
@@ -755,7 +844,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
// }
|
|
|
dto1.setRoleDTOList(roleIdList);
|
|
|
dto1.setPostDTOList(postDTOList);
|
|
|
- SpringUtil.getBean ( IUserApi.class ).saveOrUpdate(dto1);
|
|
|
+ SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto1);
|
|
|
|
|
|
|
|
|
}
|
|
@@ -764,7 +853,8 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
|
|
|
public void insertIntoEnrollmentRegistrationInfo(String value) {
|
|
|
- EnrollmentRegistration infos = JSON.parseObject(value, new TypeReference<EnrollmentRegistration>() {});
|
|
|
+ EnrollmentRegistration infos = JSON.parseObject(value, new TypeReference<EnrollmentRegistration>() {
|
|
|
+ });
|
|
|
mapper.insert(infos);
|
|
|
}
|
|
|
|
|
@@ -774,20 +864,21 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
/**
|
|
|
* 用户新增时对入职信息进行同步
|
|
|
+ *
|
|
|
* @param registration
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void saveInfo(EnrollmentRegistration registration) {
|
|
|
//现根据userId查询入职信息
|
|
|
- if (StringUtils.isNotBlank(registration.getUserId())){
|
|
|
+ if (StringUtils.isNotBlank(registration.getUserId())) {
|
|
|
registration.setType("5");
|
|
|
registration.setOnJobStatus("2");
|
|
|
- EnrollmentRegistration enrollmentRegistration=mapper.getByUserId(registration.getUserId());
|
|
|
- if (enrollmentRegistration != null){
|
|
|
+ EnrollmentRegistration enrollmentRegistration = mapper.getByUserId(registration.getUserId());
|
|
|
+ if (enrollmentRegistration != null) {
|
|
|
registration.setId(enrollmentRegistration.getId());
|
|
|
mapper.updateById(registration);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
registration.setId(SnowFlake.getId());
|
|
|
mapper.insert(registration);
|
|
|
}
|
|
@@ -795,11 +886,11 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据用户id删除用户信息
|
|
|
+ *
|
|
|
* @param id
|
|
|
*/
|
|
|
public void delByUserId(String id) {
|
|
@@ -808,15 +899,16 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
/**
|
|
|
* 添加导入的用户信息
|
|
|
+ *
|
|
|
* @param staffUserInfoDTO
|
|
|
*/
|
|
|
public void updateInfo(EnrollmentRegistration staffUserInfoDTO) {
|
|
|
- if (ObjectUtil.isNotEmpty(staffUserInfoDTO)){
|
|
|
- if (StringUtils.isNotBlank(staffUserInfoDTO.getMobilePhone())){
|
|
|
+ if (ObjectUtil.isNotEmpty(staffUserInfoDTO)) {
|
|
|
+ if (StringUtils.isNotBlank(staffUserInfoDTO.getMobilePhone())) {
|
|
|
//根据手机号查询信息
|
|
|
EnrollmentRegistration registration = mapper.getByMobile(staffUserInfoDTO.getMobilePhone());
|
|
|
- if (ObjectUtil.isNotEmpty(registration)){
|
|
|
- if (registration.getName().equals(staffUserInfoDTO.getName())){
|
|
|
+ if (ObjectUtil.isNotEmpty(registration)) {
|
|
|
+ if (registration.getName().equals(staffUserInfoDTO.getName())) {
|
|
|
registration.setSex(staffUserInfoDTO.getSex());//性别
|
|
|
registration.setBirthday(staffUserInfoDTO.getBirthday());//生日
|
|
|
registration.setAge(staffUserInfoDTO.getAge());//年龄
|
|
@@ -824,17 +916,17 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
registration.setOnJobStatus(staffUserInfoDTO.getOnJobStatus());//正式
|
|
|
registration.setDepartment(staffUserInfoDTO.getDepartment());//所属部门
|
|
|
registration.setMobilePhone(staffUserInfoDTO.getMobilePhone());//联系电话
|
|
|
- if (ObjectUtil.isNotEmpty(staffUserInfoDTO.getInDate())){
|
|
|
+ if (ObjectUtil.isNotEmpty(staffUserInfoDTO.getInDate())) {
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String format = simpleDateFormat.format(staffUserInfoDTO.getInDate());
|
|
|
registration.setEntryDate(format);//入职时间
|
|
|
}
|
|
|
registration.setIdCard(staffUserInfoDTO.getIdCard());//身份证
|
|
|
mapper.updateById(registration);
|
|
|
- if (com.jeeplus.utils.StringUtils.isNotBlank(staffUserInfoDTO.getRole()) && staffUserInfoDTO.getRole().contains(",")){
|
|
|
- if (StringUtils.isNotBlank(registration.getUserId())){
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotBlank(staffUserInfoDTO.getRole()) && staffUserInfoDTO.getRole().contains(",")) {
|
|
|
+ if (StringUtils.isNotBlank(registration.getUserId())) {
|
|
|
UserDTO dto = SpringUtil.getBean(IUserApi.class).getById(registration.getUserId());
|
|
|
- List <RoleDTO> roleIdList = new ArrayList<>();
|
|
|
+ List<RoleDTO> roleIdList = new ArrayList<>();
|
|
|
String[] split = staffUserInfoDTO.getRole().split(",");
|
|
|
for (String s : split) {
|
|
|
HashMap<String, String> hashMap = new HashMap<>();
|
|
@@ -853,11 +945,11 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
TenantDTO tenantDTO = new TenantDTO();
|
|
|
tenantDTO.setId(officeDTO.getTenantId());
|
|
|
dto.setTenantDTO(tenantDTO);
|
|
|
- SpringUtil.getBean ( IUserApi.class ).saveOrUpdate(dto);
|
|
|
+ SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//入职id
|
|
|
String id = SnowFlake.getId();
|
|
|
EnrollmentRegistration enrollmentRegistration = new EnrollmentRegistration();
|
|
@@ -874,7 +966,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
enrollmentRegistration.setOnJobStatus(staffUserInfoDTO.getOnJobStatus());//正式
|
|
|
enrollmentRegistration.setDepartment(staffUserInfoDTO.getDepartment());//所属部门
|
|
|
enrollmentRegistration.setMobilePhone(staffUserInfoDTO.getMobilePhone());//联系电话
|
|
|
- if (ObjectUtil.isNotEmpty(staffUserInfoDTO.getInDate())){
|
|
|
+ if (ObjectUtil.isNotEmpty(staffUserInfoDTO.getInDate())) {
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String format = simpleDateFormat.format(staffUserInfoDTO.getInDate());
|
|
|
enrollmentRegistration.setEntryDate(format);//入职时间
|
|
@@ -886,10 +978,10 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
|
|
|
//新增用户信息
|
|
|
UserDTO dto1 = new UserDTO();
|
|
|
- if (ObjectUtil.isNotEmpty(dto)){
|
|
|
+ if (ObjectUtil.isNotEmpty(dto)) {
|
|
|
enrollmentRegistration.setUserId(dto.getId());
|
|
|
- BeanUtils.copyProperties(dto,dto1);
|
|
|
- }else {
|
|
|
+ BeanUtils.copyProperties(dto, dto1);
|
|
|
+ } else {
|
|
|
//生成一个用户id
|
|
|
String userId = SnowFlake.getId();
|
|
|
enrollmentRegistration.setUserId(userId);
|
|
@@ -909,8 +1001,8 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
tenantDTO.setId(officeDTO.getTenantId());
|
|
|
dto1.setTenantDTO(tenantDTO);
|
|
|
}
|
|
|
- if (com.jeeplus.utils.StringUtils.isNotBlank(staffUserInfoDTO.getRole()) && staffUserInfoDTO.getRole().contains(",")){
|
|
|
- List <RoleDTO> roleIdList = new ArrayList<>();
|
|
|
+ if (com.jeeplus.utils.StringUtils.isNotBlank(staffUserInfoDTO.getRole()) && staffUserInfoDTO.getRole().contains(",")) {
|
|
|
+ List<RoleDTO> roleIdList = new ArrayList<>();
|
|
|
String[] split = staffUserInfoDTO.getRole().split(",");
|
|
|
for (String s : split) {
|
|
|
HashMap<String, String> hashMap = new HashMap<>();
|
|
@@ -921,11 +1013,16 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
|
|
|
}
|
|
|
dto1.setRoleDTOList(roleIdList);
|
|
|
}
|
|
|
- SpringUtil.getBean ( IUserApi.class ).saveOrUpdate(dto1);
|
|
|
+ SpringUtil.getBean(IUserApi.class).saveOrUpdate(dto1);
|
|
|
mapper.insert(enrollmentRegistration);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ public void updateDdIdById(EnrollmentRegistration registration) {
|
|
|
+ mapper.updateDdIdById(registration);
|
|
|
+ }
|
|
|
+
|
|
|
}
|