Browse Source

Merge branch 'develop' into dev/icss20191113_treatment

gaodm 5 years ago
parent
commit
636532a6de
100 changed files with 4671 additions and 808 deletions
  1. 11 0
      aipt-service/src/main/java/com/diagbot/client/TranServiceClient.java
  2. 8 0
      aipt-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  3. 173 0
      aipt-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDjDTO.java
  4. 1 1
      aipt-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java
  5. 1 1
      aipt-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java
  6. 23 0
      aipt-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  7. 1 1
      aipt-service/src/main/java/com/diagbot/facade/TransferFacade.java
  8. 60 0
      aipt-service/src/main/java/com/diagbot/vo/GetTopPatientInfoDjVO.java
  9. 9 0
      aipt-service/src/main/java/com/diagbot/web/PatientInfoController.java
  10. 2 1
      common/src/main/java/com/diagbot/enums/VisibleIdTypeEnum.java
  11. 93 0
      common/src/main/java/com/diagbot/util/IdCard.java
  12. 39 39
      data-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java
  13. 57 0
      docs/022.20191118预问诊新对接/init_prec.sql
  14. 35 0
      docs/022.20191118预问诊新对接/init_tran.sql
  15. 5 0
      icss-service/src/main/java/com/diagbot/client/TranServiceClient.java
  16. 8 0
      icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  17. 54 0
      icss-service/src/main/java/com/diagbot/dto/GetHospitalRankInfoDTO.java
  18. 39 44
      icss-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java
  19. 14 0
      icss-service/src/main/java/com/diagbot/facade/SysSetFacade.java
  20. 27 0
      icss-service/src/main/java/com/diagbot/vo/GetHospitalRankInfoVO.java
  21. 9 0
      icss-service/src/main/java/com/diagbot/web/SysSetController.java
  22. 1 1
      knowledgeman-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java
  23. 11 0
      prec-service/src/main/java/com/diagbot/client/AiptServiceClient.java
  24. 17 1
      prec-service/src/main/java/com/diagbot/client/TranServiceClient.java
  25. 8 0
      prec-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java
  26. 15 2
      prec-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  27. 173 0
      prec-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDjDTO.java
  28. 1 0
      prec-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  29. 47 36
      prec-service/src/main/java/com/diagbot/dto/SignInDTO.java
  30. 25 0
      prec-service/src/main/java/com/diagbot/dto/SysHospitalDTO.java
  31. 19 0
      prec-service/src/main/java/com/diagbot/dto/SysHospitalDeptInfoDTO.java
  32. 39 44
      prec-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java
  33. 84 33
      prec-service/src/main/java/com/diagbot/entity/InquiryInfo.java
  34. 432 0
      prec-service/src/main/java/com/diagbot/entity/InquiryQuote.java
  35. 5 0
      prec-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  36. 50 0
      prec-service/src/main/java/com/diagbot/enums/InquiryQuotedTypeEnum.java
  37. 40 0
      prec-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  38. 138 4
      prec-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  39. 13 0
      prec-service/src/main/java/com/diagbot/facade/InquiryQuoteFacade.java
  40. 7 5
      prec-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  41. 46 35
      prec-service/src/main/java/com/diagbot/facade/SysSetFacade.java
  42. 36 0
      prec-service/src/main/java/com/diagbot/idc/AbstractIdCreater.java
  43. 26 0
      prec-service/src/main/java/com/diagbot/idc/IdCreater.java
  44. 76 0
      prec-service/src/main/java/com/diagbot/idc/VisibleIdCreater.java
  45. 16 0
      prec-service/src/main/java/com/diagbot/mapper/InquiryQuoteMapper.java
  46. 16 0
      prec-service/src/main/java/com/diagbot/service/InquiryQuoteService.java
  47. 20 0
      prec-service/src/main/java/com/diagbot/service/impl/InquiryQuoteServiceImpl.java
  48. 33 24
      prec-service/src/main/java/com/diagbot/vo/GetInquiryDetailVO.java
  49. 60 0
      prec-service/src/main/java/com/diagbot/vo/GetTopPatientInfoDjVO.java
  50. 12 2
      prec-service/src/main/java/com/diagbot/vo/HisInquirysVO.java
  51. 39 0
      prec-service/src/main/java/com/diagbot/vo/InquiryQuoteDeptVO.java
  52. 69 0
      prec-service/src/main/java/com/diagbot/vo/InquiryQuoteDoctorVO.java
  53. 162 0
      prec-service/src/main/java/com/diagbot/vo/InquiryQuoteForIcssVO.java
  54. 127 0
      prec-service/src/main/java/com/diagbot/vo/InquiryQuotePatientVO.java
  55. 95 0
      prec-service/src/main/java/com/diagbot/vo/InquiryQuoteVO.java
  56. 1 1
      prec-service/src/main/java/com/diagbot/vo/RecordCheckVO.java
  57. 22 8
      prec-service/src/main/java/com/diagbot/vo/SaveInquiryVO.java
  58. 20 2
      prec-service/src/main/java/com/diagbot/vo/SignInVO.java
  59. 18 0
      prec-service/src/main/java/com/diagbot/vo/SysHospitalCodeVO.java
  60. 18 0
      prec-service/src/main/java/com/diagbot/web/InquiryInfoController.java
  61. 4 2
      prec-service/src/main/java/com/diagbot/web/PatientInfoController.java
  62. 54 44
      prec-service/src/main/java/com/diagbot/web/SysSetController.java
  63. 4 0
      prec-service/src/main/resources/mapper/InquiryInfoMapper.xml
  64. 40 0
      prec-service/src/main/resources/mapper/InquiryQuoteMapper.xml
  65. 3 1
      prec-service/src/test/java/com/diagbot/CodeGeneration.java
  66. 1 0
      precman-service/src/main/java/com/diagbot/dto/QuestionDTO.java
  67. 5 0
      precman-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  68. 1 0
      precman-service/src/main/java/com/diagbot/entity/wrapper/QuestionWrapper.java
  69. 1 0
      precman-service/src/main/resources/mapper/QuestionInfoMapper.xml
  70. 45 0
      tran-service/src/main/java/com/diagbot/dto/GetHospitalRankInfoDTO.java
  71. 145 0
      tran-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDjDTO.java
  72. 48 0
      tran-service/src/main/java/com/diagbot/dto/RegisterInfoDTO.java
  73. 46 0
      tran-service/src/main/java/com/diagbot/dto/RegisterInfoDetailDTO.java
  74. 55 45
      tran-service/src/main/java/com/diagbot/dto/SignInDTO.java
  75. 25 0
      tran-service/src/main/java/com/diagbot/dto/SysHospitalDTO.java
  76. 19 0
      tran-service/src/main/java/com/diagbot/dto/SysHospitalDeptInfoDTO.java
  77. 73 73
      tran-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java
  78. 199 199
      tran-service/src/main/java/com/diagbot/entity/SysSet.java
  79. 40 0
      tran-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  80. 446 0
      tran-service/src/main/java/com/diagbot/facade/PatientInfoDjFacade.java
  81. 1 39
      tran-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  82. 150 36
      tran-service/src/main/java/com/diagbot/facade/SysSetFacade.java
  83. 3 0
      tran-service/src/main/java/com/diagbot/idc/AbstractIdCreater.java
  84. 7 0
      tran-service/src/main/java/com/diagbot/idc/IdCreater.java
  85. 47 7
      tran-service/src/main/java/com/diagbot/idc/VisibleIdCreater.java
  86. 10 0
      tran-service/src/main/java/com/diagbot/mapper/PatientInfoMapper.java
  87. 24 21
      tran-service/src/main/java/com/diagbot/mapper/SysSetMapper.java
  88. 24 20
      tran-service/src/main/java/com/diagbot/service/SysSetService.java
  89. 36 29
      tran-service/src/main/java/com/diagbot/service/impl/SysSetServiceImpl.java
  90. 20 0
      tran-service/src/main/java/com/diagbot/vo/GetHospitalRankInfoVO.java
  91. 46 0
      tran-service/src/main/java/com/diagbot/vo/GetTopPatientInfoDjVO.java
  92. 30 0
      tran-service/src/main/java/com/diagbot/vo/InquiryQuoteDeptVO.java
  93. 55 0
      tran-service/src/main/java/com/diagbot/vo/InquiryQuoteDoctorVO.java
  94. 102 0
      tran-service/src/main/java/com/diagbot/vo/InquiryQuotePatientVO.java
  95. 65 0
      tran-service/src/main/java/com/diagbot/vo/InquiryQuoteVO.java
  96. 15 2
      tran-service/src/main/java/com/diagbot/vo/SignInVO.java
  97. 19 0
      tran-service/src/main/java/com/diagbot/vo/SysHospitalCodeVO.java
  98. 19 0
      tran-service/src/main/java/com/diagbot/vo/SysHospitalInfoVO.java
  99. 38 5
      tran-service/src/main/java/com/diagbot/web/PatientInfoController.java
  100. 0 0
      tran-service/src/main/java/com/diagbot/web/SysSetController.java

+ 11 - 0
aipt-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -4,12 +4,14 @@ import com.diagbot.client.bean.HosCodeVO;
 import com.diagbot.client.hystrix.TranServiceHystrix;
 import com.diagbot.dto.GetDiseaseIcdDTO;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.HospitalDeptInfoDTO;
 import com.diagbot.dto.IndexDataDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SysSetInfoDTO;
 import com.diagbot.vo.DiseaseIcdVO;
 import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.HospitalDeptInfoVO;
 import com.diagbot.vo.HospitalSetVO;
