yq il y a 3 ans
Parent
commit
c75904029f

+ 129 - 129
技术分享/MybatisGeneratorUtils.java

@@ -1,129 +1,129 @@
-package com.bizmatics.controller.web;
-
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.InjectionConfig;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.po.TableInfo;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author yq
- * @date 2021/7/6 11:42
- */
-public class MybatisGeneratorUtils {
-    public static void main(String[] args) {
-        //修改成自己的模块名称
-        String[] models = {"test-controller", "test-service", "test-model", "test-persistence"};
-        for (String model : models) {
-            shell(model);
-        }
-    }
-
-    private static void shell(String model) {
-
-        AutoGenerator mpg = new AutoGenerator();
-        //1、全局配置
-        GlobalConfig gc = new GlobalConfig();
-        File file = new File(model);
-        String path = file.getAbsolutePath();
-        gc.setOutputDir(path + "/src/main/java");  //生成路径(一般都是生成在此项目的src/main/java下面)
-        //修改为自己的名字
-        gc.setAuthor("ya"); //设置作者
-        gc.setOpen(false);
-        gc.setFileOverride(true); //第二次生成会把第一次生成的覆盖掉
-        gc.setServiceName("%sService"); //生成的service接口名字首字母是否为I,这样设置就没有
-        gc.setBaseResultMap(true); //生成resultMap
-        mpg.setGlobalConfig(gc);
-
-        //2、数据源配置
-        //修改数据源
-        DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://localhost:3306/test?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
-        dsc.setDriverName("com.mysql.jdbc.Driver");
-        dsc.setUsername("root");
-        dsc.setPassword(null);
-        mpg.setDataSource(dsc);
-
-        // 3、包配置
-        PackageConfig pc = new PackageConfig();
-        pc.setParent("com.bizmatics");
-        pc.setController("controller.web");
-        pc.setEntity("model");
-        pc.setMapper("persistence.mapper");
-        pc.setService("service");
-        pc.setServiceImpl("service.impl");
-        //pc.setModuleName("test");
-        mpg.setPackageInfo(pc);
-
-        // 4、策略配置
-        StrategyConfig strategy = new StrategyConfig();
-        strategy.setNaming(NamingStrategy.underline_to_camel);
-        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
-        strategy.setSuperMapperClass("com.bizmatics.common.mvc.base.CrudMapper");
-        strategy.setSuperServiceClass("com.bizmatics.common.mvc.base.CrudService");
-        strategy.setSuperServiceImplClass("com.bizmatics.common.mvc.base.AbstractCrudService");
-        // strategy.setTablePrefix("t_"); // 表名前缀
-        strategy.setEntityLombokModel(true); //使用lombok
-        //修改自己想要生成的表
-        strategy.setInclude("test");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
-        mpg.setStrategy(strategy);
-
-        // 关闭默认 xml 生成,调整生成 至 根目录
-        //修改对应的模块名称
-        TemplateConfig tc = new TemplateConfig();
-        if ("test-persistence".equals(model)) {
-            tc.setController(null);
-            tc.setEntity(null);
-            tc.setService(null);
-            tc.setServiceImpl(null);
-            // 自定义配置
-            InjectionConfig cfg = new InjectionConfig() {
-                @Override
-                public void initMap() {
-                    // to do nothing
-                }
-            };
-            //如果模板引擎是 velocity
-            String templatePath = "/templates/mapper.xml.vm";
-            // 自定义输出配置
-            List<FileOutConfig> focList = new ArrayList<>();
-            // 自定义配置会被优先输出
-            focList.add(new FileOutConfig(templatePath) {
-                @Override
-                public String outputFile(TableInfo tableInfo) {
-                    // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
-                    return path + "/src/main/resources/mapper/mysql/" + "/"
-                            + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
-                }
-            });
-            cfg.setFileOutConfigList(focList);
-            mpg.setCfg(cfg);
-            tc.setXml(null);
-        } else if ("test-model".equals(model)) {
-            tc.setController(null);
-            tc.setService(null);
-            tc.setServiceImpl(null);
-            tc.setMapper(null);
-            tc.setXml(null);
-        } else if ("test-service".equals(model)) {
-            tc.setController(null);
-            tc.setMapper(null);
-            tc.setXml(null);
-            tc.setEntity(null);
-        } else if ("test-controller".equals(model)) {
-            tc.setMapper(null);
-            tc.setXml(null);
-            tc.setService(null);
-            tc.setServiceImpl(null);
-            tc.setEntity(null);
-        }
-        mpg.setTemplate(tc);
-        //5、执行
-        mpg.execute();
-    }
-}
+//package com.bizmatics.controller.web;
+//
+//import com.baomidou.mybatisplus.core.toolkit.StringPool;
+//import com.baomidou.mybatisplus.generator.AutoGenerator;
+//import com.baomidou.mybatisplus.generator.InjectionConfig;
+//import com.baomidou.mybatisplus.generator.config.*;
+//import com.baomidou.mybatisplus.generator.config.po.TableInfo;
+//import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+//
+//import java.io.File;
+//import java.util.ArrayList;
+//import java.util.List;
+//
+///**
+// * @author yq
+// * @date 2021/7/6 11:42
+// */
+//public class MybatisGeneratorUtils {
+//    public static void main(String[] args) {
+//        //修改成自己的模块名称
+//        String[] models = {"test-controller", "test-service", "test-model", "test-persistence"};
+//        for (String model : models) {
+//            shell(model);
+//        }
+//    }
+//
+//    private static void shell(String model) {
+//
+//        AutoGenerator mpg = new AutoGenerator();
+//        //1、全局配置
+//        GlobalConfig gc = new GlobalConfig();
+//        File file = new File(model);
+//        String path = file.getAbsolutePath();
+//        gc.setOutputDir(path + "/src/main/java");  //生成路径(一般都是生成在此项目的src/main/java下面)
+//        //修改为自己的名字
+//        gc.setAuthor("ya"); //设置作者
+//        gc.setOpen(false);
+//        gc.setFileOverride(true); //第二次生成会把第一次生成的覆盖掉
+//        gc.setServiceName("%sService"); //生成的service接口名字首字母是否为I,这样设置就没有
+//        gc.setBaseResultMap(true); //生成resultMap
+//        mpg.setGlobalConfig(gc);
+//
+//        //2、数据源配置
+//        //修改数据源
+//        DataSourceConfig dsc = new DataSourceConfig();
+//        dsc.setUrl("jdbc:mysql://localhost:3306/test?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
+//        dsc.setDriverName("com.mysql.jdbc.Driver");
+//        dsc.setUsername("root");
+//        dsc.setPassword(null);
+//        mpg.setDataSource(dsc);
+//
+//        // 3、包配置
+//        PackageConfig pc = new PackageConfig();
+//        pc.setParent("com.bizmatics");
+//        pc.setController("controller.web");
+//        pc.setEntity("model");
+//        pc.setMapper("persistence.mapper");
+//        pc.setService("service");
+//        pc.setServiceImpl("service.impl");
+//        //pc.setModuleName("test");
+//        mpg.setPackageInfo(pc);
+//
+//        // 4、策略配置
+//        StrategyConfig strategy = new StrategyConfig();
+//        strategy.setNaming(NamingStrategy.underline_to_camel);
+//        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+//        strategy.setSuperMapperClass("com.bizmatics.common.mvc.base.CrudMapper");
+//        strategy.setSuperServiceClass("com.bizmatics.common.mvc.base.CrudService");
+//        strategy.setSuperServiceImplClass("com.bizmatics.common.mvc.base.AbstractCrudService");
+//        // strategy.setTablePrefix("t_"); // 表名前缀
+//        strategy.setEntityLombokModel(true); //使用lombok
+//        //修改自己想要生成的表
+//        strategy.setInclude("test");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+//        mpg.setStrategy(strategy);
+//
+//        // 关闭默认 xml 生成,调整生成 至 根目录
+//        //修改对应的模块名称
+//        TemplateConfig tc = new TemplateConfig();
+//        if ("test-persistence".equals(model)) {
+//            tc.setController(null);
+//            tc.setEntity(null);
+//            tc.setService(null);
+//            tc.setServiceImpl(null);
+//            // 自定义配置
+//            InjectionConfig cfg = new InjectionConfig() {
+//                @Override
+//                public void initMap() {
+//                    // to do nothing
+//                }
+//            };
+//            //如果模板引擎是 velocity
+//            String templatePath = "/templates/mapper.xml.vm";
+//            // 自定义输出配置
+//            List<FileOutConfig> focList = new ArrayList<>();
+//            // 自定义配置会被优先输出
+//            focList.add(new FileOutConfig(templatePath) {
+//                @Override
+//                public String outputFile(TableInfo tableInfo) {
+//                    // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
+//                    return path + "/src/main/resources/mapper/mysql/" + "/"
+//                            + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+//                }
+//            });
+//            cfg.setFileOutConfigList(focList);
+//            mpg.setCfg(cfg);
+//            tc.setXml(null);
+//        } else if ("test-model".equals(model)) {
+//            tc.setController(null);
+//            tc.setService(null);
+//            tc.setServiceImpl(null);
+//            tc.setMapper(null);
+//            tc.setXml(null);
+//        } else if ("test-service".equals(model)) {
+//            tc.setController(null);
+//            tc.setMapper(null);
+//            tc.setXml(null);
+//            tc.setEntity(null);
+//        } else if ("test-controller".equals(model)) {
+//            tc.setMapper(null);
+//            tc.setXml(null);
+//            tc.setService(null);
+//            tc.setServiceImpl(null);
+//            tc.setEntity(null);
+//        }
+//        mpg.setTemplate(tc);
+//        //5、执行
+//        mpg.execute();
+//    }
+//}

