Ver Fonte

修改逻辑

Administrator há 1 ano atrás
pai
commit
976511aedb

+ 25 - 14
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/InvestigateDisposition.java

@@ -49,9 +49,22 @@ public class InvestigateDisposition extends BaseEntity
     /** 父部门名称 */
     private String parentName;
 
+    /**
+     * 考察具体内容
+     */
+    private String content;
+
     /** 子部门 */
     private List<InvestigateDisposition> children = new ArrayList<InvestigateDisposition>();
 
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
     public String getParentName()
     {
         return parentName;
@@ -136,19 +149,17 @@ public class InvestigateDisposition extends BaseEntity
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("investigateDispositionId", getInvestigateDispositionId())
-            .append("parentId", getParentId())
-            .append("ancestors", getAncestors())
-            .append("orderNum", getOrderNum())
-            .append("title", getTitle())
-            .append("url", getUrl())
-            .append("status", getStatus())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
+        return "InvestigateDisposition{" +
+                "investigateDispositionId=" + investigateDispositionId +
+                ", parentId=" + parentId +
+                ", ancestors='" + ancestors + '\'' +
+                ", orderNum=" + orderNum +
+                ", title='" + title + '\'' +
+                ", url='" + url + '\'' +
+                ", status='" + status + '\'' +
+                ", parentName='" + parentName + '\'' +
+                ", content='" + content + '\'' +
+                ", children=" + children +
+                '}';
     }
 }

+ 21 - 12
ruoyi-system/src/main/java/com/ruoyi/system/domain/InvestigateTable.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.domain;
 
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
@@ -42,13 +43,23 @@ public class InvestigateTable extends BaseEntity
      * 考察人员集合
      */
     private List<InvestigateUser> investigateUserList;
+    /**
+     * 考察标题和内容关联集合
+     */
+    private List<InvestigateDispositionTable> investigateDispositionTableList;
 
 
 
     /** 考察配置组 */
     private Long[] investigateDispositionTableIds;
 
+    public List<InvestigateDispositionTable> getInvestigateDispositionTableList() {
+        return investigateDispositionTableList;
+    }
 
+    public void setInvestigateDispositionTableList(List<InvestigateDispositionTable> investigateDispositionTableList) {
+        this.investigateDispositionTableList = investigateDispositionTableList;
+    }
 
     public List<InvestigateUser> getInvestigateUserList() {
         return investigateUserList;
@@ -113,17 +124,15 @@ public class InvestigateTable extends BaseEntity
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("investigateTableId", getInvestigateTableId())
-            .append("investigateName", getInvestigateName())
-            .append("content", getContent())
-            .append("endTime", getEndTime())
-            .append("cipher", getCipher())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
+        return "InvestigateTable{" +
+                "investigateTableId=" + investigateTableId +
+                ", investigateName='" + investigateName + '\'' +
+                ", content='" + content + '\'' +
+                ", endTime=" + endTime +
+                ", cipher='" + cipher + '\'' +
+                ", investigateUserList=" + investigateUserList +
+                ", investigateDispositionTableList=" + investigateDispositionTableList +
+                ", investigateDispositionTableIds=" + Arrays.toString(investigateDispositionTableIds) +
+                '}';
     }
 }

+ 76 - 60
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InvestigateDispositionServiceImpl.java

@@ -1,88 +1,121 @@
 package com.ruoyi.system.service.impl;
 
+import java.io.*;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.UUID;
 import java.util.stream.Collectors;
 
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.TreeSelect;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.file.FileUtils;
+import com.ruoyi.system.mapper.InvestigateDispositionMapper;
+import com.ruoyi.system.mapper.InvestigateDispositionTableMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ruoyi.system.mapper.InvestigateDispositionMapper;
 import com.ruoyi.common.core.domain.entity.InvestigateDisposition;
 import com.ruoyi.system.service.IInvestigateDispositionService;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 考察配置Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2023-10-10
  */
 @Service
