Эх сурвалжийг харах

fix:弹窗表格组添加

侯茂昌 1 жил өмнө
parent
commit
877ccf1d2f

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableController.java

@@ -125,6 +125,8 @@ public class DragTableController extends BaseController {
         return success(dragTableService.selectDragTableVoByTId(tId));
     }
 
+
+
     /**
      * 修改动态表格
      */

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/dragForm/DragTableGroupController.java

@@ -94,6 +94,7 @@ public class DragTableGroupController extends BaseController {
     }
 
 
+
     /**
      * 新增拖拽格组
      */
@@ -105,6 +106,19 @@ public class DragTableGroupController extends BaseController {
         return toAjax(dragTableGroupService.insertDragTableGroup(dragTableGroupVo));
     }
 
+    /**
+     * 新增配置表格组
+     */
+    @Log(title = "新增配置组", businessType = BusinessType.INSERT)
+    @PostMapping("/addConfigurationGroup")
+    @ApiOperation(value = "新增拖拽格组")
+    public AjaxResult addConfigurationGroup(@RequestBody DragTableGroupVo dragTableGroupVo)
+    {
+        return toAjax(dragTableGroupService.insertDragTableConfigurationGroup(dragTableGroupVo));
+    }
+
+
+
     /**
      * 修改拖拽格组
      */

+ 14 - 0
ruoyi-system/src/main/java/com/ruoyi/system/entity/vo/DragTableGroupVo.java

@@ -1,4 +1,5 @@
 package com.ruoyi.system.entity.vo;
+import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
 
 import java.util.List;
@@ -26,6 +27,12 @@ public class DragTableGroupVo extends BaseEntity {
      */
     private  String groupKey;
 
+    /** 表格组类型 */
+    @Excel(name = "表格组key")
+    private String groupType;
+
+
+
     //动态表格实体类集合
     public List<DragTableVo> dragTables;
 
@@ -77,6 +84,13 @@ public class DragTableGroupVo extends BaseEntity {
         this.groupKey = groupKey;
     }
 
+    public String getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(String groupType) {
+        this.groupType = groupType;
+    }
     @Override
     public String toString() {
         return "DragTableGroupVo{" +

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IDragTableGroupService.java

@@ -36,6 +36,13 @@ public interface IDragTableGroupService {
      */
     public int insertDragTableGroup(DragTableGroupVo dragTableGroupVo);
 
+    /**
+     * 新增拖拽配置组
+     * @param dragTableGroupVo
+     * @return
+     */
+    public int insertDragTableConfigurationGroup(DragTableGroupVo dragTableGroupVo);
+
     /**
      * 修改拖拽格组
      *

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CommonServiceImpl.java

@@ -98,6 +98,9 @@ public class CommonServiceImpl implements ICommonService {
         fields.keySet().forEach(item -> {
             endfields.put(toUnderScoreCase(item), fields.get(item));
         });
+        endfields.put("update_time", DateUtils.getTime());
+        endfields.put("update_by", SecurityUtils.getUsername());
+        endfields.put("update_by_id", String.valueOf(SecurityUtils.getUserId()));
         return commonMapper.edit(endfields, tableName, conditions);
     }
 

+ 17 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableGroupServiceImpl.java

@@ -88,9 +88,26 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
         BeanUtils.copyProperties(dragTableGroupVo,dragTableGroup);
         //添加动态表格列表
         dragTableService.addDragTable(dragTableGroupVo);
+        //默认添加的是联动表格
+        dragTableGroup.setGroupType("0");
         return dragTableGroupMapper.insertDragTableGroup(dragTableGroup);
     }
 
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int insertDragTableConfigurationGroup(DragTableGroupVo dragTableGroupVo)
+    {
+        //表格组实体类拷贝数据
+        DragTableGroup dragTableGroup=new DragTableGroup();
+        BeanUtils.copyProperties(dragTableGroupVo,dragTableGroup);
+        //添加动态表格列表
+        dragTableService.addDragTable(dragTableGroupVo);
+        dragTableGroup.setGroupType("1");
+        return dragTableGroupMapper.insertDragTableGroup(dragTableGroup);
+    }
+
+
     // SQL 条件的开始
     public static final String SQL_START = "CONCAT(";
 

+ 9 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableServiceImpl.java

@@ -63,6 +63,9 @@ public class DragTableServiceImpl implements IDragTableService {
     @Resource
     private DragTableBtnRelevanceMapper dragTableBtnRelevanceMapper;
 
+    @Resource
+    private DragTableBtnRelevanceServiceImpl dragTableBtnRelevanceService;
+
     /**
      * 查询动态表格
      *
@@ -207,6 +210,7 @@ public class DragTableServiceImpl implements IDragTableService {
     // SQL 条件的结束
     public static final String SQL_END = "LIKE '%#{val}%'";
 
+    //单个表格添加的逻辑
     @Transactional
     @Override
     public void addDragTable(DragTableVo dragTableVo) {
@@ -268,6 +272,7 @@ public class DragTableServiceImpl implements IDragTableService {
         }
     }
 
+    //表格组添加表格的逻辑
     @Transactional
     @Override
     public void addDragTable(DragTableGroupVo dragTableGroupVo) {
@@ -323,10 +328,13 @@ public class DragTableServiceImpl implements IDragTableService {
                     });
                     dragTableConditionMapper.insertDragTableConditionByList(dragTableConditionList);
             }
+            //给表格增加按钮
+            if(dragTableVo.getDragTableBtnRelevanceList()!=null){
+                dragTableBtnRelevanceService.batchInsertDragTableBtnRelevance(dragTableVo.getDragTableBtnRelevanceList());
+            }
         }
     }
 
-
     @Override
     public DragTableVo selectDragTableVoByTId(Long tId) {
         DragTableVo vo = dragTableMapper.selectDragTableVoByTId(tId);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 27 - 13
ruoyi-system/src/main/java/com/ruoyi/system/test/ljj.java


+ 2 - 0
ruoyi-system/src/main/resources/mapper/dragmapper/DragTableMapper.xml

@@ -83,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dtNickname != null">dt_nickname,</if>
             <if test="tableKey != null">table_key,</if>
             <if test="sqlKey != null">sql_key,</if>
+            <if test="dtType != null">dt_type,</if>
             <if test="dtTableName != null">dt_table_name,</if>
             <if test="dtNotes != null">dt_notes,</if>
             <if test="dtColumnName != null">dt_column_name,</if>
@@ -103,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dtNickname != null">#{dtNickname},</if>
             <if test="tableKey != null">#{tableKey},</if>
             <if test="sqlKey != null">#{sqlKey},</if>
+            <if test="dtType != null">#{dtType},</if>
             <if test="dtTableName != null">#{dtTableName},</if>
             <if test="dtNotes != null">#{dtNotes},</if>
             <if test="dtColumnName != null">#{dtColumnName},</if>

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно