Authored by LUOXC

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

# Conflicts:
#	order/src/main/java/com/yohoufo/order/service/proxy/SellerNoticeFacade.java
... ... @@ -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 + "退还保证金失败";
... ...
... ... @@ -909,12 +909,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,22 +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 com.yohoufo.inboxclient.model.InBoxResponse;
import com.yohoufo.inboxclient.model.InboxReqVO;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;
@Service
@Slf4j(topic = "SellerNoticeFacade")
... ... @@ -64,7 +62,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)
... ... @@ -75,7 +73,11 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
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 earnMoneyPlacehold = "";
if (withEarnMoney){
earnMoneyPlacehold = "保证金已退还,";
}
return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS, goodsTypeType, prdName, sizeName, productCode,earnMoneyPlacehold);
})
.withSms(() -> {
String goodsTypeType = buildGoodsTypeTagForSeller(psog);
... ... @@ -237,8 +239,26 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
}
}
public void noticeSellerWhenPlatformOffShelve(SellerOrderGoods psog) {
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);
... ...
... ... @@ -6,8 +6,8 @@ import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.bo.ProductInfo;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohobuy.ufo.model.order.common.SellerOrderListType;
import com.yohobuy.ufo.model.order.common.SkupListType;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.QuickDeliverOrderSubmitReq;
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
import com.yohobuy.ufo.model.order.resp.PageResp;
... ... @@ -34,7 +34,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
... ... @@ -198,15 +197,11 @@ public class QuickDeliverGoodsService {
return respBuilder.build();
}
private static final List<Integer> SKUP_TYPE_CODES;
static {
SKUP_TYPE_CODES = new ArrayList<>(1);
SKUP_TYPE_CODES.add(SkupType.QUICK_DELIVER.getCode());
}
public List<Integer> getSkupTypeCodes(){
return SKUP_TYPE_CODES;
return SkupListType.QUICK_DELIVER.getSkupTypeCodes(false);
}
/**
... ...