Bladeren bron

增加元数据是否主业务对象配置

caixin 3 jaren geleden
bovenliggende
commit
3cdcaca135

+ 2 - 1
README.md

@@ -15,4 +15,5 @@
 - 参照类型([空字符串], Grid, Tree, GridTree):REFERENCE_TYPE
 - 是否使用了自定义档案参照:IF_USE_CUST_DOC_DEF_REF
 - 作者:AUTHOR
-- 目标项目根路径:TARGET_PROJECT_ROOT_PATH
+- 目标项目根路径:TARGET_PROJECT_ROOT_PATH
+- 元数据参数(是否主业务对象 1:主业务对象):IS_MAIN

+ 4 - 3
src/main/java/com/yonyou/occ/codegenerator/CodeGenerator.java

@@ -44,9 +44,10 @@ public class CodeGenerator {
     private final String targetProjectRootPath;
     private final String moduleName;
     private final String templateDir = getClass().getResource("/").getPath() + "generator/";
+    private final String isMain;
 
     public CodeGenerator(String oldBasePackage, String newBasePackage, String pdmFile, String tableCode,
-                         String referenceType, boolean ifUseCustDocDefRef, String author, String targetProjectRootPath) {
+                         String referenceType, boolean ifUseCustDocDefRef, String author, String targetProjectRootPath, String isMain) {
         this.oldBasePackage = oldBasePackage;
         this.newBasePackage = newBasePackage;
         this.pdmFile = pdmFile;
@@ -55,7 +56,7 @@ public class CodeGenerator {
         this.ifUseCustDocDefRef = ifUseCustDocDefRef;
         this.author = author;
         this.targetProjectRootPath = targetProjectRootPath;
-
+        this.isMain = isMain;
         moduleName = getModuleNameByTable(tableCode);
 
         final String[] array = {"ID", "DR", "TS", "CREATOR", "CREATION_TIME", "MODIFIER", "MODIFIED_TIME"};
@@ -163,7 +164,7 @@ public class CodeGenerator {
         data.put("ifUseCustDocDefRef", ifUseCustDocDefRef);
         data.put("author", author);
         data.put("table", table);
-
+        data.put("isMain", isMain);
         // 输出文件
         String fileName = table.getClassName();
         // 文件后缀名

+ 6 - 1
src/main/java/com/yonyou/occ/codegenerator/CodeGeneratorEntry.java

@@ -49,6 +49,11 @@ public class CodeGeneratorEntry {
      */
     private static final String TARGET_PROJECT_ROOT_PATH = "E:\\Yonyou\\project\\OTHER\\occ-toolkit\\code\\";
 
+    /**
+     * 元数据参数(是否主业务对象 1:主业务对象)
+     */
+    private static final String IS_MAIN = "1";
+
     /**
      * 代码生成主函数
      *
@@ -61,7 +66,7 @@ public class CodeGeneratorEntry {
             }
             tableCode = tableCode.trim();
             CodeGenerator codeGenerator = new CodeGenerator(OLD_BASE_PACKAGE, NEW_BASE_PACKAGE, PDM_FILE, tableCode,
-                    REFERENCE_TYPE, IF_USE_CUST_DOC_DEF_REF, AUTHOR, TARGET_PROJECT_ROOT_PATH);
+                    REFERENCE_TYPE, IF_USE_CUST_DOC_DEF_REF, AUTHOR, TARGET_PROJECT_ROOT_PATH, IS_MAIN);
             codeGenerator.run();
         }
     }

File diff suppressed because it is too large
+ 2 - 0
src/main/resources/generator/metaData.ftl