Browse Source

患者登录接口添加

rgb 5 years ago
parent
commit
8da74236fa

+ 10 - 0
prec-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -2,8 +2,11 @@ package com.diagbot.client;
 
 import com.diagbot.client.hystrix.TranServiceHystrix;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SignInDTO;
 import com.diagbot.dto.SysSetInfoDTO;
 import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.SignInVO;
+
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -24,4 +27,11 @@ public interface TranServiceClient {
      */
     @PostMapping("/sysSet/getSysSetInfoDatas")
     RespDTO<List<SysSetInfoDTO>> getSysSetInfoDatas(@Valid @RequestBody HospitalSetVO hospitalSetVO);
+    
+    /**
+     * @param signInVO
+     * @return
+     */
+    @PostMapping("/patientInfo/signIn")
+    RespDTO<List<SignInDTO>> signIn(@RequestBody SignInVO signInVO);
 }

+ 17 - 4
prec-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -1,14 +1,19 @@
 package com.diagbot.client.hystrix;
 
+import java.util.List;
+
+import javax.validation.Valid;
+
+import org.springframework.stereotype.Component;
+
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SignInDTO;
 import com.diagbot.dto.SysSetInfoDTO;
 import com.diagbot.vo.HospitalSetVO;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
+import com.diagbot.vo.SignInVO;
 
-import javax.validation.Valid;
-import java.util.List;
+import lombok.extern.slf4j.Slf4j;
 
 /**
  * @Description: 调用信息对接层服务
@@ -23,4 +28,12 @@ public class TranServiceHystrix implements TranServiceClient {
         log.error("【hystrix】调用{}异常", "getSysSetInfoDatas");
         return null;
     }
+
+	@Override
+	public RespDTO<List<SignInDTO>> signIn(SignInVO signInVO) {
+		log.error("【hystrix】调用{}异常", "signIn");
+		return null;
+	}
+    
+    
 }

+ 86 - 0
prec-service/src/main/java/com/diagbot/dto/SignInDTO.java

@@ -0,0 +1,86 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:56
+ */
+@ApiModel(value="患者登录接口出参")
+@Getter
+@Setter
+public class SignInDTO{
+	
+	/**
+     * 医院编码
+     */
+	@ApiModelProperty(value="医院编码")
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+	@ApiModelProperty(value="医院名称")
+    private String hospitalName;
+	
+	/**
+     * 医院科室编码
+     */
+	@ApiModelProperty(value="医院科室编码")
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+	@ApiModelProperty(value="医院科室名称")
+    private String hospitalDeptName;
+	
+	/**
+     * 医生编码
+     */
+	@ApiModelProperty(value="医生编码")
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+	@ApiModelProperty(value="医生姓名")
+    private String doctorName;
+	
+	/**
+     * 病人编号
+     */
+	@ApiModelProperty(value="病人编号")
+    private String patientCode;
+	
+	/**
+     * 病人姓名
+     */
+	@ApiModelProperty(value="病人姓名")
+    private String patientName;
+	
+	/**
+	 * 挂号时间
+	 */
+	@ApiModelProperty(value="挂号时间")
+	private String recordTime;
+	
+	/**
+     * 病历号
+     */
+	@ApiModelProperty(value="病历号")
+	private String recordId;
+	
+	/**
+     * 挂号信息
+     */
+	@ApiModelProperty(value="挂号信息")
+	private String registerNum;
+	
+
+		
+}

+ 24 - 4
prec-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -1,13 +1,18 @@
 package com.diagbot.facade;
 
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
 import com.diagbot.client.AiptServiceClient;
+import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SignInDTO;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.GetTopPatientInfoVO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestBody;
+import com.diagbot.vo.SignInVO;
 
 /**
  * @Description: 患者业务逻辑
@@ -19,6 +24,9 @@ public class PatientInfoFacade {
 
     @Autowired
     private AiptServiceClient aiptServiceClient;
+    
+    @Autowired
+    private TranServiceClient tranServiceClient;
 
     /**
      * 页面顶部病人医生科室信息查询
@@ -26,7 +34,7 @@ public class PatientInfoFacade {
      * @param getTopPatientInfoVO
      * @return
      */
-    public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
+    public GetTopPatientInfoDTO getTopPatientInfo(GetTopPatientInfoVO getTopPatientInfoVO) {
         RespDTO<GetTopPatientInfoDTO> respDTO = aiptServiceClient.getTopPatientInfo(getTopPatientInfoVO);
         RespDTOUtil.respNGDealCover(respDTO, "获取页面顶部病人医生科室信息失败");
 
@@ -34,5 +42,17 @@ public class PatientInfoFacade {
 
         return getTopPatientInfoDTO;
     }
+    
+    /**
+     * 患者登录
+     * @param signInVO
+     * @return
+     */
+    public List<SignInDTO> signIn(SignInVO signInVO) {
+        RespDTO<List<SignInDTO>> respDTO = tranServiceClient.signIn(signInVO);
+        RespDTOUtil.respNGDealCover(respDTO, "患者登录失败");
+        return respDTO.data;
+    }
+    
 
 }

+ 36 - 0
prec-service/src/main/java/com/diagbot/vo/SignInVO.java

@@ -0,0 +1,36 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value="患者登录接口传参")
+@Getter
+@Setter
+public class SignInVO {
+	
+	/**
+     * 患者信息类型,101-身份证、102-病历号、103-手机号、104-市民卡卡号
+     */
+	@ApiModelProperty(value="患者信息类型,101-身份证、102-病历号、103-手机号、104-市民卡卡号",required=true)
+	@NotBlank(message="患者信息类型必传")
+    private String patientInfoType;
+	
+	/**
+     * 患者信息
+     */
+	@ApiModelProperty(value="患者信息",required=true)
+	@NotBlank(message="患者信息必传")
+    private String patientInfo;
+
+   
+    
+}

