浏览代码

📝: 添加简化模板代码

添加了简化的模板代码
yangll 3 年之前
父节点
当前提交
55487127a6
共有 23 个文件被更改,包括 1292 次插入111 次删除
  1. 11 19
      tnc-generate/src/main/java/org/jeecg/codegen/database/DbReadTableUtil.java
  2. 2 0
      tnc-generate/src/main/java/org/jeecg/codegen/generate/config/CreateFileConfig.java
  3. 14 12
      tnc-generate/src/main/java/org/jeecg/codegen/generate/impl/CodeGenerateOne.java
  4. 9 6
      tnc-generate/src/main/java/org/jeecg/codegen/generate/impl/base/BaseCodeGenerate.java
  5. 32 5
      tnc-generate/src/main/java/org/jeecg/codegen/generate/pojo/CgFormColumnExtendVo.java
  6. 12 0
      tnc-generate/src/main/java/org/jeecg/codegen/generate/pojo/ColumnVo.java
  7. 17 0
      tnc-generate/src/main/java/org/jeecg/codegen/generate/util/FileHelper.java
  8. 41 8
      tnc-generate/src/main/java/org/jeecg/codegen/window/JeecgOneUtil.java
  9. 2 2
      tnc-generate/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
  10. 159 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai
  11. 88 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai
  12. 18 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai
  13. 5 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml
  14. 15 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai
  15. 20 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai
  16. 383 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
  17. 212 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei
  18. 70 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
  19. 93 0
      tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal__Style#Drawer.vuei
  20. 0 5
      tnc-generate/src/main/resources/jeecg/jeecg_config.properties
  21. 42 45
      tnc-online/src/main/java/org/jeecg/modules/online/cgform/controller/OnlCgformApiController.java
  22. 11 6
      tnc-online/src/main/java/org/jeecg/modules/online/cgform/util/GenerateCodeFileToZip.java
  23. 36 3
      tnc-system/src/main/java/org/jeecg/JeecgOneUtil.java

+ 11 - 19
tnc-generate/src/main/java/org/jeecg/codegen/database/DbReadTableUtil.java

@@ -219,8 +219,8 @@ public class DbReadTableUtil {
                         connection = null;
                         System.gc();
                     }
-                } catch (SQLException e3) {
-                    throw e3;
+                } catch (SQLException e) {
+                    throw e;
                 }
             }
             return tableNameList;
@@ -237,8 +237,8 @@ public class DbReadTableUtil {
                     System.gc();
                 }
                 throw th;
-            } catch (SQLException e4) {
-                throw e4;
+            } catch (SQLException e) {
+                throw e;
             }
         }
     }
@@ -359,11 +359,11 @@ public class DbReadTableUtil {
                             System.gc();
                         }
                         // 正序
-                        ArrayList<ColumnVo> arrayList2 = new ArrayList<>();
+                        ArrayList<ColumnVo> columnAscList = new ArrayList<>();
                         for (int size = columnVoList.size() - 1; size >= 0; size--) {
-                            arrayList2.add(columnVoList.get(size));
+                            columnAscList.add(columnVoList.get(size));
                         }
-                        return arrayList2;
+                        return columnAscList;
                     } catch (SQLException e) {
                         throw e;
                     }
@@ -383,14 +383,12 @@ public class DbReadTableUtil {
                         System.gc();
                     }
                     throw th;
-                } catch (SQLException e2) {
-                    throw e2;
+                } catch (SQLException e) {
+                    throw e;
                 }
             }
-        } catch (ClassNotFoundException e3) {
-            throw e3;
-        } catch (SQLException e4) {
-            throw e4;
+        } catch (ClassNotFoundException | SQLException e) {
+            throw e;
         }
     }
 
@@ -527,8 +525,6 @@ public class DbReadTableUtil {
         }
     }
 
