Authored by tanling

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

... ... @@ -7,7 +7,6 @@ import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.AppraiseOrderMapper;
... ... @@ -15,11 +14,10 @@ import com.yohoufo.dal.order.AppraiseOrderMetaMapper;
import com.yohoufo.dal.order.model.AppraiseOrder;
import com.yohoufo.dal.order.model.AppraiseOrderMeta;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.event.EventHandlerContainer;
import com.yohoufo.order.event.SellerDepositOrderCancelAsyncEvent;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.service.impl.AppraiseOrderService;
import com.yohoufo.order.service.seller.deposit.SellerDepositOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -42,6 +40,9 @@ public class AppraiseOrderPaymentService extends AbstractOrderPaymentService {
@Autowired
private SellerDepositOrderService sellerDepositOrderService;
@Autowired
private AppraiseOrderService appraiseOrderService;
@Override
public boolean isTimeoutCancelStatus(OrderInfo orderInfo) {
if (orderInfo.getStatus() != null
... ... @@ -171,14 +172,10 @@ public class AppraiseOrderPaymentService extends AbstractOrderPaymentService {
OrderAttributes oa = OrderAttributes.getOrderAttributes(orderInfo.getAttributes());
switch (oa){
case APPRAISE:
appraiseOrderService.processAfterPay(orderInfo);
break;
case DEPOSITE:
SellerDepositOrderCancelAsyncEvent event = new SellerDepositOrderCancelAsyncEvent(sellerDepositOrderService::handleOrderCancelAsyncEvent);
event.setUid(orderInfo.getUid());
event.setOrderCode(orderInfo.getOrderCode());
EventBusPublisher.publishEvent(event);
logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
sellerDepositOrderService.processAfterPay(orderInfo);
break;
}
}
... ...
... ... @@ -15,9 +15,9 @@ public interface IGoodsService {
/**
* 平台收货
* @param orderCode
* @param appraiseOrder
*/
int platformReceiveGoods(long orderCode);
int platformReceiveGoods(AppraiseOrder appraiseOrder);
/**
... ...
... ... @@ -55,10 +55,11 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
/**
* 平台收货
* @param orderCode
* @param appraiseOrder
*/
@Override
public int platformReceiveGoods(long orderCode){
public int platformReceiveGoods(AppraiseOrder appraiseOrder){
long orderCode = appraiseOrder.getOrderCode();
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_RECEIVE,
expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.order.bo.AppraiseOrderGoodsBo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
... ... @@ -29,6 +30,7 @@ import com.yohoufo.order.convert.SellerOrderConvertor;
import com.yohoufo.order.model.dto.AppraiseOrderContext;
import com.yohoufo.order.service.IExpressInfoService;
import com.yohoufo.order.service.IGoodsService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
... ... @@ -80,6 +82,9 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
@Autowired
private ProductProxyService productProxyService;
@Autowired
private InBoxFacade inBoxFacade;
public AppraiseOrderComputeResp compute(AppraiseOrderComputeReq req){
logger.info("in AppraiseOrderService.compute req {}", req);
... ... @@ -361,11 +366,15 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
/**
* 平台收货
* @param orderCode
* @param appraiseOrder
*/
@Override
public int platformReceiveGoods(long orderCode){
int rows = super.platformReceiveGoods(orderCode);
public int platformReceiveGoods(AppraiseOrder appraiseOrder){
int rows;
if ((rows=super.platformReceiveGoods(appraiseOrder))>0){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
}
return rows;
}
... ... @@ -375,7 +384,12 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
*/
@Override
public int appraisePass(AppraiseOrder appraiseOrder){
return super.appraisePass(appraiseOrder);
int rows;
if ((rows=super.appraisePass(appraiseOrder))>0){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.JUDGE_PASS;
inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
}
return rows;
}
/**
... ... @@ -384,7 +398,12 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
*/
@Override
public int appraiseFake(AppraiseOrder appraiseOrder){
return super.appraiseFake(appraiseOrder);
int rows;
if ((rows=super.appraiseFake(appraiseOrder))>0){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.CHECKING_FAKE;
inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
}
return rows;
}
/**
... ... @@ -393,8 +412,17 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
*/
@Override
public int unsure(AppraiseOrder appraiseOrder){
return super.unsure(appraiseOrder);
int rows;
if ((rows=super.unsure(appraiseOrder))>0){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
}
return rows;
}
public void processAfterPay(OrderInfo orderInfo){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.HAS_PAYED;
inBoxFacade.paidAppraiseOrderNotice(orderInfo.getUid(), orderInfo.getOrderCode(), targetStatus);
}
}
... ...
... ... @@ -1285,7 +1285,7 @@ public class AppraiseService {
if (serviceOrderProcessor.isGoodsServiceOrder(orderCode)){
LOGGER.info("qualityCheckReject isGoodsServiceOrder order code {}", orderCode);
ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode);
existenceNode.getGoodsService().appraiseFake(existenceNode.getAppraiseOrder());
existenceNode.getGoodsService().findFlaw(existenceNode.getAppraiseOrder());
apiResponse.setCode(200);
return apiResponse;
}
... ...
... ... @@ -701,10 +701,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
logger.info("in confirmReceive, orderCode {}", orderCode);
if(serviceOrderProcessor.isGoodsServiceOrder(orderCode)){
logger.info("in confirmReceive isGoodsServiceOrder, orderCode {}", orderCode);
serviceOrderProcessor.findGoodsServiceInstance(orderCode).platformReceiveGoods(orderCode);
ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode);
existenceNode.getGoodsService().platformReceiveGoods(existenceNode.appraiseOrder);
// 确认收货过来的是子订单号
Long parentOrderCode = existenceNode.getAppraiseOrder().getParentOrderCode();
if (parentOrderCode == null){
... ...
... ... @@ -136,7 +136,7 @@ public class DepositServiceImpl implements DepositService {
// 查询现货寄存订单的状态
Map<Long, String> appraiseOrderStatusMap = depositHelpService.queryAppraiseOrderStatus(depositList.stream()
.filter(item -> DepositSourceEnum.SOURCE_SPOT_GOODS.getCode().equals(item.getSource())).map(StorageDeposit::getOrderCode).collect(Collectors.toList()));
.filter(item -> DepositOutTypeEnum.OUTTYPE_EXPIRED.getCode().equals(item.getOutType())).map(StorageDeposit::getOrderCode).collect(Collectors.toList()));
Map<Long, BuyerOrder> buyerGoodsMap = buyerGoodsList.stream().map(Function.identity()).collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity()));
... ...
... ... @@ -6,11 +6,12 @@ import com.yoho.message.sdk.service.ufo.IUFOSendService;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import com.yohobuy.ufo.model.order.common.SuperEnterStageLevel;
import com.yohobuy.ufo.model.order.vo.GoodsVo;
import com.yohobuy.ufo.model.order.vo.ProductVo;
import com.yohoufo.dal.order.AppraiseOrderGoodsMapper;
import com.yohoufo.dal.order.AppraiseOrderStorageMapper;
import com.yohoufo.dal.order.SellerOrderMapper;
import com.yohoufo.dal.order.model.AppraiseOrder;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.dal.product.ProductMapper;
import com.yohoufo.dal.product.model.Product;
import com.yohoufo.inboxclient.model.InBoxResponse;
... ... @@ -30,7 +31,7 @@ import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Objects;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
... ... @@ -62,6 +63,12 @@ public class InBoxFacade extends BaseNoticeFacade{
private SellerOrderMapper sellerOrderMapper;
@Autowired
private AppraiseOrderGoodsMapper appraiseOrderGoodsMapper;
@Autowired
private AppraiseOrderStorageMapper appraiseOrderStorageMapper;
@Autowired
private IUFOSendService ufoSendService;
@Autowired
... ... @@ -1016,52 +1023,233 @@ public class InBoxFacade extends BaseNoticeFacade{
log.warn("notice user renew deposit goods fail, uid {}, sog {}", uid, sog, e);
}
}
GoodsVo buildProductInfo(long orderCode){
AppraiseOrderGoods paog = appraiseOrderGoodsMapper.selectOneByOrderCode(orderCode);
AppraiseOrderStorage paos = appraiseOrderStorageMapper.selectByOrderCode(orderCode);
return GoodsVo.builder()
.productName(paog.getProductName())
.productCode(paog.getProductCode())
.sizeName(Objects.nonNull(paos) ? paos.getSizeName() : null)
.build();
}
public void sellerDepositOrderNotice(int uid,long orderCode, AppraiseOrderStatus targetStatus){
switch (targetStatus){
case WAITING_PAY:
break;
log.info("enter sellerDepositOrderNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
try {
//
InboxBusinessTypeEnum inboxType = null;
InboxBusinessTypeEnum smsType = null;
Object[] inboxParams = null,
smsParams = null;
switch (targetStatus){
case WAITING_PAY:
//inbox
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_WAITING_PAY;
inboxParams = new Object[]{orderCode};
break;
case CANCEL_BEFORE_PAY:
case CANCEL_BEFORE_PAY:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_SELF_CANCEL;
inboxParams = new Object[]{orderCode};
break;
break;
case HAS_PAYED:
case HAS_PAYED:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_PAID;
inboxParams = new Object[]{orderCode};
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_PAID;
smsParams = new Object[]{orderCode};
break;
case CANCEL_BEFORE_DELIVER:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_CANCEL_BEFORE_DELIVER;
inboxParams = new Object[]{orderCode};
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_CANCEL_BEFORE_DELIVER;
smsParams = new Object[]{orderCode};
break;
case SEND_OUT_TIMEOUT:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_DELIVER_TIMEOUT;
inboxParams = new Object[]{orderCode};
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_DELIVER_TIMEOUT;
smsParams = new Object[]{orderCode};
break;
case PLATFORM_RECEIVE:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_PLATFORM_RECEIVE;
inboxParams = new Object[]{orderCode};
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_PLATFORM_RECEIVE;
smsParams = new Object[]{orderCode};
break;
case SHAM_SEND_OUT:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_MISS_GOODS;
// get product info 「商品名称」「尺码」「货号」
inboxParams = buildParams4SellerDepositOrder(orderCode);
break;
case QUALITY_CHECK_FAKE:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_FIND_FLAW_OR_BIGGER;
//get product info 「商品名称」「尺码」「货号」
inboxParams = buildParams4SellerDepositOrder(orderCode);
break;
break;
case CANCEL_BEFORE_DELIVER:
case PLATFORM_APPRAISE_UNSURE:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_APPRAISE_UNSURE;
//get product info 「商品名称」「尺码」「货号」
inboxParams = buildParams4SellerDepositOrder(orderCode);
break;
case SEND_OUT_TIMEOUT:
break;
case JUDGE_PASS:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_APPRAISE_PASS;
//get product info 「商品名称」「尺码」「货号」
inboxParams = buildParams4SellerDepositOrder(orderCode);
break;
break;
case PLATFORM_RECEIVE:
case CHECKING_FAKE:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_APPRAISE_FAKE;
//get product info 「商品名称」「尺码」「货号」
inboxParams = buildParams4SellerDepositOrder(orderCode);
break;
break;
case SHAM_SEND_OUT:
case FINISH:
inboxType = InboxBusinessTypeEnum.NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY;
inboxParams = new Object[]{orderCode};
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_SELLER_DEPOSIT_ORDER_FINISH_APPRAISE_SUMMARY;
smsParams = new Object[]{orderCode};
break;
}
break;
case QUALITY_CHECK_FAKE:
break;
Notice notice = newNotice(uid).withLogPrefix("seller Deposit Order Notice 4 " + targetStatus.name());
if (Objects.nonNull(inboxType)){
notice.withInBox(inboxType, inboxParams);
}
if (Objects.nonNull(smsType)) {
notice.withSms(smsType, smsParams);
}
notice.send();
} catch (Exception e) {
log.warn("notice seller deposit order fail, uid {}, orderCode {} status {}", uid, orderCode, targetStatus, e);
}
}
case PLATFORM_APPRAISE_UNSURE:
public void paidAppraiseOrderNotice(int uid,long orderCode, AppraiseOrderStatus targetStatus){
log.info("enter paidAppraiseOrderNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
try {
//
InboxBusinessTypeEnum inboxType = null;
InboxBusinessTypeEnum smsType = null;
break;
case JUDGE_PASS:
switch (targetStatus){
case HAS_PAYED:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_PAID;
break;
break;
case PLATFORM_RECEIVE:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_PLATFORM_RECEIVE;
break;
case SHAM_SEND_OUT:
break;
case QUALITY_CHECK_FAKE:
break;
case CHECKING_FAKE:
case PLATFORM_APPRAISE_UNSURE:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_APPRAISE_UNSURE;
//get product info 「商品名称」「尺码」「货号」
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_PAID_APPRAISE_ORDER_APPRAISE_UNSURE;
break;
case JUDGE_PASS:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_APPRAISE_PASS;
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_PAID_APPRAISE_ORDER_APPRAISE_PASS;
break;
break;
case CHECKING_FAKE:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_APPRAISE_FAKE;
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_PAID_APPRAISE_ORDER_APPRAISE_FAKE;
break;
case FINISH:
case FINISH:
break;
}
boolean smsRequired = Objects.nonNull(smsType);
Object[] inboxParams = buildParams4PaidAppraiseOrder(orderCode);
Object[] smsParams = smsRequired ? inboxParams : null;
break;
Notice notice = newNotice(uid).withLogPrefix("paid Appraise Order Notice 4 " + targetStatus.name());
if (Objects.nonNull(inboxType)){
notice.withInBox(inboxType, inboxParams);
}
if (smsRequired) {
notice.withSms(smsType, smsParams);
}
notice.send();
} catch (Exception e) {
log.warn("paidAppraiseOrderNotice fail, uid {}, orderCode {} status {}", uid, orderCode, targetStatus, e);
}
}
private Object[] buildParams4SellerDepositOrder(long orderCode){
GoodsVo goodsVo;
goodsVo = buildProductInfo(orderCode);
return new Object[]{orderCode, goodsVo.getProductName(), goodsVo.getSizeName(), goodsVo.getProductCode()};
}
private Object[] buildParams4PaidAppraiseOrder(long orderCode){
GoodsVo goodsVo;
goodsVo = buildProductInfo(orderCode);
//get product info 「商品名称」「货号」
return new Object[]{ goodsVo.getProductName(), goodsVo.getProductCode()};
}
public void paidAppraiseOrderDeliverBackNotice(int uid,long orderCode, String expressNumber, AppraiseOrderStatus targetStatus){
log.info("enter paidAppraiseOrderDeliverBackNotice uid {} orderCode {} targetStatus {}", uid, orderCode, targetStatus);
try {
//
InboxBusinessTypeEnum inboxType = null;
InboxBusinessTypeEnum smsType = null;
switch (targetStatus){
case PLATFORM_APPRAISE_UNSURE:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_DELIVER_AFTER_APPRAISE_UNSURE;
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_PAID_APPRAISE_ORDER_DELIVER_AFTER_APPRAISE_UNSURE;
break;
case JUDGE_PASS:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_DELIVER_AFTER_APPRAISE_PASS;
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_PAID_APPRAISE_ORDER_DELIVER_AFTER_APPRAISE_PASS;
break;
case CHECKING_FAKE:
inboxType = InboxBusinessTypeEnum.NOTICE_PAID_APPRAISE_ORDER_DELIVER_AFTER_APPRAISE_FAKE;
//sms
smsType = InboxBusinessTypeEnum.SMS_NOTICE_PAID_APPRAISE_ORDER_DELIVER_AFTER_APPRAISE_FAKE;
break;
}
boolean smsRequired = Objects.nonNull(smsType);
Object[] inboxParams = buildParams4PaidAppraiseOrder(orderCode);
Object[] smsParams = smsRequired ? inboxParams : null;
Notice notice = newNotice(uid).withLogPrefix("paidAppraiseOrder Deliver Back Notice 4 " + targetStatus.name());
if (Objects.nonNull(inboxType)){
notice.withInBox(inboxType, inboxParams);
}
if (smsRequired) {
//set expressNumber
smsParams[2] = expressNumber;
notice.withSms(smsType, smsParams);
}
notice.send();
} catch (Exception e) {
log.warn("paidAppraiseOrder Deliver Back Notice fail, uid {}, orderCode {} status {}", uid, orderCode, targetStatus, e);
}
}
}
... ...
... ... @@ -3,6 +3,7 @@ package com.yohoufo.order.service.seller.deposit;
import com.alibaba.fastjson.JSONObject;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
... ... @@ -42,6 +43,7 @@ import com.yohoufo.order.service.IPaymentService;
import com.yohoufo.order.service.handler.GoodsServiceRefundHandler;
import com.yohoufo.order.service.impl.*;
import com.yohoufo.order.service.pay.AbstractPayService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.utils.LoggerUtils;
... ... @@ -99,6 +101,9 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
@Autowired
private IPaymentService paymentService;
@Autowired
private InBoxFacade inBoxFacade;
public SellerDepositOrderComputeResp compute(SellerDepositOrderComputeReq req){
... ... @@ -198,12 +203,17 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
}
AppraiseOrderStatus appraiseOrderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
AppraiseOrderStatus targetOrderStatus;
switch (appraiseOrderStatus){
case WAITING_PAY:
super.triggerStatusChange(orderCode, AppraiseOrderStatus.CANCEL_BEFORE_PAY, appraiseOrderStatus);
targetOrderStatus = AppraiseOrderStatus.CANCEL_BEFORE_PAY;
super.triggerStatusChange(orderCode, targetOrderStatus, appraiseOrderStatus);
inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus);
break;
case HAS_PAYED:
super.triggerStatusChange(orderCode, AppraiseOrderStatus.CANCEL_BEFORE_DELIVER, appraiseOrderStatus);
targetOrderStatus = AppraiseOrderStatus.CANCEL_BEFORE_DELIVER;
super.triggerStatusChange(orderCode, targetOrderStatus , appraiseOrderStatus);
inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus);
//refund amount
new GoodsServiceRefundHandler()
.loadLogger(logger)
... ... @@ -275,6 +285,9 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
return rows;
}
Long orderCode = req.getOrderCode();
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
//
inBoxFacade.sellerDepositOrderNotice(req.getUid(), orderCode, targetOrderStatus);
//split sku 2 order
List<AppraiseOrderGoods> paogList = appraiseOrderGoodsMapper.selectByOrderCode(orderCode);
SellerDepositOrderListService.OrderDataNode node = sellerDepositOrderListService.buildDataSourceOfParentOrder(orderCode, paogList);
... ... @@ -297,11 +310,16 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
/**
* 平台收货
* @param orderCode
* @param appraiseOrder
*/
@Override
public int platformReceiveGoods(long orderCode){
int rows = super.platformReceiveGoods(orderCode);
public int platformReceiveGoods(AppraiseOrder appraiseOrder){
int rows = super.platformReceiveGoods(appraiseOrder);
if (rows>0) {
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_RECEIVE;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
}
return rows;
}
... ... @@ -317,7 +335,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
}
Long orderCode = pao.getOrderCode();
Long paidCode = pao.getParentOrderCode();
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.JUDGE_PASS;
inBoxFacade.sellerDepositOrderNotice(pao.getUid(), orderCode, targetOrderStatus);
BigDecimal left = calLeftMoney(pao.getAmount(), orderCode);
if (left.compareTo(BigDecimal.ZERO)>0){
... ... @@ -378,6 +397,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
if (rows == 0){
return rows;
}
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.CHECKING_FAKE;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
return rows;
}
... ... @@ -392,6 +413,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
if (rows == 0){
return rows;
}
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
return rows;
}
... ... @@ -407,6 +430,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
if (rows == 0){
return rows;
}
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
//refund amount
new GoodsServiceRefundHandler()
.loadLogger(logger)
... ... @@ -525,6 +550,8 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
if (rows == 0){
return rows;
}
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.QUALITY_CHECK_FAKE;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
new GoodsServiceRefundHandler()
.loadLogger(logger)
.loadUser(appraiseOrder.getUid())
... ... @@ -550,4 +577,14 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
return true;
}
public void processAfterPay(OrderInfo orderInfo){
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.HAS_PAYED;
inBoxFacade.sellerDepositOrderNotice(orderInfo.getUid(), orderInfo.getOrderCode(), targetOrderStatus);
SellerDepositOrderCancelAsyncEvent event = new SellerDepositOrderCancelAsyncEvent(this::handleOrderCancelAsyncEvent);
event.setUid(orderInfo.getUid());
event.setOrderCode(orderInfo.getOrderCode());
EventBusPublisher.publishEvent(event);
logger.info("processAfterPay seller deposit order , SellerDepositOrderCancelAsyncEvent send out, event {}", event);
}
}
... ...