|
@@ -11,6 +11,7 @@ import com.diagbot.entity.PatientInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
+import com.diagbot.util.RespDTOUtil;
|
|
|
import com.diagbot.vo.GetTopPatientInfoVO;
|
|
|
import com.diagbot.vo.PatientInfoVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -43,8 +44,7 @@ public class PatientInfoFacade {
|
|
|
*/
|
|
|
public PatientInfoDTO getPatientInfo(PatientInfoVO patientInfoVO) {
|
|
|
RespDTO<PatientInfoDTO> patientInfoDTO = tranServiceClient.getPatientInfo(patientInfoVO);
|
|
|
- if (patientInfoDTO == null
|
|
|
- || !CommonErrorCode.OK.getCode().equals(patientInfoDTO.code)) {
|
|
|
+ if (RespDTOUtil.respIsNG(patientInfoDTO)) {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"获取患者信息失败");
|
|
|
}
|
|
@@ -59,7 +59,7 @@ public class PatientInfoFacade {
|
|
|
*/
|
|
|
public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
|
|
|
RespDTO<GetTopPatientInfoDTO> respDTO = tranServiceClient.getTopPatientInfo(getTopPatientInfoVO);
|
|
|
- if (respDTO == null || !"0".equals(respDTO.code)) {
|
|
|
+ if (RespDTOUtil.respIsNG(respDTO)) {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"页面顶部病人医生科室信息");
|
|
|
}
|
|
@@ -94,8 +94,7 @@ public class PatientInfoFacade {
|
|
|
*/
|
|
|
public Map<Long, PatientInfo> patientInfoMapByIds(List<Long> ids) {
|
|
|
RespDTO<Map<Long, PatientInfo>> retData = tranServiceClient.patientInfoMapByIds(ids);
|
|
|
- if (retData == null
|
|
|
- || !CommonErrorCode.OK.getCode().equals(retData.code)) {
|
|
|
+ if (RespDTOUtil.respIsNG(retData)) {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
"获取患者信息失败");
|
|
|
}
|