From 6a2174585b11f94d84db6b5d9b1d269d09f440be Mon Sep 17 00:00:00 2001 From: admin <1628672303@qq.com> Date: Tue, 11 Apr 2023 09:56:31 +0800 Subject: [PATCH] 4-10 --- .../src/views/fieldx/FieldxList.vue | 2 +- .../src/views/fieldx/modules/FieldxForm.vue | 28 ++++++++----- .../src/views/tablex/TablexList.vue | 22 +++++++++- .../src/views/tablex/modules/TablexForm.vue | 40 ++++++++++--------- .../fieldx/controller/FieldxController.java | 2 + .../jeecg/modules/fieldx/entity/Fieldx.java | 15 ++++--- .../tablex/controller/TablexController.java | 16 +++++++- .../jeecg/modules/tablex/entity/Tablex.java | 10 +++-- 8 files changed, 91 insertions(+), 44 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue b/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue index 7f52f7a..acae4e2 100644 --- a/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue +++ b/ant-design-vue-jeecg/src/views/fieldx/FieldxList.vue @@ -125,7 +125,7 @@ { title:'对应实体id', align:"center", - dataIndex: 'tableId' + dataIndex: 'tableId_dictText' }, { title:'中文名称', diff --git a/ant-design-vue-jeecg/src/views/fieldx/modules/FieldxForm.vue b/ant-design-vue-jeecg/src/views/fieldx/modules/FieldxForm.vue index a2aee6b..8dcd759 100644 --- a/ant-design-vue-jeecg/src/views/fieldx/modules/FieldxForm.vue +++ b/ant-design-vue-jeecg/src/views/fieldx/modules/FieldxForm.vue @@ -4,8 +4,8 @@ - - + + @@ -50,12 +50,12 @@ - + - + @@ -75,19 +75,19 @@ - + - - - - - - + + + + + + @@ -114,6 +114,12 @@ data () { return { model:{ + isPk:'0', + isFk:'0', + isNull:'0', + isUniqueness:'0', + status:'1', + verisonStatus:'1', }, labelCol: { xs: { span: 24 }, diff --git a/ant-design-vue-jeecg/src/views/tablex/TablexList.vue b/ant-design-vue-jeecg/src/views/tablex/TablexList.vue index ff54bc7..1bb52dc 100644 --- a/ant-design-vue-jeecg/src/views/tablex/TablexList.vue +++ b/ant-design-vue-jeecg/src/views/tablex/TablexList.vue @@ -123,7 +123,7 @@ } }, { - title:'对应模块id', + title:'对应模块', align:"center", dataIndex: 'moduleId_dictText' }, @@ -147,6 +147,26 @@ align:"center", dataIndex: 'structuralDiagram' }, + { + title:'创建人', + align:"center", + dataIndex: 'createBy' + }, + { + title:'创建时间', + align:"center", + dataIndex: 'createTime' + }, + { + title:'修改人', + align:"center", + dataIndex: 'updateBy' + }, + { + title:'修改时间', + align:"center", + dataIndex: 'updateTime' + }, { title:'实体状态', align:"center", diff --git a/ant-design-vue-jeecg/src/views/tablex/modules/TablexForm.vue b/ant-design-vue-jeecg/src/views/tablex/modules/TablexForm.vue index 4f48cc6..21a53a0 100644 --- a/ant-design-vue-jeecg/src/views/tablex/modules/TablexForm.vue +++ b/ant-design-vue-jeecg/src/views/tablex/modules/TablexForm.vue @@ -4,38 +4,38 @@ - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - + @@ -69,6 +69,8 @@ data () { return { model:{ + status:1, + verisonStatus:1, }, labelCol: { xs: { span: 24 }, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java index 76271e6..358e077 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java @@ -82,6 +82,8 @@ public class FieldxController extends JeecgController { @ApiOperation(value="字段管理-添加", notes="字段管理-添加") @PostMapping(value = "/add") public Result add(@RequestBody Fieldx fieldx) { + + fieldx.setVerison(1); fieldxService.save(fieldx); return Result.OK("添加成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java index 3af7a35..d511012 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/entity/Fieldx.java @@ -36,8 +36,9 @@ public class Fieldx implements Serializable { @ApiModelProperty(value = "主键") private java.lang.String id; /**对应实体id*/ - @Excel(name = "对应实体id", width = 15) - @ApiModelProperty(value = "对应实体id") + @Excel(name = "对应实体id", width = 15,dictTable="tablex",dicText = "table_name",dicCode = "id") + @ApiModelProperty(value = "对应实体") + @Dict(dictTable="tablex",dicText = "table_name",dicCode = "id") private java.lang.String tableId; /**中文名称*/ @Excel(name = "中文名称", width = 15) @@ -98,6 +99,7 @@ public class Fieldx implements Serializable { private java.lang.String rule; /**创建人*/ @ApiModelProperty(value = "创建人") + @Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") private java.lang.String createBy; /**创建时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @@ -106,6 +108,7 @@ public class Fieldx implements Serializable { private java.util.Date createTime; /**修改人*/ @ApiModelProperty(value = "修改人") + @Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") private java.lang.String updateBy; /**修改时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @@ -113,13 +116,13 @@ public class Fieldx implements Serializable { @ApiModelProperty(value = "修改时间") private java.util.Date updateTime; /**字段状态*/ - @Excel(name = "字段状态", width = 15,dicCode = "yn") - @Dict(dicCode = "yn") + @Excel(name = "字段状态", width = 15,dicCode = "a_status") + @Dict(dicCode = "a_status") @ApiModelProperty(value = "字段状态") private java.lang.Integer status; /**版本状态*/ - @Excel(name = "版本状态", width = 15 ,dicCode = "yn") - @Dict(dicCode = "yn") + @Excel(name = "版本状态", width = 15 ,dicCode = "verison_status") + @Dict(dicCode = "verison_status") @ApiModelProperty(value = "版本状态") private java.lang.Integer verisonStatus; /**版本号*/ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java index bf6e642..e3c2096 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/controller/TablexController.java @@ -12,6 +12,8 @@ import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.modulex.entity.Modulex; +import org.jeecg.modules.modulex.service.IModulexService; import org.jeecg.modules.tablex.entity.Tablex; import org.jeecg.modules.tablex.service.ITablexService; @@ -49,6 +51,9 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class TablexController extends JeecgController { @Autowired private ITablexService tablexService; + + @Autowired + private IModulexService modulexService; /** * 分页列表查询 @@ -82,6 +87,12 @@ public class TablexController extends JeecgController { @ApiOperation(value="实体表-添加", notes="实体表-添加") @PostMapping(value = "/add") public Result add(@RequestBody Tablex tablex) { + if (tablex.getModuleId() != null){ + Modulex modulex = modulexService.getById(tablex.getModuleId()); + tablex.setTableName(modulex.getModuleName()); + tablex.setTableEnName(modulex.getModuleEnName()); + } + tablex.setVerison(1); tablexService.save(tablex); return Result.OK("添加成功!"); } @@ -99,7 +110,7 @@ public class TablexController extends JeecgController { tablexService.updateById(tablex); return Result.OK("编辑成功!"); } - + /** * 通过id删除 * @@ -113,7 +124,8 @@ public class TablexController extends JeecgController { tablexService.removeById(id); return Result.OK("删除成功!"); } - + + /** * 批量删除 * diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/entity/Tablex.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/entity/Tablex.java index 586d057..42e5c6e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/entity/Tablex.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/tablex/entity/Tablex.java @@ -58,6 +58,7 @@ public class Tablex implements Serializable { private java.lang.String structuralDiagram; /**创建人*/ @ApiModelProperty(value = "创建人") + @Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") private java.lang.String createBy; /**创建时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @@ -66,6 +67,7 @@ public class Tablex implements Serializable { private java.util.Date createTime; /**修改人*/ @ApiModelProperty(value = "修改人") + @Dict(dictTable = "sys_user", dicText = "username", dicCode = "id") private java.lang.String updateBy; /**修改时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @@ -73,13 +75,13 @@ public class Tablex implements Serializable { @ApiModelProperty(value = "修改时间") private java.util.Date updateTime; /**实体状态*/ - @Excel(name = "实体状态", width = 15,dicCode = "yn") - @Dict(dicCode = "yn") + @Excel(name = "实体状态", width = 15,dicCode = "a_status") + @Dict(dicCode = "a_status") @ApiModelProperty(value = "实体状态") private java.lang.Integer status; /**版本状态*/ - @Excel(name = "版本状态", width = 15,dicCode = "yn") - @Dict(dicCode = "yn") + @Excel(name = "版本状态", width = 15,dicCode = "verison_status") + @Dict(dicCode = "verison_status") @ApiModelProperty(value = "版本状态") private java.lang.Integer verisonStatus; /**版本号*/