Authored by mali

Merge branch 'test6.9.8' into gray

... ... @@ -172,6 +172,11 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
return result;
}
/**
* 闪购寄存
* @param buyerOrder
* @param sellerOrderGoods
*/
private void processDepositOrderOfQuickDeliverGoods(BuyerOrder buyerOrder, SellerOrderGoods sellerOrderGoods){
Integer buyerUid = buyerOrder.getUid();
Long orderCode = buyerOrder.getOrderCode();
... ...
... ... @@ -623,7 +623,7 @@ public class AppraiseService {
//记录操作记录
orderOperateRecordService.addRecord(orderCode, "买家操作", OperateTypeEnum.OPERATE_TYPE_QUALITY_MINI_FAULT_PASS);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods, true);
} else {
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE); // 更新失败,可能是因为订单状态已经被并发修改
}
... ... @@ -1289,7 +1289,7 @@ public class AppraiseService {
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
//TODO 鉴定通过,
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods, true);
if(isDepositOfInStockGoods){
Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
buyerNoticeFacade.noticeBuyerWhenDepositOrderOfInstockPass(buyerUid, orderCode, sellerOrderGoods, product);
... ... @@ -1438,7 +1438,7 @@ public class AppraiseService {
//平台已发货给买家
buyerNoticeFacade.appraisePassAndDeliveryGoodsToBuyer(buyerOrder, sellerOrderGoods);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sellerOrderGoods, true);
} catch (Exception ex) {
LOGGER.warn("in appraiseSuccess,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex);
String content = "鉴定通过时,订单" + orderCode + "退还保证金失败";
... ...
... ... @@ -1090,12 +1090,12 @@ public class InBoxFacade extends BaseNoticeFacade{
public void noticeWhenQuickDeliverOrderPaid(int buyerUid, long orderCode, SellerOrderGoods sog) {
buyerNoticeFacade.quickDeliverOrderPaid(buyerUid, orderCode, sog);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog, false);
}
public void noticeWhenDepositOrderOfQuickDeliverGoodsPaid(int buyerUid, long orderCode, SellerOrderGoods sog) {
buyerNoticeFacade.quickDeliverDepositGoodsPaid(buyerUid, orderCode, sog);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog);
sellerNoticeFacade.appraisePass(buyerUid, orderCode, sog, false);
}
// 召回的
... ...
... ... @@ -2,17 +2,20 @@ package com.yohoufo.order.service.proxy;
import com.yoho.message.sdk.service.ufo.IUFOSendService;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.model.Product;
import lombok.NonNull;
import com.yohoufo.inboxclient.model.InboxReqVO;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Optional;
import java.util.function.Supplier;
@Service
@Slf4j(topic = "SellerNoticeFacade")
... ... @@ -34,7 +37,7 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
*
* @param orderCode
*/
public void appraisePass(int buyerUid, long orderCode, SellerOrderGoods psog) {
public void appraisePass(int buyerUid, long orderCode, SellerOrderGoods psog, boolean withEarnMoney) {
try {
Integer sellerUid = psog.getUid();
newNotice(sellerUid)
... ... @@ -44,8 +47,12 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
String sizeName = psog.getSizeName();
String goodsTypeType = buildGoodsTypeTagForSeller(psog);
return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS, goodsTypeType, prdName, sizeName, productCode);
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
String earnMoneyPlacehold = "";
if (withEarnMoney){
earnMoneyPlacehold = "保证金已退还,";
}
return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, prdName, sizeName, productCode, earnMoneyPlacehold);
})
.withSms(() -> {
String goodsTypeType = buildGoodsTypeTagForSeller(psog);
... ... @@ -208,7 +215,25 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
}
public void noticeSellerWhenPlatformOffShelve(SellerOrderGoods psog){
//SALE_NOTIFIED_UNSHELF_4_QUICK_DELIVER
// SMS_SMS_NOTIFIED_UNSHELF
Integer sellerUid = psog.getUid();
String prdName = psog.getProductName();
String sizeName = psog.getSizeName();
try {
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
String skupTypeText=SkupType.getSkupType(psog.getAttributes()).attrName();
String productCode = product.getProductCode();
Supplier<InboxReqVO> inboxSupplier = ()->buildInboxContent(InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF_4_QUICK_DELIVER, skupTypeText, prdName, sizeName, productCode);
Supplier<String> smsSupplier = ()->buildSmsContent(InboxBusinessTypeEnum.SMS_SMS_NOTIFIED_UNSHELF, skupTypeText,prdName,sizeName,productCode);
newNotice(psog.getUid())
.withLogPrefix("notice Seller When Platform Off-Shelve")
.withInBox(inboxSupplier)
.withSms(smsSupplier)
.send();
} catch (Exception e) {
log.warn("noticeSellerWhenPlatformOffShelve fail, sellerUid {}, prdName {} ,sizeName {} ", sellerUid, prdName, sizeName, e);
}
}
}
... ...
... ... @@ -750,7 +750,7 @@ public class SellerOrderCancelService {
SellerOrderGoods psog = cpn.psog;
Integer sellerUid = psog.getUid();
if (cpn.isQuickDeliver){
//TODO notice seller
// notice seller
sellerNoticeFacade.noticeSellerWhenPlatformOffShelve(psog);
}else {
inBoxFacade.notifyUnshelfCauseBySpecialReason(sellerUid, psog);
... ...