ソースを参照

feat:新增表单组逻辑,共通按钮增加表单类型,以及其他共通sqlbug修复

韩帛霖 1 年間 前
コミット
4a12d58927

+ 114 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/dragForm/DragFormGroupController.java

@@ -0,0 +1,114 @@
+package com.zkqy.web.controller.dragForm;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.system.entity.DragFormGroup;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.system.service.IDragFormGroupService;
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * 动态表单组Controller
+ *
+ * @author hzh
+ * @date 2024-01-26
+ */
+@RestController
+@RequestMapping("/system/formGroup")
+@Api(value = "/system/formGroup", description = "动态表单组-接口")
+public class DragFormGroupController extends BaseController
+{
+    @Autowired
+    private IDragFormGroupService dragFormGroupService;
+
+/**
+ * 查询动态表单组列表
+ */
+//@PreAuthorize("@ss.hasPermi('system:formGroup:list')")
+@GetMapping("/list")
+@ApiOperation(value = "查询动态表单组列表")
+    public TableDataInfo list(DragFormGroup dragFormGroup)
+    {
+        startPage();
+        List<DragFormGroup> list = dragFormGroupService.selectDragFormGroupList(dragFormGroup);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出动态表单组列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:formGroup:export')")
+    @Log(title = "动态表单组", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ApiOperation(value = "导出动态表单组列表")
+    public void export(HttpServletResponse response, DragFormGroup dragFormGroup)
+    {
+        List<DragFormGroup> list = dragFormGroupService.selectDragFormGroupList(dragFormGroup);
+        ExcelUtil<DragFormGroup> util = new ExcelUtil<DragFormGroup>(DragFormGroup.class);
+        util.exportExcel(response, list, "动态表单组数据");
+    }
+
+    /**
+     * 获取动态表单组详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('system:formGroup:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation(value = "获取动态表单组详细信息")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(dragFormGroupService.selectDragFormGroupById(id));
+    }
+
+    /**
+     * 新增动态表单组
+     */
+//    @PreAuthorize("@ss.hasPermi('system:formGroup:add')")
+    @Log(title = "动态表单组", businessType = BusinessType.INSERT)
+    @PostMapping
+    @ApiOperation(value = "新增动态表单组")
+    public AjaxResult add(@RequestBody DragFormGroup dragFormGroup)
+    {
+        return toAjax(dragFormGroupService.insertDragFormGroup(dragFormGroup));
+    }
+
+    /**
+     * 修改动态表单组
+     */
+//    @PreAuthorize("@ss.hasPermi('system:formGroup:edit')")
+    @Log(title = "动态表单组", businessType = BusinessType.UPDATE)
+    @PutMapping
+    @ApiOperation(value = "修改动态表单组")
+    public AjaxResult edit(@RequestBody DragFormGroup dragFormGroup)
+    {
+        return toAjax(dragFormGroupService.updateDragFormGroup(dragFormGroup));
+    }
+
+    /**
+     * 删除动态表单组
+     */
+//    @PreAuthorize("@ss.hasPermi('system:formGroup:remove')")
+    @Log(title = "动态表单组", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    @ApiOperation(value = "删除动态表单组")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(dragFormGroupService.deleteDragFormGroupByIds(ids));
+    }
+}

+ 5 - 5
zkqy-admin/src/main/resources/application.yml

@@ -2,14 +2,14 @@
 zkqy:
   # 名称
   name: zkqy
-  # 版本
+  # 版本`
   version: 3.8.5
   # 版权年份
   copyrightYear: 2023
   # 实例演示开关
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/zkqy/uploadPath,Linux配置 /home/zkqy/uploadPath)
-  profile: /Users/zrwj/Desktop/ZKQY_LJJ/log
+  profile: C:/log
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证
@@ -46,7 +46,7 @@ logging:
     # 指定日志文件的输出目录
     # 此处将所有生成的日志文件存储在D:/rz/logs路径下(日志文件必须名为)
     # logback-spring.xml中可以读取这个配置项(注意:日志配置文件必须叫logback-spring.xml)
-    path: D:/logs
+    path: C:/log
 
 # 用户配置
 user:
@@ -92,7 +92,7 @@ spring:
     # 端口,默认为6379
     port: 6379
     # 数据库索引
-    database: 11
+    database: 5
     # 密码
     password:
     # 连接超时时间
@@ -115,7 +115,7 @@ token:
   # 令牌密钥
   secret: abcdefghijklmnopqrstuvwxyz
   # 令牌有效期(默认30分钟)
-  expireTime: 30
+  expireTime: 300
 
 # MyBatis配置
 mybatis:

+ 142 - 0
zkqy-system/src/main/java/com/zkqy/system/entity/DragFormGroup.java

@@ -0,0 +1,142 @@
+package com.zkqy.system.entity;
+
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * 动态单组对象 drag_form_group
+ * 
+ * @author hzh
+ * @date 2024-01-26
+ */
+public class DragFormGroup extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 表单组Key */
+    @Excel(name = "表单组Key")
+    private String groupKey;
+
+    /** 动态组名称 */
+    @Excel(name = "动态组名称")
+    private String fGName;
+
+    /** 当前表单组中所绑定的表单 */
+    @Excel(name = "当前表单组中所绑定的表单")
+    private String formKeys;
+
+    /** 表单组主表名称(tableName:formKey) */
+    @Excel(name = "表单组主表名称", readConverterExp = "t=ableName:formKey")
+    private String mainTable;
+
+    /** 各个表单之间的关系 */
+    @Excel(name = "各个表单之间的关系")
+    private String relationJson;
+
+    /** 回显数据sql */
+    @Excel(name = "回显数据sql")
+    private String showDataSql;
+
+
+    /** 逻辑删除 */
+    private String delFlag;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setGroupKey(String groupKey) 
+    {
+        this.groupKey = groupKey;
+    }
+
+    public String getGroupKey() 
+    {
+        return groupKey;
+    }
+    public void setfGName(String fGName) 
+    {
+        this.fGName = fGName;
+    }
+
+    public String getfGName() 
+    {
+        return fGName;
+    }
+    public void setFormKeys(String formKeys) 
+    {
+        this.formKeys = formKeys;
+    }
+
+    public String getFormKeys() 
+    {
+        return formKeys;
+    }
+    public void setMainTable(String mainTable) 
+    {
+        this.mainTable = mainTable;
+    }
+
+    public String getMainTable() 
+    {
+        return mainTable;
+    }
+    public void setRelationJson(String relationJson) 
+    {
+        this.relationJson = relationJson;
+    }
+
+    public String getRelationJson() 
+    {
+        return relationJson;
+    }
+    public void setShowDataSql(String showDataSql) 
+    {
+        this.showDataSql = showDataSql;
+    }
+
+    public String getShowDataSql() 
+    {
+        return showDataSql;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("groupKey", getGroupKey())
+            .append("fGName", getfGName())
+            .append("remark", getRemark())
+            .append("formKeys", getFormKeys())
+            .append("mainTable", getMainTable())
+            .append("relationJson", getRelationJson())
+            .append("showDataSql", getShowDataSql())
+            .append("updateTime", getUpdateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateById", getUpdateById())
+            .append("createTime", getCreateTime())
+            .append("createById", getCreateById())
+            .append("createBy", getCreateBy())
+            .append("delFlag", getDelFlag())
+            .toString();
+    }
+}

+ 105 - 53
zkqy-system/src/main/java/com/zkqy/system/entity/DragTableBtn.java

@@ -9,78 +9,123 @@ import java.util.List;
 
 /**
  * 格绑定的自定义按钮对象 drag_table_btn
- * 
+ *
  * @author zkqy
  * @date 2023-11-07
  */
-public class DragTableBtn extends BaseEntity
-{
+public class DragTableBtn extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    /**
+     * 主键
+     */
     private Long id;
 
-    /** 父级ID */
+    /**
+     * 父级ID
+     */
     private Long btnParentId;
 
-    /** 祖籍列表 */
+    /**
+     * 祖籍列表
+     */
     private String ancestorsId;
 
-    /** 按钮别名 */
+    /**
+     * 按钮别名
+     */
     private String btnKey;
 
-    /** 按钮组名称 */
+    /**
+     * 按钮组名称
+     */
     private String btnGroupName;
 
-    /** 按钮名称 */
+    /**
+     * 按钮名称
+     */
     private String btnName;
 
-    /** 按钮类型(0:操作按钮,1,其他,2表单,3跳转,4流程,5脚本,6目录) */
+    /**
+     * 按钮类型(0:操作按钮,1,其他,2表单,3跳转,4流程,5脚本,6目录)
+     */
     private String btnType;
 
-    /** 按钮图标 */
+    /**
+     * 按钮图标
+     */
     private String btnIcon;
 
-    /** 表单唯一标识 */
+    /**
+     * 表单唯一标识
+     */
     private String btnFormKey;
-
-    /** 流程唯一标识 */
+    /**
+     * 表单唯一标识
+     */
+    private String btnFormType;
+
+    /**
+     * 流程唯一标识
+     */
     private String btnProcessKey;
 
-    /** 表格唯一标识 */
+    /**
+     * 表格唯一标识
+     */
     private String btnTableKey;
 
-    /** 脚本唯一标识 */
+    /**
+     * 脚本唯一标识
+     */
     private String btnScriptKey;
 
-    /** 脚本唯一标识 */
+    /**
+     * 脚本唯一标识
+     */
     private String btnTableFormGroupKey;
 
-    /** 按钮显示条件 */
+    /**
+     * 按钮显示条件
+     */
     private String btnShowCondition;
 
-    /** 操作参数 */
+    /**
+     * 操作参数
+     */
     private String btnParams;
 
-    /** 权限字符 */
+    /**
+     * 权限字符
+     */
     private String btnHasPermi;
 
-    /** 按钮顺序 */
+    /**
+     * 按钮顺序
+     */
     private Long btnSort;
 
-    /** 删除标志(0:否;1:是) */
+    /**
+     * 删除标志(0:否;1:是)
+     */
     private String delFlag;
 
-    /** 创建者ID */
+    /**
+     * 创建者ID
+     */
     private Long createById;
 
-    /** 更新者ID */
+    /**
+     * 更新者ID
+     */
     private Long updateById;
 
     // 按钮是否被绑定
     private Boolean whetherBind = false;
 
-    /** 子菜单 */
+    /**
+     * 子菜单
+     */
     private List<DragTableBtn> children = new ArrayList<DragTableBtn>();
 
     public Long getId() {
@@ -263,35 +308,42 @@ public class DragTableBtn extends BaseEntity
         this.whetherBind = whetherBind;
     }
 
+
+    public String getBtnFormType() {
+        return btnFormType;
+    }
+
+    public void setBtnFormType(String btnFormType) {
+        this.btnFormType = btnFormType;
+    }
+
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("btnParentId", getBtnParentId())
-            .append("ancestorsId",getAncestorsId())
-            .append("btnKey", getBtnKey())
-            .append("btnName", getBtnName())
-            .append("btnType", getBtnType())
-            .append("btnFormKey", getBtnFormKey())
-            .append("btnProcessKey", getBtnProcessKey())
-            .append("btnTableKey", getBtnTableKey())
-            .append("btnScriptKey", getBtnScriptKey())
-            .append("btnTableFormGroupKey", getBtnTableFormGroupKey())
-            .append("btnShowCondition", getBtnShowCondition())
-            .append("btnParams", getBtnParams())
-            .append("btnHasPermi", getBtnHasPermi())
-            .append("btnSort", getBtnSort())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createById", getCreateById())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateById", getUpdateById())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .append("children",getChildren())
-            .append("btnGroupName",getBtnGroupName())
-            .append("btnIcon",getBtnIcon())
-            .toString();
+        final StringBuilder sb = new StringBuilder("DragTableBtn{");
+        sb.append("id=").append(id);
+        sb.append(", btnParentId=").append(btnParentId);
+        sb.append(", ancestorsId='").append(ancestorsId).append('\'');
+        sb.append(", btnKey='").append(btnKey).append('\'');
+        sb.append(", btnGroupName='").append(btnGroupName).append('\'');
+        sb.append(", btnName='").append(btnName).append('\'');
+        sb.append(", btnType='").append(btnType).append('\'');
+        sb.append(", btnIcon='").append(btnIcon).append('\'');
+        sb.append(", btnFormKey='").append(btnFormKey).append('\'');
+        sb.append(", btnFormType='").append(btnFormType).append('\'');
+        sb.append(", btnProcessKey='").append(btnProcessKey).append('\'');
+        sb.append(", btnTableKey='").append(btnTableKey).append('\'');
+        sb.append(", btnScriptKey='").append(btnScriptKey).append('\'');
+        sb.append(", btnTableFormGroupKey='").append(btnTableFormGroupKey).append('\'');
+        sb.append(", btnShowCondition='").append(btnShowCondition).append('\'');
+        sb.append(", btnParams='").append(btnParams).append('\'');
+        sb.append(", btnHasPermi='").append(btnHasPermi).append('\'');
+        sb.append(", btnSort=").append(btnSort);
+        sb.append(", delFlag='").append(delFlag).append('\'');
+        sb.append(", createById=").append(createById);
+        sb.append(", updateById=").append(updateById);
+        sb.append(", whetherBind=").append(whetherBind);
+        sb.append(", children=").append(children);
+        sb.append('}');
+        return sb.toString();
     }
 }

+ 70 - 27
zkqy-system/src/main/java/com/zkqy/system/entity/vo/DragTableVo.java

@@ -91,6 +91,10 @@ public class DragTableVo {
      * 回显数据(前端修改回显数据使用)
      */
     private String echoData;
+    /**
+     * 备用列:已启用存储动态表单查询的所有字段
+     */
+    private String spare;
 
     /**
      * 菜单编号
@@ -145,6 +149,14 @@ public class DragTableVo {
         this.tId = tId;
     }
 
+    public String getSpare() {
+        return spare;
+    }
+
+    public void setSpare(String spare) {
+        this.spare = spare;
+    }
+
     public String getDtName() {
         return dtName;
     }
@@ -369,34 +381,65 @@ public class DragTableVo {
         this.dragTableBtnRelevanceList = dragTableBtnRelevanceList;
     }
 
+    public DragTableVo(Long tId, String dtName, String dtNickname, String tableKey, String sqlKey, String dtTableName, Object dtColumnName, String dtColumnNameEcho, String timeFormat, String isSelection, List<String> searchFieldList, Map<String, Object> conditionDefaultValueMap, String tableSql, Object tableExportField, String tableExportFieldEcho, String echoData, String spare, Long menuId, String primaryKey, String orderByColumn, String sortOrder, List<DragTableStatistic> dragTableStatisticList, List<TableSql> tableSqlList, List<DragTableStyle> dragTableStyleList, List<DragTableBtn> dragTableBtnList, List<DragTableBtnRelevance> dragTableBtnRelevanceList) {
+        this.tId = tId;
+        this.dtName = dtName;
+        this.dtNickname = dtNickname;
+        this.tableKey = tableKey;
+        this.sqlKey = sqlKey;
+        this.dtTableName = dtTableName;
+        this.dtColumnName = dtColumnName;
+        this.dtColumnNameEcho = dtColumnNameEcho;
+        this.timeFormat = timeFormat;
+        this.isSelection = isSelection;
+        this.searchFieldList = searchFieldList;
+        this.conditionDefaultValueMap = conditionDefaultValueMap;
+        this.tableSql = tableSql;
+        this.tableExportField = tableExportField;
+        this.tableExportFieldEcho = tableExportFieldEcho;
+        this.echoData = echoData;
+        this.spare = spare;
+        this.menuId = menuId;
+        this.primaryKey = primaryKey;
+        this.orderByColumn = orderByColumn;
+        this.sortOrder = sortOrder;
+        this.dragTableStatisticList = dragTableStatisticList;
+        this.tableSqlList = tableSqlList;
+        this.dragTableStyleList = dragTableStyleList;
+        this.dragTableBtnList = dragTableBtnList;
+        this.dragTableBtnRelevanceList = dragTableBtnRelevanceList;
+    }
+
     @Override
     public String toString() {
-        return "DragTableVo{" +
-                "tId=" + tId +
-                ", dtName='" + dtName + '\'' +
-                ", dtNickname='" + dtNickname + '\'' +
-                ", tableKey='" + tableKey + '\'' +
-                ", sqlKey='" + sqlKey + '\'' +
-                ", dtTableName='" + dtTableName + '\'' +
-                ", dtColumnName=" + dtColumnName +
-                ", dtColumnNameEcho='" + dtColumnNameEcho + '\'' +
-                ", timeFormat='" + timeFormat + '\'' +
-                ", isSelection='" + isSelection + '\'' +
-                ", searchFieldList=" + searchFieldList +
-                ", conditionDefaultValueMap=" + conditionDefaultValueMap +
-                ", tableSql='" + tableSql + '\'' +
-                ", tableExportField=" + tableExportField +
-                ", tableExportFieldEcho='" + tableExportFieldEcho + '\'' +
-                ", echoData='" + echoData + '\'' +
-                ", menuId=" + menuId +
-                ", primaryKey='" + primaryKey + '\'' +
-                ", orderByColumn='" + orderByColumn + '\'' +
-                ", sortOrder='" + sortOrder + '\'' +
-                ", dragTableStatisticList=" + dragTableStatisticList +
-                ", tableSqlList=" + tableSqlList +
-                ", dragTableStyleList=" + dragTableStyleList +
-                ", dragTableBtnList=" + dragTableBtnList +
-                ", dragTableBtnRelevanceList=" + dragTableBtnRelevanceList +
-                '}';
+        final StringBuilder sb = new StringBuilder("DragTableVo{");
+        sb.append("tId=").append(tId);
+        sb.append(", dtName='").append(dtName).append('\'');
+        sb.append(", dtNickname='").append(dtNickname).append('\'');
+        sb.append(", tableKey='").append(tableKey).append('\'');
+        sb.append(", sqlKey='").append(sqlKey).append('\'');
+        sb.append(", dtTableName='").append(dtTableName).append('\'');
+        sb.append(", dtColumnName=").append(dtColumnName);
+        sb.append(", dtColumnNameEcho='").append(dtColumnNameEcho).append('\'');
+        sb.append(", timeFormat='").append(timeFormat).append('\'');
+        sb.append(", isSelection='").append(isSelection).append('\'');
+        sb.append(", searchFieldList=").append(searchFieldList);
+        sb.append(", conditionDefaultValueMap=").append(conditionDefaultValueMap);
+        sb.append(", tableSql='").append(tableSql).append('\'');
+        sb.append(", tableExportField=").append(tableExportField);
+        sb.append(", tableExportFieldEcho='").append(tableExportFieldEcho).append('\'');
+        sb.append(", echoData='").append(echoData).append('\'');
+        sb.append(", spare='").append(spare).append('\'');
+        sb.append(", menuId=").append(menuId);
+        sb.append(", primaryKey='").append(primaryKey).append('\'');
+        sb.append(", orderByColumn='").append(orderByColumn).append('\'');
+        sb.append(", sortOrder='").append(sortOrder).append('\'');
+        sb.append(", dragTableStatisticList=").append(dragTableStatisticList);
+        sb.append(", tableSqlList=").append(tableSqlList);
+        sb.append(", dragTableStyleList=").append(dragTableStyleList);
+        sb.append(", dragTableBtnList=").append(dragTableBtnList);
+        sb.append(", dragTableBtnRelevanceList=").append(dragTableBtnRelevanceList);
+        sb.append('}');
+        return sb.toString();
     }
 }

+ 63 - 0
zkqy-system/src/main/java/com/zkqy/system/mapper/DragFormGroupMapper.java

@@ -0,0 +1,63 @@
+package com.zkqy.system.mapper;
+
+import com.zkqy.system.entity.DragFormGroup;
+
+import java.util.List;
+
+
+/**
+ * 动态表单组Mapper接口
+ * 
+ * @author hzh
+ * @date 2024-01-26
+ */
+public interface DragFormGroupMapper 
+{
+    /**
+     * 查询动态表单组
+     * 
+     * @param id 动态表单组主键
+     * @return 动态表单组
+     */
+    public DragFormGroup selectDragFormGroupById(Long id);
+
+    /**
+     * 查询动态表单组列表
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 动态表单组集合
+     */
+    public List<DragFormGroup> selectDragFormGroupList(DragFormGroup dragFormGroup);
+
+    /**
+     * 新增动态表单组
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 结果
+     */
+    public int insertDragFormGroup(DragFormGroup dragFormGroup);
+
+    /**
+     * 修改动态表单组
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 结果
+     */
+    public int updateDragFormGroup(DragFormGroup dragFormGroup);
+
+    /**
+     * 删除动态表单组
+     * 
+     * @param id 动态表单组主键
+     * @return 结果
+     */
+    public int deleteDragFormGroupById(Long id);
+
+    /**
+     * 批量删除动态表单组
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDragFormGroupByIds(Long[] ids);
+}

+ 62 - 0
zkqy-system/src/main/java/com/zkqy/system/service/IDragFormGroupService.java

@@ -0,0 +1,62 @@
+package com.zkqy.system.service;
+
+import java.util.List;
+
+import com.zkqy.system.entity.DragFormGroup;
+
+/**
+ * 动态表单组Service接口
+ * 
+ * @author hzh
+ * @date 2024-01-26
+ */
+public interface IDragFormGroupService 
+{
+    /**
+     * 查询动态表单组
+     * 
+     * @param id 动态表单组主键
+     * @return 动态表单组
+     */
+    public DragFormGroup selectDragFormGroupById(Long id);
+
+    /**
+     * 查询动态表单组列表
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 动态表单组集合
+     */
+    public List<DragFormGroup> selectDragFormGroupList(DragFormGroup dragFormGroup);
+
+    /**
+     * 新增动态表单组
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 结果
+     */
+    public int insertDragFormGroup(DragFormGroup dragFormGroup);
+
+    /**
+     * 修改动态表单组
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 结果
+     */
+    public int updateDragFormGroup(DragFormGroup dragFormGroup);
+
+    /**
+     * 批量删除动态表单组
+     * 
+     * @param ids 需要删除的动态表单组主键集合
+     * @return 结果
+     */
+    public int deleteDragFormGroupByIds(Long[] ids);
+
+    /**
+     * 删除动态表单组信息
+     * 
+     * @param id 动态表单组主键
+     * @return 结果
+     */
+    public int deleteDragFormGroupById(Long id);
+}

+ 96 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/DragFormGroupServiceImpl.java

@@ -0,0 +1,96 @@
+package com.zkqy.system.service.impl;
+
+import java.util.List;
+import com.zkqy.common.utils.DateUtils;
+import com.zkqy.system.entity.DragFormGroup;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.zkqy.system.mapper.DragFormGroupMapper;
+import com.zkqy.system.service.IDragFormGroupService;
+
+/**
+ * 动态表单组Service业务层处理
+ * 
+ * @author hzh
+ * @date 2024-01-26
+ */
+@Service
+public class DragFormGroupServiceImpl implements IDragFormGroupService 
+{
+    @Autowired
+    private DragFormGroupMapper dragFormGroupMapper;
+
+    /**
+     * 查询动态表单组
+     * 
+     * @param id 动态表单组主键
+     * @return 动态表单组
+     */
+    @Override
+    public DragFormGroup selectDragFormGroupById(Long id)
+    {
+        return dragFormGroupMapper.selectDragFormGroupById(id);
+    }
+
+    /**
+     * 查询动态表单组列表
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 动态表单组
+     */
+    @Override
+    public List<DragFormGroup> selectDragFormGroupList(DragFormGroup dragFormGroup)
+    {
+        return dragFormGroupMapper.selectDragFormGroupList(dragFormGroup);
+    }
+
+    /**
+     * 新增动态表单组
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 结果
+     */
+    @Override
+    public int insertDragFormGroup(DragFormGroup dragFormGroup)
+    {
+        dragFormGroup.setCreateTime(DateUtils.getNowDate());
+        return dragFormGroupMapper.insertDragFormGroup(dragFormGroup);
+    }
+
+    /**
+     * 修改动态表单组
+     * 
+     * @param dragFormGroup 动态表单组
+     * @return 结果
+     */
+    @Override
+    public int updateDragFormGroup(DragFormGroup dragFormGroup)
+    {
+        dragFormGroup.setUpdateTime(DateUtils.getNowDate());
+        return dragFormGroupMapper.updateDragFormGroup(dragFormGroup);
+    }
+
+    /**
+     * 批量删除动态表单组
+     * 
+     * @param ids 需要删除的动态表单组主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragFormGroupByIds(Long[] ids)
+    {
+        return dragFormGroupMapper.deleteDragFormGroupByIds(ids);
+    }
+
+    /**
+     * 删除动态表单组信息
+     * 
+     * @param id 动态表单组主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDragFormGroupById(Long id)
+    {
+        return dragFormGroupMapper.deleteDragFormGroupById(id);
+    }
+}

+ 4 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/DragTableServiceImpl.java

@@ -365,6 +365,10 @@ public class DragTableServiceImpl implements IDragTableService {
     @Transactional
     @Override
     public void updateDragTable(DragTableVo dragTableVo) {
+        /*
+        tablename:"labe1:val1,labe2:val3,"
+        tablename1:"labe1:val1,labe2:val3,"
+         */
         String SQL = "";
         //update drag_table
         DragTable dragTable = new DragTable();

+ 132 - 0
zkqy-system/src/main/resources/mapper/dragmapper/DragFormGroupMapper.xml

@@ -0,0 +1,132 @@
+<?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.zkqy.system.mapper.DragFormGroupMapper">
+    
+    <resultMap type="com.zkqy.system.entity.DragFormGroup" id="DragFormGroupResult">
+        <result property="id"    column="id"    />
+        <result property="groupKey"    column="group_key"    />
+        <result property="fGName"    column="f_g_name"    />
+        <result property="remark"    column="remark"    />
+        <result property="formKeys"    column="form_keys"    />
+        <result property="mainTable"    column="main_table"    />
+        <result property="relationJson"    column="relation_json"    />
+        <result property="showDataSql"    column="show_data_sql"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateById"    column="update_by_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createById"    column="create_by_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="delFlag"    column="del_flag"    />
+    </resultMap>
+
+    <sql id="selectDragFormGroupVo">
+        select id,
+               group_key,
+               f_g_name,
+               remark,
+               form_keys,
+               main_table,
+               relation_json,
+               show_data_sql,
+               update_time,
+               update_by,
+               update_by_id,
+               create_time,
+               create_by_id,
+               create_by
+        from drag_form_group
+    </sql>
+
+    <select id="selectDragFormGroupList" parameterType="com.zkqy.system.entity.DragFormGroup" resultMap="DragFormGroupResult">
+        <include refid="selectDragFormGroupVo"/>
+        <where>
+            and del_flag = 0
+            <if test="groupKey != null  and groupKey != ''">and group_key = #{groupKey}</if>
+            <if test="fGName != null  and fGName != ''">and f_g_name like concat('%', #{fGName}, '%')</if>
+            <if test="formKeys != null  and formKeys != ''">and form_keys = #{formKeys}</if>
+            <if test="mainTable != null  and mainTable != ''">and main_table = #{mainTable}</if>
+            <if test="relationJson != null  and relationJson != ''">and relation_json = #{relationJson}</if>
+            <if test="showDataSql != null  and showDataSql != ''">and show_data_sql = #{showDataSql}</if>
+            <if test="updateById != null  and updateById != ''">and update_by_id = #{updateById}</if>
+            <if test="createById != null  and createById != ''">and create_by_id = #{createById}</if>
+        </where>
+    </select>
+    
+    <select id="selectDragFormGroupById" parameterType="Long" resultMap="DragFormGroupResult">
+        <include refid="selectDragFormGroupVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertDragFormGroup" parameterType="com.zkqy.system.entity.DragFormGroup" useGeneratedKeys="true" keyProperty="id">
+        insert into drag_form_group
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="groupKey != null">group_key,</if>
+            <if test="fGName != null">f_g_name,</if>
+            <if test="remark != null">remark,</if>
+            <if test="formKeys != null">form_keys,</if>
+            <if test="mainTable != null">main_table,</if>
+            <if test="relationJson != null">relation_json,</if>
+            <if test="showDataSql != null">show_data_sql,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateById != null">update_by_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createById != null">create_by_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="delFlag != null">del_flag,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="groupKey != null">#{groupKey},</if>
+            <if test="fGName != null">#{fGName},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="formKeys != null">#{formKeys},</if>
+            <if test="mainTable != null">#{mainTable},</if>
+            <if test="relationJson != null">#{relationJson},</if>
+            <if test="showDataSql != null">#{showDataSql},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateById != null">#{updateById},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createById != null">#{createById},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDragFormGroup" parameterType="com.zkqy.system.entity.DragFormGroup">
+        update drag_form_group
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="groupKey != null">group_key = #{groupKey},</if>
+            <if test="fGName != null">f_g_name = #{fGName},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="formKeys != null">form_keys = #{formKeys},</if>
+            <if test="mainTable != null">main_table = #{mainTable},</if>
+            <if test="relationJson != null">relation_json = #{relationJson},</if>
+            <if test="showDataSql != null">show_data_sql = #{showDataSql},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDragFormGroupById" parameterType="Long">
+        update {DBNAME}.drag_form_group
+        set del_flag = 2 where id = #{id}
+    </delete>
+
+    <delete id="deleteDragFormGroupByIds" parameterType="String">
+        update {DBNAME}.drag_form_group
+        set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 2 - 2
zkqy-system/src/main/resources/mapper/dragmapper/DragFormMapper.xml

@@ -153,13 +153,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <delete id="deleteDragFormByFId" parameterType="Long">
         update {DBNAME}.drag_form
-        set del_flag = 1
+        set del_flag = 2
         where f_id = #{fId}
     </delete>
 
     <delete id="deleteDragFormByFIds" parameterType="String">
         update {DBNAME}.drag_form
-        set del_flag = 1 where f_id in
+        set del_flag = 2 where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>

+ 31 - 21
zkqy-system/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zkqy.system.mapper.DragTableBtnMapper">
-    
+
     <resultMap type="com.zkqy.system.entity.DragTableBtn" id="DragTableBtnResult">
         <result property="id"    column="id"    />
         <result property="btnParentId"    column="btn_parent_id"    />
@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="btnType"    column="btn_type"    />
         <result property="btnIcon" column="btn_icon"/>
         <result property="btnFormKey"    column="btn_form_key"    />
+        <result property="btnFormType"    column="btn_form_type"    />
         <result property="btnProcessKey"    column="btn_process_key"    />
         <result property="btnTableKey"    column="btn_table_key"    />
         <result property="btnScriptKey"    column="btn_script_key"    />
@@ -32,36 +33,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectDragTableBtnVo">
-        select id, btn_parent_id,ancestors_id, btn_key,btn_group_name, btn_name, btn_type,btn_icon, btn_form_key, btn_process_key, btn_table_key, btn_script_key,btn_table_form_group_key,btn_show_condition, btn_params, btn_has_permi, btn_sort, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, remark from drag_table_btn
+        select id, btn_parent_id,ancestors_id, btn_key,btn_group_name, btn_name, btn_type,btn_icon, btn_form_key, btn_form_type,btn_process_key, btn_table_key, btn_script_key,btn_table_form_group_key,btn_show_condition, btn_params, btn_has_permi, btn_sort, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, remark from drag_table_btn
     </sql>
 
     <select id="selectDragTableBtnList" parameterType="com.zkqy.system.entity.DragTableBtn" resultMap="DragTableBtnResult">
         <include refid="selectDragTableBtnVo"/>
         where del_flag = '0'
-            <if test="btnParentId != null "> and btn_parent_id = #{btnParentId}</if>
-            <if test="btnKey != null  and btnKey != ''"> and btn_key = #{btnKey}</if>
-            <if test="btnGroupName != null  and btnGroupName != ''"> and btn_group_name like concat('%', #{btnGroupName}, '%')</if>
-            <if test="btnName != null  and btnName != ''"> and btn_name like concat('%', #{btnName}, '%')</if>
-            <if test="btnType != null  and btnType != ''"> and btn_type = #{btnType}</if>
-            <if test="btnFormKey != null  and btnFormKey != ''"> and btn_form_key = #{btnFormKey}</if>
-            <if test="btnProcessKey != null  and btnProcessKey != ''"> and btn_process_key = #{btnProcessKey}</if>
-            <if test="btnTableFormGroupKey !=null and btnTableFormGroupKey!=''">and btn_table_form_group_key=#{btnTableFormGroupKey}</if>
-            <if test="btnTableKey != null  and btnTableKey != ''"> and btn_table_key = #{btnTableKey}</if>
-            <if test="btnScriptKey != null  and btnScriptKey != ''"> and btn_script_key = #{btnScriptKey}</if>
-            <if test="btnShowCondition != null  and btnShowCondition != ''"> and btn_show_condition = #{btnShowCondition}</if>
-            <if test="btnParams != null  and btnParams != ''"> and btn_params = #{btnParams}</if>
-            <if test="btnHasPermi != null  and btnHasPermi != ''"> and btn_has_permi = #{btnHasPermi}</if>
-            <if test="btnSort != null "> and btn_sort = #{btnSort}</if>
-            <if test="createById != null "> and create_by_id = #{createById}</if>
-            <if test="updateById != null "> and update_by_id = #{updateById}</if>
-             order by btn_sort asc
+        <if test="btnParentId != null ">and btn_parent_id = #{btnParentId}</if>
+        <if test="btnKey != null  and btnKey != ''">and btn_key = #{btnKey}</if>
+        <if test="btnGroupName != null  and btnGroupName != ''">and btn_group_name like concat('%', #{btnGroupName},
+            '%')
+        </if>
+        <if test="btnName != null  and btnName != ''">and btn_name like concat('%', #{btnName}, '%')</if>
+        <if test="btnType != null  and btnType != ''">and btn_type = #{btnType}</if>
+        <if test="btnFormKey != null  and btnFormKey != ''">and btn_form_key = #{btnFormKey}</if>
+        <if test="btnFormType != null  and btnFormType != ''">and btn_form_type = #{btnFormType}</if>
+        <if test="btnProcessKey != null  and btnProcessKey != ''">and btn_process_key = #{btnProcessKey}</if>
+        <if test="btnTableFormGroupKey !=null and btnTableFormGroupKey!=''">and
+            btn_table_form_group_key=#{btnTableFormGroupKey}
+        </if>
+        <if test="btnTableKey != null  and btnTableKey != ''">and btn_table_key = #{btnTableKey}</if>
+        <if test="btnScriptKey != null  and btnScriptKey != ''">and btn_script_key = #{btnScriptKey}</if>
+        <if test="btnShowCondition != null  and btnShowCondition != ''">and btn_show_condition = #{btnShowCondition}
+        </if>
+        <if test="btnParams != null  and btnParams != ''">and btn_params = #{btnParams}</if>
+        <if test="btnHasPermi != null  and btnHasPermi != ''">and btn_has_permi = #{btnHasPermi}</if>
+        <if test="btnSort != null ">and btn_sort = #{btnSort}</if>
+        <if test="createById != null ">and create_by_id = #{createById}</if>
+        <if test="updateById != null ">and update_by_id = #{updateById}</if>
+        order by btn_sort asc
     </select>
-    
+
     <select id="selectDragTableBtnById" parameterType="Long" resultMap="DragTableBtnResult">
         <include refid="selectDragTableBtnVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertDragTableBtn" parameterType="com.zkqy.system.entity.DragTableBtn">
         insert into drag_table_btn
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -73,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">btn_type,</if>
             <if test="btnIcon != null">btn_icon,</if>
             <if test="btnFormKey != null">btn_form_key,</if>
+            <if test="btnFormType != null">btn_form_type,</if>
             <if test="btnProcessKey != null">btn_process_key,</if>
             <if test="btnTableKey != null">btn_table_key,</if>
             <if test="btnScriptKey != null">btn_script_key,</if>
@@ -95,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">#{btnType},</if>
             <if test="btnIcon != null">#{btnIcon},</if>
             <if test="btnFormKey != null">#{btnFormKey},</if>
+            <if test="btnFormType != null">#{btnFormType},</if>
             <if test="btnProcessKey != null">#{btnProcessKey},</if>
             <if test="btnTableKey != null">#{btnTableKey},</if>
             <if test="btnScriptKey != null">#{btnScriptKey},</if>
@@ -121,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">btn_type = #{btnType},</if>
             <if test="btnIcon != null">btn_icon = #{btnIcon},</if>
             <if test="btnFormKey != null">btn_form_key = #{btnFormKey},</if>
+            <if test="btnFormType != null">btn_form_type = #{btnFormType},</if>
             <if test="btnProcessKey != null">btn_process_key = #{btnProcessKey},</if>
             <if test="btnTableKey != null">btn_table_key = #{btnTableKey},</if>
             <if test="btnScriptKey != null">btn_script_key = #{btnScriptKey},</if>

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

@@ -158,14 +158,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteDragTableByTIds" parameterType="String">
-        delete from {DBNAME}.drag_table where t_id in
+        update  {DBNAME}.drag_table set del_flag = '2' where t_id in
         <foreach item="tId" collection="list" open="(" separator="," close=")">
             #{tId}
         </foreach>
     </delete>
 
     <delete id="deleteDragTableByTableKeys" parameterType="list" >
-        delete from {DBNAME}.drag_table where table_key in
+        update {DBNAME}.drag_table set del_flag = '2' where table_key in
         <foreach item="tableKey" collection="list" open="(" separator="," close=")">
             #{tableKey}
         </foreach>