Browse Source

标签删除

zhoutg 6 years ago
parent
commit
d27a07684f
28 changed files with 814 additions and 212 deletions
  1. 1 1
      icss-service/src/test/java/com/diagbot/CodeGeneration.java
  2. 1 0
      icssman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  3. 1 0
      icssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  4. 89 0
      icssman-service/src/main/java/com/diagbot/entity/ModuleDetail.java
  5. 97 0
      icssman-service/src/main/java/com/diagbot/entity/QuestionDetail.java
  6. 15 208
      icssman-service/src/main/java/com/diagbot/entity/QuestionInfo.java
  7. 99 0
      icssman-service/src/main/java/com/diagbot/entity/QuestionMapping.java
  8. 25 0
      icssman-service/src/main/java/com/diagbot/facade/ModuleDetailFacade.java
  9. 25 0
      icssman-service/src/main/java/com/diagbot/facade/QuestionDetailFacade.java
  10. 48 0
      icssman-service/src/main/java/com/diagbot/facade/QuestionInfoFacade.java
  11. 25 0
      icssman-service/src/main/java/com/diagbot/facade/QuestionMappingFacade.java
  12. 19 0
      icssman-service/src/main/java/com/diagbot/mapper/ModuleDetailMapper.java
  13. 19 0
      icssman-service/src/main/java/com/diagbot/mapper/QuestionDetailMapper.java
  14. 3 0
      icssman-service/src/main/java/com/diagbot/mapper/QuestionInfoMapper.java
  15. 19 0
      icssman-service/src/main/java/com/diagbot/mapper/QuestionMappingMapper.java
  16. 25 0
      icssman-service/src/main/java/com/diagbot/service/ModuleDetailService.java
  17. 26 0
      icssman-service/src/main/java/com/diagbot/service/QuestionDetailService.java
  18. 9 0
      icssman-service/src/main/java/com/diagbot/service/QuestionInfoService.java
  19. 25 0
      icssman-service/src/main/java/com/diagbot/service/QuestionMappingService.java
  20. 26 0
      icssman-service/src/main/java/com/diagbot/service/impl/ModuleDetailServiceImpl.java
  21. 26 0
      icssman-service/src/main/java/com/diagbot/service/impl/QuestionDetailServiceImpl.java
  22. 6 0
      icssman-service/src/main/java/com/diagbot/service/impl/QuestionInfoServiceImpl.java
  23. 26 0
      icssman-service/src/main/java/com/diagbot/service/impl/QuestionMappingServiceImpl.java
  24. 44 3
      icssman-service/src/main/java/com/diagbot/web/QuestionInfoController.java
  25. 30 0
      icssman-service/src/main/resources/mapper/ModuleDetailMapper.xml
  26. 33 0
      icssman-service/src/main/resources/mapper/QuestionDetailMapper.xml
  27. 11 0
      icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml
  28. 41 0
      icssman-service/src/main/resources/mapper/QuestionMappingMapper.xml

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

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

+ 1 - 0
icssman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -28,6 +28,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
                 .antMatchers("/file/upload").permitAll()
                 .antMatchers("/introduceInfo/saveIntroduce").permitAll()
+                .antMatchers("/questionInfo/delete").permitAll()
                 .antMatchers("/**").authenticated();
         //        .antMatchers("/**").permitAll();
     }

+ 1 - 0
icssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -91,6 +91,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/hystrix/**", request)
                 || matchers("/file/upload", request)
                 || matchers("introduceInfo/saveIntroduce", request)
+                || matchers("/questionInfo/delete", request)
                 || matchers("/", request)) {
             return true;
         }

+ 89 - 0
icssman-service/src/main/java/com/diagbot/entity/ModuleDetail.java

@@ -0,0 +1,89 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 模型明细表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-22
+ */
+@TableName("icss_module_detail")
+@Getter
+@Setter
+public class ModuleDetail 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 Long moduleId;
+
+    /**
+     * 前置内容
+     */
+    private String labelPrefix;
+
+    /**
+     * 后置内容
+     */
+    private String labelSuffix;
+
+    /**
+     * questionId
+     */
+    private Long questionId;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 97 - 0
icssman-service/src/main/java/com/diagbot/entity/QuestionDetail.java

