|
@ -193,9 +193,6 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
//2.校验是否已经有提交
|
|
|
//2.校验是否已经有提交
|
|
|
Long currentTime = System.currentTimeMillis(); |
|
|
Long currentTime = System.currentTimeMillis(); |
|
|
Long submitId = questionnaireDetailDao.queryIsSubmit(param.getName(),currentTime); |
|
|
Long submitId = questionnaireDetailDao.queryIsSubmit(param.getName(),currentTime); |
|
|
if (ObjectUtil.isNotNull(submitId)) { |
|
|
|
|
|
return new QuestionnaireVo.SubmitInfo(); |
|
|
|
|
|
} |
|
|
|
|
|
//查询用户是否此医院此角色此部门
|
|
|
//查询用户是否此医院此角色此部门
|
|
|
Integer isExist = organizationDao.queryUserIsExist(param.getDepartmentName(),param.getPositionName(),param.getName(),userId); |
|
|
Integer isExist = organizationDao.queryUserIsExist(param.getDepartmentName(),param.getPositionName(),param.getName(),userId); |
|
|
if (0 < isExist) { |
|
|
if (0 < isExist) { |
|
@ -209,6 +206,9 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
} |
|
|
} |
|
|
return new QuestionnaireVo.SubmitInfo(); |
|
|
return new QuestionnaireVo.SubmitInfo(); |
|
|
} |
|
|
} |
|
|
|
|
|
// if (ObjectUtil.isNotNull(submitId)) {
|
|
|
|
|
|
// return new QuestionnaireVo.SubmitInfo();
|
|
|
|
|
|
// }
|
|
|
AccountManage accountManage = new AccountManage(); |
|
|
AccountManage accountManage = new AccountManage(); |
|
|
accountManage.setId(snowflake.nextId()); |
|
|
accountManage.setId(snowflake.nextId()); |
|
|
accountManage.setHospitalName(param.getName()); |
|
|
accountManage.setHospitalName(param.getName()); |
|
@ -393,7 +393,7 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
public Long createOrganization(String organizationName,String departmentName,Long userId,String memberName,String memberPhone,Long positionId |
|
|
public Long createOrganization(String organizationName,String departmentName,Long userId,String memberName,String memberPhone,Long positionId |
|
|
,String positionName,String positionCode) { |
|
|
,String positionName,String positionCode,String departmentCode) { |
|
|
//机构创建
|
|
|
//机构创建
|
|
|
boolean create = false; |
|
|
boolean create = false; |
|
|
Organization organization = organizationDao.queryByName(organizationName); |
|
|
Organization organization = organizationDao.queryByName(organizationName); |
|
@ -402,18 +402,18 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
create = true; |
|
|
create = true; |
|
|
Organization organizationNew = new Organization(); |
|
|
Organization organizationNew = new Organization(); |
|
|
organizationNew.setId(snowflake.nextId()); |
|
|
organizationNew.setId(snowflake.nextId()); |
|
|
organization.setOrganizationType(Constant.OrganizationType.HOSPITAL.status); |
|
|
organizationNew.setOrganizationType(Constant.OrganizationType.HOSPITAL.status); |
|
|
organizationNew.setName(organizationName); |
|
|
organizationNew.setName(organizationName); |
|
|
//TODO 医院等级
|
|
|
//TODO 医院等级
|
|
|
//organization.setLevelId();
|
|
|
//organization.setLevelId();
|
|
|
organizationDao.insertSelective(organization); |
|
|
organizationDao.insertSelective(organizationNew); |
|
|
organization = organizationNew; |
|
|
organization = organizationNew; |
|
|
} |
|
|
} |
|
|
//部门创建
|
|
|
//部门创建
|
|
|
OrganizationDepartment department = departmentDao.queryByOrganization(organization.getId(),departmentName); |
|
|
OrganizationDepartment department = departmentDao.queryByOrganization(organization.getId(),departmentName); |
|
|
if (ObjectUtil.isNull(department)) { |
|
|
if (ObjectUtil.isNull(department)) { |
|
|
log.info("创建一级部门:{},不存在的部门名:{}",organizationName,departmentName); |
|
|
log.info("创建一级部门:{},不存在的部门名:{}",organizationName,departmentName); |
|
|
List<OrganizationDepartmentTemplate> departmentTemplateList = departmentDao.queryTemplate(); |
|
|
List<OrganizationDepartmentTemplate> departmentTemplateList = departmentDao.queryTemplate(departmentCode); |
|
|
List<OrganizationDepartment> departmentList = departmentDao.queryAllByOid(organization.getId()); |
|
|
List<OrganizationDepartment> departmentList = departmentDao.queryAllByOid(organization.getId()); |
|
|
List<String> departmentNameList = departmentList.stream().map(OrganizationDepartment::getName).collect(Collectors.toList()); |
|
|
List<String> departmentNameList = departmentList.stream().map(OrganizationDepartment::getName).collect(Collectors.toList()); |
|
|
for (OrganizationDepartmentTemplate departmentTemplate : departmentTemplateList) { |
|
|
for (OrganizationDepartmentTemplate departmentTemplate : departmentTemplateList) { |
|
@ -440,6 +440,7 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
positionNew.setRoleName(positionName); |
|
|
positionNew.setRoleName(positionName); |
|
|
positionNew.setDepartmentId(department.getId()); |
|
|
positionNew.setDepartmentId(department.getId()); |
|
|
positionDao.insertSelective(positionNew); |
|
|
positionDao.insertSelective(positionNew); |
|
|
|
|
|
position = positionNew; |
|
|
//绑定职位类型
|
|
|
//绑定职位类型
|
|
|
OrganizationPositionType positionType = positionTypeDao.queryByCode(positionCode); |
|
|
OrganizationPositionType positionType = positionTypeDao.queryByCode(positionCode); |
|
|
if (ObjectUtil.isNotNull(positionType)) { |
|
|
if (ObjectUtil.isNotNull(positionType)) { |
|
@ -462,12 +463,12 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
organizationMemberDao.insertSelective(member); |
|
|
organizationMemberDao.insertSelective(member); |
|
|
organizationMember = member; |
|
|
organizationMember = member; |
|
|
} |
|
|
} |
|
|
Long isExist = organizationMemberPositionDao.queryByExistByMember(organizationMember.getId(),positionId,department.getId()); |
|
|
Long isExist = organizationMemberPositionDao.queryByExistByMember(organizationMember.getId(),position.getId(),department.getId()); |
|
|
if (isExist == 0) { |
|
|
if (isExist == 0) { |
|
|
log.info("添加成员职位:{}",organizationMember.getId()); |
|
|
log.info("添加成员职位:{}",organizationMember.getId()); |
|
|
OrganizationMemberPosition memberPosition = new OrganizationMemberPosition(); |
|
|
OrganizationMemberPosition memberPosition = new OrganizationMemberPosition(); |
|
|
memberPosition.setId(snowflake.nextId()); |
|
|
memberPosition.setId(snowflake.nextId()); |
|
|
memberPosition.setPositionId(positionId); |
|
|
memberPosition.setPositionId(position.getId()); |
|
|
memberPosition.setDepartmentId(department.getId()); |
|
|
memberPosition.setDepartmentId(department.getId()); |
|
|
memberPosition.setMemberId(organizationMember.getId()); |
|
|
memberPosition.setMemberId(organizationMember.getId()); |
|
|
organizationMemberPositionDao.insertSelective(memberPosition); |
|
|
organizationMemberPositionDao.insertSelective(memberPosition); |
|
@ -481,9 +482,11 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
saveProjectDto.setStartTime(System.currentTimeMillis()); |
|
|
saveProjectDto.setStartTime(System.currentTimeMillis()); |
|
|
saveProjectDto.setEndTime(System.currentTimeMillis()+315360000000L); |
|
|
saveProjectDto.setEndTime(System.currentTimeMillis()+315360000000L); |
|
|
saveProjectDto.setUrl(PropUtil.domain); |
|
|
saveProjectDto.setUrl(PropUtil.domain); |
|
|
|
|
|
saveProjectDto.setCode("carbasics"); |
|
|
Set<Long> userIds = new HashSet<>(); |
|
|
Set<Long> userIds = new HashSet<>(); |
|
|
userIds.add(userId); |
|
|
userIds.add(userId); |
|
|
saveProjectDto.setUserIdList(userIds); |
|
|
saveProjectDto.setUserIdList(userIds); |
|
|
|
|
|
log.info("调用feign新建项目:{}",saveProjectDto); |
|
|
tall3FeignClient.saveProjectList(saveProjectDto); |
|
|
tall3FeignClient.saveProjectList(saveProjectDto); |
|
|
}else { |
|
|
}else { |
|
|
log.info("tall3添加成员:{}",organization.getId()); |
|
|
log.info("tall3添加成员:{}",organization.getId()); |
|
@ -495,6 +498,7 @@ public class QuestionnaireService implements IQuestionnaireService{ |
|
|
userIds.add(userId); |
|
|
userIds.add(userId); |
|
|
saveUserProject.setProjectId(projectIds); |
|
|
saveUserProject.setProjectId(projectIds); |
|
|
saveUserProject.setUserId(userIds); |
|
|
saveUserProject.setUserId(userIds); |
|
|
|
|
|
log.info("调用feign添加成员:{}",saveUserProject); |
|
|
tall3FeignClient.saveUserProject(saveUserProject); |
|
|
tall3FeignClient.saveUserProject(saveUserProject); |
|
|
} |
|
|
} |
|
|
return organization.getId(); |
|
|
return organization.getId(); |
|
|