| | |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import com.kidgrow.usercenter.service.ISysDepartmentService; |
| | | import com.kidgrow.usercenter.service.ISysHospitalService; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.usercenter.vo.HospitalListVo; |
| | |
| | | public class SysHospitalController extends BaseController { |
| | | @Autowired |
| | | private ISysHospitalService sysHospitalService; |
| | | @Autowired |
| | | private ISysDepartmentService departmentService; |
| | | @Autowired |
| | | private ISysOrganizationService organizationService; |
| | | |
| | |
| | | sysOrganization.setOrgAttr(1); |
| | | sysOrganization.setOrgLevel(1); |
| | | sysOrganization.setOrgParentId(DictionariesConstants.ORG_PARENT_ID); |
| | | if(!sysUser.getOrganizations().isEmpty()){ |
| | | sysOrganization.setCreateUserOrgCode(sysUser.getOrganizations().get(1).getOrgCode()); |
| | | } |
| | | } else { |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | } |
| | | boolean org = organizationService.saveOrUpdate(sysOrganization); |
| | | boolean org = organizationService.saveOrUpdateSer(sysOrganization); |
| | | sysHospital.setOrgId(sysOrganization.getId()); |
| | | List<SysOrganization> organizations = sysUser.getOrganizations(); |
| | | if (organizations.size() > 0) { |
| | | sysHospital.setCreateUserOrgCode(organizations.get(organizations.size() - 1).getOrgCode()); |
| | | } |
| | | //运营平台添加的医院默认就是正式的 |
| | | if (sysHospital.getHospitalState()==null) { |
| | | sysHospital.setHospitalState(1); |
| | | } |
| | | boolean v = sysHospitalService.saveOrUpdate(sysHospital); |
| | | if (v) { |
| | |
| | | } |
| | | return sysHospitalService.updateEnabled(params); |
| | | } |
| | | |
| | | /** |
| | | * 统计医院数量 |
| | | * @param datatype 医院类型 |
| | | * 0 试用医院 |
| | | * 1 正式医院 |
| | | * 11 筛查医院 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "统计医院数量") |
| | | @GetMapping("/chartHospital") |
| | | public ResultBody chartHospital(int datatype) { |
| | | return sysHospitalService.chartHospital(datatype); |
| | | } |
| | | } |