@@ -0,0 +1,97 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 标签明细表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+@TableName("icss_question_detail")
+@Getter
+@Setter
+public class QuestionDetail 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;
+
+    /**
+     * question_id
+     */
+    private Long questionId;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 后置内容
+     */
+    private String labelPrefix;
+
+    /**
+     * 后置内容
+     */
+    private String labelSuffix;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 是否默认被选中(0:不选中,1:选中)
+     */
+    private String defaultSelect;
+
+    /**
+     * 特殊编码(1:伴,2:无)
+     */
+    private Integer code;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 15 - 208
icssman-service/src/main/java/com/diagbot/entity/QuestionInfo.java

@@ -1,21 +1,26 @@
 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 com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
 import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * <p>
  * 标签基础表
  * </p>
  *
- * @author zhaops
- * @since 2018-11-23
+ * @author zhoutg
+ * @since 2018-12-03
  */
 @TableName("icss_question_info")
+@Getter
+@Setter
 public class QuestionInfo implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -34,12 +39,12 @@ public class QuestionInfo implements Serializable {
     /**
      * 记录创建时间
      */
-    private LocalDateTime gmtCreate;
+    private Date gmtCreate;
 
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 创建人,0表示无创建人值
@@ -77,12 +82,12 @@ public class QuestionInfo implements Serializable {
     private Integer ageEnd;
 
     /**
-     * 标签标识(1:单项单问题,例如: 程度,咳出通畅度  2:单项多问题,例如:杂音,添加症状 3:填充项,例如:有前后缀的输入框 4:横铺组合项,例如:咳嗽,发热 5:竖铺组合项,例如:诊疗变化)
+     * 标签标识(1:单项单列,例如: 程度,咳出通畅度  2:单项多列,例如:杂音,添加症状 3:横铺单标签形式,例如:血压 4:横铺多标签形式,例如:咳嗽 5:竖铺组合项,例如:有无治疗 6:组合项多列 既往史 7:化验)
      */
     private String tagType;
 
     /**
-     * 控件类型(0:无类型,默认值 1:下拉单选 2:下拉多选 3:联合下拉单选 4:联合下拉多选 5:占位标签 6:文本框 7:数字键盘文本框 99:联合推送)
+     * 控件类型(0:无类型,默认值 1:下拉单选 2:下拉多选 3:纯文本 4:待定 5:待定 6:文本框 7:数字键盘文本框 99:联合推送)
      */
     private Integer controlType;
 
@@ -92,7 +97,7 @@ public class QuestionInfo implements Serializable {
     private Integer type;
 
     /**
-     * 子类型,(0:本身,1:描述类型 31:既往史 32:家族史 33:个人史 34:月经史 35:婚育史)
+     * 子类型,(0:项目,1:描述)
      */
     private Integer subType;
 
@@ -141,202 +146,4 @@ public class QuestionInfo 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 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 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 +
-        ", remark=" + remark +
-        "}";
-    }
 }

+ 99 - 0
icssman-service/src/main/java/com/diagbot/entity/QuestionMapping.java

@@ -0,0 +1,99 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 标签映射表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+@TableName("icss_question_mapping")
+@Getter
+@Setter
+public class QuestionMapping 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;
+
+    /**
+     * 上级question
+     */
+    private Long parentQuestion;
+
+    /**
+     * 下级question
+     */
+    private Long sonQuestion;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 标签显示位置(0:在标签后,1:在标签前)
+     */
+    private Integer position;
+
+    /**
+     * 填写单显示位置(0:左, 1:上)
+     */
+    private Integer formPosition;
+
+    /**
+     * 互斥类型(0:不互斥, 1:互斥 主要用在组合项:例如既往史无殊)
+     */
+    private Integer exclusionType;
+
+    /**
+     * 主症状和伴随症状对应的question类型(0:症状公用 1:主症状特有 2:伴随症状特有 )
+     */
+    private Integer symptomType;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 25 - 0
icssman-service/src/main/java/com/diagbot/facade/ModuleDetailFacade.java

@@ -0,0 +1,25 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.ModuleDetailServiceImpl;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class ModuleDetailFacade extends ModuleDetailServiceImpl {
+
+    /**
+     * 根据questionId删除明细
+     *
+     * @param map
+     * @return
+     */
+    public void deleteByQuestionIdFac(Map map) {
+        this.deleteByQuestionIds(map);
+    }
+}

+ 25 - 0
icssman-service/src/main/java/com/diagbot/facade/QuestionDetailFacade.java

@@ -0,0 +1,25 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.QuestionDetailServiceImpl;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class QuestionDetailFacade extends QuestionDetailServiceImpl {
+
+    /**
+     * 根据questionId删除明细
+     *
+     * @param map
+     * @return
+     */
+    public void deleteByQuestionIdFac(Map map) {
+        this.deleteByQuestionIds(map);
+    }
+}

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

@@ -1,8 +1,16 @@
 package com.diagbot.facade;
 
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.QuestionInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @Description:
  * @Author:zhaops
@@ -10,4 +18,44 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public class QuestionInfoFacade extends QuestionInfoServiceImpl {
+
+    @Autowired
+    QuestionDetailFacade questionDetailFacade;
+    @Autowired
+    QuestionMappingFacade questionMappingFacade;
+    @Autowired
+    ModuleDetailFacade moduleDetailFacade;
+
+    /**
+     * 根据id删除标签
+     *
+     * @param ids
+     * @return
+     */
+    public Boolean deleteByIdsFac(String ids) {
+
+        if(StringUtil.isEmpty(ids)) {
+            return true;
+        }
+
+        Map paramMap = new HashMap<>();
+        paramMap.put("delete", IsDeleteEnum.Y.getKey());
+        paramMap.put("ids", Arrays.asList(ids.split(",")));
+        paramMap.put("gmtModified", DateUtil.now());
+        //TODO 获取当前修改人
+        paramMap.put("modifier", "modifier"); //修改人
+
+        //删除自身
+        this.deleteByIds(paramMap);
+
+        //删除明细
+        questionDetailFacade.deleteByQuestionIdFac(paramMap);
+
+        //删除映射关系
+        questionMappingFacade.deleteByIdsFac(paramMap);
+
+        //删除模板中的标签
+        moduleDetailFacade.deleteByQuestionIdFac(paramMap);
+        return true;
+    }
 }

+ 25 - 0
icssman-service/src/main/java/com/diagbot/facade/QuestionMappingFacade.java

@@ -0,0 +1,25 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.QuestionMappingServiceImpl;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class QuestionMappingFacade extends QuestionMappingServiceImpl {
+
+    /**
+     * 根据id删除标签
+     *
+     * @param map
+     * @return
+     */
+    public void deleteByIdsFac(Map map) {
+        this.deleteByIds(map);
+    }
+}

+ 19 - 0
icssman-service/src/main/java/com/diagbot/mapper/ModuleDetailMapper.java

@@ -0,0 +1,19 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.ModuleDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 模型明细表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-22
+ */
+public interface ModuleDetailMapper extends BaseMapper<ModuleDetail> {
+
+    public void deleteByQuestionIds(Map map);
+}

+ 19 - 0
icssman-service/src/main/java/com/diagbot/mapper/QuestionDetailMapper.java

@@ -0,0 +1,19 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.QuestionDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签明细表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+public interface QuestionDetailMapper extends BaseMapper<QuestionDetail> {
+
+    public void deleteByQuestionIds(Map map);
+}

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

@@ -3,6 +3,8 @@ package com.diagbot.mapper;
 import com.diagbot.entity.QuestionInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.Map;
+
 /**
  * <p>
  * 标签基础表 Mapper 接口
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
 
+    public void deleteByIds(Map map);
 }

+ 19 - 0
icssman-service/src/main/java/com/diagbot/mapper/QuestionMappingMapper.java

@@ -0,0 +1,19 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.QuestionMapping;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+public interface QuestionMappingMapper extends BaseMapper<QuestionMapping> {
+
+    public void deleteByIds(Map map);
+}

+ 25 - 0
icssman-service/src/main/java/com/diagbot/service/ModuleDetailService.java

@@ -0,0 +1,25 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.ModuleDetail;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 模型明细表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-22
+ */
+public interface ModuleDetailService extends IService<ModuleDetail> {
+
+    /**
+     * 根据id删除标签
+     *
+     * @param map
+     * @return
+     */
+    public void deleteByQuestionIds(Map map);
+}

+ 26 - 0
icssman-service/src/main/java/com/diagbot/service/QuestionDetailService.java

@@ -0,0 +1,26 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.QuestionDetail;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签明细表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+public interface QuestionDetailService extends IService<QuestionDetail> {
+
+
+    /**
+     * 根据id删除标签
+     *
+     * @param map
+     * @return
+     */
+    public void deleteByQuestionIds(Map map);
+}

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

@@ -3,6 +3,8 @@ package com.diagbot.service;
 import com.diagbot.entity.QuestionInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.Map;
+
 /**
  * <p>
  * 标签基础表 服务类
@@ -13,4 +15,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface QuestionInfoService extends IService<QuestionInfo> {
 
+    /**
+     * 根据id删除标签
+     *
+     * @param map
+     * @return
+     */
+    public void deleteByIds(Map map);
 }

