Authored by mali

寄存二期

@@ -193,7 +193,8 @@ public class DepositController { @@ -193,7 +193,8 @@ public class DepositController {
193 } 193 }
194 194
195 /** 195 /**
196 - * 仓库管理详情,几个尺码 几个库存接口 196 + * 仓库记录删除接口
  197 + * http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/?debug=XYZ&method=ufo.deposit.delUserDoposit&uid=500031974&deposit_code=56257845
197 * @param uid 198 * @param uid
198 * @param productId 199 * @param productId
199 * @return 200 * @return
@@ -41,6 +41,7 @@ public class DepositOrderController { @@ -41,6 +41,7 @@ public class DepositOrderController {
41 * @return 41 * @return
42 * @throws GatewayException 42 * @throws GatewayException
43 * http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/?debug=XYZ&method=ufo.deposit.computeRecall&uid=500031974&deposit_code=56257845&address_id=JJK1Ry05yFHv+DIkz2ti3A== 43 * http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/?debug=XYZ&method=ufo.deposit.computeRecall&uid=500031974&deposit_code=56257845&address_id=JJK1Ry05yFHv+DIkz2ti3A==
  44 + * http://2.yohobuy.com/?debug=XYZ&method=ufo.deposit.computeRecall&uid=71717581&deposit_code=10001681&address_id=ehhofW1zocg9YHQaYeyfWQ==
44 */ 45 */
45 @RequestMapping(params = "method=ufo.deposit.computeRecall") 46 @RequestMapping(params = "method=ufo.deposit.computeRecall")
46 @ResponseBody 47 @ResponseBody
@@ -7,10 +7,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo; @@ -7,10 +7,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
7 import com.yohobuy.ufo.model.order.bo.DepositDetailBo; 7 import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
8 import com.yohobuy.ufo.model.order.bo.DepositFee; 8 import com.yohobuy.ufo.model.order.bo.DepositFee;
9 import com.yohobuy.ufo.model.order.bo.GoodsInfo; 9 import com.yohobuy.ufo.model.order.bo.GoodsInfo;
10 -import com.yohobuy.ufo.model.order.common.EnumExpressType;  
11 -import com.yohobuy.ufo.model.order.common.OrderCodeType;  
12 -import com.yohobuy.ufo.model.order.common.OrderStatus;  
13 -import com.yohobuy.ufo.model.order.common.TabType; 10 +import com.yohobuy.ufo.model.order.common.*;
14 import com.yohobuy.ufo.model.order.constants.DepositEventTypeEnum; 11 import com.yohobuy.ufo.model.order.constants.DepositEventTypeEnum;
15 import com.yohobuy.ufo.model.order.constants.OrderConstant; 12 import com.yohobuy.ufo.model.order.constants.OrderConstant;
16 import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum; 13 import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
@@ -34,6 +31,7 @@ import com.yohoufo.order.service.IBuyerOrderService; @@ -34,6 +31,7 @@ import com.yohoufo.order.service.IBuyerOrderService;
34 import com.yohoufo.order.service.IExpressInfoService; 31 import com.yohoufo.order.service.IExpressInfoService;
35 import com.yohoufo.order.service.impl.DepositHelpService; 32 import com.yohoufo.order.service.impl.DepositHelpService;
36 import com.yohoufo.order.service.impl.MetaConfigService; 33 import com.yohoufo.order.service.impl.MetaConfigService;
  34 +import com.yohoufo.order.service.seller.SellerOrderCancelService;
37 import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator; 35 import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
38 import org.apache.commons.collections.CollectionUtils; 36 import org.apache.commons.collections.CollectionUtils;
39 import org.apache.commons.lang3.StringUtils; 37 import org.apache.commons.lang3.StringUtils;
@@ -92,6 +90,9 @@ public class DepositOrderService { @@ -92,6 +90,9 @@ public class DepositOrderService {
92 @Autowired 90 @Autowired
93 private DepositHelpService depositHelpService; 91 private DepositHelpService depositHelpService;
94 92
  93 + @Autowired
  94 + private SellerOrderCancelService sellerOrderCancelService;
  95 +
95 /** 96 /**
96 * 根据库存货号,计算需要召回的费用 97 * 根据库存货号,计算需要召回的费用
97 * @param req 98 * @param req
@@ -101,6 +102,8 @@ public class DepositOrderService { @@ -101,6 +102,8 @@ public class DepositOrderService {
101 StorageDeposit storageDeposit = checkStorageDeposit(req, 102 StorageDeposit storageDeposit = checkStorageDeposit(req,
102 Lists.newArrayList(StorageDepositStatusEnum.HAS_IN.getCode())); // 不存在的时候有异常 103 Lists.newArrayList(StorageDepositStatusEnum.HAS_IN.getCode())); // 不存在的时候有异常
103 104
  105 + cancelSellerOrderBySkup(storageDeposit, storageDeposit.getNewSkup());//如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
  106 +
104 int depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode()); // 还可存放多久 单位天 107 int depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode()); // 还可存放多久 单位天
105 108
106 Integer skup = storageDeposit.getSkup(); 109 Integer skup = storageDeposit.getSkup();
@@ -122,6 +125,19 @@ public class DepositOrderService { @@ -122,6 +125,19 @@ public class DepositOrderService {
122 } 125 }
123 126
124 127
  128 + /**
  129 + * 如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
  130 + * @param newSkup 库存上架后的新产生的SKUP
  131 + */
  132 + private void cancelSellerOrderBySkup(StorageDeposit storageDeposit, Integer newSkup) {
  133 + LOG.info("DepositOrderService.cancelSellerOrderBySkup excute; newSkup is {} storageDeposit : {}", newSkup, storageDeposit);
  134 + if (null != newSkup && 0 != newSkup && SkupStatus.CAN_SELL.getCode() == storageDeposit.getOrderStatus()) {
  135 + int result = sellerOrderCancelService.cancelSellerOrderBySkup(storageDeposit.getOwnerUid(), newSkup);
  136 + if (result == 0) {
  137 + throw new UfoServiceException(400, "该商品已被下单,不能召回商品");
  138 + }
  139 + }
  140 + }
125 141
126 142
127 public OrderSubmitResponse publishDepositOrder(DepositOrderComputeReq req) { 143 public OrderSubmitResponse publishDepositOrder(DepositOrderComputeReq req) {
@@ -77,6 +77,11 @@ consumer: @@ -77,6 +77,11 @@ consumer:
77 topic: order.hkAmountWaitPayment 77 topic: order.hkAmountWaitPayment
78 ratelimit: 20 78 ratelimit: 20
79 79
  80 + # 召回订单,库存记录状态变更为已完成
  81 + - class: com.yohoufo.order.mq.consumer.DepositFinishDeliveryDelayMsgConsumer
  82 + topic: deposit.finishDelivery
  83 + delay:
  84 + interval: 10080
80 85
81 - address: ${rabbit_ufo} 86 - address: ${rabbit_ufo}
82 username: ${rabbit_ufo_user} 87 username: ${rabbit_ufo_user}