|
|
@@ -152,7 +152,20 @@ public class FastApiServiceImpl implements FastApiService {
|
|
|
jsonBody.put("user_id", request.getUserId());
|
|
|
jsonBody.put("user_nm", request.getUserNm());
|
|
|
jsonBody.put("feedback", request.getFeedback());
|
|
|
- jsonBody.put("feedback_result", request.getFeedbackResult());
|
|
|
+
|
|
|
+ // 将 JsonNode 转换为原始 JSON 字符串
|
|
|
+ String feedbackResultStr = null;
|
|
|
+ if (request.getFeedbackResult() != null) {
|
|
|
+ if (request.getFeedbackResult().isTextual()) {
|
|
|
+ // 如果本身就是字符串
|
|
|
+ feedbackResultStr = request.getFeedbackResult().asText();
|
|
|
+ } else {
|
|
|
+ // 如果是数组或对象,序列化为 JSON 字符串
|
|
|
+ feedbackResultStr = request.getFeedbackResult().toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ jsonBody.put("feedback_result", feedbackResultStr);
|
|
|
+
|
|
|
jsonBody.put("contract_no", request.getContractNo());
|
|
|
jsonBody.put("user_org", request.getUserOrg());
|
|
|
jsonBody.put("user_endpoint", request.getUserEndpoint());
|
|
|
@@ -175,35 +188,6 @@ public class FastApiServiceImpl implements FastApiService {
|
|
|
errorResponse.setMessage("AI 打标反馈接口调用失败:" + (responseBody.isEmpty() ? "服务器内部错误" : responseBody));
|
|
|
return errorResponse;
|
|
|
}
|
|
|
- List<CustomerProfileNode> customerProfileNodes = new ArrayList<>();
|
|
|
- if(StringUtils.equals(request.getFeedback(),FEEDBACK_RESULT_AGREE)){
|
|
|
- LambdaQueryWrapper<AitagTagLogEntity> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(AitagTagLogEntity::getBusinessAttr,request.getBusinessAttr());
|
|
|
- List<AitagTagLogEntity> aitagTagLogEntities = aitagTagLogDao.selectList(queryWrapper);
|
|
|
- AitagTagLogEntity aitagTagLog = aitagTagLogEntities.get(0);
|
|
|
- String result = aitagTagLog.getResult();
|
|
|
- List<TagResultDto> tagResultDtos = JSONArray.parseArray(result, TagResultDto.class);
|
|
|
- for(TagResultDto tagResult: tagResultDtos){
|
|
|
- if(tagResult.getPassr()){
|
|
|
- customerProfileNodes.add(new CustomerProfileNode(request.getContractNo()
|
|
|
- ,tagResult.getTag_code(),tagResult.getTag_name()));
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- List<TagResultDto> tagResultDtos = JSONArray.parseArray(request.getFeedbackResult(), TagResultDto.class);
|
|
|
- for(TagResultDto tagResult: tagResultDtos){
|
|
|
- if(tagResult.getPassr()){
|
|
|
- customerProfileNodes.add(new CustomerProfileNode(request.getContractNo()
|
|
|
- ,tagResult.getTag_code(),tagResult.getTag_name()));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- CustomerProfileReqVo customerProfileReqVo = new CustomerProfileReqVo();
|
|
|
- customerProfileReqVo.setLABEL_RESULT(CONFIRM_TAGGING);
|
|
|
- customerProfileReqVo.setUSER_ID(SessionCommonUtil.getUserId());
|
|
|
- customerProfileReqVo.setDATA(customerProfileNodes);
|
|
|
- esbService.taggingResultSync(customerProfileReqVo);
|
|
|
-
|
|
|
return JSON.parseObject(responseBody, AiTaggingResponseVo.class);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
@@ -214,6 +198,8 @@ public class FastApiServiceImpl implements FastApiService {
|
|
|
return errorResponse;
|
|
|
}
|
|
|
}
|
|
|
+// ... existing code ...
|
|
|
+
|
|
|
|
|
|
|
|
|
// 辅助方法用于 URL 编码
|