Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into dev_optimize_ljj

feature/evaluate
jianjun 5 years ago
parent
commit
b2e6a45541
  1. 4
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java
  2. 4
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
  3. 4
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java
  4. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java
  5. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java
  6. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java
  7. 4
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java
  8. 5
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java
  9. 10
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java
  10. 4
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java
  11. 6
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java
  12. 95
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java
  13. 8
      epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java
  14. 1
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  15. 2
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  16. 24
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java
  17. 26
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java
  18. 121
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java
  19. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  20. 153
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java
  21. 43
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java
  22. 19
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  23. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  24. 5
      epmet-gateway/src/main/resources/bootstrap.yml
  25. 13
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectDistributionFormDTO.java
  26. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  27. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  28. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  29. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java
  30. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  31. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  32. 33
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java
  33. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java
  34. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  35. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  36. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  37. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  38. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
  39. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  40. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java
  41. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java
  42. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  43. 60
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  44. 17
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  45. 42
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  46. 54
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  47. 6
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java
  48. 6
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java
  49. 4
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java
  50. 2
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java
  51. 5
      epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java
  52. 21
      epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java
  53. 13
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java
  54. 9
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java
  55. 17
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java
  56. 19
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java
  57. 1
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java
  58. 16
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java
  59. 6
      epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java
  60. 8
      epmet-module/epmet-oss/epmet-oss-server/pom.xml
  61. 21
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java
  62. 74
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java
  63. 14
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java
  64. 14
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java
  65. 31
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java
  66. 14
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java
  67. 14
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java
  68. 65
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  69. 4
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java
  70. 10
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java
  71. 62
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java
  72. 4
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
  73. 6
      epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml
  74. 10
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  75. 81
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java
  76. 27
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java
  77. 22
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java
  78. 130
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java
  79. 55
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java
  80. 9
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java
  81. 51
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java
  82. 62
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java
  83. 47
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java
  84. 126
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java
  85. 132
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java
  86. 43
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java
  87. 12
      epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.5__gov_customer_menu.sql
  88. 29
      epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovCustomerMenuDao.xml
  89. 14
      epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml
  90. 8
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java
  91. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  92. 8
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  93. 5
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  94. 3
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml
  95. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java
  96. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  97. 16
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java
  98. 7
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java
  99. 11
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java
  100. 7
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java

