|
@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONObject; |
|
@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONObject; |
5
|
import com.yoho.error.ServiceError;
|
5
|
import com.yoho.error.ServiceError;
|
6
|
import com.yoho.error.exception.ServiceException;
|
6
|
import com.yoho.error.exception.ServiceException;
|
7
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
7
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
8
|
-import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
|
|
9
|
-import com.yohobuy.ufo.model.order.common.OrderCodeType;
|
|
|
10
|
-import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
11
|
-import com.yohobuy.ufo.model.order.common.TabType;
|
8
|
+import com.yohobuy.ufo.model.order.common.*;
|
12
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
9
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
13
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
10
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
14
|
import com.yohoufo.common.utils.DateUtil;
|
11
|
import com.yohoufo.common.utils.DateUtil;
|
|
@@ -49,6 +46,11 @@ import java.util.Arrays; |
|
@@ -49,6 +46,11 @@ import java.util.Arrays; |
49
|
import java.util.List;
|
46
|
import java.util.List;
|
50
|
import java.util.concurrent.TimeUnit;
|
47
|
import java.util.concurrent.TimeUnit;
|
51
|
|
48
|
|
|
|
49
|
+import static com.yohobuy.ufo.model.order.common.EnumExpressDataOperateTransferCode.judge_pass;
|
|
|
50
|
+import static com.yohobuy.ufo.model.order.common.EnumExpressDataOperateTransferCode.platform_receive;
|
|
|
51
|
+import static com.yohobuy.ufo.model.order.common.EnumExpressDataType.operate_transfer;
|
|
|
52
|
+import static com.yohobuy.ufo.model.order.common.EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
|
|
|
53
|
+
|
52
|
@Service
|
54
|
@Service
|
53
|
public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
|
55
|
public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
|
54
|
|
56
|
|
|
@@ -98,6 +100,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { |
|
@@ -98,6 +100,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { |
98
|
@Autowired
|
100
|
@Autowired
|
99
|
private AppraiseService appraiseService;
|
101
|
private AppraiseService appraiseService;
|
100
|
|
102
|
|
|
|
103
|
+ @Autowired
|
|
|
104
|
+ private IExpressInfoService expressInfoService;
|
|
|
105
|
+
|
101
|
private boolean isDepositWithQuickDeliverGoods(int uid, long orderCode, Integer oa){
|
106
|
private boolean isDepositWithQuickDeliverGoods(int uid, long orderCode, Integer oa){
|
102
|
BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
|
107
|
BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
|
103
|
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(pbog.getSkup());
|
108
|
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(pbog.getSkup());
|
|
@@ -237,22 +242,33 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { |
|
@@ -237,22 +242,33 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { |
237
|
orderOverTimeService.insertDeliveryTime(new OrderOverTime(orderCode, ts + secondsOfLimit, minutes));
|
242
|
orderOverTimeService.insertDeliveryTime(new OrderOverTime(orderCode, ts + secondsOfLimit, minutes));
|
238
|
}
|
243
|
}
|
239
|
|
244
|
|
240
|
- private void processQuickDeliverOrder(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){
|
245
|
+ private void processQuickDeliverOrder(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods) {
|
|
|
246
|
+ Integer sellerUid = buyerOrder.getSellerUid();
|
|
|
247
|
+ Integer buyerUid = buyerOrder.getUid();
|
|
|
248
|
+ Long orderCode = buyerOrder.getOrderCode();
|
|
|
249
|
+ Integer skup = sellerOrderGoods.getId();
|
241
|
//寄存订单 & 闪购商品
|
250
|
//寄存订单 & 闪购商品
|
242
|
- if (SkupType.QUICK_DELIVER.getCode() == sellerOrderGoods.getAttributes()){
|
|
|
243
|
- Integer sellerUid = null;
|
|
|
244
|
- Integer buyerUid = null;
|
|
|
245
|
- Long orderCode = null;
|
|
|
246
|
- Integer skup = null;
|
251
|
+ if (SkupType.QUICK_DELIVER.getCode() == sellerOrderGoods.getAttributes()) {
|
247
|
try {
|
252
|
try {
|
248
|
- depositService.changeOwner(sellerUid = buyerOrder.getSellerUid(), skup = sellerOrderGoods.getId(),
|
|
|
249
|
- orderCode = buyerOrder.getOrderCode(), buyerUid = buyerOrder.getUid(), false);
|
|
|
250
|
- }catch (Exception ex){
|
|
|
251
|
- logger.warn("pay successful, processQuickDeliverOrder invoke depositService.changeOwner fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
|
253
|
+ depositService.changeOwner(sellerUid, skup, orderCode, buyerUid, false);
|
|
|
254
|
+ } catch (Exception ex) {
|
|
|
255
|
+ logger.warn("pay successful, processQuickDeliverOrder invoke change owner fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
|
252
|
sellerUid, buyerUid, orderCode, skup);
|
256
|
sellerUid, buyerUid, orderCode, skup);
|
253
|
}
|
257
|
}
|
254
|
|
258
|
|
255
|
}
|
259
|
}
|
|
|
260
|
+ if (BuyerOrderUtils.isQuickDeliver(buyerOrder.getAttributes())) {
|
|
|
261
|
+ try {
|
|
|
262
|
+ // 插入物流调拨信息
|
|
|
263
|
+ expressInfoService.saveOperateTransferExpressInfo(buyerUid, orderCode,
|
|
|
264
|
+ EXPRESS_TYPE_JUDGE_CENTER.getCode(), operate_transfer, platform_receive);
|
|
|
265
|
+ expressInfoService.saveOperateTransferExpressInfo(buyerUid, orderCode,
|
|
|
266
|
+ EXPRESS_TYPE_JUDGE_CENTER.getCode(), operate_transfer, judge_pass);
|
|
|
267
|
+ } catch (Exception ex) {
|
|
|
268
|
+ logger.warn("pay successful, processQuickDeliverOrder invoke save transfer express info fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
|
|
|
269
|
+ sellerUid, buyerUid, orderCode, skup);
|
|
|
270
|
+ }
|
|
|
271
|
+ }
|
256
|
//todo notice
|
272
|
//todo notice
|
257
|
}
|
273
|
}
|
258
|
|
274
|
|