Browse Source

Merge remote-tracking branch 'origin/feature/syp_contentSecurity'

feature/syp_points
songyunpeng 5 years ago
parent
commit
884d0baf58
  1. 54
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/RocketMqConstant.java
  2. 5
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java
  3. 354
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/CheckDataUtils.java
  4. 36
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java
  5. 33
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckContentFormDTO.java
  6. 21
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/CheckDataFromDTO.java
  7. 51
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/ParentAndAllDeptDTO.java
  8. 122
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/form/SaveCheckRecordsDTO.java
  9. 41
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckDetailResultsDTO.java
  10. 38
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDTO.java
  11. 38
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultDetailsDTO.java
  12. 33
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/dto/result/CheckResultMessageDTO.java
  13. 5
      esua-epdc/epdc-gateway/pom.xml
  14. 9
      esua-epdc/epdc-gateway/src/main/resources/application.yml
  15. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppActUserClockLogDTO.java
  16. 1
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java
  17. 1
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CommentServiceImpl.java
  18. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java
  19. 1
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java
  20. 0
      esua-epdc/epdc-module/epdc-content-security/db/mysql.sql
  21. 0
      esua-epdc/epdc-module/epdc-content-security/db/oracle.sql
  22. 0
      esua-epdc/epdc-module/epdc-content-security/db/postgresql.sql
  23. 0
      esua-epdc/epdc-module/epdc-content-security/db/sqlserver.sql
  24. 27
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/pom.xml
  25. 86
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckCodeDTO.java
  26. 19
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckImgsDetailsDTO.java
  27. 159
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsDTO.java
  28. 86
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckRecordsImgsDTO.java
  29. 97
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/CheckResultDTO.java
  30. 37
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/DemoDto.java
  31. 20
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsDetailsDTO.java
  32. 117
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsDTO.java
  33. 87
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/ViolationsRecordsImgsDTO.java
  34. 33
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/src/main/java/com/elink/esua/epdc/dto/form/HandleRecordsFormDTO.java
  35. 20
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/Dockerfile
  36. 254
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml
  37. 31
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/ContentSecurityApplication.java
  38. 35
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/async/RejectCheckResultsTask.java
  39. 26
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/config/ModuleConfigImpl.java
  40. 107
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckCodeController.java
  41. 94
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckRecordsController.java
  42. 94
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/CheckResultController.java
  43. 70
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/HandleResultController.java
  44. 94
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/controller/ViolationsRecordsController.java
  45. 44
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckCodeDao.java
  46. 55
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsDao.java
  47. 44
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckRecordsImgsDao.java
  48. 33
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/CheckResultDao.java
  49. 55
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsDao.java
  50. 33
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/dao/ViolationsRecordsImgsDao.java
  51. 58
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckCodeEntity.java
  52. 141
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsEntity.java
  53. 58
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckRecordsImgsEntity.java
  54. 66
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/CheckResultEntity.java
  55. 137
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsEntity.java
  56. 58
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/entity/ViolationsRecordsImgsEntity.java
  57. 65
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckCodeExcel.java
  58. 111
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsExcel.java
  59. 65
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckRecordsImgsExcel.java
  60. 71
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/CheckResultExcel.java
  61. 111
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsExcel.java
  62. 65
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/excel/ViolationsRecordsImgsExcel.java
  63. 24
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/exception/ModuleErrorCode.java
  64. 31
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/MessageFeignClient.java
  65. 21
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/feign/fallback/MessageFeignClientFallback.java
  66. 47
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckCodeRedis.java
  67. 47
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsImgsRedis.java
  68. 47
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckRecordsRedis.java
  69. 47
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/CheckResultRedis.java
  70. 47
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/ViolationsRecordsImgsRedis.java
  71. 47
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/redis/ViolationsRecordsRedis.java
  72. 27
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/RejectRecordDTO.java
  73. 45
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/rocketmq/producer/RejectCheckRecordProducer.java
  74. 105
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckCodeService.java
  75. 106
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsImgsService.java
  76. 115
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckRecordsService.java
  77. 106
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/CheckResultService.java
  78. 105
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsImgsService.java
  79. 117
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/ViolationsRecordsService.java
  80. 111
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckCodeServiceImpl.java
  81. 123
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsImgsServiceImpl.java
  82. 121
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckRecordsServiceImpl.java
  83. 231
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/CheckResultServiceImpl.java
  84. 123
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsImgsServiceImpl.java
  85. 127
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/service/impl/ViolationsRecordsServiceImpl.java
  86. 21
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/java/com/elink/esua/epdc/utils/ModuleConstant.java
  87. 121
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/application.yml
  88. 12
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/db/migration/V1_1__INIT_DATABASE.sql
  89. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages.properties
  90. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_en_US.properties
  91. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_CN.properties
  92. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_zh_TW.properties
  93. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation.properties
  94. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_en_US.properties
  95. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_CN.properties
  96. 1
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_zh_TW.properties
  97. 161
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/logback-spring.xml
  98. 23
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckCodeDao.xml
  99. 118
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsDao.xml
  100. 23
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsImgsDao.xml

