|  | @@ -12,6 +12,7 @@ import com.jeeplus.common.SecurityUtils;
 | 
												
													
														
															|  |  import com.jeeplus.common.TokenProvider;
 |  |  import com.jeeplus.common.TokenProvider;
 | 
												
													
														
															|  |  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.practice.register.domain.Registration;
 |  |  import com.jeeplus.human.practice.register.domain.Registration;
 | 
												
													
														
															|  |  import com.jeeplus.human.practice.register.domain.RegistrationBank;
 |  |  import com.jeeplus.human.practice.register.domain.RegistrationBank;
 | 
												
													
														
															|  |  import com.jeeplus.human.practice.register.domain.RegistrationExperience;
 |  |  import com.jeeplus.human.practice.register.domain.RegistrationExperience;
 | 
												
											
												
													
														
															|  | @@ -54,6 +55,9 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 | 
												
													
														
															|  |      @Resource
 |  |      @Resource
 | 
												
													
														
															|  |      private RegistrationExperienceMapper experienceMapper;
 |  |      private RegistrationExperienceMapper experienceMapper;
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | 
 |  | +    @Resource
 | 
												
													
														
															|  | 
 |  | +    private EnrollmentRegistrationService enrollmentRegistrationService;
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  |      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);
 | 
												
											
												
													
														
															|  | @@ -315,88 +319,98 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 | 
												
													
														
															|  |      public Registration add(Registration reportData) throws Exception{
 |  |      public Registration add(Registration reportData) throws Exception{
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |          String currentToken = TokenProvider.getCurrentToken();
 |  |          String currentToken = TokenProvider.getCurrentToken();
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  |          Registration report = new Registration();
 |  |          Registration report = new Registration();
 | 
												
													
														
															|  |          BeanUtils.copyProperties(reportData, report);
 |  |          BeanUtils.copyProperties(reportData, report);
 | 
												
													
														
															|  | -        String id = UUID.randomUUID().toString().replace("-", "");
 |  | 
 | 
												
													
														
															|  | -        report.setId(id);
 |  | 
 | 
												
													
														
															|  | -        report.setCreateById("1");
 |  | 
 | 
												
													
														
															|  | -        report.setCreateTime(new Date());
 |  | 
 | 
												
													
														
															|  | -        report.setUpdateById("1");
 |  | 
 | 
												
													
														
															|  | -        report.setUpdateTime(new Date());
 |  | 
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -        String uid = UUID.randomUUID().toString().replace("-", "");
 |  | 
 | 
												
													
														
															|  | -        report.setId(uid);
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -        //先删除家庭成员信息,在重新添加
 |  | 
 | 
												
													
														
															|  | -        familyMembersMapper.deleteByRegisterId(report.getId());
 |  | 
 | 
												
													
														
															|  | -        List<RegistrationFamilyMembers> familyMembers = reportData.getFamilyMembers();
 |  | 
 | 
												
													
														
															|  | -        if (CollectionUtils.isNotEmpty(familyMembers)){
 |  | 
 | 
												
													
														
															|  | 
 |  | +        QueryWrapper<Registration> queryWrapper = new QueryWrapper<>();
 | 
												
													
														
															|  | 
 |  | +        queryWrapper.eq("id_card", reportData.getIdCard());
 | 
												
													
														
															|  | 
 |  | +        queryWrapper.eq("del_flag", 0);
 | 
												
													
														
															|  | 
 |  | +        Integer integer = mapper.selectCount(queryWrapper);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -            for (RegistrationFamilyMembers familyMember : familyMembers) {
 |  | 
 | 
												
													
														
															|  | -                // 生成id
 |  | 
 | 
												
													
														
															|  | -                String amountId = UUID.randomUUID().toString().replace("-", "");
 |  | 
 | 
												
													
														
															|  | -                familyMember.setId(amountId);
 |  | 
 | 
												
													
														
															|  | -                familyMember.setCreateById("1");
 |  | 
 | 
												
													
														
															|  | -                familyMember.setCreateTime(new Date());
 |  | 
 | 
												
													
														
															|  | -                familyMember.setUpdateById("1");
 |  | 
 | 
												
													
														
															|  | -                familyMember.setUpdateTime(new Date());
 |  | 
 | 
												
													
														
															|  | -                familyMember.setDelFlag(0);
 |  | 
 | 
												
													
														
															|  | -                familyMember.setRegistrationId(report.getId());
 |  | 
 | 
												
													
														
															|  | -                familyMembersMapper.insert(familyMember);
 |  | 
 | 
												
													
														
															|  | 
 |  | +        Integer mobilePhoneOnly = enrollmentRegistrationService.findMobilePhoneOnly(reportData.getMobilePhone());
 | 
												
													
														
															|  | 
 |  | +        // 删除基础信息表
 | 
												
													
														
															|  | 
 |  | +        if (integer <=0 && mobilePhoneOnly <=0){
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +            String id = UUID.randomUUID().toString().replace("-", "");
 | 
												
													
														
															|  | 
 |  | +            report.setId(id);
 | 
												
													
														
															|  | 
 |  | +            report.setCreateById("1");
 | 
												
													
														
															|  | 
 |  | +            report.setCreateTime(new Date());
 | 
												
													
														
															|  | 
 |  | +            report.setUpdateById("1");
 | 
												
													
														
															|  | 
 |  | +            report.setUpdateTime(new Date());
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +            String uid = UUID.randomUUID().toString().replace("-", "");
 | 
												
													
														
															|  | 
 |  | +            report.setId(uid);
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +            //先删除家庭成员信息,在重新添加
 | 
												
													
														
															|  | 
 |  | +            familyMembersMapper.deleteByRegisterId(report.getId());
 | 
												
													
														
															|  | 
 |  | +            List<RegistrationFamilyMembers> familyMembers = reportData.getFamilyMembers();
 | 
												
													
														
															|  | 
 |  | +            if (CollectionUtils.isNotEmpty(familyMembers)){
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +                for (RegistrationFamilyMembers familyMember : familyMembers) {
 | 
												
													
														
															|  | 
 |  | +                    // 生成id
 | 
												
													
														
															|  | 
 |  | +                    String amountId = UUID.randomUUID().toString().replace("-", "");
 | 
												
													
														
															|  | 
 |  | +                    familyMember.setId(amountId);
 | 
												
													
														
															|  | 
 |  | +                    familyMember.setCreateById("1");
 | 
												
													
														
															|  | 
 |  | +                    familyMember.setCreateTime(new Date());
 | 
												
													
														
															|  | 
 |  | +                    familyMember.setUpdateById("1");
 | 
												
													
														
															|  | 
 |  | +                    familyMember.setUpdateTime(new Date());
 | 
												
													
														
															|  | 
 |  | +                    familyMember.setDelFlag(0);
 | 
												
													
														
															|  | 
 |  | +                    familyMember.setRegistrationId(report.getId());
 | 
												
													
														
															|  | 
 |  | +                    familyMembersMapper.insert(familyMember);
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  | -        }
 |  | 
 | 
												
													
														
															|  | -        //先删除实习经历信息
 |  | 
 | 
												
													
														
															|  | -        experienceMapper.deleteByRegisterId(report.getId());
 |  | 
 | 
												
													
														
															|  | -        List<RegistrationExperience> experiences = reportData.getExperiences();
 |  | 
 | 
												
													
														
															|  | -        if (CollectionUtils.isNotEmpty(experiences)){
 |  | 
 | 
												
													
														
															|  | -            for (RegistrationExperience experience : experiences) {
 |  | 
 | 
												
													
														
															|  | -                // 生成id
 |  | 
 | 
												
													
														
															|  | -                String amountId = UUID.randomUUID().toString().replace("-", "");
 |  | 
 | 
												
													
														
															|  | -                experience.setId(amountId);
 |  | 
 | 
												
													
														
															|  | -                experience.setCreateById("1");
 |  | 
 | 
												
													
														
															|  | -                experience.setCreateTime(new Date());
 |  | 
 | 
												
													
														
															|  | -                experience.setUpdateById("1");
 |  | 
 | 
												
													
														
															|  | -                experience.setUpdateTime(new Date());
 |  | 
 | 
												
													
														
															|  | -                experience.setDelFlag(0);
 |  | 
 | 
												
													
														
															|  | -                experience.setRegistrationId(report.getId());
 |  | 
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  | -                experienceMapper.insert(experience);
 |  | 
 | 
												
													
														
															|  | 
 |  | +            //先删除实习经历信息
 | 
												
													
														
															|  | 
 |  | +            experienceMapper.deleteByRegisterId(report.getId());
 | 
												
													
														
															|  | 
 |  | +            List<RegistrationExperience> experiences = reportData.getExperiences();
 | 
												
													
														
															|  | 
 |  | +            if (CollectionUtils.isNotEmpty(experiences)){
 | 
												
													
														
															|  | 
 |  | +                for (RegistrationExperience experience : experiences) {
 | 
												
													
														
															|  | 
 |  | +                    // 生成id
 | 
												
													
														
															|  | 
 |  | +                    String amountId = UUID.randomUUID().toString().replace("-", "");
 | 
												
													
														
															|  | 
 |  | +                    experience.setId(amountId);
 | 
												
													
														
															|  | 
 |  | +                    experience.setCreateById("1");
 | 
												
													
														
															|  | 
 |  | +                    experience.setCreateTime(new Date());
 | 
												
													
														
															|  | 
 |  | +                    experience.setUpdateById("1");
 | 
												
													
														
															|  | 
 |  | +                    experience.setUpdateTime(new Date());
 | 
												
													
														
															|  | 
 |  | +                    experience.setDelFlag(0);
 | 
												
													
														
															|  | 
 |  | +                    experience.setRegistrationId(report.getId());
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +                    experienceMapper.insert(experience);
 | 
												
													
														
															|  | 
 |  | +                }
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  | -        }
 |  | 
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -        if (null == currentToken) {
 |  | 
 | 
												
													
														
															|  | -            //发起实习登记流程
 |  | 
 | 
												
													
														
															|  | -            Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("实习登记");
 |  | 
 | 
												
													
														
															|  | -            String procDefId = map.get("id")+"";
 |  | 
 | 
												
													
														
															|  | 
 |  | +            if (null == currentToken) {
 | 
												
													
														
															|  | 
 |  | +                //发起实习登记流程
 | 
												
													
														
															|  | 
 |  | +                Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("实习登记");
 | 
												
													
														
															|  | 
 |  | +                String procDefId = map.get("id")+"";
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +                report.setProcessDefinitionId(procDefId);
 | 
												
													
														
															|  | 
 |  | +                mapper.insert(report);
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -            report.setProcessDefinitionId(procDefId);
 |  | 
 | 
												
													
														
															|  | -            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_practice_registration";
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -            String procDefKey = map.get("key")+"";
 |  | 
 | 
												
													
														
															|  | -            String businessTable = "human_resources_practice_registration";
 |  | 
 | 
												
													
														
															|  | 
 |  | +                String businessId = uid;
 | 
												
													
														
															|  | 
 |  | +                String title = "管理员发起了[" + report.getName() + "-实习登记]";
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -            String businessId = uid;
 |  | 
 | 
												
													
														
															|  | -            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);
 | 
												
													
														
															|  | 
 |  | +                SpringUtil.getBean(IFlowableApi.class).startForFenNew(allMap);
 | 
												
													
														
															|  | 
 |  | +            } else {
 | 
												
													
														
															|  | 
 |  | +                mapper.insert(report);
 | 
												
													
														
															|  | 
 |  | +            }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -            Map<String, String> newMap = pingMap(procDefId, procDefKey, businessTable, businessId, title, assignee, recordType);
 |  | 
 | 
												
													
														
															|  | -            allMap.put("实习",newMap);
 |  | 
 | 
												
													
														
															|  | -            SpringUtil.getBean(IFlowableApi.class).startForFenNew(allMap);
 |  | 
 | 
												
													
														
															|  | -        } else {
 |  | 
 | 
												
													
														
															|  | -            mapper.insert(report);
 |  | 
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  |  
 |  |  
 | 
												
													
														
															|  | -
 |  | 
 | 
												
													
														
															|  |          return report;
 |  |          return report;
 | 
												
													
														
															|  |      }
 |  |      }
 | 
												
													
														
															|  |  
 |  |  
 |