|
|
|
@ -53,27 +53,24 @@ public class CheckDataUtils{ |
|
|
|
|
|
|
|
private static Logger log = LogManager.getLogger(HttpClientUtils.class); |
|
|
|
|
|
|
|
// public static void main(String[] args) {
|
|
|
|
public static void main(String[] args) { |
|
|
|
// checkContent(null,"bbb");
|
|
|
|
// checkImgs("https://epdc-shibei.elinkservice.cn/epdcFile/M00/06/80/rBAAM17wjcKACqqXAAIyYyB0O-8107.png,,https://epdc-shibei.elinkservice.cn/epdcFile/M00/06/80/rBAAM17wjcKACqqXAAIyYyB0O-8107.png,",null);
|
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param :[ title :文本标题, content:文本内容] |
|
|
|
* @return java.lang.Object |
|
|
|
* @describe:内容审核 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/6 10:13 |
|
|
|
* @param :[ title :文本标题, content:文本内容] |
|
|
|
* @return java.lang.Object |
|
|
|
*/ |
|
|
|
public static CheckResultDTO checkContent(String title, String content) { |
|
|
|
String text = ""; |
|
|
|
if (StringUtils.isBlank(content)) { |
|
|
|
public static CheckResultDTO checkContent(List<String> textList) { |
|
|
|
if (textList == null || textList.size() == 0) { |
|
|
|
return null; |
|
|
|
} else if(StringUtils.isNotBlank(title)){ |
|
|
|
text = title + ":" + content; |
|
|
|
} else { |
|
|
|
text = content; |
|
|
|
} |
|
|
|
String text = StringUtils.join(textList.toArray(), "。"); |
|
|
|
|
|
|
|
CheckDataFromDTO tasks = new CheckDataFromDTO(); |
|
|
|
List<CheckContentFormDTO> contentList = new ArrayList<>(); |
|
|
|
CheckContentFormDTO contentDto = new CheckContentFormDTO(); |
|
|
|
@ -106,11 +103,11 @@ public class CheckDataUtils{ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param :[ imgArray:集合类型的图片地址] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO |
|
|
|
* @describe: 图片审核:只要有一张图片被驳回,本次审核判定为不通过 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/7 17:42 |
|
|
|
* @param :[ imgArray:集合类型的图片地址] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO |
|
|
|
*/ |
|
|
|
public static CheckResultDTO checkImgs(List<String> imgArray) { |
|
|
|
CheckDataFromDTO tasks = new CheckDataFromDTO(); |
|
|
|
@ -155,11 +152,11 @@ public class CheckDataUtils{ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param :[ contentResult:文本审核结果, imgResult:图片审核结果] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO |
|
|
|
* @describe: 获取违规记录的分类占比,所属类别,审核状态 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/7 16:18 |
|
|
|
* @param :[ contentResult:文本审核结果, imgResult:图片审核结果] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO |
|
|
|
*/ |
|
|
|
public static CheckResultMessageDTO getCheckResultMessage(CheckResultDTO contentResult, CheckResultDTO imgResult) { |
|
|
|
CheckResultMessageDTO result = new CheckResultMessageDTO(); |
|
|
|
@ -185,23 +182,24 @@ public class CheckDataUtils{ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @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 |
|
|
|
* @param :[ contentResult:文本审核结果, imgResult:图片审核结果] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO |
|
|
|
*/ |
|
|
|
public static CheckResultMessageDTO checkTwoTypes(CheckResultDTO contentResult, CheckResultDTO imgResult) { |
|
|
|
CheckResultMessageDTO result = new CheckResultMessageDTO(); |
|
|
|
//如果是文字待审核
|
|
|
|
if (contentResult != null) { |
|
|
|
if (contentResult != 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; |
|
|
|
} |
|
|
|
} else if (imgResult != null) {//如果是图片待审核
|
|
|
|
} |
|
|
|
if (imgResult != null && 200 == imgResult.getDetails().get(0).getCode()) {//如果是图片待审核
|
|
|
|
for (CheckResultDetailsDTO details : imgResult.getDetails()) { |
|
|
|
for (CheckDetailResultsDTO detailResult : details.getResults()) { |
|
|
|
if (review.equals(detailResult.getSuggestion())) { |
|
|
|
@ -218,28 +216,29 @@ public class CheckDataUtils{ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 组装违规记录信息 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/7 19:26 |
|
|
|
* @param [userId :用户ID, |
|
|
|
* userName:用户名称, |
|
|
|
* category:工作类别:1工作2居民, |
|
|
|
* decision:判定方式:1系统2人工 |
|
|
|
* module:模块编码, |
|
|
|
* content:要审核的文本, |
|
|
|
* imgUrls:要审核的图片, |
|
|
|
* contentResult:文本审核的结果, |
|
|
|
* imgResult:图片审核的结果] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO |
|
|
|
* @describe: 组装违规记录信息 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/7 19:26 |
|
|
|
*/ |
|
|
|
public static SaveCheckRecordsDTO getViolationsRecords(String userId, String userName, String category, |
|
|
|
String module,String content,List<String> imgUrls, |
|
|
|
CheckResultDTO contentResult, |
|
|
|
String decision, String module, String content, |
|
|
|
List<String> imgUrls, CheckResultDTO contentResult, |
|
|
|
CheckResultDTO imgResult) { |
|
|
|
SaveCheckRecordsDTO record = new SaveCheckRecordsDTO(); |
|
|
|
record.setUserId(userId); |
|
|
|
record.setName(userName); |
|
|
|
record.setCategory(category);//居民
|
|
|
|
record.setDecision("1");//系统判定
|
|
|
|
record.setDecision(decision);//判定方式
|
|
|
|
record.setModule(module);//功能模块
|
|
|
|
record.setContent(content); |
|
|
|
record.setImgUrls(imgUrls); |
|
|
|
@ -251,9 +250,6 @@ public class CheckDataUtils{ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 组装待审核信息 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/7 19:26 |
|
|
|
* @param [userId :用户ID, |
|
|
|
* userName:用户名称, |
|
|
|
* category:工作类别:1工作2居民, |
|
|
|
@ -263,6 +259,9 @@ public class CheckDataUtils{ |
|
|
|
* contentResult:文本审核的结果, |
|
|
|
* imgResult:图片审核的结果] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO |
|
|
|
* @describe: 组装待审核信息 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/7 19:26 |
|
|
|
*/ |
|
|
|
public static SaveCheckRecordsDTO getUnCheckRecords(String userId, String userName, String category, |
|
|
|
String module, String content, List<String> imgUrls, |
|
|
|
|