54
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";
}

5
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";
}

354
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<String> textList) {
for (Iterator<String> 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<CheckContentFormDTO> 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<String> imgArray) {
CheckDataFromDTO tasks = new CheckDataFromDTO();
List<CheckContentFormDTO> 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<String> textList,
List<String> 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;
}
}

36
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;
}
}

33
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;
}

21
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<CheckContentFormDTO> tasks;
}

51
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;
}

122
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<String> 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;
}

41
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;
}

38
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<String> successDataIds;
/**
*审核未通过的dataId列表
*/
private List<String> failDataIds;
/**
*审核详情
*/
private List<CheckResultDetailsDTO> details;
/**
*提交的任务是否全部通过true-false-
*/
private Boolean allPass = true;
}

38
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<CheckDetailResultsDTO> results;
}

33
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;
}

5
esua-epdc/epdc-gateway/pom.xml

@ -140,6 +140,8 @@
<!-- <gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server-->
<!-- </gateway.routes.epdc-analysis-server.uri>-->
<gateway.routes.epdc-analysis-server.uri>http://127.0.0.1:9078</gateway.routes.epdc-analysis-server.uri>
<gateway.routes.epdc-content-security-server.uri>lb://epdc-content-security-server</gateway.routes.epdc-content-security-server.uri>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -187,6 +189,7 @@
<gateway.routes.epdc-points-server.uri>lb://epdc-points-server</gateway.routes.epdc-points-server.uri>
<gateway.routes.epdc-party-group-server.uri>lb://epdc-party-group-server</gateway.routes.epdc-party-group-server.uri>
<gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server</gateway.routes.epdc-analysis-server.uri>
<gateway.routes.epdc-content-security-server.uri>lb://epdc-content-security-server</gateway.routes.epdc-content-security-server.uri>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -226,6 +229,8 @@
<gateway.routes.epdc-points-server.uri>lb://epdc-points-server</gateway.routes.epdc-points-server.uri>
<gateway.routes.epdc-party-group-server.uri>lb://epdc-party-group-server</gateway.routes.epdc-party-group-server.uri>
<gateway.routes.epdc-analysis-server.uri>lb://epdc-analysis-server</gateway.routes.epdc-analysis-server.uri>
<gateway.routes.epdc-content-security-server.uri>lb://epdc-content-security-server</gateway.routes.epdc-content-security-server.uri>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>172.16.0.8</spring.redis.host>

