Browse Source

页面顶部病人信息修改

rgb 6 years ago
parent
commit
ccedbf5be6

+ 16 - 5
icss-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -1,22 +1,25 @@
 package com.diagbot.client;
 
+import java.util.List;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
 import com.diagbot.client.hystrix.TranServiceHystrix;
 import com.diagbot.dto.DoctorInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.HospitalDeptInfoDTO;
 import com.diagbot.dto.HospitalInfoDTO;
 import com.diagbot.dto.LisConfigDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.vo.DoctorInfoVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.HospitalDeptInfoVO;
 import com.diagbot.vo.HospitalInfoVO;
 import com.diagbot.vo.LisHospitalCodeVO;
 import com.diagbot.vo.PatientInfoVO;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-import java.util.List;
 
 /**
  * @Description: 调用信息对接层服务
@@ -66,4 +69,12 @@ public interface TranServiceClient {
      */
     @PostMapping("/patientInfo/getPatientInfo")
     RespDTO<PatientInfoDTO> getPatientInfo( @RequestBody PatientInfoVO patientInfoVO);
+    
+    /**
+     * 获取页面顶部病人医生科室信息
+     * @param getTopPatientInfoVO
+     * @return
+     */
+    @PostMapping("/patientInfo/getTopPatientInfo")
+    RespDTO<GetTopPatientInfoDTO> getTopPatientInfo( @RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
 }

+ 10 - 0
icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -2,12 +2,14 @@ package com.diagbot.client.hystrix;
 
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.DoctorInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.HospitalDeptInfoDTO;
 import com.diagbot.dto.HospitalInfoDTO;
 import com.diagbot.dto.LisConfigDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.vo.DoctorInfoVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.HospitalDeptInfoVO;
 import com.diagbot.vo.HospitalInfoVO;
 import com.diagbot.vo.LisHospitalCodeVO;
@@ -55,6 +57,14 @@ public class TranServiceHystrix implements TranServiceClient {
         log.error("【hystrix】调用{}异常", "getPatientInfo");
         return null;
     }
+
+	@Override
+	public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(GetTopPatientInfoVO getTopPatientInfoVO) {
+		log.error("【hystrix】调用{}异常", "getTopPatientInfo");
+		return null;
+	}
+    
+    
 //    @Override
 //    public Response<ResponseData> bayesPageData(SearchData searchData) {
 //        log.error("【hystrix】调用{}异常", "bayesPageData");

+ 0 - 3
icss-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDTO.java

@@ -1,6 +1,3 @@
-/**
- * 
- */
 package com.diagbot.dto;
 
 import java.util.Date;

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

@@ -1,5 +1,9 @@
 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;
@@ -12,12 +16,8 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.PatientInfoServiceImpl;
-import com.diagbot.util.DateUtil;
 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: 患者业务逻辑
@@ -56,10 +56,13 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
      * @return
      */
     public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
-        GetTopPatientInfoDTO getTopPatientInfoDTO = baseMapper.getTopPatientInfo(getTopPatientInfoVO);
-        getTopPatientInfoDTO.setSystemTime(DateUtil.now());
-        getTopPatientInfoDTO.setRecordId(getTopPatientInfoVO.getRecordId());
-        getTopPatientInfoDTO.setPatientAge(DateUtil.yearCompare(getTopPatientInfoDTO.getBirthday(), DateUtil.now()));
+        RespDTO<GetTopPatientInfoDTO> respDTO = tranServiceClient.getTopPatientInfo(getTopPatientInfoVO);
+        if (respDTO == null || !"0".equals(respDTO.code)) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
+                    "页面顶部病人医生科室信息");
+        }
+        
+        GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
 
         QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();
         deptInfoQ.eq("is_deleted", IsDeleteEnum.N.getKey())

+ 0 - 3
icss-service/src/main/java/com/diagbot/vo/GetTopPatientInfoVO.java

@@ -1,6 +1,3 @@
-/**
- * 
- */
 package com.diagbot.vo;
 
 import javax.validation.constraints.NotBlank;

+ 8 - 20
tran-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -1,12 +1,17 @@
 package com.diagbot.facade;
 
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.PatientInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
-import org.springframework.stereotype.Component;
 
 /**
  * @Description: 患者业务逻辑
@@ -37,32 +42,15 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
      *
      * @param getTopPatientInfoVO
      * @return
-     *//*
+     */
     public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
         GetTopPatientInfoDTO getTopPatientInfoDTO = baseMapper.getTopPatientInfo(getTopPatientInfoVO);
         getTopPatientInfoDTO.setSystemTime(DateUtil.now());
         getTopPatientInfoDTO.setRecordId(getTopPatientInfoVO.getRecordId());
         getTopPatientInfoDTO.setPatientAge(DateUtil.yearCompare(getTopPatientInfoDTO.getBirthday(), DateUtil.now()));
-
-        QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();
-        deptInfoQ.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", getTopPatientInfoDTO.getSelfDeptId());
-        DeptInfo deptInfo = deptInfoFacade.getOne(deptInfoQ);
-        if (null != deptInfo) {
-            getTopPatientInfoDTO.setSelfDeptName(deptInfo.getName());
-        }
-
-        QueryWrapper<DoctorPageMode> doctorPageModeQe = new QueryWrapper<>();
-        doctorPageModeQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-        doctorPageModeQe.eq("doctor_id", getTopPatientInfoDTO.getDoctorId());
-        DoctorPageMode doctorPageMode = doctorPageModeFacade.getOne(doctorPageModeQe);
-        if (doctorPageMode != null) {
-            getTopPatientInfoDTO.setModeClassify(doctorPageMode.getModeClassify());
-            getTopPatientInfoDTO.setModeValue(doctorPageMode.getModeValue());
-        }
         return getTopPatientInfoDTO;
     }
-*/
+
     /**
      * 通过医院编码、病人编码获取病人信息
      *

+ 13 - 9
tran-service/src/main/java/com/diagbot/web/PatientInfoController.java

@@ -1,22 +1,26 @@
 package com.diagbot.web;
 
 
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.PatientInfoFacade;
+import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
-import javax.validation.Valid;
-
 /**
  * <p>
  * 患者信息表 前端控制器
@@ -45,7 +49,7 @@ public class PatientInfoController {
     }
 
 
-   /* @ApiOperation(value = "页面顶部病人医生科室信息——查询[by:rengb]",
+   @ApiOperation(value = "页面顶部病人医生科室信息——查询[by:rengb]",
             notes = "hospitalCode:医院编号,必填<br>" +
                     "hospitalDeptCode:医院科室编号,必填<br>" +
                     "doctorCode:医院医生编号,必填<br>" +
@@ -54,6 +58,6 @@ public class PatientInfoController {
     @SysLogger("getTopPatientInfo")
     public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@Valid @RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
         return RespDTO.onSuc(patientInfoFacade.getTopPatientInfo(getTopPatientInfoVO));
-    }*/
+    }
 
 }