|
@@ -65,6 +65,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
@@ -632,6 +633,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public HttpResult callbackAnOrder(String quoteOrderNo) {
|
|
public HttpResult callbackAnOrder(String quoteOrderNo) {
|
|
|
|
|
+// log.debug("=========永诚API方式 - xml请求 - 补传回调开始======");
|
|
|
HttpResult httpResult = new HttpResult();
|
|
HttpResult httpResult = new HttpResult();
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -654,17 +656,22 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
//接口请求
|
|
|
- log.debug("=========永诚API方式 - xml请求 - 补传回调开始======");
|
|
|
|
|
- InsApiLog apiLog = httpPost(xmlMapper, o, YcBuildData.API_ORDER_QUERY);
|
|
|
|
|
- log.debug("=========永诚API方式 - xml请求 - 补传回调结束!======");
|
|
|
|
|
- verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_5);
|
|
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// InsApiLog apiLog = httpPostResultLog(xmlMapper, o, YcBuildData.API_ORDER_QUERY);
|
|
|
|
|
+ String respData = httpPostResultLog(xmlMapper, o, YcBuildData.API_ORDER_QUERY);
|
|
|
|
|
|
|
|
|
|
+// log.info("永诚API方式 - xml请求 - 参数:" + apiLog.getRequestData());
|
|
|
|
|
+// log.info("永诚API方式 - xml请求 ------------分割线----------------");
|
|
|
|
|
+// log.info("永诚API方式 - xml请求 - 响应:" + apiLog.getResponseData());
|
|
|
|
|
|
|
|
- String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
|
|
|
|
+// verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_5);
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ String cleanStr = YcBuildData.cleanResponseStr(respData);
|
|
|
// CallbackAnOrderResponse callbackAnOrderResponse = xmlMapper.readValue(cleanStr, CallbackAnOrderResponse.class);
|
|
// CallbackAnOrderResponse callbackAnOrderResponse = xmlMapper.readValue(cleanStr, CallbackAnOrderResponse.class);
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(cleanStr)) {
|
|
if (StringUtils.isNotEmpty(cleanStr)) {
|
|
|
|
|
+ if(cleanStr.equals("账户不存在或没有权限")) return HttpResult.ok("账户不存在或没有权限");
|
|
|
log.info("永诚API方式 - 补传回调 - 参数:" + cleanStr);
|
|
log.info("永诚API方式 - 补传回调 - 参数:" + cleanStr);
|
|
|
CallBackRequest param = CallBackRequest.buildCallBackParam(cleanStr);
|
|
CallBackRequest param = CallBackRequest.buildCallBackParam(cleanStr);
|
|
|
|
|
|
|
@@ -710,6 +717,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
return HttpResult.error("系统错误,请联系管理员");
|
|
return HttpResult.error("系统错误,请联系管理员");
|
|
|
}
|
|
}
|
|
|
|
|
+// log.debug("=========永诚API方式 - xml请求 - 补传回调结束!======");
|
|
|
return httpResult;
|
|
return httpResult;
|
|
|
}
|
|
}
|
|
|
/**
|
|
/**
|
|
@@ -720,6 +728,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
LambdaQueryWrapper<InsAreaCompany> lqw = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<InsAreaCompany> lqw = new LambdaQueryWrapper<>();
|
|
|
lqw.eq(InsAreaCompany::getOrderstatus,InsOrderStatus.S_2.getCode());
|
|
lqw.eq(InsAreaCompany::getOrderstatus,InsOrderStatus.S_2.getCode());
|
|
|
|
|
+ lqw.gt(InsAreaCompany::getAudittime, LocalDate.now().minusDays(1));
|
|
|
List<InsAreaCompany> list = insAreaCompanyService.list(lqw);
|
|
List<InsAreaCompany> list = insAreaCompanyService.list(lqw);
|
|
|
|
|
|
|
|
if(null != list && list.size()>0){
|
|
if(null != list && list.size()>0){
|
|
@@ -1131,6 +1140,55 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
return iplog;
|
|
return iplog;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 日志返回处理
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author: lig
|
|
|
|
|
+ * @date: 2023年09月02日 0002
|
|
|
|
|
+ */
|
|
|
|
|
+ private <T> String httpPostResultLog(ObjectMapper mapper, T requestData, String apiName) {
|
|
|
|
|
+
|
|
|
|
|
+ String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
|
|
|
|
|
+ xmlString += "<soapenv:Body>";
|
|
|
|
|
+ try {
|
|
|
|
|
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
|
|
|
|
+ xmlString += mapper.writeValueAsString(requestData);
|
|
|
|
|
+
|
|
|
|
|
+ xmlString += "</soapenv:Body>\n" +
|
|
|
|
|
+ "</soapenv:Envelope>";
|
|
|
|
|
+
|
|
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
|
|
+ throw new RuntimeException("永诚API方式-xml转换失败");
|
|
|
|
|
+ }
|
|
|
|
|
+// InsApiLog iplog = HttpXmlUtil.sendXmlPost(apiComponents.getUrl() + apiName, xmlString);
|
|
|
|
|
+ return HttpXmlUtil.sendXmlPostReq(apiComponents.getUrl() + apiName, xmlString,null);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 日志返回处理
|
|
|
|
|
+// *
|
|
|
|
|
+// * @author: lig
|
|
|
|
|
+// * @date: 2023年09月02日 0002
|
|
|
|
|
+// */
|
|
|
|
|
+// private <T> InsApiLog httpPostResultLog(ObjectMapper mapper, T requestData, String apiName) {
|
|
|
|
|
+//
|
|
|
|
|
+// String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
|
|
|
|
|
+// xmlString += "<soapenv:Body>";
|
|
|
|
|
+// try {
|
|
|
|
|
+// mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
|
|
|
|
+// xmlString += mapper.writeValueAsString(requestData);
|
|
|
|
|
+//
|
|
|
|
|
+// xmlString += "</soapenv:Body>\n" +
|
|
|
|
|
+// "</soapenv:Envelope>";
|
|
|
|
|
+//
|
|
|
|
|
+// } catch (JsonProcessingException e) {
|
|
|
|
|
+// throw new RuntimeException("永诚API方式-xml转换失败");
|
|
|
|
|
+// }
|
|
|
|
|
+// InsApiLog iplog = HttpXmlUtil.sendXmlPost(apiComponents.getUrl() + apiName, xmlString);
|
|
|
|
|
+//
|
|
|
|
|
+// return iplog;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @description: 拷贝永安方法,可以封装
|
|
* @description: 拷贝永安方法,可以封装
|