9
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@
@ -250,7 +258,6 @@ renren:
- /activiti/service/**
- /activiti/editor-app/**
- /message/sms/sendCode #发送验证码
- /heart/**
- /oss/file/download
- /ws/**
workLoginUrls:

5
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;
}

1
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);
}

1
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);
}

2
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<ItemDetailResultDTO>().error("获取用户信息失败");
}
evaluationFormDTO.setUserId(userDetail.getUserId());
evaluationFormDTO.setUserName(userDetail.getNickname());
evaluationFormDTO.setDeptId(userDetail.getGridId());
return itemFeignClient.evaluation(evaluationFormDTO);
}

1
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);
}

0
esua-epdc/epdc-module/epdc-content-security/db/mysql.sql

0
esua-epdc/epdc-module/epdc-content-security/db/oracle.sql

0
esua-epdc/epdc-module/epdc-content-security/db/postgresql.sql

0
esua-epdc/epdc-module/epdc-content-security/db/sqlserver.sql

27
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-client/pom.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-content-security</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>epdc-content-security-client</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>

86
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

19
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;
}

159
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckImgsDetailsDTO> imgUrls;
}

86
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

97
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

37
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.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
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;
}

20
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;
}

117
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<ViolationsDetailsDTO> imgUrls;
}

87
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

33
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;
}

20
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}

254
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml

@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-content-security</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>epdc-content-security-server</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-content-security-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-mybatis</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>${spring.boot.admin.version}</version>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools-wx-ma</artifactId>
<version>${project.version}</version>
</dependency>
<!--<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>-->
<!--版本控制-->
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-api-version-control</artifactId>
<version>${project.version}</version>
</dependency>
<!--RocketMQ-->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-message-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/application*.yml</include>
<include>**/*.properties</include>
<include>logback-spring.xml</include>
<include>registry.conf</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>**/application*.yml</exclude>
<exclude>**/*.properties</exclude>
<exclude>logback-spring.xml</exclude>
<exclude>registry.conf</exclude>
</excludes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring.profiles.active>dev</spring.profiles.active>
<server.port>9071</server.port>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/js_esua_epdc_content_security?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>jinshui</spring.datasource.druid.username>
<spring.datasource.druid.password>jinshui@833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
<nacos.register.ip></nacos.register.ip>
<nacos.ip>47.104.224.45</nacos.ip>
<nacos.namespace>fa5bf520-09c1-410c-a876-28e98c0534d3</nacos.namespace>
<!--居民端小程序配置-->
<wx.ma.appId>wx6dcf544cdae7d4ec</wx.ma.appId>
<wx.ma.secret>9e0882274ad3821400370312a56a8470</wx.ma.secret>
<!--工作端小程序-->
<work.wx.ma.appId>wx826a8435db9e0947</work.wx.ma.appId>
<work.wx.ma.secret>cbcb7c422f00d165105b34dc80bb825f</work.wx.ma.secret>
<!--数据分析端小程序-->
<analysis.wx.ma.appId>wx3ea0a6fb71ddf659</analysis.wx.ma.appId>
<analysis.wx.ma.secret>2154e86d56df9fae4224c93a17e01bb3</analysis.wx.ma.secret>
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.producer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.producer.contentSecurity.group>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<spring.profiles.active>test</spring.profiles.active>
<server.port>11016</server.port>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>
<spring.redis.port>9603</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/js_esua_epdc_content_security?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>jinshui</spring.datasource.druid.username>
<spring.datasource.druid.password>jinshui@833066</spring.datasource.druid.password>
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
<nacos.ip>47.104.224.45</nacos.ip>
<nacos.namespace>fa5bf520-09c1-410c-a876-28e98c0534d3</nacos.namespace>
<!--居民端小程序配置-->
<wx.ma.appId>wx6dcf544cdae7d4ec</wx.ma.appId>
<wx.ma.secret>9e0882274ad3821400370312a56a8470</wx.ma.secret>
<!--工作端小程序-->
<work.wx.ma.appId>wx826a8435db9e0947</work.wx.ma.appId>
<work.wx.ma.secret>cbcb7c422f00d165105b34dc80bb825f</work.wx.ma.secret>
<!--数据分析端小程序-->
<analysis.wx.ma.appId>wx3ea0a6fb71ddf659</analysis.wx.ma.appId>
<analysis.wx.ma.secret>2154e86d56df9fae4224c93a17e01bb3</analysis.wx.ma.secret>
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.producer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.producer.contentSecurity.group>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
<server.port>9071</server.port>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>172.16.0.8</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<!--居民端小程序配置-->
<wx.ma.appId>wx6dcf544cdae7d4ec</wx.ma.appId>
<wx.ma.secret>9e0882274ad3821400370312a56a8470</wx.ma.secret>
<!--工作端小程序-->
<work.wx.ma.appId>wx826a8435db9e0947</work.wx.ma.appId>
<work.wx.ma.secret>cbcb7c422f00d165105b34dc80bb825f</work.wx.ma.secret>
<!--数据分析端小程序-->
<analysis.wx.ma.appId>wx3ea0a6fb71ddf659</analysis.wx.ma.appId>
<analysis.wx.ma.secret>2154e86d56df9fae4224c93a17e01bb3</analysis.wx.ma.secret>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>172.16.0.7:10000,172.16.0.7:10001</nacos.server-addr>
<nacos.ip>172.16.0.8</nacos.ip>
<nacos.namespace></nacos.namespace>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5e4l333jb61be50n.mysql.rds.aliyuncs.com:3306/esua_epdc_content_security?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>epdc@jinshui888</spring.datasource.druid.password>
<rocketmq.name.server>172.16.0.52:9876;172.16.0.54:9876</rocketmq.name.server>
<rocketmq.producer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.producer.contentSecurity.group>
</properties>
</profile>
</profiles>
</project>

31
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);
}
}

35
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;
/**
*
* 内容审核-违规 - 发送短信
*
* @Authorwangtong
* @Date2020/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);
}
}

26
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.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
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";
}
}

107
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<CheckCodeDTO>> page(@RequestParam Map<String, Object> params){
PageData<CheckCodeDTO> page = checkCodeService.page(params);
return new Result<PageData<CheckCodeDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<CheckCodeDTO> get(@PathVariable("id") String id){
CheckCodeDTO data = checkCodeService.get(id);
return new Result<CheckCodeDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<CheckCodeDTO> 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<java.util.List<com.elink.esua.epdc.entity.CheckCodeEntity>>
*/
@GetMapping("getResourcesByType")
public Result<List<CheckCodeEntity>> getResourcesByType(String type){
return checkCodeService.getResourcesByType(type);
}
}

