浏览代码

查体模板

Zhaops 6 年之前
父节点
当前提交
1463157624

+ 355 - 0
icssman-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -0,0 +1,355 @@
+package com.diagbot.entity;
+
+import java.math.BigDecimal;
+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 zhaops
+ * @since 2018-11-23
+ */
+@TableName("icss_question_info")
+public class QuestionInfo 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 tagName;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 性别(1:男 2:女 3:通用)
+     */
+    private Integer sexType;
+
+    /**
+     * 最小年龄
+     */
+    private Integer ageBegin;
+
+    /**
+     * 最大年龄
+     */
+    private Integer ageEnd;
+
+    /**
+     * 标签标识(1:单项单问题,例如: 程度,咳出通畅度  2:单项多问题,例如:杂音,添加症状 3:填充项,例如:有前后缀的输入框 4:横铺组合项,例如:咳嗽,发热 5:竖铺组合项,例如:诊疗变化)
+     */
+    private String tagType;
+
+    /**
+     * 控件类型(0:无类型,默认值 1:下拉单选 2:下拉多选 3:联合下拉单选 4:联合下拉多选 5:占位标签 6:文本框 7:数字键盘文本框 99:联合推送)
+     */
+    private Integer controlType;
+
+    /**
+     * 类型(1:症状 3:其他史 4:查体,5:化验 6:辅检 7:诊断)
+     */
+    private Integer type;
+
+    /**
+     * 子类型,(0:本身,1:描述类型 31:既往史 32:家族史 33:个人史 34:月经史 35:婚育史)
+     */
+    private Integer subType;
+
+    /**
+     * 前置内容
+     */
+    private String labelPrefix;
+
+    /**
+     * 后置内容
+     */
+    private String labelSuffix;
+
+    /**
+     * 最小值
+     */
+    private BigDecimal minValue;
+
+    /**
+     * 最大值
+     */
+    private BigDecimal maxValue;
+
+    /**
+     * 判断类型(0:本身异常;1:本身正常;2:数字范围;3:计算公式;9:无需判断)
+     */
+    private String judgeType;
+
+    /**
+     * 文本生成规则(0:点选顺序,例如初为 1:从上到下,从左到右,例如查体杂音 2:从左到右,从上到下,例如伴/无)
+     */
+    private Integer textGenerate;
+
+    /**
+     * 是否复制 (0:不复制,1:复制)
+     */
+    private String copyType;
+
+    /**
+     * 是否显示+ (0:不显示 1:显示),+功能等于复制
+     */
+    private Integer showAdd;
+
+    /**
+     * 提示语
+     */
+    private String placeholder;
+
+    /**
+     * 备注
+     */
+    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 getTagName() {
+        return tagName;
+    }
+
+    public void setTagName(String tagName) {
+        this.tagName = tagName;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public Integer getSexType() {
+        return sexType;
+    }
+
+    public void setSexType(Integer sexType) {
+        this.sexType = sexType;
+    }
+    public Integer getAgeBegin() {
+        return ageBegin;
+    }
+
+    public void setAgeBegin(Integer ageBegin) {
+        this.ageBegin = ageBegin;
+    }
+    public Integer getAgeEnd() {
+        return ageEnd;
+    }
+
+    public void setAgeEnd(Integer ageEnd) {
+        this.ageEnd = ageEnd;
+    }
+    public String getTagType() {
+        return tagType;
+    }
+
+    public void setTagType(String tagType) {
+        this.tagType = tagType;
+    }
+    public Integer getControlType() {
+        return controlType;
+    }
+
+    public void setControlType(Integer controlType) {
+        this.controlType = controlType;
+    }
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+    public Integer getSubType() {
+        return subType;
+    }
+
+    public void setSubType(Integer subType) {
+        this.subType = subType;
+    }
+    public String getLabelPrefix() {
+        return labelPrefix;
+    }
+
+    public void setLabelPrefix(String labelPrefix) {
+        this.labelPrefix = labelPrefix;
+    }
+    public String getLabelSuffix() {
+        return labelSuffix;
+    }
+
+    public void setLabelSuffix(String labelSuffix) {
+        this.labelSuffix = labelSuffix;
+    }
+    public BigDecimal getMinValue() {
+        return minValue;
+    }
+
+    public void setMinValue(BigDecimal minValue) {
+        this.minValue = minValue;
+    }
+    public BigDecimal getMaxValue() {
+        return maxValue;
+    }
+
+    public void setMaxValue(BigDecimal maxValue) {
+        this.maxValue = maxValue;
+    }
+    public String getJudgeType() {
+        return judgeType;
+    }
+
+    public void setJudgeType(String judgeType) {
+        this.judgeType = judgeType;
+    }
+    public Integer getTextGenerate() {
+        return textGenerate;
+    }
+
+    public void setTextGenerate(Integer textGenerate) {
+        this.textGenerate = textGenerate;
+    }
+    public String getCopyType() {
+        return copyType;
+    }
+
+    public void setCopyType(String copyType) {
+        this.copyType = copyType;
+    }
+    public Integer getShowAdd() {
+        return showAdd;
+    }
+
+    public void setShowAdd(Integer showAdd) {
+        this.showAdd = showAdd;
+    }
+    public String getPlaceholder() {
+        return placeholder;
+    }
+
+    public void setPlaceholder(String placeholder) {
+        this.placeholder = placeholder;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "QuestionInfo{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", tagName=" + tagName +
+        ", name=" + name +
+        ", sexType=" + sexType +
+        ", ageBegin=" + ageBegin +
+        ", ageEnd=" + ageEnd +
+        ", tagType=" + tagType +
+        ", controlType=" + controlType +
+        ", type=" + type +
+        ", subType=" + subType +
+        ", labelPrefix=" + labelPrefix +
+        ", labelSuffix=" + labelSuffix +
+        ", minValue=" + minValue +
+        ", maxValue=" + maxValue +
+        ", judgeType=" + judgeType +
+        ", textGenerate=" + textGenerate +
+        ", copyType=" + copyType +
+        ", showAdd=" + showAdd +
+        ", placeholder=" + placeholder +
+        ", remark=" + remark +
+        "}";
+    }
+}

