| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.constant.CacheConstants; |
| | |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwApplication; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.SysDepartmentInfo; |
| | | import com.sinata.system.domain.SysUserDepartment; |
| | |
| | | public List<MedicalInstitutionVO> getHospitalListByRouteId(Long id) { |
| | | return baseMapper.getHospitalListByRouteId(id); |
| | | } |
| | | |
| | | /** |
| | | * 创建机构 |
| | | * |
| | | * @param mwApplication |
| | | */ |
| | | @Override |
| | | public void createDepartment(MwApplication mwApplication) { |
| | | SysDepartment parent = this.getById(mwApplication.getDepartmentId()); |
| | | if (Objects.isNull(parent)) { |
| | | throw new ServiceException("找不到对应父级组织"); |
| | | } |
| | | SysDepartment department = new SysDepartment(); |
| | | department.setParentId(mwApplication.getDepartmentId()); |
| | | department.setDepartmentName(mwApplication.getUnitName()); |
| | | department.setContactPerson(mwApplication.getConcat()); |
| | | department.setContactPhone(mwApplication.getPhone()); |
| | | department.setOrgType(mwApplication.getUnitType().equals(1) ? DepartmentEnum.MEDICAL_INSTITUTION.getCode() : DepartmentEnum.DISPOSAL_UNIT.getCode()); |
| | | department.setRegion(mwApplication.getRegion()); |
| | | department.setRelation(mwApplication.getRelation()); |
| | | department.setTreeCode(generateTreeCode(parent.getId())); |
| | | department.setOrgCode(getOrgCode(parent.getId(), department.getOrgType())); |
| | | save(department); |
| | | } |
| | | } |