|
|
@ -50,13 +50,27 @@ public class CheckDataUtils { |
|
|
|
//违规提示
|
|
|
|
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) { |
|
|
|
// 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);
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// public static void main(String[] args) {
|
|
|
|
// String a = ModuleName.WORK_DAILY.getCode();
|
|
|
|
// System.out.println(a);
|
|
|
|
// }
|
|
|
|
|
|
|
|
/** |
|
|
|
* @param :[ title :文本标题, content:文本内容] |
|
|
@ -216,68 +230,54 @@ public class CheckDataUtils { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @param [userId :用户ID, |
|
|
|
* @param :[ userId :用户ID, |
|
|
|
* userName:用户名称, |
|
|
|
* category:工作类别:1工作2居民, |
|
|
|
* decision:判定方式:1系统2人工 |
|
|
|
* module:模块编码, |
|
|
|
* content:要审核的文本, |
|
|
|
* imgUrls:要审核的图片, |
|
|
|
* textList:要审核的文本集合, |
|
|
|
* imgUrls:要审核的图片集合, |
|
|
|
* relationId:关联信息ID, |
|
|
|
* contentResult:文本审核的结果, |
|
|
|
* imgResult:图片审核的结果] |
|
|
|
* imgResult:图片审核的结果, |
|
|
|
* twoTypes:判断为通过或者待审核的结果] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO |
|
|
|
* @describe: 组装违规记录信息 |
|
|
|
* @describe: 组装违规记录/待审核信息 |
|
|
|
* @author wangtong |
|
|
|
* @date 2020/7/7 19:26 |
|
|
|
*/ |
|
|
|
public static SaveCheckRecordsDTO getViolationsRecords(String userId, String userName, String category, |
|
|
|
String decision, String module, String content, |
|
|
|
List<String> imgUrls, CheckResultDTO contentResult, |
|
|
|
CheckResultDTO imgResult) { |
|
|
|
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) { |
|
|
|
SaveCheckRecordsDTO record = new SaveCheckRecordsDTO(); |
|
|
|
record.setUserId(userId); |
|
|
|
record.setName(userName); |
|
|
|
record.setCategory(category);//居民
|
|
|
|
record.setDecision(decision);//判定方式
|
|
|
|
record.setModule(module);//功能模块
|
|
|
|
record.setContent(content); |
|
|
|
record.setImgUrls(imgUrls); |
|
|
|
CheckResultMessageDTO messageResult = getCheckResultMessage(contentResult, imgResult); |
|
|
|
record.setSuggestion(messageResult.getSuggestion()); |
|
|
|
record.setLabel(messageResult.getLabel()); |
|
|
|
record.setRate(messageResult.getRate()); |
|
|
|
return record; |
|
|
|
if (textList == null || textList.size() == 0) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param [userId :用户ID, |
|
|
|
* userName:用户名称, |
|
|
|
* category:工作类别: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 getUnCheckRecords(String userId, String userName, String category, |
|
|
|
String module, String content, List<String> imgUrls, |
|
|
|
String relationId, CheckResultMessageDTO twoTypes) { |
|
|
|
SaveCheckRecordsDTO record = new SaveCheckRecordsDTO(); |
|
|
|
record.setUserId(userId); |
|
|
|
record.setName(userName); |
|
|
|
record.setCategory(category);//居民
|
|
|
|
record.setModule(module);//功能模块
|
|
|
|
record.setContent(content); |
|
|
|
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 { |
|
|
|
CheckResultMessageDTO messageResult = getCheckResultMessage(contentResult, imgResult); |
|
|
|
record.setSuggestion(messageResult.getSuggestion()); |
|
|
|
record.setLabel(messageResult.getLabel()); |
|
|
|
record.setRate(messageResult.getRate()); |
|
|
|
} |
|
|
|
return record; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |