Authored by chenchao

Merge branch 'test6.9.8' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.8

... ... @@ -27,6 +27,7 @@ public class ActionStatusHold {
OrderStatus.MINI_FAULT_WAITING.getCode(),
OrderStatus.MINI_FAULT_ACCEPT.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode(),
OrderStatus.WAITING_RECEIVE.getCode(),
OrderStatus.DONE.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
... ...
... ... @@ -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;
... ... @@ -179,6 +176,25 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
Integer buyerUid = buyerOrder.getUid();
Long orderCode = buyerOrder.getOrderCode();
inBoxFacade.noticeWhenDepositOrderOfQuickDeliverGoodsPaid(buyerUid, orderCode, sellerOrderGoods);
// 插入物流调拨信息
expressInfoService.saveOperateTransferExpressInfo(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EXPRESS_TYPE_JUDGE_CENTER)
.operateTransferCode(platform_receive)
.build());
expressInfoService.saveOperateTransferExpressInfo(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EXPRESS_TYPE_JUDGE_CENTER)
.operateTransferCode(judge_pass)
.build());
expressInfoService.saveOperateTransferExpressInfo(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EnumExpressType.EXPRESS_TYPE_2)
.operateTransferCode(EnumExpressDataOperateTransferCode.GOODS_DEPOSIT_IN_STORE)
.build());
}
private void processDepositOrderOfInstockGoods(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){
... ... @@ -270,24 +286,20 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
// notice
inBoxFacade.noticeWhenQuickDeliverOrderPaid(buyerOrder.getUid(), buyerOrder.getOrderCode(), sellerOrderGoods);
try {
// 插入物流调拨信息
expressInfoService.saveOperateTransferExpressInfo(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EXPRESS_TYPE_JUDGE_CENTER)
.operateTransferCode(platform_receive)
.build());
expressInfoService.saveOperateTransferExpressInfo(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);
}
// 插入物流调拨信息
expressInfoService.saveOperateTransferExpressInfo(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EXPRESS_TYPE_JUDGE_CENTER)
.operateTransferCode(platform_receive)
.build());
expressInfoService.saveOperateTransferExpressInfo(OperateTransferExpressInfo.builder()
.uid(buyerUid)
.orderCode(orderCode)
.expressType(EXPRESS_TYPE_JUDGE_CENTER)
.operateTransferCode(judge_pass)
.build());
}
@Override
... ...
... ... @@ -113,6 +113,7 @@ public interface IExpressInfoService {
OrderStatus.MINI_FAULT_WAITING.getCode(),
OrderStatus.MINI_FAULT_ACCEPT.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode(),
OrderStatus.DONE.getCode(),
OrderStatus.BUYER_BLOWN_CUSTOMS_CLEARANCE.getCode());
... ... @@ -142,19 +143,20 @@ public interface IExpressInfoService {
return types;
}
List<Integer> status2BuyerDeliverExpressStatusList = Arrays.asList(
OrderStatus.PLATFORM_RECEIVE.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(),
OrderStatus.MINI_FAULT_WAITING.getCode(),
OrderStatus.MINI_FAULT_ACCEPT.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.QUALITY_CHECK_FAKE.getCode(),
OrderStatus.MINI_FAULT_REJECT.getCode(),
OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(),
OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()
);
List<Integer> status2BuyerDeliverExpressStatusList = Arrays.asList(
OrderStatus.PLATFORM_RECEIVE.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode(),
OrderStatus.MINI_FAULT_WAITING.getCode(),
OrderStatus.MINI_FAULT_ACCEPT.getCode(),
OrderStatus.JUDGE_PASS.getCode(),
OrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.QUALITY_CHECK_FAKE.getCode(),
OrderStatus.MINI_FAULT_REJECT.getCode(),
OrderStatus.MINI_FAULT_OUT_TIME_REJECT.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(),
OrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()
);
/**
... ...
... ... @@ -185,7 +185,7 @@ public class DepositServiceImpl implements DepositService {
bo.setProductName(goods.getProductName());
bo.setColorName(goods.getColorName());
bo.setPic(ImageUrlAssist.getAllProductPicUrl(goods.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
BuyerOrder buyerOrder = buyerGoodsMap.get(buyerGoodsMap.get(depo.getOrderCode()));
BuyerOrder buyerOrder = buyerGoodsMap.get(depo.getOrderCode());
if (buyerOrder != null) {
bo.setPrice(buyerOrder.getAmount().toString());
}
... ...
... ... @@ -521,7 +521,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
||OrderStatus.MINI_FAULT_WAITING.getCode()==status){
expressInfoRespBo.setStage(2);
}else if(OrderStatus.MINI_FAULT_ACCEPT.getCode()==status
||OrderStatus.JUDGE_PASS.getCode()==status){
||OrderStatus.JUDGE_PASS.getCode()==status
||OrderStatus.JUDGE_PASS_WAIT_WAREHOUSE.getCode()==status){
if(TabType.BUY==actor){
//买家
expressInfoRespBo.setStage(2);
... ... @@ -711,31 +712,8 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
}
return ls;
}
ExpressRecord expressRecord = expressRecordMapper.selectByOrderCodeAndExpressType(orderCode,expressType);
if(expressRecord==null){
LOGGER.info("getExpressInfoListByStage out because of empty record ,orderCode = {} ,expressType = {} ",orderCode,expressType);
return Lists.newArrayList();
}
String waybillCode = expressRecord.getWaybillCode();
Integer logisticsType = expressRecord.getLogisticsType();
List<ExpressInfo> list = expressInfoMapper.selectByOrderCodeAndExpressType(orderCode,expressType);
//有可能存在一个订单号,多个物流的情况,比如原来的物流填错了,修改了新的物流,只保留新的物流号的信息
if(CollectionUtils.isNotEmpty(list)){
list = list.stream().filter(info -> StringUtils.equals(waybillCode,info.getWaybillCode())).collect(Collectors.toList());
}
//如果获取为空,尝试另外一个方式,通过物流单号查
if(CollectionUtils.isEmpty(list)){
LOGGER.info("getExpressInfoListByStage try again by waybillCode, orderCode = {} ,expressType = {}, expressRecord = {} ",orderCode,expressType,expressRecord);
list = expressInfoMapper.selectExpressInfoListByWaybillCodeAndLogisticsType(waybillCode,logisticsType);
//如果存在多笔订单的情况,选择一个最近的订单
if(CollectionUtils.isNotEmpty(list)){
long latestOrder=list.get(0).getOrderCode();
list = list.stream().filter(info -> (latestOrder==info.getOrderCode())).collect(Collectors.toList());
}
}
List<ExpressInfo> list = getExpressInfoList(orderCode, expressType);
//第一阶段的物流:买家不允许查看卖家给平台订单的顺丰联系人的手机号,手机号脱敏
if(EnumExpressType.EXPRESS_TYPE_1.getCode().equals(expressType)&&TabType.BUY==actor&&CollectionUtils.isNotEmpty(list)){
... ... @@ -756,6 +734,37 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
return list;
}
private List<ExpressInfo> getExpressInfoList(Long orderCode, Integer expressType) {
List<ExpressInfo> list;
ExpressRecord expressRecord = expressRecordMapper.selectByOrderCodeAndExpressType(orderCode,expressType);
if(expressRecord==null){
list = expressInfoMapper.selectByOrderCodeAndExpressType(orderCode,expressType).stream()
// 保留正确的物流信息和调拨信息
.filter(info -> StringUtils.isBlank(info.getWaybillCode()))
.collect(Collectors.toList());
}else {
String waybillCode = expressRecord.getWaybillCode();
Integer logisticsType = expressRecord.getLogisticsType();
list = expressInfoMapper.selectByOrderCodeAndExpressType(orderCode,expressType).stream()
// 保留正确的物流信息和调拨信息
.filter(info -> StringUtils.equals(waybillCode, info.getWaybillCode()) || StringUtils.isBlank(info.getWaybillCode()))
.collect(Collectors.toList());
//如果获取为空,尝试另外一个方式,通过物流单号查
if(CollectionUtils.isEmpty(list)){
LOGGER.info("getExpressInfoListByStage try again by waybillCode, orderCode = {} ,expressType = {}, expressRecord = {} ",orderCode,expressType,expressRecord);
list = expressInfoMapper.selectExpressInfoListByWaybillCodeAndLogisticsType(waybillCode,logisticsType);
//如果存在多笔订单的情况,选择一个最近的订单
if(CollectionUtils.isNotEmpty(list)){
long latestOrder=list.get(0).getOrderCode();
list = list.stream().filter(info -> (latestOrder==info.getOrderCode())).collect(Collectors.toList());
}
}
}
return list;
}
private List<ExpressInfoDetail> queryLastExpressDetailInfo(TabType actor,Long orderCode, int expressType) {
LOGGER.info("queryLastExpressDetailInfo orderCode {}, expressType {}", orderCode, expressType);
List<ExpressInfo> expressInfoList_All = getExpressInfoListByStage( actor,orderCode, expressType);
... ...