@@ -59,6 +61,15 @@ public interface TranServiceClient {
     @PostMapping("/patientInfo/getTopPatientInfo")
     RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
 
+    /**
+     * 对接-获取页面顶部病人医生科室信息
+     *
+     * @param getTopPatientInfoDjVO
+     * @return
+     */
+    @PostMapping("/patientInfo/getTopPatientInfoDj")
+    RespDTO<GetTopPatientInfoDjDTO> getTopPatientInfoDj(@RequestBody GetTopPatientInfoDjVO getTopPatientInfoDjVO);
+
     /**
      * 根据医院编码和套餐名称获取化验公表映射关系
      *

+ 8 - 0
aipt-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -4,12 +4,14 @@ import com.diagbot.client.TranServiceClient;
 import com.diagbot.client.bean.HosCodeVO;
 import com.diagbot.dto.GetDiseaseIcdDTO;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.HospitalDeptInfoDTO;
 import com.diagbot.dto.IndexDataDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SysSetInfoDTO;
 import com.diagbot.vo.DiseaseIcdVO;
 import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.HospitalDeptInfoVO;
 import com.diagbot.vo.HospitalSetVO;
@@ -52,6 +54,12 @@ public class TranServiceHystrix implements TranServiceClient {
         return null;
     }
 
+    @Override
+    public RespDTO<GetTopPatientInfoDjDTO> getTopPatientInfoDj(GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        log.error("【hystrix】调用{}异常", "getTopPatientInfoDj");
+        return null;
+    }
+
     /**
      * 根据医院编码和套餐名称获取化验公表映射关系
      *

+ 173 - 0
aipt-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDjDTO.java

@@ -0,0 +1,173 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author rgb
+ * @Description
+ * @time 2018年11月19日下午4:57:43
+ */
+@ApiModel(value = "页面顶部病人医生科室信息查询接口出参")
+@Getter
+@Setter
+public class GetTopPatientInfoDjDTO {
+
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(value = "医院id")
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    @ApiModelProperty(value = "医院编码")
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    @ApiModelProperty(value = "医院名称")
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    @ApiModelProperty(value = "子医院id")
+    private Long sonHospitalId;
+
+    /**
+     * 子医院编码
+     */
+    @ApiModelProperty(value = "子医院编码")
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    @ApiModelProperty(value = "子医院名称")
+    private String sonHospitalName;
+
+    /**
+     * 医院科室id
+     */
+    @ApiModelProperty(value = "医院科室id")
+    private Long hospitalDeptId;
+
+    /**
+     * 自己科室id
+     */
+    @ApiModelProperty(value = "自己科室id")
+    private Long selfDeptId;
+
+    /**
+     * 自己科室名称
+     */
+    @ApiModelProperty(value = "自己科室名称")
+    private String selfDeptName;
+
+    /**
+     * 医院科室编码
+     */
+    @ApiModelProperty(value = "医院科室编码")
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    @ApiModelProperty(value = "医院科室名称")
+    private String hospitalDeptName;
+
+    /**
+     * 医生id
+     */
+    @ApiModelProperty(value = "医生id")
+    private Long doctorId;
+
+    /**
+     * 医生编码
+     */
+    @ApiModelProperty(value = "医生编码")
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+    @ApiModelProperty(value = "医生姓名")
+    private String doctorName;
+
+    /**
+     * 病人id
+     */
+    @ApiModelProperty(value = "病人id")
+    private Long patientId;
+
+    /**
+     * 病人编号
+     */
+    @ApiModelProperty(value = "病人编号")
+    private String patientCode;
+
+    /**
+     * 病人姓名
+     */
+    @ApiModelProperty(value = "病人姓名")
+    private String patientName;
+
+    /**
+     * 病人性别
+     */
+    @ApiModelProperty(value = "病人性别")
+    private String patientSex;
+
+    /**
+     * 病人年龄
+     */
+    @ApiModelProperty(value = "病人年龄")
+    private Integer patientAge;
+
+    /**
+     * 病人证件号码
+     */
+    @ApiModelProperty(value = "病人证件号码")
+    private String patientIdNo;
+
+    /**
+     * 系统时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "系统时间")
+    private Date systemTime;
+
+    /**
+     * 出生日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "出生日期")
+    private Date birthday;
+
+    /**
+     * 门诊号
+     */
+    @ApiModelProperty(value = "门诊号")
+    private String recordId;
+
+    /**
+     * 模式分类
+     */
+    @ApiModelProperty(value = "模式分类")
+    private Integer modeClassify;
+
+    /**
+     * 模式值
+     */
+    @ApiModelProperty(value = "模式值")
+    private Integer modeValue;
+
+}

+ 1 - 1
aipt-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -63,7 +63,7 @@ public class SysSetInfoDTO {
     /**
      * 配置值
      */
-    private Integer value;
+    private String value;
 
     /**
      * 备注

+ 1 - 1
aipt-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java

@@ -74,7 +74,7 @@ public enum LexiconTypeEnum implements KeyedNamed {
     HISTORY_OF_MARRIAGE_AND_CHILDBEARING(62, "婚育史"),
     BIRTH_HISTORY(63, "生育史"),
     FAMILY_HISTORY(64, "家族史"),
-    FOOD_ALLERGY_HISTORY(65, "食物过敏史"),
+    FOOD_ALLERGY_HISTORY(65, "过敏史"),
     HISTORY_OF_DRUG_ALLERGY(66, "药物过敏史"),
     FAMILY_RELATED_INFECTIOUS_DISEASE_HISTORY(67, "家族相关传染病史"),
     FURTHER_CONSULTATION(68, "复诊"),

+ 23 - 0
aipt-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -2,11 +2,13 @@ package com.diagbot.facade;
 
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.Concept;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.ConceptBaseVO;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -46,4 +48,25 @@ public class PatientInfoFacade {
         return getTopPatientInfoDTO;
     }
 
+    /**
+     * 对接-页面顶部病人医生科室信息查询
+     *
+     * @param getTopPatientInfoDjVO
+     * @return
+     */
+    public GetTopPatientInfoDjDTO getTopPatientInfoDj(@RequestBody GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        RespDTO<GetTopPatientInfoDjDTO> respDTO = tranServiceClient.getTopPatientInfoDj(getTopPatientInfoDjVO);
+        RespDTOUtil.respNGDealCover(respDTO, "获取页面顶部病人医生科室信息失败");
+
+        GetTopPatientInfoDjDTO getTopPatientInfoDjDTO = respDTO.data;
+
+        ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
+        conceptBaseVO.setLibType(LexiconTypeEnum.DEPARTMENT.getKey());
+        conceptBaseVO.setName(getTopPatientInfoDjDTO.getSelfDeptName());
+        Concept concept = conceptFacade.exist(conceptBaseVO);
+        getTopPatientInfoDjDTO.setSelfDeptId(concept.getId());
+
+        return getTopPatientInfoDjDTO;
+    }
+
 }

+ 1 - 1
aipt-service/src/main/java/com/diagbot/facade/TransferFacade.java

@@ -62,7 +62,7 @@ public class TransferFacade {
             if (RespDTOUtil.respIsOK(sysSetInfoListRes)) {
                 List<SysSetInfoDTO> sysSetInfoList = sysSetInfoListRes.data;
                 if (ListUtil.isNotEmpty(sysSetInfoList)) {
-                    if (sysSetInfoList.get(0).getValue().equals(1)) {
+                    if (sysSetInfoList.get(0).getValue().equals("1")) {
                         isConnect = true;
                     } else {
                         isConnect = false;

+ 60 - 0
aipt-service/src/main/java/com/diagbot/vo/GetTopPatientInfoDjVO.java

@@ -0,0 +1,60 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author rgb
+ * @Description
+ * @time 2018年11月19日下午4:58:37
+ */
+@ApiModel(value = "页面顶部病人医生科室信息查询接口传参")
+@Getter
+@Setter
+public class GetTopPatientInfoDjVO {
+
+    /**
+     * 医院编号
+     */
+    @ApiModelProperty(value = "医院编号", required = true)
+    @NotBlank(message = "医院编号必填")
+    private String hospitalCode;
+
+    /**
+     * 子医院编号
+     */
+    @ApiModelProperty(value = "子医院编号")
+    private String sonHospitalCode;
+
+    /**
+     * 医院科室编号
+     */
+    @ApiModelProperty(value = "医院科室编号", required = true)
+    @NotBlank(message = "医院科室编号必填")
+    private String hospitalDeptCode;
+
+    /**
+     * 医院医生编号
+     */
+    @ApiModelProperty(value = "医院医生编号")
+    private String doctorCode;
+
+    /**
+     * 医院患者编号
+     */
+    @ApiModelProperty(value = "医院患者编号", required = true)
+    @NotBlank(message = "医院患者编号必填")
+    private String patientCode;
+
+    /**
+     * 门诊号
+     */
+    @ApiModelProperty(value = "门诊号")
+    private String recordId;
+
+
+}

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

@@ -2,8 +2,10 @@ package com.diagbot.web;
 
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.PatientInfoFacade;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -44,4 +46,11 @@ public class PatientInfoController {
         return RespDTO.onSuc(patientInfoFacade.getTopPatientInfo(getTopPatientInfoVO));
     }
 
+    @ApiOperation(value = "知识库标准化-对接-页面顶部病人医生科室信息——查询[by:rengb]")
+    @PostMapping("/getTopPatientInfoDj")
+    @SysLogger("getTopPatientInfoDj")
+    public RespDTO<GetTopPatientInfoDjDTO> getTopPatientInfoDj(@Valid @RequestBody GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        return RespDTO.onSuc(patientInfoFacade.getTopPatientInfoDj(getTopPatientInfoDjVO));
+    }
+
 }

+ 2 - 1
common/src/main/java/com/diagbot/enums/VisibleIdTypeEnum.java

@@ -12,7 +12,8 @@ public enum VisibleIdTypeEnum implements KeyedNamed {
     IS_IMG_VER(1, "图片验证码"),
     IS_ORDER(2, "订单编号"),
     IS_RENEWALS(3,"续费单号"),
-    IS_AUTH(4,"认证申请单号");
+    IS_AUTH(4,"认证申请单号"),
+    PATIENT_NO(5,"病人自动编号");
 
     @Setter
     private int key;

+ 93 - 0
common/src/main/java/com/diagbot/util/IdCard.java

@@ -0,0 +1,93 @@
+package com.diagbot.util;
+
+import java.util.Calendar;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2019/11/20 13:18
+ */
+public class IdCard {
+    /**
+     * 中国公民身份证号码最小长度。
+     */
+    public final int CHINA_ID_MIN_LENGTH = 15;
+
+    /**
+     * 中国公民身份证号码最大长度。
+     */
+    public final int CHINA_ID_MAX_LENGTH = 18;
+
+    /**
+     * 根据身份编号获取年龄
+     *
+     * @param idCard 身份编号
+     * @return 年龄
+     */
+    public static int getAgeByIdCard(String idCard) {
+        int iAge = 0;
+        Calendar cal = Calendar.getInstance();
+        String year = idCard.substring(6, 10);
+        int iCurrYear = cal.get(Calendar.YEAR);
+        iAge = iCurrYear - Integer.valueOf(year);
+        return iAge;
+    }
+
+    /**
+     * 根据身份编号获取生日
+     *
+     * @param idCard 身份编号
+     * @return 生日(yyyyMMdd)
+     */
+    public static String getBirthByIdCard(String idCard) {
+        return idCard.substring(6, 14);
+    }
+
+    /**
+     * 根据身份编号获取生日年
+     *
+     * @param idCard 身份编号
+     * @return 生日(yyyy)
+     */
+    public static Short getYearByIdCard(String idCard) {
+        return Short.valueOf(idCard.substring(6, 10));
+    }
+
+    /**
+     * 根据身份编号获取生日月
+     *
+     * @param idCard 身份编号
+     * @return 生日(MM)
+     */
+    public static Short getMonthByIdCard(String idCard) {
+        return Short.valueOf(idCard.substring(10, 12));
+    }
+
+    /**
+     * 根据身份编号获取生日天
+     *
+     * @param idCard 身份编号
+     * @return 生日(dd)
+     */
+    public static Short getDateByIdCard(String idCard) {
+        return Short.valueOf(idCard.substring(12, 14));
+    }
+
+    /**
+     * 根据身份编号获取性别
+     *
+     * @param idCard 身份编号
+     * @return 性别(1- 男 ,2 - 女 , 0 - 未知)
+     */
+    public static int getGenderByIdCard(String idCard) {
+        int sGender = 0;
+
+        String sCardNum = idCard.substring(16, 17);
+        if (Integer.parseInt(sCardNum) % 2 != 0) {
+            sGender = 1;//男
+        } else {
+            sGender = 2;//女
+        }
+        return sGender;
+    }
+}

+ 39 - 39
data-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -1,39 +1,39 @@
-package com.diagbot.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年6月12日 下午3:31:22
- */
-@Setter
-@Getter
-public class SysSetInfoDTO {
-
-    /**
-     * 医院编码
-     */
-    private String hospitalCode;
-
-    /**
-     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
-     */
-    private Integer sysType;
-
-    /**
-     * 配置名称
-     */
-    private String name;
-    
-    /**
-     * 配置编码
-     */
-    private String code;
-    /**
-     * 配置值
-     */
-    private Integer value;
-}
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月12日 下午3:31:22
+ */
+@Setter
+@Getter
+public class SysSetInfoDTO {
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+     */
+    private Integer sysType;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+    
+    /**
+     * 配置编码
+     */
+    private String code;
+    /**
+     * 配置值
+     */
+    private String value;
+}

+ 57 - 0
docs/022.20191118预问诊新对接/init_prec.sql

@@ -0,0 +1,57 @@
+use `sys-prec`;
+ALTER TABLE `prec_inquiry_info`
+ADD COLUMN `son_hospital_id`  bigint(20) NULL DEFAULT 0 COMMENT '子医院id' AFTER `hospital_name`,
+ADD COLUMN `son_hospital_code`  varchar(16) NULL DEFAULT '' COMMENT '子医院code' AFTER `son_hospital_id`,
+ADD COLUMN `son_hospital_name`  varchar(32) NULL DEFAULT '' COMMENT '子医院名称' AFTER `son_hospital_code`,
+ADD COLUMN `is_quoted`  int(1) NULL DEFAULT 0 COMMENT '是否被引用:0-未引用;1-已引用' AFTER `data_json`;
+
+ALTER TABLE `prec_question_info` ADD COLUMN `flag` varchar(20) NOT NULL DEFAULT ''
+ COMMENT '类型标记(1:时间类型,2:诱因类型,3:伴随类型)' AFTER `spec_flag`;
+ update `prec_question_info` set flag = 1 where is_deleted = 'N' and type = 1 and control_type = 9;
+
+DROP TABLE IF EXISTS `prec_inquiry_quote`;
+ CREATE TABLE `prec_inquiry_quote` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `inquiry_id` bigint(20) NOT NULL COMMENT '引用问诊id',
+  `hospital_id` bigint(20) NOT NULL COMMENT '医院id',
+  `hospital_code` varchar(16) NOT NULL COMMENT '医院编码',
+  `hospital_name` varchar(32) NOT NULL COMMENT '医院名称',
+  `son_hospital_id` bigint(20) DEFAULT '0' COMMENT '子医院id',
+  `son_hospital_code` varchar(16) DEFAULT '' COMMENT '子医院code',
+  `son_hospital_name` varchar(32) DEFAULT '' COMMENT '子医院名称',
+  `hospital_dept_id` bigint(20) NOT NULL COMMENT '医院科室id',
+  `hospital_dept_code` varchar(16) NOT NULL COMMENT '医院科室编码',
+  `hospital_dept_name` varchar(32) NOT NULL COMMENT '医院科室名称',
+  `doctor_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医生id',
+  `doctor_code` varchar(16) NOT NULL DEFAULT '' COMMENT '医生编码',
+  `doctor_name` varchar(32) NOT NULL DEFAULT '' COMMENT '医生姓名',
+  `patient_id` bigint(20) NOT NULL COMMENT '患者id',
+  `patient_code` varchar(16) NOT NULL COMMENT '患者编号',
+  `patient_name` varchar(32) NOT NULL COMMENT '患者姓名',
+  `patient_sex` int(1) DEFAULT NULL COMMENT '患者性别:1男2女',
+  `patient_phone` varchar(20) DEFAULT NULL COMMENT '患者联系电话',
+  `patient_birthday` datetime DEFAULT NULL COMMENT '患者出生日期',
+  `patient_id_no` varchar(30) DEFAULT NULL COMMENT '患者证件号码(病历号)',
+  `inquiry_code` varchar(50) NOT NULL DEFAULT '' COMMENT '就诊序列号',
+  `reg_visited_state` int(1) DEFAULT NULL COMMENT '就诊状态(0待接诊,1接诊中,2完成接诊)',
+  `type` int(1) DEFAULT NULL COMMENT '分类(1:门诊,2:住院)',
+  `data_json` longtext COMMENT '内容JSON字符串',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='问诊记录-主表';
+
+ALTER TABLE `prec_inquiry_info`
+MODIFY COLUMN `doctor_id`  bigint(20) NOT NULL DEFAULT 0 COMMENT '医生id' AFTER `hospital_dept_name`,
+MODIFY COLUMN `doctor_code`  varchar(16) NOT NULL DEFAULT '' COMMENT '医生编码' AFTER `doctor_id`,
+MODIFY COLUMN `doctor_name`  varchar(32) NOT NULL DEFAULT '' COMMENT '医生姓名' AFTER `doctor_code`,
+MODIFY COLUMN `inquiry_code`  varchar(50) NOT NULL DEFAULT '' COMMENT '就诊序列号' AFTER `patient_id_no`;
+
+
+
+
+

+ 35 - 0
docs/022.20191118预问诊新对接/init_tran.sql

@@ -0,0 +1,35 @@
+use `sys-tran`;
+
+ALTER TABLE `tran_sys_set`  MODIFY `value` VARCHAR(255);
+
+insert into `tran_sys_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','集团下级医院','junior_hospital','A011,A012,A013,A014','杭州城东医院,江干区九堡医院,杭州市江干区中医院');
+insert into `tran_sys_set` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A011','0','17','杭州城东医院','default_dept','F01','默认科室(F1全科)');
+insert into `tran_sys_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A012','0','17','江干区九堡医院','default_dept','F02','默认科室(F2儿科)');
+insert into `tran_sys_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A013','0','17','杭州市江干区中医院','default_dept','F01','默认科室((F1全科)');
+insert into `tran_sys_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','集团医院','default_dept','F01','默认科室(F1全科)');
+insert into `tran_sys_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','是否支持无挂号信息','patientinfo','1','是否支持(1是,0否)');
+insert into `tran_sys_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','显示集团下级医院','junior_show','1','是否显示(1是,0否)');
+insert into `tran_sys_set` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A014','0','17','杭州二院','default_dept','D01',NULL);
+
+insert into `tran_sys_set` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values( 'N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','儿童体质测试','constitution_show','1','是否显示(1是,0否)');
+insert into `tran_sys_set` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values( 'N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','症状情况','symptoms_show','1','是否显示(1是,0否)');
+insert into `tran_sys_set` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values( 'N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','诊疗情况','diagnosis_show','1','是否显示(1是,0否)');
+insert into `tran_sys_set` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values( 'N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','其他病史','omhistory_show','1','是否显示(1是,0否)');
+insert into `tran_sys_set` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_code`, `plan`, `sys_type`, `name`, `code`, `value`, `remark`) values( 'N','1970-01-01 12:00:00','1970-01-01 12:00:00',NULL,NULL,'A010','0','17','补充内容','replenish_show','1','是否显示(1是,0否)');
+
+
+
+
+insert into `tran_hospital_dept` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `hospital_code`, `hospital_name`, `concept_dept_name`, `status`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','F01','全科','A010','集团医院','全科','1',NULL);
+insert into `tran_hospital_dept` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `hospital_code`, `hospital_name`, `concept_dept_name`, `status`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','F01','全科','A011','杭州城东医院','全科','1',NULL);
+insert into `tran_hospital_dept` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `hospital_code`, `hospital_name`, `concept_dept_name`, `status`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','F02','儿科','A012','江干区九堡医院','儿科','1',NULL);
+insert into `tran_hospital_dept` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `hospital_code`, `hospital_name`, `concept_dept_name`, `status`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','F01','全科','A013','杭州市江干区中医院','全科','1',NULL);
+insert into `tran_hospital_dept` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `hospital_code`, `hospital_name`, `concept_dept_name`, `status`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','D01','骨科','A014','杭州二院','骨科','1',NULL);
+
+
+
+insert into `tran_hospital_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `address`, `spell`, `status`, `order_no`, `connect`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','A010','集团医院',NULL,NULL,'1',NULL,'0',NULL);
+insert into `tran_hospital_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `address`, `spell`, `status`, `order_no`, `connect`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','A011','杭州城东医院',NULL,NULL,'1',NULL,'0',NULL);
+insert into `tran_hospital_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `address`, `spell`, `status`, `order_no`, `connect`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','A012','江干区九堡医院',NULL,NULL,'1',NULL,'0',NULL);
+insert into `tran_hospital_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `address`, `spell`, `status`, `order_no`, `connect`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','A013','杭州市江干区中医院',NULL,NULL,'1',NULL,'0',NULL);
+insert into `tran_hospital_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `code`, `name`, `address`, `spell`, `status`, `order_no`, `connect`, `remark`) values('N','1970-01-01 12:00:00','1970-01-01 12:00:00','0','0','A014','杭州二院',NULL,NULL,'1',NULL,'0',NULL);

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

@@ -3,6 +3,7 @@ package com.diagbot.client;
 import com.diagbot.client.hystrix.TranServiceHystrix;
 import com.diagbot.dto.DoctorInfoDTO;
 import com.diagbot.dto.GetExportInquirysDTO;
+import com.diagbot.dto.GetHospitalRankInfoDTO;
 import com.diagbot.dto.HisInquirysForJzDTO;
 import com.diagbot.dto.HospitalInfoDTO;
 import com.diagbot.dto.LisConfigDTO;
@@ -19,6 +20,7 @@ import com.diagbot.entity.HospitalDept;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.vo.AddDiagnoseSecondVO;
 import com.diagbot.vo.DoctorInfoVO;
+import com.diagbot.vo.GetHospitalRankInfoVO;
 import com.diagbot.vo.HisInquirysForJzVO;
 import com.diagbot.vo.HosCodeVO;
 import com.diagbot.vo.HospitalInfoVO;
@@ -205,4 +207,7 @@ public interface TranServiceClient {
 
     @PostMapping("/sysSet/getSysSetInfoDatas")
     RespDTO<List<SysSetInfoDTO>> getSysSetInfoDatas(@Valid @RequestBody HospitalSetVO hospitalSetVO);
+
+    @PostMapping("/sysSet/getHospitalRankInfo")
+    RespDTO<GetHospitalRankInfoDTO> getHospitalRankInfo(@RequestBody GetHospitalRankInfoVO getHospitalRankInfoVO);
 }

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

@@ -3,6 +3,7 @@ package com.diagbot.client.hystrix;
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.DoctorInfoDTO;
 import com.diagbot.dto.GetExportInquirysDTO;
+import com.diagbot.dto.GetHospitalRankInfoDTO;
 import com.diagbot.dto.HisInquirysForJzDTO;
 import com.diagbot.dto.HospitalInfoDTO;
 import com.diagbot.dto.LisConfigDTO;
@@ -19,6 +20,7 @@ import com.diagbot.entity.HospitalDept;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.vo.AddDiagnoseSecondVO;
 import com.diagbot.vo.DoctorInfoVO;
+import com.diagbot.vo.GetHospitalRankInfoVO;
 import com.diagbot.vo.HisInquirysForJzVO;
 import com.diagbot.vo.HosCodeVO;
 import com.diagbot.vo.HospitalInfoVO;
@@ -196,4 +198,10 @@ public class TranServiceHystrix implements TranServiceClient {
         log.error("【hystrix】调用{}异常", "getSysSetInfoDatas");
         return null;
     }
+
+    @Override
+    public RespDTO<GetHospitalRankInfoDTO> getHospitalRankInfo(GetHospitalRankInfoVO getHospitalRankInfoVO) {
+        log.error("【hystrix】调用{}异常", "getHospitalRankInfo");
+        return null;
+    }
 }

+ 54 - 0
icss-service/src/main/java/com/diagbot/dto/GetHospitalRankInfoDTO.java

@@ -0,0 +1,54 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2019/3/19 13:56
+ */
+@ApiModel(value = "获取大小医院信息接口出参")
+@Getter
+@Setter
+public class GetHospitalRankInfoDTO {
+
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(value = "医院id")
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    @ApiModelProperty(value = "医院编码")
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    @ApiModelProperty(value = "医院名称")
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    @ApiModelProperty(value = "子医院id")
+    private Long sonHospitalId;
+
+    /**
+     * 子医院编码
+     */
+    @ApiModelProperty(value = "子医院编码")
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    @ApiModelProperty(value = "子医院名称")
+    private String sonHospitalName;
+
+}

+ 39 - 44
icss-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -1,44 +1,39 @@
-package com.diagbot.dto;
-
-import java.time.LocalDateTime;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年6月12日 下午3:31:22
- */
-@Setter
-@Getter
-public class SysSetInfoDTO {
-
-    /**
-     * 医院编码
-     */
-    private String hospitalCode;
-
-    /**
-     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
-     */
-    private Integer sysType;
-
-    /**
-     * 配置名称
-     */
-    private String name;
-    
-    /**
-     * 配置编码
-     */
-    private String code;
-    /**
-     * 配置值
-     */
-    private Integer value;
-}
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月12日 下午3:31:22
+ */
+@Setter
+@Getter
+public class SysSetInfoDTO {
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+     */
+    private Integer sysType;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+    
+    /**
+     * 配置编码
+     */
+    private String code;
+    /**
+     * 配置值
+     */
+    private String value;
+}

+ 14 - 0
icss-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -2,6 +2,8 @@ package com.diagbot.facade;
 
 import java.util.List;
 
+import com.diagbot.dto.GetHospitalRankInfoDTO;
+import com.diagbot.vo.GetHospitalRankInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -34,4 +36,16 @@ public class SysSetFacade {
 		return sysSetInfoLists.data;
 	}
 
+	/**
+	 * 获取大小医院信息
+	 *
+	 * @param getHospitalRankInfoVO
+	 * @return
+	 */
+	public GetHospitalRankInfoDTO getHospitalRankInfo(GetHospitalRankInfoVO getHospitalRankInfoVO) {
+		RespDTO<GetHospitalRankInfoDTO> retData = tranServiceClient.getHospitalRankInfo(getHospitalRankInfoVO);
+		RespDTOUtil.respNGDeal(retData, "获取大小医院信息失败!");
+		return retData.data;
+	}
+
 }

+ 27 - 0
icss-service/src/main/java/com/diagbot/vo/GetHospitalRankInfoVO.java

@@ -0,0 +1,27 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value = "获取大小医院信息接口传参")
+@Getter
+@Setter
+public class GetHospitalRankInfoVO {
+
+    /**
+     * 医院编码
+     */
+    @ApiModelProperty(value = "医院编码", required = true)
+    @NotBlank(message = "医院编码必传")
+    private String hospitalCode;
+
+}

+ 9 - 0
icss-service/src/main/java/com/diagbot/web/SysSetController.java

@@ -1,9 +1,11 @@
 package com.diagbot.web;
 
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.GetHospitalRankInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SysSetInfoDTO;
 import com.diagbot.facade.SysSetFacade;
+import com.diagbot.vo.GetHospitalRankInfoVO;
 import com.diagbot.vo.HospitalSetVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -42,4 +44,11 @@ public class SysSetController {
 
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "获取大小医院信息[by:rengb]")
+    @PostMapping("/getHospitalRankInfo")
+    @SysLogger("getHospitalRankInfo")
+    public RespDTO<GetHospitalRankInfoDTO> getHospitalRankInfo(@Valid @RequestBody GetHospitalRankInfoVO getHospitalRankInfoVO) {
+        return RespDTO.onSuc(sysSetFacade.getHospitalRankInfo(getHospitalRankInfoVO));
+    }
 }

+ 1 - 1
knowledgeman-service/src/main/java/com/diagbot/enums/LexiconTypeEnum.java

@@ -74,7 +74,7 @@ public enum LexiconTypeEnum implements KeyedNamed {
     HISTORY_OF_MARRIAGE_AND_CHILDBEARING(62, "婚育史"),
     BIRTH_HISTORY(63, "生育史"),
     FAMILY_HISTORY(64, "家族史"),
-    FOOD_ALLERGY_HISTORY(65, "食物过敏史"),
+    FOOD_ALLERGY_HISTORY(65, "过敏史"),
     HISTORY_OF_DRUG_ALLERGY(66, "药物过敏史"),
     FAMILY_RELATED_INFECTIOUS_DISEASE_HISTORY(67, "家族相关传染病史"),
     FURTHER_CONSULTATION(68, "复诊"),

+ 11 - 0
prec-service/src/main/java/com/diagbot/client/AiptServiceClient.java

@@ -5,11 +5,13 @@ import com.diagbot.client.hystrix.AiptServiceHystrix;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRetrievalDTO;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.VersionWrapperDTO;
 import com.diagbot.vo.ConceptSearchVO;
 import com.diagbot.vo.ConceptUsualVO;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.RetrievalVO;
 import com.diagbot.vo.VersionVO;
@@ -46,6 +48,15 @@ public interface AiptServiceClient {
     @PostMapping("/patientInfo/getTopPatientInfo")
     RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
 
+    /**
+     * 对接-获取页面顶部病人医生科室信息
+     *
+     * @param getTopPatientInfoDjVO
+     * @return
+     */
+    @PostMapping("/patientInfo/getTopPatientInfoDj")
+    RespDTO<GetTopPatientInfoDjDTO> getTopPatientInfoDj(@RequestBody GetTopPatientInfoDjVO getTopPatientInfoDjVO);
+
     /**
      * 常见症状
      *

+ 17 - 1
prec-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -3,10 +3,12 @@ package com.diagbot.client;
 import com.diagbot.client.hystrix.TranServiceHystrix;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SignInDTO;
+import com.diagbot.dto.SysHospitalDTO;
 import com.diagbot.dto.SysSetInfoDTO;
 import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.InquiryQuoteVO;
 import com.diagbot.vo.SignInVO;
-
+import com.diagbot.vo.SysHospitalCodeVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -34,4 +36,18 @@ public interface TranServiceClient {
      */
     @PostMapping("/patientInfo/signIn")
     RespDTO<List<SignInDTO>> signIn(@RequestBody SignInVO signInVO);
+
+    /**
+     * @param inquiryQuoteVO
+     * @return
+     */
+    @PostMapping("/patientInfo/inquiryQuote")
+    RespDTO<InquiryQuoteVO> inquiryQuote(@RequestBody InquiryQuoteVO inquiryQuoteVO);
+
+    /**
+     *
+     * @param sysHospitalCodeVO
+     */
+    @PostMapping("/sysSet/getHospitalDatas")
+    RespDTO<SysHospitalDTO> getHospitalDeptInfoData(SysHospitalCodeVO sysHospitalCodeVO);
 }

+ 8 - 0
prec-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java

@@ -5,11 +5,13 @@ import com.diagbot.client.bean.SearchData;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.ConceptRetrievalDTO;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.VersionWrapperDTO;
 import com.diagbot.vo.ConceptSearchVO;
 import com.diagbot.vo.ConceptUsualVO;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 
 import com.diagbot.vo.RetrievalVO;
@@ -48,6 +50,12 @@ public class AiptServiceHystrix implements AiptServiceClient {
         return null;
     }
 
+    @Override
+    public RespDTO<GetTopPatientInfoDjDTO> getTopPatientInfoDj(GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        log.error("【hystrix】调用{}异常", "getTopPatientInfoDj");
+        return null;
+    }
+
     @Override
     public RespDTO<List<ConceptBaseDTO>> getConceptUsual(@Valid ConceptUsualVO conceptUsualVO) {
         log.error("【hystrix】调用{}异常", "getConceptUsual");

+ 15 - 2
prec-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -4,6 +4,9 @@ import java.util.List;
 
 import javax.validation.Valid;
 
+import com.diagbot.dto.SysHospitalDTO;
+import com.diagbot.vo.InquiryQuoteVO;
+import com.diagbot.vo.SysHospitalCodeVO;
 import org.springframework.stereotype.Component;
 
 import com.diagbot.client.TranServiceClient;
@@ -34,6 +37,16 @@ public class TranServiceHystrix implements TranServiceClient {
 		log.error("【hystrix】调用{}异常", "signIn");
 		return null;
 	}
-    
-    
+
+    @Override
+    public RespDTO<InquiryQuoteVO> inquiryQuote(InquiryQuoteVO inquiryQuoteVO) {
+        log.error("【hystrix】调用{}异常", "inquiryQuote");
+        return null;
+    }
+
+    @Override
+    public RespDTO<SysHospitalDTO> getHospitalDeptInfoData(SysHospitalCodeVO sysHospitalCodeVO) {
+        log.error("【hystrix】调用{}异常", "getHospitalDeptInfoData");
+        return null;
+    }
 }

+ 173 - 0
prec-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDjDTO.java

@@ -0,0 +1,173 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author rgb
+ * @Description
+ * @time 2018年11月19日下午4:57:43
+ */
+@ApiModel(value = "页面顶部病人医生科室信息查询接口出参")
+@Getter
+@Setter
+public class GetTopPatientInfoDjDTO {
+
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(value = "医院id")
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    @ApiModelProperty(value = "医院编码")
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    @ApiModelProperty(value = "医院名称")
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    @ApiModelProperty(value = "子医院id")
+    private Long sonHospitalId;
+
+    /**
+     * 子医院编码
+     */
+    @ApiModelProperty(value = "子医院编码")
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    @ApiModelProperty(value = "子医院名称")
+    private String sonHospitalName;
+
+    /**
+     * 医院科室id
+     */
+    @ApiModelProperty(value = "医院科室id")
+    private Long hospitalDeptId;
+
+    /**
+     * 自己科室id
+     */
+    @ApiModelProperty(value = "自己科室id")
+    private Long selfDeptId;
+
+    /**
+     * 自己科室名称
+     */
+    @ApiModelProperty(value = "自己科室名称")
+    private String selfDeptName;
+
+    /**
+     * 医院科室编码
+     */
+    @ApiModelProperty(value = "医院科室编码")
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    @ApiModelProperty(value = "医院科室名称")
+    private String hospitalDeptName;
+
+    /**
+     * 医生id
+     */
+    @ApiModelProperty(value = "医生id")
+    private Long doctorId;
+
+    /**
+     * 医生编码
+     */
+    @ApiModelProperty(value = "医生编码")
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+    @ApiModelProperty(value = "医生姓名")
+    private String doctorName;
+
+    /**
+     * 病人id
+     */
+    @ApiModelProperty(value = "病人id")
+    private Long patientId;
+
+    /**
+     * 病人编号
+     */
+    @ApiModelProperty(value = "病人编号")
+    private String patientCode;
+
+    /**
+     * 病人姓名
+     */
+    @ApiModelProperty(value = "病人姓名")
+    private String patientName;
+
+    /**
+     * 病人性别
+     */
+    @ApiModelProperty(value = "病人性别")
+    private String patientSex;
+
+    /**
+     * 病人年龄
+     */
+    @ApiModelProperty(value = "病人年龄")
+    private Integer patientAge;
+
+    /**
+     * 病人证件号码
+     */
+    @ApiModelProperty(value = "病人证件号码")
+    private String patientIdNo;
+
+    /**
+     * 系统时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "系统时间")
+    private Date systemTime;
+
+    /**
+     * 出生日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "出生日期")
+    private Date birthday;
+
+    /**
+     * 门诊号
+     */
+    @ApiModelProperty(value = "门诊号")
+    private String recordId;
+
+    //    /**
+    //     * 模式分类
+    //     */
+    //	@ApiModelProperty(value="模式分类")
+    //    private Integer modeClassify;
+    //
+    //    /**
+    //     * 模式值
+    //     */
+    //	@ApiModelProperty(value="模式值")
+    //    private Integer modeValue;
+
+}

+ 1 - 0
prec-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -33,5 +33,6 @@ public class QuestionDTO {
     private Integer exclusionType; //互斥类型
     private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
     private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签
+    private String flag; // 类型标记
     private String remark;//备注
 }

+ 47 - 36
prec-service/src/main/java/com/diagbot/dto/SignInDTO.java

@@ -10,77 +10,88 @@ import lombok.Setter;
  * @author: rengb
  * @time: 2018/11/19 18:56
  */
-@ApiModel(value="患者登录接口出参")
+@ApiModel(value = "患者登录接口出参")
 @Getter
 @Setter
-public class SignInDTO{
-	
-	/**
+public class SignInDTO {
+
+    /**
      * 医院编码
      */
-	@ApiModelProperty(value="医院编码")
+    @ApiModelProperty(value = "医院编码")
     private String hospitalCode;
 
     /**
      * 医院名称
      */
-	@ApiModelProperty(value="医院名称")
+    @ApiModelProperty(value = "医院名称")
     private String hospitalName;
-	
-	/**
+
+    /**
+     * 子医院编号
+     */
+    @ApiModelProperty(value = "子医院编号")
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    @ApiModelProperty(value = "子医院名称")
+    private String sonHospitalName;
+
+    /**
      * 医院科室编码
      */
-	@ApiModelProperty(value="医院科室编码")
+    @ApiModelProperty(value = "医院科室编码")
     private String hospitalDeptCode;
 
     /**
      * 医院科室名称
      */
-	@ApiModelProperty(value="医院科室名称")
+    @ApiModelProperty(value = "医院科室名称")
     private String hospitalDeptName;
-	
-	/**
+
+    /**
      * 医生编码
      */
-	@ApiModelProperty(value="医生编码")
+    @ApiModelProperty(value = "医生编码")
     private String doctorCode;
 
     /**
      * 医生姓名
      */
-	@ApiModelProperty(value="医生姓名")
+    @ApiModelProperty(value = "医生姓名")
     private String doctorName;
-	
-	/**
+
+    /**
      * 病人编号
      */
-	@ApiModelProperty(value="病人编号")
+    @ApiModelProperty(value = "病人编号")
     private String patientCode;
-	
-	/**
+
+    /**
      * 病人姓名
      */
-	@ApiModelProperty(value="病人姓名")
+    @ApiModelProperty(value = "病人姓名")
     private String patientName;
-	
-	/**
-	 * 挂号时间
-	 */
-	@ApiModelProperty(value="挂号时间")
-	private String recordTime;
-	
-	/**
+
+    /**
+     * 挂号时间
+     */
+    @ApiModelProperty(value = "挂号时间")
+    private String recordTime;
+
+    /**
      * 就诊号
      */
-	@ApiModelProperty(value="就诊号")
-	private String recordId;
-	
-	/**
+    @ApiModelProperty(value = "就诊号")
+    private String recordId;
+
+    /**
      * 挂号信息
      */
-	@ApiModelProperty(value="挂号信息")
-	private String registerNum;
-	
+    @ApiModelProperty(value = "挂号信息")
+    private String registerNum;
+
 
-		
 }

+ 25 - 0
prec-service/src/main/java/com/diagbot/dto/SysHospitalDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-11-18 18:29
+ */
+@Getter
+@Setter
+public class SysHospitalDTO {
+
+    /**
+     * 顶级集团信息
+     */
+    private  SysHospitalDeptInfoDTO superiorsInfo;
+    /**
+     * 下级医院信息
+     */
+    private List<SysHospitalDeptInfoDTO> juniorHospital ;
+}

+ 19 - 0
prec-service/src/main/java/com/diagbot/dto/SysHospitalDeptInfoDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-11-18 18:33
+ */
+@Getter
+@Setter
+public class SysHospitalDeptInfoDTO {
+
+    private  String hospitalCode;
+    private  String hospitalName;
+    private  String deptCode;
+    private  String deptName;
+}

+ 39 - 44
prec-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -1,44 +1,39 @@
-package com.diagbot.dto;
-
-import java.time.LocalDateTime;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年6月18日 上午10:24:42
- */
-@Setter
-@Getter
-public class SysSetInfoDTO {
-
-    /**
-     * 医院编码
-     */
-    private String hospitalCode;
-
-    /**
-     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
-     */
-    private Integer sysType;
-
-    /**
-     * 配置名称
-     */
-    private String name;
-    
-    /**
-     * 配置编码
-     */
-    private String code;
-    /**
-     * 配置值
-     */
-    private Integer value;
-}
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月18日 上午10:24:42
+ */
+@Setter
+@Getter
+public class SysSetInfoDTO {
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+     */
+    private Integer sysType;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+    
+    /**
+     * 配置编码
+     */
+    private String code;
+    /**
+     * 配置值
+     */
+    private String value;
+}

+ 84 - 33
prec-service/src/main/java/com/diagbot/entity/InquiryInfo.java

@@ -1,11 +1,10 @@
 package com.diagbot.entity;
 
-import java.io.Serializable;
-import java.util.Date;
-
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
 
 /**
  * <p>
@@ -13,7 +12,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
  * </p>
  *
  * @author gaodm
- * @since 2019-06-21
+ * @since 2019-11-19
  */
 @TableName("prec_inquiry_info")
 public class InquiryInfo implements Serializable {
@@ -66,6 +65,21 @@ public class InquiryInfo implements Serializable {
      */
     private String hospitalName;
 
+    /**
+     * 子医院id
+     */
+    private Long sonHospitalId;
+
+    /**
+     * 子医院code
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String sonHospitalName;
+
     /**
      * 医院科室id
      */
@@ -151,6 +165,11 @@ public class InquiryInfo implements Serializable {
      */
     private String dataJson;
 
+    /**
+     * 是否被引用:0-未引用;1-已引用
+     */
+    private Integer isQuoted;
+
     /**
      * 备注
      */
@@ -219,6 +238,27 @@ public class InquiryInfo implements Serializable {
     public void setHospitalName(String hospitalName) {
         this.hospitalName = hospitalName;
     }
+    public Long getSonHospitalId() {
+        return sonHospitalId;
+    }
+
+    public void setSonHospitalId(Long sonHospitalId) {
+        this.sonHospitalId = sonHospitalId;
+    }
+    public String getSonHospitalCode() {
+        return sonHospitalCode;
+    }
+
+    public void setSonHospitalCode(String sonHospitalCode) {
+        this.sonHospitalCode = sonHospitalCode;
+    }
+    public String getSonHospitalName() {
+        return sonHospitalName;
+    }
+
+    public void setSonHospitalName(String sonHospitalName) {
+        this.sonHospitalName = sonHospitalName;
+    }
     public Long getHospitalDeptId() {
         return hospitalDeptId;
     }
@@ -338,6 +378,13 @@ public class InquiryInfo implements Serializable {
     public void setDataJson(String dataJson) {
         this.dataJson = dataJson;
     }
+    public Integer getIsQuoted() {
+        return isQuoted;
+    }
+
+    public void setIsQuoted(Integer isQuoted) {
+        this.isQuoted = isQuoted;
+    }
     public String getRemark() {
         return remark;
     }
@@ -349,33 +396,37 @@ public class InquiryInfo implements Serializable {
     @Override
     public String toString() {
         return "InquiryInfo{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreate=" + gmtCreate +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", hospitalId=" + hospitalId +
-        ", hospitalCode=" + hospitalCode +
-        ", hospitalName=" + hospitalName +
-        ", hospitalDeptId=" + hospitalDeptId +
-        ", hospitalDeptCode=" + hospitalDeptCode +
-        ", hospitalDeptName=" + hospitalDeptName +
-        ", doctorId=" + doctorId +
-        ", doctorCode=" + doctorCode +
-        ", doctorName=" + doctorName +
-        ", patientId=" + patientId +
-        ", patientCode=" + patientCode +
-        ", patientName=" + patientName +
-        ", patientSex=" + patientSex +
-        ", patientPhone=" + patientPhone +
-        ", patientBirthday=" + patientBirthday +
-        ", patientIdNo=" + patientIdNo +
-        ", inquiryCode=" + inquiryCode +
-        ", regVisitedState=" + regVisitedState +
-        ", type=" + type +
-        ", dataJson=" + dataJson +
-        ", remark=" + remark +
-        "}";
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hospitalCode=" + hospitalCode +
+                ", hospitalName=" + hospitalName +
+                ", sonHospitalId=" + sonHospitalId +
+                ", sonHospitalCode=" + sonHospitalCode +
+                ", sonHospitalName=" + sonHospitalName +
+                ", hospitalDeptId=" + hospitalDeptId +
+                ", hospitalDeptCode=" + hospitalDeptCode +
+                ", hospitalDeptName=" + hospitalDeptName +
+                ", doctorId=" + doctorId +
+                ", doctorCode=" + doctorCode +
+                ", doctorName=" + doctorName +
+                ", patientId=" + patientId +
+                ", patientCode=" + patientCode +
+                ", patientName=" + patientName +
+                ", patientSex=" + patientSex +
+                ", patientPhone=" + patientPhone +
+                ", patientBirthday=" + patientBirthday +
+                ", patientIdNo=" + patientIdNo +
+                ", inquiryCode=" + inquiryCode +
+                ", regVisitedState=" + regVisitedState +
+                ", type=" + type +
+                ", dataJson=" + dataJson +
+                ", isQuoted=" + isQuoted +
+                ", remark=" + remark +
+                "}";
     }
 }

+ 432 - 0
prec-service/src/main/java/com/diagbot/entity/InquiryQuote.java

@@ -0,0 +1,432 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 问诊记录-主表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+@TableName("prec_inquiry_quote")
+public class InquiryQuote implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 引用问诊id
+     */
+    private Long inquiryId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    private Long sonHospitalId;
+
+    /**
+     * 子医院code
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String sonHospitalName;
+
+    /**
+     * 医院科室id
+     */
+    private Long hospitalDeptId;
+
+    /**
+     * 医院科室编码
+     */
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    private String hospitalDeptName;
+
+    /**
+     * 医生id
+     */
+    private Long doctorId;
+
+    /**
+     * 医生编码
+     */
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 患者id
+     */
+    private Long patientId;
+
+    /**
+     * 患者编号
+     */
+    private String patientCode;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 患者性别:1男2女
+     */
+    private Integer patientSex;
+
+    /**
+     * 患者联系电话
+     */
+    private String patientPhone;
+
+    /**
+     * 患者出生日期
+     */
+    private Date patientBirthday;
+
+    /**
+     * 患者证件号码(病历号)
+     */
+    private String patientIdNo;
+
+    /**
+     * 就诊序列号
+     */
+    private String inquiryCode;
+
+    /**
+     * 就诊状态(0待接诊,1接诊中,2完成接诊)
+     */
+    private Integer regVisitedState;
+
+    /**
+     * 分类(1:门诊,2:住院)
+     */
+    private Integer type;
+
+    /**
+     * 内容JSON字符串
+     */
+    private String dataJson;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public Long getInquiryId() {
+        return inquiryId;
+    }
+
+    public void setInquiryId(Long inquiryId) {
+        this.inquiryId = inquiryId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+    public String getHospitalName() {
+        return hospitalName;
+    }
+
+    public void setHospitalName(String hospitalName) {
+        this.hospitalName = hospitalName;
+    }
+    public Long getSonHospitalId() {
+        return sonHospitalId;
+    }
+
+    public void setSonHospitalId(Long sonHospitalId) {
+        this.sonHospitalId = sonHospitalId;
+    }
+    public String getSonHospitalCode() {
+        return sonHospitalCode;
+    }
+
+    public void setSonHospitalCode(String sonHospitalCode) {
+        this.sonHospitalCode = sonHospitalCode;
+    }
+    public String getSonHospitalName() {
+        return sonHospitalName;
+    }
+
+    public void setSonHospitalName(String sonHospitalName) {
+        this.sonHospitalName = sonHospitalName;
+    }
+    public Long getHospitalDeptId() {
+        return hospitalDeptId;
+    }
+
+    public void setHospitalDeptId(Long hospitalDeptId) {
+        this.hospitalDeptId = hospitalDeptId;
+    }
+    public String getHospitalDeptCode() {
+        return hospitalDeptCode;
+    }
+
+    public void setHospitalDeptCode(String hospitalDeptCode) {
+        this.hospitalDeptCode = hospitalDeptCode;
+    }
+    public String getHospitalDeptName() {
+        return hospitalDeptName;
+    }
+
+    public void setHospitalDeptName(String hospitalDeptName) {
+        this.hospitalDeptName = hospitalDeptName;
+    }
+    public Long getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(Long doctorId) {
+        this.doctorId = doctorId;
+    }
+    public String getDoctorCode() {
+        return doctorCode;
+    }
+
+    public void setDoctorCode(String doctorCode) {
+        this.doctorCode = doctorCode;
+    }
+    public String getDoctorName() {
+        return doctorName;
+    }
+
+    public void setDoctorName(String doctorName) {
+        this.doctorName = doctorName;
+    }
+    public Long getPatientId() {
+        return patientId;
+    }
+
+    public void setPatientId(Long patientId) {
+        this.patientId = patientId;
+    }
+    public String getPatientCode() {
+        return patientCode;
+    }
+
+    public void setPatientCode(String patientCode) {
+        this.patientCode = patientCode;
+    }
+    public String getPatientName() {
+        return patientName;
+    }
+
+    public void setPatientName(String patientName) {
+        this.patientName = patientName;
+    }
+    public Integer getPatientSex() {
+        return patientSex;
+    }
+
+    public void setPatientSex(Integer patientSex) {
+        this.patientSex = patientSex;
+    }
+    public String getPatientPhone() {
+        return patientPhone;
+    }
+
+    public void setPatientPhone(String patientPhone) {
+        this.patientPhone = patientPhone;
+    }
+    public Date getPatientBirthday() {
+        return patientBirthday;
+    }
+
+    public void setPatientBirthday(Date patientBirthday) {
+        this.patientBirthday = patientBirthday;
+    }
+    public String getPatientIdNo() {
+        return patientIdNo;
+    }
+
+    public void setPatientIdNo(String patientIdNo) {
+        this.patientIdNo = patientIdNo;
+    }
+    public String getInquiryCode() {
+        return inquiryCode;
+    }
+
+    public void setInquiryCode(String inquiryCode) {
+        this.inquiryCode = inquiryCode;
+    }
+    public Integer getRegVisitedState() {
+        return regVisitedState;
+    }
+
+    public void setRegVisitedState(Integer regVisitedState) {
+        this.regVisitedState = regVisitedState;
+    }
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+    public String getDataJson() {
+        return dataJson;
+    }
+
+    public void setDataJson(String dataJson) {
+        this.dataJson = dataJson;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "InquiryQuote{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", inquiryId=" + inquiryId +
+            ", hospitalId=" + hospitalId +
+            ", hospitalCode=" + hospitalCode +
+            ", hospitalName=" + hospitalName +
+            ", sonHospitalId=" + sonHospitalId +
+            ", sonHospitalCode=" + sonHospitalCode +
+            ", sonHospitalName=" + sonHospitalName +
+            ", hospitalDeptId=" + hospitalDeptId +
+            ", hospitalDeptCode=" + hospitalDeptCode +
+            ", hospitalDeptName=" + hospitalDeptName +
+            ", doctorId=" + doctorId +
+            ", doctorCode=" + doctorCode +
+            ", doctorName=" + doctorName +
+            ", patientId=" + patientId +
+            ", patientCode=" + patientCode +
+            ", patientName=" + patientName +
+            ", patientSex=" + patientSex +
+            ", patientPhone=" + patientPhone +
+            ", patientBirthday=" + patientBirthday +
+            ", patientIdNo=" + patientIdNo +
+            ", inquiryCode=" + inquiryCode +
+            ", regVisitedState=" + regVisitedState +
+            ", type=" + type +
+            ", dataJson=" + dataJson +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 5 - 0
prec-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -107,6 +107,11 @@ public class QuestionInfo implements Serializable {
      */
     private String explains;
 
+    /**
+     * 类型标记(1:时间类型,2:诱因类型,3:有无类型)
+     */
+    private String flag;
+
     /**
      * 备注
      */

+ 50 - 0
prec-service/src/main/java/com/diagbot/enums/InquiryQuotedTypeEnum.java

@@ -0,0 +1,50 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author gaodm
+ * @Description: TODO
+ * @date 2018年12月11日 下午2:31:42
+ */
+public enum InquiryQuotedTypeEnum implements KeyedNamed {
+    Disable(0, "未引用"),
+    Enable(1, "已引用");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    InquiryQuotedTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static InquiryQuotedTypeEnum getEnum(int key) {
+        for (InquiryQuotedTypeEnum item : InquiryQuotedTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        InquiryQuotedTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 40 - 0
prec-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java

@@ -0,0 +1,40 @@
+package com.diagbot.exception;
+
+/**
+ * @Description: 本服务错误码
+ * 系统码(3位) + 等级码(1位) + 4位顺序号
+ * 系统码 通用码 000;用户中心 100; 管理中心 200;
+ * @author: gaodm
+ * @time: 2018/9/10 11:11
+ */
+public enum ServiceErrorCode implements ErrorCode {
+    IDCARD_LOGIN("17020000", "暂无挂号信息,请选择身份证号方式登录"),
+    IQC_NOT_FOUND("17020001", "暂无挂号信息,可选择其他方式尝试登录");
+
+    private String code;
+    private String msg;
+
+
+    ServiceErrorCode(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public static ServiceErrorCode codeOf(String code) {
+        for (ServiceErrorCode state : values()) {
+            if (state.getCode() == code) {
+                return state;
+            }
+        }
+        return null;
+    }
+}

+ 138 - 4
prec-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -1,15 +1,19 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetInquiryDetailDTO;
 import com.diagbot.dto.GetInquiryDetailImgDTO;
 import com.diagbot.dto.HisInquiryDTO;
 import com.diagbot.dto.RecordCheckDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SaveInquiryDTO;
 import com.diagbot.entity.InquiryDetail;
 import com.diagbot.entity.InquiryEvaluator;
 import com.diagbot.entity.InquiryInfo;
+import com.diagbot.entity.InquiryQuote;
 import com.diagbot.entity.InquiryReport;
+import com.diagbot.enums.InquiryQuotedTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.SexEnum;
 import com.diagbot.exception.CommonErrorCode;
@@ -21,9 +25,12 @@ import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.GetInquiryDetailVO;
 import com.diagbot.vo.HisInquirysVO;
+import com.diagbot.vo.InquiryQuoteForIcssVO;
+import com.diagbot.vo.InquiryQuoteVO;
 import com.diagbot.vo.RecordCheckVO;
 import com.diagbot.vo.SaveInquiryVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,6 +64,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     @Autowired
     @Qualifier("inquiryReportServiceImpl")
     private InquiryReportServiceImpl inquiryReportServiceImpl;
+    @Autowired
+    private TranServiceClient tranServiceClient;
+    @Autowired
+    private InquiryQuoteFacade inquiryQuoteFacade;
 
     /**
      * 问诊记录保存
@@ -71,10 +82,16 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
         inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
         inquiryInfoQe.eq("hospital_id", saveInquiryVO.getHospitalId());
+        inquiryInfoQe.eq(saveInquiryVO.getSonHospitalId() != null,
+                "son_hospital_id", saveInquiryVO.getSonHospitalId());
         inquiryInfoQe.eq("hospital_dept_id", saveInquiryVO.getHospitalDeptId());
-        inquiryInfoQe.eq("doctor_id", saveInquiryVO.getDoctorId());
+        inquiryInfoQe.eq(saveInquiryVO.getDoctorId() != null,
+                "doctor_id", saveInquiryVO.getDoctorId());
         inquiryInfoQe.eq("patient_id", saveInquiryVO.getPatientId());
-        inquiryInfoQe.eq("inquiry_code", saveInquiryVO.getInquiryCode());
+        inquiryInfoQe.eq(StringUtil.isNotBlank(saveInquiryVO.getInquiryCode()),
+                "inquiry_code", saveInquiryVO.getInquiryCode());
+        inquiryInfoQe.eq("is_quoted", 0);
+        inquiryInfoQe.orderByDesc("gmt_modified");
         InquiryInfo inquiryInfo = this.getOne(inquiryInfoQe, false);
 
         if (inquiryInfo == null) {
@@ -168,6 +185,7 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
 
         QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<InquiryInfo>();
         inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
+        inquiryInfoQe.eq("is_quoted", InquiryQuotedTypeEnum.Disable.getKey());
         inquiryInfoQe.eq(hisInquirysVO.getHospitalId() != null,
                 "hospital_id", hisInquirysVO.getHospitalId());
         inquiryInfoQe.eq(StringUtil.isNotBlank(hisInquirysVO.getHospitalCode()),
@@ -186,8 +204,13 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
                 "patient_code", hisInquirysVO.getPatientCode());
         inquiryInfoQe.eq(StringUtil.isNotBlank(hisInquirysVO.getPatientIdNo()),
                 "patient_id_no", hisInquirysVO.getPatientIdNo());
+        inquiryInfoQe.eq(StringUtil.isNotBlank(hisInquirysVO.getPatientName()),
+                "patient_name", hisInquirysVO.getPatientName());
         inquiryInfoQe.eq(hisInquirysVO.getType() != null,
                 "type", hisInquirysVO.getType());
+        String day = DateUtil.formatDateTime(DateUtil.getFirstTimeOfDay(DateUtil.addDay(DateUtil.now(),
+                -hisInquirysVO.getDayLimit())));
+        inquiryInfoQe.ge("gmt_modified", day);
 
         inquiryInfoQe.ge(hisInquirysVO.getStartDate() != null,
                 "gmt_create", hisInquirysVO.getStartDate());
@@ -236,12 +259,16 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         }*/
         if (getInquiryDetailVO.getPatientId() == null
                 && StringUtil.isBlank(getInquiryDetailVO.getPatientCode())
-                && StringUtil.isBlank(getInquiryDetailVO.getPatientIdNo())) {
+                && (StringUtil.isBlank(getInquiryDetailVO.getPatientIdNo())
+                || StringUtil.isBlank(getInquiryDetailVO.getPatientName()))) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "患者信息(患者id或者患者编码或者患者病历号)必传!");
         }
 
         QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<InquiryInfo>();
+        inquiryInfoQe.eq(getInquiryDetailVO.getInquiryId() != null,
+                "id", getInquiryDetailVO.getInquiryId());
         inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
+        inquiryInfoQe.eq("is_quoted", InquiryQuotedTypeEnum.Disable.getKey());
         inquiryInfoQe.eq(getInquiryDetailVO.getHospitalId() != null,
                 "hospital_id", getInquiryDetailVO.getHospitalId());
         inquiryInfoQe.eq(StringUtil.isNotBlank(getInquiryDetailVO.getHospitalCode()),
@@ -260,7 +287,10 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
                 "patient_code", getInquiryDetailVO.getPatientCode());
         inquiryInfoQe.eq(StringUtil.isNotBlank(getInquiryDetailVO.getPatientIdNo()),
                 "patient_id_no", getInquiryDetailVO.getPatientIdNo());
-        inquiryInfoQe.eq("inquiry_code", getInquiryDetailVO.getInquiryCode());
+        inquiryInfoQe.eq(StringUtil.isNotBlank(getInquiryDetailVO.getPatientName()),
+                "patient_name", getInquiryDetailVO.getPatientName());
+        inquiryInfoQe.eq(StringUtil.isNotBlank(getInquiryDetailVO.getInquiryCode()),
+                "inquiry_code", getInquiryDetailVO.getInquiryCode());
         String day = DateUtil.formatDateTime(DateUtil.getFirstTimeOfDay(DateUtil.addDay(DateUtil.now(),
                 -getInquiryDetailVO.getDayLimit())));
         inquiryInfoQe.ge("gmt_modified", day);
@@ -324,4 +354,108 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         return getInquiryDetailDTO;
     }
 
+    /**
+     * 病历引用
+     *
+     * @param inquiryQuoteVO
+     * @return
+     */
+    public Boolean inquiryQuote(InquiryQuoteVO inquiryQuoteVO) {
+        InquiryInfo inquiryInfo = getById(inquiryQuoteVO.getInquiryId());
+        if (inquiryInfo == null) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "病历不存在");
+        }
+        if (!inquiryInfo.getHospitalCode().equals(inquiryQuoteVO.getHospitalCode())) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "医院不一致");
+        }
+        if (inquiryInfo.getIsQuoted() == 1) {
+            return true;
+        }
+
+        RespDTO<InquiryQuoteVO> respDTO = tranServiceClient.inquiryQuote(inquiryQuoteVO);
+        RespDTOUtil.respNGDealCover(respDTO, "病历引用失败");
+        inquiryQuoteVO = respDTO.data;
+
+        Date now = DateUtil.now();
+        inquiryInfo.setGmtModified(now);
+        inquiryInfo.setIsQuoted(1);
+        inquiryInfo.setInquiryCode(inquiryQuoteVO.getInquiryCode());
+        inquiryInfo.setPatientId(inquiryQuoteVO.getPatientInfo().getId());
+        inquiryInfo.setPatientCode(inquiryQuoteVO.getPatientInfo().getCode());
+        inquiryInfo.setPatientName(inquiryQuoteVO.getPatientInfo().getName());
+        inquiryInfo.setPatientIdNo(inquiryQuoteVO.getPatientInfo().getIdNo());
+        inquiryInfo.setPatientBirthday(inquiryQuoteVO.getPatientInfo().getBirthday());
+        inquiryInfo.setPatientPhone(inquiryQuoteVO.getPatientInfo().getPhone());
+        inquiryInfo.setPatientSex(inquiryQuoteVO.getPatientInfo().getSex());
+        updateById(inquiryInfo);
+
+        //插入引用表信息
+        InquiryQuote inquiryQuote = new InquiryQuote();
+        BeanUtil.copyProperties(inquiryQuoteVO, inquiryQuote);
+        inquiryQuote.setGmtCreate(now);
+        inquiryQuote.setGmtModified(now);
+        inquiryQuote.setHospitalDeptId(inquiryQuoteVO.getDeptInfo().getId());
+        inquiryQuote.setHospitalDeptCode(inquiryQuoteVO.getDeptInfo().getCode());
+        inquiryQuote.setHospitalDeptName(inquiryQuoteVO.getDeptInfo().getName());
+        inquiryQuote.setDoctorId(inquiryQuoteVO.getDoctorInfo().getId());
+        inquiryQuote.setDoctorCode(inquiryQuoteVO.getDoctorInfo().getCode());
+        inquiryQuote.setDoctorName(inquiryQuoteVO.getDoctorInfo().getName());
+        inquiryQuote.setPatientId(inquiryQuoteVO.getPatientInfo().getId());
+        inquiryQuote.setPatientCode(inquiryQuoteVO.getPatientInfo().getCode());
+        inquiryQuote.setPatientName(inquiryQuoteVO.getPatientInfo().getName());
+        inquiryQuote.setPatientIdNo(inquiryQuoteVO.getPatientInfo().getIdNo());
+        inquiryQuote.setPatientBirthday(inquiryQuoteVO.getPatientInfo().getBirthday());
+        inquiryQuote.setPatientPhone(inquiryQuoteVO.getPatientInfo().getPhone());
+        inquiryQuote.setPatientSex(inquiryQuoteVO.getPatientInfo().getSex());
+        inquiryQuote.setRegVisitedState(inquiryInfo.getRegVisitedState());
+        inquiryQuote.setType(inquiryInfo.getType());
+        inquiryQuote.setDataJson(inquiryInfo.getDataJson());
+
+        inquiryQuoteFacade.save(inquiryQuote);
+
+        return true;
+    }
+
+    /**
+     * icss引用预问诊
+     *
+     * @param inquiryQuoteForIcssVO
+     * @return
+     */
+    public Boolean inquiryQuoteForIcss(InquiryQuoteForIcssVO inquiryQuoteForIcssVO) {
+        InquiryInfo inquiryInfo = getById(inquiryQuoteForIcssVO.getInquiryId());
+        if (inquiryInfo == null) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "病历不存在");
+        }
+        if (!inquiryInfo.getHospitalCode().equals(inquiryQuoteForIcssVO.getHospitalCode())) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "医院不一致");
+        }
+        if (inquiryInfo.getIsQuoted() == 1) {
+            return true;
+        }
+
+        Date now = DateUtil.now();
+        inquiryInfo.setGmtModified(now);
+        inquiryInfo.setIsQuoted(1);
+        inquiryInfo.setInquiryCode(inquiryQuoteForIcssVO.getInquiryCode());
+        inquiryInfo.setPatientId(inquiryQuoteForIcssVO.getPatientId());
+        inquiryInfo.setPatientCode(inquiryQuoteForIcssVO.getPatientCode());
+        inquiryInfo.setPatientName(inquiryQuoteForIcssVO.getPatientName());
+        inquiryInfo.setPatientIdNo(inquiryQuoteForIcssVO.getPatientIdNo());
+        inquiryInfo.setPatientBirthday(inquiryQuoteForIcssVO.getPatientBirthday());
+        inquiryInfo.setPatientPhone(inquiryQuoteForIcssVO.getPatientPhone());
+        inquiryInfo.setPatientSex(inquiryQuoteForIcssVO.getPatientSex());
+        updateById(inquiryInfo);
+
+        InquiryQuote inquiryQuote = new InquiryQuote();
+        BeanUtil.copyProperties(inquiryQuoteForIcssVO, inquiryQuote);
+        inquiryQuote.setRegVisitedState(inquiryInfo.getRegVisitedState());
+        inquiryQuote.setType(inquiryInfo.getType());
+        inquiryQuote.setDataJson(inquiryInfo.getDataJson());
+
+        inquiryQuoteFacade.save(inquiryQuote);
+
+        return true;
+    }
 }
+

+ 13 - 0
prec-service/src/main/java/com/diagbot/facade/InquiryQuoteFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.InquiryQuoteServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/11/21 13:29
+ */
+@Component
+public class InquiryQuoteFacade extends InquiryQuoteServiceImpl {
+}

+ 7 - 5
prec-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -2,6 +2,8 @@ package com.diagbot.facade;
 
 import java.util.List;
 
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -31,16 +33,16 @@ public class PatientInfoFacade {
     /**
      * 页面顶部病人医生科室信息查询
      *
-     * @param getTopPatientInfoVO
+     * @param getTopPatientInfoDjVO
      * @return
      */
-    public GetTopPatientInfoDTO getTopPatientInfo(GetTopPatientInfoVO getTopPatientInfoVO) {
-        RespDTO<GetTopPatientInfoDTO> respDTO = aiptServiceClient.getTopPatientInfo(getTopPatientInfoVO);
+    public GetTopPatientInfoDjDTO getTopPatientInfo(GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        RespDTO<GetTopPatientInfoDjDTO> respDTO = aiptServiceClient.getTopPatientInfoDj(getTopPatientInfoDjVO);
         RespDTOUtil.respNGDealCover(respDTO, "获取页面顶部病人医生科室信息失败");
 
-        GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
+        GetTopPatientInfoDjDTO getTopPatientInfoDjDTO = respDTO.data;
 
-        return getTopPatientInfoDTO;
+        return getTopPatientInfoDjDTO;
     }
     
     /**

+ 46 - 35
prec-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -1,35 +1,46 @@
-package com.diagbot.facade;
-
-import com.diagbot.client.TranServiceClient;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.SysSetInfoDTO;
-import com.diagbot.util.RespDTOUtil;
-import com.diagbot.vo.HospitalSetVO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-
-/**
- * @author wangfeng
- * @Description: TODO
- * @date 2019年6月18日 上午10:24:58
- */
-@Component
-public class SysSetFacade {
-
-    @Autowired
-    TranServiceClient tranServiceClient;
-
-    /**
-     * 根据医院code获取配置信息
-     *
-     * @return
-     */
-    public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
-        RespDTO<List<SysSetInfoDTO>> sysSetInfoLists = tranServiceClient.getSysSetInfoDatas(hospitalSetVO);
-        RespDTOUtil.respNGDeal(sysSetInfoLists, "获取配置数据失败!");
-        return sysSetInfoLists.data;
-    }
-
-}
+package com.diagbot.facade;
+
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysHospitalDTO;
+import com.diagbot.dto.SysSetInfoDTO;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.SysHospitalCodeVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月18日 上午10:24:58
+ */
+@Component
+public class SysSetFacade {
+
+    @Autowired
+    TranServiceClient tranServiceClient;
+
+    /**
+     * 根据医院code获取配置信息
+     *
+     * @return
+     */
+    public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
+        RespDTO<List<SysSetInfoDTO>> sysSetInfoLists = tranServiceClient.getSysSetInfoDatas(hospitalSetVO);
+        RespDTOUtil.respNGDeal(sysSetInfoLists, "获取配置数据失败!");
+        return sysSetInfoLists.data;
+    }
+
+    /**
+     * @param sysHospitalCodeVO
+     * @return
+     */
+    public SysHospitalDTO getHospitalDeptInfoData(SysHospitalCodeVO sysHospitalCodeVO) {
+        RespDTO<SysHospitalDTO> sysHospitalDTO = tranServiceClient.getHospitalDeptInfoData(sysHospitalCodeVO);
+        RespDTOUtil.respNGDeal(sysHospitalDTO, "医院编码获取医院信息及科室信息失败!");
+        return sysHospitalDTO.data;
+    }
+}

+ 36 - 0
prec-service/src/main/java/com/diagbot/idc/AbstractIdCreater.java

@@ -0,0 +1,36 @@
+package com.diagbot.idc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: ID生成抽象类接口
+ * @author: gaodm
+ * @time: 2018/9/5 9:20
+ */
+public abstract class AbstractIdCreater<T> implements IdCreater<T> {
+
+    protected int machineId;
+    protected int dataCenterId;
+
+    public AbstractIdCreater(int machineId, int dataCenterId) {
+        this.machineId = machineId;
+        this.dataCenterId = dataCenterId;
+    }
+
+    @Override
+    public abstract Long getNextId(T param);
+
+    @Override
+    public List<Long> getNextIds(T param, int size) {
+        List<Long> longs = new ArrayList<>(size);
+        for (int i = 0; i < size; i++) {
+            longs.add(getNextId(param));
+        }
+        return longs;
+    }
+
+    protected long timeGen() {
+        return System.currentTimeMillis();
+    }
+}

+ 26 - 0
prec-service/src/main/java/com/diagbot/idc/IdCreater.java

@@ -0,0 +1,26 @@
+package com.diagbot.idc;
+
+import java.util.List;
+
+/**
+ * @Description: ID生成接口
+ * @author: gaodm
+ * @time: 2018/9/5 9:21
+ */
+public interface IdCreater<T> {
+
+    /**
+     * 生成一个id
+     *
+     * @return 生成的id
+     */
+    Long getNextId(T param);
+
+    /**
+     * 批量生成id
+     *
+     * @param size 生成数量
+     * @return 生成的id列表
+     */
+    List<Long> getNextIds(T param, int size);
+}

+ 76 - 0
prec-service/src/main/java/com/diagbot/idc/VisibleIdCreater.java

@@ -0,0 +1,76 @@
+package com.diagbot.idc;
+
+import com.diagbot.enums.VisibleIdTypeEnum;
+import com.diagbot.util.DateUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.RandomUtils;
+import org.apache.commons.lang3.time.DateUtils;
+
+import java.util.Calendar;
+
+/**
+ * @Description: 可见id每秒递增
+ * @author: gaodm
+ * @time: 2018/9/5 10:45
+ */
+@Slf4j
+public class VisibleIdCreater extends AbstractIdCreater<Integer> {
+
+    private long lastTimestamp = -1L;
+
+    private long sequence = 0L;
+    private long sequenceMask = 9999;
+
+    public VisibleIdCreater(int machineId, int dataCenterId) {
+        super(machineId, dataCenterId);
+    }
+
+    /**
+     * 对外id生成规则
+     * 1809051234550001
+     * 180905 - 12345 -  1  - 0001
+     * 日期 -  秒数  - 业务 - 秒内自增
+     *
+     * @param type 业务id 1.订单 2.交易 3.退款
+     * @return 生成的id
+     */
+    @Override
+    public synchronized Long getNextId(Integer type) {
+
+        Calendar calendar = Calendar.getInstance();
+
+        long timestamp = timeGen() / 1000;
+
+        if (timestamp < lastTimestamp) {
+            log.error(String.format("clock is moving backwards. Rejecting requests until %d.", lastTimestamp));
+            throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
+        }
+
+        if (lastTimestamp == timestamp) {
+            sequence = (sequence + 1);
+            if (sequence > sequenceMask) {
+                //timestamp = tilNextMillis(lastTimestamp);
+                log.error(String.format("id creater sequence is full. wait to next time"));
+                return null;
+            }
+        } else {
+            sequence = getNewSequence();
+        }
+
+        lastTimestamp = timestamp;
+
+        String date = DateUtil.format(calendar.getTime(), "yyMMdd");
+        long seconds = DateUtils.getFragmentInSeconds(calendar, Calendar.DAY_OF_YEAR);
+
+        return Long.valueOf(date + String.format("%05d", seconds) + String.valueOf(type) + sequence);
+    }
+
+    private long getNewSequence() {
+        return RandomUtils.nextInt(1000, 2000);
+    }
+
+    public static void main(String[] args) {
+        VisibleIdCreater visibleIdCreater = new VisibleIdCreater(0, 0);
+        System.out.println(visibleIdCreater.getNextId(VisibleIdTypeEnum.PATIENT_NO.getKey()));
+    }
+}

+ 16 - 0
prec-service/src/main/java/com/diagbot/mapper/InquiryQuoteMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.InquiryQuote;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 问诊记录-主表 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+public interface InquiryQuoteMapper extends BaseMapper<InquiryQuote> {
+
+}

+ 16 - 0
prec-service/src/main/java/com/diagbot/service/InquiryQuoteService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.InquiryQuote;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 问诊记录-主表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+public interface InquiryQuoteService extends IService<InquiryQuote> {
+
+}

+ 20 - 0
prec-service/src/main/java/com/diagbot/service/impl/InquiryQuoteServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.InquiryQuote;
+import com.diagbot.mapper.InquiryQuoteMapper;
+import com.diagbot.service.InquiryQuoteService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 问诊记录-主表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+@Service
+public class InquiryQuoteServiceImpl extends ServiceImpl<InquiryQuoteMapper, InquiryQuote> implements InquiryQuoteService {
+
+}

+ 33 - 24
prec-service/src/main/java/com/diagbot/vo/GetInquiryDetailVO.java

@@ -1,7 +1,5 @@
 package com.diagbot.vo;
 
-import javax.validation.constraints.NotBlank;
-
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
@@ -12,76 +10,87 @@ import lombok.Setter;
  * @author: rengb
  * @time: 2018/11/19 18:58
  */
-@ApiModel(value="病历详情接口传参")
+@ApiModel(value = "病历详情接口传参")
 @Getter
 @Setter
 public class GetInquiryDetailVO {
 
-	/**
+    /**
+     * 病历id
+     */
+    @ApiModelProperty(value = "病历id")
+    private Long inquiryId;
+
+    /**
      * 医院id
      */
-	@ApiModelProperty(value="医院id")
+    @ApiModelProperty(value = "医院id")
     private Long hospitalId;
-	
-	 /**
+
+    /**
      * 医院编码
      */
-	@ApiModelProperty(value="医院编码")
+    @ApiModelProperty(value = "医院编码")
     private String hospitalCode;
 
     /**
      * 医院科室id
      */
-	@ApiModelProperty(value="医院科室id")
+    @ApiModelProperty(value = "医院科室id")
     private Long hospitalDeptId;
 
     /**
      * 医院科室编码
      */
-	@ApiModelProperty(value="医院科室编码")
+    @ApiModelProperty(value = "医院科室编码")
     private String hospitalDeptCode;
 
     /**
      * 医生id
      */
-	@ApiModelProperty(value="医生id")
+    @ApiModelProperty(value = "医生id")
     private Long doctorId;
-	
+
     /**
      * 医生编码
      */
-	@ApiModelProperty(value="医生编码")
+    @ApiModelProperty(value = "医生编码")
     private String doctorCode;
 
     /**
      * 患者id
      */
-	@ApiModelProperty(value="患者id")
+    @ApiModelProperty(value = "患者id")
     private Long patientId;
-	
+
     /**
      * 患者编号
      */
-	@ApiModelProperty(value="患者编号")
+    @ApiModelProperty(value = "患者编号")
     private String patientCode;
-	
+
     /**
-     * 患者病历号
+     * 患者证件号码
      */
-	@ApiModelProperty(value="患者病历号")
+    @ApiModelProperty(value = "患者证件号码")
     private String patientIdNo;
-	
+
+    /**
+     * 患者姓名
+     */
+    @ApiModelProperty(value = "患者姓名")
+    private String patientName;
+
     /**
      * 就诊序列号
      */
-	@ApiModelProperty(value="就诊序列号",required=true)
-	@NotBlank(message="就诊序列号必传")
+    @ApiModelProperty(value = "就诊序列号")
     private String inquiryCode;
 
     /**
      * 有效天数限制
      */
-    @ApiModelProperty(value="有效天数限制")
-	private int dayLimit = 15;
+    @ApiModelProperty(value = "有效天数限制")
+    private int dayLimit = 15;
 
 }

+ 60 - 0
prec-service/src/main/java/com/diagbot/vo/GetTopPatientInfoDjVO.java

@@ -0,0 +1,60 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author rgb
+ * @Description
+ * @time 2018年11月19日下午4:58:37
+ */
+@ApiModel(value = "页面顶部病人医生科室信息查询接口传参")
+@Getter
+@Setter
+public class GetTopPatientInfoDjVO {
+
+    /**
+     * 医院编号
+     */
+    @ApiModelProperty(value = "医院编号", required = true)
+    @NotBlank(message = "医院编号必填")
+    private String hospitalCode;
+
+    /**
+     * 子医院编号
+     */
+    @ApiModelProperty(value = "子医院编号")
+    private String sonHospitalCode;
+
+    /**
+     * 医院科室编号
+     */
+    @ApiModelProperty(value = "医院科室编号", required = true)
+    @NotBlank(message = "医院科室编号必填")
+    private String hospitalDeptCode;
+
+    /**
+     * 医院医生编号
+     */
+    @ApiModelProperty(value = "医院医生编号")
+    private String doctorCode;
+
+    /**
+     * 医院患者编号
+     */
+    @ApiModelProperty(value = "医院患者编号", required = true)
+    @NotBlank(message = "医院患者编号必填")
+    private String patientCode;
+
+    /**
+     * 门诊号
+     */
+    @ApiModelProperty(value = "门诊号")
+    private String recordId;
+
+
+}

+ 12 - 2
prec-service/src/main/java/com/diagbot/vo/HisInquirysVO.java

@@ -72,6 +72,12 @@ public class HisInquirysVO {
      */
 	@ApiModelProperty(value="患者病历号")
     private String patientIdNo;
+
+	/**
+	 * 患者姓名
+	 */
+	@ApiModelProperty(value="患者姓名")
+	private String patientName;
     
     /**
      * 病历分类(1:门诊,2:住院)
@@ -98,7 +104,11 @@ public class HisInquirysVO {
 	 */
 	@ApiModelProperty(value="排序类型:1、时间降序;2、时间升序;3、就诊号降序;4、就诊号升序;")
 	private Integer orderType=1;
-	
-	
+
+	/**
+	 * 有效天数限制
+	 */
+	@ApiModelProperty(value = "有效天数限制")
+	private int dayLimit = 15;
 	   
 }

+ 39 - 0
prec-service/src/main/java/com/diagbot/vo/InquiryQuoteDeptVO.java

@@ -0,0 +1,39 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value = "病历引用接口传参-科室信息")
+@Getter
+@Setter
+public class InquiryQuoteDeptVO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 科室编码
+     */
+    @ApiModelProperty(value = "科室编码", required = true)
+    @NotNull(message = "科室编码必传")
+    private String code;
+
+    /**
+     * 科室名称
+     */
+    @ApiModelProperty(value = "科室名称", required = true)
+    @NotNull(message = "科室名称必传")
+    private String name;
+
+}

+ 69 - 0
prec-service/src/main/java/com/diagbot/vo/InquiryQuoteDoctorVO.java

@@ -0,0 +1,69 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value = "病历引用接口传参-医生信息")
+@Getter
+@Setter
+public class InquiryQuoteDoctorVO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 医生编码
+     */
+    @ApiModelProperty(value = "医生编码", required = true)
+    @NotBlank(message = "医生编码必传")
+    private String code;
+
+    /**
+     * 医生姓名
+     */
+    @ApiModelProperty(value = "医生姓名", required = true)
+    @NotBlank(message = "医生姓名必传")
+    private String name;
+
+    /**
+     * 医生性别,0-未知、1-男、2-女
+     */
+    @ApiModelProperty(value = "医生性别,0-未知、1-男、2-女")
+    private Integer sex;
+
+    /**
+     * 证件类型
+     */
+    @ApiModelProperty(value = "证件类型")
+    private String idType;
+
+    /**
+     * 证件号码
+     */
+    @ApiModelProperty(value = "证件号码")
+    private String idNo;
+
+    /**
+     * 家庭住址
+     */
+    @ApiModelProperty(value = "家庭住址")
+    private String address;
+
+    /**
+     * 联系电话
+     */
+    @ApiModelProperty(value = "联系电话")
+    private String phone;
+
+}

+ 162 - 0
prec-service/src/main/java/com/diagbot/vo/InquiryQuoteForIcssVO.java

@@ -0,0 +1,162 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value = "icss引用预问诊接口传参")
+@Getter
+@Setter
+public class InquiryQuoteForIcssVO {
+
+    /**
+     * 预问诊记录id
+     */
+    @ApiModelProperty(value = "预问诊记录id", required = true)
+    @NotNull(message = "预问诊记录id必传")
+    private Long inquiryId;
+
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(value = "医院id", required = true)
+    @NotNull(message = "医院id必传")
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    @ApiModelProperty(value = "医院编码", required = true)
+    @NotBlank(message = "医院编码必传")
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    @ApiModelProperty(value = "医院名称", required = true)
+    @NotBlank(message = "医院名称必传")
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    @ApiModelProperty(value = "子医院id")
+    private Long sonHospitalId;
+
+    /**
+     * 子医院code
+     */
+    @ApiModelProperty(value = "子医院code")
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    @ApiModelProperty(value = "子医院名称")
+    private String sonHospitalName;
+
+    /**
+     * 医院科室id
+     */
+    @ApiModelProperty(value = "医院科室id", required = true)
+    @NotNull(message = "医院科室id必传")
+    private Long hospitalDeptId;
+
+    /**
+     * 医院科室编码
+     */
+    @ApiModelProperty(value = "医院科室编码", required = true)
+    @NotBlank(message = "医院科室编码必传")
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    @ApiModelProperty(value = "医院科室名称", required = true)
+    @NotBlank(message = "医院科室名称必传")
+    private String hospitalDeptName;
+
+    /**
+     * 医生id
+     */
+    @ApiModelProperty(value = "医生id", required = true)
+    @NotNull(message = "医生id必传")
+    private Long doctorId;
+
+    /**
+     * 医生编码
+     */
+    @ApiModelProperty(value = "医生编码", required = true)
+    @NotBlank(message = "医生编码必传")
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+    @ApiModelProperty(value = "医生姓名", required = true)
+    @NotBlank(message = "医生姓名必传")
+    private String doctorName;
+
+    /**
+     * 患者id
+     */
+    @ApiModelProperty(value = "患者id", required = true)
+    @NotNull(message = "患者id必传")
+    private Long patientId;
+
+    /**
+     * 患者编号
+     */
+    @ApiModelProperty(value = "患者编号", required = true)
+    @NotBlank(message = "患者编号必传")
+    private String patientCode;
+
+    /**
+     * 患者姓名
+     */
+    @ApiModelProperty(value = "患者姓名", required = true)
+    @NotBlank(message = "患者姓名必传")
+    private String patientName;
+
+    /**
+     * 患者性别:1男2女
+     */
+    @ApiModelProperty(value = "患者性别:1男2女")
+    private Integer patientSex;
+
+    /**
+     * 患者联系电话
+     */
+    @ApiModelProperty(value = "患者联系电话")
+    private String patientPhone;
+
+    /**
+     * 患者出生日期
+     */
+    @ApiModelProperty(value = "患者出生日期,格式为:2018-11-28 17:25")
+    private Date patientBirthday;
+
+    /**
+     * 证件号码
+     */
+    @ApiModelProperty(value = "证件号码")
+    private String patientIdNo;
+
+    /**
+     * 就诊序列号
+     */
+    @ApiModelProperty(value = "就诊序列号", required = true)
+    @NotBlank(message = "就诊序列号必传")
+    private String inquiryCode;
+
+}

+ 127 - 0
prec-service/src/main/java/com/diagbot/vo/InquiryQuotePatientVO.java

@@ -0,0 +1,127 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value = "病历引用接口传参-患者信息")
+@Getter
+@Setter
+public class InquiryQuotePatientVO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 患者编号
+     */
+    @ApiModelProperty(value = "患者编号", required = true)
+    @NotBlank(message = "患者编号必传")
+    private String code;
+
+    /**
+     * 患者姓名
+     */
+    @ApiModelProperty(value = "患者姓名", required = true)
+    @NotBlank(message = "患者姓名必传")
+    private String name;
+
+    /**
+     * 性别,0-未知、1-男、2-女
+     */
+    @ApiModelProperty(value = "性别,0-未知、1-男、2-女")
+    private Integer sex;
+
+    /**
+     * 出生日期,格式为:2018-11-28 17:25:30
+     */
+    @ApiModelProperty(value = "出生日期,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date birthday;
+
+    /**
+     * 证件类型
+     */
+    @ApiModelProperty(value = "证件类型")
+    private String idType;
+
+    /**
+     * 证件号码
+     */
+    @ApiModelProperty(value = "证件号码", required = true)
+    @NotBlank(message = "证件号码必传")
+    private String idNo;
+
+    /**
+     * 家庭住址
+     */
+    @ApiModelProperty(value = "家庭住址")
+    private String address;
+
+    /**
+     * 联系电话
+     */
+    @ApiModelProperty(value = "联系电话")
+    private String phone;
+
+    /**
+     * 家庭邮编
+     */
+    @ApiModelProperty(value = "家庭邮编")
+    private String postcode;
+
+    /**
+     * 联系人
+     */
+    @ApiModelProperty(value = "联系人")
+    private String contacts;
+
+    /**
+     * 联系人电话
+     */
+    @ApiModelProperty(value = "联系人电话")
+    private String contactPhone;
+
+    /**
+     * 就职单位名称
+     */
+    @ApiModelProperty(value = "就职单位名称")
+    private String workUnit;
+
+    /**
+     * 职业
+     */
+    @ApiModelProperty(value = "职业")
+    private String operation;
+
+    /**
+     * 国籍
+     */
+    @ApiModelProperty(value = "国籍")
+    private String country;
+
+    /**
+     * 民族
+     */
+    @ApiModelProperty(value = "民族")
+    private String nationality;
+
+    /**
+     * 婚姻状况:0未婚,1已婚,2未知
+     */
+    @ApiModelProperty(value = "婚姻状况:0未婚,1已婚,2未知")
+    private Integer matrimony;
+
+}

+ 95 - 0
prec-service/src/main/java/com/diagbot/vo/InquiryQuoteVO.java

@@ -0,0 +1,95 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value = "病历引用接口传参")
+@Getter
+@Setter
+public class InquiryQuoteVO {
+
+    /**
+     * 病历id
+     */
+    @ApiModelProperty(value = "病历id", required = true)
+    @NotNull(message = "病历id必传")
+    private Long inquiryId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    @ApiModelProperty(value = "医院编码", required = true)
+    @NotBlank(message = "医院编码必传")
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    @ApiModelProperty(value = "医院名称", required = true)
+    @NotBlank(message = "医院名称必传")
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    private Long sonHospitalId;
+
+    /**
+     * 子医院编码
+     */
+    @ApiModelProperty(value = "子医院编码")
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    @ApiModelProperty(value = "子医院名称")
+    private String sonHospitalName;
+
+    /**
+     * 就诊序列号
+     */
+    @ApiModelProperty(value = "就诊序列号", required = true)
+    @NotBlank(message = "就诊序列号必传")
+    private String inquiryCode;
+
+    /**
+     * 科室信息
+     */
+    @Valid
+    @ApiModelProperty(value = "科室信息", required = true)
+    @NotNull(message = "科室信息必传")
+    private InquiryQuoteDeptVO deptInfo;
+
+    /**
+     * 医生信息
+     */
+    @Valid
+    @ApiModelProperty(value = "医生信息", required = true)
+    @NotNull(message = "医生信息必传")
+    private InquiryQuoteDoctorVO doctorInfo;
+
+    /**
+     * 患者信息
+     */
+    @ApiModelProperty(value = "患者信息", required = true)
+    @NotNull(message = "患者信息必传")
+    private InquiryQuotePatientVO patientInfo;
+
+}

+ 1 - 1
prec-service/src/main/java/com/diagbot/vo/RecordCheckVO.java

@@ -48,7 +48,7 @@ public class RecordCheckVO {
      * 就诊序列号
      */
 	@ApiModelProperty(value="就诊序列号",required=true)
-	@NotBlank(message="就诊序列号必传")
+//	@NotBlank(message="就诊序列号必传")
     private String inquiryCode;
     
 }

+ 22 - 8
prec-service/src/main/java/com/diagbot/vo/SaveInquiryVO.java

@@ -47,6 +47,24 @@ public class SaveInquiryVO {
 	@NotBlank(message="医院名称必传")
     private String hospitalName;
 
+	/**
+	 * 子医院id
+	 */
+	@ApiModelProperty(value="子医院id")
+	private Long sonHospitalId;
+
+	/**
+	 * 子医院编码
+	 */
+	@ApiModelProperty(value="子医院编码")
+	private String sonHospitalCode;
+
+	/**
+	 * 子医院名称
+	 */
+	@ApiModelProperty(value="子医院名称")
+	private String sonHospitalName;
+
     /**
      * 医院科室id
      */
@@ -71,22 +89,19 @@ public class SaveInquiryVO {
     /**
      * 医生id
      */
-	@ApiModelProperty(value="医生id",required=true)
-	@NotNull(message="医生id必传")
+	@ApiModelProperty(value="医生id")
     private Long doctorId;
 	
 	/**
      * 医生编码
      */
-	@ApiModelProperty(value="医生编码",required=true)
-	@NotBlank(message="医生编码必传")
+	@ApiModelProperty(value="医生编码")
     private String doctorCode;
 
     /**
      * 医生姓名
      */
-	@ApiModelProperty(value="医生姓名",required=true)
-	@NotBlank(message="医生姓名必传")
+	@ApiModelProperty(value="医生姓名")
     private String doctorName;
 
     /**
@@ -140,8 +155,7 @@ public class SaveInquiryVO {
     /**
      * 就诊序列号
      */
-	@ApiModelProperty(value="就诊序列号",required=true)
-	@NotBlank(message="就诊序列号必传")
+	@ApiModelProperty(value="就诊序列号")
     private String inquiryCode;
 
     /**

+ 20 - 2
prec-service/src/main/java/com/diagbot/vo/SignInVO.java

@@ -1,12 +1,12 @@
 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;
 
+import javax.validation.constraints.NotBlank;
+
 /**
  * @Description:
  * @author: rengb
@@ -23,6 +23,24 @@ public class SignInVO {
 	@ApiModelProperty(value="医院编号",required=true)
 	@NotBlank(message="医院编号必填")
 	private String hospitalCode;
+
+	/**
+	 * 医院名称
+	 */
+	@ApiModelProperty(value="医院名称")
+	private String hospitalName;
+
+	/**
+	 * 子医院编号
+	 */
+	@ApiModelProperty(value="子医院编号")
+	private String sonHospitalCode;
+
+	/**
+	 * 子医院名称
+	 */
+	@ApiModelProperty(value="子医院名称")
+	private String sonHospitalName;
 	
 	/**
      * 患者信息类型,101-身份证、102-病历号、103-手机号、104-市民卡卡号

+ 18 - 0
prec-service/src/main/java/com/diagbot/vo/SysHospitalCodeVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-11-18 19:17
+ */
+@Getter
+@Setter
+public class SysHospitalCodeVO {
+    @NotBlank(message = "请输入医院编码")
+    private  String hospitalCode;
+}

+ 18 - 0
prec-service/src/main/java/com/diagbot/web/InquiryInfoController.java

@@ -9,6 +9,8 @@ import com.diagbot.dto.SaveInquiryDTO;
 import com.diagbot.facade.InquiryInfoFacade;
 import com.diagbot.vo.GetInquiryDetailVO;
 import com.diagbot.vo.HisInquirysVO;
+import com.diagbot.vo.InquiryQuoteForIcssVO;
+import com.diagbot.vo.InquiryQuoteVO;
 import com.diagbot.vo.RecordCheckVO;
 import com.diagbot.vo.SaveInquiryVO;
 import io.swagger.annotations.Api;
@@ -65,5 +67,21 @@ public class InquiryInfoController {
         return RespDTO.onSuc(inquiryInfoFacade.getInquiryDetail(getInquiryDetailVO));
     }
 
+    @ApiOperation(value = "病历引用[by:rengb]")
+    @PostMapping("/inquiryQuote")
+    @SysLogger("inquiryQuote")
+    @Transactional
+    public RespDTO<Boolean> inquiryQuote(@Valid @RequestBody InquiryQuoteVO inquiryQuoteVO) {
+        return RespDTO.onSuc(inquiryInfoFacade.inquiryQuote(inquiryQuoteVO));
+    }
+
+    @ApiOperation(value = "icss引用预问诊[by:rengb]")
+    @PostMapping("/inquiryQuoteForIcss")
+    @SysLogger("inquiryQuoteForIcss")
+    @Transactional
+    public RespDTO<Boolean> inquiryQuoteForIcss(@Valid @RequestBody InquiryQuoteForIcssVO inquiryQuoteForIcssVO) {
+        return RespDTO.onSuc(inquiryInfoFacade.inquiryQuoteForIcss(inquiryQuoteForIcssVO));
+    }
+
 
 }

+ 4 - 2
prec-service/src/main/java/com/diagbot/web/PatientInfoController.java

@@ -5,6 +5,8 @@ import java.util.List;
 
 import javax.validation.Valid;
 
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -46,8 +48,8 @@ public class PatientInfoController {
                     "patientCode:医院患者编号,必填<br>")
     @PostMapping("/getTopPatientInfo")
     @SysLogger("getTopPatientInfo")
-    public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@Valid @RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
-        return RespDTO.onSuc(patientInfoFacade.getTopPatientInfo(getTopPatientInfoVO));
+    public RespDTO<GetTopPatientInfoDjDTO> getTopPatientInfo(@Valid @RequestBody GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        return RespDTO.onSuc(patientInfoFacade.getTopPatientInfo(getTopPatientInfoDjVO));
     }
     
     @ApiOperation(value = "患者登录[by:rengb]")

+ 54 - 44
prec-service/src/main/java/com/diagbot/web/SysSetController.java

@@ -1,44 +1,54 @@
-package com.diagbot.web;
-
-
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.SysSetInfoDTO;
-import com.diagbot.facade.SysSetFacade;
-import com.diagbot.vo.HospitalSetVO;
-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;
-import java.util.List;
-
-/**
- * <p>
- * 医院所有配置信息 前端控制器
- * </p>
- *
- * @author wangfeng
- * @since 2019-06-18
- */
-@RestController
-@RequestMapping("/sysSet")
-@Api(value = "配置信息API", tags = { "智能预问诊-配置信息API" })
-@SuppressWarnings("unchecked")
-public class SysSetController {
-
-    @Autowired
-    SysSetFacade sysSetFacade;
-
-    @ApiOperation(value = "智能预问诊-根据医院编码获取配置信息[by:wangfeng]", notes = "hospitalCode :医院code  必填<br> ")
-    @PostMapping("/getSysSetInfoDatas")
-    @SysLogger("getSysSetInfoDatas")
-    public RespDTO<List<SysSetInfoDTO>> getSysSetInfoDatas(@Valid @RequestBody HospitalSetVO hospitalSetVO) {
-        List<SysSetInfoDTO> data = sysSetFacade.getSysSetInfoData(hospitalSetVO);
-        return RespDTO.onSuc(data);
-    }
-}
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.SysHospitalDTO;
+import com.diagbot.dto.SysSetInfoDTO;
+import com.diagbot.facade.SysSetFacade;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.SysHospitalCodeVO;
+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;
+import java.util.List;
+
+/**
+ * <p>
+ * 医院所有配置信息 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2019-06-18
+ */
+@RestController
+@RequestMapping("/sysSet")
+@Api(value = "配置信息API", tags = { "智能预问诊-配置信息API" })
+@SuppressWarnings("unchecked")
+public class SysSetController {
+
+    @Autowired
+    SysSetFacade sysSetFacade;
+
+    @ApiOperation(value = "智能预问诊-根据医院编码获取配置信息[by:wangfeng]", notes = "hospitalCode :医院code  必填<br> ")
+    @PostMapping("/getSysSetInfoDatas")
+    @SysLogger("getSysSetInfoDatas")
+    public RespDTO<List<SysSetInfoDTO>> getSysSetInfoDatas(@Valid @RequestBody HospitalSetVO hospitalSetVO) {
+        List<SysSetInfoDTO> data = sysSetFacade.getSysSetInfoData(hospitalSetVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "根据医院编码获取医院信息及科室信息[by:wangfeng]", notes = "hospitalCode :医院code  必填")
+    @PostMapping("/getHospitalDatas")
+    @SysLogger("getHospitalDatas")
+    public RespDTO<SysHospitalDTO> getHospitalDatas(@Valid @RequestBody SysHospitalCodeVO sysHospitalCodeVO) {
+        SysHospitalDTO data = sysSetFacade.getHospitalDeptInfoData(sysHospitalCodeVO);
+        return RespDTO.onSuc(data);
+    }
+}

+ 4 - 0
prec-service/src/main/resources/mapper/InquiryInfoMapper.xml

@@ -13,6 +13,9 @@
         <result column="hospital_id" property="hospitalId" />
         <result column="hospital_code" property="hospitalCode" />
         <result column="hospital_name" property="hospitalName" />
+        <result column="son_hospital_id" property="sonHospitalId" />
+        <result column="son_hospital_code" property="sonHospitalCode" />
+        <result column="son_hospital_name" property="sonHospitalName" />
         <result column="hospital_dept_id" property="hospitalDeptId" />
         <result column="hospital_dept_code" property="hospitalDeptCode" />
         <result column="hospital_dept_name" property="hospitalDeptName" />
@@ -30,6 +33,7 @@
         <result column="reg_visited_state" property="regVisitedState" />
         <result column="type" property="type" />
         <result column="data_json" property="dataJson" />
+        <result column="is_quoted" property="isQuoted" />
         <result column="remark" property="remark" />
     </resultMap>
 

+ 40 - 0
prec-service/src/main/resources/mapper/InquiryQuoteMapper.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.InquiryQuoteMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.InquiryQuote">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="inquiry_id" property="inquiryId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="hospital_code" property="hospitalCode" />
+        <result column="hospital_name" property="hospitalName" />
+        <result column="son_hospital_id" property="sonHospitalId" />
+        <result column="son_hospital_code" property="sonHospitalCode" />
+        <result column="son_hospital_name" property="sonHospitalName" />
+        <result column="hospital_dept_id" property="hospitalDeptId" />
+        <result column="hospital_dept_code" property="hospitalDeptCode" />
+        <result column="hospital_dept_name" property="hospitalDeptName" />
+        <result column="doctor_id" property="doctorId" />
+        <result column="doctor_code" property="doctorCode" />
+        <result column="doctor_name" property="doctorName" />
+        <result column="patient_id" property="patientId" />
+        <result column="patient_code" property="patientCode" />
+        <result column="patient_name" property="patientName" />
+        <result column="patient_sex" property="patientSex" />
+        <result column="patient_phone" property="patientPhone" />
+        <result column="patient_birthday" property="patientBirthday" />
+        <result column="patient_id_no" property="patientIdNo" />
+        <result column="inquiry_code" property="inquiryCode" />
+        <result column="reg_visited_state" property="regVisitedState" />
+        <result column="type" property="type" />
+        <result column="data_json" property="dataJson" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 3 - 1
prec-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
 import com.baomidou.mybatisplus.generator.config.GlobalConfig;
 import com.baomidou.mybatisplus.generator.config.PackageConfig;
 import com.baomidou.mybatisplus.generator.config.StrategyConfig;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
 import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
 import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
 
@@ -34,6 +35,7 @@ public class CodeGeneration {
         gc.setBaseResultMap(true);// XML ResultMap
         gc.setBaseColumnList(false);// XML columList
         gc.setAuthor("gaodm");// 作者
+        gc.setDateType(DateType.ONLY_DATE);
 
         // 自定义文件命名,注意 %s 会自动填充表实体属性!
         gc.setControllerName("%sController");
@@ -56,7 +58,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
         strategy.setTablePrefix(new String[] { "prec_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "prec_question_info" }); // 需要生成的表
+        strategy.setInclude(new String[] { "prec_inquiry_quote" }); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);

+ 1 - 0
precman-service/src/main/java/com/diagbot/dto/QuestionDTO.java

@@ -34,5 +34,6 @@ public class QuestionDTO {
     private Integer exclusionType; //互斥类型
     private List<QuestionDetail> questionDetailList = new ArrayList<>(); //标签明细表
     private List<QuestionDTO> questionMapping = new ArrayList<>();     //下级标签
+    private String flag; // 类型标记
     private String remark;//备注
 }

+ 5 - 0
precman-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -136,6 +136,11 @@ public class QuestionInfo implements Serializable {
      */
     private String description;
 
+    /**
+     * 类型标记(1:时间类型,2:诱因类型,3:有无类型)
+     */
+    private String flag;
+
     /**
      * 备注
      */

+ 1 - 0
precman-service/src/main/java/com/diagbot/entity/wrapper/QuestionWrapper.java

@@ -37,6 +37,7 @@ public class QuestionWrapper implements Serializable {
     private Integer required; //必填(0:不必填,1:必填)
     private String explains; //必填(0:不必填,1:必填)
     private String description; //患者界面描述
+    private String flag; //类型标记
     private String remark; //备注
     private List<QuestionDetail> questionDetails = new ArrayList<>(); //明细
     private List<QuestionMappingWrapper> questionMappings = new ArrayList<>(); //映射关系

+ 1 - 0
precman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -26,6 +26,7 @@
         <result column="required" property="required" />
         <result column="explains" property="explains" />
         <result column="description" property="description" />
+        <result column="flag" property="flag" />
         <result column="remark" property="remark" />
     </resultMap>
 

+ 45 - 0
tran-service/src/main/java/com/diagbot/dto/GetHospitalRankInfoDTO.java

@@ -0,0 +1,45 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2019/3/19 13:56
+ */
+@Getter
+@Setter
+public class GetHospitalRankInfoDTO {
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    private Long sonHospitalId;
+
+    /**
+     * 子医院编码
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String sonHospitalName;
+
+}

+ 145 - 0
tran-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDjDTO.java

@@ -0,0 +1,145 @@
+package com.diagbot.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author rgb
+ * @Description
+ * @time 2018年11月19日下午4:57:43
+ */
+@Getter
+@Setter
+public class GetTopPatientInfoDjDTO {
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    private Long sonHospitalId;
+
+    /**
+     * 子医院编码
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String sonHospitalName;
+
+    /**
+     * 医院科室id
+     */
+    private Long hospitalDeptId;
+
+    /**
+     * 自己科室id
+     */
+    private Long selfDeptId;
+
+    /**
+     * 自己科室名称
+     */
+    private String selfDeptName;
+
+    /**
+     * 医院科室编码
+     */
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    private String hospitalDeptName;
+
+    /**
+     * 医生id
+     */
+    private Long doctorId;
+
+    /**
+     * 医生编码
+     */
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 病人id
+     */
+    private Long patientId;
+
+    /**
+     * 病人编号
+     */
+    private String patientCode;
+
+    /**
+     * 病人姓名
+     */
+    private String patientName;
+
+    /**
+     * 病人性别
+     */
+    private String patientSex;
+
+    /**
+     * 病人年龄
+     */
+    private Integer patientAge;
+
+    /**
+     * 病人证件号码
+     */
+    private String patientIdNo;
+
+    /**
+     * 系统时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date systemTime;
+
+    /**
+     * 出生日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    private Date birthday;
+
+    /**
+     * 门诊号
+     */
+    private String recordId;
+
+    /**
+     * 模式分类
+     */
+    private Integer modeClassify;
+
+    /**
+     * 模式值
+     */
+    private Integer modeValue;
+
+}

+ 48 - 0
tran-service/src/main/java/com/diagbot/dto/RegisterInfoDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.PatientInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description: 对接-医院返回挂号信息
+ * @author: rengb
+ * @time: 2018/11/19 18:56
+ */
+@Getter
+@Setter
+public class RegisterInfoDTO {
+
+	/**
+	 * 医院编号
+	 */
+	private String hospitalCode;
+
+	/**
+	 * 医院名称
+	 */
+	private String hospitalName;
+
+	/**
+	 * 子医院编号
+	 */
+	private String sonHospitalCode;
+
+	/**
+	 * 子医院名称
+	 */
+	private String sonHospitalName;
+
+	/**
+	 * 病人信息
+	 */
+	private PatientInfo patientInfo;
+
+	/**
+	 * 详情
+	 */
+	private List<RegisterInfoDetailDTO> detail;
+		
+}

+ 46 - 0
tran-service/src/main/java/com/diagbot/dto/RegisterInfoDetailDTO.java

@@ -0,0 +1,46 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.DoctorInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 对接-医院返回挂号信息-详情
+ * @author: rengb
+ * @time: 2019/11/20 9:57
+ */
+@Getter
+@Setter
+public class RegisterInfoDetailDTO {
+
+    /**
+     * 医院科室编码
+     */
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    private String hospitalDeptName;
+
+    /**
+     * 医生信息
+     */
+    private DoctorInfo doctorInfo;
+
+    /**
+     * 挂号时间
+     */
+    private String recordTime;
+
+    /**
+     * 就诊号
+     */
+    private String recordId;
+
+    /**
+     * 挂号信息
+     */
+    private String registerNum;
+
+}

+ 55 - 45
tran-service/src/main/java/com/diagbot/dto/SignInDTO.java

@@ -1,6 +1,5 @@
 package com.diagbot.dto;
 
-import io.swagger.annotations.ApiModel;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -9,12 +8,11 @@ import lombok.Setter;
  * @author: rengb
  * @time: 2018/11/19 18:56
  */
-@ApiModel(value="患者登录接口出参")
 @Getter
 @Setter
-public class SignInDTO{
-	
-	/**
+public class SignInDTO {
+
+    /**
      * 医院编码
      */
     private String hospitalCode;
@@ -23,8 +21,18 @@ public class SignInDTO{
      * 医院名称
      */
     private String hospitalName;
-	
-	/**
+
+    /**
+     * 子医院编号
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String sonHospitalName;
+
+    /**
      * 医院科室编码
      */
     private String hospitalDeptCode;
@@ -33,8 +41,8 @@ public class SignInDTO{
      * 医院科室名称
      */
     private String hospitalDeptName;
-	
-	/**
+
+    /**
      * 医生编码
      */
     private String doctorCode;
@@ -43,50 +51,52 @@ public class SignInDTO{
      * 医生姓名
      */
     private String doctorName;
-	
-	/**
+
+    /**
      * 病人编号
      */
     private String patientCode;
-	
-	/**
+
+    /**
      * 病人姓名
      */
     private String patientName;
-	
-	/**
-	 * 挂号时间
-	 */
-	private String recordTime;
-	
-	/**
+
+    /**
+     * 挂号时间
+     */
+    private String recordTime;
+
+    /**
      * 就诊号
      */
-	private String recordId;
-	
-	/**
+    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;
-	}
-	
-	
-	
-
-		
+    private String registerNum;
+
+    public SignInDTO() {
+
+    }
+
+    public SignInDTO(String hospitalCode, String hospitalName, String sonHospitalCode, String sonHospitalName,
+                     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.sonHospitalCode = sonHospitalCode;
+        this.sonHospitalName = sonHospitalName;
+        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;
+    }
+
 }

+ 25 - 0
tran-service/src/main/java/com/diagbot/dto/SysHospitalDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-11-18 18:29
+ */
+@Getter
+@Setter
+public class SysHospitalDTO {
+
+    /**
+     * 顶级集团信息
+     */
+    private  SysHospitalDeptInfoDTO superiorsInfo;
+    /**
+     * 下级医院信息
+     */
+    private List<SysHospitalDeptInfoDTO> juniorHospital ;
+}

+ 19 - 0
tran-service/src/main/java/com/diagbot/dto/SysHospitalDeptInfoDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-11-18 18:33
+ */
+@Getter
+@Setter
+public class SysHospitalDeptInfoDTO {
+
+    private  String hospitalCode;
+    private  String hospitalName;
+    private  String deptCode;
+    private  String deptName;
+}

+ 73 - 73
tran-service/src/main/java/com/diagbot/dto/SysSetInfoDTO.java

@@ -1,73 +1,73 @@
-package com.diagbot.dto;
-
-import java.time.LocalDateTime;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * 
- * @author wangfeng
- * @Description: TODO
- * @date 2019年6月12日 下午3:31:22
- */
-@Setter
-@Getter
-public class SysSetInfoDTO {
-	  /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-    /**
-     * 记录创建时间
-     */
-    private LocalDateTime gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private LocalDateTime gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 医院编码
-     */
-    private String hospitalCode;
-
-    /**
-     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
-     */
-    private Integer sysType;
-
-    /**
-     * 配置名称
-     */
-    private String name;
-    
-    /**
-     * 配置编码
-     */
-    private String code;
-    /**
-     * 配置值
-     */
-    private Integer value;
-
-    /**
-     * 备注
-     */
-    private String remark;
-}
+package com.diagbot.dto;
+
+import java.time.LocalDateTime;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月12日 下午3:31:22
+ */
+@Setter
+@Getter
+public class SysSetInfoDTO {
+	  /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
+     */
+    private Integer sysType;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+    
+    /**
+     * 配置编码
+     */
+    private String code;
+    /**
+     * 配置值
+     */
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 199 - 199
tran-service/src/main/java/com/diagbot/entity/SysSet.java

@@ -1,199 +1,199 @@
-package com.diagbot.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 医院所有配置信息
- * </p>
- *
- * @author zhaops
- * @since 2019-08-14
- */
-@TableName("tran_sys_set")
-public class SysSet implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 医院编码
-     */
-    private String hospitalCode;
-
-    /**
-     * 方案编号
-     */
-    private Integer plan;
-
-    /**
-     * 访问的系统类型(1, "user-service"),(2, "diagbotman-service"),(3, "uaa-service"),(4, "log-service"),(5, "bi-service"),(6, "ltapi-service"),(7, "feedback-service"),(8, "icss-old-service"),(9, "triage-service"),(10, "appkey"),(11, "icss-service"),(12, "icssman-service"),(13, "knowledgeman-service"),(14, "tran-service"),(15, "aipt-service"),(16, "data-service"),(17, "prec-service");
-     */
-    private Integer sysType;
-
-    /**
-     * 配置名称
-     */
-    private String name;
-
-    /**
-     * 配置编码
-     */
-    private String code;
-
-    /**
-     * 配置值
-     */
-    private Integer value;
-
-    /**
-     * 备注
-     */
-    private String remark;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-    public String getHospitalCode() {
-        return hospitalCode;
-    }
-
-    public void setHospitalCode(String hospitalCode) {
-        this.hospitalCode = hospitalCode;
-    }
-    public Integer getPlan() {
-        return plan;
-    }
-
-    public void setPlan(Integer plan) {
-        this.plan = plan;
-    }
-    public Integer getSysType() {
-        return sysType;
-    }
-
-    public void setSysType(Integer sysType) {
-        this.sysType = sysType;
-    }
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-    public Integer getValue() {
-        return value;
-    }
-
-    public void setValue(Integer value) {
-        this.value = value;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "SysSet{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreate=" + gmtCreate +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", hospitalCode=" + hospitalCode +
-        ", plan=" + plan +
-        ", sysType=" + sysType +
-        ", name=" + name +
-        ", code=" + code +
-        ", value=" + value +
-        ", remark=" + remark +
-        "}";
-    }
-}
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 医院所有配置信息
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-08-14
+ */
+@TableName("tran_sys_set")
+public class SysSet implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 方案编号
+     */
+    private Integer plan;
+
+    /**
+     * 访问的系统类型(1, "user-service"),(2, "diagbotman-service"),(3, "uaa-service"),(4, "log-service"),(5, "bi-service"),(6, "ltapi-service"),(7, "feedback-service"),(8, "icss-old-service"),(9, "triage-service"),(10, "appkey"),(11, "icss-service"),(12, "icssman-service"),(13, "knowledgeman-service"),(14, "tran-service"),(15, "aipt-service"),(16, "data-service"),(17, "prec-service");
+     */
+    private Integer sysType;
+
+    /**
+     * 配置名称
+     */
+    private String name;
+
+    /**
+     * 配置编码
+     */
+    private String code;
+
+    /**
+     * 配置值
+     */
+    private String value;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+    public Integer getPlan() {
+        return plan;
+    }
+
+    public void setPlan(Integer plan) {
+        this.plan = plan;
+    }
+    public Integer getSysType() {
+        return sysType;
+    }
+
+    public void setSysType(Integer sysType) {
+        this.sysType = sysType;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "SysSet{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", hospitalCode=" + hospitalCode +
+        ", plan=" + plan +
+        ", sysType=" + sysType +
+        ", name=" + name +
+        ", code=" + code +
+        ", value=" + value +
+        ", remark=" + remark +
+        "}";
+    }
+}

+ 40 - 0
tran-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java

@@ -0,0 +1,40 @@
+package com.diagbot.exception;
+
+/**
+ * @Description: 本服务错误码
+ * 系统码(3位) + 等级码(1位) + 4位顺序号
+ * 系统码 通用码 000;用户中心 100; 管理中心 200;
+ * @author: gaodm
+ * @time: 2018/9/10 11:11
+ */
+public enum ServiceErrorCode implements ErrorCode {
+    IDCARD_LOGIN("17020000", "请使用身份证号码登录"),
+    IQC_NOT_FOUND("17020001", "就诊号不存在");
+
+    private String code;
+    private String msg;
+
+
+    ServiceErrorCode(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public static ServiceErrorCode codeOf(String code) {
+        for (ServiceErrorCode state : values()) {
+            if (state.getCode() == code) {
+                return state;
+            }
+        }
+        return null;
+    }
+}

+ 446 - 0
tran-service/src/main/java/com/diagbot/facade/PatientInfoDjFacade.java

@@ -0,0 +1,446 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
+import com.diagbot.dto.RegisterInfoDTO;
+import com.diagbot.dto.SignInDTO;
+import com.diagbot.entity.DoctorInfo;
+import com.diagbot.entity.HospitalDept;
+import com.diagbot.entity.HospitalInfo;
+import com.diagbot.entity.PatientInfo;
+import com.diagbot.entity.SysSet;
+import com.diagbot.enums.SysTypeEnum;
+import com.diagbot.enums.VisibleIdTypeEnum;
+import com.diagbot.exception.CommonException;
+import com.diagbot.exception.ServiceErrorCode;
+import com.diagbot.idc.VisibleIdCreater;
+import com.diagbot.service.DoctorInfoService;
+import com.diagbot.service.HospitalDeptService;
+import com.diagbot.service.impl.PatientInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.IdCard;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
+import com.diagbot.vo.InquiryQuoteVO;
+import com.diagbot.vo.SignInVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 对接-患者业务逻辑
+ * @author: wangyu
+ * @time: 2018/11/19 13:19
+ */
+@Component
+public class PatientInfoDjFacade extends PatientInfoServiceImpl {
+    @Autowired
+    private HospitalInfoFacade hospitalInfoFacade;
+    @Autowired
+    private HospitalDeptFacade hospitalDeptFacade;
+    @Autowired
+    @Qualifier("hospitalDeptServiceImpl")
+    private HospitalDeptService hospitalDeptService;
+    @Autowired
+    private DoctorInfoFacade doctorInfoFacade;
+    @Autowired
+    @Qualifier("doctorInfoServiceImpl")
+    private DoctorInfoService doctorInfoService;
+    @Autowired
+    private SysSetFacade sysSetFacade;
+    @Autowired
+    private VisibleIdCreater visibleIdCreater;
+
+    /**
+     * 对接-页面顶部病人医生科室信息——查询
+     *
+     * @param getTopPatientInfoDjVO
+     * @return
+     */
+    public GetTopPatientInfoDjDTO getTopPatientInfoDj(GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        GetTopPatientInfoDjDTO getTopPatientInfoDjDTO = this.baseMapper.getTopPatientInfoDj(getTopPatientInfoDjVO);
+        getTopPatientInfoDjDTO.setSystemTime(DateUtil.now());
+        getTopPatientInfoDjDTO.setRecordId(getTopPatientInfoDjVO.getRecordId());
+        getTopPatientInfoDjDTO.setPatientAge(DateUtil.yearCompare(getTopPatientInfoDjDTO.getBirthday(), DateUtil.now()));
+
+        List<String> hospitalCodeList = Lists.newArrayList();
+        hospitalCodeList.add(getTopPatientInfoDjVO.getHospitalCode());
+        if (StringUtil.isNotBlank(getTopPatientInfoDjVO.getSonHospitalCode())) {
+            hospitalCodeList.add(getTopPatientInfoDjVO.getSonHospitalCode());
+        }
+        QueryWrapper<HospitalInfo> hospitalInfoQe = new QueryWrapper<>();
+        hospitalInfoQe.in("code", hospitalCodeList);
+        Map<String, HospitalInfo> hospitalInfoMap = hospitalInfoFacade.list(hospitalInfoQe)
+                .stream().collect(Collectors.toMap(HospitalInfo::getCode, i -> i));
+
+        HospitalInfo hospitalInfo = hospitalInfoMap.get(getTopPatientInfoDjVO.getHospitalCode());
+        HospitalInfo sonHospitalInfo = hospitalInfoMap.get(getTopPatientInfoDjVO.getSonHospitalCode());
+        getTopPatientInfoDjDTO.setHospitalId(hospitalInfo.getId());
+        getTopPatientInfoDjDTO.setHospitalCode(hospitalInfo.getCode());
+        getTopPatientInfoDjDTO.setHospitalName(hospitalInfo.getName());
+        if (sonHospitalInfo != null) {
+            getTopPatientInfoDjDTO.setSonHospitalId(sonHospitalInfo.getId());
+            getTopPatientInfoDjDTO.setSonHospitalCode(sonHospitalInfo.getCode());
+            getTopPatientInfoDjDTO.setSonHospitalName(sonHospitalInfo.getName());
+        }
+
+        QueryWrapper<HospitalDept> hospitalDeptQe = new QueryWrapper<>();
+        hospitalDeptQe.eq("hospital_code",
+                StringUtil.isBlank(getTopPatientInfoDjVO.getSonHospitalCode())
+                        ? getTopPatientInfoDjVO.getHospitalCode()
+                        : getTopPatientInfoDjVO.getSonHospitalCode());
+        hospitalDeptQe.eq("code", getTopPatientInfoDjVO.getHospitalDeptCode());
+        HospitalDept hospitalDept = hospitalDeptFacade.getOne(hospitalDeptQe, false);
+        if (hospitalDept != null) {
+            getTopPatientInfoDjDTO.setHospitalDeptId(hospitalDept.getId());
+            getTopPatientInfoDjDTO.setHospitalDeptCode(hospitalDept.getCode());
+            getTopPatientInfoDjDTO.setHospitalDeptName(hospitalDept.getName());
+            getTopPatientInfoDjDTO.setSelfDeptName(hospitalDept.getConceptDeptName());
+        }
+
+        return getTopPatientInfoDjDTO;
+    }
+
+    /**
+     * 患者登录
+     *
+     * @param signInVO
+     * @return
+     */
+    public List<SignInDTO> signIn(SignInVO signInVO) {
+        List<SignInDTO> retList = null;
+
+        RegisterInfoDTO rif = getRegisterInfo(signInVO);
+        if (rif != null) {
+            generateByRif(rif);
+            retList = rifConverSin(rif);
+        } else {
+            retList = autoGenePatinfo(signInVO);
+        }
+
+        if (retList == null) {
+            throw new CommonException(ServiceErrorCode.IQC_NOT_FOUND);
+        }
+
+        return retList;
+    }
+
+    /**
+     * 自动生成患者信息
+     *
+     * @param signInVO
+     * @return
+     */
+    private List<SignInDTO> autoGenePatinfo(SignInVO signInVO) {
+        QueryWrapper<SysSet> sysSetQe = new QueryWrapper<>();
+        sysSetQe.eq("sys_type", SysTypeEnum.PREC_SERVICE.getKey());
+        sysSetQe.and(qe1 -> qe1
+                .and(qe2 -> qe2
+                        .eq("hospital_code", signInVO.getHospitalCode())
+                        .eq("code", "patientinfo"))
+                .or(qe3 -> qe3
+                        .eq("hospital_code",
+                                StringUtil.isBlank(signInVO.getSonHospitalCode()) ? signInVO.getHospitalCode()
+                                        : signInVO.getSonHospitalCode())
+                        .eq("code", "default_dept")));
+        Map<String, String> sysSetCodeValue = sysSetFacade.list(sysSetQe).stream()
+                .collect(Collectors.toMap(SysSet::getCode, i -> i.getValue()));
+
+        if (StringUtil.isBlank(sysSetCodeValue.get("patientinfo"))
+                || !sysSetCodeValue.get("patientinfo").equals("1")) {
+            return null;
+        }
+        if (!signInVO.getPatientInfoType().equals("101")) {
+            throw new CommonException(ServiceErrorCode.IDCARD_LOGIN);
+        }
+
+        List<SignInDTO> retList = Lists.newArrayList();
+        SignInDTO signInDTO = new SignInDTO();
+        signInDTO.setHospitalCode(signInVO.getHospitalCode());
+        signInDTO.setHospitalName(signInVO.getHospitalName());
+        signInDTO.setSonHospitalCode(signInVO.getSonHospitalCode());
+        signInDTO.setSonHospitalName(signInVO.getSonHospitalName());
+
+        String hospitalDeptCode = sysSetCodeValue.get("default_dept");
+        signInDTO.setHospitalDeptCode(hospitalDeptCode);
+
+        QueryWrapper<HospitalDept> hospitalDeptQe = new QueryWrapper<>();
+        hospitalDeptQe.eq("hospital_code",
+                StringUtil.isBlank(signInVO.getSonHospitalCode()) ? signInVO.getHospitalCode() : signInVO.getSonHospitalCode());
+        hospitalDeptQe.eq("code", hospitalDeptCode);
+        signInDTO.setHospitalDeptName(hospitalDeptFacade.getOne(hospitalDeptQe, false).getName());
+
+        QueryWrapper<PatientInfo> patientInfoQe = new QueryWrapper<>();
+        patientInfoQe.eq("id_no", signInVO.getPatientInfo());
+        patientInfoQe.eq("name", signInVO.getPatientName());
+        PatientInfo patientInfo = getOne(patientInfoQe, false);
+        if (patientInfo == null) {
+            patientInfo = new PatientInfo();
+            patientInfo.setGmtCreate(DateUtil.now());
+            patientInfo.setHospitalCode(signInVO.getHospitalCode());
+            patientInfo.setIdNo(signInVO.getPatientInfo());
+            patientInfo.setIdentityNum(signInVO.getPatientInfo());
+            patientInfo.setName(signInVO.getPatientName());
+            patientInfo.setSex(IdCard.getGenderByIdCard(signInVO.getPatientInfo()));
+            patientInfo.setBirthday(DateUtil.parseDate(IdCard.getBirthByIdCard(signInVO.getPatientInfo()), "yyyyMMdd"));
+
+            patientInfo.setCode("" + visibleIdCreater.getNextShortId(VisibleIdTypeEnum.PATIENT_NO.getKey()));
+            patientInfo.setRemark("1");//自动生成标志
+
+            save(patientInfo);
+        }
+        signInDTO.setPatientCode(patientInfo.getCode());
+        signInDTO.setPatientName(patientInfo.getName());
+
+        retList.add(signInDTO);
+        return retList;
+    }
+
+    /**
+     * his返回的挂号信息转化给前端
+     *
+     * @param rif
+     * @return
+     */
+    private List<SignInDTO> rifConverSin(RegisterInfoDTO rif) {
+        List<SignInDTO> retList = Lists.newArrayList();
+        rif.getDetail().forEach(i -> {
+            SignInDTO signInDTO = new SignInDTO(
+                    rif.getHospitalCode(),
+                    rif.getHospitalName(),
+                    rif.getSonHospitalCode(),
+                    rif.getSonHospitalName(),
+                    i.getHospitalDeptCode(),
+                    i.getHospitalDeptName(),
+                    i.getDoctorInfo().getCode(),
+                    i.getDoctorInfo().getName(),
+                    rif.getPatientInfo().getCode(),
+                    rif.getPatientInfo().getName(),
+                    i.getRecordTime(),
+                    i.getRecordId(),
+                    i.getRegisterNum()
+            );
+            retList.add(signInDTO);
+        });
+        return retList;
+    }
+
+    /**
+     * 由挂号信息检查病人科室医生信息,有更新,无插入
+     *
+     * @param rif
+     */
+    private void generateByRif(RegisterInfoDTO rif) {
+        String hospitalCode = rif.getHospitalCode();
+        String hospitalName = rif.getHospitalName();
+        String sonHospitalCode = rif.getSonHospitalCode();
+        String sonHospitalName = rif.getSonHospitalName();
+
+        PatientInfo patientInfo = rif.getPatientInfo();
+        QueryWrapper<PatientInfo> patientInfoQe = new QueryWrapper<>();
+        patientInfoQe.eq("hospital_code", hospitalCode);
+        patientInfoQe.eq("code", patientInfo.getCode());
+        PatientInfo patientInfoQuery = getOne(patientInfoQe, false);
+        if (patientInfoQuery == null) {
+            patientInfo.setHospitalCode(hospitalCode);
+            save(patientInfo);
+        } else {
+            BeanUtil.copyProperties(patientInfo, patientInfoQuery);
+            updateById(patientInfoQuery);
+        }
+
+        List<String> deptCodeList = rif.getDetail().stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHospitalDeptCode()) && StringUtil.isNotBlank(i.getHospitalDeptName()))
+                .map(i -> i.getHospitalDeptCode())
+                .collect(Collectors.toList());
+        QueryWrapper<HospitalDept> hospitalDeptQe = new QueryWrapper<>();
+        hospitalDeptQe.eq("hospital_code", StringUtil.isBlank(sonHospitalCode) ? hospitalCode : sonHospitalCode);
+        hospitalDeptQe.in("code", deptCodeList);
+        Map<String, HospitalDept> deptMap = hospitalDeptFacade.list(hospitalDeptQe)
+                .stream()
+                .collect(Collectors.toMap(HospitalDept::getCode, i -> i));
+        List<HospitalDept> deptSaveOrUpdateList = Lists.newArrayList();
+        rif.getDetail().stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHospitalDeptCode()) && StringUtil.isNotBlank(i.getHospitalDeptName()))
+                .forEach(i -> {
+                    HospitalDept hospitalDeptQuery = deptMap.get(i.getHospitalDeptCode());
+                    if (hospitalDeptQuery == null) {
+                        HospitalDept hospitalDept = new HospitalDept();
+                        hospitalDept.setHospitalCode(StringUtil.isNotBlank(sonHospitalCode) ? sonHospitalCode : hospitalCode);
+                        hospitalDept.setHospitalName(StringUtil.isNotBlank(sonHospitalCode) ? sonHospitalName : hospitalName);
+                        hospitalDept.setCode(i.getHospitalDeptCode());
+                        hospitalDept.setName(i.getHospitalDeptName());
+                        hospitalDept.setconceptDeptName("全科");
+                        deptSaveOrUpdateList.add(hospitalDept);
+                    } else {
+                        hospitalDeptQuery.setName(i.getHospitalDeptName());
+                        deptSaveOrUpdateList.add(hospitalDeptQuery);
+                    }
+                });
+        if (ListUtil.isNotEmpty(deptSaveOrUpdateList)) {
+            hospitalDeptService.saveBatch(deptSaveOrUpdateList);
+        }
+
+        List<String> doctorCodeList = rif.getDetail().stream()
+                .filter(i -> i.getDoctorInfo() != null).map(i -> i.getDoctorInfo())
+                .filter(i -> StringUtil.isNotBlank(i.getCode()) && StringUtil.isNotBlank(i.getName()))
+                .map(i -> i.getCode()).collect(Collectors.toList());
+        QueryWrapper<DoctorInfo> doctorInfoQe = new QueryWrapper<>();
+        doctorInfoQe.eq("hospital_code", hospitalCode);
+        doctorInfoQe.in("code", doctorCodeList);
+        Map<String, DoctorInfo> doctorMap = doctorInfoFacade.list(doctorInfoQe)
+                .stream().collect(Collectors.toMap(DoctorInfo::getCode, i -> i));
+        List<DoctorInfo> doctorSaveOrUpdateList = Lists.newArrayList();
+        rif.getDetail().stream()
+                .filter(i -> i.getDoctorInfo() != null).map(i -> i.getDoctorInfo())
+                .filter(i -> StringUtil.isNotBlank(i.getCode()) && StringUtil.isNotBlank(i.getName()))
+                .forEach(i -> {
+                    DoctorInfo doctorInfo = new DoctorInfo();
+                    DoctorInfo doctorInfoQuery = doctorMap.get(i.getCode());
+                    if (doctorInfoQuery != null) {
+                        BeanUtil.copyProperties(doctorInfoQuery, doctorInfo);
+                    }
+                    BeanUtil.copyProperties(i, doctorInfo);
+                    doctorInfo.setHospitalCode(hospitalCode);
+                    doctorSaveOrUpdateList.add(doctorInfo);
+                });
+        if (ListUtil.isNotEmpty(doctorSaveOrUpdateList)) {
+            doctorInfoService.saveOrUpdateBatch(doctorSaveOrUpdateList);
+        }
+    }
+
+    /**
+     * 对接---获取挂号信息
+     * 某一时刻患者只可能在一家医院,所以获取到的挂号信息只能是当前医院的,当出现江干的大小医院情况时可采用2种:
+     * 1、预问诊必须选择小医院,对方接口小医院要求必传;2、his返回时间最近的一家医院挂号信息(可能不准确)。
+     * 大小医院信息使用his返回来的(未选择小医院时有用)
+     *
+     * @param signInVO
+     * @return
+     */
+    private RegisterInfoDTO getRegisterInfo(SignInVO signInVO) {
+        //        String time = DateUtil.formatDateTime(new Date());
+        //        List<SignInDTO> list = Lists.newArrayList();
+        //        list.add(new SignInDTO("A001", "浙江大学医学院附属邵逸夫医院",
+        //                "D01", "全科", "YS001", "付医生",
+        //                "1600", "王明明", time, "4468352", "15"));
+        //        list.add(new SignInDTO("A001", "浙江大学医学院附属邵逸夫医院",
+        //                "D02", "儿科", "YS001", "付医生",
+        //                "1600", "王明明", time, "4468352", "18"));
+        //        if (signInVO.getPatientInfoType().equals("101")) {
+        //            if (signInVO.getPatientInfo().equals("10123439991230120X")) {
+        //                list.remove(1);
+        //            } else if (signInVO.getPatientInfo().equals("666666180002301234")) {
+        //                list.clear();
+        //            } else if (signInVO.getPatientInfo().equals("100000201901010000")) {
+        //                return null;
+        //            }
+        //        }
+
+        RegisterInfoDTO registerInfoDTO = new RegisterInfoDTO();
+
+        return null;
+    }
+
+    /**
+     * 病历引用时,更新患者医生科室信息
+     *
+     * @param inquiryQuoteVO
+     * @return
+     */
+    public InquiryQuoteVO inquiryQuote(InquiryQuoteVO inquiryQuoteVO) {
+        List<String> hospitalCodeList = Lists.newArrayList();
+        hospitalCodeList.add(inquiryQuoteVO.getHospitalCode());
+
+        String hospitalCode = inquiryQuoteVO.getHospitalCode();
+        String hospitalName = inquiryQuoteVO.getHospitalName();
+
+        if (StringUtil.isNotBlank(inquiryQuoteVO.getSonHospitalCode())) {
+            hospitalCodeList.add(inquiryQuoteVO.getSonHospitalCode());
+            hospitalCode = inquiryQuoteVO.getSonHospitalCode();
+            hospitalName = inquiryQuoteVO.getSonHospitalName();
+        }
+
+        QueryWrapper<HospitalInfo> hospitalInfoQe = new QueryWrapper<>();
+        hospitalInfoQe.in("code", hospitalCodeList);
+        Map<String, Long> hospitalInfoIdMap = hospitalInfoFacade.list(hospitalInfoQe)
+                .stream().collect(Collectors.toMap(HospitalInfo::getCode, i -> i.getId()));
+
+        inquiryQuoteVO.setHospitalId(hospitalInfoIdMap.get(inquiryQuoteVO.getHospitalCode()));
+        if (StringUtil.isNotBlank(inquiryQuoteVO.getSonHospitalCode())) {
+            inquiryQuoteVO.setSonHospitalId(hospitalInfoIdMap.get(inquiryQuoteVO.getSonHospitalCode()));
+        }
+
+        Date now = DateUtil.now();
+        if (inquiryQuoteVO.getDeptInfo() != null) {
+            QueryWrapper<HospitalDept> hospitalDeptQe = new QueryWrapper<>();
+            hospitalDeptQe.eq("hospital_code", hospitalCode);
+            hospitalDeptQe.eq("code", inquiryQuoteVO.getDeptInfo().getCode());
+            HospitalDept hospitalDept = hospitalDeptFacade.getOne(hospitalDeptQe, false);
+            Long deptId = null;
+            if (hospitalDept == null) {
+                hospitalDept = new HospitalDept();
+                hospitalDept.setGmtCreate(now);
+                hospitalDept.setHospitalCode(hospitalCode);
+                hospitalDept.setHospitalName(hospitalName);
+                hospitalDept.setconceptDeptName("全科");
+            } else {
+                deptId = hospitalDept.getId().longValue();
+            }
+            BeanUtil.copyProperties(inquiryQuoteVO.getDeptInfo(), hospitalDept);
+            hospitalDept.setGmtModified(now);
+            hospitalDept.setId(deptId);
+            hospitalDeptFacade.saveOrUpdate(hospitalDept);
+            inquiryQuoteVO.getDeptInfo().setId(hospitalDept.getId());
+        }
+
+        if (inquiryQuoteVO.getDoctorInfo() != null) {
+            QueryWrapper<DoctorInfo> doctorInfoQe = new QueryWrapper<>();
+            doctorInfoQe.eq("hospital_code", inquiryQuoteVO.getHospitalCode());
+            doctorInfoQe.eq("code", inquiryQuoteVO.getDoctorInfo().getCode());
+            DoctorInfo doctorInfo = doctorInfoFacade.getOne(doctorInfoQe, false);
+            Long doctorId = null;
+            if (doctorInfo == null) {
+                doctorInfo = new DoctorInfo();
+                doctorInfo.setGmtCreate(now);
+                doctorInfo.setHospitalCode(inquiryQuoteVO.getHospitalCode());
+            } else {
+                doctorId = doctorInfo.getId().longValue();
+            }
+            BeanUtil.copyProperties(inquiryQuoteVO.getDoctorInfo(), doctorInfo);
+            doctorInfo.setGmtModified(now);
+            doctorInfo.setId(doctorId);
+            doctorInfoFacade.saveOrUpdate(doctorInfo);
+            inquiryQuoteVO.getDoctorInfo().setId(doctorInfo.getId());
+        }
+
+        QueryWrapper<PatientInfo> patientInfoQe = new QueryWrapper<>();
+        patientInfoQe.eq("hospital_code", inquiryQuoteVO.getHospitalCode());
+        patientInfoQe.eq("code", inquiryQuoteVO.getPatientInfo().getCode());
+        PatientInfo patientInfo = getOne(patientInfoQe, false);
+        Long patientId = null;
+        if (patientInfo == null) {
+            patientInfo = new PatientInfo();
+            patientInfo.setGmtCreate(now);
+            patientInfo.setHospitalCode(inquiryQuoteVO.getHospitalCode());
+        } else {
+            patientId = patientInfo.getId().longValue();
+        }
+        BeanUtil.copyProperties(inquiryQuoteVO.getPatientInfo(), patientInfo);
+        patientInfo.setGmtModified(now);
+        patientInfo.setId(patientId);
+        saveOrUpdate(patientInfo);
+        inquiryQuoteVO.getPatientInfo().setId(patientInfo.getId());
+
+        return inquiryQuoteVO;
+    }
+
+}

+ 1 - 39
tran-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -2,18 +2,14 @@ package com.diagbot.facade;
 
 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;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
 
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -26,11 +22,6 @@ import java.util.stream.Collectors;
 @Component
 public class PatientInfoFacade extends PatientInfoServiceImpl {
 
-    /*@Autowired
-    private DoctorPageModeFacade doctorPageModeFacade;*/
-    /*@Autowired
-    private DeptInfoFacade deptInfoFacade;*/
-
     /**
      * 获取患者信息
      *
@@ -69,33 +60,4 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
         return patientInfoMap;
     }
 
-    /**
-     * 患者登录
-     *
-     * @param signInVO
-     * @return
-     */
-    public List<SignInDTO> signIn(SignInVO signInVO) {
-        String time = DateUtil.formatDateTime(new Date());
-        List<SignInDTO> list = Lists.newArrayList();
-        list.add(new SignInDTO("A001", "浙江大学医学院附属邵逸夫医院",
-                "D01", "全科", "YS001", "付医生",
-                "1600", "王明明", time, "4468352", "15"));
-        list.add(new SignInDTO("A001", "浙江大学医学院附属邵逸夫医院",
-                "D02", "儿科", "YS001", "付医生",
-                "1600", "王明明", time, "4468352", "18"));
-        if (signInVO.getPatientInfoType().equals("101")) {
-            if (signInVO.getPatientInfo().equals("10123439991230120X")) {
-                list.remove(1);
-            } else if (signInVO.getPatientInfo().equals("666666180002301234")) {
-                list.clear();
-            } else if (signInVO.getPatientInfo().equals("100000201901010000")) {
-                return null;
-            }
-        }
-
-        return list;
-    }
-
-
-}
+}

+ 150 - 36
tran-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -1,36 +1,150 @@
-package com.diagbot.facade;
-
-import com.diagbot.dto.SysSetInfoDTO;
-import com.diagbot.entity.SysSet;
-import com.diagbot.service.impl.SysSetServiceImpl;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.IntegerUtil;
-import com.diagbot.vo.HospitalSetVO;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-
-/**
- * @author wangfeng
- * @Description: TODO
- * @date 2019年6月12日 下午3:25:36
- */
-@Component
-public class SysSetFacade extends SysSetServiceImpl {
-
-
-    /**
-     * @param hospitalSetVO
-     * @return
-     */
-    public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
-        
-        if (IntegerUtil.isNull(hospitalSetVO.getPlan())) {
-            hospitalSetVO.setPlan(0);
-        }
-        List<SysSet> sysSetData = querySysSetInfo(hospitalSetVO);
-        List<SysSetInfoDTO> data = BeanUtil.listCopyTo(sysSetData, SysSetInfoDTO.class);
-        return data;
-    }
-
-}
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.GetHospitalRankInfoDTO;
+import com.diagbot.dto.SysHospitalDTO;
+import com.diagbot.dto.SysHospitalDeptInfoDTO;
+import com.diagbot.dto.SysSetInfoDTO;
+import com.diagbot.entity.HospitalInfo;
+import com.diagbot.entity.SysSet;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.SysTypeEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.SysSetServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.IntegerUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.GetHospitalRankInfoVO;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.SysHospitalCodeVO;
+import com.diagbot.vo.SysHospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年6月12日 下午3:25:36
+ */
+@Component
+public class SysSetFacade extends SysSetServiceImpl {
+
+    @Autowired
+    private HospitalInfoFacade hospitalInfoFacade;
+
+    /**
+     * @param hospitalSetVO
+     * @return
+     */
+    public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
+
+        if (IntegerUtil.isNull(hospitalSetVO.getPlan())) {
+            hospitalSetVO.setPlan(0);
+        }
+        List<SysSet> sysSetData = querySysSetInfo(hospitalSetVO);
+        List<SysSetInfoDTO> data = BeanUtil.listCopyTo(sysSetData, SysSetInfoDTO.class);
+        return data;
+    }
+
+    /**
+     * @param sysHospitalCodeVO
+     * @return
+     */
+    public SysHospitalDTO getHospitalDeptInfoData(SysHospitalCodeVO sysHospitalCodeVO) {
+        //取出下级医院Code
+        QueryWrapper<SysSet> sysSetInfo = new QueryWrapper<>();
+        sysSetInfo.eq("is_deleted", IsDeleteEnum.N.getKey());
+        sysSetInfo.eq("hospital_code", sysHospitalCodeVO.getHospitalCode());
+        sysSetInfo.eq("code", "junior_hospital");
+        sysSetInfo.eq("sys_type", SysTypeEnum.PREC_SERVICE.getKey());
+        SysSet sysSetInfoData = getOne(sysSetInfo, false);
+        SysHospitalInfoVO sysHospitalInfoVO = new SysHospitalInfoVO();
+        List<String> listCode = Lists.newArrayList(sysSetInfoData.getValue().split(","));
+        //追加集团code
+        listCode.add(sysHospitalCodeVO.getHospitalCode());
+        //查询下级医院的默认科室
+        sysHospitalInfoVO.setHospitalCode(listCode);
+        sysHospitalInfoVO.setCode("default_dept");
+        sysHospitalInfoVO.setSysType(SysTypeEnum.PREC_SERVICE.getKey());
+        List<SysHospitalDeptInfoDTO> juniorHospitalData = getjuniorHospitalData(sysHospitalInfoVO);
+        SysHospitalDTO sysHospitalDTO = new SysHospitalDTO();
+        List<SysHospitalDeptInfoDTO> hospitalDatas = new ArrayList<SysHospitalDeptInfoDTO>();
+        for (SysHospitalDeptInfoDTO superiorsInfoData : juniorHospitalData) {
+            if (superiorsInfoData.getHospitalCode().equals(sysHospitalCodeVO.getHospitalCode())) {
+                //取出顶级集团信息
+                sysHospitalDTO.setSuperiorsInfo(superiorsInfoData);
+            } else {
+                //下级医院信息
+                hospitalDatas.add(superiorsInfoData);
+            }
+        }
+        sysHospitalDTO.setJuniorHospital(hospitalDatas);
+        return sysHospitalDTO;
+    }
+
+    /**
+     * 获取大小医院信息
+     *
+     * @param getHospitalRankInfoVO
+     * @return
+     */
+    public GetHospitalRankInfoDTO getHospitalRankInfo(GetHospitalRankInfoVO getHospitalRankInfoVO) {
+        QueryWrapper<SysSet> sysSetQe = new QueryWrapper<>();
+        sysSetQe.and(qe1 -> qe1
+                .and(qe2 -> qe2
+                        .eq("hospital_code", getHospitalRankInfoVO.getHospitalCode())
+                        .eq("sys_type", SysTypeEnum.ICSS_SERVICE.getKey())
+                        .eq("code", "connect_prec"))
+                .or(qe3 -> qe3
+                        .eq("sys_type", SysTypeEnum.PREC_SERVICE.getKey())
+                        .eq("code", "junior_hospital")
+                        .like("value", getHospitalRankInfoVO.getHospitalCode())));
+        Map<String, SysSet> sysSetMap = list(sysSetQe).stream()
+                .collect(Collectors.toMap(SysSet::getCode, i -> i));
+
+        SysSet connectPrecSysSet = sysSetMap.get("connect_prec");
+        if (connectPrecSysSet == null
+                || StringUtil.isBlank(connectPrecSysSet.getValue())
+                || connectPrecSysSet.getValue().equals("0")) {
+            throw new CommonException(CommonErrorCode.RPC_ERROR, "不支持同时对接预问诊");
+        }
+
+        String hospitalCode = null, sonHospitalCode = null;
+        SysSet juniorHospitalSysSet = sysSetMap.get("junior_hospital");
+        if (juniorHospitalSysSet != null) {
+            hospitalCode = juniorHospitalSysSet.getHospitalCode();
+            sonHospitalCode = getHospitalRankInfoVO.getHospitalCode();
+        } else {
+            hospitalCode = getHospitalRankInfoVO.getHospitalCode();
+        }
+
+        QueryWrapper<HospitalInfo> hospitalInfoQe = new QueryWrapper<>();
+        hospitalInfoQe.eq("code", hospitalCode)
+                .or(StringUtil.isNotBlank(sonHospitalCode))
+                .eq("code", sonHospitalCode);
+        Map<String, HospitalInfo> hospitalInfoMap = hospitalInfoFacade.list(hospitalInfoQe)
+                .stream().collect(Collectors.toMap(HospitalInfo::getCode, i -> i));
+
+        HospitalInfo hospitalInfo = hospitalInfoMap.get(hospitalCode);
+        HospitalInfo sonHospitalInfo = hospitalInfoMap.get(sonHospitalCode);
+        GetHospitalRankInfoDTO getHospitalRankInfoDTO = new GetHospitalRankInfoDTO();
+        getHospitalRankInfoDTO.setHospitalId(hospitalInfo.getId());
+        getHospitalRankInfoDTO.setHospitalCode(hospitalInfo.getCode());
+        getHospitalRankInfoDTO.setHospitalName(hospitalInfo.getName());
+        if (sonHospitalInfo != null) {
+            getHospitalRankInfoDTO.setSonHospitalId(sonHospitalInfo.getId());
+            getHospitalRankInfoDTO.setSonHospitalCode(sonHospitalInfo.getCode());
+            getHospitalRankInfoDTO.setSonHospitalName(sonHospitalInfo.getName());
+        }
+
+        return getHospitalRankInfoDTO;
+    }
+
+}

+ 3 - 0
tran-service/src/main/java/com/diagbot/idc/AbstractIdCreater.java

@@ -21,6 +21,9 @@ public abstract class AbstractIdCreater<T> implements IdCreater<T> {
     @Override
     public abstract Long getNextId(T param);
 
+    @Override
+    public abstract Long getNextShortId(T param);
+
     @Override
     public List<Long> getNextIds(T param, int size) {
         List<Long> longs = new ArrayList<>(size);

+ 7 - 0
tran-service/src/main/java/com/diagbot/idc/IdCreater.java

@@ -16,6 +16,13 @@ public interface IdCreater<T> {
      */
     Long getNextId(T param);
 
+    /**
+     * 生成一个id
+     *
+     * @return 生成的id
+     */
+    Long getNextShortId(T param);
+
     /**
      * 批量生成id
      *

+ 47 - 7
tran-service/src/main/java/com/diagbot/idc/VisibleIdCreater.java

@@ -25,15 +25,16 @@ public class VisibleIdCreater extends AbstractIdCreater<Integer> {
         super(machineId, dataCenterId);
     }
 
-    @Override
     /**
-     *  对外id生成规则
-     *  180905123451110001
-     *  180905 - 12345 -  1   -  1   -     1     - 0001
-     *   日期 -  秒数  - 业务 - 机器 - 数据中心 - 秒内自增
-     *  @param type 业务id 1.订单 2.交易 3.退款
-     *  @return 生成的id
+     * 对外id生成规则
+     * 180905123451110001
+     * 180905 - 12345 -  1   -  1   -     1     - 0001
+     * 日期 -  秒数  - 业务 - 机器 - 数据中心 - 秒内自增
+     *
+     * @param type 业务id 1.订单 2.交易 3.退款
+     * @return 生成的id
      */
+    @Override
     public synchronized Long getNextId(Integer type) {
 
         Calendar calendar = Calendar.getInstance();
@@ -64,6 +65,45 @@ public class VisibleIdCreater extends AbstractIdCreater<Integer> {
         return Long.valueOf(date + String.format("%05d", seconds) + String.valueOf(type) + machineId + dataCenterId + sequence);
     }
 
+    /**
+     * 对外id生成规则
+     * 1809051234550001
+     * 180905 - 12345 -  1  - 0001
+     * 日期 -  秒数  - 业务 - 秒内自增
+     *
+     * @param type 业务id 1.订单 2.交易 3.退款
+     * @return 生成的id
+     */
+    @Override
+    public synchronized Long getNextShortId(Integer type) {
+        Calendar calendar = Calendar.getInstance();
+
+        long timestamp = timeGen() / 1000;
+
+        if (timestamp < lastTimestamp) {
+            log.error(String.format("clock is moving backwards. Rejecting requests until %d.", lastTimestamp));
+            throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
+        }
+
+        if (lastTimestamp == timestamp) {
+            sequence = (sequence + 1);
+            if (sequence > sequenceMask) {
+                //timestamp = tilNextMillis(lastTimestamp);
+                log.error(String.format("id creater sequence is full. wait to next time"));
+                return null;
+            }
+        } else {
+            sequence = getNewSequence();
+        }
+
+        lastTimestamp = timestamp;
+
+        String date = DateUtil.format(calendar.getTime(), "yyMMdd");
+        long seconds = DateUtils.getFragmentInSeconds(calendar, Calendar.DAY_OF_YEAR);
+
+        return Long.valueOf(date + String.format("%05d", seconds) + String.valueOf(type) + sequence);
+    }
+
     private long getNewSequence() {
         return RandomUtils.nextInt(1000, 2000);
     }

+ 10 - 0
tran-service/src/main/java/com/diagbot/mapper/PatientInfoMapper.java

@@ -2,8 +2,10 @@ package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.entity.PatientInfo;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -27,4 +29,12 @@ public interface PatientInfoMapper extends BaseMapper<PatientInfo> {
      * @return
      */
     GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
+
+    /**
+     * 对接-顶部病人医生科室信息查询
+     * @param getTopPatientInfoDjVO
+     * @return
+     */
+    GetTopPatientInfoDjDTO getTopPatientInfoDj(@RequestBody GetTopPatientInfoDjVO getTopPatientInfoDjVO);
+
 }

+ 24 - 21
tran-service/src/main/java/com/diagbot/mapper/SysSetMapper.java

@@ -1,21 +1,24 @@
-package com.diagbot.mapper;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.entity.SysSet;
-import com.diagbot.vo.HospitalSetVO;
-
-/**
- * <p>
- * 医院所有配置信息 Mapper 接口
- * </p>
- *
- * @author wangfeng
- * @since 2019-06-12
- */
-public interface SysSetMapper extends BaseMapper<SysSet> {
-	
-	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO);
-
-}
+package com.diagbot.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.SysHospitalDeptInfoDTO;
+import com.diagbot.entity.SysSet;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.SysHospitalInfoVO;
+
+/**
+ * <p>
+ * 医院所有配置信息 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2019-06-12
+ */
+public interface SysSetMapper extends BaseMapper<SysSet> {
+	
+	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO);
+
+    public List<SysHospitalDeptInfoDTO> getjuniorHospitalData(SysHospitalInfoVO sysHospitalInfoVO);
+}

+ 24 - 20
tran-service/src/main/java/com/diagbot/service/SysSetService.java

@@ -1,20 +1,24 @@
-package com.diagbot.service;
-
-import java.util.List;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.SysSet;
-import com.diagbot.vo.HospitalSetVO;
-
-/**
- * <p>
- * 医院所有配置信息 服务类
- * </p>
- *
- * @author wangfeng
- * @since 2019-06-12
- */
-public interface SysSetService extends IService<SysSet> {
-
-	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO);
-}
+package com.diagbot.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.SysHospitalDeptInfoDTO;
+import com.diagbot.entity.SysSet;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.SysHospitalInfoVO;
+
+/**
+ * <p>
+ * 医院所有配置信息 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2019-06-12
+ */
+public interface SysSetService extends IService<SysSet> {
+
+	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO);
+
+	public List<SysHospitalDeptInfoDTO>  getjuniorHospitalData(SysHospitalInfoVO sysHospitalInfoVO);
+}

+ 36 - 29
tran-service/src/main/java/com/diagbot/service/impl/SysSetServiceImpl.java

@@ -1,29 +1,36 @@
-package com.diagbot.service.impl;
-
-import java.util.List;
-
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.SysSet;
-import com.diagbot.mapper.SysSetMapper;
-import com.diagbot.service.SysSetService;
-import com.diagbot.vo.HospitalSetVO;
-
-/**
- * <p>
- * 医院所有配置信息 服务实现类
- * </p>
- *
- * @author wangfeng
- * @since 2019-06-12
- */
-@Service
-public class SysSetServiceImpl extends ServiceImpl<SysSetMapper, SysSet> implements SysSetService {
-
-	@Override
-	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO) {
-		return baseMapper.querySysSetInfo(hospitalSetVO);
-	}
-
-}
+package com.diagbot.service.impl;
+
+import java.util.List;
+
+import com.diagbot.dto.SysHospitalDeptInfoDTO;
+import com.diagbot.vo.SysHospitalInfoVO;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.SysSet;
+import com.diagbot.mapper.SysSetMapper;
+import com.diagbot.service.SysSetService;
+import com.diagbot.vo.HospitalSetVO;
+
+/**
+ * <p>
+ * 医院所有配置信息 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2019-06-12
+ */
+@Service
+public class SysSetServiceImpl extends ServiceImpl<SysSetMapper, SysSet> implements SysSetService {
+
+	@Override
+	public List<SysSet> querySysSetInfo(HospitalSetVO hospitalSetVO) {
+		return baseMapper.querySysSetInfo(hospitalSetVO);
+	}
+
+	@Override
+	public List<SysHospitalDeptInfoDTO> getjuniorHospitalData(SysHospitalInfoVO sysHospitalInfoVO) {
+		return baseMapper.getjuniorHospitalData(sysHospitalInfoVO);
+	}
+
+}

+ 20 - 0
tran-service/src/main/java/com/diagbot/vo/GetHospitalRankInfoVO.java

@@ -0,0 +1,20 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@Getter
+@Setter
+public class GetHospitalRankInfoVO {
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+}

+ 46 - 0
tran-service/src/main/java/com/diagbot/vo/GetTopPatientInfoDjVO.java

@@ -0,0 +1,46 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author rgb
+ * @Description
+ * @time 2018年11月19日下午4:58:37
+ */
+@Getter
+@Setter
+public class GetTopPatientInfoDjVO {
+
+    /**
+     * 医院编号
+     */
+    private String hospitalCode;
+
+    /**
+     * 子医院编号
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 医院科室编号
+     */
+    private String hospitalDeptCode;
+
+    /**
+     * 医院医生编号
+     */
+    private String doctorCode;
+
+    /**
+     * 医院患者编号
+     */
+    private String patientCode;
+
+    /**
+     * 门诊号
+     */
+    private String recordId;
+
+
+}

+ 30 - 0
tran-service/src/main/java/com/diagbot/vo/InquiryQuoteDeptVO.java

@@ -0,0 +1,30 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@Getter
+@Setter
+public class InquiryQuoteDeptVO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 科室编码
+     */
+    private String code;
+
+    /**
+     * 科室名称
+     */
+    private String name;
+
+}

+ 55 - 0
tran-service/src/main/java/com/diagbot/vo/InquiryQuoteDoctorVO.java

@@ -0,0 +1,55 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@Getter
+@Setter
+public class InquiryQuoteDoctorVO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 医生编码
+     */
+    private String code;
+
+    /**
+     * 医生姓名
+     */
+    private String name;
+
+    /**
+     * 医生性别,0-未知、1-男、2-女
+     */
+    private Integer sex;
+
+    /**
+     * 证件类型
+     */
+    private String idType;
+
+    /**
+     * 证件号码
+     */
+    private String idNo;
+
+    /**
+     * 家庭住址
+     */
+    private String address;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+}

+ 102 - 0
tran-service/src/main/java/com/diagbot/vo/InquiryQuotePatientVO.java

@@ -0,0 +1,102 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@Getter
+@Setter
+public class InquiryQuotePatientVO {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 患者编号
+     */
+    private String code;
+
+    /**
+     * 患者姓名
+     */
+    private String name;
+
+    /**
+     * 性别,0-未知、1-男、2-女
+     */
+    private Integer sex;
+
+    /**
+     * 出生日期,格式为:2018-11-28 17:25:30
+     */
+    private Date birthday;
+
+    /**
+     * 证件类型
+     */
+    private String idType;
+
+    /**
+     * 证件号码
+     */
+    private String idNo;
+
+    /**
+     * 家庭住址
+     */
+    private String address;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
+    /**
+     * 家庭邮编
+     */
+    private String postcode;
+
+    /**
+     * 联系人
+     */
+    private String contacts;
+
+    /**
+     * 联系人电话
+     */
+    private String contactPhone;
+
+    /**
+     * 就职单位名称
+     */
+    private String workUnit;
+
+    /**
+     * 职业
+     */
+    private String operation;
+
+    /**
+     * 国籍
+     */
+    private String country;
+
+    /**
+     * 民族
+     */
+    private String nationality;
+
+    /**
+     * 婚姻状况:0未婚,1已婚,2未知
+     */
+    private Integer matrimony;
+
+}

+ 65 - 0
tran-service/src/main/java/com/diagbot/vo/InquiryQuoteVO.java

@@ -0,0 +1,65 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@Getter
+@Setter
+public class InquiryQuoteVO {
+
+    /**
+     * 病历id
+     */
+    private Long inquiryId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    private Long sonHospitalId;
+
+    /**
+     * 子医院编码
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String sonHospitalName;
+
+    /**
+     * 科室信息
+     */
+    private InquiryQuoteDeptVO deptInfo;
+
+    /**
+     * 医生信息
+     */
+    private InquiryQuoteDoctorVO doctorInfo;
+
+    /**
+     * 患者信息
+     */
+    private InquiryQuotePatientVO patientInfo;
+
+}

+ 15 - 2
tran-service/src/main/java/com/diagbot/vo/SignInVO.java

@@ -1,6 +1,5 @@
 package com.diagbot.vo;
 
-import io.swagger.annotations.ApiModel;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -9,7 +8,6 @@ import lombok.Setter;
  * @author: rengb
  * @time: 2018/11/19 18:58
  */
-@ApiModel(value="患者登录接口传参")
 @Getter
 @Setter
 public class SignInVO {
@@ -18,6 +16,21 @@ public class SignInVO {
 	 * 医院编号
 	 */
 	private String hospitalCode;
+
+	/**
+	 * 医院名称
+	 */
+	private String hospitalName;
+
+	/**
+	 * 子医院编号
+	 */
+	private String sonHospitalCode;
+
+	/**
+	 * 子医院名称
+	 */
+	private String sonHospitalName;
 	
 	/**
      * 患者信息类型,101-身份证、102-病历号、103-手机号、104-市民卡卡号

+ 19 - 0
tran-service/src/main/java/com/diagbot/vo/SysHospitalCodeVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-11-18 19:17
+ */
+@Getter
+@Setter
+public class SysHospitalCodeVO {
+    @NotBlank(message = "请输入医院编码")
+    private  String hospitalCode;
+}

+ 19 - 0
tran-service/src/main/java/com/diagbot/vo/SysHospitalInfoVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2019-11-18 18:55
+ */
+@Getter
+@Setter
+public class SysHospitalInfoVO {
+    private List<String> hospitalCode;
+    private Integer sysType;
+    private String code;
+ }

+ 38 - 5
tran-service/src/main/java/com/diagbot/web/PatientInfoController.java

@@ -1,19 +1,23 @@
 package com.diagbot.web;
 
-
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.GetTopPatientInfoDjDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SignInDTO;
 import com.diagbot.entity.PatientInfo;
+import com.diagbot.facade.PatientInfoDjFacade;
 import com.diagbot.facade.PatientInfoFacade;
+import com.diagbot.vo.GetTopPatientInfoDjVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.InquiryQuoteVO;
 import com.diagbot.vo.PatientInfoVO;
 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.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -39,6 +43,8 @@ import java.util.Map;
 public class PatientInfoController {
     @Autowired
     private PatientInfoFacade patientInfoFacade;
+    @Autowired
+    private PatientInfoDjFacade patientInfoDjFacade;
 
     @ApiOperation(value = "患者信息——查询[by:wangyu]",
             notes = "patientCode:患者编号,必填<br>" +
@@ -51,7 +57,6 @@ public class PatientInfoController {
         return RespDTO.onSuc(data);
     }
 
-
     @ApiOperation(value = "页面顶部病人医生科室信息——查询[by:rengb]",
             notes = "hospitalCode:医院编号,必填<br>" +
                     "hospitalDeptCode:医院科室编号,必填<br>" +
@@ -73,11 +78,39 @@ public class PatientInfoController {
         return RespDTO.onSuc(result);
     }
 
-    @ApiOperation(value = "患者登录[by:rengb]")
+    /**
+     * 患者登录[by:rengb]
+     */
     @PostMapping("/signIn")
     @SysLogger("signIn")
+    @Transactional
     public RespDTO<List<SignInDTO>> signIn(@RequestBody SignInVO signInVO) {
-        return RespDTO.onSuc(patientInfoFacade.signIn(signInVO));
+        return RespDTO.onSuc(patientInfoDjFacade.signIn(signInVO));
+    }
+
+    /**
+     * 对接-页面顶部病人医生科室信息——查询[by:rengb]
+     *
+     * @param getTopPatientInfoDjVO
+     * @return
+     */
+    @PostMapping("/getTopPatientInfoDj")
+    @SysLogger("getTopPatientInfoDj")
+    public RespDTO<GetTopPatientInfoDjDTO> getTopPatientInfoDj(@RequestBody GetTopPatientInfoDjVO getTopPatientInfoDjVO) {
+        return RespDTO.onSuc(patientInfoDjFacade.getTopPatientInfoDj(getTopPatientInfoDjVO));
+    }
+
+    /**
+     * 病历引用时,更新患者医生科室信息
+     *
+     * @param inquiryQuoteVO
+     * @return
+     */
+    @PostMapping("/inquiryQuote")
+    @SysLogger("inquiryQuote")
+    @Transactional
+    public RespDTO<InquiryQuoteVO> inquiryQuote(@RequestBody InquiryQuoteVO inquiryQuoteVO) {
+        return RespDTO.onSuc(patientInfoDjFacade.inquiryQuote(inquiryQuoteVO));
     }
 
-}
+}

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


Some files were not shown because too many files changed in this diff