Selaa lähdekoodia

tran_sys_set value字段改成String(255)相关的接口修改
新增总医院下分医院和默认科室的列表接口

wangfeng 5 vuotta sitten
vanhempi
commit
aaf6837b96

+ 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;
 
     /**
      * 备注

+ 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;
+}

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

@@ -1,44 +1,44 @@
-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 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 String value;
+}

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

@@ -1,44 +1,44 @@
-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 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 String value;
+}

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

@@ -0,0 +1,19 @@
+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 +
+        "}";
+    }
+}

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

@@ -1,36 +1,84 @@
-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.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.service.impl.SysSetServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.IntegerUtil;
+import com.diagbot.vo.HospitalSetVO;
+import com.diagbot.vo.SysHospitalCodeVO;
+import com.diagbot.vo.SysHospitalInfoVO;
+import com.google.common.collect.Lists;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+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;
+    }
+
+    public SysHospitalDTO getHospitalDeptInfoData(SysHospitalCodeVO sysHospitalCodeVO) {
+        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", 17);
+        SysSet sysSetInfoData = getOne(sysSetInfo, false);
+        SysHospitalInfoVO sysHospitalInfoVO =new SysHospitalInfoVO();
+        List<String> listCode=Lists.newArrayList(sysSetInfoData.getValue().split(","));
+        listCode.add(sysHospitalCodeVO.getHospitalCode());
+        sysHospitalInfoVO.setHospitalCode(listCode);
+        sysHospitalInfoVO.setCode("default_dept");
+        sysHospitalInfoVO.setSysType(17);
+        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())){
+                SysHospitalDeptInfoDTO data = new SysHospitalDeptInfoDTO();
+                data.setDeptCode(superiorsInfoData.getDeptCode());
+                data.setDeptName(superiorsInfoData.getDeptName());
+                data.setHospitalCode(superiorsInfoData.getHospitalCode());
+                data.setHospitalName(superiorsInfoData.getHospitalName());
+                sysHospitalDTO.setSuperiorsInfo(data);
+            }else {
+                SysHospitalDeptInfoDTO data = new SysHospitalDeptInfoDTO();
+                data.setDeptCode(superiorsInfoData.getDeptCode());
+                data.setDeptName(superiorsInfoData.getDeptName());
+                data.setHospitalCode(superiorsInfoData.getHospitalCode());
+                data.setHospitalName(superiorsInfoData.getHospitalName());
+                hospitalDatas.add(data);
+            }
+
+        }
+        sysHospitalDTO.setJuniorHospital(hospitalDatas);
+
+        return sysHospitalDTO;
+    }
+}

+ 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);
+	}
+
+}

+ 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;
+ }

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

@@ -1,43 +1,53 @@
-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-12
- */
-@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-12
+ */
+@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  必填<br> ")
+    @PostMapping("/getHospitalDatas")
+    @SysLogger("getHospitalDatas")
+    public RespDTO<SysHospitalDTO> getHospitalDatas(@Valid @RequestBody SysHospitalCodeVO sysHospitalCodeVO) {
+        SysHospitalDTO data = sysSetFacade.getHospitalDeptInfoData(sysHospitalCodeVO);
+        return RespDTO.onSuc(data);
+    }
+
+}

+ 68 - 44
tran-service/src/main/resources/mapper/SysSetMapper.xml

@@ -1,44 +1,68 @@
-<?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.SysSetMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysSet">
-        <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="plan" property="plan" />
-        <result column="sys_type" property="sysType" />
-        <result column="name" property="name" />
-        <result column="code" property="code" />
-        <result column="value" property="value" />
-        <result column="remark" property="remark" />
-    </resultMap>
-
-    <select id="querySysSetInfo" parameterType="com.diagbot.vo.HospitalSetVO" resultType="com.diagbot.entity.SysSet">
-        SELECT * FROM tran_sys_set
-        <where>
-            is_deleted = "N"
-            <if test="hospitalCode != null and hospitalCode != '' ">
-                and hospital_code = #{hospitalCode}
-            </if>
-            <if test="plan != null">
-                and plan = #{plan}
-            </if>
-            <if test="sysType != null">
-                and sys_type = #{sysType}
-            </if>
-            <if test="name != null and name !=''">
-                and name = #{name}
-            </if>
-            <if test="code != null and code !=''">
-                and code = #{code}
-            </if>
-        </where>
-    </select>
-
-</mapper>
+<?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.SysSetMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysSet">
+        <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="plan" property="plan"/>
+        <result column="sys_type" property="sysType"/>
+        <result column="name" property="name"/>
+        <result column="code" property="code"/>
+        <result column="value" property="value"/>
+        <result column="remark" property="remark"/>
+    </resultMap>
+
+    <select id="querySysSetInfo" parameterType="com.diagbot.vo.HospitalSetVO" resultType="com.diagbot.entity.SysSet">
+        SELECT * FROM tran_sys_set
+        <where>
+            is_deleted = "N"
+            <if test="hospitalCode != null and hospitalCode != '' ">
+                and hospital_code = #{hospitalCode}
+            </if>
+            <if test="plan != null">
+                and plan = #{plan}
+            </if>
+            <if test="sysType != null">
+                and sys_type = #{sysType}
+            </if>
+            <if test="name != null and name !=''">
+                and name = #{name}
+            </if>
+            <if test="code != null and code !=''">
+                and code = #{code}
+            </if>
+        </where>
+    </select>
+    <select id="getjuniorHospitalData" parameterType="com.diagbot.vo.SysHospitalInfoVO"
+            resultType="com.diagbot.dto.SysHospitalDeptInfoDTO">
+
+        SELECT c.code AS hospitalCode,c.name AS hospitalName,b.code AS deptCode ,b.name AS deptName
+        FROM tran_sys_set a
+        JOIN tran_hospital_dept b
+        JOIN tran_hospital_info c
+        ON a.value = b.code
+        AND a.hospital_code =b.hospital_code
+        AND a.hospital_code = c.code
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        <if test="sysType!= null and sysType != ''">
+            AND a.sys_type = #{sysType}
+        </if>
+        <if test="code!= null and code != ''">
+            AND a.code = #{code}
+        </if>
+        and a.hospital_code in
+        <foreach collection="hospitalCode" item="hospitalCodeNew" open="(" close=")"
+                 separator=",">
+            #{hospitalCodeNew}
+        </foreach>
+    </select>
+</mapper>