Authored by LUOXC

Merge branch 'dev6.9.8' into test6.9.8

... ... @@ -23,19 +23,4 @@ public class ExpressInfoConstant {
*/
public static final Integer EXPRESS_STATUS_UNSEND = 2;
/**
* 清关成功
*/
public static final Integer EXPRESS_CLEAR_SUCCESS = 100;
/**
* 清关失败(平台原因)
*/
public static final Integer EXPRESS_CLEAR_FAIL_CAUSE_PLATFORM = 101;
/**
* 清关失败(买家原因)
*/
public static final Integer EXPRESS_CLEAR_FAIL_CAUSE_BUYER= 102;
}
... ...
package com.yohoufo.order.common;
import java.util.Objects;
public class LogisticsTypes {
/**
* 判断是否是中通国际快递公司
*
* @param logisticsType
* @return
*/
public static boolean isZtoInternational(Integer logisticsType) {
return Objects.isNull(logisticsType) ? false : logisticsType.intValue() == 76;
}
}
... ...
... ... @@ -14,6 +14,7 @@ import com.yohoufo.dal.order.ExpressRecordMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.ExpressInfo;
import com.yohoufo.dal.order.model.ExpressRecord;
import com.yohoufo.order.common.LogisticsTypes;
import com.yohoufo.order.model.bo.ErpExpressBo;
import com.yohoufo.order.mq.publisher.ConsumerExceptionPublisher;
import com.yohoufo.order.service.IBuyerOrderService;
... ... @@ -156,30 +157,9 @@ private static final Logger LOGGER = LoggerUtils.getMqConsumerLogger();
expressInfo.setExpressType(initExpressType);
expressInfo.setState(state);
//清关失败和清关成功的物流信息,需要在OperateTransferCode记录下相应的code ,以便自动确认查询
if(ExpressInfoConstant.EXPRESS_CLEAR_SUCCESS.equals(state)){
//清关成功的纪录
// 中通国际快递公司,存在物流则表示清关成功
if (LogisticsTypes.isZtoInternational(logisticsType)) {
expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_success.getCode());
}else if(ExpressInfoConstant.EXPRESS_CLEAR_FAIL_CAUSE_PLATFORM.equals(state)){
//TODO 平台原因清关失败的信息记录下来,需要告诉order,退费
expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_fail_cause_platform.getCode());
/*暂时注释掉,等香港仓上线,中通物流返回信息未定
final CutomsClearanceFailType failType=CutomsClearanceFailType.PLATFORM;
LOGGER.info("call order clear fail interface,orderCode {},uid {},waybillCode {},state {} ,failType {}", orderCode,uid,waybillCode,state,failType);
executorService.execute(() -> {
buyerOrderCancelService.cancelOverseasOrder(orderCode, failType);
LOGGER.info("call order clear fail interface end,orderCode {},uid {},waybillCode {},state {},failType {} ", orderCode,uid,waybillCode,state,failType);
});*/
}else if(ExpressInfoConstant.EXPRESS_CLEAR_FAIL_CAUSE_BUYER.equals(state)){
//TODO 买家原因清关失败的信息记录下来,需要告诉order,退费
expressInfo.setOperateTransferCode(EnumExpressDataOperateTransferCode.express_clear_fail_cause_buyer.getCode());
/*暂时注释掉,等香港仓上线,中通物流返回信息未定
final CutomsClearanceFailType failType=CutomsClearanceFailType.BUYER;
LOGGER.info("call order clear fail interface,orderCode {},uid {},waybillCode {},state {} ,failType {}", orderCode,uid,waybillCode,state,failType);
executorService.execute(() -> {
buyerOrderCancelService.cancelOverseasOrder(orderCode, failType);
LOGGER.info("call order clear fail interface end,orderCode {},uid {},waybillCode {},state {},failType {} ", orderCode,uid,waybillCode,state,failType);
});*/
}
expressInfoMapper.insert(expressInfo);
... ...
... ... @@ -44,6 +44,7 @@ import com.yohoufo.order.service.proxy.OrderOperateRecordService;
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.seller.setting.SellerService;
import com.yohoufo.order.utils.BuyerOrderUtils;
import com.yohoufo.order.utils.PaymentHelper;
import com.yohoufo.order.utils.PubThreadFactory;
import lombok.Data;
... ... @@ -195,6 +196,7 @@ public class AppraiseService {
* 正常发货
* 鉴定通过 -- 待收货
* 瑕疵接收 -- 待收货
* 寄存完成 -- 待收货
*/
public void deliveryGoodsToBuyer(AppraiseExpressInfoBo appraiseExpressInfoBo) {
LOGGER.info("deliveryGoodsToBuyer enter req {}", appraiseExpressInfoBo);
... ... @@ -211,6 +213,11 @@ public class AppraiseService {
expectOrderStatus = OrderStatus.JUDGE_PASS;
} else if (buyerOrder.getStatus() == OrderStatus.MINI_FAULT_ACCEPT.getCode()) {
expectOrderStatus = OrderStatus.MINI_FAULT_ACCEPT;
}
// 寄存订单已完成
else if (BuyerOrderUtils.isDeposit(buyerOrder.getAttributes())
&& buyerOrder.getStatus() == OrderStatus.DONE.getCode()) {
expectOrderStatus = OrderStatus.DONE;
} else {
LOGGER.warn("in deliveryGoodsToBuyer, buyer Order orderCode {} pstatus {}, expect Order Status JUDGE_PASS or MINI_FAULT_ACCEPT ",
orderCode, buyerOrder.getStatus());
... ...
... ... @@ -42,4 +42,11 @@ public class BuyerOrderUtils {
return isOffline(orderInfo.getAttributes());
}
/**
* 是否寄存订单
*/
public static boolean isDeposit(Integer attributes) {
return OrderAttributes.getOrderAttributes(attributes) == OrderAttributes.DEPOSITE;
}
}
... ...