소스 검색

代码优化

gaodm 6 년 전
부모
커밋
c71a205674
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

+ 6 - 6
icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -1,9 +1,5 @@
 package com.diagbot.facade;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestBody;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetTopPatientInfoDTO;
@@ -18,6 +14,9 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.PatientInfoServiceImpl;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
 
 /**
  * @Description: 患者业务逻辑
@@ -42,7 +41,8 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
      */
     public PatientInfoDTO getPatientInfo(PatientInfoVO patientInfoVO) {
         RespDTO<PatientInfoDTO> patientInfoDTO = tranServiceClient.getPatientInfo(patientInfoVO);
-        if (patientInfoDTO == null || !"0".equals(patientInfoDTO.code)) {
+        if (patientInfoDTO == null
+                || !CommonErrorCode.OK.getCode().equals(patientInfoDTO.code)) {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取患者信息失败");
         }
@@ -61,7 +61,7 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "页面顶部病人医生科室信息");
         }
-        
+
         GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
 
         QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();