+ 25 - 0
icssman-service/src/main/java/com/diagbot/service/QuestionMappingService.java

@@ -0,0 +1,25 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.QuestionMapping;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签映射表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+public interface QuestionMappingService extends IService<QuestionMapping> {
+
+    /**
+     * 根据id删除标签
+     *
+     * @param map
+     * @return
+     */
+    public void deleteByIds(Map map);
+}

+ 26 - 0
icssman-service/src/main/java/com/diagbot/service/impl/ModuleDetailServiceImpl.java

@@ -0,0 +1,26 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.entity.ModuleDetail;
+import com.diagbot.mapper.ModuleDetailMapper;
+import com.diagbot.service.ModuleDetailService;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 模型明细表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-22
+ */
+@Service
+public class ModuleDetailServiceImpl extends ServiceImpl<ModuleDetailMapper, ModuleDetail> implements ModuleDetailService {
+
+    @Override
+    public void deleteByQuestionIds(Map map) {
+        baseMapper.deleteByQuestionIds(map);
+    }
+}

+ 26 - 0
icssman-service/src/main/java/com/diagbot/service/impl/QuestionDetailServiceImpl.java

@@ -0,0 +1,26 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.QuestionDetail;
+import com.diagbot.mapper.QuestionDetailMapper;
+import com.diagbot.service.QuestionDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签明细表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+@Service
+public class QuestionDetailServiceImpl extends ServiceImpl<QuestionDetailMapper, QuestionDetail> implements QuestionDetailService {
+
+    @Override
+    public void deleteByQuestionIds(Map map) {
+        baseMapper.deleteByQuestionIds(map);
+    }
+}

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

