Authored by LUOXC

fix bug

... ... @@ -51,7 +51,8 @@ public class SellerWalletDetail {
MINI_FAULT_REJECT("瑕疵确认不接受", 35),
BUYER_CANCEL_NO_DELIVERY("买家取消(无物流)", 41),
BUYER_CANCEL_DELIVERY("买家取消(有物流)", 42),
APPRAISE_OK("鉴定通过", 51),
APPRAISE_OK("鉴定通过", 51),
APPRAISE_UNSURE("商品无法鉴定", 52),
MERCHANT_EXIT("商家退出入驻", 61);
private String name;
... ...
... ... @@ -873,6 +873,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
} else if (type == SellerWalletDetail.Type.SELLER_OFF
|| type == SellerWalletDetail.Type.SYSTEM_OFF
|| type == SellerWalletDetail.Type.APPRAISE_OK
|| type == SellerWalletDetail.Type.APPRAISE_UNSURE
|| type == SellerWalletDetail.Type.BUYER_CANCEL_DELIVERY
|| type == SellerWalletDetail.Type.BUYER_CANCEL_NO_DELIVERY) {
// 增加保证金
... ...
... ... @@ -3,7 +3,6 @@ package com.yohoufo.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.google.common.collect.Range;
import com.yoho.core.rabbitmq.YhProducer;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
... ... @@ -52,12 +51,9 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
... ... @@ -1427,9 +1423,14 @@ public class AppraiseService {
// 有货平台鉴定中 -> 已取消:商品无法鉴定
.withStateTransition(OrderStatus.PLATFORM_CHECKING, OrderStatus.PLATFORM_APPRAISE_UNSURE, orderStatusFlowService)
// 退保证金给卖家
.withRefundEarnestMoney(payRefundService::refund, sellerOrderMapper::selectBySkup).refundCase(RefundCase.SELLER_EARNEST_MONEY).and()
.withRefundEarnestMoney(payRefundService::refund, sellerOrderMapper::selectBySkup)
.refundCase(RefundCase.SELLER_EARNEST_MONEY)
.sellerWalletDetailType(SellerWalletDetail.Type.APPRAISE_UNSURE)
.and()
// 退买家货款
.withRefundGoodsMoney(payRefundService::refund).refundCase(RefundCase.BUYER_GOODS_MONEY).and()
.withRefundGoodsMoney(payRefundService::refund)
.refundCase(RefundCase.BUYER_GOODS_MONEY)
.and()
// 通知卖家商品无法鉴定
.withNoticeSeller((soa, code) -> inBoxFacade.noticeSellerAppraiseUnsure(soa, code)).and()
// 通知买家商品无法鉴定(并发券)
... ...
... ... @@ -6,6 +6,7 @@ import com.google.common.base.Verify;
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohoufo.common.alarm.EventBusPublisher;
... ... @@ -308,6 +309,7 @@ class BuyerOrderCancelHandler {
.refundCase(refundEarnestMoney.refundCase())
.orderCode(sellerOrder.getOrderCode())
.refundAmount(earnestMoney.doubleValue())
.refundattch(MerchantOrderAttachInfo.builder().type(refundEarnestMoney.sellerWalletDetailType.getValue()).build())
.build();
val billLogEventBuilder = BillLogEvent.builder()
.buyerUid(uid)
... ... @@ -407,6 +409,7 @@ class BuyerOrderCancelHandler {
private final BiConsumer<PaymentRequest, BillLogEvent.BillLogEventBuilder> refundConsumer;
private final Function<Integer, SellerOrder> sellerOrderFunction;
private RefundCase refundCase;
private SellerWalletDetail.Type sellerWalletDetailType;
BuyerOrderCancelHandler and() {
BuyerOrderCancelHandler.this.refundEarnestMoney = this;
... ...