|
@@ -5,8 +5,6 @@ import com.lantone.qc.kernel.client.CRFServiceClient;
|
|
import com.lantone.qc.kernel.client.SimilarityServiceClient;
|
|
import com.lantone.qc.kernel.client.SimilarityServiceClient;
|
|
import com.lantone.qc.kernel.structure.ai.AIAnalyze;
|
|
import com.lantone.qc.kernel.structure.ai.AIAnalyze;
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
import com.lantone.qc.kernel.util.CatalogueUtil;
|
|
-import com.lantone.qc.kernel.util.ModuleMappingUtil;
|
|
|
|
-import com.lantone.qc.kernel.util.RedisUtil;
|
|
|
|
import com.lantone.qc.pub.exception.AIException;
|
|
import com.lantone.qc.pub.exception.AIException;
|
|
import com.lantone.qc.pub.exception.CatalogueException;
|
|
import com.lantone.qc.pub.exception.CatalogueException;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
@@ -16,7 +14,6 @@ import com.lantone.qc.trans.TransDispatch;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -33,20 +30,14 @@ public class QCAnalysis {
|
|
@Autowired
|
|
@Autowired
|
|
SimilarityServiceClient similarityServiceClient;
|
|
SimilarityServiceClient similarityServiceClient;
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private RedisUtil redisUtil;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ModuleMappingUtil moduleMappingUtil;
|
|
|
|
-
|
|
|
|
public OutputInfo anlysis(QueryVo queryVo) throws AIException, CatalogueException, Exception {
|
|
public OutputInfo anlysis(QueryVo queryVo) throws AIException, CatalogueException, Exception {
|
|
OutputInfo outputInfo = new OutputInfo();
|
|
OutputInfo outputInfo = new OutputInfo();
|
|
InputInfo inputInfo = TransDispatch.trans(queryVo);
|
|
InputInfo inputInfo = TransDispatch.trans(queryVo);
|
|
inputInfo.setInputCatalogueMap(queryVo.getInputCatalogueMap());
|
|
inputInfo.setInputCatalogueMap(queryVo.getInputCatalogueMap());
|
|
AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient, similarityServiceClient);
|
|
AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient, similarityServiceClient);
|
|
- try{
|
|
|
|
|
|
+ try {
|
|
aiAnalyze.aiProcess(inputInfo);
|
|
aiAnalyze.aiProcess(inputInfo);
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
throw new AIException("AI模型执行错误:" + e.getMessage());
|
|
throw new AIException("AI模型执行错误:" + e.getMessage());
|
|
}
|
|
}
|
|
for (Map.Entry<String, Map<String, String>> entry : inputInfo.getInputCatalogueMap().entrySet()) {
|
|
for (Map.Entry<String, Map<String, String>> entry : inputInfo.getInputCatalogueMap().entrySet()) {
|
|
@@ -55,13 +46,12 @@ public class QCAnalysis {
|
|
}
|
|
}
|
|
CatalogueUtil.qcCatalogueMap.get(entry.getKey()).execute(inputInfo, outputInfo);
|
|
CatalogueUtil.qcCatalogueMap.get(entry.getKey()).execute(inputInfo, outputInfo);
|
|
}
|
|
}
|
|
- moduleMappingUtil.moduleIdInsert(inputInfo.getPageData());
|
|
|
|
outputInfo.setPageData(inputInfo.getPageData());
|
|
outputInfo.setPageData(inputInfo.getPageData());
|
|
Map<String, Map<String, String>> result = outputInfo.getResult();
|
|
Map<String, Map<String, String>> result = outputInfo.getResult();
|
|
Map<String, Map<String, String>> resultNew = Maps.newHashMap();
|
|
Map<String, Map<String, String>> resultNew = Maps.newHashMap();
|
|
- result.keySet().forEach(key->{
|
|
|
|
|
|
+ result.keySet().forEach(key -> {
|
|
if (result.get(key).get("status").equals("-1")) {
|
|
if (result.get(key).get("status").equals("-1")) {
|
|
- resultNew.put(key,result.get(key));
|
|
|
|
|
|
+ resultNew.put(key, result.get(key));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
outputInfo.setResult(resultNew);
|
|
outputInfo.setResult(resultNew);
|