From 3f0d5b99d365bd40dc4ff90e3feeb4b1df82061f Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Wed, 5 Aug 2020 14:53:56 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/RocketMqConstant.java | 54 +++ .../tools/constant/ServiceConstant.java | 5 + .../security/content/CheckDataUtils.java | 354 ++++++++++++++++++ .../tools/security/content/ModuleName.java | 36 ++ .../content/dto/form/CheckContentFormDTO.java | 33 ++ .../content/dto/form/CheckDataFromDTO.java | 21 ++ .../content/dto/form/ParentAndAllDeptDTO.java | 51 +++ .../content/dto/form/SaveCheckRecordsDTO.java | 122 ++++++ .../dto/result/CheckDetailResultsDTO.java | 41 ++ .../content/dto/result/CheckResultDTO.java | 38 ++ .../dto/result/CheckResultDetailsDTO.java | 38 ++ .../dto/result/CheckResultMessageDTO.java | 33 ++ esua-epdc/epdc-gateway/pom.xml | 5 + .../src/main/resources/application.yml | 8 + .../epdc-content-security/db/mysql.sql | 0 .../epdc-content-security/db/oracle.sql | 0 .../epdc-content-security/db/postgresql.sql | 0 .../epdc-content-security/db/sqlserver.sql | 0 .../epdc-content-security-client/pom.xml | 27 ++ .../com/elink/esua/epdc/dto/CheckCodeDTO.java | 86 +++++ .../esua/epdc/dto/CheckImgsDetailsDTO.java | 19 + .../elink/esua/epdc/dto/CheckRecordsDTO.java | 159 ++++++++ .../esua/epdc/dto/CheckRecordsImgsDTO.java | 86 +++++ .../elink/esua/epdc/dto/CheckResultDTO.java | 97 +++++ .../java/com/elink/esua/epdc/dto/DemoDto.java | 37 ++ .../esua/epdc/dto/ViolationsDetailsDTO.java | 20 + .../esua/epdc/dto/ViolationsRecordsDTO.java | 117 ++++++ .../epdc/dto/ViolationsRecordsImgsDTO.java | 87 +++++ .../epdc/dto/form/HandleRecordsFormDTO.java | 33 ++ .../epdc-content-security-server/Dockerfile | 20 + .../epdc-content-security-server/pom.xml | 254 +++++++++++++ .../esua/epdc/ContentSecurityApplication.java | 31 ++ .../epdc/async/RejectCheckResultsTask.java | 35 ++ .../esua/epdc/config/ModuleConfigImpl.java | 26 ++ .../epdc/controller/CheckCodeController.java | 107 ++++++ .../controller/CheckRecordsController.java | 94 +++++ .../controller/CheckResultController.java | 94 +++++ .../controller/HandleResultController.java | 70 ++++ .../ViolationsRecordsController.java | 94 +++++ .../com/elink/esua/epdc/dao/CheckCodeDao.java | 44 +++ .../elink/esua/epdc/dao/CheckRecordsDao.java | 55 +++ .../esua/epdc/dao/CheckRecordsImgsDao.java | 44 +++ .../elink/esua/epdc/dao/CheckResultDao.java | 33 ++ .../esua/epdc/dao/ViolationsRecordsDao.java | 55 +++ .../epdc/dao/ViolationsRecordsImgsDao.java | 33 ++ .../esua/epdc/entity/CheckCodeEntity.java | 58 +++ .../esua/epdc/entity/CheckRecordsEntity.java | 141 +++++++ .../epdc/entity/CheckRecordsImgsEntity.java | 58 +++ .../esua/epdc/entity/CheckResultEntity.java | 66 ++++ .../epdc/entity/ViolationsRecordsEntity.java | 137 +++++++ .../entity/ViolationsRecordsImgsEntity.java | 58 +++ .../elink/esua/epdc/excel/CheckCodeExcel.java | 65 ++++ .../esua/epdc/excel/CheckRecordsExcel.java | 111 ++++++ .../epdc/excel/CheckRecordsImgsExcel.java | 65 ++++ .../esua/epdc/excel/CheckResultExcel.java | 71 ++++ .../epdc/excel/ViolationsRecordsExcel.java | 111 ++++++ .../excel/ViolationsRecordsImgsExcel.java | 65 ++++ .../esua/epdc/exception/ModuleErrorCode.java | 24 ++ .../esua/epdc/feign/MessageFeignClient.java | 31 ++ .../fallback/MessageFeignClientFallback.java | 21 ++ .../elink/esua/epdc/redis/CheckCodeRedis.java | 47 +++ .../epdc/redis/CheckRecordsImgsRedis.java | 47 +++ .../esua/epdc/redis/CheckRecordsRedis.java | 47 +++ .../esua/epdc/redis/CheckResultRedis.java | 47 +++ .../redis/ViolationsRecordsImgsRedis.java | 47 +++ .../epdc/redis/ViolationsRecordsRedis.java | 47 +++ .../epdc/rocketmq/dto/RejectRecordDTO.java | 27 ++ .../producer/RejectCheckRecordProducer.java | 45 +++ .../esua/epdc/service/CheckCodeService.java | 105 ++++++ .../epdc/service/CheckRecordsImgsService.java | 106 ++++++ .../epdc/service/CheckRecordsService.java | 115 ++++++ .../esua/epdc/service/CheckResultService.java | 106 ++++++ .../service/ViolationsRecordsImgsService.java | 105 ++++++ .../service/ViolationsRecordsService.java | 117 ++++++ .../service/impl/CheckCodeServiceImpl.java | 111 ++++++ .../impl/CheckRecordsImgsServiceImpl.java | 123 ++++++ .../service/impl/CheckRecordsServiceImpl.java | 121 ++++++ .../service/impl/CheckResultServiceImpl.java | 231 ++++++++++++ .../ViolationsRecordsImgsServiceImpl.java | 123 ++++++ .../impl/ViolationsRecordsServiceImpl.java | 127 +++++++ .../elink/esua/epdc/utils/ModuleConstant.java | 21 ++ .../src/main/resources/application.yml | 121 ++++++ .../db/migration/V1_1__INIT_DATABASE.sql | 12 + .../main/resources/i18n/messages.properties | 1 + .../resources/i18n/messages_en_US.properties | 1 + .../resources/i18n/messages_zh_CN.properties | 1 + .../resources/i18n/messages_zh_TW.properties | 1 + .../main/resources/i18n/validation.properties | 1 + .../i18n/validation_en_US.properties | 1 + .../i18n/validation_zh_CN.properties | 1 + .../i18n/validation_zh_TW.properties | 1 + .../src/main/resources/logback-spring.xml | 161 ++++++++ .../main/resources/mapper/CheckCodeDao.xml | 23 ++ .../main/resources/mapper/CheckRecordsDao.xml | 118 ++++++ .../resources/mapper/CheckRecordsImgsDao.xml | 23 ++ .../main/resources/mapper/CheckResultDao.xml | 22 ++ .../resources/mapper/ViolationsRecordsDao.xml | 110 ++++++ .../mapper/ViolationsRecordsImgsDao.xml | 20 + .../src/main/resources/registry.conf | 21 ++ .../epdc-module/epdc-content-security/pom.xml | 21 ++ .../epdc/dto/comment/form/CommentFormDTO.java | 5 + .../events/form/EpdcEventSubmitFormDTO.java | 5 + .../epdc/dto/item/form/EvaluationFormDTO.java | 5 + .../epdc-events/epdc-events-server/pom.xml | 6 + .../modules/comment/dao/EventCommentDao.java | 9 + .../comment/service/EventCommentService.java | 10 + .../service/impl/EventCommentServiceImpl.java | 76 ++++ .../controller/EpdcAppEventsController.java | 11 +- .../modules/events/dao/EpdcEventsDao.java | 20 +- .../events/service/EpdcEventsService.java | 12 +- .../service/impl/EpdcEventsServiceImpl.java | 79 +++- .../epdc/modules/feign/AdminFeignClient.java | 11 + .../feign/ContentSecurityFeignClient.java | 27 ++ .../fallback/AdminFeignClientFallback.java | 5 + .../ContentSecurityFeignClientFallback.java | 28 ++ .../modules/item/service/ItemService.java | 10 + .../item/service/impl/ItemServiceImpl.java | 87 ++++- .../consumer/RejectCheckRecordConsumer.java | 64 ++++ .../modules/rocketmq/dto/RejectRecordDTO.java | 27 ++ .../src/main/resources/application.yml | 2 + .../mapper/comment/EventCommentDao.xml | 4 + .../resources/mapper/events/EpdcEventsDao.xml | 9 + .../elink/esua/epdc/activity/ActInfoDTO.java | 5 + .../epdc/activity/AppActUserClockLogDTO.java | 5 + .../epdc-heart/epdc-heart-server/pom.xml | 15 + .../modules/activity/dao/ActBannerDao.java | 10 + .../modules/activity/dao/ActClockPicDao.java | 10 +- .../epdc/modules/activity/dao/ActInfoDao.java | 10 + .../activity/dao/ActUserClockLogDao.java | 10 + .../activity/service/ActInfoService.java | 19 + .../service/impl/ActInfoServiceImpl.java | 97 ++++- .../impl/ActUserClockLogServiceImpl.java | 73 +++- .../epdc/modules/feign/AdminFeignClient.java | 12 + .../feign/ContentSecurityFeignClient.java | 27 ++ .../fallback/AdminFeignClientFallback.java | 5 + .../ContentSecurityFeignClientFallback.java | 28 ++ .../consumer/RejectCheckRecordConsumer.java | 52 +++ .../modules/rocketmq/dto/RejectRecordDTO.java | 27 ++ .../src/main/resources/application.yml | 5 + .../mapper/activity/ActBannerDao.xml | 4 + .../mapper/activity/ActClockPicDao.xml | 5 +- .../resources/mapper/activity/ActInfoDao.xml | 5 + .../mapper/activity/ActUserClockLogDao.xml | 4 + .../epdc/constant/SysSmsTemplateConstant.java | 4 + .../dto/form/PartyTopicCommentFormDTO.java | 4 + .../dto/form/PartyTopicSubmitFormDTO.java | 5 +- .../epdc-party-group-server/pom.xml | 16 + .../esua/epdc/dao/PartyTopicCommentDao.java | 10 + .../elink/esua/epdc/dao/PartyTopicDao.java | 10 + .../elink/esua/epdc/dao/PartyTopicImgDao.java | 10 +- .../esua/epdc/feign/AdminFeignClient.java | 11 + .../feign/ContentSecurityFeignClient.java | 27 ++ .../fallback/AdminFeignClientFallback.java | 9 +- .../ContentSecurityFeignClientFallback.java | 28 ++ .../consumer/RejectCheckRecordConsumer.java | 57 +++ .../epdc/rocketmq/dto/RejectRecordDTO.java | 27 ++ .../service/PartyTopicCommentService.java | 11 + .../esua/epdc/service/PartyTopicService.java | 9 + .../impl/PartyTopicCommentServiceImpl.java | 82 +++- .../service/impl/PartyTopicServiceImpl.java | 83 +++- .../src/main/resources/application.yml | 5 + .../resources/mapper/PartyTopicCommentDao.xml | 5 + .../main/resources/mapper/PartyTopicDao.xml | 4 + .../resources/mapper/PartyTopicImgDao.xml | 5 +- esua-epdc/epdc-module/pom.xml | 1 + 165 files changed, 7625 insertions(+), 41 deletions(-) create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/CheckDataUtils.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckContentFormDTO.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckDataFromDTO.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/ParentAndAllDeptDTO.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/SaveCheckRecordsDTO.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckDetailResultsDTO.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDTO.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDetailsDTO.java create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultMessageDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/db/mysql.sql create mode 100644 esua-epdc/epdc-module/epdc-content-security/db/oracle.sql create mode 100644 esua-epdc/epdc-module/epdc-content-security/db/postgresql.sql create mode 100644 esua-epdc/epdc-module/epdc-content-security/db/sqlserver.sql create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/pom.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckCodeDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckImgsDetailsDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsImgsDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/DemoDto.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsDetailsDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsImgsDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/form/HandleRecordsFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/Dockerfile create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/ContentSecurityApplication.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/async/RejectCheckResultsTask.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckCodeController.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckRecordsController.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckResultController.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/HandleResultController.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/ViolationsRecordsController.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckCodeDao.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsDao.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsImgsDao.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckResultDao.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsDao.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsImgsDao.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckCodeEntity.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsEntity.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsImgsEntity.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckResultEntity.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsEntity.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsImgsEntity.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckCodeExcel.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsExcel.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsImgsExcel.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckResultExcel.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsExcel.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsImgsExcel.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/exception/ModuleErrorCode.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/MessageFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/fallback/MessageFeignClientFallback.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckCodeRedis.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsImgsRedis.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsRedis.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckResultRedis.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/ViolationsRecordsImgsRedis.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/ViolationsRecordsRedis.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/producer/RejectCheckRecordProducer.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckCodeService.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsImgsService.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsService.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckResultService.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsImgsService.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsService.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckCodeServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsImgsServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsImgsServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/utils/ModuleConstant.java create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/application.yml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_en_US.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_CN.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_TW.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_en_US.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_CN.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_TW.properties create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/logback-spring.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckCodeDao.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsDao.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsImgsDao.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckResultDao.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsDao.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsImgsDao.xml create mode 100644 esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/registry.conf create mode 100644 esua-epdc/epdc-module/epdc-content-security/pom.xml create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java create mode 100644 esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/ContentSecurityFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/ContentSecurityFeignClientFallback.java create mode 100644 esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java create mode 100644 esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java index a00df43d..074c114a 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java @@ -38,4 +38,58 @@ public interface RocketMqConstant { * 积分埋点-消息tag */ String MQ_TAG_POINTS = "jinshui-pointsTag"; + + /** + * 内容安全审核-初心互助-消息topic + */ + String MQ_TOPIC_HEART_CONTENTSECURITY = "js_heart_contentSecurityTopic"; + + /** + * 内容安全审核-初心互助-发布活动-消息tag + */ + String MQ_TAG_HEART_ACTIVITY_CONTENTSECURITY = "js_heart_activity_contentSecurityTag"; + + /** + * 内容安全审核-初心互助-已报名活动-我要打卡-消息tag + */ + String MQ_TAG_HEART_SIGNIN_CONTENTSECURITY = "js_heart_signIn_contentSecurityTag"; + //--------------------------------------------------------------------------- + + /** + * + * 内容安全审核-议题项目-消息topic + */ + String MQ_TOPIC_ISSUE_ITEM_CONTENTSECURITY = "js_issueItem_contentSecurityTopic"; + + /** + * 内容安全审核-议题项目-我要报事-消息tag + */ + String MQ_TAG_ISSUE_ITEM_SUBMIT_CONTENTSECURITY = "js_issueItem_submit_contentSecurityTag"; + + /** + * 内容安全审核-议题项目-评论-消息tag + */ + String MQ_TAG_ISSUE_ITEM_COMMENT_CONTENTSECURITY = "js_issueItem_comment_contentSecurityTag"; + + /** + * 内容安全审核-项目详情-满意度评价-消息tag + */ + String MQ_TAG_ISSUE_ITEM_SATISFACTION_CONTENTSECURITY = "js_issueItem_satisfaction_contentSecurityTag"; + //--------------------------------------------------------------------------- + + /** + * 内容安全审核-党群1+1-消息topic + */ + String MQ_TOPIC_GROUP_CONTENTSECURITY = "js_group_contentSecurityTopic"; + + /** + * 内容安全审核-党群1+!-消息tag + */ + String MQ_TAG_GROUP_TOPIC_CONTENTSECURITY = "js_group_topic_contentSecurityTag"; + + /** + * 内容安全审核-党群1+1—-评论-消息tag + */ + String MQ_TAG_GROUP_TOPIC_COMMENT_CONTENTSECURITY = "js_group_topic_comment_contentSecurityTag"; + } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java index 4f0c476d..35360476 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java @@ -97,4 +97,9 @@ public interface ServiceConstant { * 党群模块 */ String EPDC_PARTY_GROUP_SERVER = "epdc-party-group-server"; + + /** + * 内容审核模块 + */ + String EPDC_CONTENT_SECURITY_SERVER = "epdc-content-security-server"; } diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/CheckDataUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/CheckDataUtils.java new file mode 100644 index 00000000..f1a578b4 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/CheckDataUtils.java @@ -0,0 +1,354 @@ +package com.elink.esua.epdc.commons.tools.security.content; + +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSONObject; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.CheckContentFormDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.CheckDataFromDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckDetailResultsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDetailsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.cloud.netflix.ribbon.apache.HttpClientUtils; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * @program: esua-epdc + * @description: 内容违规校验 + * @author: wangtong + * @create: 2020-07-03 17:02 + **/ +public class CheckDataUtils { + + //内容审核地址 + private static String contentUrl = "https://epmet-open.elinkservice.cn/api/epmetscan/api/textSyncScan"; + + //图片审核地址 + private static String imgUrl = "https://epmet-open.elinkservice.cn/api/epmetscan/api/imgSyncScan"; + + //文本正常 + public static String pass = "pass"; + + //文本需要进一步人工审核 + public static String review = "review"; + + //文本违规,可以直接删除或者限制公开 + public static String block = "block"; + + //识别图片中的色情内容 + private static String porn = "porn"; + + //识别图片中的暴恐涉政内容 + private static String terrorism = "terrorism"; + + //违规编码:后台返给前台识别 + public static int violations_code = 533; + + //违规提示 + public static String violations_message = "内容存在违规信息,请修改后重新提交!"; + + //工作类别:工作端 + public static String cate_one = "1"; + + //工作类别:居民端 + public static String cate_two = "2"; + + //违规判定方式:系统判定 + public static String decision_one = "1"; + + //违规判定方式:人工判定 + public static String decision_two = "2"; + + + private static Logger log = LogManager.getLogger(HttpClientUtils.class); + + +// public static void main(String[] args) { +// String a = ModuleName.WORK_DAILY.getCode(); +// System.out.println(a); +// } + + /** + * @param :[ title :文本标题, content:文本内容] + * @return java.lang.Object + * @describe: 内容审核 + * @author wangtong + * @date 2020/7/6 10:13 + */ + public static CheckResultDTO checkContent(List textList) { + for (Iterator text = textList.iterator(); text.hasNext(); ) { + if (StringUtils.isBlank(text.next())) { + text.remove(); + } + } + if (textList == null || textList.size() == 0) { + return new CheckResultDTO(); + } + String text = StringUtils.join(textList.toArray(), "。"); + + CheckDataFromDTO tasks = new CheckDataFromDTO(); + List contentList = new ArrayList<>(); + CheckContentFormDTO contentDto = new CheckContentFormDTO(); + contentDto.setDataId("1"); + contentDto.setContent(text); + contentList.add(contentDto); + tasks.setTasks(contentList); + String json = JSONObject.toJSONString(tasks); + log.info("审核组装json:" + json); + + HttpResponse response = null; + try { + response = HttpRequest.post(contentUrl).body(json) + .header("lan", "zh") + .header("Content-Type", "application/json").execute(); + } catch (Exception e) { + e.printStackTrace(); + log.error("内容校验接口异常:" + e.getMessage()); + } + log.info("审核返回数据:" + response.body()); + JSONObject res = JSONObject.parseObject(response.body()); + //审核成功 + if (0 == Integer.valueOf(res.get("code").toString())) { + CheckResultDTO result = (CheckResultDTO) JSONObject.toJavaObject((JSONObject) res.get("data"), CheckResultDTO.class); + if (200 == result.getDetails().get(0).getCode()) { + return result; + } else { + log.error("内容审核返回信息错误:" + res); + return null; + } + } else { + log.error("内容审核返回信息错误:" + res); + return null; + } + } + + /** + * @param :[ imgArray:集合类型的图片地址] + * @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO + * @describe: 图片审核:只要有一张图片被驳回,本次审核判定为不通过 + * @author wangtong + * @date 2020/7/7 17:42 + */ + public static CheckResultDTO checkImgs(List imgArray) { + CheckDataFromDTO tasks = new CheckDataFromDTO(); + List contentList = new ArrayList<>(); + if (imgArray != null && imgArray.size() > 0) { + int i = 1; + for (String url : imgArray) { + if (StringUtils.isNotBlank(url)) {//图片地址为空会报错 + CheckContentFormDTO imgDto = new CheckContentFormDTO(); + imgDto.setDataId(i + ""); + imgDto.setUrl(url); + contentList.add(imgDto); + i++; + } + } + } else { + return new CheckResultDTO(); + } + + tasks.setTasks(contentList); + String json = JSONObject.toJSONString(tasks); + log.info("审核组装json:" + json); + HttpResponse response = null; + try { + response = HttpRequest.post(imgUrl).body(json) + .header("lan", "zh") + .header("Content-Type", "application/json").execute(); + } catch (Exception e) { + e.printStackTrace(); + log.error("内容校验接口异常:" + e.getMessage()); + } + log.info("审核返回数据:" + response.body()); + JSONObject res = JSONObject.parseObject(response.body()); + //审核成功 + if (0 == Integer.valueOf(res.get("code").toString())) { + CheckResultDTO result = (CheckResultDTO) JSONObject.toJavaObject((JSONObject) res.get("data"), CheckResultDTO.class); + if (200 == result.getDetails().get(0).getCode()) { + return result; + } else { + log.error("内容审核返回信息错误:" + res); + return null; + } + } else { + log.error("内容审核返回信息错误:" + res); + return null; + } + } + + /** + * @param :[ contentResult:文本审核结果, imgResult:图片审核结果] + * @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO + * @describe: 获取违规记录的分类占比,所属类别,审核状态 + * @author wangtong + * @date 2020/7/7 16:18 + */ + public static CheckResultMessageDTO getCheckResultMessage(CheckResultDTO contentResult, CheckResultDTO imgResult) { + CheckResultMessageDTO result = new CheckResultMessageDTO(); + //如果是文字违规 + if (contentResult != null && !contentResult.getAllPass()) { + result.setSuggestion(contentResult.getDetails().get(0).getResults().get(0).getSuggestion()); + result.setLabel(contentResult.getDetails().get(0).getResults().get(0).getLabel()); + result.setRate(contentResult.getDetails().get(0).getResults().get(0).getRate()); + return result; + } else if (imgResult != null && !imgResult.getAllPass()) {//如果是图片违规 + for (CheckResultDetailsDTO details : imgResult.getDetails()) { + for (CheckDetailResultsDTO detailResult : details.getResults()) { + if (block.equals(detailResult.getSuggestion())) { + result.setSuggestion(block); + result.setLabel(detailResult.getLabel()); + result.setRate(detailResult.getRate()); + return result; + } + } + } + } + return result; + } + + /** + * @param :[ contentResult:文本审核结果, imgResult:图片审核结果] + * @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO + * @describe: 判断审核结果是review还是pass + * @author wangtong + * @date 2020/7/7 17:19 + */ + public static CheckResultMessageDTO checkTwoTypes(CheckResultDTO contentResult, CheckResultDTO imgResult) { + CheckResultMessageDTO result = new CheckResultMessageDTO(); + //如果是文字待审核 + if (contentResult != null && contentResult.getDetails() != null && 200 == contentResult.getDetails().get(0).getCode()) { + if (review.equals(contentResult.getDetails().get(0).getResults().get(0).getSuggestion())) { + result.setSuggestion(review); + result.setLabel(contentResult.getDetails().get(0).getResults().get(0).getLabel()); + result.setRate(contentResult.getDetails().get(0).getResults().get(0).getRate()); + return result; + } + } + if (imgResult != null && imgResult.getDetails() != null && 200 == imgResult.getDetails().get(0).getCode()) {//如果是图片待审核 + for (CheckResultDetailsDTO details : imgResult.getDetails()) { + for (CheckDetailResultsDTO detailResult : details.getResults()) { + if (review.equals(detailResult.getSuggestion())) { + result.setSuggestion(review); + result.setLabel(detailResult.getLabel()); + result.setRate(detailResult.getRate()); + return result; + } + } + } + } + return result; + } + + /** + * @describe: 系统判定为违规,后台处理为待审核 + * @author wangtong + * @date 2020/8/4 13:57 + * @params [contentResult, imgResult] + * @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO + */ + public static CheckResultMessageDTO saveTwoTypes(CheckResultDTO contentResult, CheckResultDTO imgResult) { + CheckResultMessageDTO result = new CheckResultMessageDTO(); + //如果是文字待审核 + if (contentResult != null && contentResult.getDetails() != null && 200 == contentResult.getDetails().get(0).getCode()) { + if (block.equals(contentResult.getDetails().get(0).getResults().get(0).getSuggestion())) { + result.setSuggestion(review); + result.setLabel(contentResult.getDetails().get(0).getResults().get(0).getLabel()); + result.setRate(contentResult.getDetails().get(0).getResults().get(0).getRate()); + return result; + } + } + if (imgResult != null && imgResult.getDetails() != null && 200 == imgResult.getDetails().get(0).getCode()) {//如果是图片待审核 + for (CheckResultDetailsDTO details : imgResult.getDetails()) { + for (CheckDetailResultsDTO detailResult : details.getResults()) { + if (block.equals(detailResult.getSuggestion())) { + result.setSuggestion(review); + result.setLabel(detailResult.getLabel()); + result.setRate(detailResult.getRate()); + return result; + } + } + } + } + return result; + } + + + /** + * @param :[ userId :用户ID, + * userName:用户名称, + * category:工作类别:1工作2居民, + * decision:判定方式:1系统2人工 + * module:模块编码, + * textList:要审核的文本集合, + * imgUrls:要审核的图片集合, + * relationId:关联信息ID, + * contentResult:文本审核的结果, + * imgResult:图片审核的结果, + * twoTypes:判断为通过或者待审核的结果 + * mobile:手机号 + * system:系统审核状态:0正常1异常 + * deptDTO:部门及父部门、所有父部门信息] + * @return com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO + * @describe: 组装违规记录/待审核信息 + * @author wangtong + * @date 2020/7/7 19:26 + */ + public static SaveCheckRecordsDTO getPackageRecords(String userId, String userName, String category, + String decision, String module, List textList, + List imgUrls, String relationId, + CheckResultDTO contentResult, CheckResultDTO imgResult, + CheckResultMessageDTO twoTypes, String mobile, String system, + ParentAndAllDeptDTO deptDTO) { + SaveCheckRecordsDTO record = new SaveCheckRecordsDTO(); + record.setUserId(userId); + record.setName(userName); + record.setMobile(mobile); + record.setSystem(system); + record.setCategory(category);//居民 + record.setDecision(decision);//判定方式 + record.setModule(module);//功能模块 + if (textList == null || textList.size() == 0) { + return null; + } + String text = StringUtils.join(textList.toArray(), "。"); + record.setContent(text); + record.setImgUrls(imgUrls); + if (StringUtils.isNotBlank(relationId)) { + record.setRelationId(relationId); + } + if (twoTypes != null) { + record.setSuggestion(twoTypes.getSuggestion()); + record.setLabel(twoTypes.getLabel()); + record.setRate(twoTypes.getRate()); + } else if (contentResult != null || imgResult != null) { + CheckResultMessageDTO messageResult = getCheckResultMessage(contentResult, imgResult); + record.setSuggestion(messageResult.getSuggestion()); + record.setLabel(messageResult.getLabel()); + record.setRate(messageResult.getRate()); + } else { + //文本检测接口异常用 + record.setSuggestion(review); + } + // 父所有部门 + record.setParentDeptIds(deptDTO.getParentDeptIds()); + record.setParentDeptNames(deptDTO.getParentDeptNames()); + // 所有部门 + record.setAllDeptIds(deptDTO.getAllDeptIds()); + record.setAllDeptNames(deptDTO.getAllDeptNames()); + // 部门 + record.setDeptId(deptDTO.getGridId()); + record.setDeptName(deptDTO.getGrid()); + + return record; + } + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java new file mode 100644 index 00000000..e171da9e --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.commons.tools.security.content; + +/** +* @describe: 功能模块名 枚举类 +* @author wangtong +* @date 2020/7/8 15:14 +* @param +* @return +*/ +public enum ModuleName { + + HELP_ACTIVITY("help_activity","初心互助-发布活动"), + ISSUE_SUBMIT("issue_submit","议题项目-我要报事"), + ISSUE_COMMENT("issue_comment","议题项目-评论"), + ITEM_SATISFACTION("item_satisfaction","项目详情-满意度评价"), + PARTY_GROUP_TOPIC("party_group_topic","党群1+1-发布话题"), + PARTY_GROUP_TOPIC_COMMENT("party_group_topic_comment","党群1+1-评论"), + HELP_SIGNIN("help_signIn","初心互助-已报名活动-我要打卡"); + + private String name; + + private String code; + + ModuleName(String code,String name){ + this.code=code; + this.name=name; + } + + public String getName() { + return name; + } + + public String getCode() { + return code; + } +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckContentFormDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckContentFormDTO.java new file mode 100644 index 00000000..43114a5b --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckContentFormDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: esua-epdc + * @description: 校验数据传输数据 + * @author: wangtong + * @create: 2020-07-03 17:23 + **/ +@Data +public class CheckContentFormDTO implements Serializable { + + + private static final long serialVersionUID = -8348919053746539794L; + + /** + * 要审核的内容Id + */ + private String dataId; + + /** + * 要审核的内容 + */ + private String content; + + /** + * 要审核的图片地址 + */ + private String url; +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckDataFromDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckDataFromDTO.java new file mode 100644 index 00000000..c8537528 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckDataFromDTO.java @@ -0,0 +1,21 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @program: esua-epdc + * @description: 内容审核传参 + * @author: wangtong + * @create: 2020-07-06 09:14 + **/ +@Data +public class CheckDataFromDTO implements Serializable { + + + private static final long serialVersionUID = -4551870884807465268L; + + private List tasks; +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/ParentAndAllDeptDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/ParentAndAllDeptDTO.java new file mode 100644 index 00000000..e2873540 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/ParentAndAllDeptDTO.java @@ -0,0 +1,51 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 机构拼接信息 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/9/7 9:8 + */ +@Data +public class ParentAndAllDeptDTO implements Serializable { + + private static final long serialVersionUID = 8264059305193996215L; +// /** +// * 部门名称 +// */ +// private String deptName; +// /** +// * 部门id +// */ +// private Long deptId; + /** + * 网格名称/部门名称 + */ + private String grid; + /** + * 网格ID/部门id + */ + private Long gridId; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; +} diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/SaveCheckRecordsDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/SaveCheckRecordsDTO.java new file mode 100644 index 00000000..9ba6c589 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/SaveCheckRecordsDTO.java @@ -0,0 +1,122 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * @program: esua-epdc + * @description: 保存审核记录信息 + * @author: wangtong + * @create: 2020-07-06 16:07 + **/ +@Data +public class SaveCheckRecordsDTO implements Serializable { + + private static final long serialVersionUID = -9048821001719866937L; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名称 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 工作类别:1工作2居民 + */ + private String category; + + /** + * 关联信息表ID + */ + private String relationId; + + /** + * 判定方式:1系统2人工 + */ + private String decision; + + /** + * 功能模块 + */ + private String module; + + /** + * 内容 + */ + private String content; + + /** + * 图片地址 + */ + private List imgUrls; + + /** + * 系统审核状态:0正常1异常 + */ + private String system; + + /** + * 系统返回编码 + */ + private String code; + + /** + * 系统返回信息 + */ + private String msg; + + /** + * 审核状态 + */ + private String suggestion; + + + /** + * 检测结果分类 + */ + private String label; + + + /** + * 结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。 + */ + private BigDecimal rate; + + + /** + * 部门ID + */ + private Long deptId; + /** + * 部门名称 + */ + private String deptName; + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckDetailResultsDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckDetailResultsDTO.java new file mode 100644 index 00000000..c44dfd17 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckDetailResultsDTO.java @@ -0,0 +1,41 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @program: esua-epdc + * @description: 审核详情-详细结果 + * @author: wangtong + * @create: 2020-07-06 13:55 + **/ +@Data +public class CheckDetailResultsDTO implements Serializable { + + private static final long serialVersionUID = 8601710510211924859L; + + /** + *结果属于当前分类的概率,取值范围: + * 0.00~100.00。值越高,表示越有可能属于当前分类。 + */ + private BigDecimal rate; + + /** + * pass:文本正常 + * review:文本需要进一步人工审核 + * block:文本违规 + */ + private String suggestion; + + /** + * antispam + */ + private String scene; + + /** + *文本垃圾检测结果的分类 + */ + private String label; +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDTO.java new file mode 100644 index 00000000..2c940f4f --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDTO.java @@ -0,0 +1,38 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @program: esua-epdc + * @description: 审核结果信息 + * @author: wangtong + * @create: 2020-07-06 13:43 + **/ +@Data +public class CheckResultDTO implements Serializable { + + private static final long serialVersionUID = 6227038632643603309L; + + /** + * 审核通过的dataId列表 + */ + private List successDataIds; + + /** + *审核未通过的dataId列表 + */ + private List failDataIds; + + /** + *审核详情 + */ + private List details; + + /** + *提交的任务是否全部通过,true-是;false-否 + */ + private Boolean allPass = true; +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDetailsDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDetailsDTO.java new file mode 100644 index 00000000..1a254447 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDetailsDTO.java @@ -0,0 +1,38 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @program: esua-epdc + * @description: 审核结果详情 + * @author: wangtong + * @create: 2020-07-06 13:51 + **/ +@Data +public class CheckResultDetailsDTO implements Serializable { + + private static final long serialVersionUID = 4004896322410088693L; + + /** + * 状态码 + */ + private Integer code; + + /** + *响应信息 + */ + private String msg; + + /** + *检测的数据Id + */ + private String dataId; + + /** + *审核详细结果 + */ + private List results; +} \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultMessageDTO.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultMessageDTO.java new file mode 100644 index 00000000..1bf467a5 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultMessageDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.commons.tools.security.content.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @program: esua-epdc + * @description: 组装审核结果分类 + * @author: wangtong + * @create: 2020-07-07 16:16 + **/ +@Data +public class CheckResultMessageDTO implements Serializable { + + private static final long serialVersionUID = -1831600854629135265L; + + /** + * 审核状态 + */ + private String suggestion; + + /** + * 检测结果分类 + */ + private String label; + + /** + * 结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。 + */ + private BigDecimal rate; +} \ No newline at end of file diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index 89aff5a1..698173f7 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -140,6 +140,8 @@ http://127.0.0.1:9078 + lb://epdc-content-security-server + false 47.104.224.45:8848 @@ -187,6 +189,7 @@ lb://epdc-points-server lb://epdc-party-group-server lb://epdc-analysis-server + lb://epdc-content-security-server true 47.104.224.45:8848 @@ -226,6 +229,8 @@ lb://epdc-points-server lb://epdc-party-group-server lb://epdc-analysis-server + lb://epdc-content-security-server + 0 172.16.0.8 diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index d2b054d0..fd2cecf2 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -196,6 +196,14 @@ spring: - Path=${server.servlet.context-path}/partyGroup/** filters: - StripPrefix=1 + - #安全模块 + - id: epdc-content-security-server + uri: @gateway.routes.epdc-content-security-server.uri@ + order: 21 + predicates: + - Path=${server.servlet.context-path}/contentSecurity/** + filters: + - StripPrefix=1 nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/esua-epdc/epdc-module/epdc-content-security/db/mysql.sql b/esua-epdc/epdc-module/epdc-content-security/db/mysql.sql new file mode 100644 index 00000000..e69de29b diff --git a/esua-epdc/epdc-module/epdc-content-security/db/oracle.sql b/esua-epdc/epdc-module/epdc-content-security/db/oracle.sql new file mode 100644 index 00000000..e69de29b diff --git a/esua-epdc/epdc-module/epdc-content-security/db/postgresql.sql b/esua-epdc/epdc-module/epdc-content-security/db/postgresql.sql new file mode 100644 index 00000000..e69de29b diff --git a/esua-epdc/epdc-module/epdc-content-security/db/sqlserver.sql b/esua-epdc/epdc-module/epdc-content-security/db/sqlserver.sql new file mode 100644 index 00000000..e69de29b diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/pom.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/pom.xml new file mode 100644 index 00000000..245fc4d8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + + com.esua.epdc + epdc-content-security + 1.0.0 + + + epdc-content-security-client + jar + + + + com.esua.epdc + epdc-commons-tools + 1.0.0 + + + + + ${project.artifactId} + + + diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckCodeDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckCodeDTO.java new file mode 100644 index 00000000..ef342c86 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckCodeDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class CheckCodeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private Integer id; + + /** + * 类型:content文本内容,module功能模块 + */ + private String type; + + /** + * 编码 + */ + private String code; + + /** + * 描述 + */ + private String description; + + /** + * 删除标识:0未删除 1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckImgsDetailsDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckImgsDetailsDTO.java new file mode 100644 index 00000000..cddeb428 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckImgsDetailsDTO.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: esua-epdc + * @description: 待审核详情图片 + * @author: wangtong + * @create: 2020-07-13 14:32 + **/ +@Data +public class CheckImgsDetailsDTO implements Serializable { + + private static final long serialVersionUID = 889405718937714779L; + + private String url; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsDTO.java new file mode 100644 index 00000000..0a5e55ec --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsDTO.java @@ -0,0 +1,159 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class CheckRecordsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名称 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 系统审核状态:0正常1异常 + */ + private String system; + + /** + * 工作类别:1工作2居民 + */ + private String category; + + /** + * 关联信息表ID + */ + private String relationId; + + /** + * 功能模块 + */ + private String module; + + /** + * 内容 + */ + private String content; + + /** + * 图片地址 + */ + private String url; + + /** + * 系统返回编码 + */ + private String code; + + /** + * 系统返回信息 + */ + private String msg; + + /** + * 审核状态 + */ + private String checkState; + + /** + * 审核建议 + */ + private String suggestion; + + /** + * 审核状态编码 + */ + private String suggestionCode; + + /** + * 检测结果分类 + */ + private String label; + + /** + * 结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。 + */ + private BigDecimal rate; + + /** + * 是否全部审核通过 + */ + private String allPass; + + /** + * 删除标识:0未删除 1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private String createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private String auditTime; + + private List imgUrls; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsImgsDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsImgsDTO.java new file mode 100644 index 00000000..06beab1f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsImgsDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 待审核图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class CheckRecordsImgsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String url; + + /** + * 缩略图 + */ + private String thumbnail; + + /** + * 排序 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckResultDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckResultDTO.java new file mode 100644 index 00000000..ace4209c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckResultDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 审核结果 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class CheckResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 记录表ID + */ + private String recordId; + + /** + * 审批结果 + */ + private String result; + + /** + * 审批人 + */ + private String approverId; + + /** + * 是否已经发送消息Y/N + */ + private String isSend; + + /** + * 审批意见 + */ + private String suggestion; + + /** + * 删除标识:0未删除 1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/DemoDto.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/DemoDto.java new file mode 100644 index 00000000..8d92d996 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/DemoDto.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +public class DemoDto implements Serializable { + + private static final long serialVersionUID = -8056876497668990939L; + + /** + * 用户ID + */ + private Long id; + /** + * 用户名 + */ + private String name; + /** + * 手机号 + */ + private int age; +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsDetailsDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsDetailsDTO.java new file mode 100644 index 00000000..3d9060fc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsDetailsDTO.java @@ -0,0 +1,20 @@ +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: esua-epdc + * @description: 违规记录详情 + * @author: wangtong + * @create: 2020-07-10 11:05 + **/ +@Data +public class ViolationsDetailsDTO implements Serializable { + + + private static final long serialVersionUID = 1146695071941329751L; + + private String url; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsDTO.java new file mode 100644 index 00000000..a3bf1dc2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class ViolationsRecordsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + + /** + * 用户名称 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 工作类别:1工作2居民 + */ + private String category; + + + /** + * 判定方式:1系统2人工 + */ + private String decision; + + /** + * 功能模块 + */ + private String module; + + /** + * 内容 + */ + private String content; + + /** + * 图片地址 + */ + private String url; + + /** + * 审核状态 + */ + private String suggestion; + + /** + * 检测结果分类 + */ + private String label; + + /** + * 结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。 + */ + private BigDecimal rate; + + + /** + * 提交时间 + */ + private String createdTime; + + /** + * 审批时间 + */ + private String auditTime; + + + /** + * 更新时间 + */ + private Date updatedTime; + + + private List imgUrls; + + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsImgsDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsImgsDTO.java new file mode 100644 index 00000000..4a6a036b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsImgsDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 违规记录图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class ViolationsRecordsImgsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String url; + + /** + * 缩略图 + */ + private String thumbnail; + + /** + * 排序 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/form/HandleRecordsFormDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/form/HandleRecordsFormDTO.java new file mode 100644 index 00000000..140f1e64 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/form/HandleRecordsFormDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: esua-epdc + * @description: 处理待审核记录 + * @author: wangtong + * @create: 2020-07-13 17:49 + **/ +@Data +public class HandleRecordsFormDTO implements Serializable { + + private static final long serialVersionUID = -9152257649225080975L; + + /** + * 待审核记录ID + */ + private String id; + + /** + * 处理操作:pass通过 + * block驳回 + */ + private String result; + + /** + * 审核意见 + */ + private String suggestion; +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/Dockerfile b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/Dockerfile new file mode 100644 index 00000000..dca4a2a5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/Dockerfile @@ -0,0 +1,20 @@ +# 基础镜像 +FROM openjdk:8u242-jre-buster +# 作者 +MAINTAINER rongchao@elink-cn.com +# 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_FILE的值 +ARG JAR_FILE +# 对应pom.xml文件中的dockerfile-maven-plugin插件JAR_NAME的值 +ARG JAR_NAME +# 对应pom.xml文件中的dockerfile-maven-plugin插件SERVER_PORT的值 +ARG SERVER_PORT +# 复制打包完成后的jar文件到/opt目录下 +ENV JAR_PATH /mnt/epdc/${JAR_NAME}.jar +ADD ${JAR_FILE} $JAR_PATH +# /data设为环境变量 +ENV DATAPATH /data +# 挂载/data目录到主机 +VOLUME $DATAPATH +# 启动容器时执行 +ENTRYPOINT java -jar -Xmx512m $JAR_PATH +EXPOSE ${SERVER_PORT} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml new file mode 100644 index 00000000..b4de6f20 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml @@ -0,0 +1,254 @@ + + + 4.0.0 + + + com.esua.epdc + epdc-content-security + 1.0.0 + + + epdc-content-security-server + jar + + + com.esua.epdc + epdc-content-security-client + 1.0.0 + + + com.esua.epdc + epdc-commons-mybatis + 1.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + com.esua.epdc + epdc-commons-tools-wx-ma + ${project.version} + + + + + com.esua.epdc + epdc-commons-api-version-control + ${project.version} + + + + org.apache.rocketmq + rocketmq-spring-boot-starter + 2.0.3 + + + com.esua.epdc + epdc-message-client + 1.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + com.spotify + dockerfile-maven-plugin + + + + ${project.basedir}/src/main/java + + + + true + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + + + + + + dev + + true + + + dev + + 9079 + + 2 + 114.215.125.123 + 9603 + epdc!redis@master1405 + + + + + jinshui + jinshui@833066 + + false + 47.104.224.45:8848 + + + 47.104.224.45 + fa5bf520-09c1-410c-a876-28e98c0534d3 + + + wx6dcf544cdae7d4ec + 9e0882274ad3821400370312a56a8470 + + wx826a8435db9e0947 + cbcb7c422f00d165105b34dc80bb825f + + wx3ea0a6fb71ddf659 + 2154e86d56df9fae4224c93a17e01bb3 + + + + 47.104.85.99:9876;114.215.125.123:9876 + contentSecurityGroup + + + + + test + + test + + 11015 + + 2 + 114.215.125.123 + 9603 + epdc!redis@master1405 + + + + + jinshui + jinshui@833066 + + true + 47.104.224.45:8848 + 47.104.224.45 + fa5bf520-09c1-410c-a876-28e98c0534d3 + + + wx6dcf544cdae7d4ec + 9e0882274ad3821400370312a56a8470 + + wx826a8435db9e0947 + cbcb7c422f00d165105b34dc80bb825f + + wx3ea0a6fb71ddf659 + 2154e86d56df9fae4224c93a17e01bb3 + + + 47.104.85.99:9876;114.215.125.123:9876 + contentSecurityGroup + + + + + prod + + prod + + 9076 + + + 0 + 172.16.0.8 + 6379 + epdc!redis@master1405 + + wx6dcf544cdae7d4ec + 9e0882274ad3821400370312a56a8470 + + wx826a8435db9e0947 + cbcb7c422f00d165105b34dc80bb825f + + wx3ea0a6fb71ddf659 + 2154e86d56df9fae4224c93a17e01bb3 + + true + 172.16.0.7:10000,172.16.0.7:10001 + 172.16.0.8 + + + + + + epdc + epdc@jinshui888 + 172.16.0.52:9876;172.16.0.54:9876 + contentSecurityGroup + + + + + diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/ContentSecurityApplication.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/ContentSecurityApplication.java new file mode 100644 index 00000000..5512ce0a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/ContentSecurityApplication.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class ContentSecurityApplication { + + public static void main(String[] args) { + SpringApplication.run(ContentSecurityApplication.class, args); + } + +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/async/RejectCheckResultsTask.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/async/RejectCheckResultsTask.java new file mode 100644 index 00000000..b0f3994b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/async/RejectCheckResultsTask.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.async; + +import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; +import com.elink.esua.epdc.feign.MessageFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +/** + * + * 内容审核-违规 - 发送短信 + * + * @Author:wangtong + * @Date:2020/7/16 10:31 + */ +@Component +public class RejectCheckResultsTask { + + @Autowired + private MessageFeignClient messageFeignClient; + + /** + * @describe: 短信通知 + * @author wangtong + * @date 2020/7/16 9:49 + * @params [smsNoticeFormDTO] + * @return void + */ + @Async + public void sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { + messageFeignClient.sendSmsNotice(smsNoticeFormDTO); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java new file mode 100644 index 00000000..299fc4ca --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.config; + +import com.elink.esua.epdc.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "demo"; + } +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckCodeController.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckCodeController.java new file mode 100644 index 00000000..150bfc8c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckCodeController.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.CheckCodeDTO; +import com.elink.esua.epdc.entity.CheckCodeEntity; +import com.elink.esua.epdc.excel.CheckCodeExcel; +import com.elink.esua.epdc.service.CheckCodeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@RestController +@RequestMapping("checkcode") +public class CheckCodeController { + + @Autowired + private CheckCodeService checkCodeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = checkCodeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CheckCodeDTO data = checkCodeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CheckCodeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + checkCodeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CheckCodeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + checkCodeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + checkCodeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = checkCodeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CheckCodeExcel.class); + } + + /** + * @describe: 根据type获取字典数据 + * @author wangtong + * @date 2020/7/14 9:33 + * @param [type] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + */ + @GetMapping("getResourcesByType") + public Result> getResourcesByType(String type){ + return checkCodeService.getResourcesByType(type); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckRecordsController.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckRecordsController.java new file mode 100644 index 00000000..29449ac1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckRecordsController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.CheckRecordsDTO; +import com.elink.esua.epdc.excel.CheckRecordsExcel; +import com.elink.esua.epdc.service.CheckRecordsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@RestController +@RequestMapping("checkrecords") +public class CheckRecordsController { + + @Autowired + private CheckRecordsService checkRecordsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = checkRecordsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CheckRecordsDTO data = checkRecordsService.getDetails(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CheckRecordsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + checkRecordsService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CheckRecordsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + checkRecordsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + checkRecordsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = checkRecordsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CheckRecordsExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckResultController.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckResultController.java new file mode 100644 index 00000000..2cc94ffc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckResultController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.CheckResultDTO; +import com.elink.esua.epdc.excel.CheckResultExcel; +import com.elink.esua.epdc.service.CheckResultService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 审核结果 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@RestController +@RequestMapping("checkresult") +public class CheckResultController { + + @Autowired + private CheckResultService checkResultService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = checkResultService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CheckResultDTO data = checkResultService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CheckResultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + checkResultService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CheckResultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + checkResultService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + checkResultService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = checkResultService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CheckResultExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/HandleResultController.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/HandleResultController.java new file mode 100644 index 00000000..a0f819fb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/HandleResultController.java @@ -0,0 +1,70 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.HandleRecordsFormDTO; +import com.elink.esua.epdc.service.CheckRecordsService; +import com.elink.esua.epdc.service.CheckResultService; +import com.elink.esua.epdc.service.ViolationsRecordsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @program: esua-epdc + * @description: 处理审核结果 + * @author: wangtong + * @create: 2020-07-07 09:14 + **/ +@RestController +@RequestMapping("handleResult") +public class HandleResultController{ + + @Autowired + private ViolationsRecordsService violationsRecordsService; + + @Autowired + private CheckRecordsService checkRecordsService; + + @Autowired + private CheckResultService checkResultService; + + /** + * @describe: 保存违规记录 + * @author wangtong + * @date 2020/7/7 9:19 + * @param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @PostMapping("insertViolationsRecord") + public Result insertViolationsRecord(@RequestBody SaveCheckRecordsDTO formDto) { + return violationsRecordsService.insertViolationsRecord(formDto); + } + + /** + * @describe: 保存待审核记录 + * @author wangtong + * @date 2020/7/7 10:39 + * @param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @PostMapping("insertRecords") + public Result insertRecords(@RequestBody SaveCheckRecordsDTO formDto) { +// ValidatorUtils.validateEntity(formDto); + return checkRecordsService.insertRecords(formDto); + } + + /** + * @describe: 处理待审核记录 + * @author wangtong + * @date 2020/7/13 17:48 + * @param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @PostMapping("handleRecords") + public Result handleRecords(@RequestBody HandleRecordsFormDTO formDto) { + return checkResultService.handleRecords(formDto); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/ViolationsRecordsController.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/ViolationsRecordsController.java new file mode 100644 index 00000000..b52f1ee8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/ViolationsRecordsController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.dto.ViolationsRecordsDTO; +import com.elink.esua.epdc.excel.ViolationsRecordsExcel; +import com.elink.esua.epdc.service.ViolationsRecordsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@RestController +@RequestMapping("violationsrecords") +public class ViolationsRecordsController { + + @Autowired + private ViolationsRecordsService violationsRecordsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = violationsRecordsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ViolationsRecordsDTO data = violationsRecordsService.getDetails(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ViolationsRecordsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + violationsRecordsService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ViolationsRecordsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + violationsRecordsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + violationsRecordsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = violationsRecordsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ViolationsRecordsExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckCodeDao.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckCodeDao.java new file mode 100644 index 00000000..22029ecc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckCodeDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CheckCodeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Mapper +public interface CheckCodeDao extends BaseDao { + + /** + * @describe: 根据type获取字典数据 + * @author wangtong + * @date 2020/7/14 9:35 + * @param [type] + * @return java.util.List + */ + List getResourcesByType(@Param("type") String type); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsDao.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsDao.java new file mode 100644 index 00000000..0584a383 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsDao.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.CheckRecordsDTO; +import com.elink.esua.epdc.entity.CheckRecordsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Mapper +public interface CheckRecordsDao extends BaseDao { + + /** + * @describe: 获取待审核列表 + * @author wangtong + * @date 2020/7/10 15:48 + * @param [params] + * @return java.util.List + */ + List getCheckRecords(Map params); + + /** + * @describe: 待审核详情 + * @author wangtong + * @date 2020/7/13 14:13 + * @param [id] + * @return com.elink.esua.epdc.dto.CheckRecordsDTO + */ + CheckRecordsDTO getDetails(@Param("id") String id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsImgsDao.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsImgsDao.java new file mode 100644 index 00000000..ecccca79 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsImgsDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CheckRecordsImgsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 待审核图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Mapper +public interface CheckRecordsImgsDao extends BaseDao { + + /** + * @describe: 根据待审核ID获取图片信息 + * @author wangtong + * @date 2020/7/13 19:35 + * @param [id] + * @return java.util.List + */ + List selectListByRecordId(@Param("id") String id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckResultDao.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckResultDao.java new file mode 100644 index 00000000..246778fe --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckResultDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.CheckResultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 审核结果 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Mapper +public interface CheckResultDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsDao.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsDao.java new file mode 100644 index 00000000..7ae17da2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsDao.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.ViolationsRecordsDTO; +import com.elink.esua.epdc.entity.ViolationsRecordsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Mapper +public interface ViolationsRecordsDao extends BaseDao { + + /** + * @describe: 违规记录列表 + * @author wangtong + * @date 2020/7/9 10:18 + * @param [params] + * @return java.util.List + */ + List getViolationsRecord(Map params); + + /** + * @describe: 违规记录详情 + * @author wangtong + * @date 2020/7/9 17:39 + * @param [id] + * @return com.elink.esua.epdc.dto.ViolationsRecordsDTO + */ + ViolationsRecordsDTO getDetails(@Param("id") String id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsImgsDao.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsImgsDao.java new file mode 100644 index 00000000..9df77edb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsImgsDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.entity.ViolationsRecordsImgsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 违规记录图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Mapper +public interface ViolationsRecordsImgsDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckCodeEntity.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckCodeEntity.java new file mode 100644 index 00000000..ad50cca6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckCodeEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_check_code") +public class CheckCodeEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 类型:content文本内容,module功能模块 + */ + private String type; + + /** + * 编码 + */ + private String code; + + /** + * 描述 + */ + private String description; + + /** + * 排序 + */ + private Integer sort; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsEntity.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsEntity.java new file mode 100644 index 00000000..48972f32 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsEntity.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_check_records") +public class CheckRecordsEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名称 + */ + private String name; + + /** + * 用户名称 + */ + private String system; + + /** + * 手机号 + */ + private String mobile; + + /** + * 工作类别:1工作2居民 + */ + private String category; + + /** + * 关联信息表ID + */ + private String relationId; + + /** + * 功能模块 + */ + private String module; + + /** + * 内容 + */ + private String content; + + /** + * 系统返回编码 + */ + private String code; + + /** + * 系统返回信息 + */ + private String msg; + + /** + * 审核状态 + */ + private String suggestion; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 检测结果分类 + */ + private String label; + + /** + * 结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。 + */ + private BigDecimal rate; + + /** + * 是否全部审核通过 + */ + private String allPass; + + /** + * 部门ID + */ + private Long deptId; + /** + * 部门名称 + */ + private String deptName; + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsImgsEntity.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsImgsEntity.java new file mode 100644 index 00000000..593149c7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsImgsEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 待审核图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_check_records_imgs") +public class CheckRecordsImgsEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String url; + + /** + * 缩略图 + */ + private String thumbnail; + + /** + * 排序 + */ + private Integer sort; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckResultEntity.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckResultEntity.java new file mode 100644 index 00000000..2a7ee151 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckResultEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 审核结果 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_check_result") +public class CheckResultEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 记录表ID + */ + private String recordId; + + /** + * 审批结果 + */ + private String result; + + /** + * 审批人 + */ + private String approverId; + + /** + * 是否已经发送消息Y/N + */ + private String isSend; + + /** + * 审批意见 + */ + private String suggestion; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsEntity.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsEntity.java new file mode 100644 index 00000000..4dbf0196 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsEntity.java @@ -0,0 +1,137 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_violations_records") +public class ViolationsRecordsEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名称 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 工作类别:1工作2居民 + */ + private String category; + + /** + * 关联信息表ID + */ + private String relationId; + + /** + * 判定方式:1系统2人工 + */ + private String decision; + + /** + * 功能模块 + */ + private String module; + + /** + * 内容 + */ + private String content; + + /** + * 系统返回编码 + */ + private String code; + + /** + * 系统返回信息 + */ + private String msg; + + /** + * 审核状态 + */ + private String suggestion; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 检测结果分类 + */ + private String label; + + /** + * 结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。 + */ + private BigDecimal rate; + + + /** + * 部门ID + */ + private Long deptId; + /** + * 部门名称 + */ + private String deptName; + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsImgsEntity.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsImgsEntity.java new file mode 100644 index 00000000..ccc6c262 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsImgsEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 违规记录图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_violations_records_imgs") +public class ViolationsRecordsImgsEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String url; + + /** + * 缩略图 + */ + private String thumbnail; + + /** + * 排序 + */ + private Integer sort; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckCodeExcel.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckCodeExcel.java new file mode 100644 index 00000000..7df53c6f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckCodeExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Data +public class CheckCodeExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "类型:1文字2图片") + private String type; + + @Excel(name = "编码") + private String code; + + @Excel(name = "描述") + private String description; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsExcel.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsExcel.java new file mode 100644 index 00000000..01de3288 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsExcel.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Data +public class CheckRecordsExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户名称") + private String name; + + @Excel(name = "工作类别:1工作2居民") + private String category; + + @Excel(name = "关联信息表ID") + private String relationId; + + @Excel(name = "类型:1文字2图片") + private Integer type; + + @Excel(name = "功能模块") + private String module; + + @Excel(name = "内容") + private String content; + + @Excel(name = "图片地址") + private String url; + + @Excel(name = "系统返回编码") + private String code; + + @Excel(name = "系统返回信息") + private String msg; + + @Excel(name = "审核状态") + private String suggestionText; + + @Excel(name = "图片鉴黄审核状态") + private String suggestionImgPorn; + + @Excel(name = "图片暴恐涉政审核状态") + private String suggestionImgTerrorism; + + @Excel(name = "检测结果分类") + private String labelText; + + @Excel(name = "图片鉴黄") + private String labelImgPorn; + + @Excel(name = "图片暴恐涉政识别") + private String labelImgTerrorism; + + @Excel(name = "结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。") + private BigDecimal rate; + + @Excel(name = "是否全部审核通过") + private String allPass; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsImgsExcel.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsImgsExcel.java new file mode 100644 index 00000000..c1e0c5c1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsImgsExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 待审核图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class CheckRecordsImgsExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "引用ID") + private String referenceId; + + @Excel(name = "图片地址") + private String url; + + @Excel(name = "缩略图") + private String thumbnail; + + @Excel(name = "排序") + private Integer sort; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckResultExcel.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckResultExcel.java new file mode 100644 index 00000000..6bf075a3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckResultExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 审核结果 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Data +public class CheckResultExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "记录表ID") + private String recordId; + + @Excel(name = "审批结果") + private String result; + + @Excel(name = "审批人") + private String approverId; + + @Excel(name = "是否已经发送消息Y/N") + private String isSend; + + @Excel(name = "审批意见") + private String suggestion; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsExcel.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsExcel.java new file mode 100644 index 00000000..3840265a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsExcel.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Data +public class ViolationsRecordsExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户名称") + private String name; + + @Excel(name = "工作类别:1工作2居民") + private String category; + + @Excel(name = "关联信息表ID") + private String relationId; + + @Excel(name = "类型:1文字2图片") + private Integer type; + + @Excel(name = "判定方式:1系统2人工") + private String decision; + + @Excel(name = "功能模块") + private String module; + + @Excel(name = "内容") + private String content; + + @Excel(name = "图片地址") + private String url; + + @Excel(name = "系统返回编码") + private String code; + + @Excel(name = "系统返回信息") + private String msg; + + @Excel(name = "审核状态") + private String suggestionText; + + @Excel(name = "图片鉴黄审核状态") + private String suggestionImgPorn; + + @Excel(name = "图片暴恐涉政审核状态") + private String suggestionImgTerrorism; + + @Excel(name = "检测结果分类") + private String labelText; + + @Excel(name = "图片鉴黄") + private String labelImgPorn; + + @Excel(name = "图片暴恐涉政识别") + private String labelImgTerrorism; + + @Excel(name = "结果属于当前分类的概率,取值范围:0.00~100.00。值越高,表示越有可能属于当前分类。") + private BigDecimal rate; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsImgsExcel.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsImgsExcel.java new file mode 100644 index 00000000..401ac83f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsImgsExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 违规记录图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Data +public class ViolationsRecordsImgsExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "引用ID") + private String referenceId; + + @Excel(name = "图片地址") + private String url; + + @Excel(name = "缩略图") + private String thumbnail; + + @Excel(name = "排序") + private Integer sort; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/exception/ModuleErrorCode.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/exception/ModuleErrorCode.java new file mode 100644 index 00000000..4f56d60c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/exception/ModuleErrorCode.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.exception; + +import com.elink.esua.epdc.commons.tools.exception.ErrorCode; + +/** + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

+ * 如:100001001(100001代表模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ModuleErrorCode extends ErrorCode { + +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/MessageFeignClient.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/MessageFeignClient.java new file mode 100644 index 00000000..de565797 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/MessageFeignClient.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; +import com.elink.esua.epdc.feign.fallback.MessageFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 消息通知模块 + * + * @Author:wangtong + * @Date:2020/7/16 10:31 + */ +@FeignClient(name = ServiceConstant.EPDC_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) +public interface MessageFeignClient { + + /** + * 议题:待回应事件 审核结果短信通知 议题发起人 + * + * @param smsNoticeFormDTO + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author zy + * @Date:2020/01/08 10:31 + */ + @PostMapping(value = "message/epdc-app/smstemplate/sendSmsNotice", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result sendSmsNotice(@RequestBody SmsNoticeFormDTO smsNoticeFormDTO); +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/fallback/MessageFeignClientFallback.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/fallback/MessageFeignClientFallback.java new file mode 100644 index 00000000..47880c64 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/fallback/MessageFeignClientFallback.java @@ -0,0 +1,21 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; +import com.elink.esua.epdc.feign.MessageFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Author:wangtong + * @Date:2020/7/16 10:31 + */ +@Component +public class MessageFeignClientFallback implements MessageFeignClient { + + @Override + public Result sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_MESSAGE_SERVER, "sendSmsNotice", smsNoticeFormDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckCodeRedis.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckCodeRedis.java new file mode 100644 index 00000000..55d6d7ae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckCodeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Component +public class CheckCodeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsImgsRedis.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsImgsRedis.java new file mode 100644 index 00000000..809b52a3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsImgsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 待审核图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Component +public class CheckRecordsImgsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsRedis.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsRedis.java new file mode 100644 index 00000000..09b1c055 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Component +public class CheckRecordsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckResultRedis.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckResultRedis.java new file mode 100644 index 00000000..3acabcca --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckResultRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

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

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 违规记录图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Component +public class ViolationsRecordsImgsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/ViolationsRecordsRedis.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/ViolationsRecordsRedis.java new file mode 100644 index 00000000..e6e20a69 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/ViolationsRecordsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Component +public class ViolationsRecordsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java new file mode 100644 index 00000000..51111c4c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.rocketmq.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 内容审核驳回信息处理-发送MQ消息DTO + * + * @Author: wangtong + * @Date: 2020/7/14 14:58 + */ +@Data +public class RejectRecordDTO implements Serializable { + + private static final long serialVersionUID = 3032661994413974324L; + /** + * 用户ID + */ + private String userId; + + /** + * 关联信息ID + */ + private String relationId; +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/producer/RejectCheckRecordProducer.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/producer/RejectCheckRecordProducer.java new file mode 100644 index 00000000..50046ed3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/producer/RejectCheckRecordProducer.java @@ -0,0 +1,45 @@ +package com.elink.esua.epdc.rocketmq.producer; + +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.client.producer.DefaultMQProducer; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * 驳回待审核信息-发送MQ消息 + * + * @Author:wangtong + * @Date:2020/7/14 11:22 + */ +@Slf4j +@Component +public class RejectCheckRecordProducer { + + @Autowired + private RocketMQTemplate rocketMQTemplate; + + /** + * @describe: 发送消息 + * @author wangtong + * @date 2020/7/14 11:22 + * @params [topic, tag, keys, body] + * @return void + */ + public void sendMessage(String topic, String tag, String keys, String body) { + Message message = new Message(topic, tag, keys, body.getBytes()); + try { + DefaultMQProducer producer = rocketMQTemplate.getProducer(); + producer.setSendMsgTimeout(15000); + SendResult sendResult = producer.send(message); + log.info("EPDC-CONTENT-SECURITY-SERVER发送消息结果:{sendStatus:{}, topic:{}, msgId:{}}", sendResult.getSendStatus(), topic, sendResult.getMsgId()); + } catch (Exception e) { + log.error("EPDC-CONTENT-SECURITY-SERVER发送消息异常:{topic:{}, tag:{}, keys:{}, body:{}}", topic, tag, keys, body); + e.printStackTrace(); + } + } + +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckCodeService.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckCodeService.java new file mode 100644 index 00000000..c731fb20 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckCodeService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CheckCodeDTO; +import com.elink.esua.epdc.entity.CheckCodeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +public interface CheckCodeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CheckCodeDTO + * @author generator + * @date 2020-07-03 + */ + CheckCodeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void save(CheckCodeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void update(CheckCodeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-03 + */ + void delete(String[] ids); + + /** + * @describe: 根据type获取字典数据 + * @author wangtong + * @date 2020/7/14 9:33 + * @param [type] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + */ + Result> getResourcesByType(String type); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsImgsService.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsImgsService.java new file mode 100644 index 00000000..b0a82f35 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsImgsService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CheckRecordsImgsDTO; +import com.elink.esua.epdc.entity.CheckRecordsImgsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 待审核图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +public interface CheckRecordsImgsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CheckRecordsImgsDTO + * @author generator + * @date 2020-07-08 + */ + CheckRecordsImgsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-08 + */ + void save(CheckRecordsImgsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-08 + */ + void update(CheckRecordsImgsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-08 + */ + void delete(String[] ids); + + + /** + * @describe: 插入待审核记录 + * @author wangtong + * @date 2020/7/8 10:01 + * @param [imgUrls, id] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result insertImages(List imgUrls, String id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsService.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsService.java new file mode 100644 index 00000000..8abe09e7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsService.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CheckRecordsDTO; +import com.elink.esua.epdc.entity.CheckRecordsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +public interface CheckRecordsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CheckRecordsDTO + * @author generator + * @date 2020-07-03 + */ + CheckRecordsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void save(CheckRecordsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void update(CheckRecordsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-03 + */ + void delete(String[] ids); + + /** + * @describe: 保存待审核记录 + * @author wangtong + * @date 2020/7/7 10:39 + * @param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result insertRecords(SaveCheckRecordsDTO formDto); + + /** + * @describe: 待审核详情 + * @author wangtong + * @date 2020/7/13 14:10 + * @param [id] + * @return com.elink.esua.epdc.dto.CheckRecordsDTO + */ + CheckRecordsDTO getDetails(String id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckResultService.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckResultService.java new file mode 100644 index 00000000..9f00330d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckResultService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CheckResultDTO; +import com.elink.esua.epdc.dto.form.HandleRecordsFormDTO; +import com.elink.esua.epdc.entity.CheckResultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 审核结果 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +public interface CheckResultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CheckResultDTO + * @author generator + * @date 2020-07-03 + */ + CheckResultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void save(CheckResultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void update(CheckResultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-03 + */ + void delete(String[] ids); + + /** + * @describe: 处理待审核记录 + * @author wangtong + * @date 2020/7/13 17:53 + * @param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result handleRecords(HandleRecordsFormDTO formDto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsImgsService.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsImgsService.java new file mode 100644 index 00000000..b12b976d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsImgsService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ViolationsRecordsImgsDTO; +import com.elink.esua.epdc.entity.ViolationsRecordsImgsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 违规记录图片信息 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +public interface ViolationsRecordsImgsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-08 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-08 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ViolationsRecordsImgsDTO + * @author generator + * @date 2020-07-08 + */ + ViolationsRecordsImgsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-08 + */ + void save(ViolationsRecordsImgsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-08 + */ + void update(ViolationsRecordsImgsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-08 + */ + void delete(String[] ids); + + /** + * @describe: 插入违规记录图片 + * @author wangtong + * @date 2020/7/8 9:54 + * @param [imgUrls, id] + * @return Result + */ + Result insertImages(List imgUrls, String id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsService.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsService.java new file mode 100644 index 00000000..1727c067 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsService.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.ViolationsRecordsDTO; +import com.elink.esua.epdc.entity.ViolationsRecordsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +public interface ViolationsRecordsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ViolationsRecordsDTO + * @author generator + * @date 2020-07-03 + */ + ViolationsRecordsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void save(ViolationsRecordsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-03 + */ + void update(ViolationsRecordsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-03 + */ + void delete(String[] ids); + + /** + * @describe: 保存违规记录 + * @author wangtong + * @date 2020/7/7 9:20 + * @param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result insertViolationsRecord(SaveCheckRecordsDTO formDto); + + + + /** + * @describe: 获取违规记录详情 + * @author wangtong + * @date 2020/7/9 17:38 + * @param [id] + * @return com.elink.esua.epdc.dto.ViolationsRecordsDTO + */ + ViolationsRecordsDTO getDetails(String id); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckCodeServiceImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckCodeServiceImpl.java new file mode 100644 index 00000000..6c39b4a0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckCodeServiceImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.CheckCodeDao; +import com.elink.esua.epdc.dto.CheckCodeDTO; +import com.elink.esua.epdc.entity.CheckCodeEntity; +import com.elink.esua.epdc.redis.CheckCodeRedis; +import com.elink.esua.epdc.service.CheckCodeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 检测编码信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Service +public class CheckCodeServiceImpl extends BaseServiceImpl implements CheckCodeService { + + @Autowired + private CheckCodeRedis checkCodeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CheckCodeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CheckCodeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CheckCodeDTO get(String id) { + CheckCodeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CheckCodeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CheckCodeDTO dto) { + CheckCodeEntity entity = ConvertUtils.sourceToTarget(dto, CheckCodeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CheckCodeDTO dto) { + CheckCodeEntity entity = ConvertUtils.sourceToTarget(dto, CheckCodeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result> getResourcesByType(String type) { + List result = baseDao.getResourcesByType(type); + return new Result>().ok(result); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsImgsServiceImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsImgsServiceImpl.java new file mode 100644 index 00000000..d649ce07 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsImgsServiceImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.CheckRecordsImgsDao; +import com.elink.esua.epdc.dto.CheckRecordsImgsDTO; +import com.elink.esua.epdc.entity.CheckRecordsImgsEntity; +import com.elink.esua.epdc.redis.CheckRecordsImgsRedis; +import com.elink.esua.epdc.service.CheckRecordsImgsService; +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 qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Service +public class CheckRecordsImgsServiceImpl extends BaseServiceImpl implements CheckRecordsImgsService { + + @Autowired + private CheckRecordsImgsRedis checkRecordsImgsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CheckRecordsImgsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CheckRecordsImgsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CheckRecordsImgsDTO get(String id) { + CheckRecordsImgsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CheckRecordsImgsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CheckRecordsImgsDTO dto) { + CheckRecordsImgsEntity entity = ConvertUtils.sourceToTarget(dto, CheckRecordsImgsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CheckRecordsImgsDTO dto) { + CheckRecordsImgsEntity entity = ConvertUtils.sourceToTarget(dto, CheckRecordsImgsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional + public Result insertImages(List imgUrls, String referencrId) { + List fileEntities = new ArrayList<>(imgUrls.size()); + int j = 0; + for(String url : imgUrls){ + CheckRecordsImgsEntity entity = new CheckRecordsImgsEntity(); + entity.setReferenceId(referencrId); + entity.setUrl(url); + entity.setSort(j); + fileEntities.add(entity); + j++; + } + insertBatch(fileEntities); + return new Result(); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsServiceImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsServiceImpl.java new file mode 100644 index 00000000..36846937 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsServiceImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.CheckRecordsDao; +import com.elink.esua.epdc.dto.CheckRecordsDTO; +import com.elink.esua.epdc.entity.CheckRecordsEntity; +import com.elink.esua.epdc.redis.CheckRecordsRedis; +import com.elink.esua.epdc.service.CheckRecordsImgsService; +import com.elink.esua.epdc.service.CheckRecordsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 待审核记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Service +public class CheckRecordsServiceImpl extends BaseServiceImpl implements CheckRecordsService { + + @Autowired + private CheckRecordsRedis checkRecordsRedis; + + @Autowired + private CheckRecordsImgsService checkRecordsImgsService; + + @Override + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.getCheckRecords(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CheckRecordsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CheckRecordsDTO get(String id) { + CheckRecordsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CheckRecordsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CheckRecordsDTO dto) { + CheckRecordsEntity entity = ConvertUtils.sourceToTarget(dto, CheckRecordsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CheckRecordsDTO dto) { + CheckRecordsEntity entity = ConvertUtils.sourceToTarget(dto, CheckRecordsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result insertRecords(SaveCheckRecordsDTO formDto) { + CheckRecordsEntity entity = ConvertUtils.sourceToTarget(formDto, CheckRecordsEntity.class); + insert(entity); + checkRecordsImgsService.insertImages(formDto.getImgUrls(),entity.getId()); + return new Result(); + } + + @Override + public CheckRecordsDTO getDetails(String id) { + return baseDao.getDetails(id); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java new file mode 100644 index 00000000..87957e47 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java @@ -0,0 +1,231 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.async.RejectCheckResultsTask; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; +import com.elink.esua.epdc.commons.tools.security.content.ModuleName; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.constant.SysSmsTemplateConstant; +import com.elink.esua.epdc.dao.*; +import com.elink.esua.epdc.dto.CheckResultDTO; +import com.elink.esua.epdc.dto.form.HandleRecordsFormDTO; +import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; +import com.elink.esua.epdc.entity.*; +import com.elink.esua.epdc.redis.CheckResultRedis; +import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO; +import com.elink.esua.epdc.rocketmq.producer.RejectCheckRecordProducer; +import com.elink.esua.epdc.service.CheckResultService; +import com.elink.esua.epdc.service.ViolationsRecordsImgsService; +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.*; + +/** + * 审核结果 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Service +public class CheckResultServiceImpl extends BaseServiceImpl implements CheckResultService { + + @Autowired + private CheckResultRedis checkResultRedis; + + @Autowired + private CheckRecordsDao checkRecordsDao; + + @Autowired + private ViolationsRecordsDao violationsRecordsDao; + + @Autowired + private CheckRecordsImgsDao checkRecordsImgsDao; + + @Autowired + private ViolationsRecordsImgsDao violationsRecordsImgsDao; + + @Autowired + private ViolationsRecordsImgsService violationsRecordsImgsService; + + @Autowired + private RejectCheckRecordProducer rejectCheckRecordProducer; + + @Autowired + private RejectCheckResultsTask rejectCheckResultsTask; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CheckResultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CheckResultDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CheckResultDTO get(String id) { + CheckResultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CheckResultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CheckResultDTO dto) { + CheckResultEntity entity = ConvertUtils.sourceToTarget(dto, CheckResultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CheckResultDTO dto) { + CheckResultEntity entity = ConvertUtils.sourceToTarget(dto, CheckResultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional + public Result handleRecords(HandleRecordsFormDTO formDto) { + //更新待审核记录信息 + CheckRecordsEntity record = checkRecordsDao.selectById(formDto.getId()); + record.setAuditTime(new Date()); + record.setSuggestion(formDto.getResult()); + checkRecordsDao.updateById(record); + //保存审核记录 + CheckResultEntity entity = new CheckResultEntity(); + entity.setRecordId(formDto.getId()); + entity.setResult(formDto.getResult()); + String userId = null; + if(null != SecurityUser.getUser()){ + userId = SecurityUser.getUser().getId().toString(); + } + entity.setApproverId(userId); + entity.setIsSend("N"); + entity.setSuggestion(formDto.getSuggestion()); + baseDao.insert(entity); + if(CheckDataUtils.block.equals(formDto.getResult())){ + ViolationsRecordsEntity violationEntity = ConvertUtils.sourceToTarget(record, ViolationsRecordsEntity.class); + violationEntity.setDecision("2");//人工审核 + violationsRecordsDao.insert(violationEntity); + //保存图片 + List vioImgList = new ArrayList<>(); + List recordImgs = checkRecordsImgsDao.selectListByRecordId(record.getId()); + for(CheckRecordsImgsEntity recordImg : recordImgs){ + ViolationsRecordsImgsEntity vioImgEntity = new ViolationsRecordsImgsEntity(); + vioImgEntity.setReferenceId(violationEntity.getId()); + vioImgEntity.setUrl(recordImg.getUrl()); + vioImgEntity.setSort(recordImg.getSort()); + vioImgList.add(vioImgEntity); + } + violationsRecordsImgsService.insertBatch(vioImgList); + + //后台人工审核驳回,发送MQ消息 + String topic = null; + String tag = null; + + //初心互助 + if(ModuleName.HELP_ACTIVITY.getCode().equals(record.getModule())){ + topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY; + tag = RocketMqConstant.MQ_TAG_HEART_ACTIVITY_CONTENTSECURITY; + }else if(ModuleName.HELP_SIGNIN.getCode().equals(record.getModule())){ + topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY; + tag = RocketMqConstant.MQ_TAG_HEART_SIGNIN_CONTENTSECURITY; + } + //议题项目 + else if(ModuleName.ISSUE_SUBMIT.getCode().equals(record.getModule())){ + topic = RocketMqConstant.MQ_TOPIC_ISSUE_ITEM_CONTENTSECURITY; + tag = RocketMqConstant.MQ_TAG_ISSUE_ITEM_SUBMIT_CONTENTSECURITY; + }else if(ModuleName.ISSUE_COMMENT.getCode().equals(record.getModule())){ + topic = RocketMqConstant.MQ_TOPIC_ISSUE_ITEM_CONTENTSECURITY; + tag = RocketMqConstant.MQ_TAG_ISSUE_ITEM_COMMENT_CONTENTSECURITY; + }else if(ModuleName.ITEM_SATISFACTION.getCode().equals(record.getModule())){ + topic = RocketMqConstant.MQ_TOPIC_ISSUE_ITEM_CONTENTSECURITY; + tag = RocketMqConstant.MQ_TAG_ISSUE_ITEM_SATISFACTION_CONTENTSECURITY; + } + //党群1+1 + else if(ModuleName.PARTY_GROUP_TOPIC.getCode().equals(record.getModule())){ + topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY; + tag = RocketMqConstant.MQ_TAG_GROUP_TOPIC_CONTENTSECURITY; + }else if(ModuleName.PARTY_GROUP_TOPIC_COMMENT.getCode().equals(record.getModule())){ + topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY; + tag = RocketMqConstant.MQ_TAG_GROUP_TOPIC_COMMENT_CONTENTSECURITY; + } + RejectRecordDTO body = new RejectRecordDTO(); + body.setUserId(violationEntity.getUserId()); + body.setRelationId(violationEntity.getRelationId()); + rejectCheckRecordProducer.sendMessage(topic, tag,violationEntity.getId(), JSONObject.toJSONString(body)); + + //发送短信 + this.checkSmsNotification(violationEntity.getMobile()); + } + return new Result<>().ok("处理成功"); + } + + /** + * @describe: 人工审核内审违规后,向用户发送短信提示 + * @author wangtong + * @date 2020/7/16 9:42 + * @params [userMobile] + * @return void + */ + private void checkSmsNotification(String userMobile){ + List list = new ArrayList<>(); + list.add(userMobile); + // 驳回用户提交信息 操作发送短信 + SmsNoticeFormDTO sms = new SmsNoticeFormDTO(); + sms.setMobiles(list); + sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_CONTENT_SECURITY_BLOCK); + rejectCheckResultsTask.sendSmsNotice(sms); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsImgsServiceImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsImgsServiceImpl.java new file mode 100644 index 00000000..79ecb86d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsImgsServiceImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.ViolationsRecordsImgsDao; +import com.elink.esua.epdc.dto.ViolationsRecordsImgsDTO; +import com.elink.esua.epdc.entity.ViolationsRecordsImgsEntity; +import com.elink.esua.epdc.redis.ViolationsRecordsImgsRedis; +import com.elink.esua.epdc.service.ViolationsRecordsImgsService; +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 qu qu@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Service +public class ViolationsRecordsImgsServiceImpl extends BaseServiceImpl implements ViolationsRecordsImgsService { + + @Autowired + private ViolationsRecordsImgsRedis violationsRecordsImgsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ViolationsRecordsImgsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ViolationsRecordsImgsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ViolationsRecordsImgsDTO get(String id) { + ViolationsRecordsImgsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ViolationsRecordsImgsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ViolationsRecordsImgsDTO dto) { + ViolationsRecordsImgsEntity entity = ConvertUtils.sourceToTarget(dto, ViolationsRecordsImgsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ViolationsRecordsImgsDTO dto) { + ViolationsRecordsImgsEntity entity = ConvertUtils.sourceToTarget(dto, ViolationsRecordsImgsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional + public Result insertImages(List imgUrls, String referencrId) { + List fileEntities = new ArrayList<>(imgUrls.size()); + int j = 0; + for(String url : imgUrls){ + ViolationsRecordsImgsEntity entity = new ViolationsRecordsImgsEntity(); + entity.setReferenceId(referencrId); + entity.setUrl(url); + entity.setSort(j); + fileEntities.add(entity); + j++; + } + insertBatch(fileEntities); + return new Result(); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsServiceImpl.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsServiceImpl.java new file mode 100644 index 00000000..c5aac96a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsServiceImpl.java @@ -0,0 +1,127 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.ViolationsRecordsDao; +import com.elink.esua.epdc.dto.ViolationsRecordsDTO; +import com.elink.esua.epdc.entity.ViolationsRecordsEntity; +import com.elink.esua.epdc.redis.ViolationsRecordsRedis; +import com.elink.esua.epdc.service.ViolationsRecordsImgsService; +import com.elink.esua.epdc.service.ViolationsRecordsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 违规记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-07-03 + */ +@Service +public class ViolationsRecordsServiceImpl extends BaseServiceImpl implements ViolationsRecordsService { + + @Autowired + private ViolationsRecordsRedis violationsRecordsRedis; + + @Autowired + private ViolationsRecordsImgsService violationsRecordsImgsService; + + @Override + public PageData page(Map params) { +// params.put("deptIdList", SecurityUser.getUser().getDeptIdList()); +// params.put("creatUser",SecurityUser.getUser().getId()); + IPage page = getPage(params); + List list = baseDao.getViolationsRecord(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ViolationsRecordsDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ViolationsRecordsDTO get(String id) { + ViolationsRecordsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ViolationsRecordsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ViolationsRecordsDTO dto) { + ViolationsRecordsEntity entity = ConvertUtils.sourceToTarget(dto, ViolationsRecordsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ViolationsRecordsDTO dto) { + ViolationsRecordsEntity entity = ConvertUtils.sourceToTarget(dto, ViolationsRecordsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + + @Override + @Transactional(rollbackFor=Exception.class) + public Result insertViolationsRecord(SaveCheckRecordsDTO formDto) { + ViolationsRecordsEntity entity = ConvertUtils.sourceToTarget(formDto, ViolationsRecordsEntity.class); + insert(entity); + //保存违规记录图片 + violationsRecordsImgsService.insertImages(formDto.getImgUrls(),entity.getId()); + return new Result(); + } + + + @Override + public ViolationsRecordsDTO getDetails(String id) { + return baseDao.getDetails(id); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/utils/ModuleConstant.java b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/utils/ModuleConstant.java new file mode 100644 index 00000000..03d407f8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/utils/ModuleConstant.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.utils; + +import com.elink.esua.epdc.commons.tools.constant.Constant; + +/** + * 模块常量 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +public interface ModuleConstant extends Constant { + +} diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/application.yml new file mode 100644 index 00000000..e22804f7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/application.yml @@ -0,0 +1,121 @@ +server: + port: @server.port@ + servlet: + context-path: /contentSecurity + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epdc-content-security-server + # 环境 dev|test|prod + profiles: + active: @spring.profiles.active@ + messages: + encoding: UTF-8 + basename: i18n/messages,i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + timeout: 30s + port: @spring.redis.port@ + password: @spring.redis.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + namespace: @nacos.namespace@ + alibaba: + seata: + tx-service-group: epdc-content-security-server-fescar-service-group + datasource: + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + +feign: + hystrix: + enabled: true + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.elink.esua.epdc.modules.*.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: UUID + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +wx: + ma: + configs: + - appid: @wx.ma.appId@ + secret: @wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON + - appid: @work.wx.ma.appId@ + secret: @work.wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON + - appid: @analysis.wx.ma.appId@ + secret: @analysis.wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON + appId: + # 普通居民端的appId + normal: @wx.ma.appId@ + # 工作端的appId + work: @work.wx.ma.appId@ + # 数据分析端的appId + analysis: @analysis.wx.ma.appId@ + +rocketmq: + name-server: @rocketmq.name.server@ + producer: + group: @rocketmq.producer.contentSecurity.group@ + diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql new file mode 100644 index 00000000..98c3f580 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql @@ -0,0 +1,12 @@ +CREATE TABLE person ( + id int(11) NOT NULL AUTO_INCREMENT, + first varchar(100) NOT NULL, + last varchar(100) NOT NULL, + dateofbirth DATE DEFAULT null, + placeofbirth varchar(100) not null, + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +insert into person (first,last,dateofbirth,placeofbirth) values('Dursun','KOC', STR_TO_DATE('02/10/1982', '%m/%d/%Y'),'Erzincan'); + +insert into person (first,last,dateofbirth,placeofbirth) values('Durseeun','KeeOC', STR_TO_DATE('05/10/1982', '%m/%d/%Y'),'Erzeeincan'); diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages.properties new file mode 100644 index 00000000..a7091dbb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages.properties @@ -0,0 +1 @@ +#Default diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_en_US.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_en_US.properties new file mode 100644 index 00000000..9e895e42 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_en_US.properties @@ -0,0 +1 @@ +#English diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_CN.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_CN.properties new file mode 100644 index 00000000..b21fd22e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_CN.properties @@ -0,0 +1 @@ +#\u7B80\u4F53\u4E2D\u6587 diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_TW.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_TW.properties new file mode 100644 index 00000000..4433dba4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_TW.properties @@ -0,0 +1 @@ +#\u7E41\u4F53\u4E2D\u6587 diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation.properties new file mode 100644 index 00000000..56ca909c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation.properties @@ -0,0 +1 @@ +#Default \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_en_US.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_en_US.properties new file mode 100644 index 00000000..9e895e42 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_en_US.properties @@ -0,0 +1 @@ +#English diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_CN.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_CN.properties new file mode 100644 index 00000000..b21fd22e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_CN.properties @@ -0,0 +1 @@ +#\u7B80\u4F53\u4E2D\u6587 diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_TW.properties b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_TW.properties new file mode 100644 index 00000000..4433dba4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_TW.properties @@ -0,0 +1 @@ +#\u7E41\u4F53\u4E2D\u6587 diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..3038f1b1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/logback-spring.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckCodeDao.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckCodeDao.xml new file mode 100644 index 00000000..9f024960 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckCodeDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsDao.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsDao.xml new file mode 100644 index 00000000..5bd20a1f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsDao.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsImgsDao.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsImgsDao.xml new file mode 100644 index 00000000..e2c870fb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsImgsDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckResultDao.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckResultDao.xml new file mode 100644 index 00000000..9977c940 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckResultDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsDao.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsDao.xml new file mode 100644 index 00000000..6e1b8ff9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsDao.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsImgsDao.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsImgsDao.xml new file mode 100644 index 00000000..eb692efb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/ViolationsRecordsImgsDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/registry.conf b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/registry.conf new file mode 100644 index 00000000..b5f08984 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/registry.conf @@ -0,0 +1,21 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "@nacos.server-addr@" + namespace = "@nacos.namespace@" + cluster = "default" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "@nacos.server-addr@" + namespace = "@nacos.namespace@" + cluster = "default" + } +} diff --git a/esua-epdc/epdc-module/epdc-content-security/pom.xml b/esua-epdc/epdc-module/epdc-content-security/pom.xml new file mode 100644 index 00000000..053fe6e0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-content-security/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.esua.epdc + epdc-module + 1.0.0 + + + com.esua.epdc + epdc-content-security + pom + + + epdc-content-security-client + epdc-content-security-server + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java index e846e9c2..31a2d1c4 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java @@ -48,4 +48,9 @@ public class CommentFormDTO { */ private String userFace; + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java index c28f9e0e..0c97c648 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java @@ -163,4 +163,9 @@ public class EpdcEventSubmitFormDTO implements Serializable { private Long changeUserId; private String changeUsername; private String changeUserMobile; + + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java index 98ca092a..f135222b 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java @@ -26,4 +26,9 @@ public class EvaluationFormDTO implements Serializable { private String userId; + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index 3f6de287..837a49cd 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -188,6 +188,8 @@ jinshui-categoryGroup jinshui-pointsGroup jinshui-pointsGroup + contentSecurityGroup + @@ -233,6 +235,8 @@ jinshui-categoryGroup jinshui-pointsGroup jinshui-pointsGroup + contentSecurityGroup + @@ -281,6 +285,8 @@ jinshui-categoryGroup jinshui-pointsGroup jinshui-pointsGroup + contentSecurityGroup + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java index 2866a53d..56366ff0 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/dao/EventCommentDao.java @@ -122,4 +122,13 @@ public interface EventCommentDao extends BaseDao { * @Date 2020/1/6 17:40 **/ int batchInsertEventComment(@Param("list") List commentEntities); + + /** + * @describe:驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 18:26 + * @params [relationId] + * @return void + */ + void rejectEventsCommentInfo(@Param("relationId") String relationId); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java index 61afb820..64614d5d 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java @@ -31,6 +31,7 @@ import com.elink.esua.epdc.dto.issue.form.WorkEventCommentListFormDTO; import com.elink.esua.epdc.dto.issue.result.IssueHotCommentResultDTO; import com.elink.esua.epdc.dto.issue.result.WorkEventCommentResultDTO; import com.elink.esua.epdc.modules.comment.entity.EventCommentEntity; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import java.util.List; import java.util.Map; @@ -180,4 +181,13 @@ public interface EventCommentService extends BaseService { * @return */ Result commentReplyList(WorkCommentReplyFormDTO workCommentReplyFormDTO); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 18:26 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result rejectEventsCommentInfo(RejectRecordDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java index 4cb8f8e3..00aaafd6 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java @@ -23,6 +23,13 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; +import com.elink.esua.epdc.commons.tools.security.content.ModuleName; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.EventsNoticeConstant; @@ -44,11 +51,14 @@ import com.elink.esua.epdc.modules.comment.entity.EventCommentEntity; import com.elink.esua.epdc.modules.comment.service.EventCommentService; import com.elink.esua.epdc.modules.comment.service.EventCommentUserAttitudeService; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; +import com.elink.esua.epdc.modules.feign.AdminFeignClient; +import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import com.elink.esua.epdc.modules.issue.service.IssueService; import com.elink.esua.epdc.modules.item.entity.ItemEntity; import com.elink.esua.epdc.modules.item.service.ItemService; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -90,6 +100,13 @@ public class EventCommentServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -145,6 +162,31 @@ public class EventCommentServiceImpl extends BaseServiceImpl textList = new ArrayList<>(); + textList.add(commentFormDTO.getContent()); + String mobile = null; + Result user = userFeignClient.getUserInfoById(commentFormDTO.getUserId()); + if(null != user.getData()){ + mobile = user.getData().getMobile(); + } + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + if (!isConReview && (contentResult != null && !contentResult.getAllPass())) { + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(commentFormDTO.getUserId(), + commentFormDTO.getUserName(),CheckDataUtils.cate_two , CheckDataUtils.decision_one, + ModuleName.ISSUE_COMMENT.getCode(), textList,null, null,contentResult, + null,null,mobile,"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - end + + IssueEntity issueEntity = null; ItemEntity itemEntity = null; @@ -249,6 +291,33 @@ public class EventCommentServiceImpl extends BaseServiceImpl().ok(workEventsCommentsDTO); } + + @Override + @Transactional + public Result rejectEventsCommentInfo(RejectRecordDTO dto) { + baseDao.rejectEventsCommentInfo(dto.getRelationId()); + return new Result(); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java index a4dce3f0..661a4d3e 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java @@ -11,7 +11,10 @@ import com.elink.esua.epdc.dto.issue.IssueDTO; import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -37,10 +40,8 @@ public class EpdcAppEventsController { public Result submitEvent(@RequestBody EpdcEventSubmitFormDTO formDto) { //效验数据 ValidatorUtils.validateEntity(formDto); - EpdcEventsEntity epdcEventsEntity = epdcEventsService.saveEvent(formDto); - Result result = new Result(); - result.setData(epdcEventsEntity.getId()); - return result; + Result epdcEventsEntityResult = epdcEventsService.saveEvent(formDto); + return new Result().ok(epdcEventsEntityResult.getData().getId()); } /** diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java index 5a20c5fc..af35c15c 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java @@ -18,7 +18,6 @@ package com.elink.esua.epdc.modules.events.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; -import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.events.*; import com.elink.esua.epdc.dto.events.form.GroupFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; @@ -28,7 +27,6 @@ import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -189,4 +187,22 @@ public interface EpdcEventsDao extends BaseDao { */ void updateBatchPartyGroupName(@Param("groups") List groups); + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 18:18 + * @params [relationId] + * @return void + */ + void rejectEventsInfo(@Param("relationId") String relationId); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 18:19 + * @params [relationId] + * @return void + */ + void rejectEventsImgInfo(@Param("relationId") String relationId); + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java index c1de647b..2faf6a97 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java @@ -32,6 +32,7 @@ import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity; import com.elink.esua.epdc.modules.rocketmq.dto.CategoryModifyDTO; import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import java.util.List; import java.util.Map; @@ -73,7 +74,7 @@ public interface EpdcEventsService extends BaseService { * @Author: liuchuang * @Date: 2019/9/8 16:52 */ - EpdcEventsEntity saveEvent(EpdcEventSubmitFormDTO dto); + Result saveEvent(EpdcEventSubmitFormDTO dto); void update(EpdcEventsDTO dto); @@ -244,4 +245,13 @@ public interface EpdcEventsService extends BaseService { */ void modifyPartyGroupName(List groups); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 18:16 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result rejectEventsInfo(RejectRecordDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java index 6bf2fc3b..94610d52 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java @@ -24,6 +24,12 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; +import com.elink.esua.epdc.commons.tools.security.content.ModuleName; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; @@ -56,6 +62,7 @@ import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import com.elink.esua.epdc.modules.events.service.ImgService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; +import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; import com.elink.esua.epdc.modules.feign.GroupFeignClient; import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import com.elink.esua.epdc.modules.issue.entity.IssueHandleEntity; @@ -64,14 +71,12 @@ import com.elink.esua.epdc.modules.issue.service.IssueService; import com.elink.esua.epdc.modules.item.service.ItemService; import com.elink.esua.epdc.modules.rocketmq.dto.CategoryModifyDTO; import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.List; -import java.util.Map; import java.util.*; /** @@ -110,6 +115,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl listOfPendingReviewEvents(Map params) { IPage page = getPage(params); @@ -149,7 +157,25 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl saveEvent(EpdcEventSubmitFormDTO dto) { + //内容审核 - start + Boolean isConReview = dto.getIsConReview(); + List textList = new ArrayList<>(); + textList.add(dto.getEventContent()); + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + CheckResultDTO imgResult = CheckDataUtils.checkImgs(dto.getImages()); + if(!isConReview && + ((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(dto.getUserId(), + dto.getNickName(), CheckDataUtils.cate_two, CheckDataUtils.decision_one, ModuleName.ISSUE_SUBMIT.getCode(), textList, + dto.getImages(), null,contentResult, imgResult,null,dto.getMobile(),"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - end EpdcEventsEntity entity = ConvertUtils.sourceToTarget(dto, EpdcEventsEntity.class); insert(entity); @@ -161,7 +187,37 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl().ok(entity); } @Override @@ -463,7 +519,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl> getRoleIdList(@PathVariable("userId") Long userId); + /** + * 根据部门ID获取所有上级机构名称和ID拼接 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author lipengfei + * @date 2019/11/27 09:31 + */ + @GetMapping("sys/dept/getParentAndAllDept/{deptId}") + Result getParentAndAllDept(@PathVariable("deptId") Long deptId); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java new file mode 100644 index 00000000..5a3654db --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.feign.fallback.ContentSecurityFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 内容审核端接口 + * + * @author wangtong + * @date 2020/7/6 15:58 + */ + +@FeignClient(name = ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, fallback = ContentSecurityFeignClientFallback.class) +public interface ContentSecurityFeignClient { + + @PostMapping(value = "contentSecurity/handleResult/insertViolationsRecord", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result insertViolationsRecord(@RequestBody SaveCheckRecordsDTO record); + + @PostMapping(value = "contentSecurity/handleResult/insertRecords", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result insertRecords(@RequestBody SaveCheckRecordsDTO record); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java index 38c2110a..87dc9aa9 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java @@ -1,6 +1,7 @@ package com.elink.esua.epdc.modules.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.CompleteDeptDTO; @@ -59,4 +60,8 @@ public class AdminFeignClientFallback implements AdminFeignClient { public Result> getRoleIdList(Long userId) { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getRoleIdList", userId); } + @Override + public Result getParentAndAllDept(Long deptId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", deptId); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java new file mode 100644 index 00000000..a00e5ae7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author wangtong + * @date 2020/7/6 15:58 + */ +@Component +public class ContentSecurityFeignClientFallback implements ContentSecurityFeignClient { + + @Override + public Result insertViolationsRecord(SaveCheckRecordsDTO record) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertViolationsRecord", record); + } + + @Override + public Result insertRecords(SaveCheckRecordsDTO record) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertRecords", record); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java index 53e713da..8daf6737 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java @@ -29,6 +29,7 @@ import com.elink.esua.epdc.dto.item.result.*; import com.elink.esua.epdc.modules.item.entity.ItemEntity; import com.elink.esua.epdc.modules.rocketmq.dto.CategoryModifyDTO; import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import java.util.List; import java.util.Map; @@ -377,4 +378,13 @@ public interface ItemService extends BaseService { * @Date: 2020-05-06 */ List listHandleCategory(); + + /** + * @describe: 置空 满意度评价 文本内容 + * @author wangtong + * @date 2020/7/15 18:39 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result rejectItemSatisfactionInfo(RejectRecordDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index 3f459cec..2ac37e8f 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -28,6 +28,12 @@ import com.elink.esua.epdc.commons.tools.enums.InterfaceLogBusinessTypeEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; +import com.elink.esua.epdc.commons.tools.security.content.ModuleName; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; @@ -36,10 +42,7 @@ import com.elink.esua.epdc.commons.tools.utils.GPSUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.*; import com.elink.esua.epdc.constants.MenuCodeConstant; -import com.elink.esua.epdc.dto.CompleteDeptDTO; -import com.elink.esua.epdc.dto.DeptGridPlatformDTO; -import com.elink.esua.epdc.dto.MenuNoticeDTO; -import com.elink.esua.epdc.dto.SysDeptDTO; +import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO; import com.elink.esua.epdc.dto.events.form.GroupFormDTO; @@ -67,6 +70,8 @@ import com.elink.esua.epdc.modules.events.entity.ImgEntity; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import com.elink.esua.epdc.modules.events.service.ImgService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; +import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; +import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity; import com.elink.esua.epdc.modules.interfacelog.service.InterfaceLogService; import com.elink.esua.epdc.modules.issue.service.IssueService; @@ -78,6 +83,7 @@ import com.elink.esua.epdc.modules.item.entity.*; import com.elink.esua.epdc.modules.item.service.*; import com.elink.esua.epdc.modules.rocketmq.dto.CategoryModifyDTO; import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import com.elink.esua.epdc.modules.rolecategory.service.HandleRoleCategoryService; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -155,6 +161,13 @@ public class ItemServiceImpl extends BaseServiceImpl implem private IssueOverseeResultsTask issueOverseeResultsTask; @Autowired private HandleRoleCategoryService handleRoleCategoryService; + + @Autowired + private UserFeignClient userFeignClient; + + @Autowired + private ContentSecurityFeignClient contentSecurityFeign; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -296,12 +309,68 @@ public class ItemServiceImpl extends BaseServiceImpl implem public Result evaluation(EvaluationFormDTO evaluationFormDTO) { ItemEntity itemEntityResult = baseDao.selectById(evaluationFormDTO.getItemId()); if (itemEntityResult.getUserId().equals(evaluationFormDTO.getUserId()) && itemEntityResult.getEvaluationScore() == null) { + //内容审核 - start + Boolean isConReview = evaluationFormDTO.getIsConReview(); + String userName = null; + if(null != SecurityUser.getUser()){ + userName = SecurityUser.getUser().getUsername(); + } + String mobile = null; + Result user = userFeignClient.getUserInfoById(evaluationFormDTO.getUserId()); + if(null != user.getData()){ + mobile = user.getData().getMobile(); + } + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + List textList = new ArrayList<>(); + textList.add(evaluationFormDTO.getEvaluationContent()); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + if (!isConReview && (contentResult != null && !contentResult.getAllPass())) { + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(), + userName,CheckDataUtils.cate_two , CheckDataUtils.decision_one, + ModuleName.ITEM_SATISFACTION.getCode(), textList,null, null,contentResult, + null,null,mobile,"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - end + ItemEntity itemEntity = new ItemEntity(); itemEntity.setId(evaluationFormDTO.getItemId()); itemEntity.setEvaluationScore(evaluationFormDTO.getEvaluationScore()); itemEntity.setEvaluationContent(evaluationFormDTO.getEvaluationContent()); itemEntity.setEvaluationTime(new Date()); baseDao.updateById(itemEntity); + + + //内容审核- 开始 + //接口异常,保存至待审核信息 + if(contentResult == null && !isConReview) { + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(), + userName, CheckDataUtils.cate_two, null,ModuleName.ITEM_SATISFACTION.getCode(), textList, + null, itemEntity.getId(),null,null, null,mobile,"1",deptDto); + contentSecurityFeign.insertRecords(record); + } + + //判断是否为待审核 + if(contentResult != null) { + CheckResultMessageDTO twoTypes = null; + if(isConReview){ + twoTypes = CheckDataUtils.saveTwoTypes(contentResult, null); + }else{ + twoTypes = CheckDataUtils.checkTwoTypes(contentResult, null); + } + if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(), + userName, CheckDataUtils.cate_two, null, ModuleName.ITEM_SATISFACTION.getCode(), textList, + null,itemEntity.getId(), null,null,twoTypes,mobile,"0",deptDto); + contentSecurityFeign.insertRecords(record); + } + } + //内容审核 - 结束 + return new Result(); } else { return new Result().error("您无法评价"); @@ -1474,4 +1543,14 @@ public class ItemServiceImpl extends BaseServiceImpl implem List handleResultDTOS = handleRoleCategoryService.listItemHandleResultDTO(roleIdList.getData()); return handleResultDTOS; } + + @Override + @Transactional + public Result rejectItemSatisfactionInfo(RejectRecordDTO dto) { + ItemEntity entity = baseDao.selectById(dto.getRelationId()); + entity.setEvaluationContent(null); + entity.setUpdatedTime(new Date()); + updateById(entity); + return new Result(); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java new file mode 100644 index 00000000..029c7abe --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java @@ -0,0 +1,64 @@ +package com.elink.esua.epdc.modules.rocketmq.consumer; + +import com.alibaba.fastjson.JSONObject; +import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; +import com.elink.esua.epdc.modules.comment.service.EventCommentService; +import com.elink.esua.epdc.modules.events.service.EpdcEventsService; +import com.elink.esua.epdc.modules.item.service.ItemService; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.MessageModel; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * 内容审核驳回信息处理-监听MQ消息 + * + * @Author:wangtong + * @Date:2020/7/14 1:54 + */ +@Slf4j +@Component +@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ISSUE_ITEM_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING) +public class RejectCheckRecordConsumer implements RocketMQListener { + + @Autowired + private EpdcEventsService epdcEventsService; + + @Autowired + private EventCommentService eventCommentService; + + @Autowired + private ItemService itemService; + + + @Override + public void onMessage(MessageExt messageExt) { + log.info("EPDC-EVENTS-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ISSUE_ITEM_CONTENTSECURITY, messageExt.getMsgId()); + try { + String charset = "UTF-8"; + String body = new String(messageExt.getBody(), charset); + String tag = messageExt.getTags(); + RejectRecordDTO dto = JSONObject.parseObject(body, RejectRecordDTO.class); + if(RocketMqConstant.MQ_TAG_ISSUE_ITEM_SUBMIT_CONTENTSECURITY.equals(tag)){ + //删除 我要报事 相关信息 + epdcEventsService.rejectEventsInfo(dto); + }else if(RocketMqConstant.MQ_TAG_ISSUE_ITEM_COMMENT_CONTENTSECURITY.equals(tag)){ + //删除 议题项目评论 相关信息 + eventCommentService.rejectEventsCommentInfo(dto); + }else if(RocketMqConstant.MQ_TAG_ISSUE_ITEM_SATISFACTION_CONTENTSECURITY.equals(tag)){ + //置空 满意度评价 文本内容 + itemService.rejectItemSatisfactionInfo(dto); + } + + log.info("EPDC-EVENTS-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ISSUE_ITEM_CONTENTSECURITY, messageExt.getMsgId(), body); + } catch (Exception e) { + log.info("EPDC-EVENTS-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); + e.printStackTrace(); + } + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java new file mode 100644 index 00000000..509c5afe --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.modules.rocketmq.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 内容审核驳回信息处理-发送MQ消息DTO + * + * @Author: wangtong + * @Date: 2020/7/14 14:58 + */ +@Data +public class RejectRecordDTO implements Serializable { + + private static final long serialVersionUID = 3032661994413974324L; + /** + * 用户ID + */ + private String userId; + + /** + * 关联信息ID + */ + private String relationId; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml index 96816293..459b80f5 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml @@ -123,3 +123,5 @@ rocketmq: group: @rocketmq.consumer.group@ category-group: @rocketmq.consumer.category.group@ points-group: @rocketmq.consumer.points.group@ + contentSecurity-group: @rocketmq.consumer.contentSecurity.group@ + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml index 2d9dcf7f..dadec1ec 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/comment/EventCommentDao.xml @@ -283,4 +283,8 @@ #{item.delFlag},#{item.revision},#{item.createdBy},#{item.createdTime},#{item.updatedBy},#{item.updatedTime},#{item.partyFlag}) + + UPDATE epdc_event_comment SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where id=#{relationId} + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml index 261210c8..874e8b41 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml @@ -353,4 +353,13 @@ + + UPDATE epdc_events SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where id=#{relationId} + + + UPDATE epdc_img SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where REFERENCE_ID=#{relationId} + + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java index ffa87aa5..9956ae7d 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java @@ -219,4 +219,9 @@ public class ActInfoDTO implements Serializable { * 活动新闻稿 */ private String actNewsContent; + + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java index 54a16100..a42d18ea 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java @@ -77,4 +77,9 @@ public class AppActUserClockLogDTO implements Serializable { @NotBlank(message = "打卡是否有效不能为空") private String effectiveFlag; + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; + } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml index 5520ed64..6839427a 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml @@ -83,6 +83,12 @@ 1.0.0 compile + + + org.apache.rocketmq + rocketmq-spring-boot-starter + 2.0.2 + @@ -166,6 +172,9 @@ 47.104.224.45:8848 + + 47.104.85.99:9876;114.215.125.123:9876 + contentSecurityGroup @@ -191,6 +200,9 @@ 47.104.224.45:8848 47.104.224.45 fa5bf520-09c1-410c-a876-28e98c0534d3 + + 47.104.85.99:9876;114.215.125.123:9876 + contentSecurityGroup @@ -218,6 +230,9 @@ epdc epdc@jinshui888 + + 172.16.0.7:9876;172.16.0.8:9876 + contentSecurityGroup diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java index 408fae91..da247f7d 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -97,4 +98,13 @@ public interface ActBannerDao extends BaseDao { * @Date 18:27 2020-05-25 **/ List selectListBannerList(EpdcAppActBannerFormDTO formDto); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 16:56 + * @params [relationId] + * @return void + */ + void rejectActBannerInfo(@Param("relationId") String relationId); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java index 34b83b45..077348a4 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActClockPicDao.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.modules.activity.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.modules.activity.entity.ActClockPicEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 活动打卡图片表 @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ActClockPicDao extends BaseDao { - + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 17:13 + * @params [relationId] + * @return void + */ + void rejectActClockPicInfo(@Param("relationId") String relationId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java index bbd6463f..80cb9c98 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java @@ -26,6 +26,7 @@ import com.elink.esua.epdc.activity.result.ActInfoResultDTO; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -113,4 +114,13 @@ public interface ActInfoDao extends BaseDao { * @date 2020/4/3 9:25 */ void minusSignUpNum(String actId); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 16:55 + * @params [relationId] + * @return void + */ + void rejectActInfo(@Param("relationId") String relationId); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java index 411229e5..466f96b6 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java @@ -21,6 +21,7 @@ import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -44,4 +45,13 @@ public interface ActUserClockLogDao extends BaseDao { * @Date 15:56 2020-06-03 **/ void updateShieldFlag(ActUserClockLogResultDTO dto); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 17:18 + * @params [relationId] + * @return void + */ + void rejectActClockInfo(@Param("relationId") String relationId); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java index 09b6563f..54eae1a2 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java @@ -27,6 +27,7 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import java.util.List; import java.util.Map; @@ -185,4 +186,22 @@ public interface ActInfoService extends BaseService { * @date 2020/4/3 9:23 */ void minusSignUpNum(String actId); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 16:53 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result rejectActInfo(RejectRecordDTO dto); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 17:12 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result rejectActClockInfo(RejectRecordDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java index cf255f09..a7352eb2 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -33,6 +33,13 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.constant.StrConstant; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; +import com.elink.esua.epdc.commons.tools.security.content.ModuleName; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.DateUtils; import com.elink.esua.epdc.commons.tools.utils.LocalDateUtils; @@ -43,9 +50,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.constant.*; import com.elink.esua.epdc.dto.ScheduleJobDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; -import com.elink.esua.epdc.modules.activity.dao.ActInfoDao; -import com.elink.esua.epdc.modules.activity.dao.ActUserClockLogDao; -import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao; +import com.elink.esua.epdc.modules.activity.dao.*; import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity; @@ -53,8 +58,11 @@ import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; import com.elink.esua.epdc.modules.activity.service.ActBannerService; import com.elink.esua.epdc.modules.activity.service.ActInfoService; import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.feign.AdminFeignClient; +import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; import com.elink.esua.epdc.modules.feign.JobFeignClient; import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -84,6 +92,14 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -126,10 +142,67 @@ public class ActInfoServiceImpl extends BaseServiceImpl textList = new ArrayList<>(); + textList.add(dto.getTitle()); + textList.add(dto.getActContent()); + List imgList = new ArrayList<>(); + imgList.add(dto.getHeadPic()); + imgList.add(dto.getBannerUrl()); + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + CheckResultDTO imgResult = CheckDataUtils.checkImgs(imgList); + if(!isConReview && + ((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, + userName, CheckDataUtils.cate_one, CheckDataUtils.decision_one, ModuleName.HELP_ACTIVITY.getCode(), textList, + imgList, null,contentResult, imgResult,null,dto.getTel(),"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - end ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); if (insert(entity)) { // 创建定时任务(活动开始后将未审核的报名人员自动置为审核通过或不通过) - return this.saveActToScheduleJob(entity.getId(), dto.getActStartTime()); + this.saveActToScheduleJob(entity.getId(), dto.getActStartTime()); + + + //内容审核- 开始 + //接口异常,保存至待审核信息 + if((contentResult == null || imgResult == null) && !isConReview) { + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, + userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, + imgList, entity.getId(),null,null, null,dto.getTel(),"1",deptDto); + contentSecurityFeign.insertRecords(record); + } + + //保存待审核记录 + if (contentResult != null && imgResult != null) { + CheckResultMessageDTO twoTypes = null; + if(isConReview){ + twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult); + }else{ + twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); + } + if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, + userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, + imgList, entity.getId(),null,null, twoTypes,dto.getTel(),"0",deptDto); + contentSecurityFeign.insertRecords(record); + } + } + //内容审核 - 结束 + return new Result(); } return new Result().error(); @@ -526,4 +599,20 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -297,6 +310,35 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl user = userInfoFeignClient.getUserInfoById(appActUserClockLogDTO.getUserId()); + if(null != user.getData()){ + mobile = user.getData().getMobile(); + } + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + List textList = new ArrayList<>(); + textList.add(appActUserClockLogDTO.getClockDesc()); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + CheckResultDTO imgResult = CheckDataUtils.checkImgs(appActUserClockLogDTO.getImages()); + if(!isConReview && + ((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(appActUserClockLogDTO.getUserId(), + userName, CheckDataUtils.cate_two, CheckDataUtils.decision_one, ModuleName.HELP_SIGNIN.getCode(), textList, + appActUserClockLogDTO.getImages(), null,contentResult, imgResult,null,mobile,"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - end + + //查询人员活动关系Id(可打卡的) List statusList = new ArrayList<>(); statusList.add(ActUserRelationStatusConstant.APPROVED); @@ -331,6 +373,33 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl> getListSimpleDictInfo(@PathVariable("dictType") String dictType); + + /** + * 根据部门ID获取所有上级机构名称和ID拼接 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author lipengfei + * @date 2019/11/27 09:31 + */ + @GetMapping("sys/dept/getParentAndAllDept/{deptId}") + Result getParentAndAllDept(@PathVariable("deptId") Long deptId); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java new file mode 100644 index 00000000..5a3654db --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.modules.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.feign.fallback.ContentSecurityFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 内容审核端接口 + * + * @author wangtong + * @date 2020/7/6 15:58 + */ + +@FeignClient(name = ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, fallback = ContentSecurityFeignClientFallback.class) +public interface ContentSecurityFeignClient { + + @PostMapping(value = "contentSecurity/handleResult/insertViolationsRecord", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result insertViolationsRecord(@RequestBody SaveCheckRecordsDTO record); + + @PostMapping(value = "contentSecurity/handleResult/insertRecords", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result insertRecords(@RequestBody SaveCheckRecordsDTO record); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java index da30ee20..442deef6 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java @@ -2,6 +2,7 @@ package com.elink.esua.epdc.modules.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.SysSimpleDictDTO; @@ -21,4 +22,8 @@ public class AdminFeignClientFallback implements AdminFeignClient { public Result> getListSimpleDictInfo(String dictType) { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getListSimpleDictInfo", dictType); } + @Override + public Result getParentAndAllDept(Long deptId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", deptId); + } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java new file mode 100644 index 00000000..a00e5ae7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.modules.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author wangtong + * @date 2020/7/6 15:58 + */ +@Component +public class ContentSecurityFeignClientFallback implements ContentSecurityFeignClient { + + @Override + public Result insertViolationsRecord(SaveCheckRecordsDTO record) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertViolationsRecord", record); + } + + @Override + public Result insertRecords(SaveCheckRecordsDTO record) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertRecords", record); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java new file mode 100644 index 00000000..bb2d7c6d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java @@ -0,0 +1,52 @@ +package com.elink.esua.epdc.modules.rocketmq.consumer; + +import com.alibaba.fastjson.JSONObject; +import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; +import com.elink.esua.epdc.modules.activity.service.ActInfoService; +import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.MessageModel; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * 内容审核驳回信息处理-监听MQ消息 + * + * @Author:wangtong + * @Date:2020/7/14 1:54 + */ +@Slf4j +@Component +@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING) +public class RejectCheckRecordConsumer implements RocketMQListener { + + @Autowired + private ActInfoService actInfoService; + + @Override + public void onMessage(MessageExt messageExt) { + log.info("EPDC-HEART-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, messageExt.getMsgId()); + try { + String charset = "UTF-8"; + String body = new String(messageExt.getBody(), charset); + String tag = messageExt.getTags(); + RejectRecordDTO dto = JSONObject.parseObject(body, RejectRecordDTO.class); + if(RocketMqConstant.MQ_TAG_HEART_ACTIVITY_CONTENTSECURITY.equals(tag)){ + //删除发布活动相关信息 + actInfoService.rejectActInfo(dto); + }else if(RocketMqConstant.MQ_TAG_HEART_SIGNIN_CONTENTSECURITY.equals(tag)){ + //删除已报名活动-我要打卡相关信息 + actInfoService.rejectActClockInfo(dto); + } + + log.info("EPDC-HEART-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, messageExt.getMsgId(), body); + } catch (Exception e) { + log.info("EPDC-HEART-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); + e.printStackTrace(); + } + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java new file mode 100644 index 00000000..509c5afe --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/RejectRecordDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.modules.rocketmq.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 内容审核驳回信息处理-发送MQ消息DTO + * + * @Author: wangtong + * @Date: 2020/7/14 14:58 + */ +@Data +public class RejectRecordDTO implements Serializable { + + private static final long serialVersionUID = 3032661994413974324L; + /** + * 用户ID + */ + private String userId; + + /** + * 关联信息ID + */ + private String relationId; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml index b8e4d01f..1b7dee0c 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml @@ -87,3 +87,8 @@ mybatis-plus: cache-enabled: false call-setters-on-nulls: true jdbc-type-for-null: 'null' + +rocketmq: + name-server: @rocketmq.name.server@ + consumer: + group: @rocketmq.consumer.contentSecurity.group@ \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml index 72b8f255..0368ea4e 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml @@ -134,4 +134,8 @@ AND DEL_FLAG = 0 ORDER BY SORT,STATUS_TIME DESC + + UPDATE epdc_act_banner SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where ACT_ID=#{relationId} + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml index 37dd9f15..5ea906af 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActClockPicDao.xml @@ -14,5 +14,8 @@ - + + UPDATE epdc_act_clock_pic SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where CLOCK_ID=#{relationId} + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml index 7c118a94..15659f15 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml @@ -509,4 +509,9 @@ where eai.DEL_FLAG='0' and eai.id=#{actId} + + + UPDATE epdc_act_info SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where id=#{relationId} + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml index d35b857e..44acc89f 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml @@ -77,4 +77,8 @@ where id = #{id} + + UPDATE epdc_act_user_clock_log SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where id=#{relationId} + diff --git a/esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/constant/SysSmsTemplateConstant.java b/esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/constant/SysSmsTemplateConstant.java index 4af79e83..0004871f 100644 --- a/esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/constant/SysSmsTemplateConstant.java +++ b/esua-epdc/epdc-module/epdc-message/epdc-message-client/src/main/java/com/elink/esua/epdc/constant/SysSmsTemplateConstant.java @@ -61,4 +61,8 @@ public interface SysSmsTemplateConstant { * 工作端-项目-结案 */ String SMS_TEMPLATE_WORK_ITEM_SETTLE = "WORK_ITEM_SETTLE"; + /** + * 内容审核-违规 + */ + String SMS_TEMPLATE_CONTENT_SECURITY_BLOCK = "CONTENT_SECURITY_BLOCK"; } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicCommentFormDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicCommentFormDTO.java index 8acb2b78..73f64898 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicCommentFormDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicCommentFormDTO.java @@ -54,5 +54,9 @@ public class PartyTopicCommentFormDTO { * 党员标识 */ private String partyMember; + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicSubmitFormDTO.java index d11e1089..7e326411 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicSubmitFormDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicSubmitFormDTO.java @@ -113,5 +113,8 @@ public class PartyTopicSubmitFormDTO implements Serializable { */ private Long gridId; - + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml index 183a3d47..89628b96 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml @@ -68,6 +68,12 @@ orika-spring-boot-starter 1.8.0 + + + org.apache.rocketmq + rocketmq-spring-boot-starter + 2.0.2 + @@ -148,6 +154,10 @@ 47.104.224.45:8848 fa5bf520-09c1-410c-a876-28e98c0534d3 + + 47.104.85.99:9876;114.215.125.123:9876 + contentSecurityGroup + @@ -173,6 +183,9 @@ 47.104.224.45:8848 47.104.224.45 fa5bf520-09c1-410c-a876-28e98c0534d3 + + 47.104.85.99:9876;114.215.125.123:9876 + contentSecurityGroup @@ -201,6 +214,9 @@ epdc epdc@jinshui888 + + 172.16.0.7:9876;172.16.0.8:9876 + contentSecurityGroup diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicCommentDao.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicCommentDao.java index 734457d1..cebd6f3e 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicCommentDao.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicCommentDao.java @@ -21,6 +21,7 @@ import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.PartyTopicCommentDTO; import com.elink.esua.epdc.entity.PartyTopicCommentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -49,4 +50,13 @@ public interface PartyTopicCommentDao extends BaseDao { * @return void **/ void updateReplyCount(String faCommentId); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 17:52 + * @params [relationId] + * @return void + */ + void rejectTopicCommentInfo(@Param("relationId") String relationId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java index 7a5adf75..70fe5d9b 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java @@ -24,6 +24,7 @@ import com.elink.esua.epdc.dto.form.PartyTopicFormDTO; import com.elink.esua.epdc.dto.result.TopicList; import com.elink.esua.epdc.entity.PartyTopicEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -86,4 +87,13 @@ public interface PartyTopicDao extends BaseDao { * @return java.util.List **/ List selectListOfMyPartyTopic(MyPartyTopicFormDTO formDto); + + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 17:43 + * @params [relationId] + * @return void + */ + void rejectTopicInfo(@Param("relationId") String relationId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicImgDao.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicImgDao.java index 337ac683..5bf377c5 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicImgDao.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicImgDao.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.entity.PartyTopicImgEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 话题图片表 @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface PartyTopicImgDao extends BaseDao { - + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 17:44 + * @params [relationId] + * @return void + */ + void rejectTopicImgInfo(@Param("relationId") String relationId); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java index 98d77284..0465f8e9 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java @@ -40,4 +40,15 @@ public interface AdminFeignClient { */ @GetMapping("/sys/dept/getParentAndAllDept/{deptId}") Result getParentAndAllDept(@PathVariable("deptId") String deptId); + + /** + * 根据部门ID获取所有上级机构名称和ID拼接 + * + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author lipengfei + * @date 2019/11/27 09:31 + */ + @GetMapping("sys/dept/getParentAndAllDept/{deptId}") + Result getParentAndAllDept(@PathVariable("deptId") Long deptId); } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/ContentSecurityFeignClient.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/ContentSecurityFeignClient.java new file mode 100644 index 00000000..af8dc3e9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/ContentSecurityFeignClient.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.fallback.ContentSecurityFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 内容审核端接口 + * + * @author wangtong + * @date 2020/7/6 15:58 + */ + +@FeignClient(name = ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, fallback = ContentSecurityFeignClientFallback.class) +public interface ContentSecurityFeignClient { + + @PostMapping(value = "contentSecurity/handleResult/insertViolationsRecord", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result insertViolationsRecord(@RequestBody SaveCheckRecordsDTO record); + + @PostMapping(value = "contentSecurity/handleResult/insertRecords", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result insertRecords(@RequestBody SaveCheckRecordsDTO record); +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java index 2e80c80d..37fb2558 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java @@ -5,13 +5,9 @@ import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; import com.elink.esua.epdc.dto.SysDeptDTO; -import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; -import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; import org.springframework.stereotype.Component; -import java.util.List; - /** * @Description * @Author songyunpeng @@ -27,4 +23,9 @@ public class AdminFeignClientFallback implements AdminFeignClient { public Result getParentAndAllDept(String depId) { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", depId); } + @Override + public Result getParentAndAllDept(Long deptId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getParentAndAllDept", deptId); + } + } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/ContentSecurityFeignClientFallback.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/ContentSecurityFeignClientFallback.java new file mode 100644 index 00000000..2185275d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/ContentSecurityFeignClientFallback.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.ContentSecurityFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author wangtong + * @date 2020/7/6 15:58 + */ +@Component +public class ContentSecurityFeignClientFallback implements ContentSecurityFeignClient { + + @Override + public Result insertViolationsRecord(SaveCheckRecordsDTO record) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertViolationsRecord", record); + } + + @Override + public Result insertRecords(SaveCheckRecordsDTO record) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertRecords", record); + } + + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java new file mode 100644 index 00000000..435138dc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java @@ -0,0 +1,57 @@ +package com.elink.esua.epdc.rocketmq.consumer; + +import com.alibaba.fastjson.JSONObject; +import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant; +import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO; +import com.elink.esua.epdc.service.PartyTopicCommentService; +import com.elink.esua.epdc.service.PartyTopicService; +import lombok.extern.slf4j.Slf4j; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.MessageModel; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * + * 内容审核驳回信息处理-监听MQ消息 + * + * @Author:wangtong + * @Date:2020/7/14 1:54 + */ +@Slf4j +@Component +@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING) +public class RejectCheckRecordConsumer implements RocketMQListener { + + @Autowired + private PartyTopicService topicService; + + @Autowired + private PartyTopicCommentService topicCommentService; + + + @Override + public void onMessage(MessageExt messageExt) { + log.info("EPDC-GROUP-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY, messageExt.getMsgId()); + try { + String charset = "UTF-8"; + String body = new String(messageExt.getBody(), charset); + String tag = messageExt.getTags(); + RejectRecordDTO dto = JSONObject.parseObject(body, RejectRecordDTO.class); + if(RocketMqConstant.MQ_TAG_GROUP_TOPIC_CONTENTSECURITY.equals(tag)){ + //删除 党群1+1话题 相关信息 + topicService.rejectTopicInfo(dto); + }else if(RocketMqConstant.MQ_TAG_GROUP_TOPIC_COMMENT_CONTENTSECURITY.equals(tag)){ + //删除 党群1+1话题评论 相关信息 + topicCommentService.rejectTopicCommentInfo(dto); + } + + log.info("EPDC-GROUP-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY, messageExt.getMsgId(), body); + } catch (Exception e) { + log.info("EPDC-GROUP-SERVER消费消息失败:msgId:{}", messageExt.getMsgId()); + e.printStackTrace(); + } + } +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java new file mode 100644 index 00000000..51111c4c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.rocketmq.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 内容审核驳回信息处理-发送MQ消息DTO + * + * @Author: wangtong + * @Date: 2020/7/14 14:58 + */ +@Data +public class RejectRecordDTO implements Serializable { + + private static final long serialVersionUID = 3032661994413974324L; + /** + * 用户ID + */ + private String userId; + + /** + * 关联信息ID + */ + private String relationId; +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicCommentService.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicCommentService.java index 21e3617e..c3eb5a82 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicCommentService.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicCommentService.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.PartyTopicCommentDTO; import com.elink.esua.epdc.dto.form.PartyTopicCommentFormDTO; import com.elink.esua.epdc.entity.PartyTopicCommentEntity; +import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO; import java.util.List; import java.util.Map; @@ -111,4 +112,14 @@ public interface PartyTopicCommentService extends BaseService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getMyPartyTopicResultDTO(MyPartyTopicFormDTO formDTO); + /** + * @describe: 驳回-内容违规检测-待审核信息 + * @author wangtong + * @date 2020/7/15 17:40 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result rejectTopicInfo(RejectRecordDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicCommentServiceImpl.java index 82c35d3e..4a3eaeae 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicCommentServiceImpl.java @@ -23,15 +23,27 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; +import com.elink.esua.epdc.commons.tools.security.content.ModuleName; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; +import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dao.PartyTopicCommentDao; import com.elink.esua.epdc.dto.PartyTopicCommentDTO; import com.elink.esua.epdc.dto.PartyTopicDTO; import com.elink.esua.epdc.dto.PartyUserGroupDTO; +import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.form.PartyTopicCommentFormDTO; import com.elink.esua.epdc.entity.PartyTopicCommentEntity; +import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.feign.ContentSecurityFeignClient; +import com.elink.esua.epdc.feign.UserFeignClient; import com.elink.esua.epdc.redis.PartyTopicCommentRedis; +import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO; import com.elink.esua.epdc.service.PartyTopicCommentService; import com.elink.esua.epdc.service.PartyTopicService; import com.elink.esua.epdc.service.PartyUserGroupService; @@ -40,10 +52,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 话题评论表 @@ -62,6 +71,14 @@ public class PartyTopicCommentServiceImpl extends BaseServiceImpl page(Map params) { @@ -129,6 +146,29 @@ public class PartyTopicCommentServiceImpl extends BaseServiceImpl textList = new ArrayList<>(); + textList.add(formDto.getContent()); + String mobile = null; + Result user = userInfoFeignClient.getUserInfoById(formDto.getUserId()); + if(null != user.getData()){ + mobile = user.getData().getMobile(); + } + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + if (!isConReview && (contentResult != null && !contentResult.getAllPass())) { + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(), + formDto.getUserName(),CheckDataUtils.cate_two , CheckDataUtils.decision_one, + ModuleName.PARTY_GROUP_TOPIC_COMMENT.getCode(), textList,null, null,contentResult, + null,null,mobile,"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - 结束 + PartyTopicCommentEntity entity = ConvertUtils.sourceToTarget(formDto, PartyTopicCommentEntity.class); entity.setUsername(formDto.getUserName()); //判断是否被禁言 @@ -164,6 +204,40 @@ public class PartyTopicCommentServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -168,12 +186,60 @@ public class PartyTopicServiceImpl extends BaseServiceImpl textList = new ArrayList<>(); + textList.add(formDto.getTopicContent()); + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + CheckResultDTO imgResult = CheckDataUtils.checkImgs(formDto.getImages()); + if(!isConReview && + ((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(), + formDto.getNickname(), CheckDataUtils.cate_two, CheckDataUtils.decision_one, ModuleName.PARTY_GROUP_TOPIC.getCode(), textList, + formDto.getImages(), null,contentResult, imgResult,null,formDto.getMobile(),"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - 结束 + + + PartyTopicEntity entity = ConvertUtils.sourceToTarget(formDto, PartyTopicEntity.class); entity.setTopicModule(formDto.getTopicType()); if(insert(entity)){ //保存图片 List images = formDto.getImages(); partyTopicImgService.saveImgs(images,entity.getId()); + + //内容审核 - 开始 + //接口异常,保存至待审核信息 + if((contentResult == null || imgResult == null) && !isConReview) { + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(), + formDto.getNickname(), CheckDataUtils.cate_two, null,ModuleName.PARTY_GROUP_TOPIC.getCode(), textList, + formDto.getImages(), entity.getId(),null,null, null,formDto.getMobile(),"1",deptDto); + contentSecurityFeign.insertRecords(record); + } + //保存待审核记录 + if (contentResult != null && imgResult != null) { + CheckResultMessageDTO twoTypes = null; + if(isConReview){ + twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult); + }else{ + twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); + } + if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(), + formDto.getNickname(), CheckDataUtils.cate_two, null,ModuleName.PARTY_GROUP_TOPIC.getCode(), textList, + formDto.getImages(), entity.getId(),null,null, twoTypes,formDto.getMobile(),"0",deptDto); + contentSecurityFeign.insertRecords(record); + } + } + //内容审核 - 结束 + return new Result(); } return new Result().error("发布话题失败"); @@ -238,4 +304,13 @@ public class PartyTopicServiceImpl extends BaseServiceImpl().ok(partyTopicResultDTO); } + + @Override + @Transactional + public Result rejectTopicInfo(RejectRecordDTO dto) { + baseDao.rejectTopicInfo(dto.getRelationId()); + partyTopicImgDao.rejectTopicImgInfo(dto.getRelationId()); + return new Result(); + } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/application.yml index c7d10eab..7b5f06bb 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/application.yml @@ -87,3 +87,8 @@ mybatis-plus: cache-enabled: false call-setters-on-nulls: true jdbc-type-for-null: 'null' + +rocketmq: + name-server: @rocketmq.name.server@ + consumer: + group: @rocketmq.consumer.contentSecurity.group@ diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicCommentDao.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicCommentDao.xml index 6282fcd8..63c0c902 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicCommentDao.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicCommentDao.xml @@ -46,5 +46,10 @@ WHERE ID = #{commentId} + + UPDATE epdc_party_topic_comment SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where id=#{relationId} + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml index 58062a4e..94a6f343 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml @@ -275,4 +275,8 @@ UPDATE epdc_party_topic SET SUPPORT_NUM = SUPPORT_NUM + #{num} WHERE ID = #{id} + + UPDATE epdc_party_topic SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where id=#{relationId} + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicImgDao.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicImgDao.xml index a084814c..082a23c4 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicImgDao.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicImgDao.xml @@ -16,5 +16,8 @@ - + + UPDATE epdc_party_topic_img SET DEL_FLAG = 1,UPDATED_TIME=NOW() + where REFERENCE_ID=#{relationId} + \ No newline at end of file diff --git a/esua-epdc/epdc-module/pom.xml b/esua-epdc/epdc-module/pom.xml index 0dd48e32..e071e96a 100644 --- a/esua-epdc/epdc-module/pom.xml +++ b/esua-epdc/epdc-module/pom.xml @@ -33,6 +33,7 @@ epdc-custom epdc-points epdc-party-group + epdc-content-security From cdf71a496cb0855eccbfa0634b1b4331033c4e6a Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Wed, 5 Aug 2020 15:10:01 +0800 Subject: [PATCH 2/9] =?UTF-8?q?gateway=E6=A8=A1=E5=9D=97bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esua-epdc/epdc-gateway/src/main/resources/application.yml | 2 +- .../epdc-content-security-server/pom.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index fd2cecf2..892563c3 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -196,7 +196,7 @@ spring: - Path=${server.servlet.context-path}/partyGroup/** filters: - StripPrefix=1 - - #安全模块 + #安全模块 - id: epdc-content-security-server uri: @gateway.routes.epdc-content-security-server.uri@ order: 21 diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml index b4de6f20..ce62ef71 100644 --- a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml @@ -137,7 +137,7 @@ dev - 9079 + 9071 2 114.215.125.123 @@ -179,7 +179,7 @@ test - 11015 + 11016 2 114.215.125.123 @@ -218,7 +218,7 @@ prod - 9076 + 9071 0 From 1ab5dd43622d52b8c23868319a53e5578e545ac7 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Wed, 5 Aug 2020 15:37:40 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=B6=88=E8=B4=B9=E8=80=85=E5=88=86?= =?UTF-8?q?=E7=BB=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/rocketmq/consumer/RejectCheckRecordConsumer.java | 2 +- .../esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java index bb2d7c6d..d48f5f35 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java @@ -21,7 +21,7 @@ import org.springframework.stereotype.Component; */ @Slf4j @Component -@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING) +@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING) public class RejectCheckRecordConsumer implements RocketMQListener { @Autowired diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java index 435138dc..e1198b67 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java @@ -22,7 +22,7 @@ import org.springframework.stereotype.Component; */ @Slf4j @Component -@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING) +@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING) public class RejectCheckRecordConsumer implements RocketMQListener { @Autowired From 32c4cdf21fe2f02242619f26e67b083666cdcb2f Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Thu, 6 Aug 2020 09:30:08 +0800 Subject: [PATCH 4/9] =?UTF-8?q?gateway=E5=88=A0=E9=99=A4=E5=AF=B9heart?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esua-epdc/epdc-gateway/src/main/resources/application.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index 892563c3..91b876df 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -258,7 +258,6 @@ renren: - /activiti/service/** - /activiti/editor-app/** - /message/sms/sendCode #发送验证码 - - /heart/** - /oss/file/download - /ws/** workLoginUrls: From 56bb8683eb311012adc350b3feda0ebf4e11267d Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Thu, 6 Aug 2020 13:38:10 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=83=A8=E9=97=A8=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/service/impl/CommentServiceImpl.java | 1 + .../service/impl/PartyGroupServiceImpl.java | 1 + .../epdc/dto/comment/form/CommentFormDTO.java | 5 +- .../service/impl/EventCommentServiceImpl.java | 3 +- .../service/impl/EpdcEventsServiceImpl.java | 2 +- .../epdc/activity/AppActUserClockLogDTO.java | 8 +++ .../activity/service/ActInfoService.java | 10 +++ .../service/impl/ActInfoServiceImpl.java | 62 +++++++++++++++++++ .../impl/ActUserClockLogServiceImpl.java | 13 ++-- .../dto/form/PartyTopicCommentFormDTO.java | 4 ++ .../impl/PartyTopicCommentServiceImpl.java | 3 +- .../service/impl/PartyTopicServiceImpl.java | 3 +- 12 files changed, 98 insertions(+), 17 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java index 466c3ab5..e86cf7b8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java @@ -37,6 +37,7 @@ public class CommentServiceImpl implements CommentService { commentFormDTO.setUserId(userDetail.getUserId()); commentFormDTO.setUserName(userDetail.getNickname()); commentFormDTO.setUserFace(userDetail.getFaceImg()); + commentFormDTO.setDeptId(userDetail.getGridId()); return commentFeignClient.submit(commentFormDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java index 7bb9ae5f..5a8bbcbc 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java @@ -51,6 +51,7 @@ public class PartyGroupServiceImpl implements PartyGroupService { formDto.setPartyMember(userDetail.getPartyFlag()); formDto.setUserFace(userDetail.getFaceImg()); formDto.setUserName(userDetail.getNickname()); + formDto.setDeptId(userDetail.getGridId()); return partyGroupFeignClient.submit(formDto); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java index 31a2d1c4..af737da3 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/form/CommentFormDTO.java @@ -52,5 +52,8 @@ public class CommentFormDTO { *是否提交为内容待审核状态 */ private Boolean isConReview; - + /** + * 切换网格ID + */ + private Long deptId; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java index 00aaafd6..71ceaa1b 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java @@ -29,7 +29,6 @@ import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllD import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; -import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.EventsNoticeConstant; @@ -173,7 +172,7 @@ public class EventCommentServiceImpl extends BaseServiceImpl textList = new ArrayList<>(); textList.add(dto.getEventContent()); // 获取所有上级机构名称和ID拼接 - ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(dto.getGridId()).getData(); CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); CheckResultDTO imgResult = CheckDataUtils.checkImgs(dto.getImages()); if(!isConReview && diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java index a42d18ea..0b3f1365 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppActUserClockLogDTO.java @@ -81,5 +81,13 @@ public class AppActUserClockLogDTO implements Serializable { *是否提交为内容待审核状态 */ private Boolean isConReview; + /** + * 用户名 + */ + private String userName; + /** + * 切换网格ID + */ + private Long deptId; } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java index 54eae1a2..be936903 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java @@ -148,6 +148,16 @@ public interface ActInfoService extends BaseService { */ void update(ActInfoDTO dto); + /** + * 带内容审核更新默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-12-11 + */ + Result updateWithContent(ActInfoDTO dto); + /** * * 取消活动 diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java index a7352eb2..9561fb2c 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -215,6 +215,68 @@ public class ActInfoServiceImpl extends BaseServiceImpl textList = new ArrayList<>(); + textList.add(dto.getTitle()); + textList.add(dto.getActContent()); + List imgList = new ArrayList<>(); + imgList.add(dto.getHeadPic()); + imgList.add(dto.getBannerUrl()); + // 获取所有上级机构名称和ID拼接 + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); + CheckResultDTO imgResult = CheckDataUtils.checkImgs(imgList); + if(!isConReview && + ((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, + userName, CheckDataUtils.cate_one, CheckDataUtils.decision_one, ModuleName.HELP_ACTIVITY.getCode(), textList, + imgList, null,contentResult, imgResult,null,dto.getTel(),"0",deptDto); + contentSecurityFeign.insertViolationsRecord(record); + return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); + } + //内容审核 - end + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + updateById(entity); + //内容审核- 开始 + //接口异常,保存至待审核信息 + if((contentResult == null || imgResult == null) && !isConReview) { + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, + userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, + imgList, entity.getId(),null,null, null,dto.getTel(),"1",deptDto); + contentSecurityFeign.insertRecords(record); + } + + //保存待审核记录 + if (contentResult != null && imgResult != null) { + CheckResultMessageDTO twoTypes = null; + if(isConReview){ + twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult); + }else{ + twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); + } + if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { + //组装要保存的信息 + SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, + userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, + imgList, entity.getId(),null,null, twoTypes,dto.getTel(),"0",deptDto); + contentSecurityFeign.insertRecords(record); + } + } + //内容审核 - 结束 + return new Result(); + } + /** * 活动列表-移动app端用 * diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java index a4be2254..d28a2c6f 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java @@ -37,7 +37,6 @@ import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllD import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; -import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.LocalDateUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -312,17 +311,13 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl user = userInfoFeignClient.getUserInfoById(appActUserClockLogDTO.getUserId()); if(null != user.getData()){ mobile = user.getData().getMobile(); } // 获取所有上级机构名称和ID拼接 - ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(appActUserClockLogDTO.getDeptId()).getData(); List textList = new ArrayList<>(); textList.add(appActUserClockLogDTO.getClockDesc()); CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); @@ -331,7 +326,7 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl textList = new ArrayList<>(); textList.add(formDto.getTopicContent()); // 获取所有上级机构名称和ID拼接 - ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDto.getGridId()).getData(); CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); CheckResultDTO imgResult = CheckDataUtils.checkImgs(formDto.getImages()); if(!isConReview && From 348cd271e289045d7cdbb174f91dfe4bcb2fa88e Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Thu, 6 Aug 2020 18:04:01 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=AE=A1=E7=90=86BUG?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/events/controller/EpdcAppEventsController.java | 5 ++++- .../epdc/modules/activity/controller/ActInfoController.java | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java index 661a4d3e..07e55be8 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/controller/EpdcAppEventsController.java @@ -41,7 +41,10 @@ public class EpdcAppEventsController { //效验数据 ValidatorUtils.validateEntity(formDto); Result epdcEventsEntityResult = epdcEventsService.saveEvent(formDto); - return new Result().ok(epdcEventsEntityResult.getData().getId()); + if(epdcEventsEntityResult!=null && epdcEventsEntityResult.success()){ + return new Result().ok(epdcEventsEntityResult.getData().getId()); + } + return epdcEventsEntityResult; } /** diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java index 09007ecf..ccda72d3 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java @@ -91,8 +91,7 @@ public class ActInfoController { public Result update(@RequestBody ActInfoDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - actInfoService.update(dto); - return new Result(); + return actInfoService.updateWithContent(dto); } /** From a3c383f6b5dfe58f1d2fbd59db15a4068f2344f4 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Fri, 7 Aug 2020 09:51:09 +0800 Subject: [PATCH 7/9] =?UTF-8?q?mq=E5=86=85=E5=AE=B9=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc-content-security-server/pom.xml | 6 +++--- .../epdc-module/epdc-events/epdc-events-server/pom.xml | 6 +++--- esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml | 6 +++--- .../epdc-party-group/epdc-party-group-server/pom.xml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml index ce62ef71..5d64eae3 100644 --- a/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml @@ -170,7 +170,7 @@ 47.104.85.99:9876;114.215.125.123:9876 - contentSecurityGroup + jinshui-contentSecurityGroup @@ -209,7 +209,7 @@ 47.104.85.99:9876;114.215.125.123:9876 - contentSecurityGroup + jinshui-contentSecurityGroup @@ -246,7 +246,7 @@ epdc epdc@jinshui888 172.16.0.52:9876;172.16.0.54:9876 - contentSecurityGroup + jinshui-contentSecurityGroup diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index 837a49cd..7ab898b2 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -188,7 +188,7 @@ jinshui-categoryGroup jinshui-pointsGroup jinshui-pointsGroup - contentSecurityGroup + jinshui-contentSecurityGroup @@ -235,7 +235,7 @@ jinshui-categoryGroup jinshui-pointsGroup jinshui-pointsGroup - contentSecurityGroup + jinshui-contentSecurityGroup @@ -285,7 +285,7 @@ jinshui-categoryGroup jinshui-pointsGroup jinshui-pointsGroup - contentSecurityGroup + jinshui-contentSecurityGroup diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml index 6839427a..359828a1 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml @@ -174,7 +174,7 @@ 47.104.85.99:9876;114.215.125.123:9876 - contentSecurityGroup + jinshui-contentSecurityGroup @@ -202,7 +202,7 @@ fa5bf520-09c1-410c-a876-28e98c0534d3 47.104.85.99:9876;114.215.125.123:9876 - contentSecurityGroup + jinshui-contentSecurityGroup @@ -232,7 +232,7 @@ epdc@jinshui888 172.16.0.7:9876;172.16.0.8:9876 - contentSecurityGroup + jinshui-contentSecurityGroup diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml index 89628b96..63cf62b2 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml @@ -156,7 +156,7 @@ fa5bf520-09c1-410c-a876-28e98c0534d3 47.104.85.99:9876;114.215.125.123:9876 - contentSecurityGroup + jinshui-contentSecurityGroup @@ -185,7 +185,7 @@ fa5bf520-09c1-410c-a876-28e98c0534d3 47.104.85.99:9876;114.215.125.123:9876 - contentSecurityGroup + jinshui-contentSecurityGroup @@ -216,7 +216,7 @@ epdc@jinshui888 172.16.0.7:9876;172.16.0.8:9876 - contentSecurityGroup + jinshui-contentSecurityGroup From 6d46dfea7df4ddbbf8ccbd0fcd3bcc541396005b Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Fri, 7 Aug 2020 10:50:00 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=89=93=E5=8D=A1=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java | 5 +++++ .../esua/epdc/controller/ApiActUserRelationController.java | 1 + 2 files changed, 6 insertions(+) diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java index 2d30a452..9ea234d3 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java @@ -77,4 +77,9 @@ public class EpdcAppActUserClockLogDTO implements Serializable { @NotBlank(message = "打卡是否有效不能为空") private String effectiveFlag; + /** + *是否提交为内容待审核状态 + */ + private Boolean isConReview; + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java index 0ccfad84..6e481c54 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java @@ -127,6 +127,7 @@ public class ApiActUserRelationController { ValidatorUtils.validateEntity(epdcAppActUserClockLogDTO); AppActUserClockLogDTO appActUserClockLogDTO = ConvertUtils.sourceToTarget(epdcAppActUserClockLogDTO, AppActUserClockLogDTO.class); appActUserClockLogDTO.setUserId(tokenDto.getUserId()); + appActUserClockLogDTO.setDeptId(tokenDto.getGridId()); return actUserRelationService.activityClock(appActUserClockLogDTO); } From ef4b13640068df8960a1f67cc31cc9a579ad0d2a Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Fri, 7 Aug 2020 18:01:33 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=89=93=E5=8D=A1=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/security/content/ModuleName.java | 2 +- .../esua/epdc/service/impl/ItemServiceImpl.java | 2 ++ .../esua/epdc/dto/item/form/EvaluationFormDTO.java | 3 +++ .../modules/item/service/impl/ItemServiceImpl.java | 12 ++++-------- .../activity/service/impl/ActInfoServiceImpl.java | 11 +++++++++++ 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java index e171da9e..296e752a 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java @@ -13,7 +13,7 @@ public enum ModuleName { ISSUE_SUBMIT("issue_submit","议题项目-我要报事"), ISSUE_COMMENT("issue_comment","议题项目-评论"), ITEM_SATISFACTION("item_satisfaction","项目详情-满意度评价"), - PARTY_GROUP_TOPIC("party_group_topic","党群1+1-发布话题"), + PARTY_GROUP_TOPIC("party_group_topic","党群1+1-发个新话题"), PARTY_GROUP_TOPIC_COMMENT("party_group_topic_comment","党群1+1-评论"), HELP_SIGNIN("help_signIn","初心互助-已报名活动-我要打卡"); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java index e7e2f72f..e453ffa9 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java @@ -52,6 +52,8 @@ public class ItemServiceImpl implements ItemService { return new Result().error("获取用户信息失败"); } evaluationFormDTO.setUserId(userDetail.getUserId()); + evaluationFormDTO.setUserName(userDetail.getNickname()); + evaluationFormDTO.setDeptId(userDetail.getGridId()); return itemFeignClient.evaluation(evaluationFormDTO); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java index f135222b..56bb7676 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/EvaluationFormDTO.java @@ -25,6 +25,9 @@ public class EvaluationFormDTO implements Serializable { private String evaluationContent; private String userId; + private String userName; + private Long deptId; + /** *是否提交为内容待审核状态 diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index 2ac37e8f..8ae191b8 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -311,24 +311,20 @@ public class ItemServiceImpl extends BaseServiceImpl implem if (itemEntityResult.getUserId().equals(evaluationFormDTO.getUserId()) && itemEntityResult.getEvaluationScore() == null) { //内容审核 - start Boolean isConReview = evaluationFormDTO.getIsConReview(); - String userName = null; - if(null != SecurityUser.getUser()){ - userName = SecurityUser.getUser().getUsername(); - } String mobile = null; Result user = userFeignClient.getUserInfoById(evaluationFormDTO.getUserId()); if(null != user.getData()){ mobile = user.getData().getMobile(); } // 获取所有上级机构名称和ID拼接 - ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); + ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(evaluationFormDTO.getDeptId()).getData(); List textList = new ArrayList<>(); textList.add(evaluationFormDTO.getEvaluationContent()); CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); if (!isConReview && (contentResult != null && !contentResult.getAllPass())) { //组装要保存的信息 SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(), - userName,CheckDataUtils.cate_two , CheckDataUtils.decision_one, + evaluationFormDTO.getUserName(),CheckDataUtils.cate_two , CheckDataUtils.decision_one, ModuleName.ITEM_SATISFACTION.getCode(), textList,null, null,contentResult, null,null,mobile,"0",deptDto); contentSecurityFeign.insertViolationsRecord(record); @@ -348,7 +344,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem //接口异常,保存至待审核信息 if(contentResult == null && !isConReview) { SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(), - userName, CheckDataUtils.cate_two, null,ModuleName.ITEM_SATISFACTION.getCode(), textList, + evaluationFormDTO.getUserName(), CheckDataUtils.cate_two, null,ModuleName.ITEM_SATISFACTION.getCode(), textList, null, itemEntity.getId(),null,null, null,mobile,"1",deptDto); contentSecurityFeign.insertRecords(record); } @@ -364,7 +360,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { //组装要保存的信息 SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(), - userName, CheckDataUtils.cate_two, null, ModuleName.ITEM_SATISFACTION.getCode(), textList, + evaluationFormDTO.getUserName(), CheckDataUtils.cate_two, null, ModuleName.ITEM_SATISFACTION.getCode(), textList, null,itemEntity.getId(), null,null,twoTypes,mobile,"0",deptDto); contentSecurityFeign.insertRecords(record); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java index 9561fb2c..bfdbca02 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -673,6 +673,17 @@ public class ActInfoServiceImpl extends BaseServiceImpl queryMap = new HashMap<>(); + queryMap.put("ACT_USER_ID",actUserClockLogEntity.getActUserId()); + List actUserClockLogEntities = actUserClockLogDao.selectByMap(queryMap); + if(actUserClockLogEntities.size()==1){ + ActUserRelationEntity actUserRelationEntity = new ActUserRelationEntity(); + actUserRelationEntity.setId(actUserClockLogEntity.getActUserId()); + actUserRelationEntity.setStatus("1"); + actUserRelationDao.updateById(actUserRelationEntity); + } actUserClockLogDao.rejectActClockInfo(dto.getRelationId()); actClockPicDao.rejectActClockPicInfo(dto.getRelationId()); return new Result();