From b16d735d0bab49f564c0bbf4b9f6fbec8e2e8d49 Mon Sep 17 00:00:00 2001 From: rongchao Date: Sun, 26 Apr 2020 20:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 29 + db/epdc-admin.html | 558 +++ db/epdc-admin.pdman.json | 3274 +++++++++++++++++ epdc-cloud-admin/Dockerfile | 20 + epdc-cloud-admin/pom.xml | 257 ++ .../com/elink/esua/epdc/AdminApplication.java | 31 + .../esua/epdc/config/ModuleConfigImpl.java | 26 + .../elink/esua/epdc/config/SwaggerConfig.java | 68 + .../epdc/controller/AppMenuController.java | 141 + .../controller/AppMenuTemplateController.java | 92 + .../controller/AppRoleMenuController.java | 94 + .../esua/epdc/controller/AreaController.java | 55 + .../DeptGridPlatformController.java | 105 + .../epdc/controller/DeptMaCodeController.java | 134 + .../controller/SysAnalysisMenuController.java | 132 + .../SysAnalysisRoleMenuController.java | 94 + .../epdc/controller/SysDeptController.java | 297 ++ .../epdc/controller/SysDictController.java | 155 + .../controller/SysLogErrorController.java | 69 + .../controller/SysLogLoginController.java | 74 + .../controller/SysLogOperationController.java | 73 + .../epdc/controller/SysMenuController.java | 134 + .../epdc/controller/SysParamsController.java | 138 + .../controller/SysResourceController.java | 41 + .../epdc/controller/SysRoleController.java | 136 + .../epdc/controller/SysUserController.java | 466 +++ .../com/elink/esua/epdc/dao/AppMenuDao.java | 91 + .../esua/epdc/dao/AppMenuTemplateDao.java | 33 + .../elink/esua/epdc/dao/AppRoleMenuDao.java | 48 + .../java/com/elink/esua/epdc/dao/AreaDao.java | 16 + .../esua/epdc/dao/DeptGridPlatformDao.java | 42 + .../elink/esua/epdc/dao/DeptMaCodeDao.java | 56 + .../esua/epdc/dao/SysAnalysisMenuDao.java | 84 + .../esua/epdc/dao/SysAnalysisRoleMenuDao.java | 50 + .../com/elink/esua/epdc/dao/SysDeptDao.java | 204 + .../com/elink/esua/epdc/dao/SysDictDao.java | 31 + .../elink/esua/epdc/dao/SysLanguageDao.java | 28 + .../elink/esua/epdc/dao/SysLogErrorDao.java | 25 + .../elink/esua/epdc/dao/SysLogLoginDao.java | 25 + .../esua/epdc/dao/SysLogOperationDao.java | 25 + .../com/elink/esua/epdc/dao/SysMenuDao.java | 53 + .../com/elink/esua/epdc/dao/SysParamsDao.java | 47 + .../elink/esua/epdc/dao/SysResourceDao.java | 49 + .../com/elink/esua/epdc/dao/SysRoleDao.java | 39 + .../esua/epdc/dao/SysRoleDataScopeDao.java | 47 + .../elink/esua/epdc/dao/SysRoleMenuDao.java | 43 + .../elink/esua/epdc/dao/SysRoleUserDao.java | 48 + .../com/elink/esua/epdc/dao/SysUserDao.java | 108 + .../elink/esua/epdc/entity/AppMenuEntity.java | 119 + .../epdc/entity/AppMenuTemplateEntity.java | 72 + .../esua/epdc/entity/AppRoleMenuEntity.java | 49 + .../elink/esua/epdc/entity/AreaEntity.java | 60 + .../epdc/entity/DeptGridPlatformEntity.java | 66 + .../esua/epdc/entity/DeptMaCodeEntity.java | 54 + .../epdc/entity/SysAnalysisMenuEntity.java | 121 + .../entity/SysAnalysisRoleMenuEntity.java | 63 + .../elink/esua/epdc/entity/SysDeptEntity.java | 82 + .../elink/esua/epdc/entity/SysDictEntity.java | 74 + .../esua/epdc/entity/SysLanguageEntity.java | 49 + .../esua/epdc/entity/SysLogErrorEntity.java | 71 + .../esua/epdc/entity/SysLogLoginEntity.java | 63 + .../epdc/entity/SysLogOperationEntity.java | 82 + .../elink/esua/epdc/entity/SysMenuEntity.java | 88 + .../esua/epdc/entity/SysParamsEntity.java | 64 + .../esua/epdc/entity/SysResourceEntity.java | 67 + .../epdc/entity/SysRoleDataScopeEntity.java | 40 + .../elink/esua/epdc/entity/SysRoleEntity.java | 66 + .../esua/epdc/entity/SysRoleMenuEntity.java | 36 + .../esua/epdc/entity/SysRoleUserEntity.java | 37 + .../elink/esua/epdc/entity/SysUserEntity.java | 108 + .../elink/esua/epdc/excel/AppMenuExcel.java | 74 + .../esua/epdc/excel/AppRoleMenuExcel.java | 50 + .../epdc/excel/DeptGridPlatformExcel.java | 68 + .../esua/epdc/excel/DeptMaCodeExcel.java | 62 + .../esua/epdc/excel/SysAnalysisMenuExcel.java | 83 + .../epdc/excel/SysAnalysisRoleMenuExcel.java | 50 + .../esua/epdc/excel/SysLogErrorExcel.java | 39 + .../esua/epdc/excel/SysLogLoginExcel.java | 37 + .../esua/epdc/excel/SysLogOperationExcel.java | 47 + .../elink/esua/epdc/excel/SysParamsExcel.java | 29 + .../elink/esua/epdc/excel/SysUserExcel.java | 43 + .../esua/epdc/feign/GroupFeignClient.java | 45 + .../elink/esua/epdc/feign/OssFeignClient.java | 30 + .../fallback/GroupFeignClientFallback.java | 28 + .../fallback/OssFeignClientFallback.java | 22 + .../com/elink/esua/epdc/log/LogConsumer.java | 91 + .../elink/esua/epdc/redis/AppMenuRedis.java | 47 + .../esua/epdc/redis/AppMenuTemplateRedis.java | 47 + .../esua/epdc/redis/AppRoleMenuRedis.java | 47 + .../com/elink/esua/epdc/redis/AreaRedis.java | 67 + .../epdc/redis/DeptGridPlatformRedis.java | 47 + .../esua/epdc/redis/SysAnalysisMenuRedis.java | 47 + .../epdc/redis/SysAnalysisRoleMenuRedis.java | 47 + .../elink/esua/epdc/redis/SysDictRedis.java | 81 + .../elink/esua/epdc/redis/SysMenuRedis.java | 58 + .../elink/esua/epdc/redis/SysParamsRedis.java | 45 + .../esua/epdc/redis/SysResourceRedis.java | 49 + .../rocketmq/dto/OrganizationModifyDTO.java | 37 + .../producer/OrganizationModifyProducer.java | 44 + .../esua/epdc/service/AppMenuService.java | 155 + .../epdc/service/AppMenuTemplateService.java | 95 + .../esua/epdc/service/AppRoleMenuService.java | 118 + .../elink/esua/epdc/service/AreaService.java | 41 + .../epdc/service/DeptGridPlatformService.java | 105 + .../esua/epdc/service/DeptMaCodeService.java | 124 + .../epdc/service/SysAnalysisMenuService.java | 125 + .../service/SysAnalysisRoleMenuService.java | 111 + .../esua/epdc/service/SysDeptService.java | 274 ++ .../esua/epdc/service/SysDictService.java | 62 + .../esua/epdc/service/SysLanguageService.java | 32 + .../esua/epdc/service/SysLogErrorService.java | 33 + .../esua/epdc/service/SysLogLoginService.java | 33 + .../epdc/service/SysLogOperationService.java | 32 + .../esua/epdc/service/SysMenuService.java | 67 + .../esua/epdc/service/SysParamsService.java | 52 + .../esua/epdc/service/SysResourceService.java | 50 + .../epdc/service/SysRoleDataScopeService.java | 56 + .../esua/epdc/service/SysRoleMenuService.java | 48 + .../esua/epdc/service/SysRoleService.java | 38 + .../esua/epdc/service/SysRoleUserService.java | 55 + .../esua/epdc/service/SysUserService.java | 139 + .../epdc/service/impl/AppMenuServiceImpl.java | 185 + .../impl/AppMenuTemplateServiceImpl.java | 104 + .../service/impl/AppRoleMenuServiceImpl.java | 152 + .../epdc/service/impl/AreaServiceImpl.java | 80 + .../impl/DeptGridPlatformServiceImpl.java | 118 + .../service/impl/DeptMaCodeServiceImpl.java | 244 ++ .../impl/SysAnalysisMenuServiceImpl.java | 162 + .../impl/SysAnalysisRoleMenuServiceImpl.java | 150 + .../epdc/service/impl/SysDeptServiceImpl.java | 1084 ++++++ .../epdc/service/impl/SysDictServiceImpl.java | 153 + .../service/impl/SysLanguageServiceImpl.java | 41 + .../service/impl/SysLogErrorServiceImpl.java | 68 + .../service/impl/SysLogLoginServiceImpl.java | 71 + .../impl/SysLogOperationServiceImpl.java | 72 + .../epdc/service/impl/SysMenuServiceImpl.java | 193 + .../service/impl/SysParamsServiceImpl.java | 128 + .../service/impl/SysResourceServiceImpl.java | 91 + .../impl/SysRoleDataScopeServiceImpl.java | 78 + .../service/impl/SysRoleMenuServiceImpl.java | 69 + .../epdc/service/impl/SysRoleServiceImpl.java | 200 + .../service/impl/SysRoleUserServiceImpl.java | 70 + .../epdc/service/impl/SysUserServiceImpl.java | 293 ++ .../src/main/resources/application-dev.yml | 56 + .../src/main/resources/application-prod.yml | 36 + .../src/main/resources/application-test.yml | 36 + .../src/main/resources/application.yml | 120 + .../src/main/resources/logback-spring.xml | 159 + .../src/main/resources/mapper/AppMenuDao.xml | 166 + .../resources/mapper/AppMenuTemplateDao.xml | 23 + .../main/resources/mapper/AppRoleMenuDao.xml | 21 + .../resources/mapper/DeptGridPlatformDao.xml | 27 + .../main/resources/mapper/DeptMaCodeDao.xml | 40 + .../resources/mapper/SysAnalysisMenuDao.xml | 132 + .../mapper/SysAnalysisRoleMenuDao.xml | 21 + .../src/main/resources/mapper/SysDeptDao.xml | 334 ++ .../src/main/resources/mapper/SysDictDao.xml | 11 + .../main/resources/mapper/SysLanguageDao.xml | 16 + .../main/resources/mapper/SysLogErrorDao.xml | 6 + .../main/resources/mapper/SysLogLoginDao.xml | 6 + .../resources/mapper/SysLogOperationDao.xml | 6 + .../src/main/resources/mapper/SysMenuDao.xml | 42 + .../main/resources/mapper/SysParamsDao.xml | 24 + .../main/resources/mapper/SysResourceDao.xml | 25 + .../src/main/resources/mapper/SysRoleDao.xml | 21 + .../resources/mapper/SysRoleDataScopeDao.xml | 34 + .../main/resources/mapper/SysRoleMenuDao.xml | 18 + .../main/resources/mapper/SysRoleUserDao.xml | 33 + .../src/main/resources/mapper/SysUserDao.xml | 155 + .../src/main/resources/registry.conf | 21 + .../epdc/service/DynamicDataSourceTest.java | 90 + .../service/DynamicDataSourceTestService.java | 66 + .../esua/epdc/service/DynamicService.java | 24 + pom.xml | 19 + 174 files changed, 18316 insertions(+) create mode 100644 .gitignore create mode 100644 db/epdc-admin.html create mode 100644 db/epdc-admin.pdman.json create mode 100755 epdc-cloud-admin/Dockerfile create mode 100644 epdc-cloud-admin/pom.xml create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/AdminApplication.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/SwaggerConfig.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuTemplateController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppRoleMenuController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AreaController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptMaCodeController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDictController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogErrorController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogLoginController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogOperationController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysMenuController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysParamsController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysResourceController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuTemplateDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppRoleMenuDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AreaDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLanguageDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogErrorDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogLoginDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogOperationDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysMenuDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysParamsDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysResourceDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDataScopeDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleMenuDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleUserDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuTemplateEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppRoleMenuEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDeptEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDictEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLanguageEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogErrorEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogLoginEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogOperationEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysMenuEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysParamsEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysResourceEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleDataScopeEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleMenuEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleUserEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysUserEntity.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppMenuExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppRoleMenuExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptMaCodeExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogErrorExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogLoginExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogOperationExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysParamsExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysUserExcel.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/log/LogConsumer.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuTemplateRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppRoleMenuRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysMenuRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysParamsRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysResourceRedis.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/producer/OrganizationModifyProducer.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuTemplateService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppRoleMenuService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AreaService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptMaCodeService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDeptService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDictService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLanguageService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogErrorService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogLoginService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogOperationService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysMenuService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysParamsService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysResourceService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleDataScopeService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleMenuService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleUserService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysUserService.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuTemplateServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppRoleMenuServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLanguageServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogErrorServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogLoginServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogOperationServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysParamsServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysResourceServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleDataScopeServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleMenuServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleUserServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java create mode 100644 epdc-cloud-admin/src/main/resources/application-dev.yml create mode 100644 epdc-cloud-admin/src/main/resources/application-prod.yml create mode 100644 epdc-cloud-admin/src/main/resources/application-test.yml create mode 100644 epdc-cloud-admin/src/main/resources/application.yml create mode 100644 epdc-cloud-admin/src/main/resources/logback-spring.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/AppMenuDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/AppMenuTemplateDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/AppRoleMenuDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/DeptGridPlatformDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/DeptMaCodeDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysAnalysisMenuDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysDictDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysLanguageDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysLogErrorDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysLogLoginDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysLogOperationDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysMenuDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysParamsDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysResourceDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysRoleDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysRoleDataScopeDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysRoleMenuDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysRoleUserDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/mapper/SysUserDao.xml create mode 100644 epdc-cloud-admin/src/main/resources/registry.conf create mode 100644 epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTest.java create mode 100644 epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTestService.java create mode 100644 epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicService.java create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..281336c --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# Created by .ignore support plugin (hsz.mobi) +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +.idea/ +*.iml +**/target/ + diff --git a/db/epdc-admin.html b/db/epdc-admin.html new file mode 100644 index 0000000..0d0ffb2 --- /dev/null +++ b/db/epdc-admin.html @@ -0,0 +1,558 @@ + + + + + epdc-admin + + +
目录
+
+
+ \ No newline at end of file diff --git a/db/epdc-admin.pdman.json b/db/epdc-admin.pdman.json new file mode 100644 index 0000000..4dc077d --- /dev/null +++ b/db/epdc-admin.pdman.json @@ -0,0 +1,3274 @@ +{ + "modules": [ + { + "name": "DB_REVERSE_MYSQL", + "chnname": "逆向解析_MYSQL", + "entities": [ + { + "title": "AREA", + "chnname": "区域表", + "fields": [ + { + "name": "ID", + "type": "INT_10", + "chnname": "", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARENT_ID", + "type": "INT_10", + "chnname": "父级ID", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "NAME", + "type": "VARCHAR_50", + "chnname": "名称", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SHORT_NAME", + "type": "VARCHAR_50", + "chnname": "简称", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LONGITUDE", + "type": "FLOAT_12", + "chnname": "经度", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LATITUDE", + "type": "FLOAT_12", + "chnname": "纬度", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LEVEL", + "type": "INT_10", + "chnname": "等级(1省/直辖市,2地级市,3区县,4镇/街道)", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SORT", + "type": "INT_10", + "chnname": "排序", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "STATUS", + "type": "INT_10", + "chnname": "状态(0禁用/1启用)", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + } + ], + "indexs": [], + "headers": [ + { + "fieldName": "chnname", + "relationNoShow": false + }, + { + "fieldName": "name", + "relationNoShow": false + }, + { + "fieldName": "type", + "relationNoShow": false + }, + { + "fieldName": "dataType", + "relationNoShow": true + }, + { + "fieldName": "remark", + "relationNoShow": true + }, + { + "fieldName": "pk", + "relationNoShow": false + }, + { + "fieldName": "notNull", + "relationNoShow": true + }, + { + "fieldName": "autoIncrement", + "relationNoShow": true + }, + { + "fieldName": "defaultValue", + "relationNoShow": true + }, + { + "fieldName": "relationNoShow", + "relationNoShow": true + }, + { + "fieldName": "uiHint", + "relationNoShow": true + } + ], + "remark": "区域表" + }, + { + "title": "EPDC_DEPT_MA_CODE", + "chnname": "网格小程序码", + "fields": [ + { + "name": "ID", + "type": "VARCHAR_32", + "chnname": "主键", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "GRID_ID", + "type": "BIGINT_19", + "chnname": "网格ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CODE_URL", + "type": "VARCHAR_512", + "chnname": "小程序码URL", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LEADER_FLAG", + "type": "VARCHAR_1", + "chnname": "是否是网格长码,0否 1是", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REVISION", + "type": "INT_10", + "chnname": "乐观锁", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATED_BY", + "type": "VARCHAR_32", + "chnname": "创建人", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATED_TIME", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATED_BY", + "type": "VARCHAR_32", + "chnname": "更新人", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATED_TIME", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "VARCHAR_1", + "chnname": "删除标记", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + } + ], + "indexs": [], + "headers": [ + { + "fieldName": "chnname", + "relationNoShow": false + }, + { + "fieldName": "name", + "relationNoShow": false + }, + { + "fieldName": "type", + "relationNoShow": false + }, + { + "fieldName": "dataType", + "relationNoShow": true + }, + { + "fieldName": "remark", + "relationNoShow": true + }, + { + "fieldName": "pk", + "relationNoShow": false + }, + { + "fieldName": "notNull", + "relationNoShow": true + }, + { + "fieldName": "autoIncrement", + "relationNoShow": true + }, + { + "fieldName": "defaultValue", + "relationNoShow": true + }, + { + "fieldName": "relationNoShow", + "relationNoShow": true + }, + { + "fieldName": "uiHint", + "relationNoShow": true + } + ] + }, + { + "title": "SYS_APP_MENU", + "chnname": "菜单管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PID", + "type": "BIGINT_19", + "chnname": "上级ID,一级菜单为0", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "URL", + "type": "VARCHAR_200", + "chnname": "菜单URL", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "TYPE", + "type": "TINYINT UNSIGNED_3", + "chnname": "类型 0:菜单 1:按钮", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ICON", + "type": "VARCHAR_50", + "chnname": "菜单图标", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PERMISSIONS", + "type": "VARCHAR_32", + "chnname": "权限标识,如:sys:menu:save", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SORT", + "type": "INT_10", + "chnname": "排序", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "删除标识 0:未删除 1:删除", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MENU_CODE", + "type": "VARCHAR_50", + "chnname": "菜单编码", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_APP_ROLE_MENU", + "chnname": "角色菜单关系", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ROLE_ID", + "type": "BIGINT_19", + "chnname": "角色ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MENU_ID", + "type": "BIGINT_19", + "chnname": "菜单ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_DEPT", + "chnname": "部门管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PID", + "type": "BIGINT_19", + "chnname": "上级ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PIDS", + "type": "VARCHAR_500", + "chnname": "所有上级ID,用逗号分开", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "NAME", + "type": "VARCHAR_50", + "chnname": "部门名称", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SORT", + "type": "INT UNSIGNED_10", + "chnname": "排序", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "删除标识 0:未删除 1:删除", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "TYPE_KEY", + "type": "VARCHAR_50", + "chnname": "机构类型键值", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARTY_CODE", + "type": "VARCHAR_50", + "chnname": "部门编码", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PPID", + "type": "BIGINT_19", + "chnname": "所属党委ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_DICT", + "chnname": "数据字典", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PID", + "type": "BIGINT_19", + "chnname": "上级ID,一级为0", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DICT_TYPE", + "type": "VARCHAR_50", + "chnname": "字典类型", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DICT_NAME", + "type": "VARCHAR_255", + "chnname": "字典名称", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DICT_VALUE", + "type": "VARCHAR_255", + "chnname": "字典值", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REMARK", + "type": "VARCHAR_255", + "chnname": "备注", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SORT", + "type": "INT UNSIGNED_10", + "chnname": "排序", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "删除标识 0:未删除 1:删除", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_LANGUAGE", + "chnname": "国际化", + "fields": [ + { + "name": "TABLE_NAME", + "type": "VARCHAR_32", + "chnname": "表名", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "TABLE_ID", + "type": "BIGINT_19", + "chnname": "表主键", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "FIELD_NAME", + "type": "VARCHAR_32", + "chnname": "字段名", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "FIELD_VALUE", + "type": "VARCHAR_200", + "chnname": "字段值", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LANGUAGE", + "type": "VARCHAR_10", + "chnname": "语言", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_LOG_ERROR", + "chnname": "异常日志", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MODULE", + "type": "VARCHAR_50", + "chnname": "模块名称,如:sys", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REQUEST_URI", + "type": "VARCHAR_200", + "chnname": "请求URI", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REQUEST_METHOD", + "type": "VARCHAR_20", + "chnname": "请求方式", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REQUEST_PARAMS", + "type": "TEXT", + "chnname": "请求参数", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "USER_AGENT", + "type": "VARCHAR_500", + "chnname": "用户代理", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "IP", + "type": "VARCHAR_32", + "chnname": "操作IP", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ERROR_INFO", + "type": "TEXT", + "chnname": "异常信息", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_LOG_LOGIN", + "chnname": "登录日志", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "OPERATION", + "type": "TINYINT UNSIGNED_3", + "chnname": "用户操作 0:用户登录 1:用户退出", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "STATUS", + "type": "TINYINT UNSIGNED_3", + "chnname": "状态 0:失败 1:成功 2:账号已锁定", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "USER_AGENT", + "type": "VARCHAR_500", + "chnname": "用户代理", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "IP", + "type": "VARCHAR_32", + "chnname": "操作IP", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR_NAME", + "type": "VARCHAR_50", + "chnname": "用户名", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_LOG_OPERATION", + "chnname": "操作日志", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MODULE", + "type": "VARCHAR_32", + "chnname": "模块名称,如:sys", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "OPERATION", + "type": "VARCHAR_50", + "chnname": "用户操作", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REQUEST_URI", + "type": "VARCHAR_200", + "chnname": "请求URI", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REQUEST_METHOD", + "type": "VARCHAR_20", + "chnname": "请求方式", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REQUEST_PARAMS", + "type": "TEXT", + "chnname": "请求参数", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REQUEST_TIME", + "type": "INT UNSIGNED_10", + "chnname": "请求时长(毫秒)", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "USER_AGENT", + "type": "VARCHAR_500", + "chnname": "用户代理", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "IP", + "type": "VARCHAR_32", + "chnname": "操作IP", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "STATUS", + "type": "TINYINT UNSIGNED_3", + "chnname": "状态 0:失败 1:成功", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR_NAME", + "type": "VARCHAR_50", + "chnname": "用户名", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_MAIL_LOG", + "chnname": "邮件发送记录", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "TEMPLATE_ID", + "type": "BIGINT_19", + "chnname": "邮件模板ID", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MAIL_FROM", + "type": "VARCHAR_200", + "chnname": "发送者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MAIL_TO", + "type": "VARCHAR_400", + "chnname": "收件人", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MAIL_CC", + "type": "VARCHAR_400", + "chnname": "抄送者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SUBJECT", + "type": "VARCHAR_200", + "chnname": "邮件主题", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CONTENT", + "type": "TEXT", + "chnname": "邮件正文", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "STATUS", + "type": "TINYINT UNSIGNED_3", + "chnname": "发送状态 0:失败 1:成功", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_MAIL_TEMPLATE", + "chnname": "邮件模板", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "NAME", + "type": "VARCHAR_100", + "chnname": "模板名称", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SUBJECT", + "type": "VARCHAR_200", + "chnname": "邮件主题", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CONTENT", + "type": "TEXT", + "chnname": "邮件正文", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_MENU", + "chnname": "菜单管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PID", + "type": "BIGINT_19", + "chnname": "上级ID,一级菜单为0", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "URL", + "type": "VARCHAR_200", + "chnname": "菜单URL", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "TYPE", + "type": "TINYINT UNSIGNED_3", + "chnname": "类型 0:菜单 1:按钮", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ICON", + "type": "VARCHAR_50", + "chnname": "菜单图标", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PERMISSIONS", + "type": "VARCHAR_32", + "chnname": "权限标识,如:sys:menu:save", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SORT", + "type": "INT_10", + "chnname": "排序", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "删除标识 0:未删除 1:删除", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MENU_CODE", + "type": "VARCHAR_50", + "chnname": "菜单编码", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_OSS", + "chnname": "文件上传", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "URL", + "type": "VARCHAR_200", + "chnname": "URL地址", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_PARAMS", + "chnname": "参数管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARAM_CODE", + "type": "VARCHAR_32", + "chnname": "参数编码", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARAM_VALUE", + "type": "VARCHAR_2000", + "chnname": "参数值", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARAM_TYPE", + "type": "TINYINT UNSIGNED_3", + "chnname": "类型 0:系统参数 1:非系统参数", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REMARK", + "type": "VARCHAR_200", + "chnname": "备注", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "删除标识 0:未删除 1:删除", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_PARTY_DEPT", + "chnname": "党委部门管理 党委部门管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "主键", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PID", + "type": "BIGINT_19", + "chnname": "上级ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PIDS", + "type": "VARCHAR_500", + "chnname": "所有上级ID,用逗号分开", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "NAME", + "type": "VARCHAR_50", + "chnname": "部门名称", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "TYPE_KEY", + "type": "VARCHAR_50", + "chnname": "机构类型键值", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARTY_CODE", + "type": "VARCHAR_50", + "chnname": "部门编码", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SORT", + "type": "INT_10", + "chnname": "排序", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "VARCHAR_1", + "chnname": "删除标记", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATED_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATED_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_RESOURCE", + "chnname": "资源管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "RESOURCE_CODE", + "type": "VARCHAR_32", + "chnname": "资源编码,如菜单ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "RESOURCE_NAME", + "type": "VARCHAR_32", + "chnname": "资源名称", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "RESOURCE_URL", + "type": "VARCHAR_100", + "chnname": "资源URL", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "RESOURCE_METHOD", + "type": "VARCHAR_8", + "chnname": "请求方式(如:GET、POST、PUT、DELETE)", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MENU_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "菜单标识 0:非菜单资源 1:菜单资源", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "AUTH_LEVEL", + "type": "TINYINT UNSIGNED_3", + "chnname": "认证等级 0:权限认证 1:登录认证 2:无需认证", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_ROLE", + "chnname": "角色管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "NAME", + "type": "VARCHAR_32", + "chnname": "角色名称", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "TYPE_KEY", + "type": "VARCHAR_32", + "chnname": "角色类型键值(数据字典sysRoleType)", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REMARK", + "type": "VARCHAR_100", + "chnname": "备注", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "删除标识 0:未删除 1:删除", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEPT_ID", + "type": "BIGINT_19", + "chnname": "部门ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_ROLE_DATA_SCOPE", + "chnname": "角色数据权限", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ROLE_ID", + "type": "BIGINT_19", + "chnname": "角色ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEPT_ID", + "type": "BIGINT_19", + "chnname": "部门ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_ROLE_MENU", + "chnname": "角色菜单关系", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ROLE_ID", + "type": "BIGINT_19", + "chnname": "角色ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MENU_ID", + "type": "BIGINT_19", + "chnname": "菜单ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_ROLE_USER", + "chnname": "角色用户关系", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ROLE_ID", + "type": "BIGINT_19", + "chnname": "角色ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "USER_ID", + "type": "BIGINT_19", + "chnname": "用户ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_SMS", + "chnname": "短信", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PLATFORM", + "type": "TINYINT UNSIGNED_3", + "chnname": "平台类型", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MOBILE", + "type": "VARCHAR_20", + "chnname": "手机号", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARAMS_1", + "type": "VARCHAR_50", + "chnname": "参数1", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARAMS_2", + "type": "VARCHAR_50", + "chnname": "参数2", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARAMS_3", + "type": "VARCHAR_50", + "chnname": "参数3", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PARAMS_4", + "type": "VARCHAR_50", + "chnname": "参数4", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "STATUS", + "type": "TINYINT UNSIGNED_3", + "chnname": "发送状态 0:失败 1:成功", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "SYS_USER", + "chnname": "用户管理", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "id", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "USERNAME", + "type": "VARCHAR_50", + "chnname": "用户名", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "PASSWORD", + "type": "VARCHAR_100", + "chnname": "密码", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REAL_NAME", + "type": "VARCHAR_50", + "chnname": "姓名", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "HEAD_URL", + "type": "VARCHAR_200", + "chnname": "头像", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "GENDER", + "type": "TINYINT UNSIGNED_3", + "chnname": "性别 1:男 0:女 2:保密", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "EMAIL", + "type": "VARCHAR_100", + "chnname": "邮箱", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "MOBILE", + "type": "VARCHAR_20", + "chnname": "手机号", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEPT_ID", + "type": "BIGINT_19", + "chnname": "部门ID", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "SUPER_ADMIN", + "type": "TINYINT UNSIGNED_3", + "chnname": "超级管理员 0:否 1:是", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "STATUS", + "type": "TINYINT UNSIGNED_3", + "chnname": "状态 0:停用 1:正常", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "REMARK", + "type": "VARCHAR_200", + "chnname": "备注", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "DEL_FLAG", + "type": "TINYINT UNSIGNED_3", + "chnname": "删除标识 0:未删除 1:删除", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATOR", + "type": "BIGINT_19", + "chnname": "创建者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CREATE_DATE", + "type": "DATETIME", + "chnname": "创建时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATER", + "type": "BIGINT_19", + "chnname": "更新者", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "UPDATE_DATE", + "type": "DATETIME", + "chnname": "更新时间", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "USER_TAG_KEY", + "type": "VARCHAR_15", + "chnname": "用户标签键值", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ] + }, + { + "title": "UNDO_LOG", + "chnname": "分布式事务日志表", + "fields": [ + { + "name": "ID", + "type": "BIGINT_19", + "chnname": "", + "remark": "", + "pk": true, + "notNull": true, + "autoIncrement": true, + "defaultValue": "" + }, + { + "name": "BRANCH_ID", + "type": "BIGINT_19", + "chnname": "", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "XID", + "type": "VARCHAR_100", + "chnname": "", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "CONTEXT", + "type": "VARCHAR_128", + "chnname": "", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "ROLLBACK_INFO", + "type": "LONGBLOB", + "chnname": "", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LOG_STATUS", + "type": "INT_10", + "chnname": "", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LOG_CREATED", + "type": "DATETIME", + "chnname": "", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "LOG_MODIFIED", + "type": "DATETIME", + "chnname": "", + "remark": "", + "pk": false, + "notNull": true, + "autoIncrement": false, + "defaultValue": "" + }, + { + "name": "EXT", + "type": "VARCHAR_100", + "chnname": "", + "remark": "", + "pk": false, + "notNull": false, + "autoIncrement": false, + "defaultValue": "" + } + ], + "indexs": [], + "headers": [ + { + "fieldName": "chnname", + "relationNoShow": false + }, + { + "fieldName": "name", + "relationNoShow": false + }, + { + "fieldName": "type", + "relationNoShow": false + }, + { + "fieldName": "dataType", + "relationNoShow": true + }, + { + "fieldName": "remark", + "relationNoShow": true + }, + { + "fieldName": "pk", + "relationNoShow": false + }, + { + "fieldName": "notNull", + "relationNoShow": true + }, + { + "fieldName": "autoIncrement", + "relationNoShow": true + }, + { + "fieldName": "defaultValue", + "relationNoShow": true + }, + { + "fieldName": "relationNoShow", + "relationNoShow": true + }, + { + "fieldName": "uiHint", + "relationNoShow": true + } + ], + "remark": "分布式事务日志表" + } + ], + "graphCanvas": { + "nodes": [], + "edges": [] + }, + "associations": [] + } + ], + "dataTypeDomains": { + "datatype": [ + { + "name": "默认字串", + "code": "DefaultString", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "VARCHAR(32)" + }, + "ORACLE": { + "type": "NVARCHAR2(32)" + }, + "SQLServer": { + "type": "NVARCHAR(32)" + }, + "PostgreSQL": { + "type": "VARCHAR(32)" + } + } + }, + { + "name": "标识号", + "code": "IdOrKey", + "apply": { + "JAVA": { + "type": "String" + }, + "ORACLE": { + "type": "VARCHAR2(32)" + }, + "MYSQL": { + "type": "VARCHAR(32)" + }, + "SQLServer": { + "type": "VARCHAR(32)" + }, + "PostgreSQL": { + "type": "VARCHAR(32)" + } + } + }, + { + "name": "标识号-长", + "code": "LongKey", + "apply": { + "MYSQL": { + "type": "VARCHAR(64)" + }, + "ORACLE": { + "type": "VARCHAR2(64)" + }, + "JAVA": { + "type": "String" + }, + "SQLServer": { + "type": "VARCHAR(64)" + }, + "PostgreSQL": { + "type": "VARCHAR(64)" + } + } + }, + { + "name": "名称", + "code": "Name", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "VARCHAR(128)" + }, + "ORACLE": { + "type": "NVARCHAR2(128)" + }, + "SQLServer": { + "type": "NVARCHAR(128)" + }, + "PostgreSQL": { + "type": "VARCHAR(128)" + } + } + }, + { + "name": "备注说明", + "code": "Intro", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "VARCHAR(512)" + }, + "ORACLE": { + "type": "NVARCHAR2(512)" + }, + "SQLServer": { + "type": "NVARCHAR(512)" + }, + "PostgreSQL": { + "type": "VARCHAR(512)" + } + } + }, + { + "name": "字串-短", + "code": "ShortString", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "VARCHAR(128)" + }, + "ORACLE": { + "type": "NVARCHAR2(128)" + }, + "SQLServer": { + "type": "NVARCHAR(128)" + }, + "PostgreSQL": { + "type": "VARCHAR(128)" + } + } + }, + { + "name": "字串-中", + "code": "MiddleString", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "VARCHAR(1024)" + }, + "ORACLE": { + "type": "NVARCHAR2(1024)" + }, + "SQLServer": { + "type": "NVARCHAR(1024)" + }, + "PostgreSQL": { + "type": "VARCHAR(1024)" + } + } + }, + { + "name": "字串-长", + "code": "LongString", + "apply": { + "JAVA": { + "type": "String" + }, + "ORACLE": { + "type": "NVARCHAR2(3072)" + }, + "MYSQL": { + "type": "VARCHAR(3072)" + }, + "SQLServer": { + "type": "NVARCHAR(3072)" + }, + "PostgreSQL": { + "type": "VARCHAR(3072)" + } + } + }, + { + "name": "大文本", + "code": "LongText", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "TEXT" + }, + "ORACLE": { + "type": "CLOB" + }, + "SQLServer": { + "type": "NTEXT" + }, + "PostgreSQL": { + "type": "TEXT" + } + } + }, + { + "name": "小数", + "code": "Double", + "apply": { + "JAVA": { + "type": "Double" + }, + "MYSQL": { + "type": "DECIMAL(32,10)" + }, + "ORACLE": { + "type": "NUMBER(32,10)" + }, + "SQLServer": { + "type": "DECIMAL(32,10)" + }, + "PostgreSQL": { + "type": "DECIMAL(32,10)" + } + } + }, + { + "name": "比例", + "code": "Ratio", + "apply": { + "MYSQL": { + "type": "DECIMAL(4,2)" + }, + "JAVA": { + "type": "Double" + }, + "ORACLE": { + "type": "NUMBER(4,2)" + }, + "SQLServer": { + "type": "DECIMAL(4,2)" + }, + "PostgreSQL": { + "type": "DECIMAL(4,2)" + } + } + }, + { + "name": "整数", + "code": "Integer", + "apply": { + "JAVA": { + "type": "Integer" + }, + "MYSQL": { + "type": "INT" + }, + "ORACLE": { + "type": "INT" + }, + "SQLServer": { + "type": "INT" + }, + "PostgreSQL": { + "type": "INT" + } + } + }, + { + "name": "大整数", + "code": "BigInt", + "apply": { + "MYSQL": { + "type": "BIGINT" + }, + "JAVA": { + "type": "Long" + }, + "ORACLE": { + "type": "NUMBER" + }, + "SQLServer": { + "type": "BIGINT" + }, + "PostgreSQL": { + "type": "BIGINT" + } + } + }, + { + "name": "金额", + "code": "Money", + "apply": { + "JAVA": { + "type": "Double" + }, + "MYSQL": { + "type": "DECIMAL(32,8)" + }, + "ORACLE": { + "type": "NUMBER(32,8)" + }, + "SQLServer": { + "type": "DECIMAL(32,8)" + }, + "PostgreSQL": { + "type": "DECIMAL(32,8)" + } + } + }, + { + "name": "是否", + "code": "YesNo", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "VARCHAR(1)" + }, + "ORACLE": { + "type": "VARCHAR2(1)" + }, + "SQLServer": { + "type": "VARCHAR(1)" + }, + "PostgreSQL": { + "type": "VARCHAR(1)" + } + } + }, + { + "name": "数据字典", + "code": "Dict", + "apply": { + "JAVA": { + "type": "String" + }, + "MYSQL": { + "type": "VARCHAR(32)" + }, + "ORACLE": { + "type": "VARCHAR2(32)" + }, + "SQLServer": { + "type": "VARCHAR(32)" + }, + "PostgreSQL": { + "type": "VARCHAR(32)" + } + } + }, + { + "name": "日期", + "code": "Date", + "apply": { + "JAVA": { + "type": "Date" + }, + "MYSQL": { + "type": "DATE" + }, + "ORACLE": { + "type": "DATE" + }, + "SQLServer": { + "type": "DATE" + }, + "PostgreSQL": { + "type": "DATE" + } + } + }, + { + "name": "日期时间", + "code": "DateTime", + "apply": { + "JAVA": { + "type": "Date" + }, + "MYSQL": { + "type": "DATETIME" + }, + "ORACLE": { + "type": "DATE" + }, + "SQLServer": { + "type": "DATE" + }, + "PostgreSQL": { + "type": "DATE" + } + } + }, + { + "name": "单字符", + "code": "Char", + "apply": { + "MYSQL": { + "type": "CHAR(1)" + }, + "ORACLE": { + "type": "CHAR(1)" + }, + "JAVA": { + "type": "String" + }, + "SQLServer": { + "type": "CHAR(1)" + }, + "PostgreSQL": { + "type": "CHAR(1)" + } + } + }, + { + "name": "BIGINT_19", + "code": "BIGINT_19", + "apply": { + "MYSQL": { + "type": "BIGINT(19)" + } + } + }, + { + "name": "DATETIME", + "code": "DATETIME", + "apply": { + "MYSQL": { + "type": "DATETIME" + } + } + }, + { + "name": "FLOAT_12", + "code": "FLOAT_12", + "apply": { + "MYSQL": { + "type": "FLOAT(12)" + } + } + }, + { + "name": "INT UNSIGNED_10", + "code": "INT UNSIGNED_10", + "apply": { + "MYSQL": { + "type": "INT UNSIGNED(10)" + } + } + }, + { + "name": "INT_10", + "code": "INT_10", + "apply": { + "MYSQL": { + "type": "INT(10)" + } + } + }, + { + "name": "LONGBLOB", + "code": "LONGBLOB", + "apply": { + "MYSQL": { + "type": "LONGBLOB" + } + } + }, + { + "name": "TEXT", + "code": "TEXT", + "apply": { + "MYSQL": { + "type": "TEXT" + } + } + }, + { + "name": "TINYINT UNSIGNED_3", + "code": "TINYINT UNSIGNED_3", + "apply": { + "MYSQL": { + "type": "TINYINT UNSIGNED(3)" + } + } + }, + { + "name": "VARCHAR_1", + "code": "VARCHAR_1", + "apply": { + "MYSQL": { + "type": "VARCHAR(1)" + } + } + }, + { + "name": "VARCHAR_10", + "code": "VARCHAR_10", + "apply": { + "MYSQL": { + "type": "VARCHAR(10)" + } + } + }, + { + "name": "VARCHAR_100", + "code": "VARCHAR_100", + "apply": { + "MYSQL": { + "type": "VARCHAR(100)" + } + } + }, + { + "name": "VARCHAR_128", + "code": "VARCHAR_128", + "apply": { + "MYSQL": { + "type": "VARCHAR(128)" + } + } + }, + { + "name": "VARCHAR_15", + "code": "VARCHAR_15", + "apply": { + "MYSQL": { + "type": "VARCHAR(15)" + } + } + }, + { + "name": "VARCHAR_20", + "code": "VARCHAR_20", + "apply": { + "MYSQL": { + "type": "VARCHAR(20)" + } + } + }, + { + "name": "VARCHAR_200", + "code": "VARCHAR_200", + "apply": { + "MYSQL": { + "type": "VARCHAR(200)" + } + } + }, + { + "name": "VARCHAR_2000", + "code": "VARCHAR_2000", + "apply": { + "MYSQL": { + "type": "VARCHAR(2000)" + } + } + }, + { + "name": "VARCHAR_255", + "code": "VARCHAR_255", + "apply": { + "MYSQL": { + "type": "VARCHAR(255)" + } + } + }, + { + "name": "VARCHAR_32", + "code": "VARCHAR_32", + "apply": { + "MYSQL": { + "type": "VARCHAR(32)" + } + } + }, + { + "name": "VARCHAR_400", + "code": "VARCHAR_400", + "apply": { + "MYSQL": { + "type": "VARCHAR(400)" + } + } + }, + { + "name": "VARCHAR_50", + "code": "VARCHAR_50", + "apply": { + "MYSQL": { + "type": "VARCHAR(50)" + } + } + }, + { + "name": "VARCHAR_500", + "code": "VARCHAR_500", + "apply": { + "MYSQL": { + "type": "VARCHAR(500)" + } + } + }, + { + "name": "VARCHAR_512", + "code": "VARCHAR_512", + "apply": { + "MYSQL": { + "type": "VARCHAR(512)" + } + } + }, + { + "name": "VARCHAR_8", + "code": "VARCHAR_8", + "apply": { + "MYSQL": { + "type": "VARCHAR(8)" + } + } + } + ], + "database": [ + { + "code": "MYSQL", + "template": "DROP TABLE {{=it.entity.title}};\n$blankline\nCREATE TABLE {{=it.entity.title}}(\n{{ pkList = [] ; }}\n{{~it.entity.fields:field:index}}\n {{? field.pk }}{{ pkList.push(field.name) }}{{?}}\n {{=field.name}} {{=field.type}} {{= field.pk ? 'NOT NULL' : '' }} COMMENT '{{=it.func.join(field.chnname,field.remark,';')}}' {{= index < it.entity.fields.length-1 ? ',' : ( pkList.length>0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}{{? pkList.length >0 }} PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n CONSTRAINT PK_{{=it.entity.title}} PRIMARY KEY CLUSTERED ({{~pkList:pkName:i}}{{= pkName }} ASC {{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i0 ? ',' :'' ) }}\n{{~}}\n{{? pkList.length >0 }}\n PRIMARY KEY ({{~pkList:pkName:i}}{{= pkName }}{{= i + + 4.0.0 + + + com.esua.epdc.yushan + epdc-cloud-parent-yushan + 1.0.0 + ../epdc-cloud-parent-yushan + + + epdc-cloud-admin + jar + 榆山党群e家管理微服务模块 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework + spring-context-support + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + org.springframework.cloud + spring-cloud-starter-zipkin + + + + + io.github.openfeign + feign-httpclient + + + + + org.apache.rocketmq + rocketmq-spring-boot-starter + 2.0.3 + + + + + com.esua.epdc.yushan + epdc-commons-mybatis + ${epdc-cloud-commons.version} + + + + com.esua.epdc.yushan + epdc-commons-dynamic-datasource + ${epdc-cloud-commons.version} + + + + + com.esua.epdc.yushan + epdc-commons-tools-wx-ma + ${epdc-cloud-commons.version} + + + + + + + com.esua.epdc.yushan + epdc-cloud-events-client + ${epdc-cloud-client.version} + + + + com.esua.epdc.yushan + epdc-cloud-admin-client + ${epdc-cloud-client.version} + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + com.spotify + dockerfile-maven-plugin + + + + ${project.basedir}/src/main/java + + + + true + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + + + + + dev + + true + + + 9092 + dev + dev + + 2 + 114.215.125.123 + 9603 + epdc!redis@master1405 + + + false + 47.104.224.45:8848 + + a746dde3-7a13-4521-b986-7369b0b7c269 + + http://localhost:9411 + + wxdd8530c5f4926766 + 5bf4fb813145431b3493a10aa7e041e9 + + wx29b074840ef4bfd9 + 4adb1afccc69f205cdf5b521d74e2aca + + wxfa4afaa2b5f9c876 + 7db9f049c78c9a6cafa673deebe8330d + + 47.104.85.99:9876;114.215.125.123:9876 + organizationGroup + + + + + test + + 10021 + test + test + + + true + 47.104.224.45:8848 + 47.104.85.99 + 6a3577b4-7b79-43f6-aebb-9c3f31263f6a + + http://localhost:9411 + + + + + + wx5d3e97461d248397 + bfed51b731e53db9affb9e6131e7ae12 + + wx9f20a46906ab2c3e + dc13065f79429979d9f687d249eb5c4e + + wxfa4afaa2b5f9c876 + 7db9f049c78c9a6cafa673deebe8330d + + 47.104.85.99:9876;114.215.125.123:9876 + organizationGroup + + + + + prod + + 9055 + prod + prod + + + 0 + 172.16.0.54 + 6379 + Elink833066 + + + true + 172.16.0.52:8848 + + + + http://172.31.171.61:9411 + + + wxdd8530c5f4926766 + 5bf4fb813145431b3493a10aa7e041e9 + + + + + wx9f20a46906ab2c3e + dc13065f79429979d9f687d249eb5c4e + + wxfa4afaa2b5f9c876 + 7db9f049c78c9a6cafa673deebe8330d + + + + + epdc + Elink@833066 + + 172.16.0.52:9876;172.16.0.54:9876 + organizationGroup + + + + diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/AdminApplication.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/AdminApplication.java new file mode 100644 index 0000000..5ee3a1f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/AdminApplication.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 管理后台 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class AdminApplication { + + public static void main(String[] args) { + SpringApplication.run(AdminApplication.class, args); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java new file mode 100644 index 0000000..2385160 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.config; + +import com.elink.esua.epdc.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "sys"; + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/SwaggerConfig.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/SwaggerConfig.java new file mode 100644 index 0000000..c6dc1a4 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/config/SwaggerConfig.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.config; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import io.swagger.annotations.ApiOperation; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +/** + * Swagger配置 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + //加了ApiOperation注解的类,才生成接口文档 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + //包下的类,才生成接口文档 + //.apis(RequestHandlerSelectors.basePackage("io.renren.controller")) + .paths(PathSelectors.any()) + .build() + .directModelSubstitute(java.util.Date.class, String.class) + .securitySchemes(security()); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("人人开源") + .description("系统模块开发文档") + .termsOfServiceUrl("https://www.renren.io/community") + .version("1.1.0") + .build(); + } + + private List security() { + return newArrayList( + new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header") + ); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java new file mode 100644 index 0000000..5bc38d2 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuController.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; +import com.elink.esua.epdc.excel.AppMenuExcel; +import com.elink.esua.epdc.service.AppMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@RestController +@RequestMapping("appmenu") +public class AppMenuController { + + @Autowired + private AppMenuService appMenuService; + + /** + * 获取APP菜单列表 + * + * @param type 菜单类型 0:菜单 1:按钮 null:全部 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/11/19 13:26 + */ + @GetMapping("list") + public Result> list(Integer type) { + List list = appMenuService.getAppMenuList(type); + return new Result>().ok(list); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + AppMenuDTO data = appMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody AppMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + appMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody AppMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + appMenuService.update(dto); + return new Result(); + } + + @DeleteMapping("{id}") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + //判断是否有子菜单或按钮 + if(appMenuService.hasChileMenu(id)){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + + appMenuService.delete(id); + + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = appMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, AppMenuExcel.class); + } + + @GetMapping("select") + public Result> select(UserDetail userDetail) { + List list = appMenuService.getUserMenuList(userDetail, null); + + return new Result>().ok(list); + } + + /** + * @param mobile + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 首页面板 获取工作端APP菜单 + * @Date 2019/11/20 10:43 + **/ + @GetMapping("/indexPanel/{mobile}") + public Result> indexPanel(@PathVariable("mobile") String mobile) { + return appMenuService.indexPanel(mobile); + } + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + @GetMapping("/analysisIndexPanel/{userId}") + public Result> analysisIndexPanel(@PathVariable("userId") String userId) { + return appMenuService.getAnalysisIndexPanel(userId); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuTemplateController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuTemplateController.java new file mode 100644 index 0000000..f70b1cd --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppMenuTemplateController.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.AppMenuTemplateDTO; +import com.elink.esua.epdc.service.AppMenuTemplateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * APP菜单模板管理 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-19 + */ +@RestController +@RequestMapping("appmenutemplate") +public class AppMenuTemplateController { + + @Autowired + private AppMenuTemplateService appMenuTemplateService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = appMenuTemplateService.page(params); + return new Result>().ok(page); + } + + @GetMapping("list") + public Result> list(){ + List list = appMenuTemplateService.list(new HashMap<>()); + return new Result>().ok(list); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + AppMenuTemplateDTO data = appMenuTemplateService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody AppMenuTemplateDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + appMenuTemplateService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody AppMenuTemplateDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + appMenuTemplateService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + appMenuTemplateService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppRoleMenuController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppRoleMenuController.java new file mode 100644 index 0000000..c80d919 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AppRoleMenuController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.AppRoleMenuDTO; +import com.elink.esua.epdc.excel.AppRoleMenuExcel; +import com.elink.esua.epdc.service.AppRoleMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@RestController +@RequestMapping("approlemenu") +public class AppRoleMenuController { + + @Autowired + private AppRoleMenuService appRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = appRoleMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + AppRoleMenuDTO data = appRoleMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody AppRoleMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + appRoleMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody AppRoleMenuDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + appRoleMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + appRoleMenuService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = appRoleMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, AppRoleMenuExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AreaController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AreaController.java new file mode 100644 index 0000000..8ab8ed6 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/AreaController.java @@ -0,0 +1,55 @@ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SimpleAreaDTO; +import com.elink.esua.epdc.dto.SysSimpleDeptDTO; +import com.elink.esua.epdc.service.AreaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 获取行政区划 + * + * @author liuhongwei @elink-cn.com + * @since v1.0.0 2019-05-13 + */ +@RestController +@RequestMapping("area") +public class AreaController { + + @Autowired + private AreaService areaService; + + /** + * 根据区划ID,获取下属区域列表 + * + * @param areaId + * @return com.elink.esua.commons.tools.utils.Result> + * @author yujintao + * @date 2019/9/3 16:28 + */ + @GetMapping("listSimple/{areaId}") + public Result> listSimpleAreaInfo(@PathVariable("areaId") String areaId) { + return this.areaService.listSimpleAreaInfo(areaId); + } + + /** + * 数据权限控制用户可操作的部门(用于下拉菜单显示) + * + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author yujintao + * @date 2019/9/4 19:21 + */ + @GetMapping("listSimpleDept") + @DataFilter(tableAlias = "temp", deptId = "id", prefix = "WHERE") + public Result> listSimpleDeptInfo(@RequestParam Map params) { + return this.areaService.listSimpleDeptInfo(params); + } +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java new file mode 100644 index 0000000..f977f15 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptGridPlatformController.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.DeptGridPlatformDTO; +import com.elink.esua.epdc.excel.DeptGridPlatformExcel; +import com.elink.esua.epdc.service.DeptGridPlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@RestController +@RequestMapping("deptgridplatform") +public class DeptGridPlatformController { + + @Autowired + private DeptGridPlatformService deptGridPlatformService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = deptGridPlatformService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DeptGridPlatformDTO data = deptGridPlatformService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DeptGridPlatformDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + deptGridPlatformService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DeptGridPlatformDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + deptGridPlatformService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + deptGridPlatformService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = deptGridPlatformService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DeptGridPlatformExcel.class); + } + + /** + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据部门id查询记录 + * @Date 2019/12/25 15:09 + **/ + @GetMapping("selectByDeptId/{deptId}") + public Result selectByDeptId(@PathVariable("deptId") String deptId){ + return deptGridPlatformService.getDeptGridPlatformDTO(deptId); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptMaCodeController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptMaCodeController.java new file mode 100644 index 0000000..74b83f0 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/DeptMaCodeController.java @@ -0,0 +1,134 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.DeptMaCodeDTO; +import com.elink.esua.epdc.excel.DeptMaCodeExcel; +import com.elink.esua.epdc.service.DeptMaCodeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 网格小程序码 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-09-19 + */ +@RestController +@RequestMapping("deptmacode") +public class DeptMaCodeController { + + @Autowired + private DeptMaCodeService deptMaCodeService; + + @GetMapping("page") + @DataFilter(tableAlias = "dg", deptId = "id", prefix = "AND") + public Result> page(@RequestParam Map params) { + PageData page = deptMaCodeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + DeptMaCodeDTO data = deptMaCodeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DeptMaCodeDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + deptMaCodeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DeptMaCodeDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + deptMaCodeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + deptMaCodeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = deptMaCodeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DeptMaCodeExcel.class); + } + + /** + * 所有部门小程序码初始化 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/9/19 09:33 + */ + @PostMapping("init") + public Result initDeptMaCode() { + return deptMaCodeService.initDeptMaCode(); + } + + /** + * 生成指定网格小程序码 + * + * @param gridId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/9/19 11:04 + */ + @PostMapping("create/{gridId}") + public Result createDeptMaCode(@PathVariable("gridId") String gridId) { + return deptMaCodeService.createDeptMaCode(gridId); + } + + /** + * 创建网格长注册小程序码 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/10/22 09:59 + */ + @PostMapping("gridLeader") + public Result createGridLeaderMaCode() { + return deptMaCodeService.createGridLeaderMaCode(); + } + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java new file mode 100644 index 0000000..04ee8c9 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisMenuController.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.excel.*; +import com.elink.esua.epdc.service.SysAnalysisMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@RestController +@RequestMapping("analysismenu") +public class SysAnalysisMenuController { + + @Autowired + private SysAnalysisMenuService sysAnalysisMenuService; + + /** + * 获取APP菜单列表 + * + * @param type 菜单类型 0:菜单 1:按钮 null:全部 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/11/19 13:26 + */ + @GetMapping("list") + public Result> list(Integer type) { + List list = sysAnalysisMenuService.getAnalysisMenuList(type); + return new Result>().ok(list); + } + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = sysAnalysisMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SysAnalysisMenuDTO data = sysAnalysisMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody SysAnalysisMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + sysAnalysisMenuService.save(dto); + return new Result(); + } + @GetMapping("select") + public Result> select(UserDetail userDetail) { + List list = sysAnalysisMenuService.getUserMenuList(userDetail, null); + + return new Result>().ok(list); + } + + @PutMapping + public Result update(@RequestBody SysAnalysisMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + sysAnalysisMenuService.update(dto); + return new Result(); + } + + @DeleteMapping("{id}") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + //判断是否有子菜单或按钮 + if(sysAnalysisMenuService.hasChileMenu(id)){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + sysAnalysisMenuService.delete(id); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysAnalysisMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, SysAnalysisMenuExcel.class); + } + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + @GetMapping("/analysisIndexPanel/{userId}") + public Result> analysisIndexPanel(@PathVariable("userId") String userId) { + return sysAnalysisMenuService.getAnalysisIndexPanel(userId); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java new file mode 100644 index 0000000..65deebc --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysAnalysisRoleMenuController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.excel.*; +import com.elink.esua.epdc.service.SysAnalysisRoleMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@RestController +@RequestMapping("analysisrolemenu") +public class SysAnalysisRoleMenuController { + + @Autowired + private SysAnalysisRoleMenuService sysAnalysisRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = sysAnalysisRoleMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SysAnalysisRoleMenuDTO data = sysAnalysisRoleMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody SysAnalysisRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + sysAnalysisRoleMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody SysAnalysisRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + sysAnalysisRoleMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + sysAnalysisRoleMenuService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysAnalysisRoleMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, SysAnalysisRoleMenuExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java new file mode 100644 index 0000000..4c0113e --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java @@ -0,0 +1,297 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; +import com.elink.esua.epdc.service.SysDeptService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("dept") +@Api(tags = "部门管理") +public class SysDeptController { + @Autowired + private SysDeptService sysDeptService; + + @GetMapping("list") + @ApiOperation("列表") + public Result> list() { + List list = sysDeptService.list(new HashMap<>(1)); + + return new Result>().ok(list); + } + + @GetMapping("sublist/{pid}") + @ApiOperation("子列表") + public Result> sublist(@PathVariable("pid") String pid) { + List list = sysDeptService.subList(pid); + return new Result().ok(list); + } + + /*** + * 通过编码得到党委编码 + * @param partyCode + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/9/20 19:56 + */ + @GetMapping("getIdByCode/{partyCode}") + public Result> getIdByCode(@PathVariable("partyCode") String partyCode) { + return new Result>().ok(sysDeptService.getIdByCode(partyCode)); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") Long id) { + SysDeptDTO data = sysDeptService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("Save Dept") + public Result save(@RequestBody SysDeptDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysDeptService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("Update Dept") + public Result update(@RequestBody SysDeptDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDeptService.update(dto); + + return new Result(); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("Delete Dept") + public Result delete(@PathVariable("id") Long id) { + //效验数据 + AssertUtils.isNull(id, "id"); +// sysDeptService.delete(id); + sysDeptService.deleteBatchIds(Arrays.asList(new Long[]{id})); + return new Result(); + } + + @GetMapping("listGridId/{pid}") + @ApiOperation("获取所有下属网格ID集合") + public Result> listGridIdByPid(@PathVariable("pid") Long pid) { + return sysDeptService.listGridIdByPid(pid); + } + + /** + * 通过网格ID获取该网格所有上级机构 + * + * @param gridId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author yujintao + * @date 2019/9/7 09:12 + */ + @GetMapping("getCompleteDept/{gridId}") + public Result getCompleteDept(@PathVariable("gridId") String gridId) { + return sysDeptService.getCompleteDept(gridId); + } + + /** + * 通过网格ID获取该网格所有上级机构 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author yujintao + * @date 2019/9/7 09:12 + */ + @GetMapping("getParentAndAllDept/{deptId}") + public Result getParentAndAllDept(@PathVariable("deptId") String deptId) { + return new Result().ok(sysDeptService.getParentAndAllDept(deptId)); + } + + /** + * 通过街道ID获取项目可流转部门 + * + * @Params: [deptId] + * @Return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: liuchuang + * @Date: 2019/9/16 17:00 + */ + @GetMapping("getCirculationDept/{deptId}") + public Result> listOfItemCirculationDept(@PathVariable("deptId") Long deptId) { + List data = sysDeptService.listOfItemCirculationDept(deptId); + return new Result>().ok(data); + } + + /** + * 根据部门id,获取所有上级部门id,英文逗号隔开拼接字符串 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/11/27 15:07 + */ + @GetMapping("getParentDeptIds/{deptId}") + public Result getParentDeptIds(@PathVariable("deptId") Long deptId) { + return sysDeptService.getParentDeptIds(deptId); + } + + /** + * 根据部门id,获取部门所在四级机构的所有机构名称 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/11/27 15:08 + */ + @GetMapping("getCompleteDeptList/{deptId}") + public Result> getCompleteDeptList(@PathVariable("deptId") Long deptId) { + return sysDeptService.getCompleteDeptList(deptId); + } + + /** + * @param formDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 获取用户数据权限下各部门基本信息 + * @Date 2019/12/4 19:41 + **/ + @PostMapping("queryUserSysDeptInfo") + public Result> queryUserSysDeptInfo(@RequestBody UserSysDeptInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List list = sysDeptService.listUserSysDeptInfoResultDTO(formDTO); + return new Result>().ok(list); + } + + /*** + * 获取所有部门树 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/13 15:25 + */ + @GetMapping("party/getDeptTree") + public Result getDeptTree() { + return sysDeptService.getDeptTree(); + } + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取所有部门树:二级只要街道 + * @Date 2020/1/31 10:30 + **/ + @GetMapping("party/getDeptTreeForEpiDemic") + public Result getDeptTreeForEpiDemic() { + return sysDeptService.getDeptTreeForEpiDemic(); + } + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询未建立党员群的网格列表 + * @Date 2019/12/19 11:19 + **/ + @GetMapping("queryCompleteDept") + public Result> queryCompleteDept(@RequestParam Map params) { + PageData page = sysDeptService.listCompleteDeptDTO(params); + return new Result>().ok(page); + } + + /*** + * 获取所有网格 kpi模块原始数据 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/12 17:26 + */ + @GetMapping("listAllGridId") + public Result listAllGridId() { + return sysDeptService.listAllGridId(); + } + + /** + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/17 16:03 + */ + @GetMapping("pageDeptIdByTypeKey/{typeKey}/{pageSize}/{pageIndex}") + public Result> pageDeptIdByTypeKey(@PathVariable("typeKey") String typeKey, + @PathVariable("pageSize") Integer pageSize, + @PathVariable("pageIndex") Integer pageIndex) { + return sysDeptService.pageDeptIdByTypeKey(typeKey, pageSize, pageIndex); + } + + + /** + * 根据部门id,获取部门层级关系,获取部门领导姓名 + * + * @param deptId 部门id + * @param leaderFlag 是否需要查询网格长姓名 0 否 、1 是 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/12/18 11:04 + */ + @GetMapping("getDeptInfoById/{deptId}/{leaderFlag}") + public Result getDeptInfoById(@PathVariable("deptId") Long deptId, + @PathVariable("leaderFlag") String leaderFlag) { + DeptLevelAndLeaderDTO dto = sysDeptService.getDeptInfoById(deptId, leaderFlag); + return new Result().ok(dto); + } + + /** + * @Description: 获取全部的部门基本信息 + * @Param: [userSysDeptInfoFormDTO] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2020-04-14 + */ + @PostMapping("queryAllDeptInfo") + public Result> queryAllDeptInfo(@RequestBody UserSysDeptInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List list = sysDeptService.listAllDeptInfo(formDTO); + return new Result>().ok(list); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDictController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDictController.java new file mode 100644 index 0000000..925c2cd --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDictController.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.SysDictDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import com.elink.esua.epdc.service.SysDictService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("dict") +@Api(tags = "数据字典") +public class SysDictController { + @Autowired + private SysDictService sysDictService; + + @GetMapping("page") + @ApiOperation("字典分类") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String") + }) + public Result> page(@ApiIgnore @RequestParam Map params) { + //字典分类 + PageData page = sysDictService.page(params); + + return new Result>().ok(page); + } + + + @GetMapping("sublist/{pid}") + @ApiOperation("子列表") + public Result> sublist(@PathVariable("pid") String pid) { + Map map = new HashMap(); + map.put("pid", pid); + List list = sysDictService.subList(map); + return new Result>().ok(list); + } + + @GetMapping("list") + @ApiOperation("字典分类数据") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataType = "String") + }) + public Result> list(@ApiIgnore @RequestParam Map params) { + //字典分类数据 + List list = sysDictService.list(params); + + return new Result>().ok(list); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") Long id) { + SysDictDTO data = sysDictService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("Save Dict") + public Result save(@RequestBody SysDictDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysDictService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("Update Dict") + public Result update(@RequestBody SysDictDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysDictService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("Delete Dict") + public Result delete(@RequestBody Long[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysDictService.delete(ids); + + return new Result(); + } + + /** + * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 + * + * @param dictType 数据字典类型 + * @return com.elink.esua.commons.tools.utils.Result> + * @author yujintao + * @date 2019/7/15 09:33 + */ + @GetMapping("listSimple/{dictType}") + @ApiOperation("字典分类数据") + public Result> listSimpleDictInfo(@PathVariable("dictType") String dictType) { + //字典分类数据 + return sysDictService.listSimpleDictInfo(dictType); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("Delete Dict") + public Result delete(@PathVariable Long id) { + //效验数据 + sysDictService.delete(id); + return new Result(); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogErrorController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogErrorController.java new file mode 100644 index 0000000..cfec33f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogErrorController.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SysLogErrorDTO; +import com.elink.esua.epdc.excel.SysLogErrorExcel; +import com.elink.esua.epdc.service.SysLogErrorService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("log/error") +@Api(tags="异常日志") +public class SysLogErrorController { + @Autowired + private SysLogErrorService sysLogErrorService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "module", value = "模块名称,如:sys", paramType = "query", dataType="String") + }) + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysLogErrorService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("Export Log Error") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysLogErrorService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysLogErrorExcel.class); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogLoginController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogLoginController.java new file mode 100644 index 0000000..febc8cc --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogLoginController.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SysLogLoginDTO; +import com.elink.esua.epdc.excel.SysLogLoginExcel; +import com.elink.esua.epdc.service.SysLogLoginService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("log/login") +@Api(tags="登录日志") +public class SysLogLoginController { + @Autowired + private SysLogLoginService sysLogLoginService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"), + @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String") + }) + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysLogLoginService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("Export Log Login") + @ApiImplicitParams({ + @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"), + @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String") + }) + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysLogLoginService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysLogLoginExcel.class); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogOperationController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogOperationController.java new file mode 100644 index 0000000..3dd0c20 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysLogOperationController.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SysLogOperationDTO; +import com.elink.esua.epdc.excel.SysLogOperationExcel; +import com.elink.esua.epdc.service.SysLogOperationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("log/operation") +@Api(tags="操作日志") +public class SysLogOperationController { + @Autowired + private SysLogOperationService sysLogOperationService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "module", value = "模块名称,如:sys", paramType = "query", dataType="String"), + @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功", paramType = "query", dataType="int") + }) + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysLogOperationService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("Export Log Operation") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysLogOperationService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysLogOperationExcel.class); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysMenuController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysMenuController.java new file mode 100644 index 0000000..90770af --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysMenuController.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.MenuResourceDTO; +import com.elink.esua.epdc.dto.SysMenuDTO; +import com.elink.esua.epdc.service.SysMenuService; +import com.elink.esua.epdc.service.SysResourceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("menu") +@Api(tags="菜单管理") +public class SysMenuController { + @Autowired + private SysMenuService sysMenuService; + @Autowired + private SysResourceService sysResourceService; + + @GetMapping("nav") + @ApiOperation("导航") + public Result> nav(@ApiIgnore UserDetail userDetail){ + List list = sysMenuService.getUserMenuNavList(userDetail); + + return new Result>().ok(list); + } + + @GetMapping("permissions") + @ApiOperation("权限标识") + public Result> permissions(@ApiIgnore UserDetail userDetail){ + Set set = sysMenuService.getUserPermissions(userDetail); + + return new Result>().ok(set); + } + + @GetMapping("list") + @ApiOperation("列表") + @ApiImplicitParam(name = "type", value = "菜单类型 0:菜单 1:按钮 null:全部", paramType = "query", dataType="int") + public Result> list(Integer type){ + List list = sysMenuService.getMenuList(type); + + return new Result>().ok(list); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") Long id){ + SysMenuDTO data = sysMenuService.get(id); + + //菜单资源列表 + List resourceList = sysResourceService.getMenuResourceList(id); + data.setResourceList(resourceList); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("Save Menu") + public Result save(@RequestBody SysMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysMenuService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("Update Menu") + public Result update(@RequestBody SysMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, DefaultGroup.class); + + sysMenuService.update(dto); + + return new Result(); + } + + @DeleteMapping("{id}") + @ApiOperation("删除") + @LogOperation("Delete Menu") + public Result delete(@PathVariable("id") Long id){ + //效验数据 + AssertUtils.isNull(id, "id"); + + //判断是否有子菜单或按钮 + List list = sysMenuService.getListPid(id); + if(list.size() > 0){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + + sysMenuService.delete(id); + + return new Result(); + } + + @GetMapping("select") + @ApiOperation("角色菜单权限") + public Result> select(@ApiIgnore UserDetail userDetail){ + List list = sysMenuService.getUserMenuList(userDetail, null); + + return new Result>().ok(list); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysParamsController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysParamsController.java new file mode 100644 index 0000000..2ca0ba6 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysParamsController.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.SysParamsDTO; +import com.elink.esua.epdc.excel.SysParamsExcel; +import com.elink.esua.epdc.service.SysParamsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("params") +@Api(tags="参数管理") +public class SysParamsController { + @Autowired + private SysParamsService sysParamsService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") + }) + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysParamsService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") Long id){ + SysParamsDTO data = sysParamsService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("Save Params") + public Result save(@RequestBody SysParamsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysParamsService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("Update Params") + public Result update(@RequestBody SysParamsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysParamsService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("Delete Params") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysParamsService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("Export Params") + @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysParamsService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysParamsExcel.class); + } + + /** + * 根据参数编码,获取参数值 + * @param paramCode 参数编码 + * @return 返回参数值 + */ + @GetMapping("code/{paramCode}") + public String getValue(@PathVariable("paramCode") String paramCode){ + return sysParamsService.getValue(paramCode); + } + + /** + * 根据参数编码,更新参数值 + * @param paramCode 参数编码 + * @param paramValue 参数值 + */ + @PutMapping("code/{paramCode}") + public void updateValueByCode(@PathVariable("paramCode") String paramCode, @RequestParam("paramValue") String paramValue){ + sysParamsService.updateValueByCode(paramCode, paramValue); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysResourceController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysResourceController.java new file mode 100644 index 0000000..1fcf07d --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysResourceController.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.security.bo.ResourceBO; +import com.elink.esua.epdc.service.SysResourceService; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("resource") +@Api(tags="资源管理") +public class SysResourceController { + @Autowired + private SysResourceService sysResourceService; + + /** + * 获取所有资源列表 + */ + @GetMapping("list") + public List list(){ + return sysResourceService.getResourceList(); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java new file mode 100644 index 0000000..c284327 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysRoleController.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.SysRoleDTO; +import com.elink.esua.epdc.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + /** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("role") +@Api(tags="角色管理") +public class SysRoleController { + @Autowired + private SysRoleService sysRoleService; + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysRoleDataScopeService sysRoleDataScopeService; + @Autowired + private AppRoleMenuService appRoleMenuService; + @Autowired + private SysAnalysisRoleMenuService sysAnalysisRoleMenuService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") , + @ApiImplicitParam(name = "name", value = "角色名", paramType = "query", dataType="String") + }) + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = sysRoleService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("list") + @ApiOperation("列表") + public Result> list(){ + List data = sysRoleService.list(new HashMap<>(1)); + + return new Result>().ok(data); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") Long id){ + SysRoleDTO data = sysRoleService.get(id); + + //查询角色对应的菜单 + List menuIdList = sysRoleMenuService.getMenuIdList(id); + data.setMenuIdList(menuIdList); + + //查询角色对应的数据权限 + List deptIdList = sysRoleDataScopeService.getDeptIdList(id); + data.setDeptIdList(deptIdList); + + //查询角色对应app菜单权限 + List appMenuIdList = appRoleMenuService.getAppMenuIdList(id); + data.setAppMenuIdList(appMenuIdList); + //查询角色对应数据端菜单权限 + List analysisMenuIdList = sysAnalysisRoleMenuService.getAnalysisMenuIdList(id); + data.setAnalysisMenuIdList(analysisMenuIdList); + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("Save Role") + public Result save(@RequestBody SysRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysRoleService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("Update Role") + public Result update(@RequestBody SysRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysRoleService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("Delete Role") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysRoleService.delete(ids); + + return new Result(); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java new file mode 100644 index 0000000..2de0726 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysUserController.java @@ -0,0 +1,466 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.annotation.LogOperation; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.bo.ResourceBO; +import com.elink.esua.epdc.commons.tools.security.password.PasswordUtils; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; +import com.elink.esua.epdc.excel.SysUserExcel; +import com.elink.esua.epdc.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RestController +@RequestMapping("user") +@Api(tags = "用户管理") +public class SysUserController { + @Autowired + private SysUserService sysUserService; + @Autowired + private SysRoleUserService sysRoleUserService; + @Autowired + private SysRoleDataScopeService sysRoleDataScopeService; + @Autowired + private SysResourceService sysResourceService; + @Autowired + private SysDeptService sysDeptService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType = "String") + }) + public Result> page(@ApiIgnore @RequestParam Map params) { + PageData page = sysUserService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + public Result get(@PathVariable("id") Long id) { + SysUserDTO data = sysUserService.get(id); + + //用户角色列表 + List roleIdList = sysRoleUserService.getRoleIdList(id); + data.setRoleIdList(roleIdList); + + return new Result().ok(data); + } + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 查询用户角色Id + * @Date 2020/2/3 8:13 + **/ + @GetMapping("getRoleIdList/{userId}") + public Result> getRoleIdList(@PathVariable("userId") Long userId) { + //用户角色列表 + List roleIdList = sysRoleUserService.getRoleIdList(userId); + return new Result>().ok(roleIdList); + } + + @GetMapping("info") + @ApiOperation("登录用户信息") + public Result info(@ApiIgnore UserDetail user) { + SysUserDTO data = ConvertUtils.sourceToTarget(user, SysUserDTO.class); + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("Save User") + public Result save(@RequestBody SysUserDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + sysUserService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("Update User") + public Result update(@RequestBody SysUserDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + sysUserService.update(dto); + + return new Result(); + } + + @PutMapping("password") + @ApiOperation("修改密码") + @LogOperation("Password User") + public Result password(@RequestBody PasswordDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto); + + UserDetail user = SecurityUser.getUser(); + + //原密码不正确 + if (!PasswordUtils.matches(dto.getPassword(), user.getPassword())) { + return new Result().error(ErrorCode.PASSWORD_ERROR); + } + + sysUserService.updatePassword(user.getId(), dto.getNewPassword()); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("Delete User") + public Result delete(@RequestBody Long[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + sysUserService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("Export User") + @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType = "String") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = sysUserService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, list, SysUserExcel.class); + } + + /** + * 根据用户名,获取用户信息 + */ + @GetMapping("getByUsername") + public Result getByUsername(String username) { + SysUserDTO user = sysUserService.getByUsername(username); + + UserDetail userDetail = ConvertUtils.sourceToTarget(user, UserDetail.class); + //初始化用户数据 + initUserData(userDetail); + + return new Result().ok(userDetail); + } + + /** + * 根据用户ID,获取用户信息 + */ + @GetMapping("getById") + public Result getById(Long id) { + SysUserDTO user = sysUserService.get(id); + + UserDetail userDetail = ConvertUtils.sourceToTarget(user, UserDetail.class); + //初始化用户数据 + initUserData(userDetail); + + return new Result().ok(userDetail); + } + + /** + * 根据openId获取用户信息 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [openId] + * @author liuchuang + * @since 2019/11/20 13:54 + */ + @GetMapping("getUserInfo/{openId}") + public Result getSysUserInfoByOpenId(@PathVariable("openId") String openId) { + SysUserDTO data = sysUserService.getSysUserInfoByOpenId(openId); + + return new Result().ok(data); + } + + /** + * 根据用户ID 获取用户角色权限信息 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @params [id] + * @author liuchuang + * @since 2019/11/19 23:36 + */ + @GetMapping("getDataScope") + public Result> getDataScopeList(Long id) { + List data = sysRoleDataScopeService.getDataScopeDetailList(id); + + return new Result>().ok(data); + } + @GetMapping("getWorkRecordRoleUser/{menuCode}") + public Result> getWorkRecordRoleUser(@PathVariable("menuCode") String menuCode) { + List data = sysRoleUserService.getWorkRecordRoleUser(menuCode); + + return new Result>().ok(data); + } + + /** + * 根据用户名更新用户微信openId + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [sysUserOpenIdFormDto] + * @author liuchuang + * @since 2019/11/20 9:52 + */ + @PostMapping("modifyOpenId") + public Result modifyOpenIdByUsername(@RequestBody SysUserOpenIdFormDTO sysUserOpenIdFormDto) { + //效验数据 + ValidatorUtils.validateEntity(sysUserOpenIdFormDto); + return sysUserService.modifyOpenIdByUsername(sysUserOpenIdFormDto); + } + + /** + * 初始化用户数据 + */ + private void initUserData(UserDetail userDetail) { + if (userDetail == null) { + return; + } + + //用户机构类型键值 + SysDeptDTO deptDto = sysDeptService.get(userDetail.getDeptId()); + if (null != deptDto) { + userDetail.setTypeKey(deptDto.getTypeKey()); + } + + //用户部门数据权限 + List deptIdList = sysRoleDataScopeService.getDataScopeList(userDetail.getId()); + userDetail.setDeptIdList(deptIdList); + + //用户资源列表 + List resourceList = sysResourceService.getUserResourceList(userDetail.getId()); + userDetail.setResourceList(resourceList); + } + + /** + * 网格长注册时,根据手机号,查询网格长管理的所有网格 + * + * @param mobile + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/10/22 16:18 + */ + @GetMapping("/listGridForLeader/{mobile}") + public Result listGridWhileLeaderRegister(@PathVariable("mobile") String mobile) { + return sysUserService.listGridWhileLeaderRegister(mobile); + } + + /** + * 获取部门下的所有用户ID + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @params [deptId] + * @author liuchuang + * @since 2019/10/29 17:31 + */ + @GetMapping("ids/{deptId}") + public Result> getUserIdsByDeptIds(@PathVariable("deptId") Long deptId) { + List data = sysUserService.listOfUserIdsByDeptId(deptId); + return new Result>().ok(data); + } + + /** + * 组装用户部门多层结构 + *

auth模块调用,用户登录时,获取用户机构权限,返回页面组装下拉菜单所需数据,保存在redis

+ *

组装三层,街道-社区-网格

+ * + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/11/27 14:31 + */ + @GetMapping("packageOption/{userId}") + public Result packageUserDeptOption(@PathVariable("userId") Long userId) { + sysDeptService.packageUserDeptOption(userId); + return new Result(); + } + + /** + * 获取用户部门多层结构,用户前端显示,请求需携带token + *

调接口,从redis获取{@link SysUserController#packageUserDeptOption(Long)}接口生成的数据。

+ *

此接口展示三级机构层级(街道-社区-网格),不包括区级

+ * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/11/27 14:31 + */ + @GetMapping("deptOptions/getByLoginUser") + public Result getUserDeptOption() { + DeptOption deptOption = sysDeptService.getUserDeptOption(); + return new Result().ok(deptOption); + } + /** + * 获取用户部门多层结构,用户前端显示,请求需携带token + *

调接口,从redis获取{@link SysUserController#packageUserDeptOption(Long)}接口生成的数据。

+ *

此接口展示三级机构层级(街道-社区-网格),不包括区级

+ * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/11/27 14:31 + */ + @GetMapping("deptOptions/getDeptAuthByUser") + public Result getDeptAuthByUser() { + DeptOption deptOption = sysDeptService.getDeptAuthByUser(); + return new Result().ok(deptOption); + } + @GetMapping("deptOptions/getGridAuthByUser") + public Result> getGridAuthByUser() { + List deptOption = sysDeptService.getGridAuthByUser(); + return new Result().ok(deptOption); + } + + /** + * 获取用户部门多层结构(完整层级结构,包括顶级部门),用户前端显示,请求需携带token + *

新闻、通知发布,选择机构可多选,且展示完整层级结构,市区-街道-社区-网格

+ *

新闻、通知页面主动触发,不在用户登录是自动调用

+ * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2020/1/28 10:40 + */ + @GetMapping("deptOptions/getAllByLoginUser") + public Result getAllDeptOptionByLoginUser() { + DeptOption option = sysDeptService.getAllDeptOptionByLoginUser(); + return new Result().ok(option); + } + + /** + * pc端页面,获取用户街道-社区层级关系,前端显示,请求需携带token + *

只组装 街道-社区 两级 + *

  • 相关页面:用户数据分析-网格开通情况
  • + *

    + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2020/2/10 14:45 + */ + @GetMapping("deptOptions/getMiddleByLoginUser") + public Result getMiddleByLoginUser() { + DeptOption option = sysDeptService.getMiddleByLoginUser(); + return new Result().ok(option); + } + + /** + * pc端页面,获取用户 所有街道权限,前端显示,请求需携带token + *

    只组装 街道 一级 + *

  • 相关页面:用户数据分析-排名分析-居民注册
  • + *
  • 相关页面:用户数据分析-排名分析-党员注册
  • + *

    + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2020/2/11 11:22 + */ + @GetMapping("deptOptions/getStreetByLoginUser") + public Result getStreetByLoginUser() { + DeptOption option = sysDeptService.getStreetByLoginUser(); + return new Result().ok(option); + } + + /** + * 退出登录 + * + * @param userId @RequestBody SysUserDTO dto + * @return + */ + @GetMapping("updateUserOpenId/{userId}") + public Result updateUserOpenId(@PathVariable("userId") Long userId) { + + sysUserService.updateUserOpenId(userId); + + return new Result(); + } + + /** + * @Description: 根据部门id,查询部门下的所有用户手机号 + * @Param: [deptId] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2020-01-09 + */ + @GetMapping("getUserPhoneByListDeptId") + public Result> getUserPhoneByListDeptId(@RequestBody List deptId) { + return sysUserService.getUserPhoneByListDeptId(deptId); + } + + /** + * @Description: 根据议题网格ID查询拥有这个网格数据权限且是网格长的角色,再根据角色查出所有用户手机号 + * @Param: [deptId] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2020-01-09 + */ + @GetMapping("getSysGridLeaderPhone/{deptId}") + public Result> getSysGridLeaderPhone(@PathVariable("deptId") Long deptId) { + return sysUserService.getSysGridLeaderPhone(deptId); + } + + /** + * @describe: 判断是否更新头像 + * @author wangtong + * @date 2020/3/30 13:49 + * @param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @GetMapping("checkUpdateAvatar") + public Result checkUpdateAvatar() { + return sysUserService.checkUpdateAvatar(); + } + + /** + * @describe: 更新头像 + * @author wangtong + * @date 2020/3/30 16:11 + * @param [avatar] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @GetMapping("updateAvatar") + public Result updateAvatar(String avatar) { + return sysUserService.updateAvatar(avatar); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java new file mode 100644 index 0000000..4a748f1 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuDao.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Mapper +public interface AppMenuDao extends BaseDao { + + + /** + * 获取app菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/19 13:43 + */ + List selectListAppMenu(@Param("type") Integer type, @Param("language") String language); + + /** + * 获取菜单详细信息 + * @param id + * @return + */ + AppMenuDTO selectByIdDIY(@Param("id") String id, @Param("language") String language); + /** + * 查询所有菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + */ + List getMenuList(@Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param type 菜单类型 + * @param language 语言 + */ + List getUserMenuList(@Param("userId") Long userId, @Param("type") Integer type, @Param("language") String language); + + /** + * @param mobile 手机号 + * @return java.util.List + * @Author yinzuomei + * @Description + * @Date 2019/11/20 11:10 + **/ + List indexPanelByMobile(String mobile); + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + List getAnalysisIndexPanel(String userId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuTemplateDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuTemplateDao.java new file mode 100644 index 0000000..b168278 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppMenuTemplateDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.AppMenuTemplateEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * APP菜单模板管理 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-19 + */ +@Mapper +public interface AppMenuTemplateDao extends BaseDao { + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppRoleMenuDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppRoleMenuDao.java new file mode 100644 index 0000000..94d7607 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AppRoleMenuDao.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.AppRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Mapper +public interface AppRoleMenuDao extends BaseDao { + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 根据角色ID,获取菜单ID列表 + * + * @param id + * @return + */ + List getAppMenuIdList(Long id); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AreaDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AreaDao.java new file mode 100644 index 0000000..3a9944a --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/AreaDao.java @@ -0,0 +1,16 @@ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.AreaEntity; +import org.apache.ibatis.annotations.Mapper; + + +/** + * @author yujintao + * @date 2019/9/3 16:54 + */ +@Mapper +public interface AreaDao extends BaseDao { + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java new file mode 100644 index 0000000..d80fb24 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptGridPlatformDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.DeptGridPlatformDTO; +import com.elink.esua.epdc.entity.DeptGridPlatformEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Mapper +public interface DeptGridPlatformDao extends BaseDao { + + /** + * @param deptId + * @return com.elink.esua.epdc.dto.DeptGridPlatformDTO + * @Author yinzuomei + * @Description 根据部门id查询记录 + * @Date 2019/12/25 15:12 + **/ + DeptGridPlatformDTO selectDeptGridPlatformDTO(String deptId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java new file mode 100644 index 0000000..c5bb9c4 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.DeptMaCodeDTO; +import com.elink.esua.epdc.entity.DeptMaCodeEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 网格小程序码 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-09-19 + */ +@Mapper +public interface DeptMaCodeDao extends BaseDao { + + /** + * 获取部门小程序码列表 + * + * @param params + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/9/19 09:18 + */ + List selectListDeptMaCode(Map params); + + /** + * 查询所有未生成小程序码的网格ID + * + * @param + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/9/19 10:38 + */ + List selectListNoCodeGridId(); +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java new file mode 100644 index 0000000..e0c83b8 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisMenuDao.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.SysAnalysisMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Mapper +public interface SysAnalysisMenuDao extends BaseDao { + + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + List getAnalysisIndexPanel(String userId); + + /** + * 获取菜单详细信息 + * @param id + * @return + */ + SysAnalysisMenuDTO selectByIdDIY(@Param("id") String id, @Param("language") String language); + + /** + * 查询所有菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + */ + List getMenuList(@Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param type 菜单类型 + * @param language 语言 + */ + List getUserMenuList(@Param("userId") Long userId, @Param("type") Integer type, @Param("language") String language); + + /** + * 获取app菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/19 13:43 + */ + List selectListAppMenu(@Param("type") Integer type, @Param("language") String language); + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java new file mode 100644 index 0000000..e817fc7 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysAnalysisRoleMenuDao.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Mapper +public interface SysAnalysisRoleMenuDao extends BaseDao { + + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 根据角色ID,获取菜单ID列表 + * + * @param id + * @return + */ + List getAnalysisMenuIdList(Long id); + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java new file mode 100644 index 0000000..a1d9e8b --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; +import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; +import com.elink.esua.epdc.entity.SysDeptEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysDeptDao extends BaseDao { + + List getList(Map params); + + SysDeptEntity getById(Long id); + + /** + * 获取所有部门的id、pid列表 + */ + List getIdAndPidList(); + + /** + * 根据部门ID,获取所有子部门ID列表 + * + * @param id 部门ID + */ + List getSubDeptIdList(String id); + + /** + * 根据上级部门ID,获取下属部门简要信息列表 + * + * @param params 父部门ID + * @return java.util.List < com.elink.esua.epdc.dto.SysSimpleDeptDTO> + * @author yujintao + * @date 2019/9/4 16:21 + */ + List listSimpleDeptInfo(Map params); + + /** + * 获取所有下属网格ID集合 + * + * @param pid + * @return java.util.List + * @author yujintao + * @date 2019/9/5 13:46 + */ + List listGridIdByPid(@Param("pid") Long pid); + + /** + * 通过网格ID获取该网格所有上级机构 + * + * @param gridId + * @return com.elink.esua.epdc.dto.CompleteDeptDTO + * @author yujintao + * @date 2019/9/7 09:20 + */ + CompleteDeptDTO getCompleteDept(@Param("gridId") Long gridId); + + /** + * 通过网格ID获取该网格所有上级机构 + * + * @param deptId + * @return com.elink.esua.epdc.dto.CompleteDeptDTO + * @author yujintao + * @date 2019/9/7 09:20 + */ + CompleteDeptDTO getParentAndAllDept(@Param("deptId") Long deptId); + + /** + * 通过街道ID获取项目可流转部门 + * + * @Params: [deptId] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/16 16:54 + */ + List selectListOfItemCirculationDept(@Param("deptId") Long deptId); + + /** + * 通过网格id集合,获取网格长管理的所有网格 + * + * @param gridIdList + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/10/24 15:27 + */ + List selectListGridForLeader(@Param("gridIdList") List gridIdList); + + /** + * 通过用户部门权限 获取第一级部门节点 + * + * @param dataScopeDeptList + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/27 19:10 + */ + List selectListHeadDeptNode(@Param("dataScopeDeptList") List dataScopeDeptList); + + /** + * 通过数据权限和上级机构列表查询下级机构id列表 + * + * @param dataScopeDeptList + * @param parentDeptIdList + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/27 19:32 + */ + List selectChildrenDeptNode(@Param("dataScopeDeptList") List dataScopeDeptList, @Param("parentDeptIdList") List parentDeptIdList); + + List selectChildrenDeptAuth(@Param("dataScopeDeptList") List dataScopeDeptList); + List getGridAuthByUser(@Param("deptList") List deptList); + + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description + * @Date 2019/12/4 20:22 + **/ + List selectListUserSysDeptInfo(UserSysDeptInfoFormDTO formDTO); + + + /** + * @author: qushutong + * @Date: 2019/12/13 14:17 + * @Description: 查询所有 + */ + List selectListDeptTree(); + + /** + * @param params + * @return java.util.List + * @Author yinzuomei + * @Description 查询未建立党员群的网格列表 + * @Date 2019/12/19 12:54 + **/ + List selectListCompleteDeptDTO(Map params); + + List selectListDeptTreeForEpiDemic(); + + + /*** + * 查询所有网格 + * @param + * @return java.util.List + * @author qushutong + * @date 2019/12/12 18:12 + */ + List selectListAllGridId(); + + /** + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/12/17 16:11 + */ + List pageDeptIdByTypeKey(@Param("typeKey") String typeKey, + @Param("pageSize") Integer pageSize, + @Param("pageIndex") Integer pageIndex); + + /** + * 根据部门id,查询该部门指定角色的用户姓名 + * + * @param deptId 部门id + * @param roleType 角色类型 + * @return java.lang.String + * @author work@yujt.net.cn + * @date 2019/12/18 13:45 + */ + String selectDeptLeaderName(@Param("deptId") Long deptId, @Param("roleType") String roleType); + + /** + * @Description: 获取全部的部门基本信息 + * @Param: [userSysDeptInfoFormDTO] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2020-04-14 + */ + List selectListAllDeptInfo(Map map); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java new file mode 100644 index 0000000..e19c4e9 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDictDao.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysDictEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysDictEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysDictDao extends BaseDao { + + List getSubList(Map params); + + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLanguageDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLanguageDao.java new file mode 100644 index 0000000..ab9ab63 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLanguageDao.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysLanguageEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysLanguageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface SysLanguageDao extends BaseDao { + + SysLanguageEntity getLanguage(SysLanguageEntity entity); + + void updateLanguage(SysLanguageEntity entity); + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogErrorDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogErrorDao.java new file mode 100644 index 0000000..98924ef --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogErrorDao.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysLogErrorEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysLogErrorEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysLogErrorDao extends BaseDao { + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogLoginDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogLoginDao.java new file mode 100644 index 0000000..d029007 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogLoginDao.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysLogLoginEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysLogLoginEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysLogLoginDao extends BaseDao { + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogOperationDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogOperationDao.java new file mode 100644 index 0000000..16339fa --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysLogOperationDao.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysLogOperationEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysLogOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysLogOperationDao extends BaseDao { + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysMenuDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysMenuDao.java new file mode 100644 index 0000000..9df0f8c --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysMenuDao.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysMenuEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysMenuDao extends BaseDao { + + SysMenuEntity getById(@Param("id") Long id, @Param("language") String language); + + /** + * 查询所有菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + */ + List getMenuList(@Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param type 菜单类型 + * @param language 语言 + */ + List getUserMenuList(@Param("userId") Long userId, @Param("type") Integer type, @Param("language") String language); + + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(Long pid); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysParamsDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysParamsDao.java new file mode 100644 index 0000000..377046b --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysParamsDao.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysParamsEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysParamsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysParamsDao extends BaseDao { + /** + * 根据参数编码,查询value + * @param paramCode 参数编码 + * @return 参数值 + */ + String getValueByCode(String paramCode); + + /** + * 获取参数编码列表 + * @param ids ids + * @return 返回参数编码列表 + */ + List getParamCodeList(Long[] ids); + + /** + * 根据参数编码,更新value + * @param paramCode 参数编码 + * @param paramValue 参数值 + */ + int updateValueByCode(@Param("paramCode") String paramCode, @Param("paramValue") String paramValue); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysResourceDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysResourceDao.java new file mode 100644 index 0000000..f9e7de8 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysResourceDao.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysResourceEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysResourceEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysResourceDao extends BaseDao { + /** + * 根据资源编码,删除对应的资源 + * @param code 资源编码 + */ + void deleteByCode(String code); + + /** + * 获取资源列表 + * @param menuId 菜单ID + */ + List getMenuResourceList(String menuId); + + /** + * 获取所有资源列表 + */ + List getResourceList(); + + /** + * 获取用户资源列表 + * @param userId 用户ID + */ + List getUserResourceList(@Param("userId") Long userId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java new file mode 100644 index 0000000..1310c61 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDao.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysRoleEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysRoleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleDao extends BaseDao { + + /** + * 根据角色类型,获取机构的此类角色数量 + * + * @param roleType + * @param deptIdList + * @return java.util.List> + * @author work@yujt.net.cn + * @date 2019/12/18 10:20 + */ + List> selectAmountByRoleTpye(@Param("roleType") String roleType, @Param("deptIdList") List deptIdList); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDataScopeDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDataScopeDao.java new file mode 100644 index 0000000..9f85f91 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleDataScopeDao.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.dto.DataScopeDeptList; +import com.elink.esua.epdc.entity.SysRoleDataScopeEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleDataScopeDao extends BaseDao { + + /** + * 根据角色ID,获取部门ID列表 + */ + List getDeptIdList(Long roleId); + + /** + * 获取用户的部门数据权限列表 + */ + List getDataScopeList(Long userId); + + /** + * 获取用户的部门数据权限列表 + */ + List getDataScopeDetailList(Long userId); + + /** + * 根据角色id,删除角色数据权限关系 + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleMenuDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleMenuDao.java new file mode 100644 index 0000000..e481567 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleMenuDao.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysRoleMenuEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleMenuDao extends BaseDao { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(Long roleId); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(Long menuId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleUserDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleUserDao.java new file mode 100644 index 0000000..32f149d --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysRoleUserDao.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.entity.SysRoleUserEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.SysRoleUserEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysRoleUserDao extends BaseDao { + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据用户id,删除角色用户关系 + * @param userId 用户id + */ + void deleteByUserId(Long userId); + + /** + * 角色ID列表 + * @param userId 用户ID + * + * @return + */ + List getRoleIdList(Long userId); + + List getWorkRecordRoleUser(String menuCode); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java new file mode 100644 index 0000000..d7902e7 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.dto.SysUserDTO; +import com.elink.esua.epdc.dto.SysUserOpenIdFormDTO; +import com.elink.esua.epdc.entity.SysUserEntity; +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface SysUserDao extends BaseDao { + + List getList(Map params); + + SysUserEntity getById(Long id); + + SysUserEntity getByUsername(String username); + + int updatePassword(@Param("id") Long id, @Param("newPassword") String newPassword); + + /** + * 根据部门ID,查询用户数 + */ + int getCountByDeptId(Long deptId); + + /** + * 网格长注册时,根据手机号,查询网格长管理的所有网格 + * + * @param mobile + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/10/22 16:27 + */ + List selectListLeaderGridId(@Param("mobile") String mobile); + + /** + * + * 获取部门下的所有用户ID + * + * @params [deptId] + * @return java.util.List + * @author liuchuang + * @since 2019/10/29 16:18 + */ + List selectListOfUserIdsByDeptId(@Param("deptId") Long deptId); + + /** + * + * 根据用户名更新用户微信openId + * + * @params [sysUserOpenIdFormDto] + * @return void + * @author liuchuang + * @since 2019/11/20 9:59 + */ + void updateOpenIdByUsername(SysUserOpenIdFormDTO sysUserOpenIdFormDto); + + /** + * + * 根据openId获取用户信息 + * + * @params [openId] + * @return com.elink.esua.epdc.dto.SysUserDTO + * @author liuchuang + * @since 2019/11/20 13:56 + */ + SysUserDTO selectOneOfSysUserByOpenId(String openId); + + /** + * 退出登录 + */ + void updateUserOpenId(@Param("userId") Long userId); + + /** + * @Description: 根据部门id,查询部门下的所有用户手机号 + * @Param: [map] + * @return: java.util.List + * @Author: zy + * @Date: 2020-01-09 + */ + List getUserPhoneByListDeptId(Map deptId); + + /** + * @Description: 根据议题网格ID查询拥有这个网格数据权限且是网格长的角色,再根据角色查出所有用户手机号 + * @Param: [deptId] + * @return: java.util.List + * @Author: zy + * @Date: 2020-01-09 + */ + List getSysGridLeaderPhone(Long deptId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuEntity.java new file mode 100644 index 0000000..00b42d0 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuEntity.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_app_menu") +public class AppMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 8343477172739451636L; + + + /** + * 上级ID,一级菜单为0 + */ + private Long pid; + + /** + * 菜单名称 + */ + @TableField(exist = false) + private String name; + + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 样式名称 + */ + private String className; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 菜单编码 + */ + private String menuCode; + + /** + * 备注 + */ + private String remark; + + /** + * 子模板ID + */ + private String templateId; + + /** + * 是否显示数字 0否 1是 + */ + private String numFlag; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuTemplateEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuTemplateEntity.java new file mode 100644 index 0000000..f274f40 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppMenuTemplateEntity.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * APP菜单模板管理 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_app_menu_template") +public class AppMenuTemplateEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 3771232002180783503L; + + + /** + * 背景颜色(渐变色为0时使用) + */ + private String backgroundColor; + + /** + * CSS类名 + */ + private String className; + + /** + * 备用CSS类名 + */ + private String spareClassName; + + /** + * 模板编码(tem-1,tem-2,tem-3) + */ + private String templateCode; + + /** + * 模板名称 + */ + private String templateName; + + /** + * 模块列数 + */ + private Integer columnAmount; + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppRoleMenuEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppRoleMenuEntity.java new file mode 100644 index 0000000..4b41cb6 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AppRoleMenuEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_app_role_menu") +public class AppRoleMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 5439181968297858519L; + + /** + * 角色ID + */ + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java new file mode 100644 index 0000000..c5d58ad --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/AreaEntity.java @@ -0,0 +1,60 @@ +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 行政区划 + * + * @author yujintao + * @date 2019/9/3 16:25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("area") +public class AreaEntity implements Serializable { + + private static final long serialVersionUID = -2139014717755304245L; + + /** + * ID + */ + private Integer id; + /** + * 父级ID + */ + private Integer parentId; + /** + * 名称 + */ + private String name; + /** + * 简称 + */ + private String shortName; + /** + * 经度 + */ + private Float longitude; + /** + * 纬度 + */ + private Float latitude; + /** + * 等级(1省/直辖市,2地级市,3区县,4镇/街道) + */ + private Integer level; + /** + * 排序 + */ + private Integer sort; + /** + * 状态(0禁用/1启用) + */ + private Integer status; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java new file mode 100644 index 0000000..43e6bc6 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptGridPlatformEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_dept_grid_platform") +public class DeptGridPlatformEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 部门编码 + */ + private String deptCode; + + /** + * 街道编码 + */ + private String streetCode; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 启用标识 0-否,1-是 + */ + private String enableFlag; + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java new file mode 100644 index 0000000..18a9636 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 网格小程序码 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-09-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_dept_ma_code") +public class DeptMaCodeEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 7851330983990440333L; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 小程序码URL + */ + private String codeUrl; + + /** + * 是否是网格长码,0否 1是 + */ + private String leaderFlag; + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java new file mode 100644 index 0000000..8668e09 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisMenuEntity.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_analysis_menu") +public class SysAnalysisMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 上级ID,一级菜单为0 + */ + private Long pid; + + /** + * 菜单名称 + */ + @TableField(exist = false) + private String name; + + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 样式名称 + */ + private String className; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 菜单编码 + */ + private String menuCode; + + /** + * 备注 + */ + private String remark; + + /** + * 子模板ID + */ + private String templateId; + + /** + * 是否显示数字 0否 1是 + */ + private String numFlag; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java new file mode 100644 index 0000000..0b05aaa --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysAnalysisRoleMenuEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_analysis_role_menu") +public class SysAnalysisRoleMenuEntity extends BaseEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 角色ID + */ + private Long roleId; + + /** + * 菜单ID + */ + private Long menuId; + + /** + * 创建者 + */ + private Long creator; + + /** + * 创建时间 + */ + private Date createDate; + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDeptEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDeptEntity.java new file mode 100644 index 0000000..5e90ca0 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDeptEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_dept") +public class SysDeptEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 上级ID + */ + private Long pid; + /** + * 所有上级ID,用逗号分开 + */ + private String pids; + /** + * 部门名称 + */ + private String name; + /** + * 排序 + */ + private Integer sort; + /** + * 删除标识 0:未删除 1:删除 + */ + @TableLogic + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + + /** + * 上级部门名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 部门类型键值 + */ + private String typeKey; + + /** + * 部门编码 + */ + private String partyCode; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDictEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDictEntity.java new file mode 100644 index 0000000..1db9fb7 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDictEntity.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_dict") +public class SysDictEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 上级ID,一级为0 + */ + private Long pid; + /** + * 字典类型 + */ + private String dictType; + /** + * 字典名称 + */ + private String dictName; + /** + * 字典值 + */ + private String dictValue; + /** + * 备注 + */ + private String remark; + /** + * 排序 + */ + private Integer sort; + /** + * 删除标识 0:未删除 1:删除 + */ + @TableLogic + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLanguageEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLanguageEntity.java new file mode 100644 index 0000000..2e7c870 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLanguageEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_language") +public class SysLanguageEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 表名 + */ + private String tableName; + /** + * 表主键 + */ + private Long tableId; + /** + * 字段名 + */ + private String fieldName; + /** + * 字段值 + */ + private String fieldValue; + /** + * 语言 + */ + private String language; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogErrorEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogErrorEntity.java new file mode 100644 index 0000000..4430b08 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogErrorEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@TableName("sys_log_error") +public class SysLogErrorEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 模块名称,如:sys + */ + private String module; + /** + * 请求URI + */ + private String requestUri; + /** + * 请求方式 + */ + private String requestMethod; + /** + * 请求参数 + */ + private String requestParams; + /** + * 用户代理 + */ + private String userAgent; + /** + * 操作IP + */ + private String ip; + /** + * 异常信息 + */ + private String errorInfo; + /** + * 创建者 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogLoginEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogLoginEntity.java new file mode 100644 index 0000000..346f361 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogLoginEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@TableName("sys_log_login") +public class SysLogLoginEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId + private Long id; + /** + * 用户操作 0:用户登录 1:用户退出 + */ + private Integer operation; + /** + * 状态 0:失败 1:成功 2:账号已锁定 + */ + private Integer status; + /** + * 用户代理 + */ + private String userAgent; + /** + * 操作IP + */ + private String ip; + /** + * 用户名 + */ + private String creatorName; + /** + * 创建者 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogOperationEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogOperationEntity.java new file mode 100644 index 0000000..d7eb424 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysLogOperationEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@TableName("sys_log_operation") +public class SysLogOperationEntity implements Serializable { + private static final long serialVersionUID = 1L; + /** + * id + */ + @TableId + private Long id; + /** + * 模块名称,如:sys + */ + private String module; + /** + * 用户操作 + */ + private String operation; + /** + * 请求URI + */ + private String requestUri; + /** + * 请求方式 + */ + private String requestMethod; + /** + * 请求参数 + */ + private String requestParams; + /** + * 请求时长(毫秒) + */ + private Integer requestTime; + /** + * 用户代理 + */ + private String userAgent; + /** + * 操作IP + */ + private String ip; + /** + * 状态 0:失败 1:成功 + */ + private Integer status; + /** + * 用户名 + */ + private String creatorName; + /** + * 创建者 + */ + private Long creator; + /** + * 创建时间 + */ + private Date createDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysMenuEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysMenuEntity.java new file mode 100644 index 0000000..18a3a87 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysMenuEntity.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_menu") +public class SysMenuEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 上级ID,一级菜单为0 + */ + private Long pid; + /** + * 菜单名称 + */ + @TableField(exist = false) + private String name; + /** + * 菜单URL + */ + private String url; + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + /** + * 菜单图标 + */ + private String icon; + /** + * 权限标识,如:sys:menu:save + */ + private String permissions; + /** + * 排序 + */ + private Integer sort; + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 菜单编码 + */ + private String menuCode; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysParamsEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysParamsEntity.java new file mode 100644 index 0000000..59a6b8f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysParamsEntity.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_params") +public class SysParamsEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 参数编码 + */ + private String paramCode; + /** + * 参数值 + */ + private String paramValue; + /** + * 类型 0:系统参数 1:非系统参数 + */ + private Integer paramType; + /** + * 备注 + */ + private String remark; + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysResourceEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysResourceEntity.java new file mode 100644 index 0000000..6106645 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysResourceEntity.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_resource") +public class SysResourceEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 资源编码,如菜单ID + */ + private String resourceCode; + /** + * 资源名称 + */ + private String resourceName; + /** + * 资源URL + */ + private String resourceUrl; + /** + * 请求方式(如:GET、POST、PUT、DELETE) + */ + private String resourceMethod; + /** + * 菜单标识 0:非菜单资源 1:菜单资源 + */ + private Integer menuFlag; + /** + * 认证等级 0:权限认证 1:登录认证 2:无需认证 + */ + private Integer authLevel; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleDataScopeEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleDataScopeEntity.java new file mode 100644 index 0000000..cadf6dc --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleDataScopeEntity.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_role_data_scope") +public class SysRoleDataScopeEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private Long roleId; + /** + * 部门ID + */ + @TableField(fill = FieldFill.DEFAULT) + private Long deptId; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleEntity.java new file mode 100644 index 0000000..20523d9 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_role") +public class SysRoleEntity extends BaseEntity { + + private static final long serialVersionUID = -5938313610523405964L; + + /** + * 角色名称 + */ + private String name; + /** + * 角色类型键值(数据字典sysRoleType) + */ + private String typeKey; + /** + * 备注 + */ + private String remark; + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + /** + * 部门ID + */ + @TableField(fill = FieldFill.INSERT) + private Long deptId; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleMenuEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleMenuEntity.java new file mode 100644 index 0000000..9389e11 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleMenuEntity.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_role_menu") +public class SysRoleMenuEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + /** + * 角色ID + */ + private Long roleId; + /** + * 菜单ID + */ + private Long menuId; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleUserEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleUserEntity.java new file mode 100644 index 0000000..168ad3f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysRoleUserEntity.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("sys_role_user") +public class SysRoleUserEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private Long roleId; + /** + * 用户ID + */ + private Long userId; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysUserEntity.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysUserEntity.java new file mode 100644 index 0000000..b034042 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysUserEntity.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_user") +public class SysUserEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 用户名 + */ + private String username; + /** + * 密码 + */ + private String password; + /** + * 姓名 + */ + private String realName; + /** + * 头像 + */ + private String headUrl; + /** + * 性别 0:男 1:女 2:保密 + */ + private Integer gender; + /** + * 邮箱 + */ + private String email; + /** + * 手机号 + */ + private String mobile; + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + /** + * 状态 0:停用 1:正常 + */ + private Integer status; + /** + * 备注 + */ + private String remark; + /** + * 部门ID + */ + private Long deptId; + /** + * 删除标识 0:未删除 1:删除 + */ + @TableField(fill = FieldFill.INSERT) + private Integer delFlag; + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Long updater; + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateDate; + + /** + * 部门名称 + */ + @TableField(exist = false) + private String deptName; + + /** + * 用户标签键值 + */ + private String userTagKey; + + /** + * 用户微信openId + */ + private String openId; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppMenuExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppMenuExcel.java new file mode 100644 index 0000000..0f0eafb --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppMenuExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +public class AppMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "上级ID,一级菜单为0") + private Long pid; + + @Excel(name = "菜单URL") + private String url; + + @Excel(name = "类型 0:菜单 1:按钮") + private Integer type; + + @Excel(name = "菜单图标") + private String icon; + + @Excel(name = "权限标识,如:sys:menu:save") + private String permissions; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "删除标识 0:未删除 1:删除") + private Integer delFlag; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "更新者") + private Long updater; + + @Excel(name = "更新时间") + private Date updateDate; + + @Excel(name = "菜单编码") + private String menuCode; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppRoleMenuExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppRoleMenuExcel.java new file mode 100644 index 0000000..1634de8 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/AppRoleMenuExcel.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Data +public class AppRoleMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "角色ID") + private Long roleId; + + @Excel(name = "菜单ID") + private Long menuId; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java new file mode 100644 index 0000000..58dd8e6 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptGridPlatformExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Data +public class DeptGridPlatformExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "部门ID") + private Long deptId; + + @Excel(name = "部门编码") + private String deptCode; + + @Excel(name = "街道编码") + private String streetCode; + + @Excel(name = "部门名称") + private String deptName; + + @Excel(name = "启用标识 0-否,1-是") + private String enableFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记") + private String delFlag; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptMaCodeExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptMaCodeExcel.java new file mode 100644 index 0000000..87a1936 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/DeptMaCodeExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格小程序码 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-09-19 + */ +@Data +public class DeptMaCodeExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "小程序码URL") + private String codeUrl; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记") + private String delFlag; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java new file mode 100644 index 0000000..9e2c7ba --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisMenuExcel.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +public class SysAnalysisMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "上级ID,一级菜单为0") + private Long pid; + + @Excel(name = "类型 0:菜单 1:按钮") + private Integer type; + + @Excel(name = "模块名称") + private String modelname; + + @Excel(name = "菜单图标") + private String icon; + + @Excel(name = "样式名称") + private String className; + + @Excel(name = "菜单编码(议题管理-待回应:10001,议题管理-待处理:10002,项目管理-待处理:10003,用户管理-待认证居民:10004,消息:10005)") + private String menuCode; + + @Excel(name = "模板ID") + private String templateId; + + @Excel(name = "是否显示数字 0否 1是") + private String numFlag; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "备注") + private String remark; + + @Excel(name = "删除标识 0:未删除 1:删除") + private Integer delFlag; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + @Excel(name = "更新者") + private Long updater; + + @Excel(name = "更新时间") + private Date updateDate; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java new file mode 100644 index 0000000..629ac01 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysAnalysisRoleMenuExcel.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Data +public class SysAnalysisRoleMenuExcel { + + @Excel(name = "id") + private Long id; + + @Excel(name = "角色ID") + private Long roleId; + + @Excel(name = "菜单ID") + private Long menuId; + + @Excel(name = "创建者") + private Long creator; + + @Excel(name = "创建时间") + private Date createDate; + + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogErrorExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogErrorExcel.java new file mode 100644 index 0000000..d0642a2 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogErrorExcel.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysLogErrorExcel { + @Excel(name = "模块名称") + private String module; + @Excel(name = "请求URI") + private String requestUri; + @Excel(name = "请求方式") + private String requestMethod; + @Excel(name = "请求参数") + private String requestParams; + @Excel(name = "User-Agent") + private String userAgent; + @Excel(name = "操作IP") + private String ip; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogLoginExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogLoginExcel.java new file mode 100644 index 0000000..c7468e3 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogLoginExcel.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysLogLoginExcel { + @Excel(name = "用户操作") + private String operation; + @Excel(name = "状态", replace = {"失败_0", "成功_1", "账号已锁定_1"}) + private Integer status; + @Excel(name = "User-Agent") + private String userAgent; + @Excel(name = "操作IP") + private String ip; + @Excel(name = "用户名") + private String creatorName; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogOperationExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogOperationExcel.java new file mode 100644 index 0000000..39d4b95 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysLogOperationExcel.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysLogOperationExcel { + @Excel(name = "模块名称") + private String module; + @Excel(name = "用户操作") + private String operation; + @Excel(name = "请求URI") + private String requestUri; + @Excel(name = "请求方式") + private String requestMethod; + @Excel(name = "请求参数") + private String requestParams; + @Excel(name = "请求时长(毫秒)") + private Integer requestTime; + @Excel(name = "User-Agent") + private String userAgent; + @Excel(name = "操作IP") + private String ip; + @Excel(name = "状态", replace = {"失败_0", "成功_1"}) + private Integer status; + @Excel(name = "用户名") + private String creatorName; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysParamsExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysParamsExcel.java new file mode 100644 index 0000000..12e3d4c --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysParamsExcel.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysParamsExcel { + @Excel(name = "参数编码") + private String paramCode; + @Excel(name = "参数值") + private String paramValue; + @Excel(name = "备注") + private String remark; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysUserExcel.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysUserExcel.java new file mode 100644 index 0000000..2dd8be8 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/excel/SysUserExcel.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class SysUserExcel { + @Excel(name = "用户名") + private String username; + @Excel(name = "姓名") + private String realName; + @Excel(name = "性别", replace = {"男_0", "女_1", "保密_2"}) + private Integer gender; + @Excel(name = "邮箱") + private String email; + @Excel(name = "手机号") + private String mobile; + @Excel(name = "部门名称") + private String deptName; + @Excel(name = "状态", replace = {"停用_0", "正常_1"}) + private Integer status; + @Excel(name = "备注") + private String remark; + @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss") + private Date createDate; + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java new file mode 100644 index 0000000..05668c4 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java @@ -0,0 +1,45 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CompleteDeptDTO; +import com.elink.esua.epdc.feign.fallback.GroupFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 友邻社群模块调用 + * + * @Author:liuchuang + * @Date:2019/11/20 23:41 + */ +@FeignClient(name = ServiceConstant.EPDC_GROUP_SERVER, fallback = GroupFeignClientFallback.class) +public interface GroupFeignClient { + + /** + * + * 创建网格党员群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/21 0:01 + */ + @PostMapping(value = "group/epdc-app/group/createParty", consumes = MediaType.APPLICATION_JSON_VALUE) + Result createPartyGroup(CompleteDeptDTO formDto); + + /** + * @param + * @return java.util.List + * @Author yinzuomei + * @Description 查询已经建立党员群的网格id + * @Date 2019/12/19 13:01 + **/ + @GetMapping(value = "group/epdc-app/group/listPartyMemberGridId") + Result> listPartyMemberGridId(); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java new file mode 100644 index 0000000..0e67831 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/OssFeignClient.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UploadToOssDTO; +import com.elink.esua.epdc.feign.fallback.OssFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; + + +/** + * @author work@yujt.net.cn + * @date 19/9/19 10:12 + */ +@FeignClient(name = ServiceConstant.EPDC_OSS_SERVER, fallback = OssFeignClientFallback.class) +public interface OssFeignClient { + + /** + * File文件上传到文件服务器 + * + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/9/19 10:15 + */ + @PostMapping(value = "oss/file/uploadFile", consumes = MediaType.APPLICATION_JSON_VALUE) + Result uploadFile(UploadToOssDTO dto); + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java new file mode 100644 index 0000000..2dc634f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CompleteDeptDTO; +import com.elink.esua.epdc.feign.GroupFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:liuchuang + * @Date:2019/11/20 23:41 + */ +@Component +public class GroupFeignClientFallback implements GroupFeignClient { + + @Override + public Result createPartyGroup(CompleteDeptDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "createPartyGroup", formDto); + } + + @Override + public Result> listPartyMemberGridId() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listPartyMemberGridId"); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java new file mode 100644 index 0000000..078b5ef --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/feign/fallback/OssFeignClientFallback.java @@ -0,0 +1,22 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.UploadToOssDTO; +import com.elink.esua.epdc.feign.OssFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author work@yujt.net.cn + * @date 19/9/19 10:12 + */ +@Component +public class OssFeignClientFallback implements OssFeignClient { + + @Override + public Result uploadFile(UploadToOssDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_OSS_SERVER, "uploadFile", dto.getFileName()); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/log/LogConsumer.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/log/LogConsumer.java new file mode 100644 index 0000000..3746473 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/log/LogConsumer.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.log; + +import com.elink.esua.epdc.entity.SysLogLoginEntity; +import com.elink.esua.epdc.entity.SysLogOperationEntity; +import com.elink.esua.epdc.service.SysLogErrorService; +import com.elink.esua.epdc.service.SysLogLoginService; +import com.elink.esua.epdc.service.SysLogOperationService; +import com.elink.esua.epdc.commons.tools.log.BaseLog; +import com.elink.esua.epdc.commons.tools.log.enums.LogTypeEnum; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.entity.SysLogErrorEntity; +import com.elink.esua.epdc.entity.SysLogLoginEntity; +import com.elink.esua.epdc.entity.SysLogOperationEntity; +import com.elink.esua.epdc.service.SysLogErrorService; +import com.elink.esua.epdc.service.SysLogLoginService; +import com.elink.esua.epdc.service.SysLogOperationService; +import org.apache.commons.lang3.concurrent.BasicThreadFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; + +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * 从Redis队列中获取Log,保存到DB + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class LogConsumer implements CommandLineRunner { + @Autowired + private RedisUtils redisUtils; + @Autowired + private SysLogErrorService sysLogErrorService; + @Autowired + private SysLogLoginService sysLogLoginService; + @Autowired + private SysLogOperationService sysLogOperationService; + private ScheduledExecutorService scheduledService = new ScheduledThreadPoolExecutor(1, + new BasicThreadFactory.Builder().namingPattern("log-consumer-schedule-pool-%d").daemon(true).build()); + + @Override + public void run(String... args) { + //上次任务结束后,等待10秒钟,再执行下次任务 + scheduledService.scheduleWithFixedDelay(() -> receiveQueue(), 1, 10, TimeUnit.SECONDS); + } + + private void receiveQueue() { + String key = RedisKeys.getSysLogKey(); + //每次插入100条 + int count = 100; + for(int i = 0; i < count; i++){ + BaseLog log = (BaseLog) redisUtils.rightPop(key); + if(log == null){ + return; + } + + //登录日志 + if(log.getType() == LogTypeEnum.LOGIN.value()){ + SysLogLoginEntity entity = ConvertUtils.sourceToTarget(log, SysLogLoginEntity.class); + sysLogLoginService.save(entity); + } + + //操作日志 + if(log.getType() == LogTypeEnum.OPERATION.value()){ + SysLogOperationEntity entity = ConvertUtils.sourceToTarget(log, SysLogOperationEntity.class); + sysLogOperationService.save(entity); + } + + //异常日志 + if(log.getType() == LogTypeEnum.ERROR.value()){ + SysLogErrorEntity entity = ConvertUtils.sourceToTarget(log, SysLogErrorEntity.class); + sysLogErrorService.save(entity); + } + } + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuRedis.java new file mode 100644 index 0000000..500b737 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Component +public class AppMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuTemplateRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuTemplateRedis.java new file mode 100644 index 0000000..2411e26 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppMenuTemplateRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * APP菜单模板管理 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-19 + */ +@Component +public class AppMenuTemplateRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppRoleMenuRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppRoleMenuRedis.java new file mode 100644 index 0000000..558ca32 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AppRoleMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Component +public class AppRoleMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java new file mode 100644 index 0000000..2dbe215 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/AreaRedis.java @@ -0,0 +1,67 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.dto.SimpleAreaDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 区划信息表 + * + * @author yujintao yujintao@elink-cn.com + * @since v1.0.0 2019-05-08 + */ +@Component +public class AreaRedis { + + @Autowired + private RedisUtils redisUtils; + + /** + * 取出区划信息 + * + * @param areaId 区域ID + * @return java.lang.String + * @author yujintao + * @date 2019/6/13 11:05 + */ + public List getSimpleAreaList(String areaId) { + String configAreaKey = RedisKeys.getSimpleAreaKey(areaId); + return (List) redisUtils.get(configAreaKey); + } + + /** + * 缓存区划信息 + * + * @param areaId + * @param areaDtoList + * @return void + * @author yujintao + * @date 2019/6/13 11:02 + */ + public void setSimpleAreaList(String areaId, List areaDtoList) { + String configAreaKey = RedisKeys.getSimpleAreaKey(areaId); + redisUtils.set(configAreaKey, areaDtoList); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java new file mode 100644 index 0000000..babdde9 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/DeptGridPlatformRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Component +public class DeptGridPlatformRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java new file mode 100644 index 0000000..3349f7c --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Component +public class SysAnalysisMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java new file mode 100644 index 0000000..f660239 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysAnalysisRoleMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Component +public class SysAnalysisRoleMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java new file mode 100644 index 0000000..d67e65a --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysDictRedis.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.dto.SimpleAreaDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 区划信息表 + * + * @author yujintao yujintao@elink-cn.com + * @since v1.0.0 2019-05-08 + */ +@Component +public class SysDictRedis { + + @Autowired + private RedisUtils redisUtils; + + /** + * 根据数据字典类型,从redis获取简版数据字典列表 + * + * @param dictType 数据字典类型 + * @return java.util.List + * @author yujintao + * @date 2019/7/15 09:42 + */ + public List getSimpleDictList(String dictType) { + String dictKey = RedisKeys.getSimpleDictKey(dictType); + return (List) redisUtils.get(dictKey); + } + + /** + * 根据数据字典类型,将简版数据字典列表放入缓存 + * + * @param dictType 数据字典类型 + * @param simpleDictList 列表 + * @return void + * @author yujintao + * @date 2019/7/15 09:50 + */ + public void setSimpleDictList(String dictType, List simpleDictList) { + String dictKey = RedisKeys.getSimpleDictKey(dictType); + redisUtils.set(dictKey, simpleDictList); + } + + /** + * 根据数据字典类型,从redis删除简版数据字典列表 + * + * @param dictType + * @return void + * @author yujintao + * @date 2019/7/15 10:10 + */ + public void removeSimpleDictList(String dictType) { + String dictKey = RedisKeys.getSimpleDictKey(dictType); + redisUtils.delete(dictKey); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysMenuRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysMenuRedis.java new file mode 100644 index 0000000..aba05ca --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysMenuRedis.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.utils.HttpContextUtils; +import com.elink.esua.epdc.dto.SysMenuDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class SysMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Long userId){ + //清空菜单导航、权限标识 + redisUtils.deleteByPattern(RedisKeys.getUserMenuNavKey(userId)); + redisUtils.delete(RedisKeys.getUserPermissionsKey(userId)); + } + + public void setUserMenuNavList(Long userId, List menuList){ + String key = RedisKeys.getUserMenuNavKey(userId, HttpContextUtils.getLanguage()); + redisUtils.set(key, menuList); + } + + public List getUserMenuNavList(Long userId){ + String key = RedisKeys.getUserMenuNavKey(userId, HttpContextUtils.getLanguage()); + return (List)redisUtils.get(key); + } + + public void setUserPermissions(Long userId, Set permsSet){ + String key = RedisKeys.getUserPermissionsKey(userId); + redisUtils.set(key, permsSet); + } + + public Set getUserPermissions(Long userId){ + String key = RedisKeys.getUserPermissionsKey(userId); + return (Set)redisUtils.get(key); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysParamsRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysParamsRedis.java new file mode 100644 index 0000000..edc1d51 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysParamsRedis.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class SysParamsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] paramCodes) { + String key = RedisKeys.getSysParamsKey(); + redisUtils.hDel(key, paramCodes); + } + + public void set(String paramCode, String paramValue){ + if(paramValue == null){ + return ; + } + String key = RedisKeys.getSysParamsKey(); + redisUtils.hSet(key, paramCode, paramValue); + } + + public String get(String paramCode){ + String key = RedisKeys.getSysParamsKey(); + return (String)redisUtils.hGet(key, paramCode); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysResourceRedis.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysResourceRedis.java new file mode 100644 index 0000000..c66658a --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/redis/SysResourceRedis.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.entity.SysResourceEntity; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.entity.SysResourceEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class SysResourceRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete() { + String key = RedisKeys.getSysResourceKey(); + + redisUtils.delete(key); + } + + public void set(List list){ + String key = RedisKeys.getSysResourceKey(); + + redisUtils.set(key, list); + } + + public List get(){ + String key = RedisKeys.getSysResourceKey(); + + return (List)redisUtils.get(key); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java new file mode 100644 index 0000000..d6b5087 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.rocketmq.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 组织机构信息修改-发送MQ消息DTO + * + * @Author:liuchuang + * @Date:2020/3/6 19:58 + */ +@Data +public class OrganizationModifyDTO implements Serializable { + private static final long serialVersionUID = -1330090682508121169L; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 旧部门名称 + */ + private String oldDeptName; + + /** + * 新部门名称 + */ + private String newDeptName; + + /** + * 部门类型 + */ + private String typeKey; +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/producer/OrganizationModifyProducer.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/producer/OrganizationModifyProducer.java new file mode 100644 index 0000000..48cc8b0 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/rocketmq/producer/OrganizationModifyProducer.java @@ -0,0 +1,44 @@ +package com.elink.esua.epdc.rocketmq.producer; + +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * 组织机构信息修改-发送MQ消息 + * + * @Author:liuchuang + * @Date:2020/3/5 17:53 + */ +@Slf4j +@Component +public class OrganizationModifyProducer { + + @Autowired + private RocketMQTemplate rocketMQTemplate; + + /** + * + * 发送消息 + * + * @params [topic, tag, keys, body] + * @return void + * @author liuchuang + * @since 2020/3/6 21:09 + */ + public void sendMessage(String topic, String tag, String keys, String body) { + Message message = new Message(topic, tag, keys, body.getBytes()); + try { + SendResult sendResult = rocketMQTemplate.getProducer().send(message); + log.info("EPDC-ADMIN-SERVER发送消息结果:{sendStatus:{}, topic:{}, msgId:{}}", sendResult.getSendStatus(), topic, sendResult.getMsgId()); + } catch (Exception e) { + log.error("EPDC-ADMIN-SERVER发送消息异常:{topic:{}, tag:{}, keys:{}, body:{}}", topic, tag, keys, body); + e.printStackTrace(); + } + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuService.java new file mode 100644 index 0000000..401d3fc --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuService.java @@ -0,0 +1,155 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +public interface AppMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AppMenuDTO + * @author generator + * @date 2019-11-19 + */ + AppMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void save(AppMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void update(AppMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-19 + */ + void delete(String[] ids); + + + /** + * 获取APP菜单列表 + * + * @param type 菜单类型 0:菜单 1:按钮 null:全部 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/11/19 13:27 + */ + List getAppMenuList(Integer type); + + /** + * 根据ID删除 + * + * @param id 菜单ID + * @return void + * @author work@yujt.net.cn + * @date 2019/11/19 14:31 + */ + void delete(Long id); + + /** + * 判断是否有子级菜单 + * + * @param id 菜单ID + * @return boolean + * @author work@yujt.net.cn + * @date 2019/11/19 14:30 + */ + boolean hasChileMenu(Long id); + + /** + * 用户app端菜单列表 + * + * @param userDetail 用户信息 + * @param type 菜单类型 + */ + List getUserMenuList(UserDetail userDetail, Integer type); + + /** + * @param mobile + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 首页面板 获取工作端APP菜单 + * @Date 2019/11/20 10:42 + **/ + Result> indexPanel(String mobile); + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + Result> getAnalysisIndexPanel(String userId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuTemplateService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuTemplateService.java new file mode 100644 index 0000000..5253095 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppMenuTemplateService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.AppMenuTemplateDTO; +import com.elink.esua.epdc.entity.AppMenuTemplateEntity; + +import java.util.List; +import java.util.Map; + +/** + * APP菜单模板管理 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-19 + */ +public interface AppMenuTemplateService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AppMenuTemplateDTO + * @author generator + * @date 2019-11-19 + */ + AppMenuTemplateDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void save(AppMenuTemplateDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void update(AppMenuTemplateDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppRoleMenuService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppRoleMenuService.java new file mode 100644 index 0000000..2080c9c --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AppRoleMenuService.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.AppRoleMenuDTO; +import com.elink.esua.epdc.entity.AppRoleMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +public interface AppRoleMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AppRoleMenuDTO + * @author generator + * @date 2019-11-19 + */ + AppRoleMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void save(AppRoleMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-19 + */ + void update(AppRoleMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-19 + */ + void delete(String[] ids); + + /** + * 保存或修改 + * + * @param roleId 角色ID + * @param appMenuIdList 菜单ID列表 + */ + void saveOrUpdate(Long roleId, List appMenuIdList); + + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 根据角色ID,获取菜单ID列表 + * + * @param id + * @return + */ + List getAppMenuIdList(Long id); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AreaService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AreaService.java new file mode 100644 index 0000000..b5a8e01 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/AreaService.java @@ -0,0 +1,41 @@ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SimpleAreaDTO; +import com.elink.esua.epdc.dto.SysSimpleDeptDTO; +import com.elink.esua.epdc.entity.AreaEntity; + +import java.util.List; +import java.util.Map; + +/** + * 行政区划 + * + * @author yujintao + * @date 2019/9/3 16:54 + */ +public interface AreaService extends BaseService { + + + /** + * 根据区划ID,获取下属区域列表 + * + * @param areaId + * @return com.elink.esua.commons.tools.utils.Result> + * @author yujintao + * @date 2019/6/13 10:35 + */ + Result> listSimpleAreaInfo(String areaId); + + /** + * 根据上级部门ID,获取下属部门简要信息列表 + * + * @param params 父部门ID + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author yujintao + * @date 2019/9/4 16:21 + */ + Result> listSimpleDeptInfo(Map params); +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java new file mode 100644 index 0000000..0545ba8 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptGridPlatformService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.DeptGridPlatformDTO; +import com.elink.esua.epdc.entity.DeptGridPlatformEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +public interface DeptGridPlatformService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-25 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DeptGridPlatformDTO + * @author generator + * @date 2019-12-25 + */ + DeptGridPlatformDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void save(DeptGridPlatformDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-25 + */ + void update(DeptGridPlatformDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-12-25 + */ + void delete(String[] ids); + + /** + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据部门id查询记录 + * @Date 2019/12/25 15:10 + **/ + Result getDeptGridPlatformDTO(String deptId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptMaCodeService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptMaCodeService.java new file mode 100644 index 0000000..c82db65 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/DeptMaCodeService.java @@ -0,0 +1,124 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.DeptMaCodeDTO; +import com.elink.esua.epdc.entity.DeptMaCodeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格小程序码 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-09-19 + */ +public interface DeptMaCodeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-09-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-09-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DeptMaCodeDTO + * @author generator + * @date 2019-09-19 + */ + DeptMaCodeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-09-19 + */ + void save(DeptMaCodeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-09-19 + */ + void update(DeptMaCodeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-09-19 + */ + void delete(String[] ids); + + /** + * 所有部门小程序码初始化 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/9/19 09:32 + */ + Result initDeptMaCode(); + + /** + * 生成指定网格小程序码 + * + * @param gridId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/9/19 11:05 + */ + Result createDeptMaCode(String gridId); + + /** + * 创建网格长注册小程序码 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/10/22 09:59 + */ + Result createGridLeaderMaCode(); +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java new file mode 100644 index 0000000..a59c4e7 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisMenuService.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; +import com.elink.esua.epdc.dto.*; +import java.util.List; +import java.util.Map; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +public interface SysAnalysisMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-25 + */ + List list(Map params); + + /** + * 判断是否有子级菜单 + * + * @param id 菜单ID + * @return boolean + * @author work@yujt.net.cn + * @date 2019/11/19 14:30 + */ + boolean hasChileMenu(Long id); + + List getAnalysisMenuList(Integer type); + + /** + * 单条查询 + * + * @param id + * @return SysAnalysisMenuDTO + * @author generator + * @date 2020-03-25 + */ + SysAnalysisMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void save(SysAnalysisMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void update(SysAnalysisMenuDTO dto); + + /** + * 用户app端菜单列表 + * + * @param userDetail 用户信息 + * @param type 菜单类型 + */ + List getUserMenuList(UserDetail userDetail, Integer type); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-25 + */ + void delete(Long id); + /** + * @param userId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author lpf + * @Description 首页面板 获取数据端APP菜单 + * @Date 2020/03/18 10:42 + **/ + Result> getAnalysisIndexPanel(String userId); +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java new file mode 100644 index 0000000..9ccfd8c --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysAnalysisRoleMenuService.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +public interface SysAnalysisRoleMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-25 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-25 + */ + List list(Map params); + + /** + * 保存或修改 + * + * @param roleId 角色ID + * @param analysisMenuIdList 菜单ID列表 + */ + void saveOrUpdate(Long roleId, List analysisMenuIdList); + + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 单条查询 + * + * @param id + * @return SysAnalysisRoleMenuDTO + * @author generator + * @date 2020-03-25 + */ + SysAnalysisRoleMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void save(SysAnalysisRoleMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-25 + */ + void update(SysAnalysisRoleMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-25 + */ + void delete(String[] ids); + List getAnalysisMenuIdList(Long id); +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDeptService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDeptService.java new file mode 100644 index 0000000..12ed317 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDeptService.java @@ -0,0 +1,274 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; +import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; +import com.elink.esua.epdc.entity.SysDeptEntity; + +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysDeptService extends BaseService { + + List list(Map params); + + SysDeptDTO get(Long id); + + void save(SysDeptDTO dto); + + void update(SysDeptDTO dto); + + void delete(Long id); + + /** + * 根据部门ID,获取下属部门 + * + * @param pid + * @return java.util.List + * @author + * @date 2019/9/4 20:54 + */ + List subList(String pid); + + /** + * 根据部门ID,获取本部门及子部门ID列表 + * + * @param id 部门ID + */ + List getSubDeptIdList(Long id); + + /** + * 获取所有下属网格ID集合 + * + * @param pid 部门ID + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author yujintao + * @date 2019/9/5 13:45 + */ + Result> listGridIdByPid(Long pid); + + /** + * 通过网格ID获取该网格所有上级机构 + * + * @param gridId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author yujintao + * @date 2019/9/7 09:13 + */ + Result getCompleteDept(String gridId); + + /** + * 通过网格ID获取该网格所有上级机构 + * + * @param deptId + * @return com.elink.esua.epdc.dto.CompleteDeptDTO + * @author yujintao + * @date 2019/9/7 09:13 + */ + ParentAndAllDeptDTO getParentAndAllDept(String deptId); + + /** + * 通过街道ID获取项目可流转部门 + * + * @Params: [deptId] + * @Return: java.util.List + * @Author: liuchuang + * @Date: 2019/9/16 16:54 + */ + List listOfItemCirculationDept(Long deptId); + + + /*** + * 通过编码得到党委编码 + * @param partyCode + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/9/20 19:57 + */ + Map getIdByCode(String partyCode); + + /*** + * 校验编码是否重复 + * @param dto + * @return java.lang.Integer + * @author qushutong + * @date 2019/9/21 14:14 + */ + Integer getCodeCount(SysDeptDTO dto); + + /** + * 通过网格id集合,获取网格长管理的所有网格 + * + * @param gridIdList + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/10/24 15:26 + */ + List selectListGridForLeader(List gridIdList); + + /** + * 根据部门id,获取所有上级部门id,英文逗号隔开拼接字符串 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/11/27 15:09 + */ + Result getParentDeptIds(Long deptId); + + /** + * 根据部门id,获取部门所在四级机构的所有机构名称 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/11/27 15:09 + */ + Result> getCompleteDeptList(Long deptId); + + /** + * 组装用户部门多层结构 + * + * @param userId + * @return void + * @author work@yujt.net.cn + * @date 2019/11/27 14:33 + */ + void packageUserDeptOption(Long userId); + + /** + * 从缓存中读取用户部门层级结构 + * + * @return com.elink.esua.epdc.dto.DeptOption + * @author work@yujt.net.cn + * @date 2019/11/28 11:13 + */ + DeptOption getUserDeptOption(); + + DeptOption getDeptAuthByUser(); + + List getGridAuthByUser(); + + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description + * @Date 2019/12/4 19:43 + **/ + List listUserSysDeptInfoResultDTO(UserSysDeptInfoFormDTO formDTO); + + /*** + * 组装所有部门 + * @param + * @return void + * @author qushutong + * @date 2019/12/13 13:54 + */ + void packgeAllDeptOption(); + + /*** + * 获取所有部门树 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/13 14:48 + */ + Result getDeptTree(); + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取所有部门树:二级只要街道 + * @Date 2020/1/31 10:30 + **/ + Result getDeptTreeForEpiDemic(); + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询未建立党员群的网格列表 + * @Date 2019/12/19 11:20 + **/ + PageData listCompleteDeptDTO(Map params); + + /** + * 获取用户部门多层结构(完整层级结构,包括顶级部门),用户前端显示,请求需携带token + * + * @author work@yujt.net.cn + * @date 2020/1/28 10:40 + */ + DeptOption getAllDeptOptionByLoginUser(); + + /*** + * 获取所有网格 + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author qushutong + * @date 2019/12/12 17:29 + */ + Result> listAllGridId(); + + /** + * 按部门类型,分页查询部门列表 + * + * @param typeKey 部门类型 + * @param pageSize 页容量 + * @param pageIndex 页码 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author work@yujt.net.cn + * @date 2019/12/17 16:05 + */ + Result> pageDeptIdByTypeKey(String typeKey, Integer pageSize, Integer pageIndex); + + /** + * 根据部门id,获取部门层级关系,获取部门领导姓名 + * + * @param deptId 部门id + * @param leaderFlag 是否需要查询网格长姓名 0 否 、1 是 + * @return com.elink.esua.epdc.dto.DeptLevelAndLeaderDTO + * @author work@yujt.net.cn + * @date 2019/12/18 11:05 + */ + DeptOption getMiddleByLoginUser(); + + /** + * 获取用户部门层级结构(街道),用户前端显示,请求需携带token + * + * @return com.elink.esua.epdc.dto.DeptOption + * @author work@yujt.net.cn + * @date 2020/2/11 11:31 + */ + DeptOption getStreetByLoginUser(); + + DeptLevelAndLeaderDTO getDeptInfoById(Long deptId, String leaderFlag); + + /** + * @Description: 获取全部的部门基本信息 + * @Param: [userSysDeptInfoFormDTO] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2020-04-14 + */ + List listAllDeptInfo(UserSysDeptInfoFormDTO formDTO); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDictService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDictService.java new file mode 100644 index 0000000..7598352 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDictService.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SysDictDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import com.elink.esua.epdc.entity.SysDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysDictService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysDictDTO get(Long id); + + void save(SysDictDTO dto); + + void update(SysDictDTO dto); + + void delete(Long[] ids); + + //根据pid获取下一级子列表 + List subList(Map params); + /** + * 根据数据字典类型获取简版数据字典列表,用于页面下拉菜单 + * + * @param dictType 数据字典类型 + * @return com.elink.esua.commons.tools.utils.Result> + * @author yujintao + * @date 2019/7/15 09:33 + */ + Result> listSimpleDictInfo(String dictType); + + /** + * 根据ID删除 + * + * @param id + * @return void + * @author yujintao + * @date 2019/7/15 10:14 + */ + void delete(Long id); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLanguageService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLanguageService.java new file mode 100644 index 0000000..d25a07f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLanguageService.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.entity.SysLanguageEntity; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.entity.SysLanguageEntity; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +public interface SysLanguageService extends BaseService { + + /** + * 保存或更新 + * @param tableName 表名 + * @param tableId 表主键 + * @param fieldName 字段名 + * @param fieldValue 字段值 + * @param language 语言 + */ + void saveOrUpdate(String tableName, Long tableId, String fieldName, String fieldValue, String language); +} + diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogErrorService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogErrorService.java new file mode 100644 index 0000000..d133e3c --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogErrorService.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.SysLogErrorDTO; +import com.elink.esua.epdc.entity.SysLogErrorEntity; + +import java.util.List; +import java.util.Map; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysLogErrorService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + void save(SysLogErrorEntity entity); + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogLoginService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogLoginService.java new file mode 100644 index 0000000..26c5cc7 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogLoginService.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.entity.SysLogLoginEntity; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.SysLogLoginDTO; +import com.elink.esua.epdc.entity.SysLogLoginEntity; + +import java.util.List; +import java.util.Map; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysLogLoginService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + void save(SysLogLoginEntity entity); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogOperationService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogOperationService.java new file mode 100644 index 0000000..dc42786 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysLogOperationService.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.SysLogOperationDTO; +import com.elink.esua.epdc.entity.SysLogOperationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysLogOperationService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + void save(SysLogOperationEntity entity); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysMenuService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysMenuService.java new file mode 100644 index 0000000..4a80400 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysMenuService.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.entity.SysMenuEntity; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.dto.SysMenuDTO; +import com.elink.esua.epdc.entity.SysMenuEntity; + +import java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysMenuService extends BaseService { + + SysMenuDTO get(Long id); + + void save(SysMenuDTO dto); + + void update(SysMenuDTO dto); + + void delete(Long id); + + /** + * 菜单列表 + * + * @param type 菜单类型 + */ + List getMenuList(Integer type); + + /** + * 用户菜单列表 + * + * @param userDetail 用户信息 + * @param type 菜单类型 + */ + List getUserMenuList(UserDetail userDetail, Integer type); + + /** + * 用户菜单导航 + * @param userDetail 用户信息 + */ + List getUserMenuNavList(UserDetail userDetail); + + /** + * 获取用户权限标识 + */ + Set getUserPermissions(UserDetail userDetail); + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(Long pid); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysParamsService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysParamsService.java new file mode 100644 index 0000000..810be7f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysParamsService.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.SysParamsDTO; +import com.elink.esua.epdc.entity.SysParamsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysParamsService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysParamsDTO get(Long id); + + void save(SysParamsDTO dto); + + void update(SysParamsDTO dto); + + void delete(Long[] ids); + + /** + * 根据参数编码,获取参数的value值 + * + * @param paramCode 参数编码 + */ + String getValue(String paramCode); + + /** + * 根据参数编码,更新value + * @param paramCode 参数编码 + * @param paramValue 参数值 + */ + int updateValueByCode(String paramCode, String paramValue); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysResourceService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysResourceService.java new file mode 100644 index 0000000..d48f331 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysResourceService.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.security.bo.ResourceBO; +import com.elink.esua.epdc.dto.MenuResourceDTO; +import com.elink.esua.epdc.entity.SysResourceEntity; + +import java.util.List; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysResourceService extends BaseService { + + /** + * 获取菜单资源列表 + * @param menuId 菜单ID + */ + List getMenuResourceList(Long menuId); + + /** + * 获取所有资源列表 + */ + List getResourceList(); + + /** + * 获取用户资源列表 + * @param userId 用户ID + */ + List getUserResourceList(Long userId); + + /** + * 保存菜单资源 + * @param menuId 菜单ID + * @param menuName 菜单名称 + * @param resourceList 资源列表 + */ + void saveMenuResource(Long menuId, String menuName, List resourceList); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleDataScopeService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleDataScopeService.java new file mode 100644 index 0000000..f48a520 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleDataScopeService.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.dto.DataScopeDeptList; +import com.elink.esua.epdc.entity.SysRoleDataScopeEntity; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleDataScopeService extends BaseService { + + /** + * 根据角色ID,获取部门ID列表 + */ + List getDeptIdList(Long roleId); + + /** + * 获取用户对应的部门数据权限 + * @param userId 用户ID + * @return 返回部门ID列表 + */ + List getDataScopeList(Long userId); + + /** + * 获取用户对应的部门数据权限 + * @param userId 用户ID + * @return 返回部门ID列表 + */ + List getDataScopeDetailList(Long userId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param deptIdList 部门ID列表 + */ + void saveOrUpdate(Long roleId, List deptIdList); + + /** + * 根据角色id,删除角色数据权限关系 + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleMenuService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleMenuService.java new file mode 100644 index 0000000..3fcd35e --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleMenuService.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.entity.SysRoleMenuEntity; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.entity.SysRoleMenuEntity; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleMenuService extends BaseService { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(Long roleId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param menuIdList 菜单ID列表 + */ + void saveOrUpdate(Long roleId, List menuIdList); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleId 角色id + */ + void deleteByRoleId(Long roleId); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(Long menuId); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleService.java new file mode 100644 index 0000000..7300f79 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleService.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.SysRoleDTO; +import com.elink.esua.epdc.entity.SysRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysRoleDTO get(Long id); + + void save(SysRoleDTO dto); + + void update(SysRoleDTO dto); + + void delete(Long[] ids); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleUserService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleUserService.java new file mode 100644 index 0000000..50ebae9 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysRoleUserService.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.entity.SysRoleUserEntity; +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.entity.SysRoleUserEntity; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysRoleUserService extends BaseService { + + /** + * 保存或修改 + * @param userId 用户ID + * @param roleIdList 角色ID列表 + */ + void saveOrUpdate(Long userId, List roleIdList); + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(Long[] roleIds); + + /** + * 根据用户id,删除角色用户关系 + * @param userId 用户id + */ + void deleteByUserId(Long userId); + + /** + * 角色ID列表 + * @param userId 用户ID + */ + List getRoleIdList(Long userId); + + /** + * 用户ID列表 + * @param menuCode 用户ID + */ + List getWorkRecordRoleUser(String menuCode); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysUserService.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysUserService.java new file mode 100644 index 0000000..9a5363b --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysUserService.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.SysUserDTO; +import com.elink.esua.epdc.dto.SysUserOpenIdFormDTO; +import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; +import com.elink.esua.epdc.entity.SysUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface SysUserService extends BaseService { + + PageData page(Map params); + + List list(Map params); + + SysUserDTO get(Long id); + + SysUserDTO getByUsername(String username); + + void save(SysUserDTO dto); + + void update(SysUserDTO dto); + + void delete(Long[] ids); + + /** + * 修改密码 + * + * @param id 用户ID + * @param newPassword 新密码 + */ + void updatePassword(Long id, String newPassword); + + /** + * 根据部门ID,查询用户数 + */ + int getCountByDeptId(Long deptId); + + /** + * 网格长注册时,根据手机号,查询网格长管理的所有网格 + * + * @param mobile + * @return java.util.List + * @author work@yujt.net.cn + * @date 2019/10/22 16:19 + */ + Result listGridWhileLeaderRegister(String mobile); + + /** + * 根据openId获取用户信息 + * + * @return com.elink.esua.epdc.dto.SysUserDTO + * @params [openId] + * @author liuchuang + * @since 2019/11/20 13:56 + */ + SysUserDTO getSysUserInfoByOpenId(String openId); + + /** + * 获取部门下的所有用户ID + * + * @return java.util.List + * @params [deptId] + * @author liuchuang + * @since 2019/10/29 16:14 + */ + List listOfUserIdsByDeptId(Long deptId); + + /** + * 根据用户名更新用户微信openId + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [sysUserOpenIdFormDto] + * @author liuchuang + * @since 2019/11/20 9:56 + */ + Result modifyOpenIdByUsername(SysUserOpenIdFormDTO sysUserOpenIdFormDto); + + /** + * 退出登录 + * @param userId + * @return + */ + void updateUserOpenId(Long userId); + + /** + * @Description: 根据部门id,查询部门下的所有用户手机号 + * @Param: [deptId] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2020-01-09 + */ + Result> getUserPhoneByListDeptId(List deptId); + + /** + * @Description: 根据议题网格ID查询拥有这个网格数据权限且是网格长的角色,再根据角色查出所有用户手机号 + * @Param: [deptId] + * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @Author: zy + * @Date: 2020-01-09 + */ + Result> getSysGridLeaderPhone(Long deptId); + + /** + * @describe: 判断是否更新头像 + * @author wangtong + * @date 2020/3/30 13:52 + * @param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result checkUpdateAvatar(); + + /** + * @describe: 更新头像 + * @author wangtong + * @date 2020/3/30 16:12 + * @param [avatar] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result updateAvatar(String avatar); +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java new file mode 100644 index 0000000..876d250 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java @@ -0,0 +1,185 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.HttpContextUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.utils.TreeUtils; +import com.elink.esua.epdc.dao.AppMenuDao; +import com.elink.esua.epdc.dto.AppMenuDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import com.elink.esua.epdc.enums.MenuTableEnum; +import com.elink.esua.epdc.service.AppMenuService; +import com.elink.esua.epdc.service.SysLanguageService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * APP菜单管理 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Service +public class AppMenuServiceImpl extends BaseServiceImpl implements AppMenuService { + + @Autowired + private SysLanguageService sysLanguageService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AppMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + return ConvertUtils.sourceToTarget(entityList, AppMenuDTO.class); + } + + @Override + public List getAppMenuList(Integer type) { + List menuList = baseDao.selectListAppMenu(type, HttpContextUtils.getLanguage()); + return TreeUtils.build(menuList, Constant.MENU_ROOT); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public AppMenuDTO get(String id) { + AppMenuDTO dto = baseDao.selectByIdDIY(id,HttpContextUtils.getLanguage()); + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AppMenuDTO dto) { + AppMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppMenuEntity.class); + insert(entity); + + sysLanguageService.saveOrUpdate(MenuTableEnum.APP.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AppMenuDTO dto) { + AppMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppMenuEntity.class); + updateById(entity); + + sysLanguageService.saveOrUpdate(MenuTableEnum.APP.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 物理删除(没有使用@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void delete(Long id) { + baseDao.deleteById(id); + } + + @Override + public boolean hasChileMenu(Long id) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("pid", id) + .eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + Integer selectCount = baseDao.selectCount(wrapper); + return selectCount > NumConstant.ZERO; + } + + /** + * 用户app端菜单列表 + * + * @param userDetail 用户信息 + * @param type 菜单类型 + */ + @Override + public List getUserMenuList(UserDetail userDetail, Integer type) { + List menuList; + + //系统管理员,拥有最高权限 + if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { + menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + } else { + menuList = baseDao.getUserMenuList(userDetail.getId(), type, HttpContextUtils.getLanguage()); + } + + List dtoList = ConvertUtils.sourceToTarget(menuList, AppMenuDTO.class); + + return TreeUtils.build(dtoList); + } + + /** + * @param mobile + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 首页面板 获取工作端APP菜单 + * @Date 2019/11/20 10:42 + **/ + @Override + public Result> indexPanel(String mobile) { + if (StringUtils.isBlank(mobile)) { + return new Result().error("手机号不能为空"); + } + List indexPanelResultDTOList = this.baseDao.indexPanelByMobile(mobile); + return new Result().ok(indexPanelResultDTOList); + } + @Override + public Result> getAnalysisIndexPanel(String userId) { + if (StringUtils.isBlank(userId)) { + return new Result().error("用户Id不能为空"); + } + List list = this.baseDao.getAnalysisIndexPanel(userId); + return new Result().ok(list); + } + + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuTemplateServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuTemplateServiceImpl.java new file mode 100644 index 0000000..d89ba7b --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuTemplateServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.AppMenuTemplateDao; +import com.elink.esua.epdc.dto.AppMenuTemplateDTO; +import com.elink.esua.epdc.entity.AppMenuTemplateEntity; +import com.elink.esua.epdc.redis.AppMenuTemplateRedis; +import com.elink.esua.epdc.service.AppMenuTemplateService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * APP菜单模板管理 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-19 + */ +@Service +public class AppMenuTemplateServiceImpl extends BaseServiceImpl implements AppMenuTemplateService { + + @Autowired + private AppMenuTemplateRedis appMenuTemplateRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AppMenuTemplateDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AppMenuTemplateDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + String templateName = (String) params.get("templateName"); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.like(StringUtils.isNotBlank(templateName),"TEMPLATE_NAME",templateName); + return wrapper; + } + + @Override + public AppMenuTemplateDTO get(String id) { + AppMenuTemplateEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AppMenuTemplateDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AppMenuTemplateDTO dto) { + AppMenuTemplateEntity entity = ConvertUtils.sourceToTarget(dto, AppMenuTemplateEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AppMenuTemplateDTO dto) { + AppMenuTemplateEntity entity = ConvertUtils.sourceToTarget(dto, AppMenuTemplateEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppRoleMenuServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppRoleMenuServiceImpl.java new file mode 100644 index 0000000..c3caee4 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppRoleMenuServiceImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.AppRoleMenuDao; +import com.elink.esua.epdc.dto.AppRoleMenuDTO; +import com.elink.esua.epdc.entity.AppRoleMenuEntity; +import com.elink.esua.epdc.redis.AppRoleMenuRedis; +import com.elink.esua.epdc.service.AppRoleMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * APP角色菜单关系 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-11-19 + */ +@Service +public class AppRoleMenuServiceImpl extends BaseServiceImpl implements AppRoleMenuService { + + @Autowired + private AppRoleMenuRedis appRoleMenuRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AppRoleMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AppRoleMenuDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public AppRoleMenuDTO get(String id) { + AppRoleMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AppRoleMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AppRoleMenuDTO dto) { + AppRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppRoleMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AppRoleMenuDTO dto) { + AppRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, AppRoleMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 保存或修改 + * + * @param roleId 角色ID + * @param appMenuIdList 菜单ID列表 + */ + @Override + public void saveOrUpdate(Long roleId, List appMenuIdList) { + //先删除角色菜单权限关系 + deleteByRoleId(roleId); + + //角色没有一个菜单权限的情况 + if (CollUtil.isEmpty(appMenuIdList)) { + return; + } + + //保存角色菜单权限关系 + for (Long menuId : appMenuIdList) { + AppRoleMenuEntity appRoleMenuEntity = new AppRoleMenuEntity(); + appRoleMenuEntity.setMenuId(menuId); + appRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(appRoleMenuEntity); + } + } + + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + @Override + public void deleteByRoleId(Long roleId) { + baseDao.deleteByRoleId(roleId); + } + + /** + * 根据角色ID,获取菜单ID列表 + * + * @param id + * @return + */ + @Override + public List getAppMenuIdList(Long id) { + return baseDao.getAppMenuIdList(id); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java new file mode 100644 index 0000000..8432d45 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AreaServiceImpl.java @@ -0,0 +1,80 @@ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.AreaDao; +import com.elink.esua.epdc.dao.SysDeptDao; +import com.elink.esua.epdc.dto.SimpleAreaDTO; +import com.elink.esua.epdc.dto.SysSimpleDeptDTO; +import com.elink.esua.epdc.entity.AreaEntity; +import com.elink.esua.epdc.redis.AreaRedis; +import com.elink.esua.epdc.service.AreaService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + + +/** + * @author yujintao + * @date 2019/9/3 16:55 + */ +@Slf4j +@Service +public class AreaServiceImpl extends BaseServiceImpl implements AreaService { + + + @Autowired + private AreaRedis areaRedis; + + @Autowired + private SysDeptDao deptDao; + + + @Override + public Result> listSimpleAreaInfo(String areaId) { + + List simpleAreaList = Lists.newArrayList(); + + try { + if (StringUtils.isNotBlank(areaId)) { + + List areaList = areaRedis.getSimpleAreaList(areaId); + if (null != areaList) { + return new Result>().ok(areaList); + } + + Integer pid = Integer.parseInt(areaId); + QueryWrapper arWrapper = new QueryWrapper<>(); + arWrapper.select("ID", "NAME"); + arWrapper.eq("PARENT_ID", pid); + arWrapper.eq("STATUS", NumConstant.ONE); + arWrapper.orderByAsc("LEVEL", "SORT"); + List entityList = baseDao.selectList(arWrapper); + if (!entityList.isEmpty()) { + simpleAreaList = ConvertUtils.sourceToTarget(entityList, SimpleAreaDTO.class); + areaRedis.setSimpleAreaList(areaId, simpleAreaList); + } + } + } catch (Exception e) { + log.error("获取区划信息失败,错误信息{}", e.getMessage()); + } + return new Result>().ok(simpleAreaList); + } + + @Override + public Result> listSimpleDeptInfo(Map params) { + + List sysSimpleDeptS = this.deptDao.listSimpleDeptInfo(params); + + return new Result().ok(sysSimpleDeptS); + } +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java new file mode 100644 index 0000000..3894f56 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptGridPlatformServiceImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.DeptGridPlatformDao; +import com.elink.esua.epdc.dto.DeptGridPlatformDTO; +import com.elink.esua.epdc.entity.DeptGridPlatformEntity; +import com.elink.esua.epdc.redis.DeptGridPlatformRedis; +import com.elink.esua.epdc.service.DeptGridPlatformService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-12-25 + */ +@Service +public class DeptGridPlatformServiceImpl extends BaseServiceImpl implements DeptGridPlatformService { + + @Autowired + private DeptGridPlatformRedis deptGridPlatformRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DeptGridPlatformDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DeptGridPlatformDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DeptGridPlatformDTO get(String id) { + DeptGridPlatformEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DeptGridPlatformDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DeptGridPlatformDTO dto) { + DeptGridPlatformEntity entity = ConvertUtils.sourceToTarget(dto, DeptGridPlatformEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeptGridPlatformDTO dto) { + DeptGridPlatformEntity entity = ConvertUtils.sourceToTarget(dto, DeptGridPlatformEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据部门id查询记录 + * @Date 2019/12/25 15:10 + **/ + @Override + public Result getDeptGridPlatformDTO(String deptId) { + DeptGridPlatformDTO dto=baseDao.selectDeptGridPlatformDTO(deptId); + return new Result().ok(dto); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java new file mode 100644 index 0000000..492128a --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java @@ -0,0 +1,244 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.DeptMaCodeDao; +import com.elink.esua.epdc.dto.DeptMaCodeDTO; +import com.elink.esua.epdc.dto.UploadToOssDTO; +import com.elink.esua.epdc.entity.DeptMaCodeEntity; +import com.elink.esua.epdc.feign.OssFeignClient; +import com.elink.esua.epdc.service.DeptMaCodeService; +import com.elink.esua.epdc.utils.WxMaServiceUtils; +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.error.WxErrorException; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.*; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格小程序码 + * + * @author work@yujt.net.cn + * @since v1.0.0 2019-09-19 + */ +@Slf4j +@Service +public class DeptMaCodeServiceImpl extends BaseServiceImpl implements DeptMaCodeService { + + @Autowired + private WxMaServiceUtils wxMaServiceUtils; + + @Autowired + private OssFeignClient ossFeignClient; + + /** + * 小程序首页 + */ + private static String MA_FRONT_PAGE_URL = "pages/index/index"; + + @Override + public PageData page(Map params) { + String leaderFlag = (String) params.get("leaderFlag"); + if (StringUtils.isNotBlank(leaderFlag) && leaderFlag.equals(YesOrNoEnum.YES.value())) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("LEADER_FLAG", leaderFlag); + + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + + PageData pageData = getPageData(page, DeptMaCodeDTO.class); + List pageDataList = pageData.getList(); + for (DeptMaCodeDTO dto : pageDataList) { + dto.setStreet("全部街道通用"); + dto.setCommunity("全部社区通用"); + dto.setGrid("全部网格通用"); + } + + return pageData; + } + + IPage page = this.getPage(params); + List dtoList = this.baseDao.selectListDeptMaCode(params); + + return new PageData<>(dtoList, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DeptMaCodeDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DeptMaCodeDTO get(String id) { + DeptMaCodeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DeptMaCodeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DeptMaCodeDTO dto) { + DeptMaCodeEntity entity = ConvertUtils.sourceToTarget(dto, DeptMaCodeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeptMaCodeDTO dto) { + DeptMaCodeEntity entity = ConvertUtils.sourceToTarget(dto, DeptMaCodeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result initDeptMaCode() { + + List gridIdList = this.baseDao.selectListNoCodeGridId(); + if (CollUtil.isEmpty(gridIdList)) { + return new Result(); + } + DeptMaCodeEntity entity; + for (Long gridId : gridIdList) { + entity = new DeptMaCodeEntity(); + entity.setCodeUrl(this.createMaCode(String.valueOf(gridId), MA_FRONT_PAGE_URL)); + entity.setGridId(gridId); + this.baseDao.insert(entity); + } + return new Result(); + } + + @Override + public Result createDeptMaCode(String gridId) { + DeptMaCodeEntity entity = new DeptMaCodeEntity(); + entity.setCodeUrl(this.createMaCode(gridId, MA_FRONT_PAGE_URL)); + entity.setGridId(Long.parseLong(gridId)); + entity.setLeaderFlag(YesOrNoEnum.NO.value()); + this.baseDao.insert(entity); + return new Result(); + } + + @Override + public Result createGridLeaderMaCode() { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("leader_flag", YesOrNoEnum.YES.value()); + Integer selectCount = this.baseDao.selectCount(wrapper); + if (selectCount > NumConstant.ZERO) { + return new Result(); + } + DeptMaCodeEntity entity = new DeptMaCodeEntity(); + entity.setCodeUrl(this.createMaCode("gridLeader", MA_FRONT_PAGE_URL)); + entity.setLeaderFlag(YesOrNoEnum.YES.value()); + this.baseDao.insert(entity); + return new Result(); + } + + /** + * 创建微信小程序码,并上传到oss + * + * @param param 小程序码的参数 + * @param pageUrl 小程序码的跳转链接 + * @return java.lang.String 小程序码的下载抵制 + * @author work@yujt.net.cn + * @date 2019/10/22 10:14 + */ + private String createMaCode(String param, String pageUrl) { + File wxaCodeUnlimit; + try { + wxaCodeUnlimit = wxMaServiceUtils.normalWxMaService().getQrcodeService() + .createWxaCodeUnlimit(param, pageUrl, 1280, true, null, false); + } catch (WxErrorException e) { + throw new RenException("请求微信接口失败"); + } + + UploadToOssDTO dto = new UploadToOssDTO(); + dto.setFileByte(this.fileToByteArray(wxaCodeUnlimit)); + dto.setFileName(wxaCodeUnlimit.getName()); + + Result ossResult = ossFeignClient.uploadFile(dto); + if (null == ossResult || !ossResult.success() || null == ossResult.getData()) { + throw new RenException("小程序码上传失败"); + } + return ossResult.getData(); + } + + /** + * File文件转为byte[] + * + * @param file + * @return byte[] + * @author work@yujt.net.cn + * @date 2019/9/19 15:56 + */ + private byte[] fileToByteArray(File file) { + try { + //获取输入流 + FileInputStream fis = new FileInputStream(file); + //新的 byte 数组输出流,缓冲区容量1024byte + ByteArrayOutputStream bos = new ByteArrayOutputStream(1024); + //缓存 + byte[] b = new byte[1024]; + int n; + while ((n = fis.read(b)) != NumConstant.ONE_NEG) { + bos.write(b, NumConstant.ZERO, n); + } + fis.close(); + //改变为byte[] + byte[] data = bos.toByteArray(); + bos.close(); + return data; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java new file mode 100644 index 0000000..a4db169 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisMenuServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.HttpContextUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.utils.TreeUtils; +import com.elink.esua.epdc.dao.SysAnalysisMenuDao; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.result.EpdcAppChildNavResultDTO; +import com.elink.esua.epdc.entity.AppMenuEntity; +import com.elink.esua.epdc.entity.SysAnalysisMenuEntity; +import com.elink.esua.epdc.enums.MenuTableEnum; +import com.elink.esua.epdc.redis.SysAnalysisMenuRedis; +import com.elink.esua.epdc.service.SysAnalysisMenuService; +import com.elink.esua.epdc.service.SysLanguageService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 菜单管理 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Service +public class SysAnalysisMenuServiceImpl extends BaseServiceImpl implements SysAnalysisMenuService { + + @Autowired + private SysAnalysisMenuRedis sysAnalysisMenuRedis; + @Autowired + private SysLanguageService sysLanguageService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SysAnalysisMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysAnalysisMenuDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + @Override + public List getAnalysisMenuList(Integer type) { + List menuList = baseDao.selectListAppMenu(type, HttpContextUtils.getLanguage()); + return TreeUtils.build(menuList, Constant.MENU_ROOT); + } + + @Override + public SysAnalysisMenuDTO get(String id) { + SysAnalysisMenuDTO dto = baseDao.selectByIdDIY(id,HttpContextUtils.getLanguage()); + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysAnalysisMenuDTO dto) { + SysAnalysisMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisMenuEntity.class); + insert(entity); + sysLanguageService.saveOrUpdate(MenuTableEnum.ANALYSIS.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysAnalysisMenuDTO dto) { + SysAnalysisMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisMenuEntity.class); + updateById(entity); + sysLanguageService.saveOrUpdate(MenuTableEnum.ANALYSIS.value(), entity.getId(), "name", dto.getName(), HttpContextUtils.getLanguage()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteById(id); + } + @Override + public boolean hasChileMenu(Long id) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("pid", id) + .eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + Integer selectCount = baseDao.selectCount(wrapper); + return selectCount > NumConstant.ZERO; + } + /** + * 用户app端菜单列表 + * + * @param userDetail 用户信息 + * @param type 菜单类型 + */ + @Override + public List getUserMenuList(UserDetail userDetail, Integer type) { + List menuList; + + //系统管理员,拥有最高权限 + if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { + menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + } else { + menuList = baseDao.getUserMenuList(userDetail.getId(), type, HttpContextUtils.getLanguage()); + } + + List dtoList = ConvertUtils.sourceToTarget(menuList, AppMenuDTO.class); + + return TreeUtils.build(dtoList); + } + @Override + public Result> getAnalysisIndexPanel(String userId) { + if (StringUtils.isBlank(userId)) { + return new Result().error("用户Id不能为空"); + } + List list = this.baseDao.getAnalysisIndexPanel(userId); + return new Result().ok(list); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java new file mode 100644 index 0000000..81737ec --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysAnalysisRoleMenuServiceImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.SysAnalysisRoleMenuDao; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.entity.SysAnalysisRoleMenuEntity; +import com.elink.esua.epdc.redis.SysAnalysisRoleMenuRedis; +import com.elink.esua.epdc.service.SysAnalysisRoleMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 角色菜单关系 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-03-25 + */ +@Service +public class SysAnalysisRoleMenuServiceImpl extends BaseServiceImpl implements SysAnalysisRoleMenuService { + + @Autowired + private SysAnalysisRoleMenuRedis sysAnalysisRoleMenuRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SysAnalysisRoleMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysAnalysisRoleMenuDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + /** + * 保存或修改 + * + * @param roleId 角色ID + * @param appMenuIdList 菜单ID列表 + */ + @Override + public void saveOrUpdate(Long roleId, List analysisMenuIdList) { + //先删除角色菜单权限关系 + deleteByRoleId(roleId); + + //角色没有一个菜单权限的情况 + if (CollUtil.isEmpty(analysisMenuIdList)) { + return; + } + + //保存角色菜单权限关系 + for (Long menuId : analysisMenuIdList) { + SysAnalysisRoleMenuEntity appRoleMenuEntity = new SysAnalysisRoleMenuEntity(); + appRoleMenuEntity.setMenuId(menuId); + appRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(appRoleMenuEntity); + } + } + /** + * 根据角色id,删除角色数据权限关系 + * + * @param roleId 角色id + */ + @Override + public void deleteByRoleId(Long roleId) { + baseDao.deleteByRoleId(roleId); + } + + @Override + public SysAnalysisRoleMenuDTO get(String id) { + SysAnalysisRoleMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, SysAnalysisRoleMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysAnalysisRoleMenuDTO dto) { + SysAnalysisRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisRoleMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysAnalysisRoleMenuDTO dto) { + SysAnalysisRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysAnalysisRoleMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + /** + * 根据角色ID,获取菜单ID列表 + * + * @param id + * @return + */ + @Override + public List getAnalysisMenuIdList(Long id) { + return baseDao.getAnalysisMenuIdList(id); + } + +} \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java new file mode 100644 index 0000000..cdf9227 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -0,0 +1,1084 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.db.handler.HandleHelper; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; +import com.elink.esua.epdc.commons.tools.constant.*; +import com.elink.esua.epdc.commons.tools.constant.*; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.redis.RedisKeys; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.utils.TreeUtils; +import com.elink.esua.epdc.constant.RoleTypeKeyConstant; +import com.elink.esua.epdc.dao.SysDeptDao; +import com.elink.esua.epdc.dto.*; +import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; +import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; +import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; +import com.elink.esua.epdc.entity.SysDeptEntity; +import com.elink.esua.epdc.feign.GroupFeignClient; +import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.rocketmq.producer.OrganizationModifyProducer; +import com.elink.esua.epdc.service.SysDeptService; +import com.elink.esua.epdc.service.SysUserService; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 部门管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Slf4j +@Service +public class SysDeptServiceImpl extends BaseServiceImpl implements SysDeptService { + @Autowired + private SysUserService sysUserService; + + @Autowired + private GroupFeignClient groupFeignClient; + + @Autowired + private UserDetailRedis userDetailRedis; + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private OrganizationModifyProducer organizationModifyProducer; + + private static final Logger logger = LoggerFactory.getLogger(SysDeptServiceImpl.class); + + @Override + public List list(Map params) { + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", getSubDeptIdList(user.getDeptId())); + } + + List entityList = baseDao.getList(params); + + List dtoList = ConvertUtils.sourceToTarget(entityList, SysDeptDTO.class); + + return TreeUtils.build(dtoList); + } + + @Override + public List subList(String pid) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("PID", pid) + .ne("TYPE_KEY", "district_dept") + .ne("TYPE_KEY", "street_dept") + .select(FieldConstant.ID, FieldConstant.NAME) + .orderByAsc(FieldConstant.NAME); + List entities = this.baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(entities, SysSimpleDeptDTO.class); + } + + @Override + public SysDeptDTO get(Long id) { + //超级管理员,部门ID为null + if (id == null) { + return null; + } + + SysDeptEntity entity = baseDao.getById(id); + + return ConvertUtils.sourceToTarget(entity, SysDeptDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDeptDTO dto) { + String partyCode = dto.getPartyCode(); + if (StringUtils.isNotBlank(partyCode)) { + if (getCodeCount(dto) > 0) { + throw new RenException("您输入的编码已存在"); + } + } + SysDeptEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptEntity.class); + + entity.setPids(getPidList(entity.getPid())); + insert(entity); + + // 新建网格党支部时创建网格党员群 + if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(dto.getTypeKey())) { + // 获取网格所有上级机构 + Result completeDeptDtoResult = this.getCompleteDept(entity.getId().toString()); + groupFeignClient.createPartyGroup(completeDeptDtoResult.getData()); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDeptDTO dto) { + String partyCode = dto.getPartyCode(); + if (StringUtils.isNotBlank(partyCode)) { + if (getCodeCount(dto) > 0) { + throw new RenException("您输入的编码已存在"); + } + } + SysDeptEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptEntity.class); + + //上级部门不能为自身 + if (entity.getId().equals(entity.getPid())) { + throw new RenException(ErrorCode.SUPERIOR_DEPT_ERROR); + } + + entity.setPids(getPidList(entity.getPid())); + + // 发送消息 + sendMqMessage(dto); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + //判断是否有子部门 + List subList = getSubDeptIdList(id); + if (subList.size() > 1) { + throw new RenException(ErrorCode.DEPT_SUB_DELETE_ERROR); + } + + //判断部门下面是否有用户 + int count = sysUserService.getCountByDeptId(id); + if (count > 0) { + throw new RenException(ErrorCode.DEPT_USER_DELETE_ERROR); + } + + //逻辑删除 + logicDelete(new Long[]{id}, SysDeptEntity.class); + } + + @Override + public List getSubDeptIdList(Long id) { + List deptIdList = baseDao.getSubDeptIdList("%" + id + "%"); + deptIdList.add(id); + + return deptIdList; + } + + /** + * 获取所有上级部门ID + * + * @param pid 上级ID + */ + private String getPidList(Long pid) { + //顶级部门,无上级部门 + if (Constant.DEPT_ROOT.equals(pid)) { + return Constant.DEPT_ROOT + ""; + } + + //所有部门的id、pid列表 + List deptList = baseDao.getIdAndPidList(); + + //list转map + Map map = new HashMap<>(deptList.size()); + for (SysDeptEntity entity : deptList) { + map.put(entity.getId(), entity); + } + + //递归查询所有上级部门ID列表 + List pidList = new ArrayList<>(); + getPidTree(pid, map, pidList); + + return StringUtils.join(pidList, ","); + } + + private void getPidTree(Long pid, Map map, List pidList) { + //顶级部门,无上级部门 + if (Constant.DEPT_ROOT.equals(pid)) { + return; + } + + //上级部门存在 + SysDeptEntity parent = map.get(pid); + if (parent != null) { + getPidTree(parent.getPid(), map, pidList); + } + + pidList.add(pid); + } + + @Override + public Result> listGridIdByPid(Long pid) { + List deptIdList = this.baseDao.listGridIdByPid(pid); + return new Result().ok(deptIdList); + } + + @Override + public Result getCompleteDept(String gridId) { + Long gridIdL = null; + try { + gridIdL = Long.parseLong(gridId.trim()); + } catch (Exception e) { + log.error("->getCompleteDept:::网格ID格式转换异常:::grid->{}", gridId); + } + if (null == gridId) { + return new Result().error("参数格式异常"); + } + CompleteDeptDTO completeDept = this.baseDao.getCompleteDept(gridIdL); + return new Result().ok(completeDept); + } + + @Override + public ParentAndAllDeptDTO getParentAndAllDept(String deptId) { + Long deptIdL = null; + try { + deptIdL = Long.parseLong(deptId.trim()); + } catch (Exception e) { + log.error("->getCompleteDept:::部门ID格式转换异常:::deptId->{}", deptId); + } + if (null == deptIdL) { + throw new RenException("参数格式异常"); + } + CompleteDeptDTO completeDept = this.baseDao.getParentAndAllDept(deptIdL); + ParentAndAllDeptDTO parentAndAllDeptDTO = new ParentAndAllDeptDTO(); + + if (completeDept != null) { + parentAndAllDeptDTO.setGrid(StringUtils.isNotEmpty(completeDept.getGrid()) ? completeDept.getGrid() : ""); + parentAndAllDeptDTO.setGridId(completeDept.getGridId() != null && completeDept.getGridId() != 0 ? completeDept.getGridId() : null); + // 父所有部门(包含街道、社区) + String deptNames = (StringUtils.isNotEmpty(completeDept.getDistrict()) ? completeDept.getDistrict() + "-" : ""); + deptNames += (StringUtils.isNotEmpty(completeDept.getStreet()) ? completeDept.getStreet() + "-" : ""); + deptNames += (StringUtils.isNotEmpty(completeDept.getCommunity()) ? completeDept.getCommunity() + "-" : ""); + String deptIds = (completeDept.getDistrictId() != null && completeDept.getDistrictId() != 0 ? completeDept.getDistrictId().toString() + "," : ""); + deptIds += (completeDept.getStreetId() != null && completeDept.getStreetId() != 0 ? completeDept.getStreetId().toString() + "," : ""); + deptIds += (completeDept.getCommunityId() != null && completeDept.getCommunityId() != 0 ? completeDept.getCommunityId().toString() + "," : ""); + parentAndAllDeptDTO.setParentDeptIds(!"".equals(deptIds) ? deptIds.substring(0, deptIds.length() - 1) : ""); + parentAndAllDeptDTO.setParentDeptNames(!"".equals(deptNames) ? deptNames.substring(0, deptNames.length() - 1) : ""); + // 所有部门(包含街道、社区、网格) + deptNames += (StringUtils.isNotEmpty(completeDept.getGrid()) ? completeDept.getGrid() : ""); + deptIds += (completeDept.getGridId() != null && completeDept.getGridId() != 0 ? completeDept.getGridId().toString() : ""); + parentAndAllDeptDTO.setAllDeptIds(deptIds); + parentAndAllDeptDTO.setAllDeptNames(deptNames); + } else { + throw new RenException("部门Id错误"); + } + + + return parentAndAllDeptDTO; + } + + @Override + public List selectListGridForLeader(List gridIdList) { + return this.baseDao.selectListGridForLeader(gridIdList); + } + + @Override + public List listOfItemCirculationDept(Long deptId) { + return baseDao.selectListOfItemCirculationDept(deptId); + } + + @Override + public Map getIdByCode(String partyCode) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.select("id"); + wrapper.eq("party_code", partyCode); + SysDeptEntity sysDeptEntity = baseDao.selectOne(wrapper); + Map map = new HashMap<>(); + map.put("id", sysDeptEntity.getId().toString()); + return map; + } + + @Override + public Integer getCodeCount(SysDeptDTO dto) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("party_code", dto.getPartyCode()); + Long id = dto.getId(); + wrapper.ne(id != null, "id", dto.getId()); + return baseDao.selectCount(wrapper); + } + + @Override + public Result getParentDeptIds(Long deptId) { + return new Result().ok(getPidList(deptId)); + } + + @Override + public Result> getCompleteDeptList(Long deptId) { + CompleteDeptDTO completeDept = this.baseDao.getCompleteDept(deptId); + List list = Lists.newArrayList(); + list.add(completeDept.getDistrict()); + list.add(completeDept.getStreet()); + list.add(completeDept.getCommunity()); + list.add(completeDept.getGrid()); + return new Result().ok(list); + } + + @Override + public DeptOption getUserDeptOption() { + return getUserDeptOption(SecurityUser.getUserId()); + } + @Override + public DeptOption getDeptAuthByUser() { + return getDeptAuthByUser(SecurityUser.getUserId()); + } + @Override + public List getGridAuthByUser() { + // 用户拥有的所有部门权限 + List deptList = SecurityUser.getUser().getDeptIdList(); + List list; + if (deptList != null && deptList.size() > 0) { + list = baseDao.getGridAuthByUser(deptList); + } else { + return null; + } + return list; + } + + + /** + * 根据userId,从redis取出用户部门层级关系(街道-社区-网格) + * + * @param userId + * @return com.elink.esua.epdc.dto.DeptOption + * @author work@yujt.net.cn + * @date 2020/2/11 11:18 + */ + private DeptOption getDeptAuthByUser(Long userId) { + String deptOptionKey = RedisKeys.getAdminUserDeptAuthOptionKey(userId); + Object obj = redisUtils.get(deptOptionKey); + if (null == obj) { + this.packageDeptAuthByUser(userId); + obj = redisUtils.get(deptOptionKey); + } + return (DeptOption) obj; + } + /** + * 根据userId,从redis取出用户部门层级关系(街道-社区-网格) + * + * @param userId + * @return com.elink.esua.epdc.dto.DeptOption + * @author work@yujt.net.cn + * @date 2020/2/11 11:18 + */ + private DeptOption getUserDeptOption(Long userId) { + String deptOptionKey = RedisKeys.getAdminUserDeptOptionKey(userId); + Object obj = redisUtils.get(deptOptionKey); + if (null == obj) { + this.packageUserDeptOption(userId); + obj = redisUtils.get(deptOptionKey); + } + return (DeptOption) obj; + } + + @Override + public DeptOption getAllDeptOptionByLoginUser() { + Long userId = SecurityUser.getUserId(); + String deptOptionKey = RedisKeys.getAllAdminUserDeptOptionKey(userId); + Object obj = redisUtils.get(deptOptionKey); + if (null == obj) { + this.packageAllUserDeptOption(userId); + obj = redisUtils.get(deptOptionKey); + } + return (DeptOption) obj; + } + + @Override + public DeptOption getMiddleByLoginUser() { + DeptOption result = getUserDeptOption(SecurityUser.getUserId()); + List options = result.getOptions(); + if (options.isEmpty()) { + return result; + } + // 代表存在子级机构的json key + String childJsonOptionKey = "children"; + // 一个街道机构 + JSONObject streetOption; + // 一个街道下所有社区机构 + JSONArray communityOptionArray; + // 一个社区机构 + JSONObject communityOption; + // 循环所有街道 + for (int i = options.size() - NumConstant.ONE; i >= NumConstant.ZERO; i--) { + // 取出一个街道 + streetOption = options.get(i); + // 街道有children,代表有下级社区(没有children的,其实是区直) + if (null != streetOption.get(childJsonOptionKey)) { + // 获取该街道的所有社区 + communityOptionArray = streetOption.getJSONArray(childJsonOptionKey); + if (!communityOptionArray.isEmpty()) { + // 社区不为空,循环所有社区 + for (int j = 0; j < communityOptionArray.size(); j++) { + // 取出一个社区 + communityOption = communityOptionArray.getJSONObject(j); + // 社区有children,代表有下级网格, + if (null != communityOption.get(childJsonOptionKey)) { + // 移除网格 + communityOption.remove(childJsonOptionKey); + } + } + } + } else { + // 移除区直机构 + options.remove(i); + } + } + return result; + } + + @Override + public DeptOption getStreetByLoginUser() { + DeptOption result = getUserDeptOption(SecurityUser.getUserId()); + List options = result.getOptions(); + if (options.isEmpty()) { + return result; + } + // 代表存在子级机构的json key + String childJsonOptionKey = "children"; + // 一个街道机构 + JSONObject streetOption; + // 循环所有街道 + for (int i = options.size() - NumConstant.ONE; i >= NumConstant.ZERO; i--) { + // 取出一个街道 + streetOption = options.get(i); + // 街道有children,代表有下级社区(没有children的,其实是区直) + if (null != streetOption.get(childJsonOptionKey)) { + // 若街道有下级机构(社区),移除社区 + streetOption.remove(childJsonOptionKey); + } else { + // 移除区直机构(有些街道还没创建社区,也被移除) + options.remove(i); + } + } + return result; + } + + /** + * @param formDTO + * @return java.util.List + * @Author yinzuomei + * @Description + * @Date 2019/12/4 19:43 + **/ + @Override + public List listUserSysDeptInfoResultDTO(UserSysDeptInfoFormDTO formDTO) { + if (CollUtil.isEmpty(formDTO.getDeptIdList())) { + Long userId = SecurityUser.getUserId(); + // 查询当前用户所具有的的数据权限 + UserDetail userDetail = userDetailRedis.get(userId); + // 用户拥有的所有部门权限 + List dataScopeDeptList = userDetail.getDeptIdList(); + formDTO.setDeptIdList(dataScopeDeptList); + } + List list = baseDao.selectListUserSysDeptInfo(formDTO); + // 处理记录,赋值parentNames + for (UserSysDeptInfoResultDTO resultDTO : list) { + if (resultDTO.getPid() != 0) { + String parentNames = ""; + String street = ""; + String community = ""; + String grid = ""; + String[] pids = resultDTO.getPids().split(","); + for (String id : pids) { + SysDeptEntity deptEntity = baseDao.getById(Long.valueOf(id)); + parentNames += deptEntity.getName() + "-"; + if (("street_party").equals(deptEntity.getTypeKey())) { + street = deptEntity.getName(); + } else if (("community_party").equals(deptEntity.getTypeKey())) { + community = deptEntity.getName(); + } else if (("grid_party").equals(deptEntity.getTypeKey())) { + grid = deptEntity.getName(); + } + } + parentNames = parentNames.substring(0, parentNames.length() - 1); + resultDTO.setParentNames(parentNames); + resultDTO.setStreet(street); + resultDTO.setCommunity(community); + if (StringUtils.isNotBlank(grid)) { + resultDTO.setGrid(grid); + } + } + } + return list; + } + + + @Override + public void packageUserDeptOption(Long userId) { + packageDeptOptionByUser(userId, false); + } + + public void packageDeptAuthByUser(Long userId) { + packageDeptOptionAuthByUser(userId); + } + + public void packageAllUserDeptOption(Long userId) { + packageDeptOptionByUser(userId, true); + } + + /** + * 组装部门层级结构 + * + * @param userId 用户id + * @param packageAllDept 是否组装完整层级结构,否 则组装后三级 + * @return void + * @author work@yujt.net.cn + * @date 2020/1/28 10:49 + */ + private void packageDeptOptionByUser(long userId, boolean packageAllDept) { + UserDetail userDetail = userDetailRedis.get(userId); + // 用户拥有的所有部门权限 + List dataScopeDeptList = userDetail.getDeptIdList(); + if (CollUtil.isEmpty(dataScopeDeptList)) { + return; + } + // 通过用户部门权限 获取第一级部门节点 + List headDepts = baseDao.selectListHeadDeptNode(dataScopeDeptList); + if (CollUtil.isEmpty(headDepts)) { + return; + } + // 某个部门id 声明变量,方便操作数据 + Long deptId; + + // 存放上级节点的主键,查询下级节点用 + List parentDeptIdList = Lists.newArrayList(); + // 所有父级节点 此处为第一次获取,为顶级节点,相当于市区 + JSONArray parentNodeArray = new JSONArray(); + JSONObject node; + for (int i = 0; i < headDepts.size(); i++) { + // 父节点主键 + deptId = headDepts.get(i).getId(); + parentDeptIdList.add(deptId); + + node = new JSONObject(); + node.put("label", headDepts.get(i).getName()); + node.put("value", String.valueOf(deptId)); + parentNodeArray.add(node); + } + // 用于存放 每次组装好的 某一级节点。页面只需展示三级,所以没有存放顶级节点(市区) + List cache = Lists.newArrayList(); + if (packageAllDept) { + cache.add(parentNodeArray); + } + Map object; + while (CollUtil.isNotEmpty(dataScopeDeptList) && CollUtil.isNotEmpty(parentDeptIdList)) { + // 通过上级节点组装所有下级节点 + object = this.packageChildrenNodeArray(parentNodeArray, dataScopeDeptList, parentDeptIdList); + + dataScopeDeptList = (List) object.get("scope"); + parentDeptIdList = (List) object.get("pids"); + + parentNodeArray = (JSONArray) object.get("node"); + cache.add(parentNodeArray); + } + + DeptOption option = new DeptOption(); + option.setOptions(cache.get(0)); + + if (packageAllDept) { + redisUtils.set(RedisKeys.getAllAdminUserDeptOptionKey(userId), option); + } else { + redisUtils.set(RedisKeys.getAdminUserDeptOptionKey(userId), option); + } + + } + /** + * 组装部门层级结构 + * + * @param userId 用户id + * @return void + * @author work@yujt.net.cn + * @date 2020/1/28 10:49 + */ + private void packageDeptOptionAuthByUser(long userId) { + UserDetail userDetail = userDetailRedis.get(userId); + // 用户拥有的所有部门权限 + List dataScopeDeptList = userDetail.getDeptIdList(); + if (CollUtil.isEmpty(dataScopeDeptList)) { + return; + } + // 某个部门id 声明变量,方便操作数据 + Long deptId; + + // 所有父级节点 此处为第一次获取,为顶级节点,相当于市区 + JSONArray parentNodeArray = new JSONArray(); + // 用于存放 每次组装好的 某一级节点。页面只需展示三级,所以没有存放顶级节点(市区) + List cache = Lists.newArrayList(); + Map object; + while (CollUtil.isNotEmpty(dataScopeDeptList)) { + // 通过上级节点组装所有下级节点 + object = this.packageChildrenNodeAuth(parentNodeArray, dataScopeDeptList); + + dataScopeDeptList = (List) object.get("scope"); + + parentNodeArray = (JSONArray) object.get("node"); + cache.add(parentNodeArray); + } + + DeptOption option = new DeptOption(); + option.setOptions(cache.get(0)); + redisUtils.set(RedisKeys.getAdminUserDeptAuthOptionKey(userId), option); + } + + /** + * 组装下级结构节点 + * + * @param allParentNode 所有的上级机构节点 + * @param dataScopeDeptList 拥有数据权限的部门 + * @param parentDeptIdList 上级部门id + * @return java.util.Map + * @author work@yujt.net.cn + * @date 2019/11/29 10:27 + */ + private Map packageChildrenNodeArray(JSONArray allParentNode, List dataScopeDeptList, List parentDeptIdList) { + + List childDepts = baseDao.selectChildrenDeptNode(dataScopeDeptList, parentDeptIdList); + + parentDeptIdList = Lists.newArrayList(); + + // 用于存储所有子节点 + JSONArray allChildrenNode = new JSONArray(); + // 某个父节点下所有的子节点 + JSONArray childrenNodeList; + // 单个 子节点 + JSONObject nodeChild; + + // 单个 父节点 + JSONObject nodeParent; + Long deptId; + + for (int i = 0; i < allParentNode.size(); i++) { + + nodeParent = allParentNode.getJSONObject(i); + // 用于存储 一个父节点的所有下级节点 + childrenNodeList = new JSONArray(); + + for (int j = 0; j < childDepts.size(); j++) { + deptId = childDepts.get(j).getId(); + + if (nodeParent.get("value").equals(String.valueOf(childDepts.get(j).getPid()))) { + nodeChild = new JSONObject(); + nodeChild.put("label", childDepts.get(j).getName()); + nodeChild.put("value", String.valueOf(deptId)); + childrenNodeList.add(nodeChild); + + allChildrenNode.add(nodeChild); + parentDeptIdList.add(deptId); + } + } + if (childrenNodeList.size() > 0) { + nodeParent.put("children", childrenNodeList); + } + } + + List newDataScopeList = Lists.newArrayList(); + for (int i = 0; i < dataScopeDeptList.size(); i++) { + deptId = dataScopeDeptList.get(i); + if (!parentDeptIdList.contains(deptId)) { + newDataScopeList.add(deptId); + } + } + dataScopeDeptList = newDataScopeList; + Map result = Maps.newHashMap(); + result.put("node", allChildrenNode); + result.put("scope", dataScopeDeptList); + result.put("pids", parentDeptIdList); + return result; + } + /** + * 组装下级结构节点 + * + * @param allParentNode 所有的上级机构节点 + * @param dataScopeDeptList 拥有数据权限的部门 + * @return java.util.Map + * @author work@yujt.net.cn + * @date 2019/11/29 10:27 + */ + private Map packageChildrenNodeAuth(JSONArray allParentNode, List dataScopeDeptList) { + + List childDepts = baseDao.selectChildrenDeptAuth(dataScopeDeptList); + + List parentDeptIdList = Lists.newArrayList(); + + // 用于存储所有子节点 + JSONArray allChildrenNode = new JSONArray(); + // 某个父节点下所有的子节点 + JSONArray childrenNodeList; + // 单个 子节点 + JSONObject nodeChild; + + // 单个 父节点 + JSONObject nodeParent; + Long deptId; + + for (int i = 0; i < allParentNode.size(); i++) { + + nodeParent = allParentNode.getJSONObject(i); + // 用于存储 一个父节点的所有下级节点 + childrenNodeList = new JSONArray(); + + for (int j = 0; j < childDepts.size(); j++) { + deptId = childDepts.get(j).getId(); + + if (nodeParent.get("value").equals(String.valueOf(childDepts.get(j).getPid()))) { + nodeChild = new JSONObject(); + nodeChild.put("label", childDepts.get(j).getName()); + nodeChild.put("value", String.valueOf(deptId)); + childrenNodeList.add(nodeChild); + + allChildrenNode.add(nodeChild); + parentDeptIdList.add(deptId); + } + } + if (childrenNodeList.size() > 0) { + nodeParent.put("children", childrenNodeList); + } + } + if(allParentNode.size() == 0){ + for (int index = 0; index < childDepts.size(); index++) { + JSONObject node = new JSONObject(); + node.put("label", childDepts.get(index).getName()); + node.put("value", String.valueOf(childDepts.get(index).getId())); + allParentNode.add(node); + parentDeptIdList.add(childDepts.get(index).getId()); + allChildrenNode.add(node); + } + } + + List newDataScopeList = Lists.newArrayList(); + for (int i = 0; i < dataScopeDeptList.size(); i++) { + deptId = dataScopeDeptList.get(i); + if (!parentDeptIdList.contains(deptId)) { + newDataScopeList.add(deptId); + } + } + dataScopeDeptList = newDataScopeList; + Map result = Maps.newHashMap(); + result.put("node", allChildrenNode); + result.put("scope", dataScopeDeptList); + return result; + } + @Override + public void packgeAllDeptOption() { + List deptList = baseDao.selectListDeptTree(); + JSONObject node; + JSONArray headNodes = new JSONArray(); + for (DeptTreeDTO deptItemDto : deptList) { + if (deptItemDto.getPid().longValue() == NumConstant.ZERO_L) { + node = new JSONObject(); + node.put("value", deptItemDto.getId()); + node.put("label", deptItemDto.getName()); + headNodes.add(node); + } + } + // 用于存放所有父级节点 + JSONArray parent; + parent = headNodes; + // 用于存放所有子级节点 + JSONArray allChildren = new JSONArray(); + JSONArray children; + // 用于存放单个子级节点 + JSONObject childNode; + // 存放其余未处理的类别(节点) + List others = this.getOtherDept(deptList, parent); + + while (!others.isEmpty()) { + for (int i = 0; i < parent.size(); i++) { + node = parent.getJSONObject(i); + children = new JSONArray(); + for (DeptTreeDTO categoryTreeDto : others) { + if (categoryTreeDto.getPid().equals(node.get("value"))) { + childNode = new JSONObject(); + childNode.put("value", categoryTreeDto.getId()); + childNode.put("label", categoryTreeDto.getName()); + children.add(childNode); + allChildren.add(childNode); + } + } + if (!children.isEmpty()) { + node.put("children", children); + } + } + parent = allChildren; + + others = this.getOtherDept(others, parent); + + } + //存放到redis中 + List cache = Lists.newArrayList(); + cache.add(headNodes); + DeptOption option = new DeptOption(); + option.setOptions(cache.get(0)); + redisUtils.set(RedisKeys.getAllDeptOptionKey(), option); + } + + + List getOtherDept(List deptList, JSONArray parent) { + List already = Lists.newArrayList(); + for (int i = 0; i < parent.size(); i++) { + already.add((Long) parent.getJSONObject(i).get("value")); + } + + List others = Lists.newArrayList(); + + for (DeptTreeDTO categoryTreeDto : deptList) { + Long categoryTreeDtoId = categoryTreeDto.getId(); + if (!already.contains(categoryTreeDtoId)) { + others.add(categoryTreeDto); + } + } + return others; + } + + + /*** + * + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author qushutong + * @date 2019/12/13 14:50 + */ + @Override + public Result getDeptTree() { + String deptKey = RedisKeys.getAllDeptOptionKey(); + Object obj = redisUtils.get(deptKey); + if (null == obj) { + this.packgeAllDeptOption(); + obj = redisUtils.get(deptKey); + } + return new Result().ok((DeptOption) obj); + } + + /** + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 获取所有部门树:二级只要街道 + * @Date 2020/1/31 10:31 + **/ + @Override + public Result getDeptTreeForEpiDemic() { + String deptKey = RedisKeys.getAllDeptOptionKeyForEpiDemic(); + Object obj = redisUtils.get(deptKey); + if (null == obj) { + this.packgeAllDeptOptionForEpiDemic(); + obj = redisUtils.get(deptKey); + } + return new Result().ok((DeptOption) obj); + } + + /** + * @param + * @return void + * @Author yinzuomei + * @Description + * @Date 2020/1/31 11:39 + **/ + private void packgeAllDeptOptionForEpiDemic() { + List deptList = baseDao.selectListDeptTreeForEpiDemic(); + JSONObject node; + JSONArray headNodes = new JSONArray(); + for (DeptTreeDTO deptItemDto : deptList) { + if (deptItemDto.getPid().longValue() == NumConstant.ZERO_L) { + node = new JSONObject(); + node.put("value", deptItemDto.getId()); + node.put("label", deptItemDto.getName()); + headNodes.add(node); + } + } + // 用于存放所有父级节点 + JSONArray parent; + parent = headNodes; + // 用于存放所有子级节点 + JSONArray allChildren = new JSONArray(); + JSONArray children; + // 用于存放单个子级节点 + JSONObject childNode; + // 存放其余未处理的类别(节点) + List others = this.getOtherDept(deptList, parent); + + while (!others.isEmpty()) { + for (int i = 0; i < parent.size(); i++) { + node = parent.getJSONObject(i); + children = new JSONArray(); + for (DeptTreeDTO categoryTreeDto : others) { + if (categoryTreeDto.getPid().equals(node.get("value"))) { + childNode = new JSONObject(); + childNode.put("value", categoryTreeDto.getId()); + childNode.put("label", categoryTreeDto.getName()); + children.add(childNode); + allChildren.add(childNode); + } + } + if (!children.isEmpty()) { + node.put("children", children); + } + } + parent = allChildren; + + others = this.getOtherDept(others, parent); + + } + //存放到redis中 + List cache = Lists.newArrayList(); + cache.add(headNodes); + DeptOption option = new DeptOption(); + option.setOptions(cache.get(0)); + redisUtils.set(RedisKeys.getAllDeptOptionKeyForEpiDemic(), option); + } + + /** + * @param params + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询未建立党员群的网格列表 + * @Date 2019/12/19 11:20 + **/ + @Override + public PageData listCompleteDeptDTO(Map params) { + //查询出已经建立党员群的网格id + Result> gridListResult = groupFeignClient.listPartyMemberGridId(); + params.put("gridList", gridListResult.getData()); + IPage iPage = this.getPage(params); + List userDtoList = this.baseDao.selectListCompleteDeptDTO(params); + return new PageData<>(userDtoList, iPage.getTotal()); + } + + @Override + public Result> listAllGridId() { + List gridIdList = baseDao.selectListAllGridId(); + + return new Result>().ok(gridIdList); + } + + @Override + public Result> pageDeptIdByTypeKey(String typeKey, Integer pageSize, Integer pageIndex) { + if (null == pageSize || null == pageIndex || pageSize < NumConstant.ONE || pageIndex < NumConstant.ONE) { + return new Result().error("参数错误"); + } + pageIndex = (pageIndex - NumConstant.ONE) * pageSize; + List deptIdList = baseDao.pageDeptIdByTypeKey(typeKey, pageSize, pageIndex); + return new Result().ok(deptIdList); + } + + @Override + public DeptLevelAndLeaderDTO getDeptInfoById(Long deptId, String leaderFlag) { + if (null == deptId || null == leaderFlag) { + return null; + } + SysDeptEntity sysDeptEntity = baseDao.selectById(deptId); + if (null == sysDeptEntity) { + return null; + } + String deptName = sysDeptEntity.getName(); + String pids = sysDeptEntity.getPids(); + // 上级机构id + String parentDeptIds = NumConstant.ZERO_STR.equals(pids) ? "" : pids; + // 全部机构id + String allDeptIds = StringUtils.isBlank(pids) ? String.valueOf(deptId) : + pids.concat(StrConstant.COMMA).concat(String.valueOf(deptId)); + + // 上级机构名称 + String parentDeptNames = ""; + if (StringUtils.isNotBlank(parentDeptIds)) { + String[] pidArray = parentDeptIds.split(StrConstant.COMMA); + List deptNameList = Lists.newArrayList(); + SysDeptEntity dept; + for (int i = 0; i < pidArray.length; i++) { + dept = baseDao.selectById(Long.parseLong(pidArray[i])); + deptNameList.add(dept.getName()); + } + parentDeptNames = StringUtils.join(deptNameList, StrConstant.HYPHEN); + } + // 全部机构名称 + String allDeptNames = StringUtils.isBlank(parentDeptNames) ? deptName : parentDeptNames.concat(StrConstant.HYPHEN).concat(deptName); + + DeptLevelAndLeaderDTO deptLevel = new DeptLevelAndLeaderDTO(); + deptLevel.setDeptId(deptId); + deptLevel.setDeptName(deptName); + deptLevel.setParentDeptIds(parentDeptIds); + deptLevel.setParentDeptNames(parentDeptNames); + deptLevel.setAllDeptIds(allDeptIds); + deptLevel.setAllDeptNames(allDeptNames); + deptLevel.setTypeKey(sysDeptEntity.getTypeKey()); + + if (YesOrNoEnum.YES.value().equals(leaderFlag)) { + String leaderName = baseDao.selectDeptLeaderName(deptId, RoleTypeKeyConstant.ROLE_GRID_LEADER); + deptLevel.setLeaderName(leaderName); + } + + redisUtils.set(RedisKeys.getDeptOptionKey(deptId), deptLevel); + return deptLevel; + } + + @Override + public List listAllDeptInfo(UserSysDeptInfoFormDTO formDTO) { + Map map = new HashMap<>(); + if (formDTO.getTypeKeyList() != null && formDTO.getTypeKeyList().size() >0) { + map.put("typeKey", formDTO.getTypeKeyList().get(0)); + } + if (formDTO.getDeptIdList() != null && formDTO.getDeptIdList().size() >0) { + map.put("deptId", formDTO.getDeptIdList().get(0)); + } + if (formDTO.getDeptName() != null && formDTO.getDeptName() != "") { + map.put("deptName", formDTO.getDeptName()); + } + List list = baseDao.selectListAllDeptInfo(map); // 获取全部的部门信息 + return list; + } + + /** + * + * 组织机构名称修改发送MQ消息 + * + * @params [dto] + * @return void + * @author liuchuang + * @since 2020/3/6 21:34 + */ + private void sendMqMessage(SysDeptDTO dto) { + // 获取旧信息 + SysDeptEntity entity = baseDao.getById(dto.getId()); + if (!dto.getName().equals(entity.getName())) { + OrganizationModifyDTO body = new OrganizationModifyDTO(); + body.setDeptId(dto.getId()); + body.setOldDeptName(entity.getName()); + body.setNewDeptName(dto.getName()); + body.setTypeKey(entity.getTypeKey()); + organizationModifyProducer.sendMessage(RocketMqConstant.MQ_TOPIC_ORGANIZATION, RocketMqConstant.MQ_TAG_ORGANIZATION, + dto.getId().toString(), JSONObject.toJSONString(body)); + } + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java new file mode 100644 index 0000000..5b5a69f --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDictServiceImpl.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.SysDictDao; +import com.elink.esua.epdc.dto.SysDictDTO; +import com.elink.esua.epdc.dto.SysSimpleDictDTO; +import com.elink.esua.epdc.entity.SysDictEntity; +import com.elink.esua.epdc.redis.SysDictRedis; +import com.elink.esua.epdc.service.SysDictService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 数据字典 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Slf4j +@Service +public class SysDictServiceImpl extends BaseServiceImpl implements SysDictService { + + @Autowired + private SysDictRedis dictRedis; + + @Override + public PageData page(Map params) { + + IPage page = baseDao.selectPage( + getPage(params, "sort", true), + getWrapper(params) + ); + + return getPageData(page, SysDictDTO.class); + } + + @Override + public List subList(Map params) { + List entityList = baseDao.getSubList(params); + return ConvertUtils.sourceToTarget(entityList, SysDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysDictDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String pid = (String) params.get("pid"); + String dictType = (String) params.get("dictType"); + String dictName = (String) params.get("dictName"); + String dictValue = (String) params.get("dictValue"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(pid), "pid", Long.parseLong(pid)); + wrapper.eq(StringUtils.isNotBlank(dictType), "dict_type", dictType); + wrapper.like(StringUtils.isNotBlank(dictName), "dict_name", dictName); + wrapper.like(StringUtils.isNotBlank(dictValue), "dict_value", dictValue); + + return wrapper; + } + + @Override + public SysDictDTO get(Long id) { + SysDictEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysDictDTO dto) { + SysDictEntity entity = ConvertUtils.sourceToTarget(dto, SysDictEntity.class); + insert(entity); + dictRedis.removeSimpleDictList(entity.getDictType()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysDictDTO dto) { + SysDictEntity entity = ConvertUtils.sourceToTarget(dto, SysDictEntity.class); + updateById(entity); + dictRedis.removeSimpleDictList(entity.getDictType()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //逻辑删除 + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void delete(Long id) { + SysDictDTO dto = this.get(id); + dictRedis.removeSimpleDictList(dto.getDictType()); + baseDao.deleteById(id); + } + + @Override + public Result> listSimpleDictInfo(String dictType) { + List simpleDictList = Lists.newArrayList(); + + try { + if (StringUtils.isNotBlank(dictType)) { + + List dictList = dictRedis.getSimpleDictList(dictType); + if (null != dictList) { + return new Result>().ok(dictList); + } + + QueryWrapper sdWrapper = new QueryWrapper<>(); + sdWrapper.select("dict_value", "dict_name","remark"); + sdWrapper.eq("dict_type", dictType); + sdWrapper.ne("dict_value", ""); + sdWrapper.isNotNull("dict_value"); + sdWrapper.orderByAsc("SORT", Constant.CREATE_DATE); + List entityList = baseDao.selectList(sdWrapper); + if (!entityList.isEmpty()) { + simpleDictList = ConvertUtils.sourceToTarget(entityList, SysSimpleDictDTO.class); + dictRedis.setSimpleDictList(dictType, simpleDictList); + } + } + } catch (Exception e) { + log.error("获取数据字典列表失败,错误信息{}", e.getMessage()); + } + return new Result>().ok(simpleDictList); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLanguageServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLanguageServiceImpl.java new file mode 100644 index 0000000..c156282 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLanguageServiceImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.dao.SysLanguageDao; +import com.elink.esua.epdc.entity.SysLanguageEntity; +import com.elink.esua.epdc.service.SysLanguageService; +import org.springframework.stereotype.Service; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Service +public class SysLanguageServiceImpl extends BaseServiceImpl implements SysLanguageService { + + @Override + public void saveOrUpdate(String tableName, Long tableId, String fieldName, String fieldValue, String language) { + SysLanguageEntity entity = new SysLanguageEntity(); + entity.setTableName(tableName); + entity.setTableId(tableId); + entity.setFieldName(fieldName); + entity.setFieldValue(fieldValue); + entity.setLanguage(language); + + //判断是否有数据 + if(baseDao.getLanguage(entity) == null){ + baseDao.insert(entity); + }else { + baseDao.updateLanguage(entity); + } + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogErrorServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogErrorServiceImpl.java new file mode 100644 index 0000000..44de121 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogErrorServiceImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dao.SysLogErrorDao; +import com.elink.esua.epdc.dto.SysLogErrorDTO; +import com.elink.esua.epdc.entity.SysLogErrorEntity; +import com.elink.esua.epdc.service.SysLogErrorService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 异常日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysLogErrorServiceImpl extends BaseServiceImpl implements SysLogErrorService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysLogErrorDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogErrorDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String module = (String) params.get("module"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(module), "module", module); + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogErrorEntity entity) { + insert(entity); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogLoginServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogLoginServiceImpl.java new file mode 100644 index 0000000..8982968 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogLoginServiceImpl.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dao.SysLogLoginDao; +import com.elink.esua.epdc.dto.SysLogLoginDTO; +import com.elink.esua.epdc.entity.SysLogLoginEntity; +import com.elink.esua.epdc.service.SysLogLoginService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 登录日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysLogLoginServiceImpl extends BaseServiceImpl implements SysLogLoginService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysLogLoginDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogLoginDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String status = (String) params.get("status"); + String creatorName = (String) params.get("creatorName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(status), "status", status); + wrapper.like(StringUtils.isNotBlank(creatorName), "creator_name", creatorName); + + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogLoginEntity entity) { + insert(entity); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogOperationServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogOperationServiceImpl.java new file mode 100644 index 0000000..cf55c08 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysLogOperationServiceImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.service.SysLogOperationService; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dao.SysLogOperationDao; +import com.elink.esua.epdc.dto.SysLogOperationDTO; +import com.elink.esua.epdc.entity.SysLogOperationEntity; +import com.elink.esua.epdc.service.SysLogOperationService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 操作日志 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysLogOperationServiceImpl extends BaseServiceImpl implements SysLogOperationService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysLogOperationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysLogOperationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String module = (String) params.get("module"); + String status = (String) params.get("status"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(module), "module", module); + wrapper.eq(StringUtils.isNotBlank(status), "status", status); + + return wrapper; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysLogOperationEntity entity) { + insert(entity); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java new file mode 100644 index 0000000..7acfa24 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysMenuServiceImpl.java @@ -0,0 +1,193 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.HttpContextUtils; +import com.elink.esua.epdc.commons.tools.utils.TreeUtils; +import com.elink.esua.epdc.dao.SysMenuDao; +import com.elink.esua.epdc.dto.SysMenuDTO; +import com.elink.esua.epdc.entity.SysMenuEntity; +import com.elink.esua.epdc.enums.MenuTableEnum; +import com.elink.esua.epdc.enums.MenuTypeEnum; +import com.elink.esua.epdc.redis.SysMenuRedis; +import com.elink.esua.epdc.service.SysLanguageService; +import com.elink.esua.epdc.service.SysMenuService; +import com.elink.esua.epdc.service.SysResourceService; +import com.elink.esua.epdc.service.SysRoleMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysMenuServiceImpl extends BaseServiceImpl implements SysMenuService { + @Autowired + private SysMenuRedis sysMenuRedis; + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysResourceService sysResourceService; + @Autowired + private SysLanguageService sysLanguageService; + + @Override + public SysMenuDTO get(Long id) { + SysMenuEntity entity = baseDao.getById(id, HttpContextUtils.getLanguage()); + + SysMenuDTO dto = ConvertUtils.sourceToTarget(entity, SysMenuDTO.class); + + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysMenuDTO dto) { + SysMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysMenuEntity.class); + + //保存菜单 + insert(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + + //保存菜单资源 + sysResourceService.saveMenuResource(entity.getId(), entity.getName(), dto.getResourceList()); + + //清空当前用户,菜单导航、权限标识 + sysMenuRedis.delete(SecurityUser.getUserId()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysMenuDTO dto) { + SysMenuEntity entity = ConvertUtils.sourceToTarget(dto, SysMenuEntity.class); + + //上级菜单不能为自身 + if (entity.getId().equals(entity.getPid())) { + throw new RenException(ErrorCode.SUPERIOR_MENU_ERROR); + } + + //更新菜单 + updateById(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + + //更新菜单资源 + sysResourceService.saveMenuResource(entity.getId(), entity.getName(), dto.getResourceList()); + + //清空当前用户,菜单导航、权限标识 + sysMenuRedis.delete(SecurityUser.getUserId()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + //逻辑删除 + logicDelete(new Long[]{id}, SysMenuEntity.class); + + //删除角色菜单关系 + sysRoleMenuService.deleteByMenuId(id); + + //清空当前用户,菜单导航、权限标识 + sysMenuRedis.delete(SecurityUser.getUserId()); + } + + @Override + public List getMenuList(Integer type) { + List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + + List dtoList = ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + + return TreeUtils.build(dtoList, Constant.MENU_ROOT); + } + + @Override + public List getUserMenuList(UserDetail userDetail, Integer type) { + List menuList; + + //系统管理员,拥有最高权限 + if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { + menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + } else { + menuList = baseDao.getUserMenuList(userDetail.getId(), type, HttpContextUtils.getLanguage()); + } + + List dtoList = ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + + return TreeUtils.build(dtoList); + } + + @Override + public List getUserMenuNavList(UserDetail userDetail) { + List menuList = sysMenuRedis.getUserMenuNavList(userDetail.getId()); + if (menuList == null) { + menuList = getUserMenuList(userDetail, MenuTypeEnum.MENU.value()); + + sysMenuRedis.setUserMenuNavList(userDetail.getId(), menuList); + } + + return menuList; + } + + @Override + public Set getUserPermissions(UserDetail userDetail) { + //用户权限列表 + Set permsSet = sysMenuRedis.getUserPermissions(userDetail.getId()); + if (permsSet != null) { + return permsSet; + } + + //超级管理员,拥有最高权限 + List menuList; + if (userDetail.getSuperAdmin() == SuperAdminEnum.YES.value()) { + menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); + } else { + menuList = baseDao.getUserMenuList(userDetail.getId(), MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); + } + + permsSet = new HashSet<>(); + for (SysMenuEntity menu : menuList) { + if (StringUtils.isNotBlank(menu.getPermissions())) { + permsSet.add(menu.getPermissions()); + } + } + + //保存到缓存 + sysMenuRedis.setUserPermissions(userDetail.getId(), permsSet); + + return permsSet; + } + + @Override + public List getListPid(Long pid) { + List menuList = baseDao.getListPid(pid); + + return ConvertUtils.sourceToTarget(menuList, SysMenuDTO.class); + } + + private void saveLanguage(Long tableId, String fieldName, String fieldValue) { + sysLanguageService.saveOrUpdate(MenuTableEnum.SYS.value(), tableId, fieldName, fieldValue, HttpContextUtils.getLanguage()); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysParamsServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysParamsServiceImpl.java new file mode 100644 index 0000000..779cf15 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysParamsServiceImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.service.SysParamsService; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dao.SysParamsDao; +import com.elink.esua.epdc.dto.SysParamsDTO; +import com.elink.esua.epdc.entity.SysParamsEntity; +import com.elink.esua.epdc.redis.SysParamsRedis; +import com.elink.esua.epdc.service.SysParamsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 参数管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysParamsServiceImpl extends BaseServiceImpl implements SysParamsService { + @Autowired + private SysParamsRedis sysParamsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysParamsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysParamsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String paramCode = (String) params.get("paramCode"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(Constant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + wrapper.eq("param_type", 1); + wrapper.like(StringUtils.isNotBlank(paramCode), "param_code", paramCode); + + return wrapper; + } + + @Override + public SysParamsDTO get(Long id) { + SysParamsEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysParamsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysParamsDTO dto) { + SysParamsEntity entity = ConvertUtils.sourceToTarget(dto, SysParamsEntity.class); + insert(entity); + + sysParamsRedis.set(entity.getParamCode(), entity.getParamValue()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysParamsDTO dto) { + SysParamsEntity entity = ConvertUtils.sourceToTarget(dto, SysParamsEntity.class); + updateById(entity); + + sysParamsRedis.set(entity.getParamCode(), entity.getParamValue()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //删除Redis数据 + List paramCodeList = baseDao.getParamCodeList(ids); + String[] paramCodes = paramCodeList.toArray(new String[paramCodeList.size()]); + sysParamsRedis.delete(paramCodes); + + //逻辑删除 + logicDelete(ids, SysParamsEntity.class); + } + + @Override + public String getValue(String paramCode) { + String paramValue = sysParamsRedis.get(paramCode); + if(paramValue == null){ + paramValue = baseDao.getValueByCode(paramCode); + + sysParamsRedis.set(paramCode, paramValue); + } + return paramValue; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int updateValueByCode(String paramCode, String paramValue) { + int count = baseDao.updateValueByCode(paramCode, paramValue); + sysParamsRedis.set(paramCode, paramValue); + + return count; + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysResourceServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysResourceServiceImpl.java new file mode 100644 index 0000000..d3eb823 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysResourceServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.security.bo.ResourceBO; +import com.elink.esua.epdc.commons.tools.security.enums.ResourceAuthEnum; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dao.SysResourceDao; +import com.elink.esua.epdc.dto.MenuResourceDTO; +import com.elink.esua.epdc.entity.SysResourceEntity; +import com.elink.esua.epdc.enums.MenuFlagEnum; +import com.elink.esua.epdc.redis.SysResourceRedis; +import com.elink.esua.epdc.service.SysResourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysResourceServiceImpl extends BaseServiceImpl implements SysResourceService { + @Autowired + private SysResourceRedis sysResourceRedis; + + @Override + public List getMenuResourceList(Long menuId) { + List entityList = baseDao.getMenuResourceList(menuId+""); + + return ConvertUtils.sourceToTarget(entityList, MenuResourceDTO.class); + } + + @Override + public List getResourceList() { + List entityList = sysResourceRedis.get(); + if(entityList == null){ + entityList = baseDao.getResourceList(); + + sysResourceRedis.set(entityList); + } + return ConvertUtils.sourceToTarget(entityList, ResourceBO.class); + } + + @Override + public List getUserResourceList(Long userId) { + List entityList = baseDao.getUserResourceList(userId); + + return ConvertUtils.sourceToTarget(entityList, ResourceBO.class); + } + + @Override + public void saveMenuResource(Long menuId, String menuName, List resourceList) { + //先删除菜单资源关系 + baseDao.deleteByCode(menuId+""); + + //删除缓存 + sysResourceRedis.delete(); + + //菜单没有一个资源的情况 + if(CollUtil.isEmpty(resourceList)){ + return ; + } + + //保存菜单资源关系 + for(MenuResourceDTO dto : resourceList){ + SysResourceEntity entity = new SysResourceEntity(); + entity.setResourceCode(menuId+""); + entity.setResourceName(menuName); + entity.setResourceUrl(dto.getResourceUrl()); + entity.setResourceMethod(dto.getResourceMethod()); + entity.setAuthLevel(ResourceAuthEnum.PERMISSIONS_AUTH.value()); + entity.setMenuFlag(MenuFlagEnum.YES.value()); + + //保存 + insert(entity); + } + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleDataScopeServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleDataScopeServiceImpl.java new file mode 100644 index 0000000..09c2d63 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleDataScopeServiceImpl.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import com.elink.esua.epdc.dao.SysRoleDataScopeDao; +import com.elink.esua.epdc.dto.DataScopeDeptList; +import com.elink.esua.epdc.entity.SysRoleDataScopeEntity; +import com.elink.esua.epdc.service.SysRoleDataScopeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 角色数据权限 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleDataScopeServiceImpl extends BaseServiceImpl + implements SysRoleDataScopeService { + @Autowired + private RedisUtils redisUtils; + + @Override + public List getDeptIdList(Long roleId) { + return baseDao.getDeptIdList(roleId); + } + + @Override + public List getDataScopeList(Long userId) { + return baseDao.getDataScopeList(userId); + } + + @Override + public List getDataScopeDetailList(Long userId) { + return baseDao.getDataScopeDetailList(userId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(Long roleId, List deptIdList) { + //先删除角色数据权限关系 + deleteByRoleId(roleId); + + //角色没有一个数据权限的情况 + if(CollUtil.isEmpty(deptIdList)){ + return ; + } + + //保存角色数据权限关系 + for(Long deptId : deptIdList){ + SysRoleDataScopeEntity sysRoleDataScopeEntity = new SysRoleDataScopeEntity(); + sysRoleDataScopeEntity.setDeptId(deptId); + sysRoleDataScopeEntity.setRoleId(roleId); + + //保存 + insert(sysRoleDataScopeEntity); + } + redisUtils.deleteByPattern("epdc:options:dept:user*"); + } + + @Override + public void deleteByRoleId(Long roleId) { + baseDao.deleteByRoleId(roleId); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleMenuServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleMenuServiceImpl.java new file mode 100644 index 0000000..b7e7302 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleMenuServiceImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.dao.SysRoleMenuDao; +import com.elink.esua.epdc.entity.SysRoleMenuEntity; +import com.elink.esua.epdc.service.SysRoleMenuService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleMenuServiceImpl extends BaseServiceImpl implements SysRoleMenuService { + + @Override + public List getMenuIdList(Long roleId){ + return baseDao.getMenuIdList(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(Long roleId, List menuIdList) { + //先删除角色菜单关系 + deleteByRoleId(roleId); + + //角色没有一个菜单权限的情况 + if(CollUtil.isEmpty(menuIdList)){ + return ; + } + + //保存角色菜单关系 + for(Long menuId : menuIdList){ + SysRoleMenuEntity sysRoleMenuEntity = new SysRoleMenuEntity(); + sysRoleMenuEntity.setMenuId(menuId); + sysRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(sysRoleMenuEntity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleId(Long roleId) { + baseDao.deleteByRoleId(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByMenuId(Long menuId) { + baseDao.deleteByMenuId(menuId); + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java new file mode 100644 index 0000000..c08f058 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleServiceImpl.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.constant.RoleTypeKeyConstant; +import com.elink.esua.epdc.dao.SysRoleDao; +import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; +import com.elink.esua.epdc.dto.SysRoleDTO; +import com.elink.esua.epdc.entity.SysRoleEntity; +import com.elink.esua.epdc.service.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleServiceImpl extends BaseServiceImpl implements SysRoleService { + @Autowired + private SysRoleUserService sysRoleUserService; + @Autowired + private SysRoleMenuService sysRoleMenuService; + @Autowired + private SysRoleDataScopeService sysRoleDataScopeService; + @Autowired + private SysDeptService sysDeptService; + @Autowired + private AppRoleMenuService appRoleMenuService; + @Autowired + private SysAnalysisRoleMenuService sysAnalysisRoleMenuService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, Constant.CREATE_DATE, false), + getWrapper(params) + ); + + return getPageData(page, SysRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysRoleDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String name = (String) params.get("name"); + String code = (String) params.get("code"); + String completeMatchName = ""; + if (params.containsKey("completeMatchName")) { + completeMatchName = (String) params.get("completeMatchName"); + } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(Constant.DEL_FLAG, DelFlagEnum.NORMAL.value()) + .eq(StringUtils.isNotBlank(code), "code", code) + .like(StringUtils.isNotBlank(name), "name", name) + .eq(StringUtils.isNotBlank(completeMatchName), "name", completeMatchName); + + // 普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + List deptIdList = sysDeptService.getSubDeptIdList(user.getDeptId()); + wrapper.in(deptIdList != null, "dept_id", deptIdList); + } + + return wrapper; + } + + @Override + public SysRoleDTO get(Long id) { + SysRoleEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, SysRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysRoleDTO dto) { + SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class); + + checkDeptRoleAmount(dto.getTypeKey(), dto.getDeptIdList()); + + //保存角色 + insert(entity); + + //保存角色菜单关系 + sysRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + + //保存角色数据权限关系 + sysRoleDataScopeService.saveOrUpdate(entity.getId(), dto.getDeptIdList()); + + //保存角色与app菜单关系 + appRoleMenuService.saveOrUpdate(entity.getId(), dto.getAppMenuIdList()); + +// //更新角色与数据端菜单关系 + sysAnalysisRoleMenuService.saveOrUpdate(entity.getId(), dto.getAnalysisMenuIdList()); + + } + + /** + * 根据角色类型,获取机构的此类角色数量 + * + * @param roleType 角色类型 + * @param deptidList 机构id列表 + * @return void + * @author work@yujt.net.cn + * @date 2019/12/18 10:14 + */ + private void checkDeptRoleAmount(String roleType, List deptidList) { + if (RoleTypeKeyConstant.ROLE_GRID_LEADER.equals(roleType)) { + List> resultList = baseDao.selectAmountByRoleTpye(roleType, deptidList); + if (CollUtil.isEmpty(resultList)) { + return; + } + Map map; + String mapValue; + for (int i = 0; i < resultList.size(); i++) { + map = resultList.get(i); + + mapValue = map.get("typeKey").toString(); + if (!mapValue.equals(OrganizationTypeConstant.ORG_TYPE_GRID_PARTY)) { + continue; + } + + mapValue = map.get("amount").toString(); + if (Integer.parseInt(mapValue) <= NumConstant.THREE) { + continue; + } + mapValue = map.get("id").toString(); + ParentAndAllDeptDTO parentAndAllDept = sysDeptService.getParentAndAllDept(mapValue); + throw new RenException("保存失败:" + parentAndAllDept.getAllDeptNames() + ",网格长多于3人"); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysRoleDTO dto) { + SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class); + + //更新角色 + updateById(entity); + + //更新角色菜单关系 + sysRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + + //更新角色数据权限关系 + sysRoleDataScopeService.saveOrUpdate(entity.getId(), dto.getDeptIdList()); + + //更新角色与app菜单关系 + appRoleMenuService.saveOrUpdate(entity.getId(), dto.getAppMenuIdList()); + //更新角色与数据端菜单关系 + sysAnalysisRoleMenuService.saveOrUpdate(entity.getId(), dto.getAnalysisMenuIdList()); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //逻辑删除角色 + logicDelete(ids, SysRoleEntity.class); + + //删除角色用户关系 + sysRoleUserService.deleteByRoleIds(ids); + + //[角色菜单关系、角色数据权限关系、App菜单授权],需要保留,不然逻辑删除就变成物理删除了 + } + +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleUserServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleUserServiceImpl.java new file mode 100644 index 0000000..58b5492 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysRoleUserServiceImpl.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.dao.SysRoleUserDao; +import com.elink.esua.epdc.entity.SysRoleUserEntity; +import com.elink.esua.epdc.service.SysRoleUserService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysRoleUserServiceImpl extends BaseServiceImpl implements SysRoleUserService { + + @Override + public void saveOrUpdate(Long userId, List roleIdList) { + //先删除角色用户关系 + deleteByUserId(userId); + + //用户没有一个角色权限的情况 + if(CollUtil.isEmpty(roleIdList)){ + return ; + } + + //保存角色用户关系 + for(Long roleId : roleIdList){ + SysRoleUserEntity sysRoleUserEntity = new SysRoleUserEntity(); + sysRoleUserEntity.setUserId(userId); + sysRoleUserEntity.setRoleId(roleId); + + //保存 + insert(sysRoleUserEntity); + } + } + + @Override + public void deleteByRoleIds(Long[] roleIds) { + baseDao.deleteByRoleIds(roleIds); + } + + @Override + public void deleteByUserId(Long userId) { + baseDao.deleteByUserId(userId); + } + + @Override + public List getRoleIdList(Long userId) { + + return baseDao.getRoleIdList(userId); + } + @Override + public List getWorkRecordRoleUser(String menuCode) { + + return baseDao.getWorkRecordRoleUser(menuCode); + } +} diff --git a/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..94fd363 --- /dev/null +++ b/epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java @@ -0,0 +1,293 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.enums.SuperAdminEnum; +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.password.PasswordUtils; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.SysUserDao; +import com.elink.esua.epdc.dto.SysUserDTO; +import com.elink.esua.epdc.dto.SysUserOpenIdFormDTO; +import com.elink.esua.epdc.dto.epdc.GridForLeaderRegisterDTO; +import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; +import com.elink.esua.epdc.entity.SysUserEntity; +import com.elink.esua.epdc.service.SysDeptService; +import com.elink.esua.epdc.service.SysRoleUserService; +import com.elink.esua.epdc.service.SysUserService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 用户管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class SysUserServiceImpl extends BaseServiceImpl implements SysUserService { + @Autowired + private SysRoleUserService sysRoleUserService; + @Autowired + private SysDeptService sysDeptService; + + @Override + public PageData page(Map params) { + //转换成like + paramsToLike(params, "username"); + paramsToLike(params, "realname"); + paramsToLike(params, "mobile"); + paramsToLike(params, "email"); + //分页 + IPage page = getPage(params, Constant.CREATE_DATE, false); + + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", sysDeptService.getSubDeptIdList(user.getDeptId())); + } + + //查询 + List list = baseDao.getList(params); + + return getPageData(list, page.getTotal(), SysUserDTO.class); + } + + @Override + public List list(Map params) { + //普通管理员,只能查询所属部门及子部门的数据 + UserDetail user = SecurityUser.getUser(); + if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) { + params.put("deptIdList", sysDeptService.getSubDeptIdList(user.getDeptId())); + } + + List entityList = baseDao.getList(params); + + return ConvertUtils.sourceToTarget(entityList, SysUserDTO.class); + } + + @Override + public SysUserDTO get(Long id) { + SysUserEntity entity = baseDao.getById(id); + + return ConvertUtils.sourceToTarget(entity, SysUserDTO.class); + } + + @Override + public SysUserDTO getByUsername(String username) { + SysUserEntity entity = baseDao.getByUsername(username); + return ConvertUtils.sourceToTarget(entity, SysUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysUserDTO dto) { + + this.verifyUsernameAndMobile(dto); + + SysUserEntity entity = ConvertUtils.sourceToTarget(dto, SysUserEntity.class); + + //密码加密 + String password = PasswordUtils.encode(entity.getPassword()); + entity.setPassword(password); + + //保存用户 + entity.setSuperAdmin(SuperAdminEnum.NO.value()); + insert(entity); + + //保存角色用户关系 + sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysUserDTO dto) { + + this.verifyUsernameAndMobile(dto); + + SysUserEntity entity = ConvertUtils.sourceToTarget(dto, SysUserEntity.class); + + //密码加密 + if (StringUtils.isBlank(dto.getPassword())) { + entity.setPassword(null); + } else { + String password = PasswordUtils.encode(entity.getPassword()); + entity.setPassword(password); + } + + //更新用户 + updateById(entity); + + //更新角色用户关系 + sysRoleUserService.saveOrUpdate(entity.getId(), dto.getRoleIdList()); + } + + /** + * 用户名与手机号查重 + * + * @param dto 用户新增或修改时的提交数据 + * @return void + * @author work@yujt.net.cn + * @date 2019/11/4 14:01 + */ + private void verifyUsernameAndMobile(SysUserDTO dto) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()) + .ne(null != dto.getId(), "id", dto.getId()) + .and(i -> i.eq(StringUtils.isNotBlank(dto.getMobile()), "mobile", dto.getMobile()) + .or() + .eq("username", dto.getUsername())); + Integer selectCount = this.baseDao.selectCount(wrapper); + if (selectCount > NumConstant.ZERO) { + throw new RenException("保存失败,用户名或手机号重复"); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long[] ids) { + //逻辑删除 + logicDelete(ids, SysUserEntity.class); + + //角色用户关系,需要保留,不然逻辑删除就变成物理删除了 + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updatePassword(Long id, String newPassword) { + newPassword = PasswordUtils.encode(newPassword); + + baseDao.updatePassword(id, newPassword); + } + + @Override + public int getCountByDeptId(Long deptId) { + return baseDao.getCountByDeptId(deptId); + } + + @Override + public Result listGridWhileLeaderRegister(String mobile) { + //TODO:该方法的获取组织结构不灵活,得重构 create by rongchao + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.MOBILE, mobile) + .eq(FieldConstant.DEL_FLAG, DelFlagEnum.NORMAL.value()); + + Integer selectCount = baseDao.selectCount(wrapper); + if (selectCount == NumConstant.ZERO) { + return new Result().error("匹配网格长手机号失败"); + } + + SysUserEntity sysUserEntity = baseDao.selectOne(wrapper); + SysUserDTO dto = ConvertUtils.sourceToTarget(sysUserEntity, SysUserDTO.class); + + List gridIdList = this.baseDao.selectListLeaderGridId(mobile); + if (CollUtil.isEmpty(gridIdList)) { + return new Result().error("匹配网格长数据权限失败"); + } + + List gridForLeaderList = sysDeptService.selectListGridForLeader(gridIdList); + + GridLeaderRegisterDTO result = new GridLeaderRegisterDTO(); + result.setSysUser(dto); + result.setLeaderGridList(gridForLeaderList); + return new Result().ok(result); + } + + @Override + public List listOfUserIdsByDeptId(Long deptId) { + return baseDao.selectListOfUserIdsByDeptId(deptId); + } + + @Override + public Result modifyOpenIdByUsername(SysUserOpenIdFormDTO sysUserOpenIdFormDto) { + // 查询当前openId是否绑定过账户 + SysUserDTO userDto = this.getSysUserInfoByOpenId(sysUserOpenIdFormDto.getOpenId()); + if (null != userDto) { + // 解绑旧帐户 + SysUserEntity entity = new SysUserEntity(); + entity.setId(userDto.getId()); + entity.setOpenId(""); + baseDao.updateById(entity); + } + // 绑定新账户 + baseDao.updateOpenIdByUsername(sysUserOpenIdFormDto); + + return new Result(); + } + + @Override + public SysUserDTO getSysUserInfoByOpenId(String openId) { + return baseDao.selectOneOfSysUserByOpenId(openId); + } + + @Override + public void updateUserOpenId(Long userId) { + baseDao.updateUserOpenId(userId); + } + + @Override + public Result> getUserPhoneByListDeptId(List deptId) { + Map map = new HashMap<>(); + map.put("deptId",deptId); + List list = baseDao.getUserPhoneByListDeptId(map); + return new Result>().ok(list); + } + + @Override + public Result> getSysGridLeaderPhone(Long deptId) { + return new Result>().ok(baseDao.getSysGridLeaderPhone(deptId)); + } + + @Override + public Result checkUpdateAvatar() { + String userId = SecurityUser.getUser().getId().toString(); + SysUserEntity userInfo = baseDao.selectById(userId); + if(userInfo==null || userInfo.getDelFlag()==1 || userInfo.getStatus()==0){ + throw new RenException("未查到次用户信息或此用户被停用!"); + } + if(StringUtils.isNotBlank(userInfo.getHeadUrl())){ + return new Result().ok(false); + }else{ + return new Result().ok(true); + } + } + + @Transactional + @Override + public Result updateAvatar(String avatar) { + if(StringUtils.isBlank(avatar)){ + throw new RenException("头像地址不可为空"); + } + String userId = SecurityUser.getUser().getId().toString(); + SysUserEntity userInfo = baseDao.selectById(userId); + userInfo.setHeadUrl(avatar); + baseDao.updateById(userInfo); + return new Result().ok(true); + } + + +} diff --git a/epdc-cloud-admin/src/main/resources/application-dev.yml b/epdc-cloud-admin/src/main/resources/application-dev.yml new file mode 100644 index 0000000..225439f --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/application-dev.yml @@ -0,0 +1,56 @@ +spring: + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + timeout: 30s + port: @spring.redis.port@ + password: @spring.redis.password@ + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: epdc + password: elink833066 + #Oracle +# driver-class-name: oracle.jdbc.OracleDriver +# url: jdbc:oracle:thin:@localhost:1521:xe +# username: renren_cloud +# password: 123456 + #SQLServer +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_cloud +# username: sa +# password: 123456 + #postgresql +# driver-class-name: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/renren_cloud +# username: postgres +# password: 123456 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + + +##多数据源的配置,需要引用renren-commons-dynamic-datasource +#dynamic: +# datasource: +# slave1: +# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver +# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_cloud +# username: sa +# password: 123456 +# slave2: +# driver-class-name: org.postgresql.Driver +# url: jdbc:postgresql://localhost:5432/renren_cloud +# username: postgres +# password: 123456 diff --git a/epdc-cloud-admin/src/main/resources/application-prod.yml b/epdc-cloud-admin/src/main/resources/application-prod.yml new file mode 100644 index 0000000..5afdbc8 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/application-prod.yml @@ -0,0 +1,36 @@ +spring: + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + timeout: 30s + port: @spring.redis.port@ + password: @spring.redis.password@ + datasource: + druid: + driver-class-name: com.mysql.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false diff --git a/epdc-cloud-admin/src/main/resources/application-test.yml b/epdc-cloud-admin/src/main/resources/application-test.yml new file mode 100644 index 0000000..847562a --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/application-test.yml @@ -0,0 +1,36 @@ +spring: + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + timeout: 30s + port: @spring.redis.port@ + password: @spring.redis.password@ + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: epdc + password: elink833066 + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + stat-view-servlet: + enabled: true + url-pattern: /druid/* + #login-username: admin + #login-password: admin + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/resources/application.yml b/epdc-cloud-admin/src/main/resources/application.yml new file mode 100644 index 0000000..9156371 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/application.yml @@ -0,0 +1,120 @@ +server: + port: @server.port@ + servlet: + context-path: /sys + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epdc-admin-server + #环境 dev|test|prod + profiles: + active: @spring.profiles.active@ + messages: + encoding: UTF-8 + basename: i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + namespace: @nacos.namespace@ + alibaba: + seata: + tx-service-group: epdc-admin-server-fescar-service-group + zipkin: + # 指定了 zipkin 服务器的地址 + base-url: @spring.zipkin.base-url@ + sleuth: + sampler: + # 将采样比例设置为 1.0,也就是全部都需要。默认是 0.1 + probability: 1.0 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.elink.esua.epdc.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + #db-type: mysql + #刷新mapper 调试神器 + refresh-mapper: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +wx: + ma: + configs: + - appid: @wx.ma.appId@ + secret: @wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON + - appid: @work.wx.ma.appId@ + secret: @work.wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON + - appid: @analysis.wx.ma.appId@ + secret: @analysis.wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON + appId: + # 普通居民端的appId + normal: @wx.ma.appId@ + # 工作端的appId + work: @work.wx.ma.appId@ + # 数据分析端的appId + analysis: @analysis.wx.ma.appId@ + + +feign: + hystrix: + enabled: true + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + + +rocketmq: + name-server: @rocketmq.name.server@ + producer: + group: @rocketmq.producer.group@ diff --git a/epdc-cloud-admin/src/main/resources/logback-spring.xml b/epdc-cloud-admin/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..3fa19ae --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/logback-spring.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/AppMenuDao.xml b/epdc-cloud-admin/src/main/resources/mapper/AppMenuDao.xml new file mode 100644 index 0000000..9ef1b2c --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/AppMenuDao.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/AppMenuTemplateDao.xml b/epdc-cloud-admin/src/main/resources/mapper/AppMenuTemplateDao.xml new file mode 100644 index 0000000..686ad74 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/AppMenuTemplateDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/resources/mapper/AppRoleMenuDao.xml b/epdc-cloud-admin/src/main/resources/mapper/AppRoleMenuDao.xml new file mode 100644 index 0000000..4ca2df3 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/AppRoleMenuDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + delete from sys_app_role_menu where role_id = #{value} + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/DeptGridPlatformDao.xml b/epdc-cloud-admin/src/main/resources/mapper/DeptGridPlatformDao.xml new file mode 100644 index 0000000..da50dbf --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/DeptGridPlatformDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/DeptMaCodeDao.xml b/epdc-cloud-admin/src/main/resources/mapper/DeptMaCodeDao.xml new file mode 100644 index 0000000..2889a5e --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/DeptMaCodeDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysAnalysisMenuDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysAnalysisMenuDao.xml new file mode 100644 index 0000000..649e12c --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysAnalysisMenuDao.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml new file mode 100644 index 0000000..e06a1be --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysAnalysisRoleMenuDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + delete from sys_analysis_role_menu where role_id = #{value} + + + + + \ No newline at end of file diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml new file mode 100644 index 0000000..4a7b850 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysDictDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysDictDao.xml new file mode 100644 index 0000000..5dd4a68 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysDictDao.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysLanguageDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysLanguageDao.xml new file mode 100644 index 0000000..0690f5d --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysLanguageDao.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysLogErrorDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysLogErrorDao.xml new file mode 100644 index 0000000..7b7cdb0 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysLogErrorDao.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysLogLoginDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysLogLoginDao.xml new file mode 100644 index 0000000..6b949c8 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysLogLoginDao.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysLogOperationDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysLogOperationDao.xml new file mode 100644 index 0000000..570b4c0 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysLogOperationDao.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysMenuDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysMenuDao.xml new file mode 100644 index 0000000..b9bb496 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysMenuDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysParamsDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysParamsDao.xml new file mode 100644 index 0000000..4c190ca --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysParamsDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + update sys_params set param_value = #{paramValue} where param_code = #{paramCode} + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysResourceDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysResourceDao.xml new file mode 100644 index 0000000..b3be20b --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysResourceDao.xml @@ -0,0 +1,25 @@ + + + + + + + delete from sys_resource where resource_code = #{value} + + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysRoleDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysRoleDao.xml new file mode 100644 index 0000000..c8cc9d1 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysRoleDao.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysRoleDataScopeDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysRoleDataScopeDao.xml new file mode 100644 index 0000000..2211301 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysRoleDataScopeDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + delete from sys_role_data_scope where role_id = #{value} + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysRoleMenuDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysRoleMenuDao.xml new file mode 100644 index 0000000..f2015af --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysRoleMenuDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + delete from sys_role_menu where role_id = #{value} + + + + delete from sys_role_menu where menu_id = #{value} + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysRoleUserDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysRoleUserDao.xml new file mode 100644 index 0000000..ba0b491 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysRoleUserDao.xml @@ -0,0 +1,33 @@ + + + + + + + delete from sys_role_user where role_id in + + #{roleId} + + + + + delete from sys_role_user where user_id = #{value} + + + + + diff --git a/epdc-cloud-admin/src/main/resources/mapper/SysUserDao.xml b/epdc-cloud-admin/src/main/resources/mapper/SysUserDao.xml new file mode 100644 index 0000000..873cb62 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/mapper/SysUserDao.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + update sys_user set password = #{newPassword} where id = #{id} + + + + + + + + + + + + + UPDATE sys_user SET open_id = #{openId} WHERE username = #{username} AND del_flag = 0 + + + + UPDATE sys_user SET open_id = '' WHERE id = #{userId} AND del_flag = 0 + + + + + + + + diff --git a/epdc-cloud-admin/src/main/resources/registry.conf b/epdc-cloud-admin/src/main/resources/registry.conf new file mode 100644 index 0000000..b5f0898 --- /dev/null +++ b/epdc-cloud-admin/src/main/resources/registry.conf @@ -0,0 +1,21 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "@nacos.server-addr@" + namespace = "@nacos.namespace@" + cluster = "default" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "@nacos.server-addr@" + namespace = "@nacos.namespace@" + cluster = "default" + } +} diff --git a/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTest.java b/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTest.java new file mode 100644 index 0000000..536cd90 --- /dev/null +++ b/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTest.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.tools.exception.RenException; +import com.elink.esua.epdc.commons.tools.redis.RedisChannels; +import com.elink.esua.epdc.utils.WxMaServiceUtils; +import me.chanjar.weixin.common.error.WxErrorException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.File; + +/** + * 多数据源测试 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@RunWith(SpringRunner.class) +@SpringBootTest +public class DynamicDataSourceTest { + @Autowired + private DynamicDataSourceTestService dynamicDataSourceTestService; + + @Test + public void test() { + Long id = 1067246875800000001L; + dynamicDataSourceTestService.selectById(id); + dynamicDataSourceTestService.updateUser(id); + dynamicDataSourceTestService.updateUserBySlave1(id); + dynamicDataSourceTestService.updateUserBySlave2(id); + } + + @Autowired + private SysDeptService deptService; + + @Test + public void test1() { + Long id = 1199891988837203969L; + deptService.packageUserDeptOption(id); + } + + @Autowired + private WxMaServiceUtils wxMaServiceUtils; + + @Test + public void test2() { + Long id = 1203124312842002434L; + + File wxaCodeUnlimit; + try { + wxaCodeUnlimit = wxMaServiceUtils.normalWxMaService().getQrcodeService() + .createWxaCodeUnlimit(String.valueOf(id), "pages/index/index", 1280, true, null, false); + System.out.println(wxaCodeUnlimit.getName()); + } catch (WxErrorException e) { + throw new RenException("请求微信接口失败"); + } + + } + + @Autowired + private RedisTemplate redisTemplate; + + @Test + public void test3() { + String json = "{'postId':'666','carNum':'123'}"; + redisTemplate.convertAndSend(RedisChannels.COMPLETE_INFO_BY_SENTRY_POST, json); + } + +} diff --git a/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTestService.java b/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTestService.java new file mode 100644 index 0000000..76ee836 --- /dev/null +++ b/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicDataSourceTestService.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

    + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

    + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

    + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.dynamic.datasource.annotation.DataSource; +import com.elink.esua.epdc.dao.SysUserDao; +import com.elink.esua.epdc.entity.SysUserEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 测试多数据源 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class DynamicDataSourceTestService extends DynamicService { + @Autowired + private SysUserDao sysUserDao; + + @Transactional + public void updateUser(Long id){ + SysUserEntity user = new SysUserEntity(); + user.setId(id); + user.setMobile("13500000000"); + sysUserDao.updateById(user); + } + + @DataSource("slave1") + @Transactional + public void updateUserBySlave1(Long id){ + SysUserEntity user = new SysUserEntity(); + user.setId(id); + user.setMobile("13500000001"); + sysUserDao.updateById(user); + } + + @DataSource("slave2") + @Transactional + public void updateUserBySlave2(Long id){ + SysUserEntity user = new SysUserEntity(); + user.setId(id); + user.setMobile("13500000002"); + sysUserDao.updateById(user); + + //测试事物 + int i = 1/0; + } +} diff --git a/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicService.java b/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicService.java new file mode 100644 index 0000000..441e848 --- /dev/null +++ b/epdc-cloud-admin/src/test/java/com/elink/esua/epdc/service/DynamicService.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

    + * https://www.renren.io + *

    + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.dynamic.datasource.annotation.DataSource; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.dao.SysUserDao; +import com.elink.esua.epdc.entity.SysUserEntity; + +/** + * 测试多数据源 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +@DataSource("slave2") +public class DynamicService extends BaseServiceImpl { +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..c48ddad --- /dev/null +++ b/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + com.esua.epdc.yushan + epdc-cloud-admin-yushan + 1.0.0 + pom + 榆山党群e家管理微服务模块 + + + epdc-cloud-admin + epdc-cloud-client-yushan + epdc-cloud-commons-yushan + epdc-cloud-gateway-yushan + epdc-cloud-parent-yushan + +