+ 58 - 2
icssman-service/src/main/java/com/diagbot/facade/DeptVitalFacade.java

@@ -1,13 +1,69 @@
 package com.diagbot.facade;
 
-import com.diagbot.service.impl.DeptInfoServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.DeptVital;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.QuestionTypeEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.impl.DeptVitalServiceImpl;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.vo.DeptVitalVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Description:
  * @Author:zhaops
  * @time: 2018/11/22 11:45
  */
 @Component
-public class DeptVitalFacade extends DeptInfoServiceImpl {
+public class DeptVitalFacade extends DeptVitalServiceImpl {
+
+    @Autowired
+    private QuestionInfoFacade questionInfoFacade;
+
+    /**
+     * 保存查体模板
+     *
+     * @param deptVitalVO
+     * @return
+     */
+    public Boolean saveDeptVitals(DeptVitalVO deptVitalVO) {
+        //先删除该科室原有模板
+        QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<DeptVital>();
+        deptVitalQueryWrapper.eq("dept_id", deptVitalVO.getDeptId());
+        this.remove(deptVitalQueryWrapper);
+
+        //查找标签是否存在
+        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
+        questionInfoQueryWrapper.in("id", deptVitalVO.getVitalIds()).
+                eq("type", QuestionTypeEnum.Vital.getKey()).
+                eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<QuestionInfo> questionInfoList = questionInfoFacade.list(questionInfoQueryWrapper);
+
+        Map<Long, QuestionInfo> questionInfoMap = EntityUtil.makeEntityMap(questionInfoList, "id");
+        for (Long vital : deptVitalVO.getVitalIds()) {
+            if (questionInfoMap.get(vital) == null) {
+                throw new CommonException(CommonErrorCode.NOT_EXISTS, "id=" + vital + "的查体标签不存在");
+            }
+        }
+
+        //插入新模板
+        List<DeptVital> deptVitalList = Lists.newArrayList();
+        for (Long vital : deptVitalVO.getVitalIds()) {
+            DeptVital deptVital = new DeptVital();
+            deptVital.setDeptId(deptVitalVO.getDeptId());
+            deptVital.setVitalId(vital);
+            deptVital.setGmtCreate(new Date());
+        }
+        this.saveBatch(deptVitalList);
+        return true;
+    }
 }

+ 13 - 0
icssman-service/src/main/java/com/diagbot/facade/QuestionInfoFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.QuestionInfoServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class QuestionInfoFacade extends QuestionInfoServiceImpl {
+}

+ 16 - 0
icssman-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.QuestionInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 标签基础表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2018-11-23
+ */
+public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
+
+}

