|
@@ -1,26 +1,17 @@
|
|
|
package cn.com.yusys.yusp.service.impl;
|
|
package cn.com.yusys.yusp.service.impl;
|
|
|
|
|
|
|
|
-import cn.com.yusys.yusp.commons.util.StringUtils;
|
|
|
|
|
|
|
+import cn.com.yusys.yusp.commons.exception.BizException;
|
|
|
import cn.com.yusys.yusp.config.FastApiConfig;
|
|
import cn.com.yusys.yusp.config.FastApiConfig;
|
|
|
-import cn.com.yusys.yusp.domain.dto.TagResultDto;
|
|
|
|
|
import cn.com.yusys.yusp.domain.dto.fastapidto.AiTaggingFeedbackRequestDto;
|
|
import cn.com.yusys.yusp.domain.dto.fastapidto.AiTaggingFeedbackRequestDto;
|
|
|
import cn.com.yusys.yusp.domain.dto.fastapidto.AiTaggingQueryRequestDto;
|
|
import cn.com.yusys.yusp.domain.dto.fastapidto.AiTaggingQueryRequestDto;
|
|
|
import cn.com.yusys.yusp.domain.dto.fastapidto.AiTaggingRequestDto;
|
|
import cn.com.yusys.yusp.domain.dto.fastapidto.AiTaggingRequestDto;
|
|
|
-import cn.com.yusys.yusp.domain.entity.AitagTagLogEntity;
|
|
|
|
|
-import cn.com.yusys.yusp.domain.vo.EsbVo.CustomerProfileNode;
|
|
|
|
|
-import cn.com.yusys.yusp.domain.vo.EsbVo.CustomerProfileReqVo;
|
|
|
|
|
import cn.com.yusys.yusp.domain.vo.fastapivo.AiTaggingQueryResponseVo;
|
|
import cn.com.yusys.yusp.domain.vo.fastapivo.AiTaggingQueryResponseVo;
|
|
|
import cn.com.yusys.yusp.domain.vo.fastapivo.AiTaggingResponseVo;
|
|
import cn.com.yusys.yusp.domain.vo.fastapivo.AiTaggingResponseVo;
|
|
|
import cn.com.yusys.yusp.mapper.AitagTagLogDao;
|
|
import cn.com.yusys.yusp.mapper.AitagTagLogDao;
|
|
|
-import cn.com.yusys.yusp.service.AitagTagLogService;
|
|
|
|
|
import cn.com.yusys.yusp.service.FastApiService;
|
|
import cn.com.yusys.yusp.service.FastApiService;
|
|
|
import cn.com.yusys.yusp.service.esb.ESBService;
|
|
import cn.com.yusys.yusp.service.esb.ESBService;
|
|
|
-import cn.com.yusys.yusp.util.SessionCommonUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.http.HttpEntity;
|
|
|
|
|
import org.apache.http.client.config.RequestConfig;
|
|
import org.apache.http.client.config.RequestConfig;
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
import org.apache.http.client.methods.HttpGet;
|
|
@@ -34,11 +25,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-
|
|
|
|
|
-import static cn.com.yusys.yusp.config.DataDictionary.CONFIRM_TAGGING;
|
|
|
|
|
-import static cn.com.yusys.yusp.config.DataDictionary.FEEDBACK_RESULT_AGREE;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
@@ -216,9 +202,30 @@ public class FastApiServiceImpl implements FastApiService {
|
|
|
return errorResponse;
|
|
return errorResponse;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-// ... existing code ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AiTaggingResponseVo categorySync(String categoryId) {
|
|
|
|
|
+ String url = fastApiConfig.getUrl() + "/api/aitag/admin/v1/synchronize_category";
|
|
|
|
|
+ log.info("调用标签体系信息同步接口: {}", url);
|
|
|
|
|
+
|
|
|
|
|
+ try (CloseableHttpClient httpClient = createHttpClient()) {
|
|
|
|
|
+ HttpPost httpPost = new HttpPost(url);
|
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json");
|
|
|
|
|
+ // 构造请求体
|
|
|
|
|
+ String requestBody ="{\"category_id\": \""+categoryId+"\"}";
|
|
|
|
|
+ httpPost.setEntity(new StringEntity(requestBody, "UTF-8"));
|
|
|
|
|
+ try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
|
|
|
|
+ String responseBody = EntityUtils.toString(response.getEntity(), "UTF-8");
|
|
|
|
|
+ log.info("调用标签体系信息同步接口: {}", responseBody);
|
|
|
|
|
+ return JSON.parseObject(responseBody, AiTaggingResponseVo.class);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("调用标签体系信息同步接口", e);
|
|
|
|
|
+ throw BizException.of("E008");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 辅助方法用于 URL 编码
|
|
// 辅助方法用于 URL 编码
|
|
|
private String encodeParam(String param) {
|
|
private String encodeParam(String param) {
|