Authored by LING.TAN

极速

... ... @@ -156,6 +156,9 @@ public class BuyerOrderCancelService {
@Autowired
private BuyerOrderAssistant buyerOrderAssistant;
@Autowired
FastDeliveryProxyService fastDeliveryProxyService;
public int cancel(BeforeSellerDeliverEvent bsdEvent){
int buyerUid = bsdEvent.getBuyerUid();
... ... @@ -354,6 +357,11 @@ public class BuyerOrderCancelService {
}else {
inBoxFacade.buyerCancelBeforeDepotReceive(buyerOrder, penaltyAmount.toPlainString(), psog, useDepositGoods);
}
if (fastDeliveryProxyService.isFastDeliveryGoods(skup)){
fastDeliveryProxyService.cancel(psog.getUid(), skup, true);
}
//整个过程异步去执行(考虑退费依赖订单状态)
//(退费)退保证金给卖家
//(转账)瓜分指定赔偿款给卖家和平台
... ...
... ... @@ -454,9 +454,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
// 恢复product skup的库存
boolean isReturnSuccess = productProxyService.returnStorage(skup);
// 急速发货的场合,释放库存
// 急速发货的场合,取消订单
if (fastDeliveryProxyService.isFastDeliveryGoods(skup)){
fastDeliveryProxyService.cancel(psog.getUid(), skup);
fastDeliveryProxyService.cancel(psog.getUid(), skup, false);
}
//如有用券则退券
... ...
package com.yohoufo.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.enums.StorageCheckEnum;
... ... @@ -11,6 +12,7 @@ import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.*;
import com.yohobuy.ufo.model.order.resp.*;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo;
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
import com.yohobuy.ufo.model.response.ProductDetailResp;
... ... @@ -106,6 +108,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
@Autowired
private TradeBillsMapper tradeBillsMapper;
private static final String ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerburger仓储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"阿津\",\"isUpdate\":\"N\",\"mobile\":\"18121153590\",\"phone\":\"\",\"zipCode\":\"\"}";
private static final String HIDDEN_ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerbur****储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"*津\",\"isUpdate\":\"N\",\"mobile\":\"181****3590\",\"phone\":\"\",\"zipCode\":\"\"}";
/**
* 货款收入
*/
... ... @@ -384,6 +390,10 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
// 上架
List<ProductImportTranItemBo> responseList = Lists.newArrayList();
AddressInfo noHiddenBackAddress = JSONObject.parseObject(ADDRESS_STR, AddressInfo.class);
AddressInfo hiddenBackAddress = JSONObject.parseObject(HIDDEN_ADDRESS_STR, AddressInfo.class);
// 上架的代码(和之前同)
List<FastDeliveryBatchOnShelfResp> shelfResps = Lists.newArrayList();
for(FastDeliveryBatchOnShelfReq.ProductInfo productInfo : req.getProductInfos()){
... ... @@ -406,6 +416,8 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
ImPrdNode node = ImPrdNode.builder().uid(req.getUid())
.sellerWrapper(sellerWrapper)
.storageId(productInfo.getStorageId())
.noHiddenBackAddress(noHiddenBackAddress)
.hiddenBackAddress(hiddenBackAddress)
.salePrice(productInfo.getConvertedPrice())
.storageNum(productInfo.getNum())
.productCode(productInfo.getProductCode())
... ...
... ... @@ -136,7 +136,7 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService {
productProxyService.returnStorage(orderBuilder.getSkup());
if (fastDeliveryProxyService.isFastDeliveryGoods(orderBuilder.getSkup())){
fastDeliveryProxyService.cancel(orderBuilder.getSellerOrderGoods().getUid(), orderBuilder.getSkup());
fastDeliveryProxyService.cancel(orderBuilder.getSellerOrderGoods().getUid(), orderBuilder.getSkup(), false);
}
}catch (Exception ex0){
... ...
... ... @@ -109,9 +109,10 @@ public class FastDeliveryProxyService {
/**
* 取消
* @param skup
* @param needReShelves 是否需要重新上架
* @return
*/
public ApiResponse cancel(int sellerUid, int skup){
public ApiResponse cancel(int sellerUid, int skup, boolean needReShelves){
if (!isOnToThird()){
return new ApiResponse();
}
... ... @@ -123,8 +124,11 @@ public class FastDeliveryProxyService {
}
logger.info("fast delivery cancel, skup {}, url {}", skup, sellerAccessInfo.getUnlockSkupUrl());
JSONObject param = getParam(skup, null, null, sellerAccessInfo.getYhSecret());
param.put("needReShelves", needReShelves);
ApiResponse result = baseServiceCaller.doPost("fast.delivery.cancel", sellerAccessInfo.getUnlockSkupUrl(),
getParam(skup, null, null, sellerAccessInfo.getYhSecret()));
param);
logger.info("fast delivery cancel, skup {}, result {}", skup, result);
return result;
... ...