diff --git a/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java b/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java index a3c42ba6..5ce63f39 100644 --- a/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java +++ b/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java @@ -1,5 +1,7 @@ package com.ibeetl.admin.core.web; +import cn.hutool.core.util.StrUtil; +import com.ibeetl.admin.core.annotation.Query; import com.ibeetl.admin.core.gen.*; import com.ibeetl.admin.core.gen.model.Attribute; import com.ibeetl.admin.core.gen.model.Entity; @@ -25,6 +27,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.stream.Collectors; @Controller public class CoreCodeGenController { @@ -34,9 +37,32 @@ public class CoreCodeGenController { @Autowired CoreCodeGenService codeGenService; + /** + * 前端显示字段控制 + */ + public class TableSearchQuery { + @Query(name = "表名称", display = true, fuzzy=true) + private String tableName; + @Query(name = "类名", display = true, fuzzy=true) + private String name; + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getTableName() { + return tableName; + } + public void setTableName(String tableName) { + this.tableName = tableName; + } + } + @GetMapping(MODEL + "/index.do") public ModelAndView index() { ModelAndView view = new ModelAndView("/core/codeGen/index.html"); + view.addObject("search", TableSearchQuery.class.getName()); return view; } @@ -154,15 +180,16 @@ public class CoreCodeGenController { } return target; } - - - @PostMapping(MODEL + "/table.json") @ResponseBody - public JsonResult<List<Entity>> getTable() { + public JsonResult<List<Entity>> getTable(TableSearchQuery tableSearchQuery) { List<Entity> list = codeGenService.getAllEntityInfo(); - return JsonResult.success(list); + List<Entity> result = list.stream().filter( + item -> (StrUtil.isNotBlank(tableSearchQuery.getName()) && item.getName().contains(tableSearchQuery.getName())) + || (StrUtil.isNotBlank(tableSearchQuery.getTableName()) && item.getTableName().contains(tableSearchQuery.getTableName()))) + .collect(Collectors.toList()); + return JsonResult.success(result); } @PostMapping(MODEL + "/tableDetail.json") diff --git a/admin-core/src/main/resources/static/js/core/codeGen/index.js b/admin-core/src/main/resources/static/js/core/codeGen/index.js index b1b0bfff..00886374 100644 --- a/admin-core/src/main/resources/static/js/core/codeGen/index.js +++ b/admin-core/src/main/resources/static/js/core/codeGen/index.js @@ -9,6 +9,10 @@ layui.define([ 'form', 'laydate', 'table','codeApi' ], function(exports) { init:function(){ this.initTable(); this.initToolBar(); + this.initSearchForm(); + window.dataReload = function(){ + Lib.doSearchForm($("#searchForm"), codeTable) + } }, initTable:function(){ codeTable = table.render({ @@ -41,6 +45,9 @@ layui.define([ 'form', 'laydate', 'table','codeApi' ], function(exports) { }); }, + initSearchForm() { + Lib.initSearchForm($("#searchForm"), codeTable, form); + }, initToolBar:function(){ toolbar = { edit : function() { //获取选中数目 diff --git a/admin-core/src/main/resources/templates/core/codeGen/index.html b/admin-core/src/main/resources/templates/core/codeGen/index.html index d99581de..34238ea6 100644 --- a/admin-core/src/main/resources/templates/core/codeGen/index.html +++ b/admin-core/src/main/resources/templates/core/codeGen/index.html @@ -1,9 +1,12 @@ <!--#layout("/common/layout.html",{"jsBase":"/js/core/codeGen/"}){ --> +<layui:searchForm formId="searchForm" searchList="" condition="${search}"> +</layui:searchForm> <div class="layui-btn-group"> <layui:accessButton function="codeGen.edit" action="edit">编辑</layui:accessButton> <layui:accessButton function="codeGen.edit" action="refresh">刷新</layui:accessButton> </div> + <table id="codeTable" lay-filter="codeTable"></table> <!--#} --> <script> diff --git a/doc/sql/mysql/tianze-pro.sql b/doc/sql/mysql/1.tianze-pro.sql similarity index 100% rename from doc/sql/mysql/tianze-pro.sql rename to doc/sql/mysql/1.tianze-pro.sql diff --git a/doc/sql/mysql/tianze-pro-update.sql b/doc/sql/mysql/2.tianze-pro-update.sql similarity index 100% rename from doc/sql/mysql/tianze-pro-update.sql rename to doc/sql/mysql/2.tianze-pro-update.sql diff --git a/doc/sql/mysql/3.tianze-pro-account.sql b/doc/sql/mysql/3.tianze-pro-account.sql new file mode 100644 index 00000000..fed10a83 --- /dev/null +++ b/doc/sql/mysql/3.tianze-pro-account.sql @@ -0,0 +1,51 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +drop table if exists student_account_asset_allocation; + +CREATE TABLE `student_account_asset_allocation` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `student_id` bigint(20) DEFAULT NULL COMMENT '学生ID', + `application_id` bigint(20) DEFAULT NULL COMMENT '应用ID', + `universities_colleges_id` bigint(20) DEFAULT NULL COMMENT '院校ID', + `name` decimal(15,0) DEFAULT NULL COMMENT '账户名称', + `state` tinyint(2) DEFAULT NULL COMMENT '账户开通状态 1:未开通 2:已开通', + `initial_capital` decimal(15,0) DEFAULT NULL COMMENT '期初资金', + `available_funds` decimal(15,0) DEFAULT NULL COMMENT '可用资金', + `into_account` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '转入账户', + `transfer_amount` decimal(15,0) DEFAULT NULL COMMENT '转账金额', + `transferIn_amount` decimal(15,0) DEFAULT NULL COMMENT '转入金额', + `transfer_out_amount` decimal(15,0) DEFAULT NULL COMMENT '转出金额', + `initial_investment_capital` decimal(15,0) DEFAULT NULL COMMENT '期初投资资金', + `borrowed_funds` decimal(15,0) DEFAULT NULL COMMENT '借入资金', + `investment_funds` decimal(15,0) DEFAULT NULL COMMENT '投资资金', + `investment_value` decimal(15,0) DEFAULT NULL COMMENT '投资市值', + `investment_income` decimal(15,0) DEFAULT NULL COMMENT '投资收益', + `total_assets_of_sub_accounts` decimal(15,0) DEFAULT NULL COMMENT '子账户总资产', + `asset_Investment` decimal(15,0) DEFAULT NULL COMMENT '总资产投资收益率', + `return_on_equity` decimal(15,0) DEFAULT NULL COMMENT '净资产收益率', + `is_update` tinyint(2) DEFAULT NULL COMMENT '是否给予初始值 1:未给 2:已给', + `amount_frozen` decimal(15,0) DEFAULT NULL COMMENT '冻结金额', + `update_version` bigint(20) DEFAULT NULL COMMENT '乐观锁', + `update_by` bigint(20) DEFAULT NULL COMMENT '修改人', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `is_del` tinyint(2) DEFAULT '0' COMMENT '是否删除 0:未删除,1:删除', + `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构ID', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='学生资产账户'; + +drop table if exists student_account_trading_record_sheet; + +CREATE TABLE `student_account_trading_record_sheet` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `transaction_amount` decimal(15,0) DEFAULT NULL COMMENT '转入金额', + `transfer_type` varchar(255) DEFAULT NULL COMMENT '转入类型', + `exit_type` varchar(255) DEFAULT NULL COMMENT '转出类型', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `student_id` bigint(20) DEFAULT NULL COMMENT '学生ID', + `user_Id` bigint(20) DEFAULT NULL COMMENT '用户ID', + `org_id` bigint(20) DEFAULT NULL COMMENT '机构ID', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='学生资产账户交易流水'; \ No newline at end of file