+ 16 - 0
icssman-service/src/main/java/com/diagbot/service/QuestionInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.QuestionInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 标签基础表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2018-11-23
+ */
+public interface QuestionInfoService extends IService<QuestionInfo> {
+
+}

+ 20 - 0
icssman-service/src/main/java/com/diagbot/service/impl/QuestionInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.mapper.QuestionInfoMapper;
+import com.diagbot.service.QuestionInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 标签基础表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2018-11-23
+ */
+@Service
+public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, QuestionInfo> implements QuestionInfoService {
+
+}

+ 20 - 0
icssman-service/src/main/java/com/diagbot/vo/DeptVitalVO.java

@@ -0,0 +1,20 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:查体模板
+ * @Author:zhaops
+ * @time: 2018/11/23 11:16
+ */
+@Getter
+@Setter
+public class DeptVitalVO {
+    @NotNull(message = "请输入科室ID")
+    private Long deptId;
+    @NotNull(message = "请输入查体标签ID")
+    private Long[] vitalIds;
+}

+ 0 - 2
icssman-service/src/main/java/com/diagbot/web/DeptInfoController.java

@@ -3,8 +3,6 @@ package com.diagbot.web;
 
 import io.swagger.annotations.Api;
 import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RestController;
 
 /**

+ 17 - 0
icssman-service/src/main/java/com/diagbot/web/DeptVitalController.java

@@ -1,10 +1,19 @@
 package com.diagbot.web;
 
 
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DeptVital;
+import com.diagbot.vo.DeptVitalVO;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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 java.util.List;
+
 /**
  * <p>
  * 科室查体对应表 前端控制器
@@ -18,4 +27,12 @@ import org.springframework.web.bind.annotation.RestController;
 @Api(value = "查体模板相关API", tags = { "查体模板相关API" })
 public class DeptVitalController {
 
+    @ApiOperation(value = "保存查体模板",
+            notes = "deptId:科室ID,必填<br>" +
+                    "vitalIds:查体标签ids,必填<br>" )
+    @PostMapping("/saveDeptVitals")
+    @SysLogger("saveDeptVitals")
+    public RespDTO<Boolean> saveDeptVitals(@RequestBody DeptVitalVO deptVitalVO){
+        return RespDTO.onSuc(true);
+    }
 }

+ 20 - 0
icssman-service/src/main/java/com/diagbot/web/QuestionInfoController.java

@@ -0,0 +1,20 @@
+package com.diagbot.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 标签基础表 前端控制器
+ * </p>
+ *
+ * @author zhaops
+ * @since 2018-11-23
+ */
+@Controller
+@RequestMapping("/questionInfo")
+public class QuestionInfoController {
+
+}

+ 1 - 2
icssman-service/src/main/java/com/diagbot/web/VitalOrderController.java

@@ -3,8 +3,6 @@ package com.diagbot.web;
 
 import io.swagger.annotations.Api;
 import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -20,4 +18,5 @@ import org.springframework.web.bind.annotation.RestController;
 @Api(value = "查体排序相关API", tags = { "查体排序相关API" })
 public class VitalOrderController {
 
+
 }

+ 34 - 0
icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -0,0 +1,34 @@
+<?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.QuestionInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.QuestionInfo">
+        <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="tag_name" property="tagName" />
+        <result column="name" property="name" />
+        <result column="sex_type" property="sexType" />
+        <result column="age_begin" property="ageBegin" />
+        <result column="age_end" property="ageEnd" />
+        <result column="tag_type" property="tagType" />
+        <result column="control_type" property="controlType" />
+        <result column="type" property="type" />
+        <result column="sub_type" property="subType" />
+        <result column="label_prefix" property="labelPrefix" />
+        <result column="label_suffix" property="labelSuffix" />
+        <result column="min_value" property="minValue" />
+        <result column="max_value" property="maxValue" />
+        <result column="judge_type" property="judgeType" />
+        <result column="text_generate" property="textGenerate" />
+        <result column="copy_type" property="copyType" />
+        <result column="show_add" property="showAdd" />
+        <result column="placeholder" property="placeholder" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>