|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.service.model.response.UserAddressRspBO;
|
...
|
...
|
@@ -26,13 +15,7 @@ import com.yohoufo.dal.order.BuyerOrderMapper; |
|
|
import com.yohoufo.dal.order.SellerOrderMapper;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrder;
|
|
|
import com.yohoufo.dal.order.model.SellerOrder;
|
|
|
import com.yohoufo.order.common.CancelType;
|
|
|
import com.yohoufo.order.common.DelStatus;
|
|
|
import com.yohoufo.order.common.OrderCodeType;
|
|
|
import com.yohoufo.order.common.OrderStatus;
|
|
|
import com.yohoufo.order.common.SellerOrderStatus;
|
|
|
import com.yohoufo.order.common.SkupStatus;
|
|
|
import com.yohoufo.order.common.TabType;
|
|
|
import com.yohoufo.order.common.*;
|
|
|
import com.yohoufo.order.convert.AddressInfoConvertor;
|
|
|
import com.yohoufo.order.convert.SellerOrderConvertor;
|
|
|
import com.yohoufo.order.event.ErpCancelSellerOrderEvent;
|
...
|
...
|
@@ -61,6 +44,13 @@ import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta; |
|
|
import com.yohoufo.product.model.GoodsSize;
|
|
|
import com.yohoufo.product.model.ProductInfo;
|
|
|
import com.yohoufo.product.response.StorageDataResp;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* Created by chenchao on 2018/9/13.
|
...
|
...
|
@@ -69,16 +59,6 @@ import com.yohoufo.product.response.StorageDataResp; |
|
|
@Slf4j
|
|
|
public class SellerOrderService implements IOrderListService, IOrderDetailService {
|
|
|
|
|
|
private final static List<Integer> sellerCanDelStatusList = Lists.newArrayList(
|
|
|
SellerOrderStatus.PLAY_SELF.getCode(),
|
|
|
SellerOrderStatus.SELf_CANCEL_PAY.getCode(),
|
|
|
SellerOrderStatus.TIMEOUT_CANCEL.getCode(),
|
|
|
SellerOrderStatus.FINISH.getCode());
|
|
|
|
|
|
private final static List<Integer> buyerCanDelStatusList = Lists.newArrayList(
|
|
|
OrderStatus.DONE.getCode(),
|
|
|
OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(),
|
|
|
OrderStatus.BUYER_CANCEL_TIMEOUT.getCode());
|
|
|
|
|
|
@Autowired
|
|
|
private SellerOrderMapper sellerOrderMapper;
|
...
|
...
|
@@ -394,15 +374,14 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi |
|
|
}
|
|
|
|
|
|
private void checkBuyCanDelStatus(Integer status) {
|
|
|
if (!buyerCanDelStatusList.contains(status)) {
|
|
|
if (!ActionStatusHold.getSellerCanDelBuyerStatusList().contains(status)) {
|
|
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
private void checkSellCanDelStatus(Integer status) {
|
|
|
if (!sellerCanDelStatusList.contains(status)) {
|
|
|
if (!ActionStatusHold.getSellerCanDelStatusList().contains(status)) {
|
|
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
|
|
}
|
|
|
}
|
...
|
...
|
|