...
|
...
|
@@ -7,10 +7,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo; |
|
|
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
|
|
|
import com.yohobuy.ufo.model.order.bo.DepositFee;
|
|
|
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.EnumExpressType;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderCodeType;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.TabType;
|
|
|
import com.yohobuy.ufo.model.order.common.*;
|
|
|
import com.yohobuy.ufo.model.order.constants.DepositEventTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
|
|
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
|
...
|
...
|
@@ -34,6 +31,7 @@ import com.yohoufo.order.service.IBuyerOrderService; |
|
|
import com.yohoufo.order.service.IExpressInfoService;
|
|
|
import com.yohoufo.order.service.impl.DepositHelpService;
|
|
|
import com.yohoufo.order.service.impl.MetaConfigService;
|
|
|
import com.yohoufo.order.service.seller.SellerOrderCancelService;
|
|
|
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
...
|
...
|
@@ -92,6 +90,9 @@ public class DepositOrderService { |
|
|
@Autowired
|
|
|
private DepositHelpService depositHelpService;
|
|
|
|
|
|
@Autowired
|
|
|
private SellerOrderCancelService sellerOrderCancelService;
|
|
|
|
|
|
/**
|
|
|
* 根据库存货号,计算需要召回的费用
|
|
|
* @param req
|
...
|
...
|
@@ -101,6 +102,8 @@ public class DepositOrderService { |
|
|
StorageDeposit storageDeposit = checkStorageDeposit(req,
|
|
|
Lists.newArrayList(StorageDepositStatusEnum.HAS_IN.getCode())); // 不存在的时候有异常
|
|
|
|
|
|
cancelSellerOrderBySkup(storageDeposit, storageDeposit.getNewSkup());//如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
|
|
|
|
|
|
int depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode()); // 还可存放多久 单位天
|
|
|
|
|
|
Integer skup = storageDeposit.getSkup();
|
...
|
...
|
@@ -122,6 +125,19 @@ public class DepositOrderService { |
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
|
|
|
* @param newSkup 库存上架后的新产生的SKUP
|
|
|
*/
|
|
|
private void cancelSellerOrderBySkup(StorageDeposit storageDeposit, Integer newSkup) {
|
|
|
LOG.info("DepositOrderService.cancelSellerOrderBySkup excute; newSkup is {} storageDeposit : {}", newSkup, storageDeposit);
|
|
|
if (null != newSkup && 0 != newSkup && SkupStatus.CAN_SELL.getCode() == storageDeposit.getOrderStatus()) {
|
|
|
int result = sellerOrderCancelService.cancelSellerOrderBySkup(storageDeposit.getOwnerUid(), newSkup);
|
|
|
if (result == 0) {
|
|
|
throw new UfoServiceException(400, "该商品已被下单,不能召回商品");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
public OrderSubmitResponse publishDepositOrder(DepositOrderComputeReq req) {
|
...
|
...
|
|