+ 119 - 0
项目需求/东信中控系统需求文档.md

@@ -0,0 +1,119 @@
+# 东信中控系统需求文档
+## 项目背景 
+* 由于东信开发的项目比较多,设计设备设施,门禁,充值,安防等14个子项目
+* 需要对项目进行统一的配置和管理,全方面的了解每一个项目负责的职能和权限管理
+
+
+## 预期目标
+### 用户部门管理
+* 人员管理,人员信息同步,人员信息的新增,修改,查看,删除
+* 部门管理,部门信息同步,部门信息的新增,修改,查看,删除
+### 系统管理
+* 角色管理,角色管理的新增,修改,查看,删除,角色管理人员,角色关联菜单
+* 菜单管理,菜单管理的新增,修改,查看,删除,树状的层级关系
+### 中间键管理
+* 子系统的新增,修改,查看,删除,导出功能
+* 子系统-功能接口,新增,修改,查看,删除,导出
+* 子系统-主机设备,新增,修改,查看,删除,导出
+* 场景管理-----待需求完善
+* 配置管理-----待需求完善
+
+## 总体设计
+### 合作方式
+* 世贸负责用户管理和系统管理
+* 永天负责中间键管理
+
+### 项目拆分方式
+#### 前端
+* 方案一:跟世贸合并开发,再他们的基础上完善相关的代码
+* 方案二:自己独立创建项目,作为一个新项目部署,需要和世贸沟通协调跳转方式
+* 
+#### 后端
+* 首先对世贸的项目不做任何处理,正常的处理这些功能
+* 合并功能需求到充值,安防,设备设施中的其中一个,调用接口的时候通过单点登录来进行接口访问
+
+### 技术栈
+
+#### 前端
+
+##### 框架
+
+* vue3
+
+#### 后端
+
+##### 框架
+
+* springBoot
+* mybatisplus
+
+##### 数据库
+* mysql
+
+##### 中间键
+* redis
+
+### 数据库
+
+#### 数据库表设计
+* 子系统(child_system)
+
+| 列名          | 名称     | 数据类型         | 字段类型     | 长度    | 是否必填 | 描述                |
+|-------------|--------|--------------|----------|-------|------|-------------------|
+| id          | 主键id   | bigint(20)   | bigint   |       | NO   |                   |
+| name        | 系统名称   | varchar(100) | varchar  | 100   | NO   |                   |
+| icon        | 图标     | varchar(200) | varchar  | 200   | NO   |                   |
+| addr        | ip或者域名 | varchar(255) | varchar  | 255   | NO   |                   |
+| path        | 路径     | varchar(255) | varchar  | 255   | NO   |                   |
+| params      | 参数接口   | text         | text     | 65535 | YES  |                   |
+| del_flag    |        | tinyint(255) | tinyint  |       | YES  | 0                 |
+| create_by   | 创建者    | varchar(64)  | varchar  | 64    | YES  |                   |
+| create_time | 创建时间   | datetime     | datetime |       | YES  | CURRENT_TIMESTAMP |
+| update_by   | 更新者    | varchar(64)  | varchar  | 64    | YES  |                   |
+| update_time | 更新时间   | datetime     | datetime |       | YES  |                   |
+| remark      | 备注     | varchar(500) | varchar  | 500   | YES  |
+
+
+* 系统接口(doc_info)
+
+| id          | 主键       | bigint(20)   | bigint   |       | NO  |                   |
+|-------------|----------|--------------|----------|-------|-----|-------------------|
+| name        | 名称       | varchar(50)  | varchar  | 50    | NO  |                   |
+| system_id   | 子系统编号    | bigint(20)   | bigint   |       | NO  |                   |
+| url         | 路径       | varchar(255) | varchar  | 255   | NO  |                   |
+| params      | 参数       | text         | text     | 65535 | YES |                   |
+| enable_flag | 0已开启1未开启 | tinyint(255) | tinyint  |       | NO  |                   |
+| del_flag    |          | tinyint(255) | tinyint  |       | YES | 0                 |
+| create_by   | 创建者      | varchar(64)  | varchar  | 64    | YES |                   |
+| create_time | 创建时间     | datetime     | datetime |       | YES | CURRENT_TIMESTAMP |
+| update_by   | 更新者      | varchar(64)  | varchar  | 64    | YES |                   |
+| update_time | 更新时间     | datetime     | datetime |       | YES |                   |
+| remark      | 备注       | varchar(500) | varchar  | 500   | YES |
+
+
+* 系统设备(main_device)
+
+| id          | 主键id     | bigint(255)  | bigint   |       | NO  |                   |
+|-------------|----------|--------------|----------|-------|-----|-------------------|
+| name        | 名称       | varchar(100) | varchar  | 100   | NO  |                   |
+| params      | 参数       | text         | text     | 65535 | YES |                   |
+| enable_flag | 0未开启1已开启 | tinyint(255) | tinyint  |       | NO  | 0                 |
+| system_id   | 子系统编号    | bigint(20)   | bigint   |       | NO  |                   |
+| del_flag    |          | tinyint(255) | tinyint  |       | YES | 0                 |
+| create_by   | 创建者      | varchar(64)  | varchar  | 64    | YES |                   |
+| create_time | 创建时间     | datetime     | datetime |       | YES | CURRENT_TIMESTAMP |
+| update_by   | 更新者      | varchar(64)  | varchar  | 64    | YES |                   |
+| update_time | 更新时间     | datetime     | datetime |       | YES |                   |
+| remark      | 备注       | varchar(500) | varchar  | 500   | YES |
+
+
+
+
+
+ 
+
+
+
+
+
+

+ 31 - 0
项目需求/东信运营中心需求文档.md

@@ -0,0 +1,31 @@
+# 东信运营中心大屏需求文档
+
+## 项目背景
+* 将东信的几个平台整合起来形成运营中心大屏
+
+## 系统目标
+* 对不同的模块/系统,形成不同的可视化大屏
+* 保证任何数据都能够返回数据,包含延迟的数据或者缓存的数据
+
+
+## 总体设计
+### 项目分类 
+* 大屏可视化服务
+* 数据采集项目
+
+### 分类原因
+* 职能细分,大屏只负责展示,采集负责负责数据的采集
+* 减少并发压力,集采系统需要对接各种不同的技术厂商来进行数据的采集和计算,数据规模较大的时候可以进行集群的部署来实现高扩展性
+* 标注化的形成,有利于形成采集和计算的标准化工程,形成数据仓库
+
+### 模块划分
+* 能源环境
+* 安防监控
+* 出入通行
+* 智慧场景
+* 概览
+
+
+
+
+