94
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<CheckRecordsDTO>> page(@RequestParam Map<String, Object> params){
PageData<CheckRecordsDTO> page = checkRecordsService.page(params);
return new Result<PageData<CheckRecordsDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<CheckRecordsDTO> get(@PathVariable("id") String id){
CheckRecordsDTO data = checkRecordsService.getDetails(id);
return new Result<CheckRecordsDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<CheckRecordsDTO> list = checkRecordsService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, CheckRecordsExcel.class);
}
}

94
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<CheckResultDTO>> page(@RequestParam Map<String, Object> params){
PageData<CheckResultDTO> page = checkResultService.page(params);
return new Result<PageData<CheckResultDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<CheckResultDTO> get(@PathVariable("id") String id){
CheckResultDTO data = checkResultService.get(id);
return new Result<CheckResultDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<CheckResultDTO> list = checkResultService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, CheckResultExcel.class);
}
}

70
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);
}
}

94
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<PageData<ViolationsRecordsDTO>> page(@RequestParam Map<String, Object> params){
PageData<ViolationsRecordsDTO> page = violationsRecordsService.page(params);
return new Result<PageData<ViolationsRecordsDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ViolationsRecordsDTO> get(@PathVariable("id") String id){
ViolationsRecordsDTO data = violationsRecordsService.getDetails(id);
return new Result<ViolationsRecordsDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<ViolationsRecordsDTO> list = violationsRecordsService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ViolationsRecordsExcel.class);
}
}

