|
@ -1,6 +1,7 @@ |
|
|
package com.epmet.commons.tools.utils; |
|
|
package com.epmet.commons.tools.utils; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|
|
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|
@ -36,7 +37,7 @@ public class ScanContentUtils { |
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); |
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); |
|
|
log.debug("imgSyncScan result:{}", JSON.toJSONString(param)); |
|
|
log.debug("imgSyncScan result:{}", JSON.toJSONString(param)); |
|
|
if (result.success()) { |
|
|
if (result.success()) { |
|
|
return JSON.parseObject(result.getData(),Result.class); |
|
|
return JSON.parseObject(result.getData(),new TypeReference<Result<SyncScanResult>>(){}); |
|
|
} |
|
|
} |
|
|
Result<SyncScanResult> resultResult = new Result<>(); |
|
|
Result<SyncScanResult> resultResult = new Result<>(); |
|
|
resultResult.error(result.getCode(),result.getMsg()); |
|
|
resultResult.error(result.getCode(),result.getMsg()); |
|
@ -62,7 +63,8 @@ public class ScanContentUtils { |
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); |
|
|
Result<String> result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); |
|
|
log.debug("textSyncScan result:{}", JSON.toJSONString(result)); |
|
|
log.debug("textSyncScan result:{}", JSON.toJSONString(result)); |
|
|
if (result.success()) { |
|
|
if (result.success()) { |
|
|
return JSON.parseObject(result.getData(),Result.class); |
|
|
//return JSON.parseObject(result.getData(),Result.class);
|
|
|
|
|
|
return JSON.parseObject(result.getData(),new TypeReference<Result<SyncScanResult>>(){}); |
|
|
} |
|
|
} |
|
|
Result<SyncScanResult> resultResult = new Result<>(); |
|
|
Result<SyncScanResult> resultResult = new Result<>(); |
|
|
resultResult.error(result.getCode(),result.getMsg()); |
|
|
resultResult.error(result.getCode(),result.getMsg()); |
|
@ -83,7 +85,17 @@ public class ScanContentUtils { |
|
|
list.add(p); |
|
|
list.add(p); |
|
|
TextScanParamDTO param = new TextScanParamDTO(); |
|
|
TextScanParamDTO param = new TextScanParamDTO(); |
|
|
param.setTasks(list); |
|
|
param.setTasks(list); |
|
|
Result<SyncScanResult> result = ScanContentUtils.textSyncScan(url, param); |
|
|
Result<SyncScanResult> imgSyncScanResult = ScanContentUtils.textSyncScan(url, param); |
|
|
System.out.println(JSON.toJSONString(result)); |
|
|
System.out.println(JSON.toJSONString(imgSyncScanResult)); |
|
|
} |
|
|
SyncScanResult result = new SyncScanResult(); |
|
|
|
|
|
if (imgSyncScanResult != null){ |
|
|
|
|
|
SyncScanResult imgSyncScanResultData = imgSyncScanResult.getData(); |
|
|
|
|
|
if (imgSyncScanResult.success()&&imgSyncScanResultData.isAllPass()) { |
|
|
|
|
|
result.setAllPass(imgSyncScanResultData.isAllPass()); |
|
|
|
|
|
result.getSuccessDataIds().addAll(imgSyncScanResultData.getSuccessDataIds()); |
|
|
|
|
|
result.getFailDataIds().addAll(imgSyncScanResultData.getFailDataIds()); |
|
|
|
|
|
System.out.println("================"+JSON.toJSONString(result)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|