From bae537fe0aedbef2c3610d067d38d53f0b3efb5b Mon Sep 17 00:00:00 2001 From: xce Date: Wed, 24 Dec 2025 04:13:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agri-admin/src/main/resources/application.yml | 2 +- .../com/agri/common/enums/BusinessType.java | 5 ++ .../generator/controller/GenController.java | 47 ++++++++++--------- .../main/resources/vm/vue/index-tree.vue.vm | 33 ++++++------- .../src/main/resources/vm/vue/index.vue.vm | 34 +++++++------- .../resources/vm/vue/v3/index-tree.vue.vm | 33 ++++++------- .../src/main/resources/vm/vue/v3/index.vue.vm | 34 +++++++------- 7 files changed, 98 insertions(+), 90 deletions(-) diff --git a/agri-admin/src/main/resources/application.yml b/agri-admin/src/main/resources/application.yml index 025c237..b8cd14d 100644 --- a/agri-admin/src/main/resources/application.yml +++ b/agri-admin/src/main/resources/application.yml @@ -9,7 +9,7 @@ agri: # 文件路径 示例( Windows配置D:/agri/uploadPath,Linux配置 /home/agri/uploadPath) profile: D:/agri/uploadPath # 获取ip地址开关 - addressEnabled: false + addressEnabled: true # 验证码类型 math 数字计算 char 字符验证 captchaType: math # 开启增强 diff --git a/agri-common/src/main/java/com/agri/common/enums/BusinessType.java b/agri-common/src/main/java/com/agri/common/enums/BusinessType.java index 87e24c9..e93128b 100644 --- a/agri-common/src/main/java/com/agri/common/enums/BusinessType.java +++ b/agri-common/src/main/java/com/agri/common/enums/BusinessType.java @@ -56,4 +56,9 @@ public enum BusinessType * 清空数据 */ CLEAN, + + /** + * 查询数据 + */ + SELECT, } diff --git a/agri-generator/src/main/java/com/agri/generator/controller/GenController.java b/agri-generator/src/main/java/com/agri/generator/controller/GenController.java index 3c892c5..4a2ea7e 100644 --- a/agri-generator/src/main/java/com/agri/generator/controller/GenController.java +++ b/agri-generator/src/main/java/com/agri/generator/controller/GenController.java @@ -1,27 +1,5 @@ package com.agri.generator.controller; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.servlet.http.HttpServletResponse; -import org.apache.commons.io.IOUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.alibaba.druid.DbType; -import com.alibaba.druid.sql.SQLUtils; -import com.alibaba.druid.sql.ast.SQLStatement; -import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement; import com.agri.common.annotation.Log; import com.agri.common.core.controller.BaseController; import com.agri.common.core.domain.AjaxResult; @@ -35,6 +13,29 @@ import com.agri.generator.domain.GenTable; import com.agri.generator.domain.GenTableColumn; import com.agri.generator.service.IGenTableColumnService; import com.agri.generator.service.IGenTableService; +import com.alibaba.druid.DbType; +import com.alibaba.druid.sql.SQLUtils; +import com.alibaba.druid.sql.ast.SQLStatement; +import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCreateTableStatement; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * 代码生成 操作处理 @@ -125,7 +126,7 @@ public class GenController extends BaseController * 创建表结构(保存) */ @PreAuthorize("@ss.hasRole('admin')") - @Log(title = "创建表", businessType = BusinessType.OTHER) + @Log(title = "创建表", businessType = BusinessType.INSERT) @PostMapping("/createTable") public AjaxResult createTableSave(String sql) { diff --git a/agri-generator/src/main/resources/vm/vue/index-tree.vue.vm b/agri-generator/src/main/resources/vm/vue/index-tree.vue.vm index 4e35fc9..6f15882 100644 --- a/agri-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/agri-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -14,7 +14,7 @@ #if($column.htmlType == "input") #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) - + #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) - + #elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") @@ -93,6 +93,7 @@ #elseif($column.htmlType == "input") - + #elseif($column.htmlType == "imageUpload") - + #elseif($column.htmlType == "fileUpload") - + #elseif($column.htmlType == "editor") - + #elseif($column.htmlType == "select" && "" != $dictType) - + #elseif($column.htmlType == "select" && $dictType) - + #elseif($column.htmlType == "checkbox" && "" != $dictType) - + #elseif($column.htmlType == "checkbox" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "radio" && "" != $dictType) - + #elseif($column.htmlType == "radio" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "datetime") @@ -267,7 +268,7 @@ #elseif($column.htmlType == "textarea") - + #end #end diff --git a/agri-generator/src/main/resources/vm/vue/index.vue.vm b/agri-generator/src/main/resources/vm/vue/index.vue.vm index 04ebe16..205d888 100644 --- a/agri-generator/src/main/resources/vm/vue/index.vue.vm +++ b/agri-generator/src/main/resources/vm/vue/index.vue.vm @@ -14,7 +14,7 @@ #if($column.htmlType == "input") #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) - + #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) - + #elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") @@ -113,7 +113,7 @@ - + #foreach($column in $columns) #set($javaField=$column.javaField) @@ -195,23 +195,23 @@ #set($dictType=$column.dictType) #if($column.htmlType == "input") - + #elseif($column.htmlType == "imageUpload") - + #elseif($column.htmlType == "fileUpload") - + #elseif($column.htmlType == "editor") - + #elseif($column.htmlType == "select" && "" != $dictType) - + #elseif($column.htmlType == "select" && $dictType) - + #elseif($column.htmlType == "checkbox" && "" != $dictType) - + #elseif($column.htmlType == "checkbox" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "radio" && "" != $dictType) - + #elseif($column.htmlType == "radio" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "datetime") @@ -278,7 +278,7 @@ #elseif($column.htmlType == "textarea") - + #end #end diff --git a/agri-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/agri-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm index fabd921..6903aab 100644 --- a/agri-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/agri-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -14,7 +14,7 @@ #if($column.htmlType == "input") #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) - + #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) - + #elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") @@ -90,6 +90,7 @@ #elseif($column.htmlType == "input") - + #elseif($column.htmlType == "imageUpload") - + #elseif($column.htmlType == "fileUpload") - + #elseif($column.htmlType == "editor") - + #elseif($column.htmlType == "select" && "" != $dictType) - + #elseif($column.htmlType == "select" && $dictType) - + #elseif($column.htmlType == "checkbox" && "" != $dictType) - + #elseif($column.htmlType == "checkbox" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "radio" && "" != $dictType) - + #elseif($column.htmlType == "radio" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "datetime") @@ -253,7 +254,7 @@ #elseif($column.htmlType == "textarea") - + #end #end diff --git a/agri-generator/src/main/resources/vm/vue/v3/index.vue.vm b/agri-generator/src/main/resources/vm/vue/v3/index.vue.vm index 1a9c517..4fbf0c1 100644 --- a/agri-generator/src/main/resources/vm/vue/v3/index.vue.vm +++ b/agri-generator/src/main/resources/vm/vue/v3/index.vue.vm @@ -14,7 +14,7 @@ #if($column.htmlType == "input") #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) - + #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType) - + #elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") @@ -108,7 +108,7 @@ - + #foreach($column in $columns) #set($javaField=$column.javaField) @@ -178,23 +178,23 @@ #set($dictType=$column.dictType) #if($column.htmlType == "input") - + #elseif($column.htmlType == "imageUpload") - + #elseif($column.htmlType == "fileUpload") - + #elseif($column.htmlType == "editor") - + #elseif($column.htmlType == "select" && "" != $dictType) - + #elseif($column.htmlType == "select" && $dictType) - + #elseif($column.htmlType == "checkbox" && "" != $dictType) - + #elseif($column.htmlType == "checkbox" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "radio" && "" != $dictType) - + #elseif($column.htmlType == "radio" && $dictType) - + 请选择字典生成 #elseif($column.htmlType == "datetime") @@ -261,7 +261,7 @@ #elseif($column.htmlType == "textarea") - + #end #end