Authored by wujiexiang

Merge branch 'dev_bid' into test6.9.13

package com.yohoufo.order.event;
import com.yohoufo.common.alarm.Event;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 未支付延时提醒
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BuyerOrderUnpaidDelayReminderEvent extends Event {
private int uid;
private long orderCode;
//剩余小时数
private int remainingHour;
private String topic;
// 用用于重试,发延迟消息
private int delayTime;
}
... ...
... ... @@ -35,4 +35,9 @@ public interface DelayTime {
int MINUTES_120_HOURS = 120 * 60;
int SELLER_DEPOSIT_ORDER_PAY_TIME_LIMIT = 10;
//未支付第一次提醒 12小时后
int BUYER_BID_ORDER_UNPAID_FIRST_REMINDER = 12 * 60;
//未支付第二次提醒 22小时后
int BUYER_BID_ORDER_UNPAID_SECOND_REMINDER = 22 * 60;
}
... ...
... ... @@ -70,4 +70,10 @@ public interface TopicConstants {
String SELLER_DEPOSIT_ORDER_AUTO_CANCEL = "sellerDepositOrder.autoCancel";
/**
* 未支付提醒
*/
String BUYER_ORDER_UNPAID_REMINDER = "buyerOrder.unpaidReminder";
}
... ...
package com.yohoufo.order.mq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rabbitmq.YhConsumer;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.message.sdk.service.ufo.UFOBidMessageService;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.order.event.BuyerOrderUnpaidDelayReminderEvent;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.utils.LoggerUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
import static com.yoho.message.sdk.service.ufo.UFOBidMessageService.Scene.*;
@Component
public class BuyerOrderUnpaidReminderDelayMsgConsumer implements YhConsumer {
private Logger logger = LoggerUtils.getMqConsumerLogger();
@Autowired
private BuyerOrderMapper buyerOrderMapper;
@Autowired
protected BuyerOrderGoodsMapper buyerOrderGoodsMapper;
@Autowired
protected SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
protected ProductMapper productMapper;
@Autowired
protected UFOBidMessageService ufoBidMessageService;
public String getTopic() {
return TopicConstants.BUYER_ORDER_UNPAID_REMINDER;
}
@Override
public void handleMessage(Object message) throws Exception {
logger.info("handle {} message, message is {}.", getTopic(), message);
try {
BuyerOrderUnpaidDelayReminderEvent event = JSONObject.parseObject(message.toString(), BuyerOrderUnpaidDelayReminderEvent.class);
BuyerOrder buyerOrder = findWaitingPayBuyerOrder(event.getUid(), event.getOrderCode());
if (buyerOrder != null) {
messageNotice(event.getRemainingHour(),buyerOrder);
}
logger.info("handle {} message success, message is {}.", getTopic(), message);
} catch (Exception ex) {
logger.warn("handle {} message fail, message is {} ", getTopic(), message, ex);
}
}
private BuyerOrder findWaitingPayBuyerOrder(int uid, long orderCode) {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, uid);
if (buyerOrder == null) {
logger.warn("check orderCode exist, uid is {}, orderCode is {}", uid, orderCode);
throw new ServiceException(ServiceError.ORDER_NULL);
}
OrderStatus expectStatus = OrderStatus.getOrderStatus(buyerOrder.getStatus());
if (expectStatus != OrderStatus.WAITING_PAY) {
logger.info("[{}] order status is {}, not waiting_pay", expectStatus, orderCode);
return null;
}
return buyerOrder;
}
public void messageNotice(int remainingHour,BuyerOrder buyerOrder) {
SellerOrderGoods sellerOrderGoods = findSellerOrderGoods(buyerOrder);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
Product product = findProduct(sellerOrderGoods);
String productCode = product.getProductCode();
Map<String, Object> parameters = new HashMap<>();
parameters.put("productName", prdName);
parameters.put("sizeName", sizeName);
parameters.put("productCode", productCode);
parameters.put("remainingHour", remainingHour);
parameters.put("orderCode", buyerOrder.getOrderCode());
ufoBidMessageService.sendMessage(String.valueOf(buyerOrder.getUid()), UFO_BUYER_BID_PAY_REMINDER, parameters);
}
protected SellerOrderGoods findSellerOrderGoods(BuyerOrder buyerOrder) {
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(buyerOrder.getUid(), buyerOrder.getOrderCode());
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
return sellerOrderGoods;
}
protected Product findProduct(SellerOrderGoods sellerOrderGoods) {
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
return product;
}
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.message.sdk.service.ufo.UFOBidMessageService;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohoufo.common.alarm.EventBusPublisher;
... ... @@ -11,6 +12,10 @@ import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.order.common.Operator;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.model.RequestedStatusChangeBuyerOrder;
... ... @@ -82,6 +87,12 @@ public abstract class AbstractBuyerOrderStateChanger<T extends RequestedStatusCh
@Autowired
protected IPaymentService paymentService;
@Autowired
protected ProductMapper productMapper;
@Autowired
protected UFOBidMessageService ufoBidMessageService;
/**
* 变更
*
... ... @@ -227,6 +238,17 @@ public abstract class AbstractBuyerOrderStateChanger<T extends RequestedStatusCh
return bidOrderMetaBo.getDepositAmount();
}
protected SellerOrderGoods findSellerOrderGoods(BuyerOrder buyerOrder) {
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(buyerOrder.getUid(), buyerOrder.getOrderCode());
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
return sellerOrderGoods;
}
protected Product findProduct(SellerOrderGoods sellerOrderGoods) {
Product product = productMapper.selectByPrimaryKey(sellerOrderGoods.getProductId());
return product;
}
public interface Statement {
void evaluate();
... ...
package com.yohoufo.order.service.handler;
import com.google.common.eventbus.Subscribe;
import com.yohoufo.common.alarm.IEventHandler;
import com.yohoufo.order.event.BuyerOrderUnpaidDelayReminderEvent;
import com.yohoufo.order.mq.producer.TradeMqSender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class BuyerOrderUnpaidDelayReminderEventHandler implements IEventHandler<BuyerOrderUnpaidDelayReminderEvent> {
final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private TradeMqSender tradeMqSender;
@Override
@Subscribe
public void handle(BuyerOrderUnpaidDelayReminderEvent event) {
logger.info("Subscribe Buyer Order Unpaid Delay Reminder Event, event {}", event);
tradeMqSender.send(event.getTopic(), event, event.getDelayTime());
}
}
... ...
package com.yohoufo.order.service.impl.statechange;
import com.google.common.collect.Lists;
import com.yoho.message.sdk.service.ufo.UFOBidMessageService;
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.order.model.PayRefundBo;
import com.yohoufo.order.model.RequestedStatusChangeBuyerOrder;
import com.yohoufo.order.model.request.PaymentRequest;
... ... @@ -14,7 +16,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import static com.yoho.message.sdk.service.ufo.UFOBidMessageService.Scene.*;
import static com.yohobuy.ufo.model.order.common.OrderStatus.*;
import static com.yohoufo.order.common.RefundCase.SELLER_EARNEST_MONEY;
... ... @@ -53,7 +58,8 @@ public class BuyerOrderBidingCancelChanger extends AbstractBuyerOrderStateChange
protected Collection<Statement> afterStatements(RequestedStatusChangeBuyerOrder statusChangeBuyerOrder) {
BuyerOrder buyerOrder = statusChangeBuyerOrder.getBuyerOrder();
//退款
return Lists.newArrayList(() -> refundDeposit(buyerOrder));
return Lists.newArrayList(() -> refundDeposit(buyerOrder),
() -> messageNotice(buyerOrder, statusChangeBuyerOrder.getTargetStatus()));
}
private void refundDeposit(BuyerOrder buyerOrder) {
... ... @@ -79,4 +85,37 @@ public class BuyerOrderBidingCancelChanger extends AbstractBuyerOrderStateChange
OrderStatus targetStatus = statusChangeBuyerOrder.getTargetStatus();
return sourceStatus == BIDING && (targetStatus == BUYER_CLOSE_BID || targetStatus == SYSTEM_CLOSE_BID || targetStatus == PLATFORM_CLOSE_BID);
}
public void messageNotice(BuyerOrder buyerOrder, OrderStatus targetStatus) {
SellerOrderGoods sellerOrderGoods = findSellerOrderGoods(buyerOrder);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
Product product = findProduct(sellerOrderGoods);
String productCode = product.getProductCode();
Map<String, Object> parameters = new HashMap<>();
parameters.put("productName", prdName);
parameters.put("sizeName", sizeName);
parameters.put("productCode", productCode);
parameters.put("orderCode", buyerOrder.getOrderCode());
UFOBidMessageService.Scene scene;
switch (targetStatus) {
case BUYER_CLOSE_BID:
scene = UFO_BUYER_CLOSE_BID;
break;
case SYSTEM_CLOSE_BID:
scene = UFO_SYSTEM_CLOSE_BID;
break;
case PLATFORM_CLOSE_BID:
scene = UFO_PLATFORM_CLOSE_BID;
break;
default:
scene = null;
break;
}
ufoBidMessageService.sendMessage(String.valueOf(buyerOrder.getUid()), scene, parameters);
}
}
... ...
... ... @@ -5,7 +5,10 @@ import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.order.event.BuyerOrderDelayCancelEvent;
import com.yohoufo.order.event.BuyerOrderUnpaidDelayReminderEvent;
import com.yohoufo.order.model.RequestedStatusChangeBuyerOrder;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.mq.TopicConstants;
... ... @@ -13,7 +16,10 @@ import com.yohoufo.order.service.AbstractBuyerOrderStateChanger;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import static com.yoho.message.sdk.service.ufo.UFOBidMessageService.Scene.*;
import static com.yohobuy.ufo.model.order.common.OrderStatus.*;
@Service
... ... @@ -34,7 +40,10 @@ public class BuyerOrderBidingToWaitingPayChanger extends AbstractBuyerOrderState
return Lists.newArrayList(
//发布取消事件
() -> fireAutoCancelAsyncEvent(buyerOrder.getUid(), buyerOrder.getOrderCode())
() -> fireAutoCancelAsyncEvent(buyerOrder.getUid(), buyerOrder.getOrderCode()),
//消息通知
() -> messageNotice(buyerOrder),
() -> fireUnpaidReminderAsyncEvent(buyerOrder.getUid(), buyerOrder.getOrderCode())
);
}
... ... @@ -53,4 +62,40 @@ public class BuyerOrderBidingToWaitingPayChanger extends AbstractBuyerOrderState
.delayTime(DelayTime.BUYER_BID_ORDER_WAITING_PAY).build();
EventBusPublisher.publishEvent(buyerCancelEvent);
}
private void fireUnpaidReminderAsyncEvent(int uid, long orderCode) {
//两次提醒
BuyerOrderUnpaidDelayReminderEvent firstReminderEvent = BuyerOrderUnpaidDelayReminderEvent.builder().uid(uid)
.orderCode(orderCode)
.remainingHour(12)
.topic(TopicConstants.BUYER_ORDER_UNPAID_REMINDER)
.delayTime(DelayTime.BUYER_BID_ORDER_UNPAID_FIRST_REMINDER).build();
EventBusPublisher.publishEvent(firstReminderEvent);
//两次提醒
BuyerOrderUnpaidDelayReminderEvent secondReminderEvent = BuyerOrderUnpaidDelayReminderEvent.builder().uid(uid)
.orderCode(orderCode)
.remainingHour(2)
.topic(TopicConstants.BUYER_ORDER_UNPAID_REMINDER)
.delayTime(DelayTime.BUYER_BID_ORDER_UNPAID_SECOND_REMINDER).build();
EventBusPublisher.publishEvent(secondReminderEvent);
}
public void messageNotice(BuyerOrder buyerOrder) {
SellerOrderGoods sellerOrderGoods = findSellerOrderGoods(buyerOrder);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
Product product = findProduct(sellerOrderGoods);
String productCode = product.getProductCode();
Map<String, Object> parameters = new HashMap<>();
parameters.put("productName", prdName);
parameters.put("sizeName", sizeName);
parameters.put("productCode", productCode);
parameters.put("goodsPrice", sellerOrderGoods.getGoodsPrice().toPlainString());
parameters.put("orderCode", buyerOrder.getOrderCode());
ufoBidMessageService.sendMessage(String.valueOf(buyerOrder.getUid()), UFO_BID_SUCCESS, parameters);
}
}
... ...
... ... @@ -6,8 +6,8 @@ import com.yohobuy.ufo.model.order.constants.ChangePriceStatus;
import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.dal.order.model.BuyerChangePriceRecord;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.BuyerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.event.BuyerOrderDelayCancelEvent;
import com.yohoufo.order.model.RequestedStatusChangeBuyerOrder;
... ... @@ -19,8 +19,11 @@ import com.yohoufo.order.service.IBuyerOrderService;
import com.yohoufo.order.service.impl.BuyerChangePriceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import static com.yoho.message.sdk.service.ufo.UFOBidMessageService.Scene.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* 支付定金完成
... ... @@ -41,14 +44,17 @@ public class BuyerOrderPayDepositSuccessChanger extends AbstractBuyerOrderStateC
BuyerOrder buyerOrder = statusChangeBuyerOrder.getBuyerOrder();
int uid = buyerOrder.getUid();
long orderCode = buyerOrder.getOrderCode();
SellerOrderGoods sellerOrderGoods = findSellerOrderGoods(buyerOrder);
return Lists.newArrayList(
//如果调价订单,则需要取消源订单、修改记录表状态
() -> processIfExistChangePriceRecord(uid, orderCode),
//同步skup
() -> syncSkup(uid, orderCode),
() -> syncSkup(uid, sellerOrderGoods),
//未变现取消事件
() -> fireAutoCancelAsyncEvent(buyerOrder)
);
() -> fireAutoCancelAsyncEvent(buyerOrder),
//消息通知
() -> messageNotice(uid, sellerOrderGoods)
);
}
@Override
... ... @@ -89,11 +95,9 @@ public class BuyerOrderPayDepositSuccessChanger extends AbstractBuyerOrderStateC
* 求购skup发布,卖家可以变现
*
* @param uid
* @param orderCode
* @param sellerOrderGoods
*/
private void syncSkup(int uid, long orderCode) {
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(uid, orderCode);
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
private void syncSkup(int uid, SellerOrderGoods sellerOrderGoods) {
bidProductProxyService.createSkup(uid, sellerOrderGoods);
logger.info("[{}] bid skup was sync success", sellerOrderGoods.getId());
}
... ... @@ -109,4 +113,17 @@ public class BuyerOrderPayDepositSuccessChanger extends AbstractBuyerOrderStateC
.delayTime(day * 24 * 60).build();
EventBusPublisher.publishEvent(buyerCancelEvent);
}
private void messageNotice(int uid, SellerOrderGoods sellerOrderGoods) {
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
Product product = findProduct(sellerOrderGoods);
String productCode = product.getProductCode();
Map<String, Object> parameters = new HashMap<>();
parameters.put("productName", prdName);
parameters.put("sizeName", sizeName);
parameters.put("productCode", productCode);
ufoBidMessageService.sendMessage(String.valueOf(uid), UFO_BUYER_DEPOSIT_PAY_FINISHED, parameters);
}
}
... ...
... ... @@ -3,6 +3,7 @@ package com.yohoufo.order.service.impl.statechange;
import com.google.common.collect.Lists;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.message.sdk.service.ufo.UFOBidMessageService;
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.Payment;
... ... @@ -12,6 +13,7 @@ import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.order.common.RefundCase;
import com.yohoufo.order.common.TransferCase;
import com.yohoufo.order.event.BillLogEvent;
... ... @@ -36,8 +38,11 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import static com.yoho.message.sdk.service.ufo.UFOBidMessageService.Scene.*;
import static com.yohobuy.ufo.model.order.common.OrderStatus.*;
/**
... ... @@ -113,12 +118,12 @@ public class BuyerOrderWaitingPayCancelChanger extends AbstractBuyerOrderStateCh
}
final AtomicReference<Integer> skupRefer = new AtomicReference();
skupRefer.get();
return Lists.newArrayList(
() -> transferDepositToSeller(buyerOrder),
() -> skupRefer.set(getSkup(buyerOrder)),
() -> cancelSellerOrder(skupRefer.get()),
() -> refundSellerEarnestMoney(skupRefer.get(), buyerOrder, statusChangeBuyerOrder.getTargetStatus()),
() -> messageNotice(buyerOrder, statusChangeBuyerOrder.getTargetStatus()),
() -> cacheCleaner.cleanSellerAndBuyerOrderDetailAndList(buyerOrder.getSellerUid(), buyerOrder.getUid(), buyerOrder.getOrderCode())
);
}
... ... @@ -247,6 +252,36 @@ public class BuyerOrderWaitingPayCancelChanger extends AbstractBuyerOrderStateCh
OrderStatus targetStatus = statusChangeBuyerOrder.getTargetStatus();
return statusChangeBuyerOrder instanceof RequestedCancelEventStatusChangeBuyerOrder
&& sourceStatus == WAITING_PAY
&& (targetStatus == BUYER_BID_CANCEL_PAY || targetStatus == BUYER_BID_CANCEL_PAY_TIMEOUT);
&& (targetStatus == BUYER_BID_CANCEL_PAY || targetStatus == BUYER_BID_PAY_TIMEOUT);
}
public void messageNotice(BuyerOrder buyerOrder, OrderStatus targetStatus) {
SellerOrderGoods sellerOrderGoods = findSellerOrderGoods(buyerOrder);
String prdName = sellerOrderGoods.getProductName();
String sizeName = sellerOrderGoods.getSizeName();
Product product = findProduct(sellerOrderGoods);
String productCode = product.getProductCode();
Map<String, Object> parameters = new HashMap<>();
parameters.put("productName", prdName);
parameters.put("sizeName", sizeName);
parameters.put("productCode", productCode);
parameters.put("goodsPrice", sellerOrderGoods.getGoodsPrice().toPlainString());
parameters.put("orderCode", buyerOrder.getOrderCode());
UFOBidMessageService.Scene scene;
switch (targetStatus) {
case BUYER_BID_CANCEL_PAY:
scene = UFO_BUYER_BID_CANCEL_PAY;
break;
case BUYER_BID_PAY_TIMEOUT:
scene = UFO_BUYER_BID_PAY_TIMEOUT;
break;
default:
scene = null;
break;
}
ufoBidMessageService.sendMessage(String.valueOf(buyerOrder.getUid()), scene, parameters);
}
}
\ No newline at end of file
... ...
... ... @@ -50,7 +50,7 @@ public class BuyerOrderStatusDetailItemFactory {
case BUYER_BID_CANCEL_PAY:
detailItem = new BuyerBidCancelPayItem(tabType);
break;
case BUYER_BID_CANCEL_PAY_TIMEOUT:
case BUYER_BID_PAY_TIMEOUT:
detailItem = new BuyerBidCancelPayTimeOutItem(tabType);
break;
default:
... ...
... ... @@ -40,4 +40,11 @@ public class BuyerBidOrderServiceTest extends BaseWebTest {
long orderCode = 10019449511744L;
buyerOrderStateChangers.selectOneToChange(uid, orderCode, OrderStatus.WAITING_PAY_DEPOSIT, OrderStatus.BIDING);
}
@Test
public void test_buyer_close_bid() throws Exception {
long orderCode = 10019449511744L;
buyerOrderStateChangers.selectOneToChange(uid, orderCode,OrderStatus.BIDING,OrderStatus.BUYER_CLOSE_BID);
TimeUnit.SECONDS.sleep(100);
}
}
... ...
... ... @@ -138,7 +138,7 @@
<dependency>
<groupId>com.yoho.dsf</groupId>
<artifactId>yoho-message-sdk</artifactId>
<version>1.1.5-SNAPSHOT</version>
<version>1.1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
... ...
... ... @@ -139,7 +139,7 @@ public class BidProductService {
*/
public void resetSaleableFromBidFinished(int skup) {
logger.info("resetSaleableFromBidFinished, skup:{}", skup);
if (!doResetSaleable(skup, BidSkupStatus.BID_FINISHED)) {
if (!doResetSaleable(skup, BidSkupStatus.BID_SUCCESS)) {
logger.warn("resetSaleableFromBidFinished fail, skup:{}", skup);
throw new ServiceException(500, "商品恢复到可售状态失败");
}
... ... @@ -174,7 +174,7 @@ public class BidProductService {
}
private boolean doSale(int skup) {
return bidStoragePriceMapper.updateStatus(skup, BidSkupStatus.BIDING.getCode(), BidSkupStatus.BID_FINISHED.getCode()) > 0;
return bidStoragePriceMapper.updateStatus(skup, BidSkupStatus.BIDING.getCode(), BidSkupStatus.BID_SUCCESS.getCode()) > 0;
}
private boolean doResetSaleable(int skup, BidSkupStatus sourceStatus) {
... ...
... ... @@ -3,6 +3,17 @@ consumer:
username: yoho
password: yoho
consumers:
- class: com.yohoufo.order.mq.consumer.BuyerOrderUnpaidReminderDelayMsgConsumer
topic: buyerOrder.unpaidReminder
delay:
interval: 720
- class: com.yohoufo.order.mq.consumer.BuyerOrderUnpaidReminderDelayMsgConsumer
topic: buyerOrder.unpaidReminder
delay:
interval: 1320
- class: com.yohoufo.order.mq.consumer.BuyerOrderAutoCancelDelayMsgConsumer
topic: buyerOrder.autoCancel
delay:
... ...
... ... @@ -3,7 +3,16 @@ consumer:
username: ${rabbit_ufo_user}
password: ${rabbit_ufo_password}
consumers:
# order
- class: com.yohoufo.order.mq.consumer.BuyerOrderUnpaidReminderDelayMsgConsumer
topic: buyerOrder.unpaidReminder
delay:
interval: 720
- class: com.yohoufo.order.mq.consumer.BuyerOrderUnpaidReminderDelayMsgConsumer
topic: buyerOrder.unpaidReminder
delay:
interval: 1320
- class: com.yohoufo.order.mq.consumer.BuyerOrderAutoCancelDelayMsgConsumer
topic: buyerOrder.autoCancel
delay:
... ...