Authored by LUOXC

添加调拨记录

package com.yohoufo.order.model;
import com.yohobuy.ufo.model.order.common.EnumExpressDataOperateTransferCode;
import com.yohobuy.ufo.model.order.common.EnumExpressType;
import lombok.Builder;
import lombok.Value;
@Builder
@Value
public class OperateTransferExpressInfo {
Integer uid;
Long orderCode;
EnumExpressType expressType;
EnumExpressDataOperateTransferCode operateTransferCode;
}
... ...
... ... @@ -21,6 +21,7 @@ import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.event.DeliverNoticeEvent;
import com.yohoufo.order.event.ErpBuyerOrderEvent;
import com.yohoufo.order.event.SellerCancelDeliverEvent;
import com.yohoufo.order.model.OperateTransferExpressInfo;
import com.yohoufo.order.model.dto.PreSaleOrderConfig;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
... ... @@ -256,10 +257,18 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
Integer skup = sellerOrderGoods.getId();
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);
expressInfoService.saveOperateTransfer(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EXPRESS_TYPE_JUDGE_CENTER)
.operateTransferCode(platform_receive)
.build());
expressInfoService.saveOperateTransfer(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EXPRESS_TYPE_JUDGE_CENTER)
.operateTransferCode(judge_pass)
.build());
} catch (Exception ex) {
logger.warn("pay successful, processQuickDeliverOrder invoke save transfer express info fail, sellerUid {}, buyerUid {},orderCode {},skup {}",
sellerUid, buyerUid, orderCode, skup);
... ...
... ... @@ -7,6 +7,7 @@ import com.yohoufo.common.constant.ExpressInfoConstant;
import com.yohoufo.dal.order.model.ExpressInfo;
import com.yohoufo.dal.order.model.ExpressRecord;
import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.model.OperateTransferExpressInfo;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import java.util.ArrayList;
... ... @@ -23,6 +24,20 @@ public interface IExpressInfoService {
//保存调拨信息(不含物流数据)
void saveOperateTransferExpressInfo(Integer uid, Long orderCode, Integer expressType, EnumExpressDataType expressDataType, EnumExpressDataOperateTransferCode operateTransferCode);
/**
* 保存调拨数据
* @param request 调拨数据
*/
void saveOperateTransfer(OperateTransferExpressInfo request);
/**
* 保存调拨数据
* @param condition 条件
* @param request 调拨数据
*/
void saveOperateTransferIf(boolean condition, OperateTransferExpressInfo request);
void triggerExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile );
/**
... ...
... ... @@ -23,6 +23,7 @@ import com.yohoufo.order.common.ActionStatusHold;
import com.yohoufo.order.common.DelStatus;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.event.*;
import com.yohoufo.order.model.OperateTransferExpressInfo;
import com.yohoufo.order.model.PayQueryBo;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.request.SaveQualityCheckInfoRequest;
... ... @@ -53,6 +54,9 @@ import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
import static com.yohobuy.ufo.model.order.common.EnumExpressDataOperateTransferCode.platform_receive;
import static com.yohobuy.ufo.model.order.common.EnumExpressType.EXPRESS_TYPE_JUDGE_CENTER;
@Service
public class BuyerOrderServiceImpl implements IBuyerOrderService {
... ... @@ -104,6 +108,10 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Autowired
private OrderChangeListenerContainer orderChangeListenerContainer;
@Autowired
private IExpressInfoService expressInfoService;
/**
* 提交订单
... ... @@ -130,6 +138,14 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode);
SellerOrderGoods sog = sellerOrderGoodsMapper.selectByPrimaryKey(bog.getSkup());
expressInfoService.saveOperateTransferIf(BuyerOrderUtils.isDeposit(buyerOrder),
OperateTransferExpressInfo.builder()
.uid(uid)
.orderCode(orderCode)
.expressType(EnumExpressType.EXPRESS_TYPE_2)
.operateTransferCode(EnumExpressDataOperateTransferCode.GOODS_DEPOSIT_IN_STORE)
.build());
//记录状态信息
logger.info("in seller confirm record status change, orderCode {},uid {} ,sellerUid {}", orderCode,uid,sellerUid);
orderStatusFlowService.addAsy(orderCode,OrderStatus.DONE.getCode());
... ...
... ... @@ -29,6 +29,7 @@ import com.yohoufo.order.common.ExpressForMqSend;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.event.BuyerOrderSellerDeliveryCheckEvent;
import com.yohoufo.order.event.ErpBuyerOrderEvent;
import com.yohoufo.order.model.OperateTransferExpressInfo;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import com.yohoufo.order.service.IBuyerOrderMetaService;
import com.yohoufo.order.service.IExpressCompanyService;
... ... @@ -319,7 +320,25 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
public void saveOperateTransferExpressInfo(Integer uid, Long orderCode, Integer expressType, EnumExpressDataType expressDataType,EnumExpressDataOperateTransferCode operateTransferCode){
LOGGER.info("ExpressInfoServiceImpl begin add OperateTran enter ,uid ={},orderCode={},expressType={},expressDataType={},operateTransferCode={} ",
uid,orderCode,expressType,expressDataType,operateTransferCode);
this.saveOperateTransferExpressInfo(uid,23,orderCode, "", expressType, expressDataType, operateTransferCode);
saveOperateTransferExpressInfo(uid,23,orderCode, "",
expressType, expressDataType, operateTransferCode);
}
@Override
public void saveOperateTransfer(OperateTransferExpressInfo request) {
try {
saveOperateTransferExpressInfo(request.getUid(), 23, request.getOrderCode(), "",
request.getExpressType().getCode(), EnumExpressDataType.operate_transfer, request.getOperateTransferCode());
}catch (Exception e){
LOGGER.warn("save Operate Transfer fail, uid is {} order code is {} ");
}
}
@Override
public void saveOperateTransferIf(boolean condition, OperateTransferExpressInfo operateTransferExpressInfo) {
if (condition) {
saveOperateTransfer(operateTransferExpressInfo);
}
}
private void saveOperateTransferExpressInfo(Integer uid, Integer expressCompanyId, Long orderCode, String wayBillCode, Integer expressType, EnumExpressDataType expressDataType,EnumExpressDataOperateTransferCode operateTransferCode){
... ...