Authored by Lixiaodi

Merge branch 'test6.9.8' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.8

... ... @@ -132,7 +132,7 @@ public class DepositController {
return new ApiResponse(200, "缓存清除成功!", Boolean.TRUE);
}
@RequestMapping("method=ufo.deposit.clearUserDeposit")
@RequestMapping(params = "method=ufo.deposit.clearUserDeposit")
@IgnoreSignature
@IgnoreSession
public ApiResponse clearUserDeposit(@RequestParam("uid") Integer uid,
... ...
... ... @@ -200,9 +200,13 @@ public class OrderDetailInfo {
* 实付金额
*/
String realPayPrice;
/**
* 仓储费
*/
String depositPrice;
/**
* 闪购服务费
*/
String quickDeliveServicePrice;
}
... ...
... ... @@ -121,12 +121,15 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
OrderStatus targetOrderStatus = OrderStatus.HAS_PAYED;
boolean isQuickDeliver = false;
boolean isDepositWithQuickDeliverGoods = false;
boolean isDerectPass = false;
//门店订单支付后直接完成
if(BuyerOrderUtils.isOffline(orderInfo) ) {
targetOrderStatus = OrderStatus.DONE;
}else if((isQuickDeliver=BuyerOrderUtils.isQuickDeliver(orderInfo.getAttributes()))
|| (isDepositWithQuickDeliverGoods = isDepositWithQuickDeliverGoods(uid, orderCode, orderInfo.getAttributes()))){
targetOrderStatus = OrderStatus.WAITING_RECEIVE;
isDerectPass = true;
}
logger.info("after paid updateOrderStatusPaid uid {} orderCode {} isQuickDeliver {} isDepositWithQuickDeliverGoods {} ",
uid, orderCode, isQuickDeliver, isDepositWithQuickDeliverGoods);
... ... @@ -144,8 +147,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
logger.info("in updateOrderStatusPaid record status change, orderCode {}, status: {}",
orderCode, orderStatusCode);
orderStatusFlowService.addAsy(orderCode, orderStatusCode);
if (isQuickDeliver){
appraiseService.processQuickDeliverOrderAfterPaid(orderCode, uid);
if (isDerectPass){
boolean isDepositRequired = isDepositWithQuickDeliverGoods;
appraiseService.processQuickDeliverOrderAfterPaid(orderCode, uid, isDepositRequired);
}
}
orderInfo.setStatus(orderStatusCode);
... ...
... ... @@ -60,4 +60,11 @@ public interface DepositService {
* @param depositCode
*/
void clearCacheByDepositCode(Integer uid, String depositCode);
/**
* 根据货号查询库存
* @param depositCode
* @return
*/
StorageDeposit selectStorageDeposit(Integer uid, String depositCode);
}
... ...
... ... @@ -1568,7 +1568,7 @@ public class AppraiseService {
}
@Autowired
private DepositService depositService;
public void processQuickDeliverOrderAfterPaid(long orderCode,int uid){
public void processQuickDeliverOrderAfterPaid(long orderCode,int uid, boolean isDeposit){
BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
BuyerOrder pbo = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
try {
... ... @@ -1577,7 +1577,6 @@ public class AppraiseService {
LOGGER.warn("in processQuickDeliverOrderAfterPaid transferGoodsMoneyWhenPass fail orderCode {} uid {}",
orderCode, uid, ex);
}
depositService.changeOwner(pbo.getSellerUid(), pbog.getSkup(), orderCode,uid, false);
depositService.changeOwner(pbo.getSellerUid(), pbog.getSkup(), orderCode,uid, isDeposit);
}
}
... ...
... ... @@ -7,20 +7,25 @@ import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.DepositOrder;
import com.yohoufo.dal.order.model.EntrySellerRechargeOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.StorageDeposit;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.service.AbstractOrderPaymentService;
import com.yohoufo.order.service.DepositService;
import com.yohoufo.order.service.deposit.DepositOrderService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.swing.text.html.Option;
import java.util.Objects;
import java.util.Optional;
@Service
public class DepositOrderPaymentService extends AbstractOrderPaymentService {
... ... @@ -32,6 +37,12 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
@Autowired
private DepositService depositService;
@Autowired
protected InBoxFacade inBoxFacade;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Override
public boolean isTimeoutCancelStatus(OrderInfo orderInfo) {
return false;
... ... @@ -151,6 +162,13 @@ public class DepositOrderPaymentService extends AbstractOrderPaymentService {
if (result != 1) {
logger.error("depositService.changeStorageStatus find wrong, depositCode is {}, result is {}", depositOrder.getDepositCode(), result);
return;
} else {
StorageDeposit deposit = depositService.selectStorageDeposit(depositOrder.getUid(), depositOrder.getDepositCode());
SellerOrderGoods psog = Optional.ofNullable(deposit).map(StorageDeposit::getSkup)
.map(sellerOrderGoodsMapper::selectByPrimaryKey).orElse(null);
inBoxFacade.recallDepositnotify(deposit.getOwnerUid(), psog); // 更新待拣货状态成功后,发通知
}
}
... ...
... ... @@ -378,6 +378,15 @@ public class DepositServiceImpl implements DepositService {
}
/**
* 根据货号查询库存
* @param depositCode
* @return
*/
public StorageDeposit selectStorageDeposit(Integer uid, String depositCode) {
return storageDepositMapper.queryByDepositCode(uid, depositCode);
}
/**
* Do 转 Vo
* @param storageDeposit
* @return
... ...
... ... @@ -283,7 +283,7 @@ public class ShoppingServiceImpl implements IShoppingService {
//急速商品 非寄存
if (!depositChoose && SkupType.QUICK_DELIVER.equals(skupType)){
FeeNRate feeNRate = feeNRateFunc.apply(skupType);
quickDeliverServiceFee = feeNRate.getStorageManagementFee();
quickDeliverServiceFee = feeNRate.getQuickDeliverServiceFee();
}
//现货 or 闪购 商品,且选择了寄存
... ...
... ... @@ -1789,6 +1789,41 @@ public class InBoxFacade {
}
}
// 召回的
public void recallDepositnotify(int uid, SellerOrderGoods sog) {
if (null == sog) {
logger.warn("InBoxFacade recallDepositnotify error SellerOrderGoods is null, uid {}", uid);
return;
}
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
try {
executorService.execute(()->{
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_RECALL;
String paramsOfSeller = buildParams(prdName, sizeName,productCode);
InboxReqVO reqOfSeller = buildInboxReqVO(uid, paramsOfSeller, ibtOfSeller);
InBoxResponse respOfSeller = inBoxSDK.addInbox(reqOfSeller);
logger.info("record recallDepositnotify to seller inbox msg, uid {}, sog {} resp {}",
uid, sog, respOfSeller);
String phone = userProxyService.getMobile(uid);
if (StringUtils.isBlank(phone)){
logger.warn("in recallDepositnotify sms fail, uid {} sog {}", uid, sog);
return;
}
List<String> mobileList = Arrays.asList(phone);
String content= getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFY_SELLER_DEPOSIT_RECALL.getContent(),prdName, sizeName, productCode);
sendSmsService.smsSendByMobile(content,mobileList);
logger.info("record recallDepositnotify inbox sms msg, uid {}, sog {}", uid, sog);
});
} catch (Exception e) {
logger.warn("InBoxFacade recallDepositnotify error inbox msg, uid {}, sog {}", uid, sog, e);
}
}
public InboxReqVO buildInboxReqVO(int uid, String params, InboxBusinessTypeEnum ibt) {
InboxReqVO req = new InboxReqVO();
req.setType(ibt.getType());
... ...
... ... @@ -787,7 +787,7 @@ public class ProductServiceImpl implements ProductService {
}
private void addStorageNum(Integer skup, Integer storageId, Integer num) {
LOGGER.info("修改库存:skup={}, storageId={}, num={}", skup, storageId, num);
/* LOGGER.info("修改库存:skup={}, storageId={}, num={}", skup, storageId, num);
if (storageId == null) {
StoragePrice sp = storagePriceMapper.selectBySkup(skup);
storageId = sp.getStorageId();
... ... @@ -801,7 +801,7 @@ public class ProductServiceImpl implements ProductService {
storageMapper.addStorageNum(storageId, num);
} catch (Exception e) {
LOGGER.error("修改库存出错: skup=" + skup + ", storageId=" + storageId + ", num=" + num + ", find storageId is null", e);
}
}*/
}
private StoragePrice checkSkupCanSale(Integer skup) {
... ...