|  | @@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.SecurityUtils;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.TokenProvider;
 | 
	
		
			
				|  |  |  import com.jeeplus.core.query.QueryWrapperGenerator;
 | 
	
		
			
				|  |  | +import com.jeeplus.flowable.feign.IFlowableApi;
 | 
	
		
			
				|  |  |  import com.jeeplus.human.practice.register.domain.Registration;
 | 
	
		
			
				|  |  |  import com.jeeplus.human.practice.register.domain.RegistrationExperience;
 | 
	
		
			
				|  |  |  import com.jeeplus.human.practice.register.domain.RegistrationFamilyMembers;
 | 
	
	
		
			
				|  | @@ -162,9 +163,9 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 | 
	
		
			
				|  |  |                  //发送短信通知
 | 
	
		
			
				|  |  |                  String officeName = "";
 | 
	
		
			
				|  |  |                  OfficeDTO office = SpringUtil.getBean(IOfficeApi.class).getOfficeById(report.getPracticeOffice());
 | 
	
		
			
				|  |  | -                if (office.getTenantDTO().getId().equals("10003")){
 | 
	
		
			
				|  |  | +                if (office.getTenantId().equals("10003")){
 | 
	
		
			
				|  |  |                      officeName = "兴光会计";
 | 
	
		
			
				|  |  | -                }else if (office.getTenantDTO().getId().equals("10004")) {
 | 
	
		
			
				|  |  | +                }else if (office.getTenantId().equals("10004")) {
 | 
	
		
			
				|  |  |                      officeName = "中审";
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -233,7 +234,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public Registration add(Registration reportData) throws Exception{
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -//        UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
 | 
	
		
			
				|  |  | +        String currentToken = TokenProvider.getCurrentToken();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Registration report = new Registration();
 | 
	
		
			
				|  |  |          BeanUtils.copyProperties(reportData, report);
 | 
	
	
		
			
				|  | @@ -244,6 +245,9 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 | 
	
		
			
				|  |  |          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();
 | 
	
	
		
			
				|  | @@ -281,11 +285,61 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (null == currentToken) {
 | 
	
		
			
				|  |  | +            //发起实习登记流程
 | 
	
		
			
				|  |  | +            Map map = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("实习登记");
 | 
	
		
			
				|  |  | +            String procDefId = map.get("id")+"";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            report.setProcessDefinitionId(procDefId);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            Map<String ,Map<String,String >>  allMap = new HashMap<>();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            String procDefKey = map.get("key")+"";
 | 
	
		
			
				|  |  | +            String businessTable = "human_resources_practice_registration";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            String businessId = uid;
 | 
	
		
			
				|  |  | +            String title = "实习登记";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //获取实习信息审核员信息
 | 
	
		
			
				|  |  | +            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);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          mapper.insert(report);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          return report;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    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);
 | 
	
		
			
				|  |  | +        map.put("businessId", businessId);
 | 
	
		
			
				|  |  | +        map.put("title", title);
 | 
	
		
			
				|  |  | +        map.put("assignee", assignee);
 | 
	
		
			
				|  |  | +        map.put("recordType", recordType);
 | 
	
		
			
				|  |  | +        return map;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    public String getAssignee(String roleId){
 | 
	
		
			
				|  |  | +        List<UserDTO> userDTOS = SpringUtil.getBean(IUserApi.class).findListByRoleId(roleId);
 | 
	
		
			
				|  |  | +        StringJoiner idJoiner = new StringJoiner(",");
 | 
	
		
			
				|  |  | +        for (UserDTO user : userDTOS) {
 | 
	
		
			
				|  |  | +            idJoiner.add(String.valueOf(user.getId()));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return idJoiner.toString();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 根据实习生的用户id修改实习状态
 | 
	
		
			
				|  |  |       * @param createById
 |