|
|
@ -93,6 +93,7 @@ public class AsyncService implements IAsyncService { |
|
|
|
newOrganization.setId(snowflake.nextId()); |
|
|
|
newOrganization.setName(param.getHospitalName()); |
|
|
|
newOrganization.setLevel(param.getHospitalLevel()); |
|
|
|
newOrganization.setOrganizationType(Constant.OrganizationType.HOSPITAL.status); |
|
|
|
organizationDao.insertSelective(newOrganization); |
|
|
|
//创建部门
|
|
|
|
OrganizationDepartment department = new OrganizationDepartment(); |
|
|
@ -117,9 +118,16 @@ public class AsyncService implements IAsyncService { |
|
|
|
//创建项目
|
|
|
|
createProject(newOrganization.getId(),param,userId); |
|
|
|
PatientDto.SavePatient savePatient = new PatientDto.SavePatient(); |
|
|
|
firstAidService.getFirstAid(savePatient,userId,(byte)1,organization.getId()); |
|
|
|
firstAidService.getFirstAid(savePatient,userId,(byte)1,newOrganization.getId()); |
|
|
|
}else { |
|
|
|
OrganizationDepartment department = departmentDao.queryByOrganization(organization.getId(),departmentCode); |
|
|
|
//查询项目机构是否绑定项目
|
|
|
|
OrganizationProject project = organizationProjectDao.queryByOrganizationId(organization.getId()); |
|
|
|
if (ObjectUtil.isNull(project)) { |
|
|
|
createProject(organization.getId(),param,userId); |
|
|
|
PatientDto.SavePatient savePatient = new PatientDto.SavePatient(); |
|
|
|
firstAidService.getFirstAid(savePatient,userId,(byte)1,organization.getId()); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNull(department)) { |
|
|
|
//创建部门
|
|
|
|
OrganizationDepartment newDepartment = new OrganizationDepartment(); |
|
|
@ -141,10 +149,6 @@ public class AsyncService implements IAsyncService { |
|
|
|
position.setPositionId(param.getPositionId()); |
|
|
|
position.setDepartmentId(department.getId()); |
|
|
|
organizationMemberPositionMapper.insertSelective(position); |
|
|
|
//创建项目
|
|
|
|
createProject(organization.getId(),param,userId); |
|
|
|
PatientDto.SavePatient savePatient = new PatientDto.SavePatient(); |
|
|
|
firstAidService.getFirstAid(savePatient,userId,(byte)1,organization.getId()); |
|
|
|
}else { |
|
|
|
OrganizationMember member = new OrganizationMember(); |
|
|
|
member.setId(snowflake.nextId()); |
|
|
@ -158,10 +162,6 @@ public class AsyncService implements IAsyncService { |
|
|
|
position.setPositionId(param.getPositionId()); |
|
|
|
position.setDepartmentId(department.getId()); |
|
|
|
organizationMemberPositionMapper.insertSelective(position); |
|
|
|
//创建项目
|
|
|
|
createProject(organization.getId(),param,userId); |
|
|
|
PatientDto.SavePatient savePatient = new PatientDto.SavePatient(); |
|
|
|
firstAidService.getFirstAid(savePatient,userId,(byte)1,organization.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|