| 
					
				 | 
			
			
				@ -0,0 +1,143 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.jw.hospital.endpoint.base; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.area.service.BaseCityService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.dict.service.BaseDictJobTitleService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.dict.service.DictHospitalDeptService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.doctor.service.BaseDoctorHosService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.doctor.service.BaseDoctorService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.area.BaseCityDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.dict.DictHospitalDeptDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.dict.DictJobTitleDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseOrgDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.org.service.BaseOrgService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.Envelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.http.MediaType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.GetMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * Created by cws on 2019/5/28. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RestController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RequestMapping("internet/base" ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Api(tags = "基础字典专用,用于各下拉框数据获取", description = "互联网医院") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class BaseInfoEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseCityService cityService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private DictHospitalDeptService dictHospitalDeptService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseDictJobTitleService baseDictJobTitleService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseDoctorHosService baseDoctorHosService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseDoctorService baseDoctorService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseOrgService baseOrgService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取市列表信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "/getCity") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取市列表信息", notes = "基础数据获取") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop getCity() throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BaseCityDO> res =  cityService.getAllCity(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(res != null && res.size() > 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  success(res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return success("无法获取市列表信息!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 根据市编码,获取该市范围内所有的医院列表信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "/getOrgByCity") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "根据市编码,获取该市范围内所有的医院列表信息", notes = "基础数据获取") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop getOrgByCity( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "cityCode", value = "市编码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "cityCode", required = false) String cityCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BaseOrgDO> res =  baseOrgService.getOrgByCity(cityCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(res != null && res.size() > 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  success(res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return success("该市未维护医院信息!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 根据机构编码获取部门列表信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param orgCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "/getDeptByOrgCode") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "根据机构编码获取部门列表信息", notes = "基础数据获取") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop getDeptByOrgCode( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "orgCode", value = "机构编码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "orgCode", required = false) String orgCode)  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DictHospitalDeptDO> res =  dictHospitalDeptService.getHosDeptByCode(orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(res != null && res.size() > 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  success(res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return success("无法获取该机构的部门列表信息!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 根据机构编码及科室信息获取科室内所有医生列表信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param orgCode 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "/getDoctorByOrgAndDept") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "根据机构编码及科室信息获取科室内所有医生列表信息", notes = "基础数据获取") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop getDoctorByOrgAndDept( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "orgCode", value = "机构编码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "orgCode", required = false) String orgCode, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "deptCode", value = "部门编码") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "deptCode", required = false) String deptCode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BaseDoctorHospitalDO> res =  baseDoctorHosService.getDoctorByOrgAndDept(orgCode,deptCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(res != null && res.size() > 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  success(res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return success("无法获取该机构科室下的医生信息!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取机构职称信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "/getJobBySaasId") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取机构职称信息", notes = "基础数据获取") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Envelop getJobBySaasId( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "saasId", value = "租户ID,当为空的情况下查询所有") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "saasId", required = false) String saasId)  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DictJobTitleDO> res= baseDictJobTitleService.getBySaasId(saasId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(res != null && res.size() > 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return  success(res); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return success("无法获取该机构的职称信息!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |