Authored by mali

寄存二期

... ... @@ -193,7 +193,8 @@ public class DepositController {
}
/**
* 仓库管理详情,几个尺码 几个库存接口
* 仓库记录删除接口
* http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/?debug=XYZ&method=ufo.deposit.delUserDoposit&uid=500031974&deposit_code=56257845
* @param uid
* @param productId
* @return
... ...
... ... @@ -41,6 +41,7 @@ public class DepositOrderController {
* @return
* @throws GatewayException
* 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==
* http://2.yohobuy.com/?debug=XYZ&method=ufo.deposit.computeRecall&uid=71717581&deposit_code=10001681&address_id=ehhofW1zocg9YHQaYeyfWQ==
*/
@RequestMapping(params = "method=ufo.deposit.computeRecall")
@ResponseBody
... ...
... ... @@ -7,10 +7,7 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.DepositDetailBo;
import com.yohobuy.ufo.model.order.bo.DepositFee;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.common.EnumExpressType;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.common.*;
import com.yohobuy.ufo.model.order.constants.DepositEventTypeEnum;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
... ... @@ -34,6 +31,7 @@ import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.IExpressInfoService;
import com.yohoufo.order.service.impl.DepositHelpService;
import com.yohoufo.order.service.impl.MetaConfigService;
import com.yohoufo.order.service.seller.SellerOrderCancelService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -92,6 +90,9 @@ public class DepositOrderService {
@Autowired
private DepositHelpService depositHelpService;
@Autowired
private SellerOrderCancelService sellerOrderCancelService;
/**
* 根据库存货号,计算需要召回的费用
* @param req
... ... @@ -101,6 +102,8 @@ public class DepositOrderService {
StorageDeposit storageDeposit = checkStorageDeposit(req,
Lists.newArrayList(StorageDepositStatusEnum.HAS_IN.getCode())); // 不存在的时候有异常
cancelSellerOrderBySkup(storageDeposit, storageDeposit.getNewSkup());//如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
int depositRemainDay = depositService.getRemainDay(req.getUid(), req.getDepositCode()); // 还可存放多久 单位天
Integer skup = storageDeposit.getSkup();
... ... @@ -122,6 +125,19 @@ public class DepositOrderService {
}
/**
* 如果关联了新的skup,代表寄存的主人已上架过库存, 需要 下架SKUP
* @param newSkup 库存上架后的新产生的SKUP
*/
private void cancelSellerOrderBySkup(StorageDeposit storageDeposit, Integer newSkup) {
LOG.info("DepositOrderService.cancelSellerOrderBySkup excute; newSkup is {} storageDeposit : {}", newSkup, storageDeposit);
if (null != newSkup && 0 != newSkup && SkupStatus.CAN_SELL.getCode() == storageDeposit.getOrderStatus()) {
int result = sellerOrderCancelService.cancelSellerOrderBySkup(storageDeposit.getOwnerUid(), newSkup);
if (result == 0) {
throw new UfoServiceException(400, "该商品已被下单,不能召回商品");
}
}
}
public OrderSubmitResponse publishDepositOrder(DepositOrderComputeReq req) {
... ...
... ... @@ -77,6 +77,11 @@ consumer:
topic: order.hkAmountWaitPayment
ratelimit: 20
# 召回订单,库存记录状态变更为已完成
- class: com.yohoufo.order.mq.consumer.DepositFinishDeliveryDelayMsgConsumer
topic: deposit.finishDelivery
delay:
interval: 10080
- address: ${rabbit_ufo}
username: ${rabbit_ufo_user}
... ...