44
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckCodeEntity> {
/**
* @describe: 根据type获取字典数据
* @author wangtong
* @date 2020/7/14 9:35
* @param [type]
* @return java.util.List<com.elink.esua.epdc.entity.CheckCodeEntity>
*/
List<CheckCodeEntity> getResourcesByType(@Param("type") String type);
}

55
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckRecordsEntity> {
/**
* @describe: 获取待审核列表
* @author wangtong
* @date 2020/7/10 15:48
* @param [params]
* @return java.util.List<com.elink.esua.epdc.dto.CheckRecordsDTO>
*/
List<CheckRecordsDTO> getCheckRecords(Map<String, Object> 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);
}

44
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckRecordsImgsEntity> {
/**
* @describe: 根据待审核ID获取图片信息
* @author wangtong
* @date 2020/7/13 19:35
* @param [id]
* @return java.util.List<com.elink.esua.epdc.entity.CheckRecordsImgsEntity>
*/
List<CheckRecordsImgsEntity> selectListByRecordId(@Param("id") String id);
}

33
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckResultEntity> {
}

55
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<ViolationsRecordsEntity> {
/**
* @describe: 违规记录列表
* @author wangtong
* @date 2020/7/9 10:18
* @param [params]
* @return java.util.List<com.elink.esua.epdc.entity.ViolationsRecordsEntity>
*/
List<ViolationsRecordsDTO> getViolationsRecord(Map<String, Object> 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);
}

33
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<ViolationsRecordsImgsEntity> {
}

58
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

141
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

58
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

66
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

137
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

58
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

65
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

111
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

65
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

71
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

111
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

65
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}

24
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位为业务编码
* <p>
* 100001001100001代表模块001代表业务代码
* </p>
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public interface ModuleErrorCode extends ErrorCode {
}

31
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;
/**
* 消息通知模块
*
* @Authorwangtong
* @Date2020/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
* @Date2020/01/08 10:31
*/
@PostMapping(value = "message/epdc-app/smstemplate/sendSmsNotice", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result sendSmsNotice(@RequestBody SmsNoticeFormDTO smsNoticeFormDTO);
}

21
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;
/**
* @Authorwangtong
* @Date2020/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);
}
}

47
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}
}

47
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}
}

47
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}
}

47
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}
}

47
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}
}

47
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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;
}
}

27
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;
}

45
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消息
*
* @Authorwangtong
* @Date2020/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();
}
}
}

105
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckCodeEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CheckCodeDTO>
* @author generator
* @date 2020-07-03
*/
PageData<CheckCodeDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CheckCodeDTO>
* @author generator
* @date 2020-07-03
*/
List<CheckCodeDTO> list(Map<String, Object> 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<java.util.List<com.elink.esua.epdc.entity.CheckCodeEntity>>
*/
Result<List<CheckCodeEntity>> getResourcesByType(String type);
}

106
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckRecordsImgsEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CheckRecordsImgsDTO>
* @author generator
* @date 2020-07-08
*/
PageData<CheckRecordsImgsDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CheckRecordsImgsDTO>
* @author generator
* @date 2020-07-08
*/
List<CheckRecordsImgsDTO> list(Map<String, Object> 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<String> imgUrls, String id);
}

115
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckRecordsEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CheckRecordsDTO>
* @author generator
* @date 2020-07-03
*/
PageData<CheckRecordsDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CheckRecordsDTO>
* @author generator
* @date 2020-07-03
*/
List<CheckRecordsDTO> list(Map<String, Object> 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);
}

106
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckResultEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CheckResultDTO>
* @author generator
* @date 2020-07-03
*/
PageData<CheckResultDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CheckResultDTO>
* @author generator
* @date 2020-07-03
*/
List<CheckResultDTO> list(Map<String, Object> 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);
}

105
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<ViolationsRecordsImgsEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ViolationsRecordsImgsDTO>
* @author generator
* @date 2020-07-08
*/
PageData<ViolationsRecordsImgsDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ViolationsRecordsImgsDTO>
* @author generator
* @date 2020-07-08
*/
List<ViolationsRecordsImgsDTO> list(Map<String, Object> 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<String> imgUrls, String id);
}

