|
@@ -22,9 +22,17 @@ import com.jzg.quotation.huatai.crawler.entity.po.HtCrawlerOrder;
|
|
|
import com.jzg.quotation.huatai.crawler.service.HtCrawlerOrderService;
|
|
import com.jzg.quotation.huatai.crawler.service.HtCrawlerOrderService;
|
|
|
import com.jzg.quotation.huatai.crawler.service.HuaTaiCrawlerRequest;
|
|
import com.jzg.quotation.huatai.crawler.service.HuaTaiCrawlerRequest;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import org.jsoup.Jsoup;
|
|
|
|
|
+import org.jsoup.nodes.Document;
|
|
|
|
|
+import org.jsoup.select.Elements;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.xml.sax.InputSource;
|
|
|
|
|
|
|
|
|
|
+import javax.xml.xpath.XPath;
|
|
|
|
|
+import javax.xml.xpath.XPathExpression;
|
|
|
|
|
+import javax.xml.xpath.XPathExpressionException;
|
|
|
|
|
+import javax.xml.xpath.XPathFactory;
|
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
import java.util.Base64;
|
|
import java.util.Base64;
|
|
|
|
|
|
|
@@ -127,6 +135,13 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public PaymentLinkResultsVo getPaymentLink(PaymentLinkVo paymentLinkVo) throws JsonProcessingException {
|
|
public PaymentLinkResultsVo getPaymentLink(PaymentLinkVo paymentLinkVo) throws JsonProcessingException {
|
|
|
|
|
+ AttributionInformationVo attributionInformationVo = paymentLinkVo.getOrder().getAttributionInformationVo();
|
|
|
|
|
+ //获取配置信息
|
|
|
|
|
+ HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
|
|
|
|
|
+ HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
|
|
|
|
|
+
|
|
|
|
|
+ HtCrawlerPaymentLinkRequest htCrawlerPaymentLinkRequest = new HtCrawlerPaymentLinkRequest(parameters, paymentLinkVo);
|
|
|
|
|
+ HtCrawlerPaymentLinkResponse paymentLinkResponse = htCrawlerRequestComponent.getPaymentLink(htCrawlerPaymentLinkRequest, headers);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -201,7 +216,27 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
|
|
|
* @param orderStatusVo
|
|
* @param orderStatusVo
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public OrderStatusResultVo queryOrderState(OrderStatusVo orderStatusVo) throws JsonProcessingException {
|
|
|
|
|
|
|
+ public OrderStatusResultVo queryOrderState(OrderStatusVo orderStatusVo) {
|
|
|
|
|
+ AttributionInformationVo attributionInformationVo = orderStatusVo.getOrder().getAttributionInformationVo();
|
|
|
|
|
+ //获取配置信息
|
|
|
|
|
+ HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
|
|
|
|
|
+ HttpHeaders headers = htCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword(), parameters.getComCode());
|
|
|
|
|
+
|
|
|
|
|
+ HtCrawlerOrder htCrawlerOrder = htCrawlerOrderService.findByOrdersNo(orderStatusVo.getOrder().getOrdersNo());
|
|
|
|
|
+ String quotationRelaNo = htCrawlerOrder.getQuotationRelaNo();
|
|
|
|
|
+
|
|
|
|
|
+ HtCrawlerOrderStateRequest htCrawlerOrderStateRequest = new HtCrawlerOrderStateRequest(parameters, quotationRelaNo);
|
|
|
|
|
+ String html = htCrawlerRequestComponent.queryOrderStatus(htCrawlerOrderStateRequest, headers);
|
|
|
|
|
+
|
|
|
|
|
+ Document document = Jsoup.parse(html);
|
|
|
|
|
+ Elements trElement = document.select("table[id='table']").select("tbody").select("tr");
|
|
|
|
|
+ Elements tdElements = trElement.select("td");
|
|
|
|
|
+
|
|
|
|
|
+ tdElements.get(1).firstElementChild().text();//客户名称
|
|
|
|
|
+ tdElements.get(2).firstElementChild().text();//保险起保日期
|
|
|
|
|
+ tdElements.get(3).firstElementChild().text();//车牌号
|
|
|
|
|
+ tdElements.get(4).firstElementChild().text();//报价单创建日期
|
|
|
|
|
+ tdElements.get(7).firstElementChild().text();//订单状态
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|