|
@@ -1,13 +1,18 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.diagbot.client.TranServiceClient;
|
|
import com.diagbot.dto.DeptInfoDTO;
|
|
import com.diagbot.dto.DeptInfoDTO;
|
|
|
|
+import com.diagbot.dto.HospitalDeptInfoDTO;
|
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.entity.DeptInfo;
|
|
import com.diagbot.entity.DeptInfo;
|
|
-import com.diagbot.entity.HospitalDept;
|
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
|
+import com.diagbot.exception.CommonException;
|
|
import com.diagbot.service.impl.DeptInfoServiceImpl;
|
|
import com.diagbot.service.impl.DeptInfoServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.vo.DeptInfoVO;
|
|
import com.diagbot.vo.DeptInfoVO;
|
|
|
|
+import com.diagbot.vo.HospitalDeptInfoVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -20,7 +25,7 @@ import org.springframework.stereotype.Component;
|
|
public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- HospitalDeptFacade hospitalDeptFacade;
|
|
|
|
|
|
+ TranServiceClient tranServiceClient;
|
|
/**
|
|
/**
|
|
* 获取科室信息
|
|
* 获取科室信息
|
|
*
|
|
*
|
|
@@ -28,14 +33,16 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public DeptInfoDTO getDeptInfo(DeptInfoVO deptInfoVO) {
|
|
public DeptInfoDTO getDeptInfo(DeptInfoVO deptInfoVO) {
|
|
- QueryWrapper<HospitalDept> hospitalDeptQueryWrapper = new QueryWrapper<>();
|
|
|
|
- hospitalDeptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
- .eq("hospital_code",deptInfoVO.getHospitalCode())
|
|
|
|
- .eq("code",deptInfoVO.getDeptCode());
|
|
|
|
- HospitalDept hospitalDept = hospitalDeptFacade.getOne(hospitalDeptQueryWrapper);
|
|
|
|
|
|
+ HospitalDeptInfoVO hospitalDeptInfoVO = new HospitalDeptInfoVO();
|
|
|
|
+ BeanUtil.copyProperties(deptInfoVO,hospitalDeptInfoVO);
|
|
|
|
+ RespDTO<HospitalDeptInfoDTO> hospitalDeptInfoDTORespDTO = tranServiceClient.getHospitalDeptInfo(hospitalDeptInfoVO);
|
|
|
|
+ if (hospitalDeptInfoDTORespDTO == null || !"0".equals(hospitalDeptInfoDTORespDTO.code)) {
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
|
+ "获取用医生信息失败");
|
|
|
|
+ }
|
|
QueryWrapper<DeptInfo> deptInfoDTOQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<DeptInfo> deptInfoDTOQueryWrapper = new QueryWrapper<>();
|
|
deptInfoDTOQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
deptInfoDTOQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("id",hospitalDept.getDeptId());
|
|
|
|
|
|
+ .eq("id",hospitalDeptInfoDTORespDTO.data.getDeptId());
|
|
DeptInfo deptInfo = this.getOne(deptInfoDTOQueryWrapper);
|
|
DeptInfo deptInfo = this.getOne(deptInfoDTOQueryWrapper);
|
|
DeptInfoDTO deptInfoDTO = new DeptInfoDTO();
|
|
DeptInfoDTO deptInfoDTO = new DeptInfoDTO();
|
|
BeanUtil.copyProperties(deptInfo,deptInfoDTO);
|
|
BeanUtil.copyProperties(deptInfo,deptInfoDTO);
|