-
-    /* renamed from: c */
     public static boolean isTableHasColumn(String tableName) {
         String sql = null;
         try {
@@ -563,22 +559,18 @@ public class DbReadTableUtil {
     }
 
 
-    /* renamed from: a */
     public static List<String> getAllTableNames() throws SQLException {
         return readAllTableNames();
     }
 
-    /* renamed from: b */
     public static List<ColumnVo> getOriginalTableColumn(String tableName) throws Exception {
         return readOriginalTableColumn(tableName);
     }
 
-
     public static String getProjectPath() {
         return CodeConfigProperties.getProjectPath();
     }
 
-
     /**
      * 空字符串转换成 ""
      *

+ 2 - 0
tnc-generate/src/main/java/org/jeecg/codegen/generate/config/CreateFileConfig.java

@@ -1,5 +1,6 @@
 package org.jeecg.codegen.generate.config;
 
+import org.jeecg.codegen.generate.util.FileHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,6 +52,7 @@ public class CreateFileConfig {
         }
         // 替换空格
         String classPath = templateRootPath.replaceAll("%20", " ");
+        classPath = FileHelper.unifyPath(classPath);
         LOGGER.debug("-------classpath-------" + classPath);
         // 在jar 包中的路径
         if (classPath.contains("/BOOT-INF/classes!") || classPath.contains("/BOOT-INF/lib/")) {

+ 14 - 12
tnc-generate/src/main/java/org/jeecg/codegen/generate/impl/CodeGenerateOne.java

@@ -10,6 +10,7 @@ import org.jeecg.codegen.generate.impl.base.BaseCodeGenerate;
 import org.jeecg.codegen.generate.pojo.ColumnVo;
 import org.jeecg.codegen.generate.pojo.TableVo;
 import org.jeecg.codegen.generate.util.NonceUtils;
+import org.jeecg.common.constant.enums.CgformEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -139,18 +140,19 @@ public class CodeGenerateOne extends BaseCodeGenerate implements IGenerate {
         // 配置文件中的 项目目录和模板目录
         String projectPath = CodeConfigProperties.projectPath;
         String templatePath = CodeConfigProperties.templatePath;
-        // 默认模板目录,选择默认样式
-        if (removeAroundSlash(templatePath).equals("jeecg/code-template")) {
-//            templatePath = "/" + removeAroundSlash(templatePath) + "/one";
-            templatePath = "/" + removeAroundSlash(templatePath);
-
-            if(StringUtils.isBlank(stylePath)) {
-                templatePath += "/one";
-            }else {
-                templatePath += "/" + removeAroundSlash(stylePath);
-            }
-            CodeConfigProperties.setTemplatePath(templatePath);
-        }
+        // 下面这段判断没啥用,加上反而出错
+//        // 默认模板目录,选择默认样式
+//        if (removeAroundSlash(templatePath).equals("jeecg/code-template")) {
+////            templatePath = "/" + removeAroundSlash(templatePath) + "/one";
+//            templatePath = "/" + removeAroundSlash(templatePath);
+//
+//            if(StringUtils.isBlank(stylePath)) {
+//                templatePath += "/one";
+//            }else {
+//                templatePath += "/" + removeAroundSlash(stylePath);
+//            }
+//            CodeConfigProperties.setTemplatePath(templatePath);
+//        }
         // 创建文件配置(没把项目目录也放进去呢)
         CreateFileConfig createFileConfig = new CreateFileConfig(templatePath);
         createFileConfig.setStylePath(stylePath);

+ 9 - 6
tnc-generate/src/main/java/org/jeecg/codegen/generate/impl/base/BaseCodeGenerate.java

@@ -119,6 +119,9 @@ public class BaseCodeGenerate {
         if (srcFileName.contains(UNDERLINE_2)) {
             srcFileName = srcFileName.replace(UNDERLINE_2, ".");
         }
+        // 统一路径分隔符
+        srcFileName = FileHelper.unifyPath(srcFileName);
+
         // 设置模板字符编码
         Template template = getTemplate(templateRootDir, createFileConfig);
         template.setOutputEncoding(StandardCharsets.UTF_8.name());
@@ -128,7 +131,7 @@ public class BaseCodeGenerate {
         FreemarkerHelper.process(template, config, srcFile);
         // 一多一
         if (!isOne2Many(srcFile)) {
-            this.genFileList.add("生成成功:" + srcFileName);
+            genFileList.add("生成成功:" + FileHelper.unifyPath(srcFileName));
         }
         // 一对多
         if (isOne2Many(srcFile)) {
@@ -162,7 +165,6 @@ public class BaseCodeGenerate {
         return false;
     }
 
-    /* renamed from: a */
     protected void generate(File srcFile, String segmentTag) {
         InputStreamReader inputStreamReader = null;
         BufferedReader bufferedReader = null;
@@ -179,11 +181,12 @@ public class BaseCodeGenerate {
                         if (readLine == null) {
                             break;
                         } else if (readLine.trim().length() > 0 && readLine.startsWith(segmentTag)) {
-                            String str2 = srcFile.getParentFile().getAbsolutePath() + File.separator + readLine.substring(segmentTag.length());
-                            LOGGER.info("[generate]\t split file:" + srcFile.getAbsolutePath() + " ==> " + str2);
-                            outputStreamWriter = new OutputStreamWriter(new FileOutputStream(str2), StandardCharsets.UTF_8);
+                            String srcFileName = srcFile.getParentFile().getAbsolutePath() + File.separator + readLine.substring(segmentTag.length());
+
+                            LOGGER.info("[generate]\t split file:" + srcFile.getAbsolutePath() + " ==> " + srcFileName);
+                            outputStreamWriter = new OutputStreamWriter(new FileOutputStream(srcFileName), StandardCharsets.UTF_8);
                             writerList.add(outputStreamWriter);
-                            this.genFileList.add("生成成功:" + str2);
+                            genFileList.add("生成成功:" + FileHelper.unifyPath(srcFileName));
                             z = true;
                         } else if (z) {
                             outputStreamWriter.append((readLine + "\r\n"));

+ 32 - 5
tnc-generate/src/main/java/org/jeecg/codegen/generate/pojo/CgFormColumnExtendVo.java

@@ -6,6 +6,10 @@ import lombok.ToString;
 
 import java.util.Map;
 
+/**
+ * 在线表单 字段表 中的 扩展字段
+ * 对应 onl_cgform_field 表中的字段
+ */
 @Getter
 @Setter
 @ToString
@@ -13,24 +17,47 @@ public class CgFormColumnExtendVo {
 
     /** 字段长度 */
     protected Integer fieldLength;
+    /** 跳转URL */
     protected String fieldHref;
+    /** 表单字段校验规则 */
     protected String fieldValidType;
+    /** 表字段默认值 对应字段:db_default_val */
     protected String fieldDefault;
-    protected String fieldShowType;
+    /** 表单控件类型 */
+    protected String fieldShowType = "text";
+    /** 排序 对应字段:order_num*/
     protected Integer fieldOrderNum;
+    /** 是否主键 是:"Y";否:“N”  对应字段:db_is_key*/
     protected String isKey;
-    protected String isShow;
-    protected String isShowList;
-    protected String isQuery;
+    /** 表单是否显示 是:"Y";否:“N”  对应字段:is_show_form */
+    protected String isShow = "N";
+    /** 列表是否显示 是:"Y";否:“N” */
+    protected String isShowList = "N";
+    /** 查询条件是否显示 是:"Y";否:“N” */
+    protected String isQuery = "N";
+    /** 查询模式 */
     protected String queryMode;
-    /**  */
+    /** 查询配置字典code */
     protected String dictField;
+    /** 查询配置字典table */
     protected String dictTable;
+    /** 查询配置字典text */
     protected String dictText;
+    /** 是否支持排序 是:"Y";否:“N” 对应字段:sort_flag */
     protected String sort = "N";
+    /** 是否是只读 是:"Y";否:“N” 对应字段:is_read_only */
     protected String readonly = "N";
+    /**
+     * 控件默认值,不同的表达式展示不同的结果。
+     * 1. 纯字符串直接赋给默认值;
+     * 2. #{普通变量};
+     * 3. {{ 动态JS表达式 }};
+     * 4. ${填值规则编码};
+     * 填值规则表达式只允许存在一个,且不能和其他规则混用。
+     */
     protected String defaultVal;
     protected String uploadnum;
+    /** 扩展参数 */
     protected Map<?, ?> extendParams;
 
 }

+ 12 - 0
tnc-generate/src/main/java/org/jeecg/codegen/generate/pojo/ColumnVo.java

@@ -4,12 +4,18 @@ import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 
+/**
+ * 在线表单 字段表
+ * 对应 onl_cgform_field 表中的字段
+ */
 @Getter
 @Setter
 @ToString
 public class ColumnVo extends CgFormColumnExtendVo {
 
+    /** 前端未找到使用 */
     public static final String OPTION_REQUIRED = "required:true";
+    /** 前端未找到使用 */
     public static final String OPTION_NUMBER_INSEX = "precision:2,groupSeparator:','";
 
     /** 数据库字段名 */
@@ -30,8 +36,14 @@ public class ColumnVo extends CgFormColumnExtendVo {
     private String scale;
     /** 是否为空 */
     private String nullable;
+    /** 表单控件类型 对应字段:field_show_type 用途不明(前端未找到使用) */
     private String classType = "";
+    /** 表单控件类型 对应字段:field_show_type 用途不明(前端未找到使用) */
     private String classType_row = "";
+    /**
+     * 用途不明(前端未找到使用)
+     * 赋值为:* n d
+     */
     private String optionType = "";
 
 }

+ 17 - 0
tnc-generate/src/main/java/org/jeecg/codegen/generate/util/FileHelper.java

@@ -126,4 +126,21 @@ public class FileHelper {
         }
         return false;
     }
+
+    /**
+     * 统一路径
+     * @param path 路径
+     * @return 路径
+     */
+    public static  String unifyPath(String path){
+        if(path == null || "".equals(path)) {
+            return "";
+        }
+        // 统一路径分隔符
+        if (path.contains("\\") || path.contains("/")) {
+            path = path.replace("\\", File.separator);
+            path = path.replace("/", File.separator);
+        }
+        return path;
+    }
 }

+ 41 - 8
tnc-generate/src/main/java/org/jeecg/codegen/window/JeecgOneUtil.java

@@ -14,10 +14,13 @@ public class JeecgOneUtil {
     public static void main(String[] args) {
 
         // 默认配置
-        defaultGen();
+//      defaultGen();
+
+        // 枚举配置
+//        enumGen();
 
         // 自定义配置
-//        customGen();
+        genTwo();
     }
 
 
@@ -46,19 +49,19 @@ public class JeecgOneUtil {
     }
 
     /**
-     * 自定义配置生成代码
+     * 枚举配置生成代码
      */
     @SneakyThrows
-    private static void customGen(){
+    private static void enumGen(){
         TableVo tableVo = new TableVo();
         // 表名
-        tableVo.setTableName("sys_user");
+        tableVo.setTableName("test_note");
         // 实体名
-        tableVo.setEntityName("SysUser");
+        tableVo.setEntityName("TestNote");
         // 包名
-        tableVo.setEntityPackage("user");
+        tableVo.setEntityPackage("note");
         // 描述
-        tableVo.setFtlDescription("系统用户");
+        tableVo.setFtlDescription("note");
         // 单表代码生成器
         CodeGenerateOne generate = new CodeGenerateOne(tableVo);
         // 自定义配置 生成代码
@@ -77,4 +80,34 @@ public class JeecgOneUtil {
             System.out.println(fileName);
         }
     }
+
+    /**
+     * 自定义配置生成代码
+     */
+    @SneakyThrows
+    private static void genTwo(){
+        TableVo tableVo = new TableVo();
+        // 表名
+        tableVo.setTableName("sys_user");
+        // 实体名
+        tableVo.setEntityName("SysUser");
+        // 包名
+        tableVo.setEntityPackage("user");
+        // 描述
+        tableVo.setFtlDescription("系统用户");
+        // 单表代码生成器
+        CodeGenerateOne generate = new CodeGenerateOne(tableVo);
+        // 自定义配置 生成代码
+        String projectPath = "D:\\codeGen";
+        // 模板目录
+        String templatePath = "/jeecg/code-template-online";
+        // 风格目录
+        String stylePath = "default.two";
+
+        List<String> codeFileList = generate.generateCodeFile(projectPath,templatePath,stylePath);
+
+        for (String fileName : codeFileList) {
+            System.out.println(fileName);
+        }
+    }
 }

+ 2 - 2
tnc-generate/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei

@@ -149,7 +149,7 @@
       <a-table
         ref="table"
         size="middle"
-        <#if tableVo.extendParams.scroll=='1'>
+        <#if (tableVo.extendParams.scroll)!'0'=='1'>
         :scroll="{x:true}"
         </#if>
         bordered
@@ -310,7 +310,7 @@
             title: '操作',
             dataIndex: 'action',
             align:"center",
-            <#if tableVo.extendParams.scroll=='1'>
+            <#if (tableVo.extendParams.scroll)!'0'=='1'>
             fixed:"right",
             width:147,
             </#if>

+ 159 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/controller/${entityName}Controller.javai

@@ -0,0 +1,159 @@
+package ${bussiPackage}.${entityPackage}.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import ${bussiPackage}.${entityPackage}.entity.${entityName};
+import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * ${tableVo.ftlDescription}
+ *
+ * @author tnc-boot
+ * @since ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
+ */
+@Slf4j
+@Api(tags="${tableVo.ftlDescription}")
+@RestController
+@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
+public class ${entityName}Controller extends JeecgController<${entityName}, I${entityName}Service> {
+	@Autowired
+	private I${entityName}Service ${entityName?uncap_first}Service;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param ${entityName?uncap_first}
+	 * @param pageNo 页码
+	 * @param pageSize 条数
+	 * @param request 请求
+	 * @return 结果
+	 */
+	//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
+	@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest request) {
+		QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, request.getParameterMap());
+		Page<${entityName}> page = new Page<${entityName}>(pageNo, pageSize);
+		IPage<${entityName}> pageList = ${entityName?uncap_first}Service.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param ${entityName?uncap_first} 数据
+	 * @return 结果
+	 */
+	@AutoLog(value = "${tableVo.ftlDescription}-添加")
+	@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
+		${entityName?uncap_first}Service.save(${entityName?uncap_first});
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param ${entityName?uncap_first} 数据
+	 * @return 结果
+	 */
+	@AutoLog(value = "${tableVo.ftlDescription}-编辑")
+	@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
+		${entityName?uncap_first}Service.updateById(${entityName?uncap_first});
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 * 通过id删除
+	 *
+	 * @param id 主键
+	 * @return 结果
+	 */
+	@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
+	@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id") String id) {
+		${entityName?uncap_first}Service.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids 所有主键(逗号隔开)
+	 * @return 结果
+	 */
+	@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
+	@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids") String ids) {
+		this.${entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id 主键
+	 * @return 结果
+	 */
+	//@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
+	@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<${entityName}> queryById(@RequestParam(name="id") String id) {
+		${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
+		if(${entityName?uncap_first}==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(${entityName?uncap_first});
+	}
+
+    /**
+     * 导出excel
+     *
+     * @param request 请求
+     * @param ${entityName?uncap_first} 数据
+     */
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) {
+        return super.exportXls(request, ${entityName?uncap_first}, ${entityName}.class, "${tableVo.ftlDescription}");
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request 请求
+     * @param response 响应
+     * @return 结果
+     */
+    @PostMapping(value = "/importExcel")
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ${entityName}.class);
+    }
+
+}

+ 88 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai

@@ -0,0 +1,88 @@
+package ${bussiPackage}.${entityPackage}.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * ${tableVo.ftlDescription}
+ *
+ * @author tnc-boot
+ * @since ${.now?string["yyyy-MM-dd"]}
+ * @version: V1.0
+ */
+@Data
+@TableName("${tableName}")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}")
+public class ${entityName} implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    <#assign excel_ignore_arr=['createBy','createTime','updateBy','updateTime','sysOrgCode']>
+    <#list originalColumns as po>
+    <#-- 生成字典Code -->
+    <#assign list_field_dictCode="">
+    <#if po.classType='sel_user'>
+      <#assign list_field_dictCode=', dictTable = "sys_user", dicText = "realname", dicCode = "username"'>
+    <#elseif po.classType='sel_depart'>
+      <#assign list_field_dictCode=', dictTable = "sys_depart", dicText = "depart_name", dicCode = "id"'>
+    <#elseif po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox'>
+      <#if po.dictTable?default("")?trim?length gt 1>
+        <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'>
+      <#elseif po.dictField?default("")?trim?length gt 1>
+        <#assign list_field_dictCode=', dicCode = "${po.dictField}"'>
+      </#if>
+    <#elseif po.classType=='sel_tree'>
+        <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'>
+    </#if>
+	/**${po.filedComment}*/
+	<#if po.fieldName == primaryKeyField>
+	@TableId(type = IdType.ASSIGN_ID)
+	<#else>
+  		<#if po.fieldDbType =='Date' || po.fieldDbType =='Datetime'>
+			<#if po.classType=='date'>
+    <#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
+	@Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd")
+	</#if>
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+			<#else>
+    <#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
+	@Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	</#if>
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+			</#if>
+		<#else>
+    <#if !excel_ignore_arr?seq_contains("${po.fieldName}")>
+	@Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
+	</#if>
+  		</#if>
+      <#if list_field_dictCode?length gt 1>
+	@Dict(${list_field_dictCode?substring(2)})
+      </#if>
+  		<#--  <#if po.classType!='popup'>
+  			<#if po.dictTable?default("")?trim?length gt 1>
+  	@Dict(dicCode="${po.dictField}",dicText="${po.dictText}",dictTable="${po.dictTable}")
+  			<#elseif po.dictField?default("")?trim?length gt 1>
+  	@Dict(dicCode="${po.dictField}")
+  			</#if>
+  		</#if>-->
+    </#if>
+    <#include "/common/blob.ftl">
+	</#list>
+}

+ 18 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/mapper/${entityName}Mapper.javai

@@ -0,0 +1,18 @@
+package ${bussiPackage}.${entityPackage}.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import ${bussiPackage}.${entityPackage}.entity.${entityName};
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * ${tableVo.ftlDescription}
+ *
+ * @author tnc-boot
+ * @since ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
+ */
+public interface ${entityName}Mapper extends BaseMapper<${entityName}> {
+
+}

+ 5 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/mapper/xml/${entityName}Mapper.xml

@@ -0,0 +1,5 @@
+<?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="${bussiPackage}.${entityPackage}.mapper.${entityName}Mapper">
+
+</mapper>

+ 15 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/service/I${entityName}Service.javai

@@ -0,0 +1,15 @@
+package ${bussiPackage}.${entityPackage}.service;
+
+import ${bussiPackage}.${entityPackage}.entity.${entityName};
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * ${tableVo.ftlDescription}
+ *
+ * @author tnc-boot
+ * @since ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
+ */
+public interface I${entityName}Service extends IService<${entityName}> {
+
+}

+ 20 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/service/impl/${entityName}ServiceImpl.javai

@@ -0,0 +1,20 @@
+package ${bussiPackage}.${entityPackage}.service.impl;
+
+import ${bussiPackage}.${entityPackage}.entity.${entityName};
+import ${bussiPackage}.${entityPackage}.mapper.${entityName}Mapper;
+import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * ${tableVo.ftlDescription}
+ *
+ * @author tnc-boot
+ * @since ${.now?string["yyyy-MM-dd"]}
+ * @version V1.0
+ */
+@Service
+public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, ${entityName}> implements I${entityName}Service {
+
+}

+ 383 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei

@@ -0,0 +1,383 @@
+<#include "/common/utils.ftl">
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+<#assign query_field_no=0>
+<#assign query_flag=false>
+<#assign list_need_dict=false>
+<#assign list_need_category=false>
+<#assign list_need_pca=false>
+<#assign list_need_switch=false>
+
+<#-- 开始循环 -->
+<#list columns as po>
+<#if po.isQuery=='Y'>
+<#assign query_flag=true>
+	<#if query_field_no==2>
+          <template v-if="toggleSearchStatus">
+	</#if>
+	<#assign query_field_dictCode="">
+	<#if po.dictTable?default("")?trim?length gt 1>
+	    <#assign query_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
+    <#elseif po.dictField?default("")?trim?length gt 1>
+        <#assign query_field_dictCode="${po.dictField}">
+    </#if>
+	<#if po.queryMode=='single'>
+          <#if query_field_no gt 1>  </#if><a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <#if query_field_no gt 1>  </#if><a-form-item label="${po.filedComment}">
+            <#if po.classType=='sel_search'>
+              <#if query_field_no gt 1>  </#if><j-search-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dict="${po.dictTable},${po.dictText},${po.dictField}"/>
+            <#elseif po.classType=='sel_user'>
+              <#if query_field_no gt 1>  </#if><j-select-user-by-dep placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
+            <#elseif po.classType=='switch'>
+              <#if query_field_no gt 1>  </#if><j-switch placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" <#if po.dictField!= 'is_open'>:options="${po.dictField}"</#if> query></j-switch>
+            <#elseif po.classType=='sel_depart'>
+              <#if query_field_no gt 1>  </#if><j-select-depart placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"/>
+            <#elseif po.classType=='list_multi'>
+              <#if query_field_no gt 1>  </#if><j-multi-select-tag placeholder="请选择${po.filedComment}" dictCode="${query_field_dictCode?default("")}" v-model="queryParam.${po.fieldName}"/>
+            <#elseif po.classType=='cat_tree'>
+              <#if query_field_no gt 1>  </#if><j-category-select placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" pcode="${po.dictField?default("")}"/>
+			<#elseif po.classType=='date'>
+              <#if query_field_no gt 1>  </#if><j-date placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
+			<#elseif po.classType=='datetime'>
+              <#if query_field_no gt 1>  </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}"></j-date>
+            <#elseif po.classType=='pca'>
+              <#if query_field_no gt 1>  </#if><j-area-linkage type="cascader" v-model="queryParam.${po.fieldName}" placeholder="请选择省市区"/>
+            <#elseif po.classType=='popup'>
+              <#if query_field_no gt 1>  </#if><j-popup placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" code="${po.dictTable}" org-fields="${po.dictField}" dest-fields="${po.dictText}" :field="getPopupField('${po.dictText}')" :multi="${po.extendParams.popupMulti?c}"/>
+			<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
+			<#--  ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
+			<#if po.dictTable?default("")?trim?length gt 1>
+              <#if query_field_no gt 1>  </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictTable},${po.dictText},${po.dictField}"/>
+			<#elseif po.dictField?default("")?trim?length gt 1>
+              <#if query_field_no gt 1>  </#if><j-dict-select-tag placeholder="请选择${po.filedComment}" v-model="queryParam.${po.fieldName}" dictCode="${po.dictField}"/>
+			<#else>
+              <#if query_field_no gt 1>  </#if><a-input placeholder="请输入${po.filedComment}" v-model="queryParam.${po.fieldName}"></a-input>
+			</#if>
+			<#else>
+              <#if query_field_no gt 1>  </#if><a-input placeholder="请输入${po.filedComment}" v-model="queryParam.${po.fieldName}"></a-input>
+			</#if>
+            <#if query_field_no gt 1>  </#if></a-form-item>
+          <#if query_field_no gt 1>  </#if></a-col>
+	<#else>
+          <#if query_field_no gt 1>  </#if><a-col :xl="10" :lg="11" :md="12" :sm="24">
+            <#if query_field_no gt 1>  </#if><a-form-item label="${po.filedComment}">
+			<#if po.classType=='date'>
+              <#if query_field_no gt 1>  </#if><j-date placeholder="请选择开始日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
+              <#if query_field_no gt 1>  </#if><span class="query-group-split-cust"></span>
+              <#if query_field_no gt 1>  </#if><j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
+			<#elseif po.classType=='datetime'>
+              <#if query_field_no gt 1>  </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></j-date>
+              <#if query_field_no gt 1>  </#if><span class="query-group-split-cust"></span>
+              <#if query_field_no gt 1>  </#if><j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></j-date>
+			<#else>
+              <#if query_field_no gt 1>  </#if><a-input placeholder="请输入最小值" class="query-group-cust" v-model="queryParam.${po.fieldName}_begin"></a-input>
+              <#if query_field_no gt 1>  </#if><span class="query-group-split-cust"></span>
+              <#if query_field_no gt 1>  </#if><a-input placeholder="请输入最大值" class="query-group-cust" v-model="queryParam.${po.fieldName}_end"></a-input>
+			</#if>
+            <#if query_field_no gt 1>  </#if></a-form-item>
+          <#if query_field_no gt 1>  </#if></a-col>
+	</#if>
+<#assign query_field_no=query_field_no+1>
+</#if>
+<#if !list_need_dict && po.fieldShowType!='popup' && po.dictField?default("")?trim?length gt 1>
+<#assign list_need_dict=true>
+</#if>
+<#if po.classType=='cat_tree' && po.dictText?default("")?trim?length == 0>
+<#assign list_need_category=true>
+</#if>
+<#if po.classType=='pca'>
+<#assign list_need_pca=true>
+</#if>
+<#if po.classType=='switch'>
+<#assign list_need_switch=true>
+</#if>
+</#list>
+<#-- 结束循环 -->
+<#t>
+<#if query_field_no gt 2>
+          </template>
+</#if>
+<#if query_flag>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
+</#if>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('${tableVo.ftlDescription}')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        <#if (tableVo.extendParams.scroll)!'0'=='1'>
+        :scroll="{x:true}"
+        </#if>
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <#if list_need_pca>
+        <template slot="pcaSlot" slot-scope="text">
+          <div>{{ getPcaText(text) }}</div>
+        </template>
+        </#if>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <${Format.humpToShortbar(entityName)}-modal ref="modalForm" @ok="modalFormOk"></${Format.humpToShortbar(entityName)}-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import ${entityName}Modal from './modules/${entityName}Modal'
+
+  <#if list_need_category>
+  import { loadCategoryData } from '@/api/api'
+  </#if>
+  <#if list_need_dict>
+  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+  </#if>
+  <#if list_need_pca>
+  import Area from '@/components/_util/Area'
+  </#if>
+
+  export default {
+    name: '${entityName}List',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      ${entityName}Modal
+    },
+    data () {
+      return {
+        description: '${tableVo.ftlDescription}管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+    <#assign showColNum=0>
+	<#list columns as po>
+	<#if po.isShowList =='Y' && po.fieldName !='id'>
+	<#assign showColNum=showColNum+1>
+          {
+            title:'${po.filedComment}',
+            align:"center",
+            <#if po.sort=='Y'>
+            sorter: true,
+            </#if>
+            <#if po.classType=='date'>
+            dataIndex: '${po.fieldName}',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+            <#elseif po.fieldDbType=='Blob'>
+            dataIndex: '${po.fieldName}String'
+            <#elseif po.classType=='umeditor'>
+            dataIndex: '${po.fieldName}',
+            scopedSlots: {customRender: 'htmlSlot'}
+            <#elseif po.classType=='pca'>
+            dataIndex: '${po.fieldName}',
+            scopedSlots: {customRender: 'pcaSlot'}
+            <#elseif po.classType=='file'>
+            dataIndex: '${po.fieldName}',
+            scopedSlots: {customRender: 'fileSlot'}
+            <#elseif po.classType=='image'>
+            dataIndex: '${po.fieldName}',
+            scopedSlots: {customRender: 'imgSlot'}
+            <#elseif po.classType=='switch'>
+            dataIndex: '${po.fieldName}',
+            customRender: (text) => (text ? filterMultiDictText(this.dictOptions['${po.fieldName}'], text) : ''),
+            <#elseif po.classType == 'sel_tree' || po.classType=='list' || po.classType=='list_multi' || po.classType=='sel_search' || po.classType=='radio' || po.classType=='checkbox' || po.classType=='sel_depart' || po.classType=='sel_user'>
+            dataIndex: '${po.fieldName}_dictText'
+            <#elseif po.classType=='cat_tree'>
+            <#if list_need_category>
+            dataIndex: '${po.fieldName}',
+            customRender: (text) => (text ? filterMultiDictText(this.dictOptions['${po.fieldName}'], text) : '')
+            <#else>
+            dataIndex: '${po.fieldName}',
+            customRender: (text, record) => (text ? record['${dashedToCamel(po.dictText)}'] : '')
+            </#if>
+			<#else>
+            dataIndex: '${po.fieldName}'
+			</#if>
+          },
+     </#if>
+     </#list>
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            <#if (tableVo.extendParams.scroll)!'0'=='1'>
+            fixed:"right",
+            width:147,
+            </#if>
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/${entityPackage}/${entityName?uncap_first}/list",
+          delete: "/${entityPackage}/${entityName?uncap_first}/delete",
+          deleteBatch: "/${entityPackage}/${entityName?uncap_first}/deleteBatch",
+          exportXlsUrl: "/${entityPackage}/${entityName?uncap_first}/exportXls",
+          importExcelUrl: "${entityPackage}/${entityName?uncap_first}/importExcel",
+        },
+        dictOptions:{},
+        <#if list_need_pca>
+        pcaData:'',
+        </#if>
+        superFieldList:[],
+      }
+    },
+    created() {
+    <#if list_need_pca>
+      this.pcaData = new Area()
+    </#if>
+    <#if list_need_switch>
+    <#list columns as po>
+    <#if po.classType=='switch'>
+      <#assign switch_extend_arr=['Y','N']>
+      <#if po.dictField?default("")?contains("[")>
+        <#assign switch_extend_arr=po.dictField?eval>
+      </#if>
+      <#list switch_extend_arr as a>
+       <#if a_index == 0>
+       <#assign switch_extend_arr1=a>
+       <#else>
+       <#assign switch_extend_arr2=a>
+       </#if>
+      </#list>
+      this.$set(this.dictOptions, '${po.fieldName}', [{text:'是',value:'${switch_extend_arr1}'},{text:'否',value:'${switch_extend_arr2}'}])
+    </#if>
+    </#list>
+    </#if>
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        <#noparse>return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;</#noparse>
+      },
+    },
+    methods: {
+    <#if list_need_pca>
+      getPcaText(code){
+        return this.pcaData.getText(code);
+      },
+    </#if>
+      initDictConfig(){
+      <#list columns as po>
+      <#if (po.isQuery=='Y' || po.isShowList=='Y') && po.classType!='popup'>
+        <#if po.classType=='cat_tree' && list_need_category==true>
+        loadCategoryData({code:'${po.dictField?default("")}'}).then((res) => {
+          if (res.success) {
+            this.$set(this.dictOptions, '${po.fieldName}', res.result)
+          }
+        })
+        </#if>
+      </#if>
+      </#list>
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+         <#list columns as po>
+        fieldList.push(${superQueryFieldList(po)})
+         </#list>
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 212 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei

@@ -0,0 +1,212 @@
+
+<#include "/common/utils.ftl">
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+<#assign form_popup = false>
+<#assign form_cat_tree = false>
+<#assign form_cat_back = "">
+
+<#assign form_span = 24>
+<#if tableVo.fieldRowNum==2>
+<#assign form_span = 12>
+<#elseif tableVo.fieldRowNum==3>
+<#assign form_span = 8>
+<#elseif tableVo.fieldRowNum==4>
+<#assign form_span = 6>
+</#if>
+<#list columns as po>
+
+<#if po.isShow =='Y' && po.fieldName != 'id'>
+<#assign form_field_dictCode="">
+	<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
+		<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
+	<#elseif po.dictField?default("")?trim?length gt 1>
+		<#assign form_field_dictCode="${po.dictField}">
+	</#if>
+          <a-col :span="${form_span}">
+            <a-form-model-item label="${po.filedComment}" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="${autoStringSuffixForModel(po)}">
+	<#if po.classType =='date'>
+              <j-date placeholder="请选择${po.filedComment}" v-model="model.${po.fieldName}"  style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType =='datetime'>
+              <j-date placeholder="请选择${po.filedComment}"  v-model="model.${po.fieldName}" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType =='time'>
+              <j-time placeholder="请选择${po.filedComment}"  v-model="model.${po.fieldName}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType =='popup'>
+	    <#assign form_popup=true>
+              <j-popup
+                v-model="model.${po.fieldName}"
+                field="${po.fieldName}"
+                org-fields="${po.dictField}"
+                dest-fields="${Format.underlineToHump(po.dictText)}"
+                code="${po.dictTable}"
+                :multi="${po.extendParams.popupMulti?c}"
+                @input="popupCallback"
+                <#if po.readonly=='Y'>disabled</#if>/>
+    <#elseif po.classType =='sel_depart'>
+              <j-select-depart v-model="model.${po.fieldName}" multi <#if po.readonly=='Y'>disabled</#if> />
+<#elseif po.classType =='switch'>
+              <j-switch v-model="model.${po.fieldName}" <#if po.dictField != 'is_open'>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
+	<#elseif po.classType =='pca'>
+             <j-area-linkage type="cascader" v-model="model.${po.fieldName}" placeholder="请输入省市区" <#if po.readonly=='Y'>disabled</#if> />
+	<#elseif po.classType =='markdown'>
+              <j-markdown-editor v-model="model.${autoStringSuffixForModel(po)}" id="${po.fieldName}"></j-markdown-editor>
+    <#elseif po.classType =='password'>
+              <a-input-password v-model="model.${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType =='sel_user'>
+              <j-select-user-by-dep v-model="model.${po.fieldName}" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType =='textarea'>
+              <a-textarea v-model="model.${autoStringSuffixForModel(po)}" rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType=='list' || po.classType=='radio'>
+              <j-dict-select-tag type="${po.classType}" v-model="model.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType=='list_multi' || po.classType=='checkbox'>
+              <j-multi-select-tag type="${po.classType}" v-model="model.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType=='sel_search'>
+              <j-search-select-tag v-model="model.${po.fieldName}" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if> />
+    <#elseif po.classType=='cat_tree'>
+    	<#assign form_cat_tree = true>
+              <j-category-select v-model="model.${po.fieldName}" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${dashedToCamel(po.dictText)}" @change="handleCategoryChange"</#if> <#if po.readonly=='Y'>disabled</#if>/>
+    	<#if po.dictText?default("")?trim?length gt 1>
+    	<#assign form_cat_back = "${po.dictText}">
+    	</#if>
+	<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
+              <a-input-number v-model="model.${po.fieldName}" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
+	<#elseif po.classType=='file'>
+              <j-upload v-model="model.${po.fieldName}"  <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:number=${po.uploadnum}</#if>></j-upload>
+	<#elseif po.classType=='image'>
+              <j-image-upload isMultiple <#if po.uploadnum??>:number=${po.uploadnum}</#if> v-model="model.${po.fieldName}" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
+	<#elseif po.classType=='umeditor'>
+              <j-editor v-model="model.${autoStringSuffixForModel(po)}" <#if po.readonly=='Y'>disabled</#if>/>
+    <#elseif po.fieldDbType=='Blob'>
+              <a-input v-model="model.${autoStringSuffixForModel(po)}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></a-input>
+		<#elseif po.classType == 'sel_tree'>
+  	          <j-tree-select
+                ref="treeSelect"
+                placeholder="请选择${po.filedComment}"
+                v-model="model.${po.fieldName}"
+                <#if po.dictText??>
+                <#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??>
+                dict="${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}"
+                <#elseif po.dictText?split(',')[1]??>
+                pidField="${po.dictText?split(',')[1]}"
+                <#elseif po.dictText?split(',')[3]??>
+                hasChildField="${po.dictText?split(',')[3]}"
+                </#if>
+                </#if>
+                pidValue="${po.dictField}"
+                <#if po.readonly=='Y'>disabled</#if>>
+              </j-tree-select>
+	<#else>
+              <a-input v-model="model.${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> ></a-input>
+    </#if>
+            </a-form-model-item>
+          </a-col>
+</#if>
+</#list>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: '${entityName}Form',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+            <#include "/common/init/initValue.ftl">
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        <#include "/common/validatorRulesTemplate/main.ftl">
+        url: {
+          add: "/${entityPackage}/${entityName?uncap_first}/add",
+          edit: "/${entityPackage}/${entityName?uncap_first}/edit",
+          queryById: "/${entityPackage}/${entityName?uncap_first}/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+       <#if form_popup>
+      popupCallback(value,row){
+         this.model = Object.assign(this.model, row);
+      },
+       </#if>
+      <#if form_cat_tree>
+      handleCategoryChange(value,backObj){
+         this.model = Object.assign(this.model, backObj);
+      }
+      </#if>
+    }
+  }
+</script>

+ 70 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei

@@ -0,0 +1,70 @@
+
+<#include "/common/utils.ftl">
+<#assign modal_width = 800>
+<#if tableVo.fieldRowNum==2>
+  <#assign modal_width = 896>
+<#elseif tableVo.fieldRowNum==3>
+  <#assign modal_width = 1024>
+<#elseif tableVo.fieldRowNum==4>
+  <#assign modal_width = 1280>
+</#if>
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <${Format.humpToShortbar(entityName)}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></${Format.humpToShortbar(entityName)}-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import ${entityName}Form from './${entityName}Form'
+  export default {
+    name: '${entityName}Modal',
+    components: {
+      ${entityName}Form
+    },
+    data () {
+      return {
+        title:'',
+        width:${modal_width},
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 93 - 0
tnc-generate/src/main/resources/jeecg/code-template-online/default/two/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal__Style#Drawer.vuei

@@ -0,0 +1,93 @@
+<#include "/common/utils.ftl">
+<#assign modal_width = 800>
+<#if tableVo.fieldRowNum==2>
+  <#assign modal_width = 896>
+<#elseif tableVo.fieldRowNum==3>
+  <#assign modal_width = 1024>
+<#elseif tableVo.fieldRowNum==4>
+  <#assign modal_width = 1280>
+</#if>
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <${Format.humpToShortbar(entityName)}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></${Format.humpToShortbar(entityName)}-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import ${entityName}Form from './${entityName}Form'
+
+  export default {
+    name: '${entityName}Modal',
+    components: {
+      ${entityName}Form
+    },
+    data () {
+      return {
+        title:"操作",
+        width:${modal_width},
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 0 - 5
tnc-generate/src/main/resources/jeecg/jeecg_config.properties

@@ -3,11 +3,6 @@ project_path=D:\\codeGen
 #bussi_package[User defined]
 bussi_package=org.jeecg.modules
 
-
-#default code path
-#source_root_package=src
-#webroot_package=WebRoot
-
 #maven code path
 source_root_package=src.main.java
 webroot_package=src.main.webapp

+ 42 - 45
tnc-online/src/main/java/org/jeecg/modules/online/cgform/controller/OnlCgformApiController.java

@@ -928,88 +928,85 @@ public class OnlCgformApiController {
 
     //region 生成、打包
     @PostMapping({"/codeGenerate"})
-    public Result<?> codeGenerate(@RequestBody JSONObject var1) {
-        OnlGenerateModel onlGenerateModel = JSONObject.parseObject(var1.toJSONString(),OnlGenerateModel.class);
-        List<String> var3 = null;
+    public Result<?> codeGenerate(@RequestBody JSONObject jsonObject) {
+        OnlGenerateModel onlGenerateModel = JSONObject.parseObject(jsonObject.toJSONString(),OnlGenerateModel.class);
+        List<String> fileList = null;
 
         try {
             if ("1".equals(onlGenerateModel.getJformType())) {
-                var3 = this.onlCgformHeadService.generateCode(onlGenerateModel);
+                fileList = this.onlCgformHeadService.generateCode(onlGenerateModel);
             } else {
-                var3 = this.onlCgformHeadService.generateOneToMany(onlGenerateModel);
+                fileList = this.onlCgformHeadService.generateOneToMany(onlGenerateModel);
             }
 
-            return Result.ok(var3);
-        } catch (Exception var5) {
-            var5.printStackTrace();
-            return Result.error(var5.getMessage());
+            return Result.ok(fileList);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error(e.getMessage());
         }
     }
 
     @GetMapping({"/downGenerateCode"})
-    public void downGenerateCode(@RequestParam("fileList") List<String> var1, HttpServletRequest request, HttpServletResponse response) {
-        List var4 = (List)var1.stream().filter((var0) -> {
-            return var0.indexOf("src/main/java") == -1 && var0.indexOf("src%5Cmain%5Cjava") == -1;
+    public void downGenerateCode(@RequestParam("fileList") List<String> fileList, HttpServletRequest request, HttpServletResponse response) {
+        List<String> filterFileList = fileList.stream().filter((filePath) -> {
+            return !filePath.contains("src/main/java") && !filePath.contains("src%5Cmain%5Cjava");
         }).collect(Collectors.toList());
-        if (var1 != null && (var4 == null || var4.size() <= 0)) {
-            String var5 = "生成代码_" + System.currentTimeMillis() + ".zip";
-            final String var6 = "/opt/temp/codegenerate/" + var5;
-            File var7 = GenerateCodeFileToZip.m260a(var1, var6);
-            if (var7.exists()) {
+        if (fileList != null && (filterFileList == null || filterFileList.size() <= 0)) {
+            String zipFileName = "生成代码_" + System.currentTimeMillis() + ".zip";
+            final String zipFilePath = "/opt/temp/codegenerate/" + zipFileName;
+            File zipFile = GenerateCodeFileToZip.zip(fileList, zipFilePath);
+            if (zipFile.exists()) {
                 response.setContentType("application/force-download");
-                response.addHeader("Content-Disposition", "attachment;fileName=" + var5);
-                byte[] var8 = new byte[1024];
-                FileInputStream var9 = null;
-                BufferedInputStream var10 = null;
+                response.addHeader("Content-Disposition", "attachment;fileName=" + zipFileName);
+                byte[] buff = new byte[1024];
+                FileInputStream fileInputStream = null;
+                BufferedInputStream bufferedInputStream = null;
 
                 try {
-                    var9 = new FileInputStream(var7);
-                    var10 = new BufferedInputStream(var9);
-                    ServletOutputStream var11 = response.getOutputStream();
+                    fileInputStream = new FileInputStream(zipFile);
+                    bufferedInputStream = new BufferedInputStream(fileInputStream);
+                    ServletOutputStream servletOutputStream = response.getOutputStream();
 
-                    for(int var12 = var10.read(var8); var12 != -1; var12 = var10.read(var8)) {
-                        var11.write(var8, 0, var12);
+                    for(int len = bufferedInputStream.read(buff); len != -1; len = bufferedInputStream.read(buff)) {
+                        servletOutputStream.write(buff, 0, len);
                     }
-                } catch (Exception var25) {
-                    var25.printStackTrace();
+                } catch (Exception e) {
+                    e.printStackTrace();
                 } finally {
-                    if (var10 != null) {
+                    if (bufferedInputStream != null) {
                         try {
-                            var10.close();
-                        } catch (IOException var24) {
-                            var24.printStackTrace();
+                            bufferedInputStream.close();
+                        } catch (IOException e) {
+                            e.printStackTrace();
                         }
                     }
 
-                    if (var9 != null) {
+                    if (fileInputStream != null) {
                         try {
-                            var9.close();
-                        } catch (IOException var23) {
-                            var23.printStackTrace();
+                            fileInputStream.close();
+                        } catch (IOException e) {
+                            e.printStackTrace();
                         }
                     }
 
-                    class NamelessClass_1 extends Thread {
-                        NamelessClass_1() {
-                        }
-
+                    class ZipFileTask extends Thread {
                         public void run() {
                             try {
                                 Thread.sleep(10000L);
-                                FileUtil.del(var6);
-                            } catch (InterruptedException var2) {
-                                var2.printStackTrace();
+                                FileUtil.del(zipFilePath);
+                            } catch (InterruptedException e) {
+                                e.printStackTrace();
                             }
 
                         }
                     }
 
-                    (new NamelessClass_1()).start();
+                    new ZipFileTask().start();
                 }
             }
 
         } else {
-            logger.error(" fileList 不合法!!!", var1);
+            logger.error(" fileList 不合法!!!{}", fileList);
         }
     }
     //endregion

+ 11 - 6
tnc-online/src/main/java/org/jeecg/modules/online/cgform/util/GenerateCodeFileToZip.java

@@ -11,20 +11,25 @@ import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 
-/* renamed from: org.jeecg.modules.online.cgform.e.d */
-/* loaded from: hibernate-re-3.1.0-beta2.jar:org/jeecg/modules/online/cgform/e/d.class */
 public class GenerateCodeFileToZip {
-    /* renamed from: a */
-    public static File m260a(List<String> list, String str) throws RuntimeException {
+    /**
+     * 压缩文件
+     *
+     * @param fileList 要要压缩的文件列表
+     * @param zipFilePath 压缩文件路径
+     * @return 文件
+     * @throws RuntimeException 异常
+     */
+    public static File zip(List<String> fileList, String zipFilePath) throws RuntimeException {
         String str2;
-        File file = FileUtil.touch(str);
+        File file = FileUtil.touch(zipFilePath);
         if (file == null || !file.getName().endsWith(".zip")) {
             return null;
         }
         try {
             FileOutputStream fileOutputStream = new FileOutputStream(file);
             ZipOutputStream zipOutputStream = new ZipOutputStream(fileOutputStream);
-            for (String str3 : list) {
+            for (String str3 : fileList) {
                 File file2 = new File(URLDecoder.decode(str3, "UTF-8").replace("生成成功:", ""));
                 if (file2 != null && file2.exists()) {
                     byte[] bArr = new byte[4096];

+ 36 - 3
tnc-system/src/main/java/org/jeecg/JeecgOneUtil.java

@@ -17,6 +17,9 @@ public class JeecgOneUtil {
         // 默认配置
 //      defaultGen();
 
+        // 枚举配置
+//        enumGen();
+
         // 自定义配置
         customGen();
     }
@@ -46,11 +49,11 @@ public class JeecgOneUtil {
     }
 
     /**
-     * 自定义配置生成代码
+     * 枚举配置生成代码
      */
     @SneakyThrows
-    private static void customGen() {
-        org.jeecg.codegen.generate.pojo.TableVo tableVo = new org.jeecg.codegen.generate.pojo.TableVo();
+    private static void enumGen() {
+        TableVo tableVo = new TableVo();
         // 表名
         tableVo.setTableName("sys_user");
         // 实体名
@@ -78,4 +81,34 @@ public class JeecgOneUtil {
         }
     }
 
+    /**
+     * 自定义配置生成代码
+     */
+    @SneakyThrows
+    private static void customGen(){
+        TableVo tableVo = new TableVo();
+        // 表名
+        tableVo.setTableName("sys_user");
+        // 实体名
+        tableVo.setEntityName("SysUser");
+        // 包名
+        tableVo.setEntityPackage("user");
+        // 描述
+        tableVo.setFtlDescription("系统用户");
+        // 单表代码生成器
+        CodeGenerateOne generate = new CodeGenerateOne(tableVo);
+        // 自定义配置 生成代码
+        String projectPath = "D:\\codeGen";
+        // 模板目录
+        String templatePath = "/jeecg/code-template";
+        // 风格目录
+        String stylePath = "one";
+
+        List<String> codeFileList = generate.generateCodeFile(projectPath,templatePath,stylePath);
+
+        for (String fileName : codeFileList) {
+            System.out.println(fileName);
+        }
+    }
+
 }