@@ -6,6 +6,8 @@ import com.diagbot.service.QuestionInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.Map;
+
 /**
  * <p>
  * 标签基础表 服务实现类
@@ -17,4 +19,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, QuestionInfo> implements QuestionInfoService {
 
+    @Override
+    public void deleteByIds(Map map) {
+        baseMapper.deleteByIds(map);
+    }
 }

+ 26 - 0
icssman-service/src/main/java/com/diagbot/service/impl/QuestionMappingServiceImpl.java

@@ -0,0 +1,26 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.QuestionMapping;
+import com.diagbot.mapper.QuestionMappingMapper;
+import com.diagbot.service.QuestionMappingService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 标签映射表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-03
+ */
+@Service
+public class QuestionMappingServiceImpl extends ServiceImpl<QuestionMappingMapper, QuestionMapping> implements QuestionMappingService {
+
+    @Override
+    public void deleteByIds(Map map) {
+        baseMapper.deleteByIds(map);
+    }
+}

+ 44 - 3
icssman-service/src/main/java/com/diagbot/web/QuestionInfoController.java

@@ -1,9 +1,16 @@
 package com.diagbot.web;
 
 
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.QuestionInfoFacade;
+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.RequestMapping;
-
-import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * <p>
@@ -13,8 +20,42 @@ import org.springframework.stereotype.Controller;
  * @author zhaops
  * @since 2018-11-23
  */
-@Controller
+@RestController
 @RequestMapping("/questionInfo")
