Commit ce0a614a by zhiheng.zhang

Merge remote-tracking branch 'origin/master'

parents 7180015c a3cb5c4f
......@@ -61,4 +61,7 @@ public class BaseQueryOrderRequest extends BaseConfig {
//外卖单配送类型
private String deliveryType;
// 合阔pos 商户订单状态不自动扭转
private Boolean notAutomaticTwist;
}
......@@ -77,6 +77,8 @@ public class ConfirmOrderRequest extends BaseConfig {
*/
private String spellGroupCode;
private Integer notAutomaticTwistTime;
@Data
public static class OrderSettlement{
/**
......
......@@ -612,6 +612,11 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
* @return
*/
private Integer getPaySuccessTimeout(ConfirmOrderRequest confirmOrderRequest,PaySuccessReq request){
//合阔pos 商户未接单退款超时时间
if(confirmOrderRequest.getNotAutomaticTwistTime() != null ){
return confirmOrderRequest.getNotAutomaticTwistTime();
}
Integer timeout = 0;
StoreInfoRequest storeInfoRequest = new StoreInfoRequest();
storeInfoRequest.setPartnerId(confirmOrderRequest.getPartnerId());
......@@ -979,6 +984,10 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
} else {
request.setTimeout(120);
}
// 合阔pos商户订单不自动扭转
if(baseQueryOrderRequest.getNotAutomaticTwist() != null && baseQueryOrderRequest.getNotAutomaticTwist()){
request.setTimeout(0);
}
com.freemud.application.sdk.api.ordercenter.response.BaseResponse response = orderSdkService.prepareComplete(request, baseQueryOrderRequest.getTrackingNo());
return orderSdkAdapter.convent2BaseOrderResponse(response);
}
......@@ -1895,6 +1904,10 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
//saas 实时外卖 预约外卖都是 按3个小时流转
private void setTimeout(BaseQueryOrderRequest baseQueryOrderRequest,POSOrderOperationBaseReq request){
//合阔pos 商户订单状态不自动扭转
if(baseQueryOrderRequest.getNotAutomaticTwist() != null && baseQueryOrderRequest.getNotAutomaticTwist()){
return ;
}
String partnerId = baseQueryOrderRequest.getPartnerId();
String storeCode = baseQueryOrderRequest.getShopId();
String trackingNo = baseQueryOrderRequest.getTrackingNo();
......
......@@ -219,6 +219,10 @@ public class OrderServiceImpl implements Orderservice {
private List<String> cocoPartnerId;
@Value("#{'${hls.partnerId}'.split(',')}")
private List<String> hlsPartnerId;
@Value("#{'${order.not.automatic.twist.partnerId}'.split(',')}")
private List<String> notAutomaticTwistPartnerId;
@Value("${order.not.automatic.twist.time}")
private Integer notAutomaticTwistTime;
@Value("${query.order.es:true}")
private Boolean queryOrderEs;
......@@ -538,7 +542,10 @@ public class OrderServiceImpl implements Orderservice {
if (orderBean.getGmtExpect() != null && orderBean.getGmtExpect() != 0) {
var1.setExpectTime(DateUtil.convert2String(new Date(orderBean.getGmtExpect()), DateUtil.FORMAT_YYYY_MM_DD_HHMMSS));
}
//合阔pos 商户不接单自动退款时间
if (CollectionUtils.isNotEmpty(notAutomaticTwistPartnerId) && notAutomaticTwistPartnerId.contains(partnerId)) {
var1.setNotAutomaticTwistTime(notAutomaticTwistTime);
}
// 订单支付成功
com.freemud.sdk.api.assortment.order.response.order.PayAccessResponse payAccessRes = orderCenterSdkService.payAccess(var1);
String string2 = JSONObject.toJSONString(payAccessRes);
......
......@@ -21,11 +21,13 @@ import com.freemud.sdk.api.assortment.order.request.order.OrderRefundRequest;
import com.freemud.sdk.api.assortment.order.response.order.BaseOrderResponse;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse;
import com.freemud.sdk.api.assortment.order.service.OrderCenterSdkService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
......@@ -50,6 +52,8 @@ public class SaasOrderHandle {
@Value("${saasDeliveryTimeOut}")
private Integer wmDeliveryTimeOut;
@Value("#{'${order.not.automatic.twist.partnerId}'.split(',')}")
private List<String> notAutomaticTwistPartnerId;
/**
* 确认接单
......@@ -62,6 +66,10 @@ public class SaasOrderHandle {
//订单接单
BaseQueryOrderRequest orderConfirmRequest = orderSdkAdapter.getOrderConfirmRequest(request.getOperator(), orderBean);
orderSdkAdapter.convert2wmDeliveryTimeOut(orderConfirmRequest,this.wmDeliveryTimeOut);
//合阔pos 商户订单状态不自动扭转
if (CollectionUtils.isNotEmpty(notAutomaticTwistPartnerId) && notAutomaticTwistPartnerId.contains(orderBean.getCompanyId())) {
orderConfirmRequest.setNotAutomaticTwist(true);
}
BaseOrderResponse confirmOrderResponse = orderCenterSdkService.orderConfirmTake(orderConfirmRequest);
//处理1秒重复接单问题 订单服务接单返回20067重复操作,20018状态机不支持认为接单成功
if ("20067".equals(confirmOrderResponse.getErrcode().toString()) || "20018".equals(confirmOrderResponse.getErrcode().toString()) || "50002".equals(confirmOrderResponse.getErrcode().toString())) {
......@@ -102,6 +110,10 @@ public class SaasOrderHandle {
*/
public BaseResponse orderDone(OrderManagerRequest request, QueryOrdersResponse.DataBean.OrderBean orderBean) {
BaseQueryOrderRequest orderDoneRequest = orderSdkAdapter.getOrderConfirmRequest(request.getOperator(), orderBean);
//合阔pos 商户订单状态不自动扭转
if (CollectionUtils.isNotEmpty(notAutomaticTwistPartnerId) && notAutomaticTwistPartnerId.contains(orderBean.getCompanyId())) {
orderDoneRequest.setNotAutomaticTwist(true);
}
BaseOrderResponse baseOrderResponse = orderCenterSdkService.orderDone(orderDoneRequest);
if (baseOrderResponse == null || ObjectUtils.notEqual(ResponseResult.SUCCESS.getCode(), baseOrderResponse.getErrcode().toString())) {
return ResponseUtil.error(ResponseResult.DONE_ORDER_FAIL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment