Authored by sailing-PC\sailing

fix

... ... @@ -51,10 +51,11 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
buyerOrder.setOrderCode(orderInfo.getOrderCode());
buyerOrder.setUid(uid);
buyerOrder.setStatus(OrderStatus.HAS_PAYED.getCode());
buyerOrder.setUpdateTime(DateUtil.getCurrentTimeSecond());
buyerOrderMapper.updateByOrderCode(buyerOrder);
//
orderInfo.setStatus(OrderStatus.HAS_PAYED.getCode());
buyerOrderMapper.updateByOrderCode(buyerOrder);
//TODO 通知卖家发货
//卖家48小时不发货取消
SellerCancelDeliverEvent event = SellerCancelDeliverEvent.builder()
... ...
... ... @@ -152,6 +152,13 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
}
}
void checkIncome(int storageId, BigDecimal income) throws GatewayException {
if (income == null || income.compareTo(BigDecimal.ZERO) <= 0){
log.warn("in checkIncome,storageId {}, income {}", income);
throw new GatewayException(501, "别闹了,这个售价没有收入");
}
}
/**
* 发布商品 + 生成订单
* @param req
... ... @@ -175,6 +182,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
checkPrice(storageId, goodsInfo.getPrice());
// compute every fee from price
SellerOrderComputeResult computeResult = computeHandler.compute(goodsInfo.getPrice());
checkIncome(storageId, computeResult.getIncome());
log.info("in publishPrd , uid {}, storageId {}, price {}, computeResult {}", uid, storageId,
goodsInfo.getPrice(), computeResult);
context.setSellerOrderComputeResult(computeResult);
... ... @@ -417,7 +425,6 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
*/
public Object queryLogistics(int uid, long buyerOrderCode, String expressNum){
return null;
}
... ...
... ... @@ -36,6 +36,7 @@ public class SellerOrderCancelHandler implements IEventHandler<Event> {
OrderCancelEvent orderCancelEvent;
if (event instanceof OrderCancelEvent){
orderCancelEvent = (OrderCancelEvent)event;
logger.info("in SellerOrderCancelHandler.handle, orderCancelEvent {}", event);
TabType actorType = orderCancelEvent.getActorType();
CancelType cancelType = orderCancelEvent.getCancelType();
if (Objects.isNull(actorType) || Objects.isNull(cancelType)){
... ... @@ -44,10 +45,7 @@ public class SellerOrderCancelHandler implements IEventHandler<Event> {
if (actorType.equals(TabType.SELL)){
switch (cancelType){
case SELF_BEFORE_PAY:
UserCancelCase ucCase = new UserCancelCase(orderCancelEvent);
ucCase.accept(sellerOrderCancelService);
break;
case TIME_OUT:
AutoCancelCase autoCancelCase = new AutoCancelCase(orderCancelEvent);
... ...