浏览代码

三诺体征设备数据上传服务开发

hill9868 6 年之前
父节点
当前提交
fa201715c5

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/area/dao/BaseCityDao.java

@ -7,6 +7,8 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.jw.entity.base.area.BaseCityDO;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
 * 城市字典 数据库访问层
 *
@ -21,4 +23,10 @@ public interface BaseCityDao extends PagingAndSortingRepository<BaseCityDO, Inte
    @Query("select name from BaseCityDO where code =:code")
    String getNameByCode(@Param("code") String code);
    @Query("select code,name from BaseCityDO")
    List<BaseCityDO> getAllCity();
}

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/area/service/BaseCityService.java

@ -6,6 +6,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.area.BaseCityDO;
import java.util.List;
/**
 * 城市字典服务service
 *
@ -24,4 +26,9 @@ public class BaseCityService extends BaseJpaService<BaseCityDO, BaseCityDao> {
    public String getNameByCode(String code) {
        return baseCityDao.getNameByCode(code);
    }
    public List<BaseCityDO> getAllCity() {
       return  baseCityDao.getAllCity();
    }
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/dict/service/BaseDictJobTitleService.java

@ -19,6 +19,7 @@ public class BaseDictJobTitleService extends BaseJpaService<DictJobTitleDO, Base
    @Autowired
    private BaseDictJobTitleDao baseDictJobTitleDao;
    /**
     * 查询某一租户下的职称字典信息,如果saadId为空表示当前用户角色为超级管理员,超级管理员可以看到所有数据
     * @param saasId
@ -44,4 +45,9 @@ public class BaseDictJobTitleService extends BaseJpaService<DictJobTitleDO, Base
        baseDictJobTitleDao.delete(id);
    }
    public List<DictJobTitleDO> getBySaasId(String saasId){
        return  baseDictJobTitleDao.findBySaasId(saasId);
    }
}

+ 143 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -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("无法获取该机构的职称信息!");
        }
    }
}