生成的代码的CRUD 基本上通过ID操作
public class BizCodeGenerator extends BaseBizGenerator {public static void main(String[] args) {//生成单据类型ThreadLocalGeneratorUtil.setType(GeneratorTypeEnum.ID);BizBillGenerator generator = new BizBillGenerator();String projectPath = System.getProperty("user.dir") + "/base-biz/base-biz-code/src/main";//java代码目录String outputDir = projectPath + "/java";//数据库表String[] tableArray = new String[] {"V_TBL_CODE_PAGE_MODEL_DTL", "V_TBL_CODE_PAGE_MODEL"};//模块,会影响package目录以及@RequiresPermissions(value = {"String module = "code";String packageDir = "com.ctgbs.framework.biz";String xmlDir = projectPath + "/resources/mapper/modules/frame/"+module +"/";Map customConfig = new HashMap(6);customConfig.put("logModel", "FrameModelConstant.CODE");customConfig.put("baseData", false);/*** @param tableSchema 表空间* @param outputDir java文件的输出目录* @param fileOverrideFlg 是否覆盖原来已经生成的同名文件* @param tableArray 要生成的表* @param packageDir 类文件的包名* @param xmlDir xml生成目录* @param moduleName 模块信息* @param customConfig 自定义信息*/ generator.autoGenerator("dataview", outputDir, false, tableArray, packageDir, xmlDir, module , customConfig);ThreadLocalGeneratorUtil.removeType();}
}
基本功能是有单据的逻辑主键(code)为依据,进行增删改查操作,所以 Controller 和 Service 都是通过code 进行操作的。同要要包含树型的parentCode字段信息
主要功能:
树型列表查询(/tree)
根据code来获取(/get)
根据code删除(/remove)
根据code来指定更新对象(/update
根据传入信息创建(/save)
根据传入code检验(/validated)
单据下拉框支持
public class BizCodeGenerator extends BaseBizGenerator {public static void main(String[] args) {//生成单据类型ThreadLocalGeneratorUtil.setType(GeneratorTypeEnum.TREE);BizBillGenerator generator = new BizBillGenerator();String projectPath = System.getProperty("user.dir") + "/base-biz/base-biz-code/src/main";//java代码目录String outputDir = projectPath + "/java";//数据库表String[] tableArray = new String[] {"V_TBL_CODE_PAGE_MODEL_DTL"};//模块,会影响package目录以及@RequiresPermissions(value = {"String module = "code";String packageDir = "com.ctgbs.framework.biz";String xmlDir = projectPath + "/resources/mapper/modules/frame/"+module +"/";Map customConfig = new HashMap(6);customConfig.put("logModel", "FrameModelConstant.CODE");//是否要下拉customConfig.put("baseData", true);/*** @param tableSchema 表空间* @param outputDir java文件的输出目录* @param fileOverrideFlg 是否覆盖原来已经生成的同名文件* @param tableArray 要生成的表* @param packageDir 类文件的包名* @param xmlDir xml生成目录* @param moduleName 模块信息* @param customConfig 自定义信息*/ generator.autoGenerator("dataview", outputDir, false, tableArray, packageDir, xmlDir, module , customConfig);ThreadLocalGeneratorUtil.removeType();}
}
基本功能是有单据的逻辑主键(code)为依据,进行增删改查操作,所以 Controller 和 Service 都是通过code 进行操作的,继承 IBaseDataService
多条件分页查询(/page)
根据code来获取(/get)
根据code删除(/remove)
根据code来指定更新对象(/update
根据传入信息创建(/save)
根据传入code检验(/validated)
单据下拉框支持
生成代码如下:
public class BizCodeGenerator extends BaseBizGenerator {public static void main(String[] args) {//生成单据类型ThreadLocalGeneratorUtil.setType(GeneratorTypeEnum.TREE);BizBillGenerator generator = new BizBillGenerator();String projectPath = System.getProperty("user.dir") + "/base-biz/base-biz-code/src/main";//java代码目录String outputDir = projectPath + "/java";//数据库表String[] tableArray = new String[] {"V_TBL_CODE_PAGE_MODEL_DTL"};//模块,会影响package目录以及@RequiresPermissions(value = {"String module = "code";String packageDir = "com.ctgbs.framework.biz";String xmlDir = projectPath + "/resources/mapper/modules/frame/"+module +"/";Map customConfig = new HashMap(6);customConfig.put("logModel", "FrameModelConstant.CODE");//是否要下拉customConfig.put("baseData", true);/*** @param tableSchema 表空间* @param outputDir java文件的输出目录* @param fileOverrideFlg 是否覆盖原来已经生成的同名文件* @param tableArray 要生成的表* @param packageDir 类文件的包名* @param xmlDir xml生成目录* @param moduleName 模块信息* @param customConfig 自定义信息*/ generator.autoGenerator("dataview", outputDir, false, tableArray, packageDir, xmlDir, module , customConfig);ThreadLocalGeneratorUtil.removeType();}
}