-public class InvestigateDispositionServiceImpl implements IInvestigateDispositionService 
-{
+public class InvestigateDispositionServiceImpl implements IInvestigateDispositionService {
     @Autowired
     private InvestigateDispositionMapper investigateDispositionMapper;
 
     /**
      * 查询考察配置
-     * 
+     *
      * @param investigateDispositionId 考察配置主键
      * @return 考察配置
      */
     @Override
-    public InvestigateDisposition selectInvestigateDispositionByInvestigateDispositionId(Long investigateDispositionId)
-    {
+    public InvestigateDisposition selectInvestigateDispositionByInvestigateDispositionId(Long investigateDispositionId) {
         return investigateDispositionMapper.selectInvestigateDispositionByInvestigateDispositionId(investigateDispositionId);
     }
 
     /**
      * 查询考察配置列表
-     * 
+     *
      * @param investigateDisposition 考察配置
      * @return 考察配置
      */
     @Override
-    public List<InvestigateDisposition> selectInvestigateDispositionList(InvestigateDisposition investigateDisposition)
-    {
+    public List<InvestigateDisposition> selectInvestigateDispositionList(InvestigateDisposition investigateDisposition) {
         return investigateDispositionMapper.selectInvestigateDispositionList(investigateDisposition);
     }
 
     /**
      * 新增考察配置
-     * 
+     *
      * @param investigateDisposition 考察配置
      * @return 结果
      */
     @Override
-    public int insertInvestigateDisposition(InvestigateDisposition investigateDisposition)
-    {
+    public int insertInvestigateDisposition(InvestigateDisposition investigateDisposition) {
+        String fileName = getFileName(investigateDisposition);
+        investigateDisposition.setUrl(fileName);
         InvestigateDisposition info = investigateDispositionMapper.selectInvestigateDispositionById(investigateDisposition.getParentId());
         investigateDisposition.setCreateTime(DateUtils.getNowDate());
         investigateDisposition.setAncestors("0");
-        if (info != null){
+        if (info != null) {
             investigateDisposition.setAncestors(info.getAncestors() + "," + investigateDisposition.getParentId());
         }
         return investigateDispositionMapper.insertInvestigateDisposition(investigateDisposition);
     }
 
+    private String getFileName(InvestigateDisposition investigateDisposition) {
+        //获取HTML文件
+        String content = investigateDisposition.getContent();
+        content = " <meta charset=\"utf-8\">" + content;
+        String fileName = "";
+        try {
+            // 上传文件路径
+            String filePath = RuoYiConfig.getUploadPath();
+            String fileNameHtml = UUID.randomUUID().toString();
+            File html = File.createTempFile(fileNameHtml, ".html", new File(filePath));
+            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(html, true), StandardCharsets.UTF_8));
+            writer.write(content);
+            writer.close();
+            InputStream inputStream = new FileInputStream(html);
+            MultipartFile file = new org.springframework.mock.web.MockMultipartFile(html.getName(), html.getName(), "text/html", inputStream);
+            // 上传并返回新文件名称
+             fileName = FileUploadUtils.upload(filePath, file);
+            html.delete();
+            System.out.println("文件生成成功!");
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return fileName;
+    }
+
+
     /**
      * 修改考察配置
-     * 
+     *
      * @param investigateDisposition 考察配置
      * @return 结果
      */
     @Override
-    public int updateInvestigateDisposition(InvestigateDisposition investigateDisposition)
-    {
+    public int updateInvestigateDisposition(InvestigateDisposition investigateDisposition) {
+        //todo 删除原先的文件
+        String fileName = getFileName(investigateDisposition);
+        investigateDisposition.setUrl(fileName);
         InvestigateDisposition newParentInfo = investigateDispositionMapper.selectInvestigateDispositionById(investigateDisposition.getParentId());
         InvestigateDisposition oldInfo = investigateDispositionMapper.selectInvestigateDispositionById(investigateDisposition.getInvestigateDispositionId());
-        if (StringUtils.isNotNull(newParentInfo) && StringUtils.isNotNull(oldInfo))
-        {
+        if (StringUtils.isNotNull(newParentInfo) && StringUtils.isNotNull(oldInfo)) {
             String newAncestors = newParentInfo.getAncestors() + "," + newParentInfo.getInvestigateDispositionId();
             String oldAncestors = oldInfo.getAncestors();
             investigateDisposition.setAncestors(newAncestors);
@@ -96,43 +129,39 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
      * 修改子元素关系
      *
      * @param investigateDispositionId 被修改的考察配置ID
-     * @param newAncestors 新的父ID集合
-     * @param oldAncestors 旧的父ID集合
+     * @param newAncestors             新的父ID集合
+     * @param oldAncestors             旧的父ID集合
      */
-    public void updateDeptChildren(Long investigateDispositionId, String newAncestors, String oldAncestors)
-    {
+    public void updateDeptChildren(Long investigateDispositionId, String newAncestors, String oldAncestors) {
         List<InvestigateDisposition> children = investigateDispositionMapper.selectChildrenInvestigateDispositionById(investigateDispositionId);
 
-        for (InvestigateDisposition child : children)
-        {
+        for (InvestigateDisposition child : children) {
             child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
         }
-        if (children.size() > 0)
-        {
+        if (children.size() > 0) {
             investigateDispositionMapper.updateInvestigateDispositionChildren(children);
         }
     }
+
     /**
      * 批量删除考察配置
-     * 
+     *
      * @param investigateDispositionIds 需要删除的考察配置主键
      * @return 结果
      */
     @Override
-    public int deleteInvestigateDispositionByInvestigateDispositionIds(Long[] investigateDispositionIds)
-    {
+    public int deleteInvestigateDispositionByInvestigateDispositionIds(Long[] investigateDispositionIds) {
         return investigateDispositionMapper.deleteInvestigateDispositionByInvestigateDispositionIds(investigateDispositionIds);
     }
 
     /**
      * 删除考察配置信息
-     * 
+     *
      * @param investigateDispositionId 考察配置主键
      * @return 结果
      */
     @Override
-    public int deleteInvestigateDispositionByInvestigateDispositionId(Long investigateDispositionId)
-    {
+    public int deleteInvestigateDispositionByInvestigateDispositionId(Long investigateDispositionId) {
         return investigateDispositionMapper.deleteInvestigateDispositionByInvestigateDispositionId(investigateDispositionId);
     }
 
@@ -144,8 +173,7 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
      * @return 部门树信息集合
      */
     @Override
-    public List<TreeSelect> selectInvestigateDispositionTreeList(InvestigateDisposition investigateDisposition)
-    {
+    public List<TreeSelect> selectInvestigateDispositionTreeList(InvestigateDisposition investigateDisposition) {
         List<InvestigateDisposition> investigateDispositions = selectInvestigateDispositionList(investigateDisposition);
         return buildInvestigateDispositionTreeSelect(investigateDispositions);
     }
@@ -157,21 +185,17 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
      * @return 树结构列表
      */
     @Override
-    public List<InvestigateDisposition> buildInvestigateDispositionTree(List<InvestigateDisposition> investigateDispositions)
-    {
+    public List<InvestigateDisposition> buildInvestigateDispositionTree(List<InvestigateDisposition> investigateDispositions) {
         List<InvestigateDisposition> returnList = new ArrayList<InvestigateDisposition>();
         List<Long> tempList = investigateDispositions.stream().map(InvestigateDisposition::getInvestigateDispositionId).collect(Collectors.toList());
-        for (InvestigateDisposition investigateDisposition : investigateDispositions)
-        {
+        for (InvestigateDisposition investigateDisposition : investigateDispositions) {
             // 如果是顶级节点, 遍历该父节点的所有子节点
-            if (!tempList.contains(investigateDisposition.getParentId()))
-            {
+            if (!tempList.contains(investigateDisposition.getParentId())) {
                 recursionFn(investigateDispositions, investigateDisposition);
                 returnList.add(investigateDisposition);
             }
         }
-        if (returnList.isEmpty())
-        {
+        if (returnList.isEmpty()) {
             returnList = investigateDispositions;
         }
         return returnList;
@@ -184,8 +208,7 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
      * @return 下拉树结构列表
      */
     @Override
-    public List<TreeSelect> buildInvestigateDispositionTreeSelect(List<InvestigateDisposition> investigateDispositions)
-    {
+    public List<TreeSelect> buildInvestigateDispositionTreeSelect(List<InvestigateDisposition> investigateDispositions) {
         List<InvestigateDisposition> deptTrees = buildInvestigateDispositionTree(investigateDispositions);
         return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
     }
@@ -193,15 +216,12 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
     /**
      * 递归列表
      */
-    private void recursionFn(List<InvestigateDisposition> list, InvestigateDisposition t)
-    {
+    private void recursionFn(List<InvestigateDisposition> list, InvestigateDisposition t) {
         // 得到子节点列表
         List<InvestigateDisposition> childList = getChildList(list, t);
         t.setChildren(childList);
-        for (InvestigateDisposition tChild : childList)
-        {
-            if (hasChild(list, tChild))
-            {
+        for (InvestigateDisposition tChild : childList) {
+            if (hasChild(list, tChild)) {
                 recursionFn(list, tChild);
             }
         }
@@ -210,15 +230,12 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
     /**
      * 得到子节点列表
      */
-    private List<InvestigateDisposition> getChildList(List<InvestigateDisposition> list, InvestigateDisposition t)
-    {
+    private List<InvestigateDisposition> getChildList(List<InvestigateDisposition> list, InvestigateDisposition t) {
         List<InvestigateDisposition> tlist = new ArrayList<InvestigateDisposition>();
         Iterator<InvestigateDisposition> it = list.iterator();
-        while (it.hasNext())
-        {
+        while (it.hasNext()) {
             InvestigateDisposition n = (InvestigateDisposition) it.next();
-            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getInvestigateDispositionId().longValue())
-            {
+            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getInvestigateDispositionId().longValue()) {
                 tlist.add(n);
             }
         }
@@ -228,8 +245,7 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
     /**
      * 判断是否有子节点
      */
-    private boolean hasChild(List<InvestigateDisposition> list, InvestigateDisposition t)
-    {
+    private boolean hasChild(List<InvestigateDisposition> list, InvestigateDisposition t) {
         return getChildList(list, t).size() > 0;
     }
 }

+ 0 - 23
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InvestigateDispositionTableServiceImpl.java

@@ -82,12 +82,6 @@ public class InvestigateDispositionTableServiceImpl implements IInvestigateDispo
 
             // 上传并返回新文件名称
             String fileName = FileUploadUtils.upload(filePath, file);
-            String url = investigateDispositionTable.getUrl() + fileName;
-            AjaxResult ajax = AjaxResult.success();
-            ajax.put("url", url);
-            ajax.put("fileName", fileName);
-            ajax.put("newFileName", FileUtils.getName(fileName));
-            ajax.put("originalFilename", file.getOriginalFilename());
             investigateDispositionTable.setUrl(fileName);
             html.delete();
         } catch (IOException e) {
@@ -126,25 +120,8 @@ public class InvestigateDispositionTableServiceImpl implements IInvestigateDispo
 
             // 上传并返回新文件名称
             String fileName = FileUploadUtils.upload(filePath, file);
-            String url = investigateDispositionTable.getUrl() + fileName;
-            AjaxResult ajax = AjaxResult.success();
-            ajax.put("url", url);
-            ajax.put("fileName", fileName);
-            ajax.put("newFileName", FileUtils.getName(fileName));
-            ajax.put("originalFilename", file.getOriginalFilename());
             investigateDispositionTable.setUrl(fileName);
             html.delete();
-            File fileOld = new File(url);
-
-            if (fileOld.exists()) {
-                if (fileOld.delete()) {
-                    System.out.println("文件删除成功!");
-                } else {
-                    System.out.println("文件删除失败!");
-                }
-            } else {
-                System.out.println("文件不存在!");
-            }
         } catch (IOException e) {
             e.printStackTrace();
         }

+ 67 - 30
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InvestigateTableServiceImpl.java

@@ -1,14 +1,21 @@
 package com.ruoyi.system.service.impl;
 
+import java.io.*;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.aliyun.dysmsapi20170525.models.SendBatchSmsRequest;
 import com.aliyun.dysmsapi20170525.models.SendBatchSmsResponse;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SendSmsUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.system.domain.InvestigateDispositionTable;
 import com.ruoyi.system.domain.InvestigateUser;
 import com.ruoyi.system.mapper.InvestigateDispositionTableMapper;
@@ -18,6 +25,9 @@ import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.InvestigateTableMapper;
 import com.ruoyi.system.domain.InvestigateTable;
 import com.ruoyi.system.service.IInvestigateTableService;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
 
 /**
  * 考察主Service业务层处理
@@ -77,11 +87,53 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
             }
             investigateUserMapper.batchDispositionUser(investigateUserList);
             //发送短信
-            sendBatchSmsTable(investigateTableId,investigateUserList);
+            sendBatchSmsTable(investigateTableId, investigateUserList);
+        }
+
+        //新增察配置与考察主表关联表的内容
+        List<InvestigateDispositionTable> investigateDispositionTableList = investigateTable.getInvestigateDispositionTableList();
+
+        if (investigateDispositionTableList != null && investigateDispositionTableList.size() > 0) {
+            insertInvestigateDispositionTable(investigateDispositionTableList);
         }
         return i;
     }
 
+
+    /**
+     * 新增考察配置与考察主关联
+     *
+     * @param investigateDispositionTableList 考察配置与考察主关联
+     * @return 结果
+     */
+
+    private void insertInvestigateDispositionTable(List<InvestigateDispositionTable> investigateDispositionTableList) {
+        for (InvestigateDispositionTable investigateDispositionTable : investigateDispositionTableList) {
+            //获取HTML文件
+            String content = investigateDispositionTable.getContent();
+            content = " <meta charset=\"utf-8\">" + content;
+            try {
+                // 上传文件路径
+                String filePath = RuoYiConfig.getUploadPath();
+                String fileNameHtml = UUID.randomUUID().toString();
+                File html = File.createTempFile(fileNameHtml, ".html", new File(filePath));
+                BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(html, true), StandardCharsets.UTF_8));
+                writer.write(content);
+                writer.close();
+                InputStream inputStream = new FileInputStream(html);
+                MultipartFile file = new org.springframework.mock.web.MockMultipartFile(html.getName(), html.getName(), "text/html", inputStream);
+                // 上传并返回新文件名称
+                String fileName = FileUploadUtils.upload(filePath, file);
+                investigateDispositionTable.setUrl(fileName);
+                html.delete();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            System.out.println("文件生成成功!");
+        }
+        investigateDispositionTableMapper.batchDispositionTable(investigateDispositionTableList);
+    }
+
     public static void sendBatchSmsTable(Long investigateTableId, List<InvestigateUser> investigateUserList) {
         for (InvestigateUser investigateUser : investigateUserList) {
             StringBuffer phoneNumberJson = new StringBuffer();
@@ -149,35 +201,6 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
         return code.toString();
     }
 
-    /**
-     * 新增考察配置与考察主表关联
-     *
-     * @param investigateTable 考察主表对象
-     */
-    public void insertInvestigateDispositionTable(InvestigateTable investigateTable) {
-        this.insertInvestigateDispositionTable(investigateTable.getInvestigateTableId(), investigateTable.getInvestigateDispositionTableIds());
-    }
-
-    /**
-     * 新增考察配置与考察主表关联
-     *
-     * @param investigateTableId             察主表ID
-     * @param investigateDispositionTableIds 考察配置组
-     */
-    public void insertInvestigateDispositionTable(Long investigateTableId, Long[] investigateDispositionTableIds) {
-        if (StringUtils.isNotEmpty(investigateDispositionTableIds)) {
-            // 新增考察配置与考察主表关联
-            List<InvestigateDispositionTable> list = new ArrayList<InvestigateDispositionTable>(investigateDispositionTableIds.length);
-            for (Long dispositionId : investigateDispositionTableIds) {
-                InvestigateDispositionTable investigateDispositionTable = new InvestigateDispositionTable();
-                investigateDispositionTable.setInvestigateTableId(investigateTableId);
-                investigateDispositionTable.setInvestigateDispositionId(dispositionId);
-                list.add(investigateDispositionTable);
-            }
-            investigateDispositionTableMapper.batchDispositionTable(list);
-        }
-    }
-
     /**
      * 修改考察主
      *
@@ -197,7 +220,21 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
             }
             investigateUserMapper.batchDispositionUser(investigateUserList);
         }
+
+        //todo 删除服务器文件
+
+        //删除原先的考察配置与考察主表关联表信息
+        investigateDispositionTableMapper.deleteInvestigateDispositionTableByInvestigateTableId(investigateTable.getInvestigateTableId());
+
+        //新增察配置与考察主表关联表的内容
+        List<InvestigateDispositionTable> investigateDispositionTableList = investigateTable.getInvestigateDispositionTableList();
+
+        if (investigateDispositionTableList != null && investigateDispositionTableList.size() > 0) {
+            insertInvestigateDispositionTable(investigateDispositionTableList);
+        }
+
         return investigateTableMapper.updateInvestigateTable(investigateTable);
+
     }
 
     /**

+ 6 - 2
ruoyi-system/src/main/resources/mapper/system/InvestigateDispositionMapper.xml

@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="title"    column="title"    />
         <result property="url"    column="url"    />
         <result property="status"    column="status"    />
+        <result property="content"    column="content"    />
         <result property="parentName" column="parent_name" />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -21,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectInvestigateDispositionVo">
-        select investigate_disposition_id, parent_id, ancestors, order_num, title, url, status, create_by, create_time, update_by, update_time, remark from investigate_disposition
+        select investigate_disposition_id, parent_id, ancestors, order_num, title, url,content, status, create_by, create_time, update_by, update_time, remark from investigate_disposition
     </sql>
 
     <select id="selectInvestigateDispositionList" parameterType="InvestigateDisposition" resultMap="InvestigateDispositionResult">
@@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="title != null">title,</if>
             <if test="url != null">url,</if>
             <if test="status != null">status,</if>
+            <if test="content != null">content,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -64,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="title != null">#{title},</if>
             <if test="url != null">#{url},</if>
             <if test="status != null">#{status},</if>
+            <if test="content != null">#{content},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -81,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="title != null">title = #{title},</if>
             <if test="url != null">url = #{url},</if>
             <if test="status != null">status = #{status},</if>
+            <if test="content != null">content = #{content},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
@@ -102,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <select id="selectInvestigateDispositionById" parameterType="Long" resultMap="InvestigateDispositionResult">
-        select d.investigate_disposition_id, d.parent_id, d.ancestors, d.order_num, d.title, d.url, d.status,
+        select d.investigate_disposition_id, d.parent_id, d.ancestors, d.order_num, d.title, d.url, d.status,d.content,
             (select title from investigate_disposition where investigate_disposition_id = d.investigate_disposition_id) parent_name
         from investigate_disposition d
         where d.investigate_disposition_id = #{investigateDispositionId}

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/InvestigateDispositionTableMapper.xml

@@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="batchDispositionTable">
         insert into investigate_disposition_table(investigate_table_id, investigate_disposition_id,url,content,title) values
         <foreach item="item" index="index" collection="list" separator=",">
-            (#{item.investigateTableId},#{item.investigateDispositionId},#{item.url},#{content},#{title})
+            (#{item.investigateTableId},#{item.investigateDispositionId},#{item.url},#{item.content},#{item.title})
         </foreach>
     </insert>
 </mapper>

+ 38 - 22
ruoyi-system/src/main/resources/mapper/system/InvestigateTableMapper.xml

@@ -16,13 +16,15 @@
         <result property="updateTime" column="update_time"/>
         <result property="remark" column="remark"/>
         <collection property="investigateUserList" javaType="java.util.List" resultMap="InvestigateUserResult"/>
+        <collection property="investigateDispositionTableList" javaType="java.util.List" resultMap="InvestigateDispositionTableResult"/>
     </resultMap>
 
     <resultMap type="InvestigateDispositionTable" id="InvestigateDispositionTableResult">
-        <result property="investigateTableId" column="investigate_table_id"/>
-        <result property="investigateDispositionId" column="investigate_disposition_id"/>
-        <result property="url" column="url"/>
-        <result property="title" column="title"/>
+        <result property="investigateTableId" column="idt_investigate_table_id"/>
+        <result property="investigateDispositionId" column="idt_investigate_disposition_id"/>
+        <result property="url" column="idt_url"/>
+        <result property="title" column="idt_title"/>
+        <result property="content" column="idt_content"/>
     </resultMap>
 
     <resultMap type="InvestigateUser" id="InvestigateUserResult">
@@ -69,10 +71,16 @@
         u.user_name,
         u.phonenumber,
         u.id_card,
-        u.duty
+        u.duty,
+        idt.investigate_table_id as idt_investigate_table_id,
+        idt.investigate_disposition_id as idt_investigate_disposition_id,
+        idt.url as idt_url,
+        idt.title as idt_title,
+        idt.content as idt_content
         FROM
         investigate_table t
         left join investigate_user u on t.investigate_table_id = u.investigate_id
+        left join investigate_disposition_table idt on idt.investigate_table_id = t.investigate_table_id
         <where>
             <if test="investigateName != null  and investigateName != ''">and t.investigate_name like concat('%',
                 #{investigateName}, '%')
@@ -85,23 +93,31 @@
     </select>
 
     <select id="selectInvestigateTableById" parameterType="Long" resultMap="InvestigateTableResult">
-        SELECT t.investigate_table_id,
-               t.investigate_name,
-               t.content,
-               t.end_time,
-               t.CIPHER,
-               t.create_by,
-               t.create_time,
-               t.update_by,
-               t.update_time,
-               u.id,
-               u.investigate_id,
-               u.user_name,
-               u.phonenumber,
-               u.id_card,
-               u.duty
-        FROM investigate_table t
-                 left join investigate_user u on t.investigate_table_id = u.investigate_id
+        SELECT
+            t.investigate_table_id,
+            t.investigate_name,
+            t.content,
+            t.end_time,
+            t.CIPHER,
+            t.create_by,
+            t.create_time,
+            t.update_by,
+            t.update_time,
+            u.id,
+            u.investigate_id,
+            u.user_name,
+            u.phonenumber,
+            u.id_card,
+            u.duty,
+            idt.investigate_table_id as idt_investigate_table_id,
+            idt.investigate_disposition_id as idt_investigate_disposition_id,
+            idt.url as idt_url,
+            idt.title as idt_title,
+            idt.content as idt_content
+        FROM
+            investigate_table t
+                left join investigate_user u on t.investigate_table_id = u.investigate_id
+                left join investigate_disposition_table idt on idt.investigate_table_id = t.investigate_table_id
         where t.investigate_table_id = #{investigateTableId}
     </select>