Authored by mali

获取订单地址,兼容鉴定订单

1 package com.yohoufo.order.service.deposit; 1 package com.yohoufo.order.service.deposit;
2 2
  3 +import com.alibaba.fastjson.JSONObject;
3 import com.google.common.collect.Lists; 4 import com.google.common.collect.Lists;
4 import com.yoho.error.ServiceError; 5 import com.yoho.error.ServiceError;
5 import com.yoho.error.exception.ServiceException; 6 import com.yoho.error.exception.ServiceException;
@@ -19,6 +20,7 @@ import com.yohoufo.common.exception.UfoServiceException; @@ -19,6 +20,7 @@ import com.yohoufo.common.exception.UfoServiceException;
19 import com.yohoufo.common.utils.*; 20 import com.yohoufo.common.utils.*;
20 import com.yohoufo.dal.order.*; 21 import com.yohoufo.dal.order.*;
21 import com.yohoufo.dal.order.model.*; 22 import com.yohoufo.dal.order.model.*;
  23 +import com.yohoufo.order.constants.MetaKey;
22 import com.yohoufo.order.controller.DepositOrderController; 24 import com.yohoufo.order.controller.DepositOrderController;
23 import com.yohoufo.order.convert.GoodsInfoConvertor; 25 import com.yohoufo.order.convert.GoodsInfoConvertor;
24 import com.yohoufo.order.model.response.AppraiseAddressResp; 26 import com.yohoufo.order.model.response.AppraiseAddressResp;
@@ -30,7 +32,9 @@ import com.yohoufo.order.service.IExpressInfoService; @@ -30,7 +32,9 @@ import com.yohoufo.order.service.IExpressInfoService;
30 import com.yohoufo.order.service.impl.DepositHelpService; 32 import com.yohoufo.order.service.impl.DepositHelpService;
31 import com.yohoufo.order.service.impl.MetaConfigService; 33 import com.yohoufo.order.service.impl.MetaConfigService;
32 import com.yohoufo.order.service.seller.SellerOrderCancelService; 34 import com.yohoufo.order.service.seller.SellerOrderCancelService;
  35 +import com.yohoufo.order.service.seller.deposit.AppraiseOrderMetaService;
33 import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator; 36 import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
  37 +import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
34 import org.apache.commons.collections.CollectionUtils; 38 import org.apache.commons.collections.CollectionUtils;
35 import org.apache.commons.lang3.StringUtils; 39 import org.apache.commons.lang3.StringUtils;
36 import org.slf4j.Logger; 40 import org.slf4j.Logger;
@@ -97,6 +101,9 @@ public class DepositOrderService { @@ -97,6 +101,9 @@ public class DepositOrderService {
97 @Autowired 101 @Autowired
98 private AppraiseOrderStorageMapper appraiseOrderStorageMapper; 102 private AppraiseOrderStorageMapper appraiseOrderStorageMapper;
99 103
  104 + @Autowired
  105 + private AppraiseOrderMetaService appraiseOrderMetaService;
  106 +
100 /** 107 /**
101 * 根据库存货号,计算需要召回的费用 108 * 根据库存货号,计算需要召回的费用
102 * @param req 109 * @param req
@@ -115,7 +122,14 @@ public class DepositOrderService { @@ -115,7 +122,14 @@ public class DepositOrderService {
115 122
116 GoodsInfo goodsInfo = getGoodsInfo(storageDeposit); // 查询购买商品的详细信息 123 GoodsInfo goodsInfo = getGoodsInfo(storageDeposit); // 查询购买商品的详细信息
117 124
118 - AddressInfo addressInfo = buyerOrderMetaService.getHiddenAddressInfo(req.getUid(), orderCode); // 获取用户的地址 125 +
  126 + CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
  127 + AddressInfo addressInfo = null;
  128 + if (OrderCodeType.BUYER_TYPE.getType() == codeMeta.getType()) {
  129 + addressInfo = buyerOrderMetaService.getHiddenAddressInfo(req.getUid(), orderCode); // 获取用户的地址
  130 + } else {
  131 + addressInfo = appraiseOrderMetaService.getHidderUserAddress(orderCode);
  132 + }
119 133
120 addressInfo.setAddress_id_str(AddressUtil.getEncryptStr(String.valueOf(addressInfo.getAddress_id())));// 加密addressId 134 addressInfo.setAddress_id_str(AddressUtil.getEncryptStr(String.valueOf(addressInfo.getAddress_id())));// 加密addressId
121 135