+@Api(value = "标签相关API——数据谨慎操作", tags = { "标签相关API——数据谨慎操作" })
 public class QuestionInfoController {
 
+    @Autowired
+    QuestionInfoFacade questionInfoFacade;
+
+    @ApiOperation(value = "标签新增或更新[by:zhoutg]",
+            notes = "")
+    @PostMapping("/saveOrUpdate")
+    @SysLogger("saveOrUpdate")
+    public RespDTO<Boolean> saveOrUpdate() {
+
+        return RespDTO.onSuc(true);
+    }
+
+
+
+    @ApiOperation(value = "标签检索[by:zhoutg]",
+            notes = "")
+    @PostMapping("/index")
+    @SysLogger("index")
+    public RespDTO<Boolean> index() {
+
+        return RespDTO.onSuc(true);
+    }
+
+
+    @ApiOperation(value = "标签删除(测试阶段,别乱删)[by:zhoutg]",
+            notes = "")
+    @PostMapping("/delete")
+    @SysLogger("delete")
+    @Transactional
+    public RespDTO<Boolean> delete(String ids) {
+        questionInfoFacade.deleteByIdsFac(ids);
+        return RespDTO.onSuc(true);
+    }
 }

+ 30 - 0
icssman-service/src/main/resources/mapper/ModuleDetailMapper.xml

@@ -0,0 +1,30 @@
+<?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.ModuleDetailMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.ModuleDetail">
+        <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="module_id" property="moduleId" />
+        <result column="label_prefix" property="labelPrefix" />
+        <result column="label_suffix" property="labelSuffix" />
+        <result column="question_id" property="questionId" />
+        <result column="order_no" property="orderNo" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+    <delete id="deleteByQuestionIds" parameterType="java.util.Map">
+        update `icss_module_detail`
+        set gmt_modified = #{gmtModified}, modifier = #{modifier}, is_deleted = #{delete}
+        where is_deleted = 'N'
+        and question_id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")" >
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 33 - 0
icssman-service/src/main/resources/mapper/QuestionDetailMapper.xml

@@ -0,0 +1,33 @@
+<?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.QuestionDetailMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.QuestionDetail">
+        <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="question_id" property="questionId" />
+        <result column="name" property="name" />
+        <result column="label_prefix" property="labelPrefix" />
+        <result column="label_suffix" property="labelSuffix" />
+        <result column="order_no" property="orderNo" />
+        <result column="default_select" property="defaultSelect" />
+        <result column="code" property="code" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+    <delete id="deleteByQuestionIds" parameterType="java.util.Map">
+        update `icss_question_detail`
+        set gmt_modified = #{gmtModified}, modifier = #{modifier}, is_deleted = #{delete}
+        where is_deleted = 'N'
+        and question_id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")" >
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>

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

@@ -30,4 +30,15 @@
         <result column="remark" property="remark" />
     </resultMap>
 
+
+
+    <delete id="deleteByIds" parameterType="java.util.Map">
+        update `icss_question_info`
+        set gmt_modified = #{gmtModified}, modifier = #{modifier}, is_deleted = #{delete}
+        where is_deleted = 'N'
+        and id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")" >
+            #{id}
+        </foreach>
+    </delete>
 </mapper>

+ 41 - 0
icssman-service/src/main/resources/mapper/QuestionMappingMapper.xml

@@ -0,0 +1,41 @@
+<?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.QuestionMappingMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.QuestionMapping">
+        <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="parent_question" property="parentQuestion" />
+        <result column="son_question" property="sonQuestion" />
+        <result column="order_no" property="orderNo" />
+        <result column="position" property="position" />
+        <result column="form_position" property="formPosition" />
+        <result column="exclusion_type" property="exclusionType" />
+        <result column="symptom_type" property="symptomType" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+
+    <delete id="deleteByIds" parameterType="java.util.Map">
+        update `icss_question_mapping`
+        set gmt_modified = #{gmtModified}, modifier = #{modifier}, is_deleted = #{delete}
+        where is_deleted = 'N'
+        and
+        (
+            parent_question in
+            <foreach item="id" collection="ids" open="(" separator="," close=")" >
+                #{id}
+            </foreach>
+            or son_question in
+            <foreach item="id" collection="ids" open="(" separator="," close=")" >
+                #{id}
+            </foreach>
+        )
+    </delete>
+
+</mapper>