|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yoho.core.common.helpers.ImagesHelper;
|
|
|
import com.yoho.core.rabbitmq.YhProducer;
|
...
|
...
|
@@ -22,6 +23,7 @@ import com.yohoufo.common.utils.UserInfoHiddenHelper; |
|
|
import com.yohoufo.dal.order.*;
|
|
|
import com.yohoufo.dal.order.model.*;
|
|
|
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.response.AppraiseAddressResp;
|
...
|
...
|
@@ -979,6 +981,40 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
return buyerOrderList.get(0);
|
|
|
}
|
|
|
|
|
|
private AddressInfo findBuyerAddressInfo(Integer uid, Long orderCode, Integer skup){
|
|
|
boolean skupIsNull = (null == skup);
|
|
|
boolean orderCodeIsNull = (null == orderCode);
|
|
|
|
|
|
|
|
|
BuyerOrder buyerOrder = null;
|
|
|
if (orderCodeIsNull){
|
|
|
//4 compatible before version 6.9.3(exclude), client transfer without order code
|
|
|
buyerOrder = findOrderCodeBySkup(skup);
|
|
|
orderCode = buyerOrder.getOrderCode();
|
|
|
LOGGER.info("in queryAppraiseAddress find buyer OrderCode By Skup , orderCode {} skup {}", orderCode, skup);
|
|
|
}
|
|
|
buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
|
|
AddressInfo buyerAddress = buyerOrderMetaService.getAddressInfo(buyerOrder.getUid(), orderCode);
|
|
|
LOGGER.info("in queryAppraiseAddress get buyerAddress {} orderCode {}, skup {}", buyerAddress, orderCode, skup);
|
|
|
return buyerAddress;
|
|
|
}
|
|
|
|
|
|
private AddressInfo findSellerAddressInfo(Integer uid, Integer skup){
|
|
|
SellerOrderMeta addressMeta = sellerOrderMetaMapper.selectByMetaKey(uid, skup, MetaKey.BACK_2_SELLER_DELIVERY_ADDRESS);
|
|
|
AddressInfo addressInfo = null;
|
|
|
if (null != addressMeta) {
|
|
|
LOGGER.info("addressMeta is not null uid is {}, skup is {}", uid, skup);
|
|
|
try {
|
|
|
addressInfo = JSONObject.parseObject(addressMeta.getMetaValue(), AddressInfo.class);
|
|
|
|
|
|
}catch (Exception ex){
|
|
|
LOGGER.warn("findSellerAddressInfo parse addressMeta fail, uid {} skup {}, addressMeta {}",
|
|
|
uid, skup, addressMeta, ex);
|
|
|
}
|
|
|
}
|
|
|
return addressInfo;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据用户默认地址的省份定位到鉴定中心的地址返回 *
|
|
|
*
|
...
|
...
|
@@ -996,16 +1032,10 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { |
|
|
return appraiseAddressService.queryInitAddress();
|
|
|
}
|
|
|
|
|
|
BuyerOrder buyerOrder = null;
|
|
|
if (orderCodeIsNull){
|
|
|
//4 compatible before version 6.9.3(exclude), client transfer without order code
|
|
|
buyerOrder = findOrderCodeBySkup(skup);
|
|
|
orderCode = buyerOrder.getOrderCode();
|
|
|
LOGGER.info("in queryAppraiseAddress find buyer OrderCode By Skup , orderCode {} skup {}", orderCode, skup);
|
|
|
}
|
|
|
buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
|
|
AddressInfo buyerAddress = buyerOrderMetaService.getAddressInfo(buyerOrder.getUid(), orderCode);
|
|
|
LOGGER.info("in queryAppraiseAddress get buyerAddress {} orderCode {}, skup {}", buyerAddress, orderCode, skup);
|
|
|
|
|
|
AddressInfo buyerAddress = findSellerAddressInfo(uid, skup);
|
|
|
|
|
|
LOGGER.info("in queryAppraiseAddress get Address {} orderCode {}, skup {}", buyerAddress, orderCode, skup);
|
|
|
|
|
|
// 根据用户id查询默认地址的省份
|
|
|
AppraiseAddressResp resp = null;
|
...
|
...
|
|