Browse Source

智能分诊操作记录

wangfeng 5 years atrás
parent
commit
171c0cff70
31 changed files with 2043 additions and 1 deletions
  1. 4 1
      tran-service/pom.xml
  2. 22 0
      tran-service/src/main/java/com/diagbot/dto/HospItemDTO.java
  3. 18 0
      tran-service/src/main/java/com/diagbot/dto/HospNameDTO.java
  4. 22 0
      tran-service/src/main/java/com/diagbot/dto/OptDTO.java
  5. 25 0
      tran-service/src/main/java/com/diagbot/dto/OptHospDTO.java
  6. 16 0
      tran-service/src/main/java/com/diagbot/dto/PVDTO.java
  7. 18 0
      tran-service/src/main/java/com/diagbot/dto/PVHospDTO.java
  8. 17 0
      tran-service/src/main/java/com/diagbot/dto/PVHospSumDTO.java
  9. 16 0
      tran-service/src/main/java/com/diagbot/dto/UVDTO.java
  10. 18 0
      tran-service/src/main/java/com/diagbot/dto/UVHospDTO.java
  11. 17 0
      tran-service/src/main/java/com/diagbot/dto/UVHospSumDTO.java
  12. 16 0
      tran-service/src/main/java/com/diagbot/dto/ZZDTO.java
  13. 18 0
      tran-service/src/main/java/com/diagbot/dto/ZZHospDTO.java
  14. 17 0
      tran-service/src/main/java/com/diagbot/dto/ZZHospSumDTO.java
  15. 250 0
      tran-service/src/main/java/com/diagbot/entity/InquiryTriage.java
  16. 173 0
      tran-service/src/main/java/com/diagbot/entity/OptInfo.java
  17. 227 0
      tran-service/src/main/java/com/diagbot/facade/OptInfoFacade.java
  18. 16 0
      tran-service/src/main/java/com/diagbot/mapper/InquiryTriageMapper.java
  19. 62 0
      tran-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java
  20. 16 0
      tran-service/src/main/java/com/diagbot/service/InquiryTriageService.java
  21. 61 0
      tran-service/src/main/java/com/diagbot/service/OptInfoService.java
  22. 20 0
      tran-service/src/main/java/com/diagbot/service/impl/InquiryTriageServiceImpl.java
  23. 98 0
      tran-service/src/main/java/com/diagbot/service/impl/OptInfoServiceImpl.java
  24. 20 0
      tran-service/src/main/java/com/diagbot/vo/HospitalVO.java
  25. 39 0
      tran-service/src/main/java/com/diagbot/vo/OptHospPageVO.java
  26. 35 0
      tran-service/src/main/java/com/diagbot/vo/OptHospVO.java
  27. 35 0
      tran-service/src/main/java/com/diagbot/vo/OptVO.java
  28. 20 0
      tran-service/src/main/java/com/diagbot/web/InquiryTriageController.java
  29. 130 0
      tran-service/src/main/java/com/diagbot/web/OptInfoController.java
  30. 26 0
      tran-service/src/main/resources/mapper/InquiryTriageMapper.xml
  31. 571 0
      tran-service/src/main/resources/mapper/OptInfoMapper.xml

+ 4 - 1
tran-service/pom.xml

@@ -172,7 +172,10 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-pool2</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>io.github.lvyahui8</groupId>
+            <artifactId>spring-boot-data-aggregator-starter</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 22 - 0
tran-service/src/main/java/com/diagbot/dto/HospItemDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class HospItemDTO {
+    //医院名称
+    private String hospitalCode;
+    // pvSum
+    private Long pvSum = 0L;
+    //uvSum
+    private Long uvSum = 0L;
+    //zzSum
+    private Long zzSum = 0L;
+}

+ 18 - 0
tran-service/src/main/java/com/diagbot/dto/HospNameDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class HospNameDTO {
+    //医院名称
+    private List<String> hospitalCode;
+}

