|
|
@ -67,7 +67,6 @@ public class CheckDataUtils { |
|
|
|
private static Logger log = LogManager.getLogger(HttpClientUtils.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public static void main(String[] args) {
|
|
|
|
// String a = ModuleName.WORK_DAILY.getCode();
|
|
|
|
// System.out.println(a);
|
|
|
@ -81,8 +80,8 @@ public class CheckDataUtils { |
|
|
|
* @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())){ |
|
|
|
for (Iterator<String> text = textList.iterator(); text.hasNext(); ) { |
|
|
|
if (StringUtils.isBlank(text.next())) { |
|
|
|
text.remove(); |
|
|
|
} |
|
|
|
} |
|
|
@ -115,9 +114,9 @@ public class CheckDataUtils { |
|
|
|
//审核成功
|
|
|
|
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()){ |
|
|
|
if (200 == result.getDetails().get(0).getCode()) { |
|
|
|
return result; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
log.error("内容审核返回信息错误:" + res); |
|
|
|
return null; |
|
|
|
} |
|
|
@ -169,9 +168,9 @@ public class CheckDataUtils { |
|
|
|
//审核成功
|
|
|
|
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()){ |
|
|
|
if (200 == result.getDetails().get(0).getCode()) { |
|
|
|
return result; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
log.error("内容审核返回信息错误:" + res); |
|
|
|
return null; |
|
|
|
} |
|
|
@ -266,7 +265,7 @@ public class CheckDataUtils { |
|
|
|
String decision, String module, List<String> textList, |
|
|
|
List<String> imgUrls, String relationId, |
|
|
|
CheckResultDTO contentResult, CheckResultDTO imgResult, |
|
|
|
CheckResultMessageDTO twoTypes,String mobile,String system) { |
|
|
|
CheckResultMessageDTO twoTypes, String mobile, String system) { |
|
|
|
SaveCheckRecordsDTO record = new SaveCheckRecordsDTO(); |
|
|
|
record.setUserId(userId); |
|
|
|
record.setName(userName); |
|
|
@ -288,12 +287,16 @@ public class CheckDataUtils { |
|
|
|
record.setSuggestion(twoTypes.getSuggestion()); |
|
|
|
record.setLabel(twoTypes.getLabel()); |
|
|
|
record.setRate(twoTypes.getRate()); |
|
|
|
} else { |
|
|
|
} 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); |
|
|
|
} |
|
|
|
|
|
|
|
return record; |
|
|
|
} |
|
|
|
|
|
|
|