|
@@ -1,11 +1,17 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.diagbot.dto.MedoupDTO;
|
|
|
+import com.diagbot.dto.RegionDTO;
|
|
|
+import com.diagbot.dto.RegionMedoupDTO;
|
|
|
import com.diagbot.entity.*;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.service.impl.BasDoctorInfoServiceImpl;
|
|
|
+import com.diagbot.service.impl.MedoupServiceImpl;
|
|
|
+import com.diagbot.service.impl.RegionServiceImpl;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
+import com.diagbot.vo.GetRegionAndMedoupInfoVO;
|
|
|
import com.diagbot.vo.data.BasDoctorInfoVO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -29,6 +35,53 @@ public class BasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
|
|
|
BasDeptInfoFacade basDeptInfoFacade;
|
|
|
@Autowired
|
|
|
BehospitalInfoFacade behospitalInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private RegionServiceImpl regionService;
|
|
|
+ @Autowired
|
|
|
+ private MedoupServiceImpl medoupService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取医院医生下拉列表信息
|
|
|
+ *
|
|
|
+ * @param getRegionAndMedoupInfoVO
|
|
|
+ * @return 医院医生下拉列表信息
|
|
|
+ */
|
|
|
+ public RegionMedoupDTO getRegionAndMedoupList(GetRegionAndMedoupInfoVO getRegionAndMedoupInfoVO) {
|
|
|
+ getRegionAndMedoupInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
|
|
|
+ RegionMedoupDTO regionMedoupDTO = new RegionMedoupDTO();
|
|
|
+ if("1".equals(getRegionAndMedoupInfoVO.getMark())){
|
|
|
+ List<Region> regions = regionService.lambdaQuery()
|
|
|
+ .eq(Region::getIsDeleted, IsDeleteEnum.N.getKey())
|
|
|
+ .eq(Region::getHospitalId, getRegionAndMedoupInfoVO.getHospitalId())
|
|
|
+ .like(StringUtils.isNotBlank(getRegionAndMedoupInfoVO.getRegionStr()), Region::getName,getRegionAndMedoupInfoVO.getRegionStr())
|
|
|
+ .select(Region::getName, Region::getCode).list();
|
|
|
+ List<RegionDTO> regionDTOS = new ArrayList<>();
|
|
|
+
|
|
|
+ regions.forEach(region->{
|
|
|
+ RegionDTO regionDTO = new RegionDTO();
|
|
|
+ regionDTO.setCode(region.getCode());
|
|
|
+ regionDTO.setName(region.getName());
|
|
|
+ regionDTOS.add(regionDTO);
|
|
|
+ });
|
|
|
+ regionMedoupDTO.setRegions(regionDTOS);
|
|
|
+ }
|
|
|
+ if("2".equals(getRegionAndMedoupInfoVO.getMark())){
|
|
|
+ List<MedoupDTO> medoupDTOS = new ArrayList<>();
|
|
|
+ List<Medoup> medoups = medoupService.lambdaQuery()
|
|
|
+ .eq(Medoup::getIsDeleted, IsDeleteEnum.N.getKey())
|
|
|
+ .like(StringUtils.isNotBlank(getRegionAndMedoupInfoVO.getMedoupStr()), Medoup::getName,getRegionAndMedoupInfoVO.getMedoupStr())
|
|
|
+ .select(Medoup::getName, Medoup::getCode).list();
|
|
|
+ medoups.forEach(medoup->{
|
|
|
+ MedoupDTO medoupDTO = new MedoupDTO();
|
|
|
+ medoupDTO.setCode(medoup.getCode());
|
|
|
+ medoupDTO.setName(medoup.getName());
|
|
|
+ medoupDTOS.add(medoupDTO);
|
|
|
+ });
|
|
|
+ regionMedoupDTO.setMedoups(medoupDTOS);
|
|
|
+ }
|
|
|
+ return regionMedoupDTO;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 获取医院医生下拉列表信息
|