Authored by chenchao

support cancel type

package com.yohoufo.order.constants;
public enum CutomsClearanceFailType {
PLATFORM,BUYER
}
... ...
... ... @@ -5,6 +5,7 @@ import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.constants.RegionEnum;
import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.alarm.UfoInfluxdbEvent;
import com.yohoufo.common.alarm.UfoInfluxdbVo;
... ... @@ -16,6 +17,7 @@ import com.yohoufo.dal.order.model.*;
import com.yohoufo.order.common.RefundCase;
import com.yohoufo.order.common.TransferCase;
import com.yohoufo.order.constants.AlarmConfig;
import com.yohoufo.order.constants.CutomsClearanceFailType;
import com.yohoufo.order.event.*;
import com.yohoufo.order.model.PayRefundBo;
import com.yohoufo.order.model.bo.CouponBo;
... ... @@ -34,6 +36,7 @@ import com.yohoufo.order.service.proxy.CouponProxyService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.OrderAssist;
import com.yohoufo.order.utils.PaymentHelper;
... ... @@ -318,6 +321,65 @@ public class BuyerOrderCancelService {
}
}
public void cancelOverseasOrder(long orderCode, CutomsClearanceFailType failType){
logger.info("step in cancelOverseasOrder orderCode {} CutomsClearanceFailType {}", orderCode, failType);
if (failType == null){
return;
}
if (orderCode<= 0L){
return;
}
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
if (buyerOrder == null){
logger.info("in cancelOverseasOrder buyer Order not exist, orderCode {} CutomsClearanceFailType {}", orderCode, failType);
return;
}
Integer orderAttr = buyerOrder.getAttributes();
SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(orderAttr);
if (codeNode.getRegion() == RegionEnum.MAINLAND.getCode()){
logger.info("in cancelOverseasOrder buyer Order is not overseas, Attr {}, orderCode {} CutomsClearanceFailType {}",
orderAttr, orderCode, failType);
return;
}
OrderStatus targetStatus = null;
switch (failType){
case PLATFORM:
targetStatus = OrderStatus.PLATFORM_BLOWN_CUSTOMS_CLEARANCE;
cancelOverseasOrderByPlatform(buyerOrder);
break;
case BUYER:
targetStatus = OrderStatus.BUYER_BLOWN_CUSTOMS_CLEARANCE;
cancelOverseasOrderByBuyer(buyerOrder);
break;
}
if (targetStatus != null){
orderStatusFlowService.addAsy(orderCode,targetStatus.getCode());
}
}
/**
* 平台原因失败
* 货品平台自己吃了
* 买家钱退给买家
* 赔偿卖家ufo券 券金额还未定
* @param buyerOrder
*/
private void cancelOverseasOrderByPlatform(BuyerOrder buyerOrder){
}
/**
* 买家原因失败
* 货品平台自己吃了
* 货款钱退给买家
* @param buyerOrder
*/
private void cancelOverseasOrderByBuyer(BuyerOrder buyerOrder){
}
class BuyerCancelAfterProcessTask implements Callable<PayRefundBo>{
int buyerUid;
long orderCode;
... ...
... ... @@ -525,7 +525,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
BuyerOrder target = new BuyerOrder();
target.setId(buyerOrder.getId());
target.setSellerOrderStatus(DelStatus.IS_DEL.getCode());
target.setUpdateTime(DateUtil.getCurrentTimeSecond());
buyerOrderMapper.updateByPrimaryKeySelective(target);
}
cacheCleaner.cleanList(uid, TabType.SELL.getValue());
... ...