Authored by LUOXC

fixbug#5735

... ... @@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
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.SkupType;
import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.utils.DateUtil;
... ... @@ -49,6 +46,11 @@ import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static com.yohobuy.ufo.model.order.common.EnumExpressDataOperateTransferCode.judge_pass;
import static com.yohobuy.ufo.model.order.common.EnumExpressDataOperateTransferCode.platform_receive;
import static com.yohobuy.ufo.model.order.common.EnumExpressDataType.operate_transfer;
import static com.yohobuy.ufo.model.order.common.EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
@Service
public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
... ... @@ -98,6 +100,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
@Autowired
private AppraiseService appraiseService;
@Autowired
private IExpressInfoService expressInfoService;
private boolean isDepositWithQuickDeliverGoods(int uid, long orderCode, Integer oa){
BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(pbog.getSkup());
... ... @@ -237,22 +242,33 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
orderOverTimeService.insertDeliveryTime(new OrderOverTime(orderCode, ts + secondsOfLimit, minutes));
}
private void processQuickDeliverOrder(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){
private void processQuickDeliverOrder(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods) {
Integer sellerUid = buyerOrder.getSellerUid();
Integer buyerUid = buyerOrder.getUid();
Long orderCode = buyerOrder.getOrderCode();
Integer skup = sellerOrderGoods.getId();
//寄存订单 & 闪购商品
if (SkupType.QUICK_DELIVER.getCode() == sellerOrderGoods.getAttributes()){
Integer sellerUid = null;
Integer buyerUid = null;
Long orderCode = null;
Integer skup = null;
if (SkupType.QUICK_DELIVER.getCode() == sellerOrderGoods.getAttributes()) {
try {
depositService.changeOwner(sellerUid = buyerOrder.getSellerUid(), skup = sellerOrderGoods.getId(),
orderCode = buyerOrder.getOrderCode(), buyerUid = buyerOrder.getUid(), false);
}catch (Exception ex){
logger.warn("pay successful, processQuickDeliverOrder invoke depositService.changeOwner fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
depositService.changeOwner(sellerUid, skup, orderCode, buyerUid, false);
} catch (Exception ex) {
logger.warn("pay successful, processQuickDeliverOrder invoke change owner fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
sellerUid, buyerUid, orderCode, skup);
}
}
if (BuyerOrderUtils.isQuickDeliver(buyerOrder.getAttributes())) {
try {
// 插入物流调拨信息
expressInfoService.saveOperateTransferExpressInfo(buyerUid, orderCode,
EXPRESS_TYPE_JUDGE_CENTER.getCode(), operate_transfer, platform_receive);
expressInfoService.saveOperateTransferExpressInfo(buyerUid, orderCode,
EXPRESS_TYPE_JUDGE_CENTER.getCode(), operate_transfer, judge_pass);
} catch (Exception ex) {
logger.warn("pay successful, processQuickDeliverOrder invoke save transfer express info fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
sellerUid, buyerUid, orderCode, skup);
}
}
//todo notice
}
... ...
... ... @@ -35,6 +35,8 @@ public interface IExpressInfoService {
void deliverToDepot(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum);
/**
* 卖家发货的商品,买家取消后,鉴定中心寄回商品给卖家
* @param sellerUid 卖家uid
... ...
package com.yohoufo.order.service.proxy;
import com.yoho.message.sdk.service.ufo.IUFOSendService;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.inboxclient.sdk.InBoxSDK;
import com.yohoufo.order.utils.PubThreadFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@Service
public class SellerOrderMessage {
private ExecutorService executorService;
@Autowired
private InBoxSDK inBoxSDK;
@Autowired
private SendSmsService sendSmsService;
@Autowired
private UserProxyService userProxyService;
@Autowired
private ProductMapper productMapper;
@Autowired
private SellerOrderMapper sellerOrderMapper;
@Autowired
private IUFOSendService ufoSendService;
@PostConstruct
public void init() {
executorService = new ThreadPoolExecutor(5, 10,
60, TimeUnit.SECONDS,
new ArrayBlockingQueue<>(1000),
new PubThreadFactory("seller-order-message"));
}
}
... ...