117
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<ViolationsRecordsEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ViolationsRecordsDTO>
* @author generator
* @date 2020-07-03
*/
PageData<ViolationsRecordsDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ViolationsRecordsDTO>
* @author generator
* @date 2020-07-03
*/
List<ViolationsRecordsDTO> list(Map<String, Object> 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);
}

111
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckCodeDao, CheckCodeEntity> implements CheckCodeService {
@Autowired
private CheckCodeRedis checkCodeRedis;
@Override
public PageData<CheckCodeDTO> page(Map<String, Object> params) {
IPage<CheckCodeEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CheckCodeDTO.class);
}
@Override
public List<CheckCodeDTO> list(Map<String, Object> params) {
List<CheckCodeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CheckCodeDTO.class);
}
private QueryWrapper<CheckCodeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CheckCodeEntity> 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<List<CheckCodeEntity>> getResourcesByType(String type) {
List<CheckCodeEntity> result = baseDao.getResourcesByType(type);
return new Result<List<CheckCodeEntity>>().ok(result);
}
}

123
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckRecordsImgsDao, CheckRecordsImgsEntity> implements CheckRecordsImgsService {
@Autowired
private CheckRecordsImgsRedis checkRecordsImgsRedis;
@Override
public PageData<CheckRecordsImgsDTO> page(Map<String, Object> params) {
IPage<CheckRecordsImgsEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CheckRecordsImgsDTO.class);
}
@Override
public List<CheckRecordsImgsDTO> list(Map<String, Object> params) {
List<CheckRecordsImgsEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CheckRecordsImgsDTO.class);
}
private QueryWrapper<CheckRecordsImgsEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CheckRecordsImgsEntity> 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<String> imgUrls, String referencrId) {
List<CheckRecordsImgsEntity> 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();
}
}

121
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckRecordsDao, CheckRecordsEntity> implements CheckRecordsService {
@Autowired
private CheckRecordsRedis checkRecordsRedis;
@Autowired
private CheckRecordsImgsService checkRecordsImgsService;
@Override
public PageData<CheckRecordsDTO> page(Map<String, Object> params) {
IPage<CheckRecordsDTO> page = getPage(params);
List<CheckRecordsDTO> list = baseDao.getCheckRecords(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<CheckRecordsDTO> list(Map<String, Object> params) {
List<CheckRecordsEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CheckRecordsDTO.class);
}
private QueryWrapper<CheckRecordsEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CheckRecordsEntity> 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);
}
}

231
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<CheckResultDao, CheckResultEntity> 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<CheckResultDTO> page(Map<String, Object> params) {
IPage<CheckResultEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CheckResultDTO.class);
}
@Override
public List<CheckResultDTO> list(Map<String, Object> params) {
List<CheckResultEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CheckResultDTO.class);
}
private QueryWrapper<CheckResultEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CheckResultEntity> 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<ViolationsRecordsImgsEntity> vioImgList = new ArrayList<>();
List<CheckRecordsImgsEntity> 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<String> list = new ArrayList<>();
list.add(userMobile);
// 驳回用户提交信息 操作发送短信
SmsNoticeFormDTO sms = new SmsNoticeFormDTO();
sms.setMobiles(list);
sms.setSmsTemplateType(SysSmsTemplateConstant.SMS_TEMPLATE_CONTENT_SECURITY_BLOCK);
rejectCheckResultsTask.sendSmsNotice(sms);
}
}

123
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<ViolationsRecordsImgsDao, ViolationsRecordsImgsEntity> implements ViolationsRecordsImgsService {
@Autowired
private ViolationsRecordsImgsRedis violationsRecordsImgsRedis;
@Override
public PageData<ViolationsRecordsImgsDTO> page(Map<String, Object> params) {
IPage<ViolationsRecordsImgsEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ViolationsRecordsImgsDTO.class);
}
@Override
public List<ViolationsRecordsImgsDTO> list(Map<String, Object> params) {
List<ViolationsRecordsImgsEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ViolationsRecordsImgsDTO.class);
}
private QueryWrapper<ViolationsRecordsImgsEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ViolationsRecordsImgsEntity> 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<String> imgUrls, String referencrId) {
List<ViolationsRecordsImgsEntity> 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();
}
}