4
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysDeptDTO;
import com.epmet.service.SysDeptService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -56,7 +55,6 @@ public class SysDeptController {
@PostMapping
@ApiOperation("保存")
@LogOperation("Save Dept")
public Result save(@RequestBody SysDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -68,7 +66,6 @@ public class SysDeptController {
@PutMapping
@ApiOperation("修改")
@LogOperation("Update Dept")
public Result update(@RequestBody SysDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -80,7 +77,6 @@ public class SysDeptController {
@DeleteMapping("{id}")
@ApiOperation("删除")
@LogOperation("Delete Dept")
public Result delete(@PathVariable("id") Long id){
//效验数据
AssertUtils.isNull(id, "id");

4
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.service.SysDictDataService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -67,7 +66,6 @@ public class SysDictDataController {
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
public Result save(@RequestBody SysDictDataDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, DefaultGroup.class);
@ -79,7 +77,6 @@ public class SysDictDataController {
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
public Result update(@RequestBody SysDictDataDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -91,7 +88,6 @@ public class SysDictDataController {
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");

4
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysDictTypeDTO;
import com.epmet.service.SysDictTypeService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -69,7 +68,6 @@ public class SysDictTypeController {
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
public Result save(@RequestBody SysDictTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, DefaultGroup.class);
@ -81,7 +79,6 @@ public class SysDictTypeController {
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
public Result update(@RequestBody SysDictTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -93,7 +90,6 @@ public class SysDictTypeController {
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysLogErrorDTO;
import com.epmet.service.SysLogErrorService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -59,7 +58,6 @@ public class SysLogErrorController {
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("Export Log Error")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SysLogErrorDTO> list = sysLogErrorService.list(params);

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysLogLoginDTO;
import com.epmet.service.SysLogLoginService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -60,7 +59,6 @@ public class SysLogLoginController {
@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")

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysLogOperationDTO;
import com.epmet.service.SysLogOperationService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -63,7 +62,6 @@ public class SysLogOperationController {
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("Export Log Operation")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SysLogOperationDTO> list = sysLogOperationService.list(params);

4
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java

@ -12,7 +12,6 @@ import com.epmet.dto.MenuResourceDTO;
import com.epmet.dto.SysMenuDTO;
import com.epmet.service.SysMenuService;
import com.epmet.service.SysResourceService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.security.user.UserDetail;
import com.epmet.commons.tools.utils.Result;
@ -83,7 +82,6 @@ public class SysMenuController {
@PostMapping
@ApiOperation("保存")
@LogOperation("Save Menu")
public Result save(@RequestBody SysMenuDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, DefaultGroup.class);
@ -95,7 +93,6 @@ public class SysMenuController {
@PutMapping
@ApiOperation("修改")
@LogOperation("Update Menu")
public Result update(@RequestBody SysMenuDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, DefaultGroup.class);
@ -107,7 +104,6 @@ public class SysMenuController {
@DeleteMapping("{id}")
@ApiOperation("删除")
@LogOperation("Delete Menu")
public Result delete(@PathVariable("id") Long id){
//效验数据
AssertUtils.isNull(id, "id");

5
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysParamsDTO;
import com.epmet.service.SysParamsService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -72,7 +71,6 @@ public class SysParamsController {
@PostMapping
@ApiOperation("保存")
@LogOperation("Save Params")
public Result save(@RequestBody SysParamsDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -84,7 +82,6 @@ public class SysParamsController {
@PutMapping
@ApiOperation("修改")
@LogOperation("Update Params")
public Result update(@RequestBody SysParamsDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -96,7 +93,6 @@ public class SysParamsController {
@DeleteMapping
@ApiOperation("删除")
@LogOperation("Delete Params")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
@ -108,7 +104,6 @@ public class SysParamsController {
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("Export Params")
@ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SysParamsDTO> list = sysParamsService.list(params);

10
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java

@ -11,7 +11,6 @@ package com.epmet.controller;
import com.epmet.dto.SysRegionDTO;
import com.epmet.dto.region.RegionProvince;
import com.epmet.service.SysRegionService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
@ -71,8 +70,7 @@ public class SysRegionController {
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
public Result save(@RequestBody SysRegionDTO dto){
public Result save(@RequestBody SysRegionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -83,8 +81,7 @@ public class SysRegionController {
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
public Result update(@RequestBody SysRegionDTO dto){
public Result update(@RequestBody SysRegionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -95,8 +92,7 @@ public class SysRegionController {
@DeleteMapping("{id}")
@ApiOperation("删除")
@LogOperation("删除")
public Result delete(@PathVariable("id") Long id){
public Result delete(@PathVariable("id") Long id){
//效验数据
AssertUtils.isNull(id, "id");

4
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java

@ -10,7 +10,6 @@ package com.epmet.controller;
import com.epmet.dto.SysRoleDTO;
import com.epmet.service.SysRoleService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -94,7 +93,6 @@ public class SysRoleController {
@PostMapping
@ApiOperation("保存")
@LogOperation("Save Role")
public Result save(@RequestBody SysRoleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -106,7 +104,6 @@ public class SysRoleController {
@PutMapping
@ApiOperation("修改")
@LogOperation("Update Role")
public Result update(@RequestBody SysRoleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -118,7 +115,6 @@ public class SysRoleController {
@DeleteMapping
@ApiOperation("删除")
@LogOperation("Delete Role")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");

6
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java

@ -13,7 +13,6 @@ import com.epmet.dto.PasswordDTO;
import com.epmet.dto.SysUserDTO;
import com.epmet.service.SysResourceService;
import com.epmet.service.SysUserService;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.page.PageData;
@ -98,7 +97,6 @@ public class SysUserController {
@PostMapping
@ApiOperation("保存")
@LogOperation("Save User")
public Result save(@RequestBody SysUserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -110,7 +108,6 @@ public class SysUserController {
@PutMapping
@ApiOperation("修改")
@LogOperation("Update User")
public Result update(@RequestBody SysUserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -122,7 +119,6 @@ public class SysUserController {
@PutMapping("password")
@ApiOperation("修改密码")
@LogOperation("Password User")
public Result password(@RequestBody PasswordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto);
@ -141,7 +137,6 @@ public class SysUserController {
@DeleteMapping
@ApiOperation("删除")
@LogOperation("Delete User")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
@ -153,7 +148,6 @@ public class SysUserController {
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("Export User")
@ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SysUserDTO> list = sysUserService.list(params);

95
epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java

@ -1,95 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.log;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.log.BaseLog;
import com.epmet.commons.tools.log.enums.LogTypeEnum;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.entity.SysLogErrorEntity;
import com.epmet.entity.SysLogLoginEntity;
import com.epmet.entity.SysLogOperationEntity;
import com.epmet.service.SysLogErrorService;
import com.epmet.service.SysLogLoginService;
import com.epmet.service.SysLogOperationService;
import lombok.extern.slf4j.Slf4j;
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
*/
@Slf4j
@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(() -> {
try {
receiveQueue();
}catch (Exception e){
log.error("LogConsumer Error:"+ ExceptionUtils.getErrorStackTrace(e));
}
}, 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);
}
}
}
}

8
epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java

@ -14,7 +14,6 @@ import com.epmet.commons.tools.log.SysLogLogin;
import com.epmet.commons.tools.log.enums.LogTypeEnum;
import com.epmet.commons.tools.log.enums.LoginOperationEnum;
import com.epmet.commons.tools.log.enums.LoginStatusEnum;
import com.epmet.commons.tools.log.producer.LogProducer;
import com.epmet.commons.tools.redis.UserDetailRedis;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.security.user.SecurityUser;
@ -49,8 +48,6 @@ public class AuthServiceImpl implements AuthService {
@Autowired
private UserDetailRedis userDetailRedis;
@Autowired
private LogProducer logProducer;
@Autowired
private JwtUtils jwtUtils;
@Autowired
private JwtProperties jwtProperties;
@ -76,7 +73,6 @@ public class AuthServiceImpl implements AuthService {
if(user == null){
log.setStatus(LoginStatusEnum.FAIL.value());
log.setCreatorName(login.getUsername());
logProducer.saveLog(log);
throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR);
}
@ -86,7 +82,6 @@ public class AuthServiceImpl implements AuthService {
log.setStatus(LoginStatusEnum.FAIL.value());
log.setCreator(user.getId());
log.setCreatorName(user.getUsername());
logProducer.saveLog(log);
throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR);
}
@ -96,7 +91,6 @@ public class AuthServiceImpl implements AuthService {
log.setStatus(LoginStatusEnum.LOCK.value());
log.setCreator(user.getId());
log.setCreatorName(user.getUsername());
logProducer.saveLog(log);
throw new RenException(ErrorCode.ACCOUNT_DISABLE);
}
@ -116,7 +110,6 @@ public class AuthServiceImpl implements AuthService {
log.setCreator(user.getId());
log.setCreatorName(user.getUsername());
log.setStatus(LoginStatusEnum.SUCCESS.value());
logProducer.saveLog(log);
return authorization;
}
@ -138,7 +131,6 @@ public class AuthServiceImpl implements AuthService {
log.setCreator(user.getId());
log.setCreatorName(user.getUsername());
log.setCreateDate(new Date());
logProducer.saveLog(log);
userDetailRedis.logout(userId);
}

1
epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java

@ -106,6 +106,7 @@ public class GovWebServiceImpl implements GovWebService {
logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]");
int expire = jwtTokenProperties.getExpire();
TokenDto tokenDto = new TokenDto();
tokenDto.setCustomerId(formDTO.getCustomerId());
tokenDto.setApp(formDTO.getApp());
tokenDto.setClient(formDTO.getClient());
tokenDto.setUserId(userId);

2
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -484,7 +484,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
}
//密码错误
if(!passwordRightFlag){
logger.error(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile()));
logger.warn(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile()));
throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode());
}
StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO();

24
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java

@ -1,24 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.annotation;
import java.lang.annotation.*;
/**
* 操作日志注解
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface LogOperation {
String value() default "";
}

26
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java

@ -7,18 +7,14 @@ import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
@ -35,19 +31,20 @@ public class NoRepeatSubmitAop {
/**
* 重复提交判断时间为2s
*/
private static final Cache<String, Object> CACHES = CacheBuilder.newBuilder()
private static final Cache<String, Integer> CACHES = CacheBuilder.newBuilder()
// 最大缓存 100 个
.maximumSize(1000)
.maximumSize(100)
// 设置写缓存后 5 秒钟过期
.expireAfterWrite(5, TimeUnit.SECONDS)
.build();
@Before("execution(public * com.epmet..*Controller.*(..))")
public void before(JoinPoint joinPoint) {
System.out.println(joinPoint.getSignature().getName());
@Pointcut("@annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)")
public void doAspect() {
}
@Around("execution(public * com.epmet..*Controller.*(..)) && @annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)")
public Object around(ProceedingJoinPoint pjp) {
@Before("doAspect()")
public void around(JoinPoint pjp) {
try {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
assert attributes != null;
@ -55,9 +52,7 @@ public class NoRepeatSubmitAop {
String key = getKey(request.getRequestURI(), pjp.getArgs());
// 如果缓存中有这个url视为重复提交
if (CACHES.getIfPresent(key) == null) {
Object o = pjp.proceed();
CACHES.put(key, NumConstant.ZERO);
return o;
} else {
log.error("重复提交");
throw new RenException(EpmetErrorCode.REPEATED_SUBMIT_ERROR.getCode());
@ -68,7 +63,6 @@ public class NoRepeatSubmitAop {
log.error("验证重复提交时出现未知异常!");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
}
private String getKey(String keyExpress, Object[] args) {
@ -79,4 +73,4 @@ public class NoRepeatSubmitAop {
}
}
}

121
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java

@ -1,121 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.aspect;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.config.ModuleConfig;
import com.epmet.commons.tools.security.user.SecurityUser;
import com.epmet.commons.tools.log.SysLogOperation;
import com.epmet.commons.tools.log.enums.LogTypeEnum;
import com.epmet.commons.tools.log.enums.OperationStatusEnum;
import com.epmet.commons.tools.log.producer.LogProducer;
import com.epmet.commons.tools.security.user.UserDetail;
import com.epmet.commons.tools.utils.HttpContextUtils;
import com.epmet.commons.tools.utils.IpUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Date;
/**
* 操作日志切面处理类
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Aspect
@Component
public class LogOperationAspect {
@Autowired
private ModuleConfig moduleConfig;
@Autowired
private LogProducer logProducer;
@Pointcut("@annotation(com.epmet.commons.tools.annotation.LogOperation)")
public void logPointCut() {
}
@Around("logPointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
long beginTime = System.currentTimeMillis();
try {
//执行方法
Object result = point.proceed();
//执行时长(毫秒)
long time = System.currentTimeMillis() - beginTime;
//保存日志
saveLog(point, time, OperationStatusEnum.SUCCESS.value());
return result;
}catch(Exception e) {
//执行时长(毫秒)
long time = System.currentTimeMillis() - beginTime;
//保存日志
saveLog(point, time, OperationStatusEnum.FAIL.value());
throw e;
}
}
private void saveLog(ProceedingJoinPoint joinPoint, long time, Integer status) {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
SysLogOperation log = new SysLogOperation();
LogOperation annotation = method.getAnnotation(LogOperation.class);
if(annotation != null){
//注解上的描述
log.setOperation(annotation.value());
}
//登录用户信息
UserDetail user = SecurityUser.getUser();
if(user != null){
log.setCreator(user.getId());
log.setCreatorName(user.getUsername());
}
log.setType(LogTypeEnum.OPERATION.value());
log.setModule(moduleConfig.getName());
log.setStatus(status);
log.setRequestTime((int)time);
log.setCreateDate(new Date());
//请求相关信息
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
log.setIp(IpUtils.getIpAddr(request));
log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
log.setRequestUri(request.getRequestURI());
log.setRequestMethod(request.getMethod());
//请求参数
Object[] args = joinPoint.getArgs();
try{
String params = JSON.toJSONString(args[0]);
log.setRequestParams(params);
}catch (Exception e){
}
//保存到Redis队列里
logProducer.saveLog(log);
}
}

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -125,9 +125,11 @@ public enum EpmetErrorCode {
// 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),
ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"),
REPEATED_SUBMIT_ERROR(8998, "请勿重复提交"),
CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"),
DRAFT_CONTENT_FILENAME_NULL(8802, "附件名称不能为空"),
ARTICLE_PUBLISH_ERROR(8803, "发布文章失败,请刷新重试"),
REPEATED_SUBMIT_ERROR(8804, "请勿重复提交"),
CUSTOMER_VALIDATE_ERROR(8805, "内部数据校验异常"),
CATEGORY_IS_NULL(8806, "请设置分类"),
//公众号 865..开头的码
PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"),

153
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java

@ -1,153 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.exception;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.config.ModuleConfig;
import com.epmet.commons.tools.log.SysLogError;
import com.epmet.commons.tools.log.enums.LogTypeEnum;
import com.epmet.commons.tools.log.producer.LogProducer;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.HttpContextUtils;
import com.epmet.commons.tools.utils.IpUtils;
import com.epmet.commons.tools.utils.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.ExceptionHandler;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Map;
/**
* 异常处理器
* 暂停使用,改用BaseRequestLogAspect
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
//@RestControllerAdvice
public class RenExceptionHandler {
private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class);
@Autowired
private ModuleConfig moduleConfig;
@Autowired
private LogProducer logProducer;
@Autowired
private LoginUserUtil loginUserUtil;
/**
* 处理自定义异常
* "code": 8000,
* "msg": "服务器开小差了...",
*/
@ExceptionHandler(RenException.class)
public Result handleRRException(RenException ex){
if (ex.getCode() > 8000) {
Result result=new Result().error(ex.getCode());
result.setData(ex.getInternalMsg());
return result;
}
logger.error(ExceptionUtils.getErrorStackTrace(ex));
Result result=new Result().error();
result.setData(ex.getInternalMsg());
return result;
// return new Result().error();
}
/**
* 处理自定义异常
* "code": 8000,
* "msg": "服务器开小差了...",
*/
@ExceptionHandler(ValidateException.class)
public Result handleVException(ValidateException ex){
logger.error(ExceptionUtils.getErrorStackTrace(ex));
Result result=new Result();
result.setCode(ex.getCode());
result.setMsg(ex.getMsg());
return result;
// return new Result().error();
}
/**
* 运行时异常拦截
* "code": 8000,
* "msg": "服务器开小差了...",
*/
@ExceptionHandler(RuntimeException.class)
public Result handleRuntimeException(RuntimeException ex){
logger.error(ExceptionUtils.getErrorStackTrace(ex));
Result result=new Result().error();
result.setData(ex.getMessage());
return result;
// return new Result().error();
}
/**
* 处理自定义异常
* "code": 10002,
* "msg": "数据库中已存在该记录",
*/
@ExceptionHandler(DuplicateKeyException.class)
public Result handleDuplicateKeyException(DuplicateKeyException ex){
logger.error(ExceptionUtils.getErrorStackTrace(ex));
return new Result().error(ErrorCode.DB_RECORD_EXISTS);
}
/**
* 异常
* "code": 8000,
* "msg": "服务器开小差了...",
*/
@ExceptionHandler(Exception.class)
public Result handleException(Exception ex){
logger.error(ExceptionUtils.getErrorStackTrace(ex));
// saveLog(ex);
Result result=new Result().error();
result.setData(ex.getMessage());
return result;
// return new Result().error();
}
/**
* 保存异常日志
*/
private void saveLog(Exception ex){
SysLogError log = new SysLogError();
log.setType(LogTypeEnum.ERROR.value());
log.setModule(moduleConfig.getName());
//请求相关信息
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
log.setRequestUri(request.getRequestURI());
log.setRequestMethod(request.getMethod());
log.setIp(IpUtils.getIpAddr(request));
Map<String, String> params = HttpContextUtils.getParameterMap(request);
if(MapUtil.isNotEmpty(params)){
log.setRequestParams(JSON.toJSONString(params));
}
//登录用户ID
log.setCreator(loginUserUtil.getLoginUserId());
//异常信息
log.setErrorInfo(ExceptionUtils.getErrorStackTrace(ex));
//保存到Redis队列里
log.setCreateDate(new Date());
logProducer.saveLog(log);
}
}

43
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java

@ -1,43 +0,0 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.log.producer;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.epmet.commons.tools.log.BaseLog;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.concurrent.*;
/**
* 日志通过redis队列异步保存到数据库
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Component
public class LogProducer {
@Autowired
private RedisUtils redisUtils;
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("log-producer-pool-%d").build();
ExecutorService pool = new ThreadPoolExecutor(5, 200, 0L,TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
/**
* 保存Log到Redis消息队列
*/
public void saveLog(BaseLog log){
String key = RedisKeys.getSysLogKey();
//异步保存到队列
pool.execute(() -> redisUtils.leftPush(key, log, RedisUtils.NOT_EXPIRE));
}
}

19
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -43,13 +43,6 @@ public class RedisKeys {
return rootPrefix.concat("sys:security:user:").concat(String.valueOf(id));
}
/**
* 系统日志Key
*/
public static String getSysLogKey() {
return rootPrefix.concat("sys:log");
}
/**
* 系统资源Key
*/
@ -386,4 +379,16 @@ public class RedisKeys {
public static String getResiUserBadgeKey(String customerId, String userId) {
return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(StringUtils.isBlank(userId) ? "*" : userId);
}
/**
* desc: 根据文件路径获取oss 文件缓存key
*
* @param path
* @return java.lang.String
* @author LiuJanJun
* @date 2021/3/30 9:56 上午
*/
public static String getOssFileKey(String path) {
return rootPrefix.concat("oss:temp:").concat(path);
}
}

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -424,6 +424,13 @@ public class DateUtils {
return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD);
}
public static String getBeforeNDay(int beforDay,String format){
Calendar c = Calendar.getInstance();
c.add(Calendar.DATE, - beforDay);
Date date = c.getTime();
return DateUtils.format(date,format);
}
/**
* @return java.lang.String
* @param beforMonth

5
epmet-gateway/src/main/resources/bootstrap.yml

@ -457,6 +457,11 @@ epmet:
- /gov/project/**
- /resi/home/**
- /data/report/**
- /epmet/ext/**
- /data/stats/**
- /data/aggregator/**
- /gov/voice/**
- /resi/voice/**
# 内部认证url白名单(在白名单中的,就不会再校验登录了)
internalAuthUrlsWhiteList:

13
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectDistributionFormDTO.java

@ -13,7 +13,20 @@ import java.io.Serializable;
*/
@Data
public class ProjectDistributionFormDTO implements Serializable {
/**
* 网格id不必填
*/
private String gridId;
@NotBlank(message = "customerId不能为空")
private String customerId;
/**
* 默认1
*/
private Integer pageNo;
/**
* 默认20
*/
private Integer pageSize;
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java

@ -44,5 +44,5 @@ public interface GovIssueService {
**/
List<ClosedIssueListResultDTO> closedIssueList(ClosedIssueListFormDTO fromDTO);
List<IssueInfoDTO> selectShiftProjectIssueList(String customerId,String gridId);
List<IssueInfoDTO> selectShiftProjectIssueList(String customerId,String gridId,Integer pageNo,Integer pageSize);
}

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java

@ -314,8 +314,13 @@ public class GovIssueServiceImpl implements GovIssueService {
}
@Override
public List<IssueInfoDTO> selectShiftProjectIssueList(String customerId,String gridId) {
return issueDao.selectShiftProjectIssueList(customerId,gridId);
public List<IssueInfoDTO> selectShiftProjectIssueList(String customerId, String gridId, Integer pageNo, Integer pageSize) {
if (pageNo != null && pageSize != null) {
PageHelper.startPage(pageNo, pageSize);
}else{
PageHelper.startPage(NumConstant.ONE, NumConstant.TWENTY);
}
return issueDao.selectShiftProjectIssueList(customerId, gridId);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -114,7 +114,7 @@ public class GovProjectServiceImpl implements GovProjectService {
@Override
public List<ProjectDistributionResultDTO> queryProjectDistribution(ProjectDistributionFormDTO formDTO) {
List<ProjectDistributionResultDTO> resultDTOList = new ArrayList<>();
List<IssueInfoDTO> issueInfoDTOList = govIssueService.selectShiftProjectIssueList(formDTO.getCustomerId(), formDTO.getGridId());
List<IssueInfoDTO> issueInfoDTOList = govIssueService.selectShiftProjectIssueList(formDTO.getCustomerId(), formDTO.getGridId(),formDTO.getPageNo(),formDTO.getPageSize());
if (CollectionUtils.isNotEmpty(issueInfoDTOList)) {
List<String> topicIds = issueInfoDTOList.stream().map(data -> data.getTopicId()).collect(Collectors.toList());
// log.info("话题id集合:" + JSON.toJSONString(topicIds, true));

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java

@ -1,7 +1,6 @@
package com.epmet.dataaggre.service.resigroup;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -10,5 +9,5 @@ import java.util.List;
* @DateTime 2020/12/25 上午9:21
*/
public interface ResiGroupService {
List<ResiTopicDTO> selectTopicInfoByIds(@Param("topicIds") List<String> topicIds);
List<ResiTopicDTO> selectTopicInfoByIds(List<String> topicIds);
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

@ -122,6 +122,6 @@
<if test="gridId != null and gridId.trim() != ''">
AND i.GRID_ID = #{gridId}
</if>
order by i.SHIFTED_TIME desc limit 100
order by i.SHIFTED_TIME desc
</select>
</mapper>

1
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -140,6 +140,5 @@
<foreach item="issueId" collection="list" separator="," open="(" close=")" index="">
#{issueId}
</foreach>
order by CREATED_TIME desc limit 100
</select>
</mapper>

33
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java

@ -17,25 +17,58 @@ import java.util.List;
public class UserStatisticalData implements Serializable {
private static final long serialVersionUID = 7423427555123585566L;
/**
* 机关下(按日)参与用户数分析
*/
private List<FactParticipationUserAgencyDailyDTO> partiAgencyDailyList;
/**
* 网格下(按日)参与用户数分析
*/
private List<FactParticipationUserGridDailyDTO> partiGridDailyList;
/**
* 机关下(按月)参与用户数分析
*/
private List<FactParticipationUserAgencyMonthlyDTO> partiAgencyMonthlyList;
/**
* 网格下()参与用户数分析
*/
private List<FactParticipationUserGridMonthlyDTO> partiGridMonthlyList;
/**
* 机关(按日)注册用户数分析
*/
private List<FactRegUserAgencyDailyDTO> regAgencyDailyList;
/**
* 网格(按日)注册用户数分析
*/
private List<FactRegUserGridDailyDTO> regGridDailyList;
/**
* 机关(按月)注册用户数分析
*/
private List<FactRegUserAgencyMonthlyDTO> regAgencyMonthlyList;
/**
* 网格()注册用户数分析
*/
private List<FactRegUserGridMonthlyDTO> regGridMonthlyList;
/**
* 当前正在计算的客户id
*/
private String customerId;
/**
* yyyyMMdd
*/
private String dateId;
/**
* yyyyMM
*/
private String monthId;
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java

@ -21,6 +21,12 @@ public class StatsUserController {
@Autowired
private StatsUserService statsUserService;
/**
* @return com.epmet.commons.tools.utils.Result
* @param formDTO
* @description 工作端数据一期用户分析参与用户注册用户分析
* @Date 2021/3/26 13:27
**/
@RequestMapping("execute")
public Result execute(@RequestBody StatsFormDTO formDTO) {
statsUserService.partition(formDTO);

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java

@ -198,7 +198,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
try {
projectExtractService.extractProjectPeriodData(paramNew);
} catch (Exception e) {
log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
log.error("抽取【项目耗时数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java

@ -30,7 +30,6 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import org.apache.commons.lang3.StringUtils;
@ -236,6 +235,7 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
//1.评价周期内结案了的项目
List<ProjectParticipatedAgencyResultDTO> projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId);
Map<String, BigDecimal> efficiencyMap = new HashMap<>();
List<String> projects = new LinkedList<>();
if (!CollectionUtils.isEmpty(projectsHandledByAgency)) {
Map<String, List<String>> agencyProjectsMap = new HashMap<>();
@ -249,10 +249,9 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
}else{
agencyProjectsMap.get(agencyId).add(projectId);
}
projects.add(projectId);
});
List<String> projects = new LinkedList<>();
agencyProjectsMap.forEach((key,value) -> {projects.addAll(value);});
//2.结案项目的总耗时
List<ProjectParticipatedAgencyResultDTO> costTimes = baseDao.selectProjectCostTime(projects);

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -104,6 +104,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> {
String[] orgIds = dto.getPIdPath().split(StrConstant.COLON);
String org = "";
//取最短的ordIds中最后一个 则为最高级的那个orgIds
if (orgIds.length > NumConstant.ONE) {
org = orgIds[orgIds.length - 1];
} else {
@ -437,11 +438,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
formattingData.add(dest);
});
if(!CollectionUtils.isEmpty(formattingData)) {
List<String> projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList());
if (!CollectionUtils.isEmpty(projectIds)) {
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(null,param.getCustomerId());
factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData);
}
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java

@ -78,6 +78,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
//2.查询出客户下网格的相关信息
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
// list 转 map,以gridId为key,a = gridList,作为value,(o,n)->o 是遇到相同的gridId舍弃,(o,n)->n 是覆盖原来的gridId
Map<String,GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o));
//3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分)
@ -96,7 +97,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
}
}
final String finalDateId = dateId;
// 查询党员积分
Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId);
//剔除垃圾数据
@ -155,7 +156,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
//最近一次操作
Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId());
//图片
List<ProjectSourceMapFormDTO> projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
List<ProjectSourceMapFormDTO> projectSourceMap = difficulties.stream().map(diff->{
ProjectSourceMapFormDTO map = new ProjectSourceMapFormDTO();map.setProjectId(diff.getEventId());map.setSourceId(diff.getEventImgUrl());return map;
}).collect(Collectors.toList());
//factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
Map<String,List<ScreenDifficultyImgDataEntity>> imgMap = topicService.getTopicImgs(projectSourceMap);

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java

@ -69,7 +69,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
*/
@Override
public void extractScreenData(ScreenCentralZoneDataFormDTO param) {
//screen_project_data表是否存在此客户数据
int rows = targetDbService.checkIfExisted(param.getCustomerId());
//查找客户项目超期参数
List<ProjectExceedParamsResultDTO> exceedParams = projectService.getProjectExceedParams(param.getCustomerId());
Integer exceedLimit = NumConstant.FIVE;
Integer about2ExceedLimit = NumConstant.FIVE;
@ -92,6 +94,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit);
if(!CollectionUtils.isEmpty(metaData)) {
// 查询项目信息
List<ProjectEntity> info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList()));
if(!CollectionUtils.isEmpty(info)){
metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(),

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java

@ -66,7 +66,7 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDiffi
if (!CollectionUtils.isEmpty(imgs)) {
baseDao.insertBatchImg(imgs);
}
baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE));
//baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE));
}
/**

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ProjectConstant;
@ -58,17 +59,25 @@ public class StatsUserServiceImpl implements StatsUserService {
**/
@Override
public void partition(StatsFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getDate())){
//如果定时任务没有指定参数,默认数据更新至t-1,包含t-1这一天内的数据
formDTO.setDate(DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN));
}
int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED;
List<String> customerIdList = null;
Date date = null;
if (StringUtils.isNotBlank(formDTO.getDate())) {
//如果指定了参数,转化为yyyy-MM-dd格式
date = DateUtils.stringToDate(formDTO.getDate(), DateUtils.DATE_PATTERN);
}
if (StringUtils.isNotBlank(formDTO.getCustomerId())) {
generate(formDTO.getCustomerId(), date);
} else {
do {
//每100个客户一组
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
@ -90,6 +99,7 @@ public class StatsUserServiceImpl implements StatsUserService {
* @date 2020.06.28 14:40
**/
void generate(String customerId,Date date){
log.info("customerId:"+customerId+";date:"+DateUtils.format(date,DateUtils.DATE_TIME_PATTERN));
//1.初始化时间参数
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
@ -99,13 +109,11 @@ public class StatsUserServiceImpl implements StatsUserService {
calendar.set(Calendar.MINUTE, NumConstant.ZERO);
calendar.set(Calendar.SECOND, NumConstant.ZERO);
//2.初始化时间维度
//2.初始化时间维度{"dateId":"20210325","monthId":"202103","quarterId":"2021Q1","weekId":"2021W13","yearId":"2021"}
DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date);
log.info("timeDimension:"+ JSON.toJSONString(timeDimension));
//3.初始化机关维度
List<AgencySubTreeDto> agencies = dimAgencyService.getAllAgency(customerId);
//List<AgencySubTreeDto> topAgencies = dimAgencyService.getTopAgency(customerId);
//4.计算机关统计数据、生成唯一性统计数据
try {
UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension);

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java

@ -63,15 +63,17 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
//1.查询用户与党员数据,判断dimId是否为昨天,如果根据这个dimId没有查询出结果,则取前天的数据
//如果还是查不出数据,继续向下执行,这部分数据设置默认值
//注册用户数
//注册用户数 fact_reg_user_grid_daily 或 fact_reg_user_agency_daily agency级别
List<ScreenUserTotalDataEntity> result =
factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(result)){
// 根据dateId查询为空,先根据当前时间-1天是否和dateId相等,相等的话,查询往前推2天的数据
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
if(null == result) result = new LinkedList<>();
}
// 网格级别
List<ScreenUserTotalDataEntity> gridUserResult =
factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
@ -84,13 +86,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
result.addAll(gridUserResult);
}
//2.组
//2.组 fact_group_grid_daily 或 fact_group_agency_daily
List<ScreenUserTotalDataEntity> agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyGroup)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
}
// 网格级别
List<ScreenUserTotalDataEntity> gridGroup = factGroupGridDailyDao.selectGroupCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridGroup)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
@ -101,13 +104,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
groupMap.putAll(gridGroup.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getGroupTotal)));
//3.话题
//3.话题 fact_topic_total_grid_daily或fact_topic_total_agency_daily
List<ScreenUserTotalDataEntity> agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyTopic)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
}
// 网格级别
List<ScreenUserTotalDataEntity> gridTopic = factTopicTotalGridDailyDao.selectTopicCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridTopic)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
@ -117,13 +121,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
Map<String,Integer> topicMap = agencyTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal));
topicMap.putAll(gridTopic.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getTopicTotal)));
//4.议题
//4.议题 fact_issue_grid_daily 或 fact_issue_agency_daily
List<ScreenUserTotalDataEntity> agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyIssue)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
}
// 网格级别
List<ScreenUserTotalDataEntity> gridIssue = factIssueGridDailyDao.selectIssueCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridIssue)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
@ -133,13 +138,14 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon
Map<String,Integer> issueMap = agencyIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal));
issueMap.putAll(gridIssue.stream().collect(Collectors.toMap(ScreenUserTotalDataEntity::getOrgId,ScreenUserTotalDataEntity::getIssueTotal)));
//5.项目
//5.项目 fact_grid_project_daily 或 fact_agency_project_daily
List<ScreenUserTotalDataEntity> agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId);
if(CollectionUtils.isEmpty(agencyProject)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){
agencyProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO));
}
}
// 网格级别
List<ScreenUserTotalDataEntity> gridProject = factAgencyProjectDailyDao.selectProjectCountByOrgLevel(ORG_LEVEL_GRID,customerId,dimId);
if(CollectionUtils.isEmpty(gridProject)){
if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -74,7 +74,7 @@ public class TopicServiceImpl implements TopicService {
agencies.forEach(agency -> {
initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency);
});
//计算网格-组-话题映射关系
List<ResiGroupTopicResultDTO> topics = topicDao.selectGroupOrderByGrid(targetDate,customerId);
topics.forEach(groupTopic -> {
if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){

60
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -62,8 +62,8 @@ public class UserServiceImpl implements UserService {
dataPacket.setDateId(timeDimension.getDateId());
dataPacket.setMonthId(timeDimension.getMonthId());
//自上向下检索
Map<String, List<AgencySubTreeDto>> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId));
//subGridOfAgency key:agencyId ,value:当前组织下的所有网格(即直属网格+下级组织下的所有网格)
Map<String,Set<String>> subGridOfAgency = new HashMap<>();
agencies.forEach(agency -> {
initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency);
@ -71,12 +71,13 @@ public class UserServiceImpl implements UserService {
//对每一个机关进行数据统计
if(subGridOfAgency.size() > NumConstant.ZERO){
subGridOfAgency.forEach((k,v) -> {
//如果当前客户存在组织
subGridOfAgency.forEach((agencyId,subGridIds) -> {
queryUserData(ModuleConstant.DIM_SUB_AGENCY,
k,
(null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(k).get(NumConstant.ZERO).getPid(),
(null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? null : agencyMap.get(k).get(NumConstant.ZERO).getCustomerId(),
v,
agencyId,
// (null == agencyMap.get(agencyId) || agencyMap.get(agencyId).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(agencyId).get(NumConstant.ZERO).getPid(),
(null == agencyMap.get(agencyId) || agencyMap.get(agencyId).isEmpty()) ? null : agencyMap.get(agencyId).get(NumConstant.ZERO).getCustomerId(),
subGridIds,
targetDate,
dataPacket,
timeDimension);
@ -107,11 +108,11 @@ public class UserServiceImpl implements UserService {
//自上向下检索
Map<String, List<AgencySubTreeDto>> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId));
if(null != agencyMap && agencyMap.size() > NumConstant.ZERO){
agencyMap.forEach((k,v) -> {
agencyMap.forEach((agencyId,v) -> {
if(null != v && v.size() > NumConstant.ZERO){
queryUserData(ModuleConstant.DIM_BELONGING_GRID,
k,
v.get(NumConstant.ZERO).getPid(),
agencyId,
// v.get(NumConstant.ZERO).getPid(),
v.get(NumConstant.ZERO).getCustomerId(),
new HashSet<>(v.get(NumConstant.ZERO).getGridIds()),
targetDate,
@ -181,22 +182,22 @@ public class UserServiceImpl implements UserService {
/**
* @Description 初始化机关-所有下级网格Map
* @param pid - 固定一个机关Id
* @param agencyId - 当前组织id
* @param agency - AgencySubTreeDto
* @param subGridOfAgency - Map<String,Set<String>>
* @return
* @author wangc
* @date 2020.06.18 15:54
**/
void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map<String,Set<String>> subGridOfAgency){
void initAgencyGridMap(String agencyId, AgencySubTreeDto agency, Map<String,Set<String>> subGridOfAgency){
//向map中放入数据
if(subGridOfAgency.containsKey(pid)){
if(subGridOfAgency.containsKey(agencyId)){
//包含key
Set<String> grids = subGridOfAgency.get(pid);
Set<String> grids = subGridOfAgency.get(agencyId);
if(null == grids){
grids = new HashSet<>();
subGridOfAgency.put(pid,grids);
subGridOfAgency.put(agencyId,grids);
}
if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){
grids.addAll(agency.getGridIds());
@ -204,18 +205,20 @@ public class UserServiceImpl implements UserService {
}else{
//不包含key
Set<String> grids = new HashSet<>(agency.getGridIds());
subGridOfAgency.put(pid,grids);
subGridOfAgency.put(agencyId,grids);
}
//外层是从顶级组织向下循环,所以循环到社区时跳出
//定义递归出口
if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){
return ;
if (StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY, agency.getLevel())
|| null == agency.getSubAgencies()
|| agency.getSubAgencies().size() == NumConstant.ZERO) {
return;
}
//定义递归入口
agency.getSubAgencies().forEach(obj -> {
initAgencyGridMap(pid,obj,subGridOfAgency);
initAgencyGridMap(agencyId,obj,subGridOfAgency);
});
}
@ -223,7 +226,7 @@ public class UserServiceImpl implements UserService {
* @Description 执行查询用户数据统计的逻辑
* @param relation - agency(下级机关加网格) | grid(直属网格)
* @param agencyId
* @param pid
* @param //pid 当前agency的父级组织id
* @param customerId
* @param gridIds - 机关下所有网格集合/机关下直属网格集合
* @param targetDate
@ -233,10 +236,12 @@ public class UserServiceImpl implements UserService {
* @author wangc
* @date 2020.06.19 10:01
**/
void queryUserData(String relation, String agencyId, String pid, String customerId, Set<String> gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){
if(StringUtils.isBlank(pid))
pid = NumConstant.ZERO_STR;
void queryUserData(String relation, String agencyId,
// String pid,
String customerId, Set<String> gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){
//pid没用到还传过来干啥-- 注释掉
// if(StringUtils.isBlank(pid))
// pid = NumConstant.ZERO_STR;
dataPacket.setCustomerId(customerId);
@ -253,6 +258,9 @@ public class UserServiceImpl implements UserService {
//指定日期 OR T-1
calendar.setTime(targetDateCheck);
//calendar.get(Calendar.DATE) 当前日期数eg:2021-03-29 :29
//calendar.getActualMinimum(Calendar.DAY_OF_MONTH) :1
//如果目标日期不是是当月的第一天
if(calendar.get(Calendar.DATE) != calendar.getActualMinimum(Calendar.DAY_OF_MONTH)){
//求出这个月的第一天
@ -264,7 +272,6 @@ public class UserServiceImpl implements UserService {
isMonthBeginning = false;
}
if(StringUtils.equals(ModuleConstant.DIM_SUB_AGENCY,relation)){
@ -396,8 +403,6 @@ public class UserServiceImpl implements UserService {
partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion());
partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT);
//如果是月初第一天,不再做日期区间查询
if(isMonthBeginning) {
if (null == dataPacket.getRegAgencyMonthlyList()) {
@ -416,6 +421,7 @@ public class UserServiceImpl implements UserService {
}
}else{
//如果不是月初第一天
//targetDateCheck:定时任务参数中的date;calendar.getTime():date所属月第一天;
//本月注册用户增长数
Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck);

17
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -165,7 +165,7 @@
AGENCY_ID,
COUNT(DISTINCT PROJECT_ID) AS count
FROM
fact_origin_project_log_daily
fact_origin_project_log_daily log
WHERE DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND IS_ACTIVE = '0'
@ -173,13 +173,14 @@
AND MONTH_ID = #{dimId}
AND NOT EXISTS(
SELECT ID
FROM fact_origin_project_log_daily
FROM fact_origin_project_log_daily innerLog
WHERE DEL_FLAG = '0'
AND MONTH_ID <![CDATA[ < ]]> #{dimId}
AND IS_ACTIVE = '0'
AND log.project_id = innerLog.project_id
<if test="agencies != null and agencies.size() > 0">
<foreach collection="agencies" item="agencyId" open="AND (" close=" )" separator=" OR ">
AGENCY_ID = #{agencyId}
innerLog.AGENCY_ID = #{agencyId}
</foreach>
</if>
)
@ -198,15 +199,19 @@
COUNT(DISTINCT log.PROJECT_ID) AS count
FROM
fact_origin_project_log_daily log
LEFT JOIN fact_origin_project_main_daily project ON log.PROJECT_ID = project.ID AND project.DEL_FLAG = '0' AND project.CUSTOMER_ID = #{customerId}
WHERE log.DEL_FLAG = '0'
AND project.PROJECT_STATUS LIKE 'close%'
AND log.CUSTOMER_ID = #{customerId}
AND log.IS_ACTIVE = '0'
<if test='null != dimId and "" != dimId.trim()'>
AND log.MONTH_ID = #{dimId}
AND EXISTS (
select innerLog.id from fact_origin_project_log_daily innerLog where innerLog.del_flag = '0'
and innerLog.customer_id = #{customerId} and innerLog.month_id = #{dimId}
and innerLog.action_code like 'close%'
and innerLog.project_id = log.project_id
)
</if>
<if test="agencies != null and agencies.size() > 0">
<foreach collection="agencies" item="agencyId" open="AND (" close=" )" separator=" OR ">
log.AGENCY_ID = #{agencyId}

42
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -335,6 +335,7 @@
gridInfo.allParentIds
FROM
fact_origin_project_main_daily project
<!--获取部门名称路径相关信息-->
LEFT JOIN (
SELECT
grid.ID AS dimGridId,
@ -368,7 +369,9 @@
grid.DEL_FLAG = '0'
AND grid.CUSTOMER_ID = #{customerId}
) gridInfo ON project.GRID_ID = gridInfo.dimGridId
<!--获取经过处理的部门数-->
LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID
<!--获取事件被处理次数-->
LEFT JOIN (
SELECT
PROJECT_ID,
@ -387,31 +390,34 @@
AND project.CUSTOMER_ID = #{customerId}
AND project.ID IN (
<!--如果项目的某一个或几个节点超过了 项目超期时间 则算难点堵点-->
SELECT DISTINCT
period.project_id
FROM
fact_origin_project_org_period_daily period
LEFT JOIN
(
SELECT
project.ID AS projectId,
IF(project.project_status = 'closed',period.handled_date,NOW()) AS finishDate
FROM fact_origin_project_main_daily project LEFT JOIN fact_origin_project_org_period_daily period
ON project.ID = period.project_id AND period.del_flag = '0' AND period.customer_id = #{customerId}
AND period.operation = 'close'
WHERE project.customer_id = #{customerId} AND project.del_flag = '0'
) projectFinishDate ON projectFinishDate.projectId = period.project_id
WHERE
period.del_flag = '0'
<!--如果项目结案 则按照结案时间,否则是当前时间 作为节点的处理时长-->
<!--项目结案时间-->
SELECT
project.ID AS projectId,
IFNULL(period.handled_date,NOW()) AS finishDate
FROM
fact_origin_project_main_daily project
LEFT JOIN fact_origin_project_org_period_daily period ON project.ID = period.project_id
AND period.del_flag = '0'
AND period.customer_id = #{customerId}
AND TIMESTAMPDIFF( DAY, period.informed_date, projectFinishDate.finishDate) > #{thresholdValue}
)
AND period.operation = 'close'
WHERE
project.customer_id = #{customerId}
AND project.del_flag = '0'
) projectFinishDate ON projectFinishDate.projectId = period.project_id
WHERE
period.del_flag = '0'
AND period.customer_id = #{customerId}
AND TIMESTAMPDIFF( DAY, period.informed_date, IFNULL(period.handled_date,projectFinishDate.finishDate)) > #{thresholdValue}
)
</select>
<!-- 查询当天新立的项目,是为了增量新增难点赌点的图片库 -->
@ -569,4 +575,4 @@
</choose>
</select>
</mapper>
</mapper>

54
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -40,11 +40,13 @@
</choose>
<choose>
<!-- 不为空,默认查询创建时间在 昨天的增量 -->
<when test='null != targetDate'>
AND CREATED_TIME <![CDATA[>=]]> #{targetDate} AND CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY)
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<!-- 为空,默认查询昨天的增量 -->
<otherwise>
AND CREATED_TIME <![CDATA[<]]> CURDATE( ) AND CREATED_TIME <![CDATA[>=]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY )
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT( DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
) AS incr
@ -76,11 +78,13 @@
</otherwise>
</choose>
<choose>
<!-- 不为空,包含传进来的这一天 -->
<when test="null != targetDate">
AND CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY )
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<!-- 为空,默认截止到昨天 -->
<otherwise>
AND CREATED_TIME <![CDATA[<]]> CURDATE( )
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
@ -121,10 +125,10 @@
<choose>
<when test='null != targetDate'>
AND CREATED_TIME <![CDATA[>=]]> #{targetDate} AND CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY)
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<otherwise>
AND CREATED_TIME <![CDATA[<]]> CURDATE( ) AND CREATED_TIME <![CDATA[>=]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY )
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
</select>
@ -164,10 +168,10 @@
<choose>
<when test='targetDate != null'>
AND CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY )
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<otherwise>
AND CREATED_TIME <![CDATA[<]]> CURDATE( )
and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
</select>
@ -190,10 +194,10 @@
</foreach>
<choose>
<when test='null != targetDate'>
AND urole.CREATED_TIME <![CDATA[>=]]> #{targetDate} AND urole.CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY)
and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<otherwise>
AND urole.CREATED_TIME <![CDATA[<]]> CURDATE( ) AND urole.CREATED_TIME <![CDATA[>=]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY )
and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
@ -221,10 +225,10 @@
<choose>
<when test='null != targetDate'>
AND urole.CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY )
and DATE_FORMAT( urole.CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<otherwise>
AND urole.CREATED_TIME <![CDATA[<]]> CURDATE( )
and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
AND erole.ROLE_NAME = '党员'
@ -261,10 +265,10 @@
<choose>
<when test='null != targetDate'>
AND urole.CREATED_TIME <![CDATA[>=]]> #{targetDate} AND urole.CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY)
and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d")=DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<otherwise>
AND urole.CREATED_TIME <![CDATA[<]]> CURDATE( ) AND urole.CREATED_TIME <![CDATA[>=]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY )
and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d")=DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
AND erole.ROLE_NAME = '热心居民'
@ -290,10 +294,10 @@
</foreach>
<choose>
<when test='null != targetDate'>
AND urole.CREATED_TIME <![CDATA[<]]> DATE_SUB( #{targetDate}, INTERVAL - 1 DAY )
and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(#{targetDate},"%Y-%m-%d")
</when>
<otherwise>
AND urole.CREATED_TIME <![CDATA[<]]> CURDATE( )
and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") <![CDATA[<=]]> DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d")
</otherwise>
</choose>
AND erole.ROLE_NAME = '热心居民';
@ -332,8 +336,8 @@
</foreach>
</otherwise>
</choose>
AND CREATED_TIME <![CDATA[>=]]> #{startDate} AND CREATED_TIME <![CDATA[<]]> DATE_SUB( #{endDate}, INTERVAL - 1 DAY)
AND CREATED_TIME <![CDATA[>=]]> DATE_FORMAT(#{startDate},"%Y-%m-%d")
AND CREATED_TIME <![CDATA[<=]]> DATE_FORMAT(#{endDate},"%Y-%m-%d")
</select>
<!-- 查询指定时间范围内居民增量 传参:注册用户or参与用户 | 网格Id集合 | 时间区间-->
@ -368,10 +372,8 @@
</foreach>
</otherwise>
</choose>
AND CREATED_TIME <![CDATA[>=]]> #{startDate} AND CREATED_TIME <![CDATA[<]]> DATE_SUB( #{endDate}, INTERVAL - 1 DAY)
AND CREATED_TIME <![CDATA[>=]]> DATE_FORMAT(#{startDate},"%Y-%m-%d")
AND CREATED_TIME <![CDATA[<=]]> DATE_FORMAT(#{endDate},"%Y-%m-%d")
</select>
<!-- 查询指定时间范围内党员的增量 传参:用户Id集合 | 时间区间 -->
@ -394,9 +396,8 @@
</foreach>
</otherwise>
</choose>
AND urole.CREATED_TIME <![CDATA[>=]]> #{startDate} AND urole.CREATED_TIME <![CDATA[<]]> DATE_SUB( #{endDate}, INTERVAL - 1 DAY)
AND urole.CREATED_TIME <![CDATA[>=]]> DATE_FORMAT(#{startDate},"%Y-%m-%d")
AND urole.CREATED_TIME <![CDATA[<=]]> DATE_FORMAT(#{endDate},"%Y-%m-%d")
AND erole.ROLE_NAME = '党员'
</select>
@ -423,7 +424,8 @@
</foreach>
</otherwise>
</choose>
AND urole.CREATED_TIME <![CDATA[>=]]> #{startDate} AND urole.CREATED_TIME <![CDATA[<]]> DATE_SUB( #{endDate}, INTERVAL - 1 DAY)
AND urole.CREATED_TIME <![CDATA[>=]]> DATE_FORMAT(#{startDate},"%Y-%m-%d")
AND urole.CREATED_TIME <![CDATA[<=]]> DATE_FORMAT(#{endDate},"%Y-%m-%d")
AND erole.ROLE_NAME = '热心居民'
</select>

6
epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java

@ -8,7 +8,6 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -55,7 +54,6 @@ public class ActModelController {
@PostMapping
@ApiOperation("新增模型")
@LogOperation("新增模型")
public Result save(@RequestBody ModelDTO dto) throws Exception{
//效验数据
ValidatorUtils.validateEntity(dto);
@ -67,7 +65,6 @@ public class ActModelController {
@PostMapping("deploy/{id}")
@ApiOperation("部署")
@LogOperation("部署")
public Result deploy(@PathVariable("id") String id) {
actModelService.deploy(id);
return new Result();
@ -75,14 +72,12 @@ public class ActModelController {
@GetMapping("export/{id}")
@ApiOperation("导出")
@LogOperation("导出")
public void export(@PathVariable("id") String id, @ApiIgnore HttpServletResponse response) {
actModelService.export(id, response);
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
public Result delete(@RequestBody String[] ids) {
for(String id : ids) {
actModelService.delete(id);
@ -92,7 +87,6 @@ public class ActModelController {
@GetMapping("image/{deploymentId}")
@ApiOperation(value = "查看流程图", produces="application/octet-stream")
@LogOperation("查看流程图")
public void viewDeployImage(@PathVariable("deploymentId") String deploymentId, @ApiIgnore HttpServletResponse response){
actModelService.deployImage(deploymentId, response);
}

6
epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java

@ -8,7 +8,6 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.page.PageData;
@ -82,7 +81,6 @@ public class ActProcessController {
@PostMapping("deploy")
@ApiOperation("部署流程文件")
@LogOperation("部署流程文件")
@ApiImplicitParam(name = "processFile", value = "流程文件", paramType = "query", dataType="file")
public Result deploy(@RequestParam("processFile") MultipartFile file) throws IOException {
if (file.isEmpty()) {
@ -95,7 +93,6 @@ public class ActProcessController {
}
@PutMapping("active/{id}")
@LogOperation("激活流程")
public Result active(@PathVariable("id") String id) {
actProcessService.active(id);
@ -104,7 +101,6 @@ public class ActProcessController {
@PutMapping("suspend/{id}")
@ApiOperation("挂起流程")
@LogOperation("挂起流程")
public Result suspend(@PathVariable("id") String id) {
actProcessService.suspend(id);
@ -113,7 +109,6 @@ public class ActProcessController {
@PostMapping("convertToModel/{id}")
@ApiOperation("将部署的流程转换为模型")
@LogOperation("将部署的流程转换为模型")
public Result convertToModel(@PathVariable("id") String id) throws Exception {
actProcessService.convertToModel(id);
@ -122,7 +117,6 @@ public class ActProcessController {
@DeleteMapping
@ApiOperation("删除流程")
@LogOperation("删除流程")
public Result delete(@RequestBody String[] deploymentIds) {
for(String deploymentId : deploymentIds) {
actProcessService.deleteDeployment(deploymentId);

4
epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java

@ -8,7 +8,6 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -53,7 +52,6 @@ public class ActRunningController {
@DeleteMapping("{id}")
@ApiOperation("删除")
@LogOperation("删除")
@ApiImplicitParam(name = "id", value = "ID", paramType = "query", dataType="String")
public Result deleteInstance(@PathVariable("id") String id) {
actRunningService.delete(id);
@ -62,7 +60,6 @@ public class ActRunningController {
@PostMapping("start")
@ApiOperation("启动流程实例,依据流程定义KEY,启动流程实例")
@LogOperation("启动流程实例,依据流程定义KEY,启动流程实例")
@ApiImplicitParam(name = "key", value = "流程定义标识key", paramType = "query", dataType="String")
public Result<ProcessInstanceDTO> start(String key){
ProcessInstanceDTO dto = actRunningService.startProcess(key);
@ -71,7 +68,6 @@ public class ActRunningController {
@PostMapping("startOfBusinessKey")
@ApiOperation("启动流程实例,依据流程定义ID和业务唯一标示启动实例")
@LogOperation("启动流程实例,依据流程定义ID和业务唯一标示启动实例")
public Result<ProcessInstanceDTO> startOfBusinessKey(@RequestBody ProcessStartDTO processStartDTO){
ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO);
return new Result().ok(dto);

2
epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java

@ -1,6 +1,5 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.page.PageData;
@ -82,7 +81,6 @@ public class ActTaskController {
*/
@GetMapping("task/{id}")
@ApiOperation("获取任务详情")
@LogOperation("获取任务详情")
public Result getTaskById(@PathVariable("id") String id){
TaskDTO task = actTaskService.taskDetail(id);
return new Result().ok(task);

5
epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java

@ -1,6 +1,5 @@
package com.epmet.demo.controller;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -59,7 +58,6 @@ public class CorrectionController {
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
public Result save(@RequestBody CorrectionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
@ -72,7 +70,6 @@ public class CorrectionController {
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
public Result update(@RequestBody CorrectionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
@ -84,7 +81,6 @@ public class CorrectionController {
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
@ -96,7 +92,6 @@ public class CorrectionController {
@PostMapping("updateInstanceId")
@ApiOperation("更新实例ID")
@LogOperation("更新实例ID")
@ApiImplicitParams({
@ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType="String"),
@ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query",required = true, dataType="String")

21
epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/3/29 15:26
*/
@Data
public class CustomerRoleResultDTO implements Serializable {
private static final long serialVersionUID = 4933114432141586045L;
private String roleName;
private String roleKey;
private String roleId;
private Boolean fullTimeOnly;
}

13
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java

@ -147,5 +147,18 @@ public class OpenUpController {
ValidatorUtils.validateEntity(formDTO);
return new Result<StaffPermissionResultDTO>().ok(openUpService.queryStaffPermissionV2(formDTO));
}
/**
* @return
* @param formDTO 客户id
* @author yinzuomei
* @description 010获取当前客户下-工作端角色列表
* @Date 2021/3/29 15:25
**/
@PostMapping("govrolelist")
public Result<List<CustomerRoleResultDTO>> queryCustomerGovRoleList(@RequestBody CustomerInfoQueryFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return new Result<List<CustomerRoleResultDTO>>().ok(openUpService.queryCustomerGovRoleList(formDTO.getCustomerId()));
}
}

9
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java

@ -62,4 +62,13 @@ public interface OpenUpService {
* @Date 2021/2/3 20:59
**/
StaffPermissionResultDTO queryStaffPermissionV2(StaffPermissionFormDTO formDTO);
/**
* @return java.util.List<com.epmet.dto.result.CustomerRoleResultDTO>
* @param customerId
* @author yinzuomei
* @description 010获取当前客户下-工作端角色列表
* @Date 2021/3/29 15:27
**/
List<CustomerRoleResultDTO> queryCustomerGovRoleList(String customerId);
}

17
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java

@ -210,4 +210,21 @@ public class OpenUpServiceImpl implements OpenUpService {
return resultDTO;
}
/**
* @param customerId
* @return java.util.List<com.epmet.dto.result.CustomerRoleResultDTO>
* @author yinzuomei
* @description 010获取当前客户下-工作端角色列表
* @Date 2021/3/29 15:27
**/
@Override
public List<CustomerRoleResultDTO> queryCustomerGovRoleList(String customerId) {
Result<List<RoleInfoResultDTO>> userRes = epmetUserOpenFeignClient.queryCustomerGovRoleList(customerId);
if (!userRes.success() || CollectionUtils.isEmpty(userRes.getData())) {
log.error(String.format("获取当前客户下,工作端角色列表失败,customerId:%s", customerId));
return new ArrayList<>();
}
return ConvertUtils.sourceToTarget(userRes.getData(), CustomerRoleResultDTO.class);
}
}

19
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java

@ -8,7 +8,6 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
@ -66,8 +65,7 @@ public class ScheduleJobController {
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
public Result save(@RequestBody ScheduleJobDTO dto){
public Result save(@RequestBody ScheduleJobDTO dto){
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
scheduleJobService.save(dto);
@ -77,8 +75,7 @@ public class ScheduleJobController {
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
public Result update(@RequestBody ScheduleJobDTO dto){
public Result update(@RequestBody ScheduleJobDTO dto){
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
scheduleJobService.update(dto);
@ -88,8 +85,7 @@ public class ScheduleJobController {
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
public Result delete(@RequestBody Long[] ids){
public Result delete(@RequestBody Long[] ids){
scheduleJobService.deleteBatch(ids);
return new Result();
@ -97,8 +93,7 @@ public class ScheduleJobController {
@PutMapping("/run")
@ApiOperation("立即执行")
@LogOperation("立即执行")
public Result run(@RequestBody Long[] ids){
public Result run(@RequestBody Long[] ids){
scheduleJobService.run(ids);
return new Result();
@ -106,8 +101,7 @@ public class ScheduleJobController {
@PutMapping("/pause")
@ApiOperation("暂停")
@LogOperation("暂停")
public Result pause(@RequestBody Long[] ids){
public Result pause(@RequestBody Long[] ids){
scheduleJobService.pause(ids);
return new Result();
@ -115,8 +109,7 @@ public class ScheduleJobController {
@PutMapping("/resume")
@ApiOperation("恢复")
@LogOperation("恢复")
public Result resume(@RequestBody Long[] ids){
public Result resume(@RequestBody Long[] ids){
scheduleJobService.resume(ids);
return new Result();

1
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java

@ -9,7 +9,6 @@
package com.epmet.controller;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LogOperation;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;

16
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/3/30 9:51
*/
@Data
public class RemoveFileFormDTO implements Serializable {
private static final long serialVersionUID = 3889369412733647229L;
private String url;
}

6
epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -12,4 +13,9 @@ import java.io.Serializable;
@Data
public class UploadImgResultDTO implements Serializable {
private String url;
/**
* 域名
*/
@JsonIgnore
private String domain;
}

8
epmet-module/epmet-oss/epmet-oss-server/pom.xml

@ -14,8 +14,7 @@
<properties>
<qiniu.version>7.2.22</qiniu.version>
<aliyun.oss.version>2.8.3</aliyun.oss.version>
<aliyun.core.version>3.2.2</aliyun.core.version>
<aliyun.oss.version>3.10.2</aliyun.oss.version>
<qcloud.cos.version>5.4.4</qcloud.cos.version>
<fastdfs.version>1.26.2</fastdfs.version>
</properties>
@ -82,11 +81,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>${aliyun.core.version}</version>
</dependency>
<dependency>
<groupId>com.github.tobato</groupId>
<artifactId>fastdfs-client</artifactId>

21
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java

@ -25,7 +25,17 @@ import java.util.UUID;
public abstract class AbstractCloudStorageService {
/** 云存储配置信息 */
CloudStorageConfig config;
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJun
* @date 2021/3/30 10:05 上午
*/
public String getOssDomain(String privacy){
return null;
};
/**
* 文件路径
* @param prefix 前缀
@ -97,4 +107,13 @@ public abstract class AbstractCloudStorageService {
*/
public abstract void down(String privacyType) throws IOException;
/**
* 文件删除
* @author zhaoqifeng
* @date 2021/3/30 11:05
* @param objectName
* @return boolean
*/
public abstract boolean delete(String objectName, String privacyType);
}

74
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java

@ -8,7 +8,9 @@
package com.epmet.cloud;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.DownloadFileRequest;
import com.aliyun.oss.model.DownloadFileResult;
import com.epmet.commons.tools.exception.RenException;
@ -26,17 +28,44 @@ import java.io.InputStream;
*/
public class AliyunCloudStorageService extends AbstractCloudStorageService {
private OSS internalClient = null;
private OSS externalClient = null;
public AliyunCloudStorageService(CloudStorageConfig config){
this.config = config;
}
/**
* @Description 根据隐私类型获取属性传递internal的时候会返回内部的否则返回外部的即公开的
* @Description 根据隐私类型获取属性获取client
* @return
* @author wxz
* @date 2021.01.04 13:49
*/
private CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) {
public OSS getOssClient(String privacyType) {
if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) {
if (internalClient == null){
CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getInternal();
internalClient = new OSSClientBuilder().build(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(),
props.getAliyunAccessKeySecret());
}
return internalClient;
} else {
if (externalClient == null) {
CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getExternal();
externalClient = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(),
props.getAliyunAccessKeySecret());
}
return externalClient;
}
}
/**
* @Description 根据隐私类型获取属性传递internal的时候会返回内部的否则返回外部的即公开的
* @return
* @author wxz
* @date 2021.01.04 13:49
*/
public CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) {
if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) {
return config.getAliyun().getInternal();
} else {
@ -44,6 +73,23 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
}
}
/**
* desc: 获取oss域名
*
* @param privacy
* @return java.lang.String
* @author LiuJanJun
* @date 2021/3/30 10:05 上午
*/
@Override
public String getOssDomain(String privacy) {
if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) {
return config.getAliyun().getInternal().getAliyunDomain();
} else {
return config.getAliyun().getExternal().getAliyunDomain();
}
}
@Override
public String upload(byte[] data, String path, String privacyType) {
return upload(new ByteArrayInputStream(data), path, privacyType);
@ -52,11 +98,10 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
@Override
public String upload(InputStream inputStream, String path, String privacyType) {
CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType);
OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(),
props.getAliyunAccessKeySecret());
OSS client = getOssClient(privacyType);
try {
client.putObject(props.getAliyunBucketName(), path, inputStream);
client.shutdown();
//client.shutdown();
} catch (Exception e){
throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, "");
}
@ -64,6 +109,20 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
return props.getAliyunDomain() + "/" + path;
}
@Override
public boolean delete(String objectName,String privacyType) {
CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType);
OSS client = getOssClient(privacyType);
try {
client.deleteObject(props.getAliyunBucketName(), objectName);
//client.shutdown();
} catch (Exception e){
return false;
}
return true;
}
@Override
public String uploadSuffix(byte[] data, String suffix, String privacyType) {
CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType);
@ -79,8 +138,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
@Override
public void down(String privacyType) throws IOException {
CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType);
OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(),
props.getAliyunAccessKeySecret());
OSS client = getOssClient(privacyType);
try {
/*
@ -118,7 +176,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService {
downloadRes.getObjectMetadata();
// 关闭OSSClient。
client.shutdown();
//client.shutdown();
} catch (Exception e){
throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, "");
} catch (Throwable throwable) {

14
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java

@ -65,4 +65,18 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService {
public void down(String privacyType) throws IOException {
}
/**
* 文件删除
*
* @param objectName
* @param privacyType
* @return boolean
* @author zhaoqifeng
* @date 2021/3/30 11:05
*/
@Override
public boolean delete(String objectName, String privacyType) {
return false;
}
}

14
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java

@ -58,4 +58,18 @@ public class LocalCloudStorageService extends AbstractCloudStorageService {
public void down(String privacyType) throws IOException {
}
/**
* 文件删除
*
* @param objectName
* @param privacyType
* @return boolean
* @author zhaoqifeng
* @date 2021/3/30 11:05
*/
@Override
public boolean delete(String objectName, String privacyType) {
return false;
}
}

31
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java

@ -20,28 +20,29 @@ import com.epmet.utils.ModuleConstant;
*/
public final class OssFactory {
private static ParamsRemoteService paramsRemoteService;
private static AbstractCloudStorageService abstractCloudStorageService;
static {
OssFactory.paramsRemoteService = SpringContextUtils.getBean(ParamsRemoteService.class);
}
public static AbstractCloudStorageService build(){
//获取云存储配置信息
CloudStorageConfig config = paramsRemoteService.getValueObject(ModuleConstant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class);
if(config.getType() == OssTypeEnum.QINIU.value()){
return new QiniuCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.ALIYUN.value()){
return new AliyunCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.QCLOUD.value()){
return new QcloudCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.FASTDFS.value()){
return new FastDFSCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.LOCAL.value()){
return new LocalCloudStorageService(config);
if (abstractCloudStorageService == null){
//获取云存储配置信息
CloudStorageConfig config = paramsRemoteService.getValueObject(ModuleConstant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class);
if(config.getType() == OssTypeEnum.QINIU.value()){
abstractCloudStorageService = new QiniuCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.ALIYUN.value()){
abstractCloudStorageService = new AliyunCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.QCLOUD.value()){
abstractCloudStorageService = new QcloudCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.FASTDFS.value()){
abstractCloudStorageService = new FastDFSCloudStorageService(config);
}else if(config.getType() == OssTypeEnum.LOCAL.value()){
abstractCloudStorageService = new LocalCloudStorageService(config);
}
}
return null;
return abstractCloudStorageService;
}
}

14
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java

@ -88,4 +88,18 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService {
public void down(String privacyType) throws IOException {
}
/**
* 文件删除
*
* @param objectName
* @param privacyType
* @return boolean
* @author zhaoqifeng
* @date 2021/3/30 11:05
*/
@Override
public boolean delete(String objectName, String privacyType) {
return false;
}
}

14
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java

@ -82,4 +82,18 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService {
public void down(String privacyType) throws IOException {
}
/**
* 文件删除
*
* @param objectName
* @param privacyType
* @return boolean
* @author zhaoqifeng
* @date 2021/3/30 11:05
*/
@Override
public boolean delete(String objectName, String privacyType) {
return false;
}
}

65
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -11,15 +11,19 @@ package com.epmet.controller;
import com.epmet.cloud.CloudStorageConfig;
import com.epmet.cloud.OssFactory;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AliyunGroup;
import com.epmet.commons.tools.validator.group.QcloudGroup;
import com.epmet.commons.tools.validator.group.QiniuGroup;
import com.epmet.dto.UploadDTO;
import com.epmet.dto.form.RemoveFileFormDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.OssEntity;
import com.epmet.enums.OssTypeEnum;
@ -32,6 +36,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -62,6 +67,8 @@ public class OssController {
private OssService ossService;
@Autowired
private ParamsRemoteService paramsRemoteService;
@Autowired
private RedisUtils redisUtils;
private final static String KEY = ModuleConstant.CLOUD_STORAGE_CONFIG_KEY;
@ -205,26 +212,55 @@ public class OssController {
return ossService.uploadImg(file, null);
}
/**
* desc: 党建声音模块 上传图片2M或附件5M
*
* @param file
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.UploadImgResultDTO>
* @author LiuJanJun
* @date 2021/3/29 4:56 下午
*/
@PostMapping("article/upload")
public Result<UploadImgResultDTO> uploadArticleImg(@RequestParam("file") MultipartFile file) {
// 校验文件类型
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType())
&& !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) ) {
log.error("uploadArticleImg file type:{} is not support 2 upload",file.getContentType() == null? null:file.getContentType());
// 校验文件类型 图片或pdf
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType())
&& !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType())
&& !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType())
&& !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) {
log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType());
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());
}
// 校验文件体积,不超过2m
long maxSize = 2 * 1024 * 1024;
long size = file.getSize();
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
if (ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) {
// 校验文件大小,不超过5m
long maxSize = 5 * 1024 * 1024;
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
} else {
// 校验文件大小,不超过2m
long maxSize = 2 * 1024 * 1024;
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
}
return ossService.uploadImg(file, null);
Result<UploadImgResultDTO> result = ossService.uploadImg(file, null);
if (result != null && result.success() ){
UploadImgResultDTO data = result.getData();
if ( data!= null && StringUtils.isNotBlank(data.getUrl())){
String path = data.getUrl().replace(data.getDomain(), StrConstant.EPMETY_STR);
if (path.startsWith(StrConstant.SEPARATOR)){
path = path.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR);
}
String fileName = data.getUrl().substring(data.getUrl().lastIndexOf(StrConstant.SEPARATOR)+1);
redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE);
}
}
return result;
}
@ -321,4 +357,9 @@ public class OssController {
return ossService.uploadVoice(file);
}
@PostMapping("article/remove/file")
public Result<Boolean> articleRemoveFile(@RequestBody RemoveFileFormDTO formDTO) {
return new Result<Boolean>().ok(ossService.articleRemoveFile(formDTO));
}
}

4
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java

@ -11,6 +11,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.OssEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 文件上传
@ -19,5 +20,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface OssDao extends BaseDao<OssEntity> {
OssEntity selectByUrl(@Param("url") String url);
void deleteDataById(@Param("id") String id);
}

10
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java

@ -11,6 +11,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.RemoveFileFormDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.OssEntity;
import org.springframework.web.multipart.MultipartFile;
@ -35,4 +36,13 @@ public interface OssService extends BaseService<OssEntity> {
Result<UploadImgResultDTO> uploadVariedFile(MultipartFile file);
Result<UploadImgResultDTO> uploadVoice(MultipartFile file);
/**
* 删除附件
* @author zhaoqifeng
* @date 2021/3/30 9:55
* @param formDTO
* @return boolean
*/
boolean articleRemoveFile(RemoveFileFormDTO formDTO);
}

62
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java

@ -8,23 +8,31 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.cloud.AbstractCloudStorageService;
import com.epmet.cloud.OssFactory;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.PrivacyType;
import com.epmet.dao.OssDao;
import com.epmet.dto.form.RemoveFileFormDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.OssEntity;
import com.epmet.exception.ModuleErrorCode;
import com.epmet.service.OssService;
import org.apache.commons.io.FilenameUtils;
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.web.multipart.MultipartFile;
@ -34,6 +42,10 @@ import java.util.Map;
@Service
public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implements OssService {
private static final Logger logger = LoggerFactory.getLogger(OssServiceImpl.class);
@Autowired
private RedisUtils redisUtils;
@Override
public PageData<OssEntity> page(Map<String, Object> params) {
IPage<OssEntity> page = baseDao.selectPage(
@ -56,21 +68,26 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
//上传文件
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
String url = null;
String ossDomain = null;
try {
url = OssFactory.build().uploadSuffix(file.getBytes(), extension, privacy);
AbstractCloudStorageService storageService = OssFactory.build();
url = storageService.uploadSuffix(file.getBytes(), extension, privacy);
ossDomain = storageService.getOssDomain(privacy);
} catch (IOException e) {
e.printStackTrace();
logger.error("图片上传异常");
logger.error("图片上传异常", e);
throw new RenException("图片上传异常");
}
//保存文件信息
OssEntity ossEntity = new OssEntity();
ossEntity.setUrl(url);
baseDao.insert(ossEntity);
//文件信息
UploadImgResultDTO dto = new UploadImgResultDTO();
dto.setUrl(url);
dto.setDomain(ossDomain);
return new Result<UploadImgResultDTO>().ok(dto);
}
@ -117,8 +134,7 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
try {
url = OssFactory.build().uploadSuffix(file.getBytes(), extension, PrivacyType.INTERNAL);
} catch (IOException e) {
e.printStackTrace();
logger.error("文件上传异常");
logger.error("文件上传异常", e);
throw new RenException("文件上传异常");
}
//保存文件信息
@ -148,13 +164,13 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
try {
url = OssFactory.build().uploadSuffix(file.getBytes(), extension, null);
} catch (IOException e) {
e.printStackTrace();
logger.error("语音上传异常");
logger.error("语音上传异常", e);
throw new RenException("语音上传异常");
}
//保存文件信息
OssEntity ossEntity = new OssEntity();
ossEntity.setUrl(url);
baseDao.insert(ossEntity);
//文件信息
@ -163,4 +179,36 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
return new Result<UploadImgResultDTO>().ok(dto);
}
/**
* 删除附件
*
* @return boolean
* @author zhaoqifeng
* @date 2021/3/30 9:55
* @param formDTO
*/
@Override
public boolean articleRemoveFile(RemoveFileFormDTO formDTO) {
logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO));
if (StringUtils.isBlank(formDTO.getUrl())){
logger.warn("articleRemoveFile param is empty");
return false;
}
String key = RedisKeys.getOssFileKey(formDTO.getUrl().substring(formDTO.getUrl().lastIndexOf(StrConstant.SEPARATOR) +1));
Object o = redisUtils.get(key);
if (o == null){
return false;
}
redisUtils.delete(key);
String fileName = (String) o;
logger.info("articleRemoveFile oss delete fileName:{}", fileName);
OssFactory.build().delete(fileName,null);
OssEntity entity = baseDao.selectByUrl(formDTO.getUrl());
if (entity != null){
baseDao.deleteDataById(entity.getId());
}
return true;
}
}

4
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -26,6 +26,10 @@ public interface ModuleConstant extends Constant {
* jpg文件类型
*/
String FILE_CONTENT_TYPE_JPG = "image/jpg";
/**
* pdf文件类型
*/
String FILE_CONTENT_TYPE_PDF = "application/pdf";
/**
* 项目附件-允许上传的文件类型

6
epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml

@ -2,5 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.OssDao">
<delete id="deleteDataById">
delete from sys_oss where id = #{id}
</delete>
<select id="selectByUrl" resultType="com.epmet.entity.OssEntity">
select id, created_time from sys_oss where url = #{url}
</select>
</mapper>

10
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java

@ -197,12 +197,14 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
@Override
@Transactional(rollbackFor = Exception.class)
public InitPointRuleResultDTO initPointRule() {
//得到所有客户Id
Result<List<CustomerDTO>> customerListResult = operCrmOpenFeignClient.getAllCustomerList();
log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult));
if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) {
throw new RenException("获取所有客户列表失败");
}
List<CustomerDTO> customerDTOList = customerListResult.getData();
//获取默认规则列表
List<PointRuleDefaultEntity> ruleDefaultEntities = pointRuleDefaultDao.selectList(null);
if (CollectionUtils.isEmpty(ruleDefaultEntities)) {
log.warn("initPointRule pointRuleDefaultDao.selectList return empty");
@ -211,15 +213,18 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
List<PointRuleEntity> insertList = new ArrayList<>();
//获取全部默认规则code集合
List<String> defaultEventCodeList = ruleDefaultEntities.stream().map(PointRuleDefaultEntity :: getEventCode).distinct().collect(Collectors.toList());
//获取所有客户的积分规则
List<PointRuleEntity> customerRule = baseDao.selectList(null);
if(!CollectionUtils.isEmpty(customerRule)){
//key :: customerId || value :: 客户规则集合
Map<String,List<PointRuleEntity>> customerRuleMap =
customerRule.stream().collect(Collectors.groupingBy(PointRuleEntity :: getCustomerId));
customerRuleMap.forEach((customerId,ruleList) -> {
if(null != ruleList){
List<String> event = new LinkedList<>(defaultEventCodeList);
//取差集
//取差集,event只剩下当前客户没有的积分规则
event.removeAll(ruleList.stream().map(PointRuleEntity :: getEventCode).distinct().collect(Collectors.toList()));
if(!CollectionUtils.isEmpty(event)){
ruleDefaultEntities.stream().filter(rule -> event.contains(rule.getEventCode())).map(o -> {
@ -238,7 +243,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
});
}
//从未被初始化的customerId
//被初始化的customerId
List<String> haveInitCustomerIds = baseDao.selectCustomerIds();
if (haveInitCustomerIds == null) {
haveInitCustomerIds = new ArrayList<>();
@ -249,6 +254,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
if (haveInitCustomerIds.contains(customerDTO.getId())) {
continue;
}
//对从未被初始化过积分规则的客户进行积分规则初始化
PointRuleEntity entity = ConvertUtils.sourceToTarget(defaultRule, PointRuleEntity.class);
entity.setId("");
entity.setCreatedBy("INITIALIZATION");

81
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java

@ -0,0 +1,81 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@Data
public class GovCustomerMenuDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* gov_menu表主键
*/
private String tableId;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

27
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 菜单配置 - 一菜单 客户
*/
@Data
public class MenuConfigFormDTO implements Serializable {
private static final long serialVersionUID = -2898130727929596798L;
/**
* gov_menu表主键
*/
@NotBlank(message = "菜单ID不能为空")
private String tableId;
/**
* 客户id 列表
*/
@NotBlank(message = "客户id 列表不能为空")
private List<String> customerIds;
}

22
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 菜单基础入参
*/
@Data
public class MenuFormDTO implements Serializable {
private static final long serialVersionUID = -2898130727929596798L;
/**
* gov_menu表主键
*/
@NotBlank(message = "菜单ID不能为空")
private String tableId;
}

130
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java

@ -0,0 +1,130 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.GovCustomerMenuDTO;
import com.epmet.dto.form.MenuConfigFormDTO;
import com.epmet.dto.form.MenuFormDTO;
import com.epmet.excel.GovCustomerMenuExcel;
import com.epmet.service.GovCustomerMenuService;
import org.apache.commons.lang3.StringUtils;
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 generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@RestController
@RequestMapping("govcustomermenu")
public class GovCustomerMenuController {
@Autowired
private GovCustomerMenuService govCustomerMenuService;
@GetMapping("page")
public Result<PageData<GovCustomerMenuDTO>> page(@RequestParam Map<String, Object> params){
PageData<GovCustomerMenuDTO> page = govCustomerMenuService.page(params);
return new Result<PageData<GovCustomerMenuDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<GovCustomerMenuDTO> get(@PathVariable("id") String id){
GovCustomerMenuDTO data = govCustomerMenuService.get(id);
return new Result<GovCustomerMenuDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody GovCustomerMenuDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
govCustomerMenuService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody GovCustomerMenuDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
govCustomerMenuService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
govCustomerMenuService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<GovCustomerMenuDTO> list = govCustomerMenuService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, GovCustomerMenuExcel.class);
}
/**
* 给每个客户 配置可见菜单
* 先删除后新增
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 14:15 2021-03-16
**/
@PostMapping("addcustomermenu")
public Result addCustomerMenu(@RequestBody MenuConfigFormDTO formDTO) {
//效验数据
if (StringUtils.isBlank(formDTO.getTableId())) {
throw new RenException("菜单ID不能为空");
}
govCustomerMenuService.saveCustomerMenu(formDTO);
return new Result();
}
/**
* 根据gov_menu表主键查询拥有这项菜单的所有客户(customerIds)
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<java.lang.String>>
* @Author zhangyong
* @Date 16:26 2021-03-16
**/
@PostMapping("getcustomerids")
public Result<List<String>> getcustomerids(@RequestBody MenuFormDTO formDTO){
List<String> data = govCustomerMenuService.getcustomerIds(formDTO.getTableId());
return new Result<List<String>>().ok(data);
}
}

55
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java

@ -0,0 +1,55 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.GovCustomerMenuEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@Mapper
public interface GovCustomerMenuDao extends BaseDao<GovCustomerMenuEntity> {
/**
* 根据gov_menu表主键先清除之前配置的客户信息
*
* @param tableId
* @return void
* @Author zhangyong
* @Date 14:24 2021-03-16
**/
void deleteBatchTableIds(@Param("tableId") String tableId);
/**
* 根据gov_menu表主键查询拥有这项菜单的所有客户(customerIds)
*
* @param tableId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 16:29 2021-03-16
**/
List<String> selectListcustomerIds(@Param("tableId") String tableId);
}

9
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java

@ -49,4 +49,13 @@ public interface GovMenuDao extends BaseDao<GovMenuEntity> {
* @param pid 父菜单ID
*/
List<GovMenuEntity> getListPid(String pid);
/**
* 查询客户菜单列表
*
* @param customerId 客户id
* @param type 菜单类型
* @param language 语言
*/
List<GovMenuEntity> getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language);
}

51
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("gov_customer_menu")
public class GovCustomerMenuEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* gov_menu表主键
*/
private String tableId;
}

62
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@Data
public class GovCustomerMenuExcel {
@Excel(name = "主键ID")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "gov_menu表主键")
private String tableId;
@Excel(name = "删除标识 0未删除、1已删除")
private String delFlag;
@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;
}

47
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@Component
public class GovCustomerMenuRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

126
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java

@ -0,0 +1,126 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.GovCustomerMenuDTO;
import com.epmet.dto.form.MenuConfigFormDTO;
import com.epmet.entity.GovCustomerMenuEntity;
import java.util.List;
import java.util.Map;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
public interface GovCustomerMenuService extends BaseService<GovCustomerMenuEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<GovCustomerMenuDTO>
* @author generator
* @date 2021-03-16
*/
PageData<GovCustomerMenuDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<GovCustomerMenuDTO>
* @author generator
* @date 2021-03-16
*/
List<GovCustomerMenuDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return GovCustomerMenuDTO
* @author generator
* @date 2021-03-16
*/
GovCustomerMenuDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-03-16
*/
void save(GovCustomerMenuDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-03-16
*/
void update(GovCustomerMenuDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-03-16
*/
void delete(String[] ids);
/**
* 给每个客户 配置可见菜单
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 14:16 2021-03-16
**/
void saveCustomerMenu(MenuConfigFormDTO formDTO);
/**
* 根据gov_menu表主键查询拥有这项菜单的所有客户(customerIds)
*
* @param tableId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 16:29 2021-03-16
**/
List<String> getcustomerIds(String tableId);
/**
* 根据gov_menu表主键先清除之前配置的客户信息
*
* @param tableId
* @return void
* @Author zhangyong
* @Date 14:24 2021-03-16
**/
void deleteBatchTableIds(String tableId);
}

132
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java

@ -0,0 +1,132 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.GovCustomerMenuDao;
import com.epmet.dto.GovCustomerMenuDTO;
import com.epmet.dto.form.MenuConfigFormDTO;
import com.epmet.entity.GovCustomerMenuEntity;
import com.epmet.redis.GovCustomerMenuRedis;
import com.epmet.service.GovCustomerMenuService;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 客户菜单配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-16
*/
@Service
public class GovCustomerMenuServiceImpl extends BaseServiceImpl<GovCustomerMenuDao, GovCustomerMenuEntity> implements GovCustomerMenuService {
@Autowired
private GovCustomerMenuRedis govCustomerMenuRedis;
@Override
public PageData<GovCustomerMenuDTO> page(Map<String, Object> params) {
IPage<GovCustomerMenuEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, GovCustomerMenuDTO.class);
}
@Override
public List<GovCustomerMenuDTO> list(Map<String, Object> params) {
List<GovCustomerMenuEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, GovCustomerMenuDTO.class);
}
private QueryWrapper<GovCustomerMenuEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<GovCustomerMenuEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public GovCustomerMenuDTO get(String id) {
GovCustomerMenuEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, GovCustomerMenuDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(GovCustomerMenuDTO dto) {
GovCustomerMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovCustomerMenuEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(GovCustomerMenuDTO dto) {
GovCustomerMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovCustomerMenuEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void saveCustomerMenu(MenuConfigFormDTO formDTO) {
if (NumConstant.ZERO < formDTO.getCustomerIds().size()) {
baseDao.deleteBatchTableIds(formDTO.getTableId());
List<GovCustomerMenuEntity> entities = new ArrayList<>();
for (String customerId : formDTO.getCustomerIds()) {
GovCustomerMenuEntity entity = new GovCustomerMenuEntity();
entity.setCustomerId(customerId);
entity.setTableId(formDTO.getTableId());
entities.add(entity);
}
insertBatch(entities);
}
}
@Override
public List<String> getcustomerIds(String tableId) {
return baseDao.selectListcustomerIds(tableId);
}
@Override
public void deleteBatchTableIds(String tableId) {
baseDao.deleteBatchTableIds(tableId);
}
}

43
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java

@ -35,10 +35,7 @@ import com.epmet.entity.GovMenuEntity;
import com.epmet.enums.MenuTypeEnum;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.redis.GovMenuRedis;
import com.epmet.service.GovLanguageService;
import com.epmet.service.GovMenuService;
import com.epmet.service.GovResourceService;
import com.epmet.service.GovRoleMenuService;
import com.epmet.service.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -67,6 +64,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit
private GovResourceService govResourceService;
@Autowired
private GovLanguageService govLanguageService;
@Autowired
private GovCustomerMenuService govCustomerMenuService;
@Override
public PageData<GovMenuDTO> page(Map<String, Object> params) {
@ -154,6 +153,9 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit
//清空当前用户,菜单导航、权限标识
govMenuRedis.delete(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient());
// 逻辑删除 epmet_gov_access 表中的关联数据
govCustomerMenuService.deleteBatchTableIds(id);
}
@Override
@ -185,14 +187,30 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit
@Override
public List<GovMenuDTO> getUserMenuNavList(TokenDto tokenDto) {
List<GovMenuDTO> menuList = govMenuRedis.getUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient());
if(menuList == null){
menuList = getUserMenuList(tokenDto, MenuTypeEnum.MENU.value());
govMenuRedis.setUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), menuList);
}
// List<GovMenuDTO> menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient());
// if(menuList == null){
// menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value());
//
// govMenuRedis.setUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient(), menuList);
// }
// PC端 每个客户的菜单信息,不放入缓存,每次登陆重新查询。
// 或者 你可以选择,在给每个客户 配置可见菜单的时候, 在saveCustomerMenu方法中,增加更新缓存的逻辑
return getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value());
}
return menuList;
/**
* 获取客户配置的 菜单信息
*
* @param customerId
* @param type
* @return java.util.List<com.epmet.dto.GovMenuDTO>
* @Author zhangyong
* @Date 15:51 2021-03-16
**/
private List<GovMenuDTO> getCustomerMenuList(String customerId, Integer type) {
List<GovMenuEntity> menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage());
List<GovMenuDTO> dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class);
return TreeUtils.buildTree(dtoList);
}
@Override
@ -243,5 +261,4 @@ public class GovMenuServiceImpl extends BaseServiceImpl<GovMenuDao, GovMenuEntit
private void saveLanguage(String tableId, String fieldName, String fieldValue){
govLanguageService.saveOrUpdate("gov_menu", tableId, fieldName, fieldValue, HttpContextUtils.getLanguage());
}
}
}

12
epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.5__gov_customer_menu.sql

@ -0,0 +1,12 @@
CREATE TABLE `gov_customer_menu` (
`ID` varchar(32) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`TABLE_ID` varchar(32) NOT NULL COMMENT 'gov_menu表主键',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户菜单配置表';

29
epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovCustomerMenuDao.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.GovCustomerMenuDao">
<resultMap type="com.epmet.entity.GovCustomerMenuEntity" id="govCustomerMenuMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="tableId" column="TABLE_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="deleteBatchTableIds">
UPDATE gov_customer_menu SET DEL_FLAG = '1'
WHERE DEL_FLAG = '0'
AND TABLE_ID = #{tableId, jdbcType=VARCHAR}
</update>
<select id="selectListcustomerIds" resultType="String">
SELECT CUSTOMER_ID customerId
FROM gov_customer_menu
WHERE del_flag = 0 AND TABLE_ID = #{tableId, jdbcType=VARCHAR}
</select>
</mapper>

14
epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml

@ -39,4 +39,18 @@
select * from gov_menu where del_flag = 0 and pid = #{value}
</select>
<select id="getCustomerMenuList" resultType="com.epmet.entity.GovMenuEntity">
select t1.*, (select lang.field_value from gov_language lang where lang.table_name='gov_menu' and lang.field_name='name'
and lang.table_id=t1.id and lang.language=#{language}) as name
from gov_menu t1
RIGHT JOIN gov_customer_menu m ON t1.id = m.TABLE_ID
where t1.del_flag = 0 AND m.del_flag = 0
<if test="type != null">
and t1.type = #{type}
</if>
<if test="customerId != null">
and m.CUSTOMER_ID = #{customerId}
</if>
order by t1.sort asc
</select>
</mapper>

8
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java

@ -115,6 +115,14 @@ public class IssueAuditController {
return new Result<List<ApplicationHistoryWorkResultDTO>>().ok(issueApplicationHistoryService.applicationHistoryWork(applicationHistoryWorkFormDTO));
}
/**
* @Description 工作端议题审核
* @param token
* @param param
* @return java.lang.String
* @author wangc
* @date 2021.03.19 23:40
*/
@PostMapping("audit")
public Result<String> audit(@LoginUser TokenDto token, @RequestBody IssueAuditionFormDTO param){
return new Result<String>().ok(issueService.audit(token,param));

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java

@ -152,7 +152,14 @@ public interface IssueService extends BaseService<IssueEntity> {
* @date 2020.11.19 10:02
*/
FirstTopicShiftedToIssueApplicationResultDTO topicShiftedToIssueV2(IssueShiftedFromTopicFormDTO issueShiftedFromTopicFormDTO);
/**
* @Description 工作端议题审核
* @param token
* @param param
* @return java.lang.String
* @author wangc
* @date 2021.03.19 23:40
*/
String audit(TokenDto token, IssueAuditionFormDTO param);
/**

8
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -443,6 +443,14 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return result;
}
/**
* @Description 工作端议题审核
* @param token
* @param param
* @return java.lang.String
* @author wangc
* @date 2021.03.19 23:40
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String audit(TokenDto token, IssueAuditionFormDTO param){

5
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java

@ -258,6 +258,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
@Transactional(rollbackFor = Exception.class)
public void syncVotingCacheToDb() {
IssueDTO issueParam = new IssueDTO();
// 表决中
issueParam.setIssueStatus(ModuleConstants.ISSUE_STATUS_VOTING);
//获取所有voting的议题
Set<IssueDTO> issues =
@ -265,18 +266,20 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
if(null == issues || issues.isEmpty()){
return;
}
// 议题ID集合
Set<String> ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet());
List<String> gridIds = issues.stream().map(IssueDTO::getGridId).distinct().collect(Collectors.toList());
CommonGridIdListFormDTO gridIdList = new CommonGridIdListFormDTO();
gridIdList.setGridIds(gridIds);
// 根据网格Id查询网格下所有加入组的组员
Result<GridVotableCountResultDTO> votableCountResult = resiGroupFeignClient.votableCounts(gridIdList);
Map<String,Integer> votableCountMap1 = null;
if(votableCountResult.success() && null != votableCountResult.getData() && null != votableCountResult.getData().getVotableCountMap()){
votableCountMap1 = votableCountResult.getData().getVotableCountMap();
}
final Map<String,Integer> votableCountMap = votableCountMap1;
//查询指定议题的统计数据
List<IssueVoteStatisticalDTO> statisticalList =
baseDao.selectListByIds(ids);
if (null != statisticalList && statisticalList.size() > NumConstant.ZERO) {

3
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml

@ -23,6 +23,9 @@
</resultMap>
<!-- 生成昨日的话题统计信息 -->
<!-- 第一个left Join,每个议题,每种状态的投票总次数 【从当前时间-创建时间,天数大于0】-->
<!-- 第二个left Join,每个议题,每种状态的投票次数 【从当前时间-创建时间,1 >= 天数 >0.也就是昨天】-->
<!-- 关闭天数在一天之内包括1天,转项目天数在一天之内包括1天 -->
<select id="getIssueVotingStatistical" resultType="com.epmet.dto.result.IssuesToBeCountedResultDTO">
SELECT

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java

@ -29,4 +29,6 @@ public class RoleInfoResultDTO implements Serializable{
* */
@JsonInclude(JsonInclude.Include.NON_NULL)
private Boolean fullTimeOnly = false;
private String roleKey;
}

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -1107,6 +1107,17 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
/**
* @Description
* @param ifPrecise imprecise(不精确两个日期中间包含多少工作日都按照二十四小时计算) | precise(精确两个日期中间包含多少工作日开头一天的时间到第二日凌晨所剩的分钟数以及最后一次从凌晨到精确时分的分钟数)
* @param ifCustom custom使用客户自定义计算方式 | default(使用默认计算方式)
* @param identity 给此次计算一个唯一索引为了在批量计算中锁定结果
* @param left 开始日期
* @param right 结束日期
* @return java.lang.Integer
* @author wangc
* @date 2021.03.21 23:32
*/
private Integer calculateDelta_T(String ifPrecise,String ifCustom,String identity,Date left,Date right){
WorkMinuteFormDTO timeParam = new WorkMinuteFormDTO();
timeParam.setIfPrecise(ifPrecise);

16
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -54,10 +55,19 @@ public class ArticleContentDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text文件file
*/
private String contentType;
/**
* desc: 请描述类的业务用途
*
* @param null
* @return
* @author LiuJanJun
* @date 2021/3/29 5:42 下午
*/
/**
* 审核状态 通过:pass失败:fail审核中auditing
*/
@ -103,4 +113,4 @@ public class ArticleContentDTO implements Serializable {
*/
private Date updatedTime;
}
}

7
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -54,7 +55,7 @@ public class DraftContentDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text文件file
*/
private String contentType;
@ -103,4 +104,4 @@ public class DraftContentDTO implements Serializable {
*/
private Date updatedTime;
}
}

11
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java

@ -67,14 +67,19 @@ public class DraftContentFromDTO implements Serializable {
*/
private String draftContentId;
/**
* 内容
* 内容 当为非文字时存放oss链接地址
*/
@Length(max = 1000, message = "每段文字最长为1000个字")
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text文件file
*/
private String contentType;
/**
* 文件名称
*/
private String fileName;
}
}
}

7
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java

@ -15,7 +15,7 @@ public class ArticleContentResultDTO implements Serializable {
private static final long serialVersionUID = 2853197212163051558L;
/**
* 内容类型图片img文字text
* 内容类型图片img文字text文件file
* */
private String contentType;
@ -23,4 +23,9 @@ public class ArticleContentResultDTO implements Serializable {
* 内容
* */
private String content;
/**
* 文件名称
* */
private String fileName;
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save