+ 20 - 7
prec-service/src/main/java/com/diagbot/web/PatientInfoController.java

@@ -1,20 +1,26 @@
 package com.diagbot.web;
 
 
+import java.util.List;
+
+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.RespDTO;
+import com.diagbot.dto.SignInDTO;
 import com.diagbot.facade.PatientInfoFacade;
 import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.SignInVO;
+
 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 javax.validation.Valid;
 
 /**
  * <p>
@@ -43,5 +49,12 @@ public class PatientInfoController {
     public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@Valid @RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
         return RespDTO.onSuc(patientInfoFacade.getTopPatientInfo(getTopPatientInfoVO));
     }
+    
+    @ApiOperation(value = "患者登录[by:rengb]")
+    @PostMapping("/signIn")
+    @SysLogger("signIn")
+    public RespDTO<List<SignInDTO>> signIn(@Valid @RequestBody SignInVO signInVO) {
+        return RespDTO.onSuc(patientInfoFacade.signIn(signInVO));
+    }
 
 }

+ 92 - 0
tran-service/src/main/java/com/diagbot/dto/SignInDTO.java

@@ -0,0 +1,92 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:56
+ */
+@ApiModel(value="患者登录接口出参")
+@Getter
+@Setter
+public class SignInDTO{
+	
+	/**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalName;
+	
+	/**
+     * 医院科室编码
+     */
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    private String hospitalDeptName;
+	
+	/**
+     * 医生编码
+     */
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+	
+	/**
+     * 病人编号
+     */
+    private String patientCode;
+	
+	/**
+     * 病人姓名
+     */
+    private String patientName;
+	
+	/**
+	 * 挂号时间
+	 */
+	private String recordTime;
+	
+	/**
+     * 病历号
+     */
+	private String recordId;
+	
+	/**
+     * 挂号信息
+     */
+	private String registerNum;
+
+	public SignInDTO(String hospitalCode, String hospitalName, String hospitalDeptCode, String hospitalDeptName,
+			String doctorCode, String doctorName, String patientCode, String patientName, String recordTime,
+			String recordId, String registerNum) {
+		this.hospitalCode = hospitalCode;
+		this.hospitalName = hospitalName;
+		this.hospitalDeptCode = hospitalDeptCode;
+		this.hospitalDeptName = hospitalDeptName;
+		this.doctorCode = doctorCode;
+		this.doctorName = doctorName;
+		this.patientCode = patientCode;
+		this.patientName = patientName;
+		this.recordTime = recordTime;
+		this.recordId = recordId;
+		this.registerNum = registerNum;
+	}
+	
+	
+	
+
+		
+}

+ 15 - 0
tran-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -9,11 +9,14 @@ import org.springframework.web.bind.annotation.RequestBody;
 
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
+import com.diagbot.dto.SignInDTO;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.service.impl.PatientInfoServiceImpl;
 import com.diagbot.util.DateUtil;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
+import com.diagbot.vo.SignInVO;
+import com.google.common.collect.Lists;
 
 /**
  * @Description: 患者业务逻辑
@@ -62,6 +65,18 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
     	Map<Long, PatientInfo> patientInfoMap = this.listByIds(ids).stream().filter(i -> i.getIsDeleted().equals("N")).collect(Collectors.toMap(PatientInfo::getId, i -> i));
     	return patientInfoMap;
     }
+   
+    /**
+     * 患者登录
+     * @param signInVO
+     * @return
+     */
+    public List<SignInDTO> signIn(SignInVO signInVO) {
+    	List<SignInDTO> list = Lists.newArrayList();
+    	list.add(new SignInDTO("A001", "浙江大学医学院附属邵逸夫医院", "D01", "全科", "YS001", "付", "1600", "沈强", "2019-08-19 19:20:50", "44", "15"));
+    	list.add(new SignInDTO("A001", "浙江大学医学院附属邵逸夫医院", "D02", "儿科", "YS004", "顾testjdy", "1600", "沈强", "2019-08-19 11:51:32", "44", "18"));
+    	return list;
+    }
     
 
 }

+ 29 - 0
tran-service/src/main/java/com/diagbot/vo/SignInVO.java

@@ -0,0 +1,29 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value="患者登录接口传参")
+@Getter
+@Setter
+public class SignInVO {
+	
+	/**
+     * 患者信息类型,101-身份证、102-病历号、103-手机号、104-市民卡卡号
+     */
+    private String patientInfoType;
+	
+	/**
+     * 患者信息
+     */
+    private String patientInfo;
+
+   
+    
+}

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

@@ -16,10 +16,12 @@ import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SignInDTO;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.facade.PatientInfoFacade;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
+import com.diagbot.vo.SignInVO;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -73,5 +75,12 @@ public class PatientInfoController {
        Map<Long, PatientInfo> result = patientInfoFacade.patientInfoMapByIds(ids);
        return RespDTO.onSuc(result);
    }
+   
+   @ApiOperation(value = "患者登录[by:rengb]")
+   @PostMapping("/signIn")
+   @SysLogger("signIn")
+   public RespDTO<List<SignInDTO>> signIn(@RequestBody SignInVO signInVO) {
+       return RespDTO.onSuc(patientInfoFacade.signIn(signInVO));
+   }
 
 }