| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private ISysHospitalService sysHospitalService; |
| | | @Autowired |
| | | private ISysDepartmentService departmentService; |
| | | @Autowired |
| | | private ISysOrganizationService organizationService; |
| | | |
| | | /** |
| | |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return sysHospitalService.findHospitalList(params,user); |
| | | return sysHospitalService.findHospitalList(params, user); |
| | | } |
| | | |
| | | @PostMapping("findAll") |
| | |
| | | @PostMapping("findAllByMap") |
| | | @ApiOperation(value = "查询所有列表") |
| | | public ResultBody<SysHospital> findAllByMap(@RequestBody Map<String, Object> params) { |
| | | return sysHospitalService.findAll(params); |
| | | return sysHospitalService.findAll(params); |
| | | } |
| | | |
| | | /** |
| | |
| | | SysHospital model = sysHospitalService.getById(id); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | */ |
| | |
| | | return ResultBody.ok().data(null).msg(""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据SysHospital当做查询条件进行查询 |
| | | */ |
| | |
| | | SysHospital model = sysHospitalService.findByObject(sysHospital); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改医院logo |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @GetMapping("/updateLogo") |
| | | public ResultBody updateLogo(@RequestBody Map<String, Object> params) |
| | | { |
| | | @PostMapping("/updateLogo") |
| | | public ResultBody updateLogo(@RequestBody Map<String, Object> params) { |
| | | return sysHospitalService.updateLogo(params); |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | | */ |
| | |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | //先检查该医院是否存在组织信息 |
| | | SysOrganization sysOrganization=new SysOrganization(); |
| | | if(sysHospital.getOrgId()!=null){ |
| | | sysOrganization.setId(sysHospital.getOrgId());} |
| | | else{ |
| | | SysOrganization sysOrganization = new SysOrganization(); |
| | | if (sysHospital.getOrgId() != null) { |
| | | sysOrganization.setId(sysHospital.getOrgId()); |
| | | } else { |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | sysOrganization.setOrgParentId(DictionariesConstants.ORG_PARENT_ID); |
| | | } |
| | | sysOrganization=organizationService.findByObject(sysOrganization); |
| | | if(sysOrganization==null) |
| | | { |
| | | sysOrganization = organizationService.findByObject(sysOrganization); |
| | | if (sysOrganization == null) { |
| | | //创建一个组织 |
| | | sysOrganization=new SysOrganization(); |
| | | sysOrganization = new SysOrganization(); |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | sysOrganization.setOrgAttr(1); |
| | | sysOrganization.setOrgLevel(1); |
| | | sysOrganization.setOrgParentId(DictionariesConstants.ORG_PARENT_ID); |
| | | } |
| | | else |
| | | { |
| | | } 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 (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); |
| | | } |
| | | } |