Authored by chenchao

fix

... ... @@ -462,12 +462,17 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
//
Long orderCode = appraiseOrder.getOrderCode();
Long parentOrderCode;
Long paidOrderCode;
boolean isParent = Objects.isNull(parentOrderCode=appraiseOrder.getParentOrderCode());
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT;
AppraiseOrderStatus expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
if(isParent){
triggerStatusChangeByParentCode(parentOrderCode, targetOrderStatus, expectedStatus);
logger.info("shamDeliver isParent orderCode {} ", orderCode);
paidOrderCode = orderCode;
triggerStatusChangeByParentCode(orderCode, targetOrderStatus, expectedStatus);
}else {
logger.info("shamDeliver is not Parent orderCode {} ", orderCode);
paidOrderCode = parentOrderCode;
//no parent
triggerStatusConsistencyCheck(orderCode);
}
... ... @@ -479,7 +484,7 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
.loadUser(appraiseOrder.getUid())
.loadActionCase(SellerWalletDetail.Type.SELLER_SHAM_SEND_OUT)
.loadRefundAction(payRefundService::refund)
.loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
.loadOrder(orderCode, paidOrderCode, appraiseOrder.getPayment(), appraiseOrder.getAmount())
.refund();
return rows;
}
... ...
... ... @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yohobuy.ufo.model.order.bo.AppraiseOrderBo;
import com.yohoufo.order.BaseWebTest;
import com.yohoufo.order.event.OrderCancelEvent;
import com.yohoufo.order.service.impl.ServiceOrderProcessor;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -13,6 +14,9 @@ public class SellerDepositOrderServiceTest extends BaseWebTest {
@Autowired
private SellerDepositOrderService sellerDepositOrderService;
@Autowired
private ServiceOrderProcessor serviceOrderProcessor;
@Test
public void testGetSubOrderStatistic(){
//sub 36378862305176
... ... @@ -29,4 +33,12 @@ public class SellerDepositOrderServiceTest extends BaseWebTest {
sellerDepositOrderService.cancelByTimeout(orderCancelEvent);
}
@Test
public void testshamDeliver(){
long orderCode = 36380351864658L;
ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.isAppraiseOrder(orderCode);
sellerDepositOrderService.shamDeliver(existenceNode.getAppraiseOrder());
}
}
... ...