Authored by mali

寄存列表兼容

@@ -123,13 +123,7 @@ public class DepositOrderService { @@ -123,13 +123,7 @@ public class DepositOrderService {
123 GoodsInfo goodsInfo = getGoodsInfo(storageDeposit); // 查询购买商品的详细信息 123 GoodsInfo goodsInfo = getGoodsInfo(storageDeposit); // 查询购买商品的详细信息
124 124
125 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 - } 126 + AddressInfo addressInfo = getAddressInfo(req, orderCode);
133 127
134 addressInfo.setAddress_id_str(AddressUtil.getEncryptStr(String.valueOf(addressInfo.getAddress_id())));// 加密addressId 128 addressInfo.setAddress_id_str(AddressUtil.getEncryptStr(String.valueOf(addressInfo.getAddress_id())));// 加密addressId
135 129
@@ -142,6 +136,17 @@ public class DepositOrderService { @@ -142,6 +136,17 @@ public class DepositOrderService {
142 .userAddress(addressInfo).priceInfo(priceInfo).goodsInfo(goodsInfo).build(); 136 .userAddress(addressInfo).priceInfo(priceInfo).goodsInfo(goodsInfo).build();
143 } 137 }
144 138
  139 + private AddressInfo getAddressInfo(DepositOrderComputeReq req, Long orderCode) {
  140 + CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
  141 + AddressInfo addressInfo = null;
  142 + if (OrderCodeType.BUYER_TYPE.getType() == codeMeta.getType()) {
  143 + addressInfo = buyerOrderMetaService.getHiddenAddressInfo(req.getUid(), orderCode); // 获取用户的地址
  144 + } else {
  145 + addressInfo = appraiseOrderMetaService.getHidderUserAddress(orderCode);
  146 + }
  147 + return addressInfo;
  148 + }
  149 +
145 150
146 /** 151 /**
147 * 如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP 152 * 如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
1 package com.yohoufo.order.service.impl; 1 package com.yohoufo.order.service.impl;
2 2
  3 +import com.google.common.collect.Lists;
3 import com.google.common.collect.Maps; 4 import com.google.common.collect.Maps;
4 import com.yohobuy.ufo.model.ProductInfo; 5 import com.yohobuy.ufo.model.ProductInfo;
5 import com.yohobuy.ufo.model.order.bo.DepositProductBo; 6 import com.yohobuy.ufo.model.order.bo.DepositProductBo;
@@ -187,6 +188,40 @@ public class DepositHelpService { @@ -187,6 +188,40 @@ public class DepositHelpService {
187 } 188 }
188 189
189 190
  191 + public Map<Long, List<String>> queryAppraiseOrderStatusEx(Long appraiseOrder) {
  192 + if (null == appraiseOrder) {
  193 + return Maps.newHashMap();
  194 + }
  195 +
  196 + AppraiseOrder appraiseOrders = appraiseOrderMapper.selectByOrderCode(appraiseOrder);
  197 + if(null == appraiseOrders) {
  198 + return Maps.newHashMap();
  199 + }
  200 +
  201 + String statusStrByCode = AppraiseOrderStatus.getStatusStrByCode(appraiseOrders.getStatus());
  202 +
  203 +
  204 + Map<Long,List<String>> result = Maps.newHashMap();
  205 + result.put(appraiseOrder, Lists.newArrayList(statusStrByCode, getAppaiseOrderStatusDesc(appraiseOrders.getStatus())));
  206 +
  207 +
  208 + return result;
  209 + }
  210 +
  211 + public String getAppaiseOrderStatusDesc(Integer status) {
  212 + switch (status) {
  213 + case 23:
  214 + return "您的商品无法鉴定,保证金已退还,平台将在1-3个工作日内寄回,请留意物流动态";
  215 + case 13:
  216 + return "您的商品鉴定未通过,保证金已扣除,平台将在1-3个工作日内到付寄回,请留意物流动态";
  217 + case 20:
  218 + return "商品质检未通过,保证金已赔付给买家,平台将在1-3个工作日内到付寄回,请留意物流动态";
  219 + default:
  220 + return "";
  221 + }
  222 + }
  223 +
  224 +
190 public AppraiseOrder queryAppraiseOrderInfo(Long orderCode) { 225 public AppraiseOrder queryAppraiseOrderInfo(Long orderCode) {
191 if (null == orderCode) { 226 if (null == orderCode) {
192 return null; 227 return null;
@@ -527,14 +527,16 @@ public class DepositServiceImpl implements DepositService { @@ -527,14 +527,16 @@ public class DepositServiceImpl implements DepositService {
527 .depositCode(storageDeposit.getDepositCode()) 527 .depositCode(storageDeposit.getDepositCode())
528 .skup(storageDeposit.getSkup()) 528 .skup(storageDeposit.getSkup())
529 .status(storageDeposit.getStatus()) 529 .status(storageDeposit.getStatus())
530 - .ownerUid(storageDeposit.getOwnerUid())  
531 - .depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus()))  
532 - .depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus())); 530 + .ownerUid(storageDeposit.getOwnerUid());
533 531
534 if (DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(storageDeposit.getOutType())) { // 如果是寄存订单,寄回的商品,则需要查询状态 532 if (DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(storageDeposit.getOutType())) { // 如果是寄存订单,寄回的商品,则需要查询状态
535 - Map<Long, String> orderStatusStr = depositHelpService.queryAppraiseOrderStatus(Lists.newArrayList(storageDeposit.getOrderCode())); 533 + Map<Long, List<String>> orderStatusStr = depositHelpService.queryAppraiseOrderStatusEx(storageDeposit.getOrderCode());
536 534
537 - depositDetailBoBuilder.depositStatusName(orderStatusStr.get(storageDeposit.getOrderCode())); 535 + depositDetailBoBuilder.depositStatusName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(0) : "")
  536 + .depositDescName(CollectionUtils.isNotEmpty(orderStatusStr.get(storageDeposit.getOrderCode())) ? orderStatusStr.get(storageDeposit.getOrderCode()).get(1) : "");
  537 + } else { // 正常的买家订单召回
  538 + depositDetailBoBuilder.depositStatusName(StorageDepositStatusEnum.getAppStatusNameByCode(storageDeposit.getStatus()))
  539 + .depositDescName(StorageDepositStatusEnum.getAppStatusDescByCode(storageDeposit.getStatus()));
538 } 540 }
539 541
540 return depositDetailBoBuilder.build(); 542 return depositDetailBoBuilder.build();