127
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
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.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<ViolationsRecordsDao, ViolationsRecordsEntity> implements ViolationsRecordsService {
@Autowired
private ViolationsRecordsRedis violationsRecordsRedis;
@Autowired
private ViolationsRecordsImgsService violationsRecordsImgsService;
@Override
public PageData<ViolationsRecordsDTO> page(Map<String, Object> params) {
// params.put("deptIdList", SecurityUser.getUser().getDeptIdList());
// params.put("creatUser",SecurityUser.getUser().getId());
IPage<ViolationsRecordsDTO> page = getPage(params);
List<ViolationsRecordsDTO> list = baseDao.getViolationsRecord(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<ViolationsRecordsDTO> list(Map<String, Object> params) {
List<ViolationsRecordsEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ViolationsRecordsDTO.class);
}
private QueryWrapper<ViolationsRecordsEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ViolationsRecordsEntity> 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);
}
}

21
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 {
}

121
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@

12
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');

1
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages.properties

@ -0,0 +1 @@
#Default

1
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/messages_en_US.properties

@ -0,0 +1 @@
#English

1
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

1
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

1
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation.properties

@ -0,0 +1 @@
#Default

1
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/i18n/validation_en_US.properties

@ -0,0 +1 @@
#English

1
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

1
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

161
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/logback-spring.xml

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/contentSecurity"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--1. 输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/debug.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/info.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/warn.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/error.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.elink.esua.epdc" level="INFO"/>
<logger name="com.elink.esua.epdc.modules.*.dao" level="DEBUG"/>
<!--<logger name="com.elink.esua.epdc.modules.issue.dao" level="DEBUG"/>-->
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springboot.sample" level="ERROR"/>
<logger name="com.elink.esua.epdc" level="ERROR"/>
<root level="ERROR">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>

23
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckCodeDao.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.CheckCodeDao">
<resultMap type="com.elink.esua.epdc.entity.CheckCodeEntity" id="checkCodeMap">
<result property="id" column="ID"/>
<result property="type" column="TYPE"/>
<result property="code" column="CODE"/>
<result property="description" column="DESCRIPTION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getResourcesByType" resultType="com.elink.esua.epdc.entity.CheckCodeEntity">
select * from epdc_check_code where type=#{type} and DEL_FLAG=0
</select>
</mapper>

