Authored by mali

寄存列表兼容

... ... @@ -123,13 +123,7 @@ public class DepositOrderService {
GoodsInfo goodsInfo = getGoodsInfo(storageDeposit); // 查询购买商品的详细信息
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
AddressInfo addressInfo = null;
if (OrderCodeType.BUYER_TYPE.getType() == codeMeta.getType()) {
addressInfo = buyerOrderMetaService.getHiddenAddressInfo(req.getUid(), orderCode); // 获取用户的地址
} else {
addressInfo = appraiseOrderMetaService.getHidderUserAddress(orderCode);
}
AddressInfo addressInfo = getAddressInfo(req, orderCode);
addressInfo.setAddress_id_str(AddressUtil.getEncryptStr(String.valueOf(addressInfo.getAddress_id())));// 加密addressId
... ... @@ -142,6 +136,17 @@ public class DepositOrderService {
.userAddress(addressInfo).priceInfo(priceInfo).goodsInfo(goodsInfo).build();
}
private AddressInfo getAddressInfo(DepositOrderComputeReq req, Long orderCode) {
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
AddressInfo addressInfo = null;
if (OrderCodeType.BUYER_TYPE.getType() == codeMeta.getType()) {
addressInfo = buyerOrderMetaService.getHiddenAddressInfo(req.getUid(), orderCode); // 获取用户的地址
} else {
addressInfo = appraiseOrderMetaService.getHidderUserAddress(orderCode);
}
return addressInfo;
}
/**
* 如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.order.bo.DepositProductBo;
... ... @@ -187,6 +188,40 @@ public class DepositHelpService {
}
public Map<Long, List<String>> queryAppraiseOrderStatusEx(Long appraiseOrder) {
if (null == appraiseOrder) {
return Maps.newHashMap();
}
AppraiseOrder appraiseOrders = appraiseOrderMapper.selectByOrderCode(appraiseOrder);
if(null == appraiseOrders) {
return Maps.newHashMap();
}
String statusStrByCode = AppraiseOrderStatus.getStatusStrByCode(appraiseOrders.getStatus());
Map<Long,List<String>> result = Maps.newHashMap();
result.put(appraiseOrder, Lists.newArrayList(statusStrByCode, getAppaiseOrderStatusDesc(appraiseOrders.getStatus())));
return result;
}
public String getAppaiseOrderStatusDesc(Integer status) {
switch (status) {
case 23:
return "您的商品无法鉴定,保证金已退还,平台将在1-3个工作日内寄回,请留意物流动态";
case 13:
return "您的商品鉴定未通过,保证金已扣除,平台将在1-3个工作日内到付寄回,请留意物流动态";
case 20:
return "商品质检未通过,保证金已赔付给买家,平台将在1-3个工作日内到付寄回,请留意物流动态";
default:
return "";
}
}
public AppraiseOrder queryAppraiseOrderInfo(Long orderCode) {
if (null == orderCode) {
return null;
... ...
... ... @@ -527,14 +527,16 @@ public class DepositServiceImpl implements DepositService {
.depositCode(storageDeposit.getDepositCode())
.skup(storageDeposit.getSkup())
.status(storageDeposit.getStatus())
.ownerUid(storageDeposit.getOwnerUid())
.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus()))
.depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus()));
.ownerUid(storageDeposit.getOwnerUid());
if (DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(storageDeposit.getOutType())) { // 如果是寄存订单,寄回的商品,则需要查询状态
Map<Long, String> orderStatusStr = depositHelpService.queryAppraiseOrderStatus(Lists.newArrayList(storageDeposit.getOrderCode()));
Map<Long, List<String>> orderStatusStr = depositHelpService.queryAppraiseOrderStatusEx(storageDeposit.getOrderCode());
depositDetailBoBuilder.depositStatusName(orderStatusStr.get(storageDeposit.getOrderCode()));
depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "")
.depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "");
} else { // 正常的买家订单召回
depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus()))
.depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus()));
}
return depositDetailBoBuilder.build();
... ...