Ver código fonte

Merge branch 'develop' into bug/mix20190729

gaodm 5 anos atrás
pai
commit
5b9e34bbcd

+ 5 - 0
data-service/src/main/java/com/diagbot/vo/HospitalSetVO.java

@@ -27,6 +27,11 @@ public class HospitalSetVO {
 	@ApiModelProperty(hidden = true)
 	private Integer sysType = SysTypeEnum.DATA_SERVICE.getKey();
 
+	/**
+	 * 方案编号
+	 */
+	private Integer plan;
+
 	/**
 	 * 配置名称
 	 */

+ 3 - 0
docs/012.20190814数据服务模式支持多种方案/init_tran.sql

@@ -0,0 +1,3 @@
+use `sys-tran`;
+ALTER TABLE `tran_sys_set`
+ADD COLUMN `plan` int(11) NOT NULL DEFAULT '0' COMMENT '方案编号' AFTER `hospital_code`;

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

@@ -1,20 +1,19 @@
 package com.diagbot.entity;
 
-import java.io.Serializable;
-import java.time.LocalDateTime;
-import java.util.Date;
-
 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 wangfeng
- * @since 2019-06-12
+ * @author zhaops
+ * @since 2019-08-14
  */
 @TableName("tran_sys_set")
 public class SysSet implements Serializable {
@@ -58,7 +57,12 @@ public class SysSet implements Serializable {
     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 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;
 
@@ -71,6 +75,7 @@ public class SysSet implements Serializable {
      * 配置编码
      */
     private String code;
+
     /**
      * 配置值
      */
@@ -81,109 +86,114 @@ public class SysSet implements Serializable {
      */
     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 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
-				+ ", sysType=" + sysType + ", name=" + name + ", code=" + code + ", value=" + value + ", remark="
-				+ 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 +
+        "}";
+    }
 }

+ 21 - 22
tran-service/src/main/java/com/diagbot/facade/SysSetFacade.java

@@ -1,39 +1,38 @@
 package com.diagbot.facade;
 
-import java.util.List;
-
-import org.springframework.stereotype.Component;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.SysSetInfoDTO;
 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 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{
+public class SysSetFacade extends SysSetServiceImpl {
+
 
-	
-	/**
-	 * 
-	 * @param hospitalSetVO
-	 * @return
-	 */
-	public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
-/*		 QueryWrapper<SysSet> queryWrapper = new QueryWrapper<SysSet>();
-	        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-	        			.in("hospital_code", hospitalSetVO.getHospitalCode());*/
-	        List<SysSet> sysSetData = querySysSetInfo(hospitalSetVO);
-	        List<SysSetInfoDTO> data =   BeanUtil.listCopyTo(sysSetData, SysSetInfoDTO.class);
-		return data;
-	}
+    /**
+     * @param hospitalSetVO
+     * @return
+     */
+    public List<SysSetInfoDTO> getSysSetInfoData(HospitalSetVO hospitalSetVO) {
+        //		 QueryWrapper<SysSet> queryWrapper = new QueryWrapper<SysSet>();
+        //	        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+        //	        			.in("hospital_code", hospitalSetVO.getHospitalCode());
+        if (IntegerUtil.isNull(hospitalSetVO.getPlan())) {
+            hospitalSetVO.setPlan(0);
+        }
+        List<SysSet> sysSetData = querySysSetInfo(hospitalSetVO);
+        List<SysSetInfoDTO> data = BeanUtil.listCopyTo(sysSetData, SysSetInfoDTO.class);
+        return data;
+    }
 
 }

+ 5 - 0
tran-service/src/main/java/com/diagbot/vo/HospitalSetVO.java

@@ -20,6 +20,11 @@ public class HospitalSetVO {
      */
     private Integer sysType;
 
+    /**
+     * 方案编号
+     */
+    private Integer plan;
+
     /**
      * 配置名称
      */

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

@@ -1,25 +1,20 @@
 package com.diagbot.web;
 
-
-import java.util.List;
-
-import javax.validation.Valid;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.IndexDataDTO;
 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>
@@ -35,16 +30,14 @@ import io.swagger.annotations.ApiOperation;
 @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);
+    @Autowired
+    SysSetFacade sysSetFacade;
 
-		return RespDTO.onSuc(data);
-	}
+    @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);
+    }
 }

+ 39 - 33
tran-service/src/main/resources/mapper/SysSetMapper.xml

@@ -2,37 +2,43 @@
 <!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="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="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>
+    <!-- 通用查询映射结果 -->
+    <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>

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

@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
         strategy.setTablePrefix(new String[] { "tran_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "tran_inquiry_info","tran_inquiry_detail" }); // 需要生成的表
+        strategy.setInclude(new String[] { "tran_sys_set" }); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);