118
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsDao.xml

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.CheckRecordsDao">
<resultMap type="com.elink.esua.epdc.entity.CheckRecordsEntity" id="checkRecordsMap">
<result property="id" column="ID"/>
<result property="userId" column="USER_ID"/>
<result property="name" column="NAME"/>
<result property="category" column="CATEGORY"/>
<result property="relationId" column="RELATION_ID"/>
<result property="module" column="MODULE"/>
<result property="content" column="CONTENT"/>
<result property="url" column="URL"/>
<result property="code" column="CODE"/>
<result property="msg" column="MSG"/>
<result property="suggestion" column="SUGGESTION"/>
<result property="label" column="LABEL"/>
<result property="rate" column="RATE"/>
<result property="allPass" column="ALL_PASS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getCheckRecords" resultType="com.elink.esua.epdc.dto.CheckRecordsDTO">
SELECT ecr.id,
ecr.name,
ecr.mobile,
IF(ecr.CATEGORY='1','工作人员','居民') category,
IF(ecr.SYSTEM= '0','正常','异常') system,
mo.DESCRIPTION as module,
ecr.CONTENT,
ecr.RATE,
la.DESCRIPTION as label,
st.DESCRIPTION as SUGGESTION,
st.code as suggestionCode,
date_format(ecr.CREATED_TIME,'%Y-%m-%d %H:%i') as CREATED_TIME,
date_format(ecr.AUDIT_TIME,'%Y-%m-%d %H:%i') as AUDIT_TIME
FROM `epdc_check_records` ecr
left join epdc_check_code mo on ecr.MODULE=mo.`CODE`
left join epdc_check_code la on ecr.LABEL=la.`CODE`
left join epdc_check_code st on ecr.SUGGESTION=st.`CODE`
where ecr.DEL_FLAG=0
<if test="name != null and name != ''">
and ecr.name like '%${name}%'
</if>
<if test="category != null and category != ''">
and ecr.CATEGORY = #{category}
</if>
<!-- <if test="decision != null and decision != ''">-->
<!-- and evr.DECISION = #{decision}-->
<!-- </if>-->
<if test="content != null and content != ''">
and ecr.CONTENT like '%${content}%'
</if>
<if test="module != null and module != ''">
and mo.DESCRIPTION like '%${module}%'
</if>
<if test="systemStatus != null and systemStatus != ''">
and ecr.SYSTEM = #{systemStatus}
</if>
<if test="mobile != null and mobile != ''">
and ecr.mobile like '%${mobile}%'
</if>
<if test="suggestion != null and suggestion != ''">
and ecr.SUGGESTION = #{suggestion}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( ecr.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
order by st.SORT asc,ecr.CREATED_TIME desc
</select>
<resultMap id="CheckRecords_detail" type="com.elink.esua.epdc.dto.CheckRecordsDTO">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="category" column="category"/>
<result property="checkState" column="checkState"/>
<result property="module" column="module"/>
<result property="content" column="CONTENT"/>
<result property="suggestion" column="SUGGESTION"/>
<result property="suggestionCode" column="suggestionCode"/>
<result property="label" column="LABEL"/>
<result property="rate" column="RATE"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="auditTime" column="AUDIT_TIME"/>
<collection property="imgUrls" ofType="com.elink.esua.epdc.dto.CheckImgsDetailsDTO">
<result property="url" column="url"/>
</collection>
</resultMap>
<select id="getDetails" resultMap="CheckRecords_detail">
SELECT ecr.id,
ecr.name,
IF(ecr.CATEGORY='1','工作人员','居民') category,
mo.DESCRIPTION as module,
ecr.CONTENT,
ecr.RATE,
la.DESCRIPTION as label,
st.DESCRIPTION as checkState,
st.code as suggestionCode,
re.SUGGESTION,
date_format(ecr.CREATED_TIME,'%Y-%m-%d %H:%m') as CREATED_TIME,
date_format(ecr.AUDIT_TIME,'%Y-%m-%d %H:%m') as AUDIT_TIME,
img.URL
FROM `epdc_check_records` ecr
left join epdc_check_code mo on ecr.MODULE=mo.`CODE`
left join epdc_check_code la on ecr.LABEL=la.`CODE`
left join epdc_check_code st on ecr.SUGGESTION=st.`CODE`
left join epdc_check_result re on re.RECORD_ID=ecr.ID
left join epdc_check_records_imgs img on img.REFERENCE_ID=ecr.ID
where ecr.DEL_FLAG=0 and ecr.id=#{id}
order by img.sort asc
</select>
</mapper>

23
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/src/main/resources/mapper/CheckRecordsImgsDao.xml

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.CheckRecordsImgsDao">
<resultMap type="com.elink.esua.epdc.entity.CheckRecordsImgsEntity" id="checkRecordsImgsMap">
<result property="id" column="ID"/>
<result property="referenceId" column="REFERENCE_ID"/>
<result property="url" column="URL"/>
<result property="thumbnail" column="THUMBNAIL"/>
<result property="sort" column="SORT"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListByRecordId" resultMap="checkRecordsImgsMap">
SELECT * FROM epdc_check_records_imgs where REFERENCE_ID=#{id}
</select>
</mapper>

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

Loading…
Cancel
Save