|
@@ -7,10 +7,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo; |
|
@@ -7,10 +7,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo; |
7
|
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
|
7
|
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
|
8
|
import com.yohobuy.ufo.model.order.bo.DepositFee;
|
8
|
import com.yohobuy.ufo.model.order.bo.DepositFee;
|
9
|
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
|
9
|
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
|
10
|
-import com.yohobuy.ufo.model.order.common.EnumExpressType;
|
|
|
11
|
-import com.yohobuy.ufo.model.order.common.OrderCodeType;
|
|
|
12
|
-import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
13
|
-import com.yohobuy.ufo.model.order.common.TabType;
|
10
|
+import com.yohobuy.ufo.model.order.common.*;
|
14
|
import com.yohobuy.ufo.model.order.constants.DepositEventTypeEnum;
|
11
|
import com.yohobuy.ufo.model.order.constants.DepositEventTypeEnum;
|
15
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
12
|
import com.yohobuy.ufo.model.order.constants.OrderConstant;
|
16
|
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
|
13
|
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
|
|
@@ -34,6 +31,7 @@ import com.yohoufo.order.service.IBuyerOrderService; |
|
@@ -34,6 +31,7 @@ import com.yohoufo.order.service.IBuyerOrderService; |
34
|
import com.yohoufo.order.service.IExpressInfoService;
|
31
|
import com.yohoufo.order.service.IExpressInfoService;
|
35
|
import com.yohoufo.order.service.impl.DepositHelpService;
|
32
|
import com.yohoufo.order.service.impl.DepositHelpService;
|
36
|
import com.yohoufo.order.service.impl.MetaConfigService;
|
33
|
import com.yohoufo.order.service.impl.MetaConfigService;
|
|
|
34
|
+import com.yohoufo.order.service.seller.SellerOrderCancelService;
|
37
|
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
|
35
|
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
|
38
|
import org.apache.commons.collections.CollectionUtils;
|
36
|
import org.apache.commons.collections.CollectionUtils;
|
39
|
import org.apache.commons.lang3.StringUtils;
|
37
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -92,6 +90,9 @@ public class DepositOrderService { |
|
@@ -92,6 +90,9 @@ public class DepositOrderService { |
92
|
@Autowired
|
90
|
@Autowired
|
93
|
private DepositHelpService depositHelpService;
|
91
|
private DepositHelpService depositHelpService;
|
94
|
|
92
|
|
|
|
93
|
+ @Autowired
|
|
|
94
|
+ private SellerOrderCancelService sellerOrderCancelService;
|
|
|
95
|
+
|
95
|
/**
|
96
|
/**
|
96
|
* 根据库存货号,计算需要召回的费用
|
97
|
* 根据库存货号,计算需要召回的费用
|
97
|
* @param req
|
98
|
* @param req
|
|
@@ -101,6 +102,8 @@ public class DepositOrderService { |
|
@@ -101,6 +102,8 @@ public class DepositOrderService { |
101
|
StorageDeposit storageDeposit = checkStorageDeposit(req,
|
102
|
StorageDeposit storageDeposit = checkStorageDeposit(req,
|
102
|
Lists.newArrayList(StorageDepositStatusEnum.HAS_IN.getCode())); // 不存在的时候有异常
|
103
|
Lists.newArrayList(StorageDepositStatusEnum.HAS_IN.getCode())); // 不存在的时候有异常
|
103
|
|
104
|
|
|
|
105
|
+ cancelSellerOrderBySkup(storageDeposit, storageDeposit.getNewSkup());//如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
|
|
|
106
|
+
|
104
|
int depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode()); // 还可存放多久 单位天
|
107
|
int depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode()); // 还可存放多久 单位天
|
105
|
|
108
|
|
106
|
Integer skup = storageDeposit.getSkup();
|
109
|
Integer skup = storageDeposit.getSkup();
|
|
@@ -122,6 +125,19 @@ public class DepositOrderService { |
|
@@ -122,6 +125,19 @@ public class DepositOrderService { |
122
|
}
|
125
|
}
|
123
|
|
126
|
|
124
|
|
127
|
|
|
|
128
|
+ /**
|
|
|
129
|
+ * 如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
|
|
|
130
|
+ * @param newSkup 库存上架后的新产生的SKUP
|
|
|
131
|
+ */
|
|
|
132
|
+ private void cancelSellerOrderBySkup(StorageDeposit storageDeposit, Integer newSkup) {
|
|
|
133
|
+ LOG.info("DepositOrderService.cancelSellerOrderBySkup excute; newSkup is {} storageDeposit : {}", newSkup, storageDeposit);
|
|
|
134
|
+ if (null != newSkup && 0 != newSkup && SkupStatus.CAN_SELL.getCode() == storageDeposit.getOrderStatus()) {
|
|
|
135
|
+ int result = sellerOrderCancelService.cancelSellerOrderBySkup(storageDeposit.getOwnerUid(), newSkup);
|
|
|
136
|
+ if (result == 0) {
|
|
|
137
|
+ throw new UfoServiceException(400, "该商品已被下单,不能召回商品");
|
|
|
138
|
+ }
|
|
|
139
|
+ }
|
|
|
140
|
+ }
|
125
|
|
141
|
|
126
|
|
142
|
|
127
|
public OrderSubmitResponse publishDepositOrder(DepositOrderComputeReq req) {
|
143
|
public OrderSubmitResponse publishDepositOrder(DepositOrderComputeReq req) {
|