+ 22 - 0
tran-service/src/main/java/com/diagbot/dto/OptDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:50
+ */
+@Getter
+@Setter
+public class OptDTO {
+    private List<PVDTO> pvdto;
+    private Long pvSum;
+    private List<UVDTO> uvdto;
+    private Long uvSum;
+    private List<ZZDTO> zzdto;
+    private Long zzSum;
+}

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

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:50
+ */
+@Getter
+@Setter
+public class OptHospDTO {
+    private List<PVHospDTO> pvHospDto;
+    private List<PVHospSumDTO> pvHospSumDto;
+    private Long pvSum;
+    private List<UVHospDTO> uvHospDto;
+    private List<UVHospSumDTO> uvHospSumDto;
+    private Long uvSum;
+    private List<ZZHospDTO> zzHospDto;
+    private List<ZZHospSumDTO> zzHospSumDto;
+    private Long zzSum;
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/dto/PVDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class PVDTO {
+    private String days;
+    private Long pvCnt;
+}

+ 18 - 0
tran-service/src/main/java/com/diagbot/dto/PVHospDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class PVHospDTO {
+    //医院名称
+    private String hospitalCode;
+    private String days;
+    private Long pvCnt;
+}

+ 17 - 0
tran-service/src/main/java/com/diagbot/dto/PVHospSumDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class PVHospSumDTO {
+    //医院名称
+    private String hospitalCode;
+    private Long pvSum;
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/dto/UVDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class UVDTO {
+    private String days;
+    private Long uvCnt;
+}

+ 18 - 0
tran-service/src/main/java/com/diagbot/dto/UVHospDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class UVHospDTO {
+    //医院名称
+    private String hospitalCode;
+    private String days;
+    private Long uvCnt;
+}

+ 17 - 0
tran-service/src/main/java/com/diagbot/dto/UVHospSumDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class UVHospSumDTO {
+    //医院名称
+    private String hospitalCode;
+    private Long uvSum;
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/dto/ZZDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class ZZDTO {
+    private String days;
+    private Long zzCnt;
+}

+ 18 - 0
tran-service/src/main/java/com/diagbot/dto/ZZHospDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class ZZHospDTO {
+    //医院名称
+    private String hospitalCode;
+    private String days;
+    private Long zzCnt;
+}

+ 17 - 0
tran-service/src/main/java/com/diagbot/dto/ZZHospSumDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:27
+ */
+@Getter
+@Setter
+public class ZZHospSumDTO {
+    //医院名称
+    private String hospitalCode;
+    private Long zzSum;
+}

+ 250 - 0
tran-service/src/main/java/com/diagbot/entity/InquiryTriage.java

@@ -0,0 +1,250 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 智能分诊记录主表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+@TableName("tran_inquiry_triage")
+public class InquiryTriage implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalCode;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 姓名
+     */
+    private String patName;
+
+    /**
+     * 年龄
+     */
+    private Integer patAge;
+
+    /**
+     * 性别(1:男 2:女)
+     */
+    private Integer patSex;
+
+    /**
+     * 证件类型(1:身份证,2:护照)
+     */
+    private Integer idType;
+
+    /**
+     * 证件号
+     */
+    private String idNum;
+
+    /**
+     * 症状
+     */
+    private String symptom;
+
+    /**
+     * 补充说明
+     */
+    private String supplement;
+
+    /**
+     * 诊断结果和疾病科室
+     */
+    private String disDept;
+
+    /**
+     * 备注
+     */
+    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 LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime 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 String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+    public String getPatName() {
+        return patName;
+    }
+
+    public void setPatName(String patName) {
+        this.patName = patName;
+    }
+    public Integer getPatAge() {
+        return patAge;
+    }
+
+    public void setPatAge(Integer patAge) {
+        this.patAge = patAge;
+    }
+    public Integer getPatSex() {
+        return patSex;
+    }
+
+    public void setPatSex(Integer patSex) {
+        this.patSex = patSex;
+    }
+    public Integer getIdType() {
+        return idType;
+    }
+
+    public void setIdType(Integer idType) {
+        this.idType = idType;
+    }
+    public String getIdNum() {
+        return idNum;
+    }
+
+    public void setIdNum(String idNum) {
+        this.idNum = idNum;
+    }
+    public String getSymptom() {
+        return symptom;
+    }
+
+    public void setSymptom(String symptom) {
+        this.symptom = symptom;
+    }
+    public String getSupplement() {
+        return supplement;
+    }
+
+    public void setSupplement(String supplement) {
+        this.supplement = supplement;
+    }
+    public String getDisDept() {
+        return disDept;
+    }
+
+    public void setDisDept(String disDept) {
+        this.disDept = disDept;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "InquiryTriage{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", hospitalCode=" + hospitalCode +
+            ", ip=" + ip +
+            ", patName=" + patName +
+            ", patAge=" + patAge +
+            ", patSex=" + patSex +
+            ", idType=" + idType +
+            ", idNum=" + idNum +
+            ", symptom=" + symptom +
+            ", supplement=" + supplement +
+            ", disDept=" + disDept +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 173 - 0
tran-service/src/main/java/com/diagbot/entity/OptInfo.java

@@ -0,0 +1,173 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 操作信息
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+@TableName("tran_opt_info")
+public class OptInfo 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;
+
+    /**
+     * 访问的系统类型(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 hospitalCode;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 操作类型:1 开始,2 结束
+     */
+    private String optType;
+
+    /**
+     * 备注
+     */
+    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 Integer getSysType() {
+        return sysType;
+    }
+
+    public void setSysType(Integer sysType) {
+        this.sysType = sysType;
+    }
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+    public String getOptType() {
+        return optType;
+    }
+
+    public void setOptType(String optType) {
+        this.optType = optType;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "OptInfo{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", sysType=" + sysType +
+            ", hospitalCode=" + hospitalCode +
+            ", ip=" + ip +
+            ", optType=" + optType +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 227 - 0
tran-service/src/main/java/com/diagbot/facade/OptInfoFacade.java

@@ -0,0 +1,227 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospItemDTO;
+import com.diagbot.dto.HospNameDTO;
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.entity.OptInfo;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.OptInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.HttpUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.HospitalVO;
+import com.diagbot.vo.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+import com.diagbot.vo.OptVO;
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2020-03-20 16:20
+ */
+@Component
+public class OptInfoFacade extends OptInfoServiceImpl {
+    @Autowired
+    DataBeanAggregateQueryFacade dataBeanAggregateQueryFacade;
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    public Boolean saveOptOnfo(HospitalVO hospitalVO, String optType) {
+        OptInfo optInfo = new OptInfo();
+        Date now = DateUtil.now();
+        optInfo.setGmtModified(now);
+        optInfo.setGmtCreate(now);
+        optInfo.setIp(HttpUtils.getIpAddress());
+        optInfo.setHospitalCode(StringUtil.isNotBlank(hospitalVO.getHospitalCode()) ? hospitalVO.getHospitalCode() : "朗通通用");
+        optInfo.setOptType(optType);
+        optInfo.setSysType(hospitalVO.getSysType());
+        Boolean res = this.save(optInfo);
+        return res;
+    }
+
+    public OptDTO getOptSum(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        if (null != optVO && null != optVO.getSysType()) {
+            optVO.setSysType(optVO.getSysType());
+        }
+        //获取统计数据
+        OptDTO optDTO = new OptDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSum", invokeParams, OptDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+        //        optDTO.setPvdto(this.getPV(optVO));
+        //        optDTO.setPvSum(this.getPVSum(optVO));
+        //        optDTO.setUvdto(this.getUV(optVO));
+        //        optDTO.setUvSum(this.getUVSum(optVO));
+        //        optDTO.setZzdto(this.getZZ(optVO));
+        //        optDTO.setZzSum(this.getZZSum(optVO));
+        return optDTO;
+    }
+
+
+    public OptDTO getOptSumNoDays(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        if (null != optVO && null != optVO.getSysType()) {
+            optVO.setSysType(optVO.getSysType());
+        }
+        //获取统计数据
+        OptDTO optDTO = new OptDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSumNoDays", invokeParams, OptDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+        //        optDTO.setPvdto(this.getPV(optVO));
+        //        optDTO.setPvSum(this.getPVSum(optVO));
+        //        optDTO.setUvdto(this.getUV(optVO));
+        //        optDTO.setUvSum(this.getUVSum(optVO));
+        //        optDTO.setZzdto(this.getZZ(optVO));
+        //        optDTO.setZzSum(this.getZZSum(optVO));
+        return optDTO;
+    }
+
+
+    public OptHospDTO getOptSumHosp(OptVO optVO) {
+        //入参验证
+        if (null != optVO && null != optVO.getStartDate()) {
+            optVO.setStartDate(DateUtil.getFirstTimeOfDay(optVO.getStartDate()));
+        }
+        if (null != optVO && null != optVO.getEndDate()) {
+            optVO.setEndDate(DateUtil.getLastTimeOfDay(optVO.getEndDate()));
+        }
+
+        if (null != optVO && null != optVO.getStartDate() && null != optVO.getEndDate()) {
+            if (DateUtil.after(optVO.getStartDate(), optVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        if (null != optVO && null != optVO.getSysType()) {
+            optVO.setSysType(optVO.getSysType());
+        }
+        //获取统计数据
+        OptHospDTO optHospDTO = new OptHospDTO();
+
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            invokeParams.put("optVO", optVO);
+            optHospDTO
+                    = dataBeanAggregateQueryFacade.get("getAllOptSumHosp", invokeParams, OptHospDTO.class);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
+        }
+
+        return optHospDTO;
+    }
+
+
+    public List<HospItemDTO> getOptSumHospNoDays(OptHospVO optHospVO) {
+        //入参验证
+        if (null != optHospVO && null != optHospVO.getStartDate()) {
+            optHospVO.setStartDate(DateUtil.getFirstTimeOfDay(optHospVO.getStartDate()));
+        }
+        if (null != optHospVO && null != optHospVO.getEndDate()) {
+            optHospVO.setEndDate(DateUtil.getLastTimeOfDay(optHospVO.getEndDate()));
+        }
+
+        if (null != optHospVO && null != optHospVO.getStartDate() && null != optHospVO.getEndDate()) {
+            if (DateUtil.after(optHospVO.getStartDate(), optHospVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        if (null != optHospVO && null != optHospVO.getSysType()) {
+            optHospVO.setSysType(optHospVO.getSysType());
+        }
+        return this.getHospitalPUZ(optHospVO);
+    }
+
+
+    public IPage<HospItemDTO> getOptSumHospNoDaysPageFac(OptHospPageVO optHospPageVO) {
+        //入参验证
+        if (null != optHospPageVO && null != optHospPageVO.getStartDate()) {
+            optHospPageVO.setStartDate(DateUtil.getFirstTimeOfDay(optHospPageVO.getStartDate()));
+        }
+        if (null != optHospPageVO && null != optHospPageVO.getEndDate()) {
+            optHospPageVO.setEndDate(DateUtil.getLastTimeOfDay(optHospPageVO.getEndDate()));
+        }
+
+        if (null != optHospPageVO && null != optHospPageVO.getStartDate() && null != optHospPageVO.getEndDate()) {
+            if (DateUtil.after(optHospPageVO.getStartDate(), optHospPageVO.getEndDate())) {
+                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间大于结束时间!");
+            }
+        }
+        if (null != optHospPageVO && null != optHospPageVO.getSysType()) {
+            optHospPageVO.setSysType(optHospPageVO.getSysType());
+        }
+        return getPageHospitalPUZ(optHospPageVO);
+    }
+
+    public HospNameDTO getAllHospitalName(){
+        HospNameDTO hospNameDTO = new HospNameDTO();
+        List<String> hospitalList = optInfoFacade.getAllHospital();
+        if(ListUtil.isNotEmpty(hospitalList)){
+            hospNameDTO.setHospitalCode(hospitalList);
+        }
+        return hospNameDTO;
+    }
+
+
+    public HospNameDTO getAllHospitalNameWithLtFrist(){
+        HospNameDTO hospNameDTO = new HospNameDTO();
+        List<String> hospitalList = optInfoFacade.getAllHospital();
+        if(ListUtil.isNotEmpty(hospitalList)){
+            List<String> hospitalListNew = new ArrayList<>();
+            List<String> hospitalListFilter = hospitalList.stream().filter(r -> !"朗通通用".equals(r)).collect(Collectors.toList());
+            hospitalListNew.add("朗通通用");
+            hospitalListNew.addAll(hospitalListFilter);
+            hospNameDTO.setHospitalCode(hospitalListNew);
+        }
+        return hospNameDTO;
+    }
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/mapper/InquiryTriageMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.InquiryTriage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 智能分诊记录主表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+public interface InquiryTriageMapper extends BaseMapper<InquiryTriage> {
+
+}

+ 62 - 0
tran-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java

@@ -0,0 +1,62 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospItemDTO;
+import com.diagbot.dto.PVDTO;
+import com.diagbot.dto.PVHospDTO;
+import com.diagbot.dto.PVHospSumDTO;
+import com.diagbot.dto.UVDTO;
+import com.diagbot.dto.UVHospDTO;
+import com.diagbot.dto.UVHospSumDTO;
+import com.diagbot.dto.ZZDTO;
+import com.diagbot.dto.ZZHospDTO;
+import com.diagbot.dto.ZZHospSumDTO;
+import com.diagbot.entity.OptInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+import com.diagbot.vo.OptVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 操作信息 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+public interface OptInfoMapper extends BaseMapper<OptInfo> {
+    List<PVDTO> getPV(OptVO optVO);
+
+    Long getPVSum(OptVO optVO);
+
+    List<UVDTO> getUV(OptVO optVO);
+
+    Long getUVSum(OptVO optVO);
+
+    List<ZZDTO> getZZ(OptVO optVO);
+
+    Long getZZSum(OptVO optVO);
+
+    //医院合计
+    List<PVHospDTO> getPVHosp(OptVO optVO);
+
+    List<PVHospSumDTO> getPVSumHosp(OptVO optVO);
+
+    List<UVHospDTO> getUVHosp(OptVO optVO);
+
+    List<UVHospSumDTO> getUVSumHosp(OptVO optVO);
+
+    List<ZZHospDTO> getZZHosp(OptVO optVO);
+
+    List<ZZHospSumDTO> getZZSumHosp(OptVO optVO);
+
+    List<String> getAllHospital();
+
+    List<HospItemDTO> getHospitalPUZ(OptHospVO optHospVO);
+
+    IPage<HospItemDTO> getPageHospitalPUZ(OptHospPageVO optHospPageVO);
+
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/service/InquiryTriageService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.InquiryTriage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 智能分诊记录主表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+public interface InquiryTriageService extends IService<InquiryTriage> {
+
+}

+ 61 - 0
tran-service/src/main/java/com/diagbot/service/OptInfoService.java

@@ -0,0 +1,61 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospItemDTO;
+import com.diagbot.dto.PVDTO;
+import com.diagbot.dto.PVHospDTO;
+import com.diagbot.dto.PVHospSumDTO;
+import com.diagbot.dto.UVDTO;
+import com.diagbot.dto.UVHospDTO;
+import com.diagbot.dto.UVHospSumDTO;
+import com.diagbot.dto.ZZDTO;
+import com.diagbot.dto.ZZHospDTO;
+import com.diagbot.dto.ZZHospSumDTO;
+import com.diagbot.entity.OptInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+import com.diagbot.vo.OptVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 操作信息 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+public interface OptInfoService extends IService<OptInfo> {
+    List<PVDTO> getPV(OptVO optVO);
+
+    Long getPVSum(OptVO optVO);
+
+    List<UVDTO> getUV(OptVO optVO);
+
+    Long getUVSum(OptVO optVO);
+
+    List<ZZDTO> getZZ(OptVO optVO);
+
+    Long getZZSum(OptVO optVO);
+
+    //医院合计
+    List<PVHospDTO> getPVHosp(OptVO optVO);
+
+    List<PVHospSumDTO> getPVSumHosp(OptVO optVO);
+
+    List<UVHospDTO> getUVHosp(OptVO optVO);
+
+    List<UVHospSumDTO> getUVSumHosp(OptVO optVO);
+
+    List<ZZHospDTO> getZZHosp(OptVO optVO);
+
+    List<ZZHospSumDTO> getZZSumHosp(OptVO optVO);
+
+    List<String> getAllHospital();
+
+    List<HospItemDTO> getHospitalPUZ(OptHospVO optHospVO);
+
+    IPage<HospItemDTO> getPageHospitalPUZ(OptHospPageVO optHospPageVO);
+}

+ 20 - 0
tran-service/src/main/java/com/diagbot/service/impl/InquiryTriageServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.InquiryTriage;
+import com.diagbot.mapper.InquiryTriageMapper;
+import com.diagbot.service.InquiryTriageService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 智能分诊记录主表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+@Service
+public class InquiryTriageServiceImpl extends ServiceImpl<InquiryTriageMapper, InquiryTriage> implements InquiryTriageService {
+
+}

+ 98 - 0
tran-service/src/main/java/com/diagbot/service/impl/OptInfoServiceImpl.java

@@ -0,0 +1,98 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HospItemDTO;
+import com.diagbot.dto.PVDTO;
+import com.diagbot.dto.PVHospDTO;
+import com.diagbot.dto.PVHospSumDTO;
+import com.diagbot.dto.UVDTO;
+import com.diagbot.dto.UVHospDTO;
+import com.diagbot.dto.UVHospSumDTO;
+import com.diagbot.dto.ZZDTO;
+import com.diagbot.dto.ZZHospDTO;
+import com.diagbot.dto.ZZHospSumDTO;
+import com.diagbot.entity.OptInfo;
+import com.diagbot.mapper.OptInfoMapper;
+import com.diagbot.service.OptInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+import com.diagbot.vo.OptVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 操作信息 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+@Service
+public class OptInfoServiceImpl extends ServiceImpl<OptInfoMapper, OptInfo> implements OptInfoService {
+    public List<PVDTO> getPV(OptVO optVO) {
+        return this.baseMapper.getPV(optVO);
+    }
+
+    public Long getPVSum(OptVO optVO) {
+        return this.baseMapper.getPVSum(optVO);
+    }
+
+    public List<UVDTO> getUV(OptVO optVO) {
+        return this.baseMapper.getUV(optVO);
+    }
+
+    public Long getUVSum(OptVO optVO) {
+        return this.baseMapper.getUVSum(optVO);
+    }
+
+    public List<ZZDTO> getZZ(OptVO optVO) {
+        return this.baseMapper.getZZ(optVO);
+    }
+
+    public Long getZZSum(OptVO optVO) {
+        return this.baseMapper.getZZSum(optVO);
+    }
+
+    //医院合计
+    public List<PVHospDTO> getPVHosp(OptVO optVO) {
+        return this.baseMapper.getPVHosp(optVO);
+    }
+
+    public List<PVHospSumDTO> getPVSumHosp(OptVO optVO) {
+        return this.baseMapper.getPVSumHosp(optVO);
+    }
+
+    public List<UVHospDTO> getUVHosp(OptVO optVO) {
+        return this.baseMapper.getUVHosp(optVO);
+    }
+
+    public List<UVHospSumDTO> getUVSumHosp(OptVO optVO) {
+        return this.baseMapper.getUVSumHosp(optVO);
+    }
+
+    public List<ZZHospDTO> getZZHosp(OptVO optVO) {
+        return this.baseMapper.getZZHosp(optVO);
+    }
+
+    public List<ZZHospSumDTO> getZZSumHosp(OptVO optVO) {
+        return this.baseMapper.getZZSumHosp(optVO);
+    }
+
+    public List<String> getAllHospital(){
+        return this.baseMapper.getAllHospital();
+    }
+
+    @Override
+    public List<HospItemDTO> getHospitalPUZ(OptHospVO optHospVO) {
+        return baseMapper.getHospitalPUZ(optHospVO);
+    }
+
+    @Override
+    public IPage<HospItemDTO> getPageHospitalPUZ(OptHospPageVO optHospPageVO) {
+        return baseMapper.getPageHospitalPUZ(optHospPageVO);
+    }
+
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ *
+ */
+@Getter
+@Setter
+public class HospitalVO {
+    //医院编码
+    //    @NotBlank(message = "请输入医院信息")
+    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;
+}

+ 39 - 0
tran-service/src/main/java/com/diagbot/vo/OptHospPageVO.java

@@ -0,0 +1,39 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/3 9:21
+ */
+@Getter
+@Setter
+public class OptHospPageVO extends Page {
+
+    //开始时间
+    @ApiModelProperty(value="开始时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date startDate;
+    //结束时间
+    @ApiModelProperty(value="结束时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date endDate;
+
+    //医院名称列表
+    private List<String> hospitalCodeList;
+
+    // 类型数组,默认都会返回访问量,有uvSum:再返回用户量,有zzSum:再返回提交量
+    private List<String> typeList;
+    /**
+     * 访问的系统类型 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;
+}

+ 35 - 0
tran-service/src/main/java/com/diagbot/vo/OptHospVO.java

@@ -0,0 +1,35 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2020/2/3 9:21
+ */
+@Getter
+@Setter
+public class OptHospVO {
+
+    //开始时间
+    @ApiModelProperty(value="开始时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date startDate;
+    //结束时间
+    @ApiModelProperty(value="结束时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date endDate;
+
+    //医院名称列表
+    private List<String> hospitalCodeList;
+    /**
+     * 访问的系统类型 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;
+}

+ 35 - 0
tran-service/src/main/java/com/diagbot/vo/OptVO.java

@@ -0,0 +1,35 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/3 9:21
+ */
+@Getter
+@Setter
+public class OptVO {
+    //医院名称
+    private String hospitalCode;
+    //开始时间
+    @ApiModelProperty(value="开始时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date startDate;
+    //结束时间
+    @ApiModelProperty(value="结束时间,格式为:2018-11-28 17:25:30")
+    @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
+    private Date endDate;
+    /**
+     * 访问的系统类型 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 List<String> hospitalCodeList;
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 智能分诊记录主表 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+@Controller
+@RequestMapping("/inquiryTriage")
+public class InquiryTriageController {
+
+}

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

@@ -0,0 +1,130 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.HospItemDTO;
+import com.diagbot.dto.HospNameDTO;
+import com.diagbot.dto.OptDTO;
+import com.diagbot.dto.OptHospDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.OptInfoFacade;
+import com.diagbot.vo.HospitalVO;
+import com.diagbot.vo.OptHospPageVO;
+import com.diagbot.vo.OptHospVO;
+import com.diagbot.vo.OptVO;
+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;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 操作信息 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-03-20
+ */
+@RestController
+@Api(value = "操作记录", tags = { "操作记录API" })
+@SuppressWarnings("unchecked")
+@RequestMapping("/optInfo")
+public class OptInfoController {
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    @ApiOperation(value = "操作记录保存[by:gaodm]")
+    @PostMapping("/saveOptInfo")
+    @SysLogger("saveOptInfo")
+    @Transactional
+    public RespDTO<Boolean> saveOptOnfo(@RequestBody HospitalVO hospitalVO) {
+        return RespDTO.onSuc(optInfoFacade.saveOptOnfo(hospitalVO, "1"));
+    }
+
+    @ApiOperation(value = "获取合计数据不带医院名称[by:gaodm]",
+            notes = "hospitalCode: 医院名称,String<br>" +
+                    "startDate: 开始时间,Date<br>" +
+                    "endDate: 结束时间,Date<br>")
+    @PostMapping("/getOptSum")
+    @SysLogger("getOptSum")
+    public RespDTO<OptDTO> getOptSum(@RequestBody OptVO optVO) {
+        return RespDTO.onSuc(optInfoFacade.getOptSum(optVO));
+    }
+
+
+    @ApiOperation(value = "获取合计数据带医院名称[by:gaodm]",
+            notes = "hospitalCode: 医院名称,String<br>" +
+                    "startDate: 开始时间,Date<br>" +
+                    "endDate: 结束时间,Date<br>")
+    @PostMapping("/getOptSumHosp")
+    @SysLogger("getOptSumHosp")
+    public RespDTO<OptHospDTO> getOptSumHosp(@RequestBody OptVO optVO) {
+        return RespDTO.onSuc(optInfoFacade.getOptSumHosp(optVO));
+    }
+
+    @ApiOperation(value = "获取所有医院名称[by:gaodm]",
+            notes = "")
+    @PostMapping("/getAllHospitalName")
+    @SysLogger("getAllHospitalName")
+    public RespDTO<HospNameDTO> getAllHospitalName() {
+        return RespDTO.onSuc(optInfoFacade.getAllHospitalName());
+    }
+
+    @ApiOperation(value = "获取所有医院名称,朗通通用排第一[by:zhoutg]",
+            notes = "")
+    @PostMapping("/getAllHospitalNameWithLtFrist")
+    @SysLogger("getAllHospitalNameWithLtFrist")
+    public RespDTO<HospNameDTO> getAllHospitalNameWithLtFrist() {
+        return RespDTO.onSuc(optInfoFacade.getAllHospitalNameWithLtFrist());
+    }
+
+
+    @ApiOperation(value = "获取合计数据不带医院名称,只统计总数据,不统计每天数据[by:zhoutg]",
+            notes = "hospitalCode: 医院名称,String<br>" +
+                    "startDate: 开始时间,Date<br>" +
+                    "endDate: 结束时间,Date<br>" +
+                    "出参:<br>" +
+                    "pvSum:访问总量<br>" +
+                    "uvSum:用户总量<br>" +
+                    "zzSum:完成问诊总量<br>")
+    @PostMapping("/getOptSumNoDays")
+    @SysLogger("getOptSumNoDays")
+    public RespDTO<OptDTO> getOptSumNoDays(@RequestBody OptVO optVO) {
+        return RespDTO.onSuc(optInfoFacade.getOptSumNoDays(optVO));
+    }
+
+
+    @ApiOperation(value = "获取合计数据带医院名称,只统计总数,不统计每天数据[by:zhoutg]",
+            notes = "hospitalCodeList: 医院名称列表,List<br>" +
+                    "startDate: 开始时间,Date<br>" +
+                    "endDate: 结束时间,Date<br>")
+    @PostMapping("/getOptSumHospNoDays")
+    @SysLogger("getOptSumHospNoDays")
+    public RespDTO<List<HospItemDTO>> getOptSumHospNoDays(@RequestBody OptHospVO optHospVO) {
+        return RespDTO.onSuc(optInfoFacade.getOptSumHospNoDays(optHospVO));
+    }
+
+    @ApiOperation(value = "获取合计数据带医院名称,只统计总数,不统计每天数据,分页[by:zhoutg]",
+            notes = "hospitalCodeList: 医院名称列表,List<br>" +
+                    "startDate: 开始时间,Date<br>" +
+                    "endDate: 结束时间,Date<br>" +
+                    "desc:排序指标,[pvSum|uvSum|zzSum]<br>" +
+                    "page;第几页<br>" +
+                    "size:条数<br>" +
+                    "typeList:类型数组,默认都会返回访问量,有uvSum:再返回用户量,有zzSum:再返回提交量")
+    @PostMapping("/getOptSumHospNoDaysPage")
+    @SysLogger("getOptSumHospNoDaysPage")
+    public RespDTO<IPage<HospItemDTO>> getOptSumHospNoDaysPage(@RequestBody OptHospPageVO optHospPageVO) {
+        IPage<HospItemDTO> data = optInfoFacade.getOptSumHospNoDaysPageFac(optHospPageVO);
+        return RespDTO.onSuc(data);
+    }
+}

+ 26 - 0
tran-service/src/main/resources/mapper/InquiryTriageMapper.xml

@@ -0,0 +1,26 @@
+<?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.InquiryTriageMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.InquiryTriage">
+        <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="hospital_code" property="hospitalCode" />
+        <result column="ip" property="ip" />
+        <result column="pat_name" property="patName" />
+        <result column="pat_age" property="patAge" />
+        <result column="pat_sex" property="patSex" />
+        <result column="id_type" property="idType" />
+        <result column="id_num" property="idNum" />
+        <result column="symptom" property="symptom" />
+        <result column="supplement" property="supplement" />
+        <result column="dis_dept" property="disDept" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 571 - 0
tran-service/src/main/resources/mapper/OptInfoMapper.xml

@@ -0,0 +1,571 @@
+<?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.OptInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.OptInfo">
+        <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="sys_type" property="sysType" />
+        <result column="hospital_code" property="hospitalCode" />
+        <result column="ip" property="ip" />
+        <result column="opt_type" property="optType" />
+        <result column="remark" property="remark" />
+    </resultMap>
+    <select id="getPV" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVDTO">
+        SELECT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        count(1) AS pvCnt
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        GROUP BY
+        DATE_FORMAT(gmt_create, '%Y-%m-%d')
+        ORDER BY
+        DATE_FORMAT(gmt_create, '%Y-%m-%d');
+    </select>
+
+    <select id="getPVSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
+        SELECT
+        count(1) AS pvSum
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+    </select>
+
+    <select id="getUV" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVDTO">
+        SELECT
+        t.days AS days,
+        count(ip) AS uvCnt
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+
+        ) t
+        GROUP BY
+        days
+        ORDER BY
+        days;
+    </select>
+
+    <select id="getUVSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
+        SELECT
+        count(ip) AS uvSum
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t;
+    </select>
+
+    <select id="getZZ" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZDTO">
+        SELECT
+        t.days AS days,
+        count(ip) AS zzCnt
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 2
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t
+        GROUP BY
+        days
+        ORDER BY
+        days;
+    </select>
+
+    <select id="getZZSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
+        SELECT
+        count(ip) AS zzSum
+        FROM
+        (
+        SELECT DISTINCT
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 2
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t;
+    </select>
+
+    <!--按照医院合计-->
+    <select id="getPVHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVHospDTO">
+        SELECT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        count(1) AS pvCnt
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        GROUP BY
+        hospital_code,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d')
+        ORDER BY
+        hospital_code,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d');
+    </select>
+
+    <select id="getPVSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVHospSumDTO">
+        SELECT
+        hospital_code AS hospitalCode,
+        count(1) AS pvSum
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        GROUP BY
+        hospital_code
+        ORDER BY
+        pvSum desc;
+    </select>
+
+    <select id="getUVHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVHospDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        t.days AS days,
+        count(ip) AS uvCnt
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode,
+        days
+        ORDER BY
+        hospitalCode,
+        days;
+
+    </select>
+
+    <select id="getUVSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVHospSumDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        count(ip) AS uvSum
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode
+        ORDER BY
+        uvSum desc;
+    </select>
+
+    <select id="getZZHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZHospDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        t.days AS days,
+        count(ip) AS zzCnt
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 2
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode,
+        days
+        ORDER BY
+        hospitalCode,
+        days;
+
+    </select>
+
+    <select id="getZZSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZHospSumDTO">
+        SELECT
+        t.hospitalCode AS hospitalCode,
+        count(ip) AS zzSum
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 2
+        <if test="hospitalCode != null and hospitalCode != ''">
+            AND hospital_code = #{hospitalCode}
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        ) t
+        GROUP BY
+        hospitalCode
+        ORDER BY
+        zzSum desc;
+    </select>
+
+    <select id="getAllHospital" resultType="java.lang.String">
+        SELECT DISTINCT(hospital_code) AS hospitalCode FROM `xlcs_opt_info` order by hospital_code
+    </select>
+
+    <select id="getHospitalPUZ" resultType="com.diagbot.dto.HospItemDTO">
+        select tt.hospitalCode, IFNULL(tt.pvSum, 0) pvSum , iFNULL(tt.uvSum, 0) uvSum,  iFNULL(tt.zzSum, 0) zzSum from (
+        select a.*,
+        (SELECT
+        count(ip)
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        ) t1 where t1.hospitalCode = a.hospitalCode
+        GROUP BY
+        hospitalCode
+        )  AS uvSum,
+
+        (
+        SELECT
+        count(ip)
+        FROM
+        (
+        SELECT DISTINCT
+        hospital_code AS hospitalCode,
+        DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+        ip
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 2
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        ) t2 where t2.hospitalCode = a.hospitalCode
+        GROUP BY
+        hospitalCode
+        )  AS zzSum
+
+        from
+        (
+        SELECT
+        hospital_code AS hospitalCode,
+        count(1) AS pvSum
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCodeList != null and hospitalCodeList.size > 0">
+            AND hospital_code in
+            <foreach collection="hospitalCodeList" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        GROUP BY
+        hospital_code
+        ORDER BY
+        hospital_code
+        ) a
+        ) tt
+    </select>
+
+    <select id="getPageHospitalPUZ" resultType="com.diagbot.dto.HospItemDTO">
+        select tt.hospitalCode, IFNULL(tt.pvSum, 0) pvSum , iFNULL(tt.uvSum, 0) uvSum,  iFNULL(tt.zzSum, 0) zzSum from (
+        select a.*,
+        <choose>
+            <when test='typeList != null and typeList.contains("uvSum")'>
+                (SELECT
+                count(ip)
+                FROM
+                (
+                SELECT DISTINCT
+                hospital_code AS hospitalCode,
+                DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+                ip
+                FROM
+                xlcs_opt_info
+                WHERE
+                opt_type = 1
+                <if test="startDate!=null">
+                    AND gmt_create &gt;= #{startDate}
+                </if>
+                <if test="endDate!=null">
+                    AND gmt_create &lt;= #{endDate}
+                </if>
+                --         AND hospital_code !='朗通通用'
+                ) t1 where t1.hospitalCode = a.hospitalCode
+
+                GROUP BY
+                hospitalCode
+                )  AS uvSum
+            </when>
+            <otherwise>
+                0 AS uvSum
+            </otherwise>
+        </choose>
+        ,
+
+        <choose>
+            <when test='typeList != null and typeList.contains("zzSum")'>
+                (
+                SELECT
+                count(ip)
+                FROM
+                (
+                SELECT DISTINCT
+                hospital_code AS hospitalCode,
+                DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
+                ip
+                FROM
+                xlcs_opt_info
+                WHERE
+                opt_type = 2
+                <if test="startDate!=null">
+                    AND gmt_create &gt;= #{startDate}
+                </if>
+                <if test="endDate!=null">
+                    AND gmt_create &lt;= #{endDate}
+                </if>
+                ) t2 where t2.hospitalCode = a.hospitalCode
+                GROUP BY
+                hospitalCode
+                )  AS zzSum
+            </when>
+            <otherwise>
+                0 AS zzSum
+            </otherwise>
+        </choose>
+        from
+        (
+        SELECT
+        hospital_code AS hospitalCode,
+        count(1) AS pvSum
+        FROM
+        xlcs_opt_info
+        WHERE
+        opt_type = 1
+        <if test="hospitalCodeList != null and hospitalCodeList.size > 0">
+            AND hospital_code in
+            <foreach collection="hospitalCodeList" item="item" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="sysType!=null">
+            AND sys_type &lt;= #{sysType}
+        </if>
+        <if test="startDate!=null">
+            AND gmt_create &gt;= #{startDate}
+        </if>
+        <if test="endDate!=null">
+            AND gmt_create &lt;= #{endDate}
+        </if>
+        --         AND hospital_code !='朗通通用'
+        GROUP BY
+        hospital_code
+        ) a
+        ) tt
+    </select>
+</mapper>