Authored by chenchao

add in Event trigger

... ... @@ -30,7 +30,7 @@ public interface IGoodsService {
/**
* 鉴别为假
* @param orderCode
* @param appraiseOrder
*/
int appraiseFake(AppraiseOrder appraiseOrder);
... ... @@ -41,4 +41,6 @@ public interface IGoodsService {
int unsure(AppraiseOrder appraiseOrder);
OrderAttributes getOrderAttributes();
int shamDeliver(AppraiseOrder appraiseOrder);
}
... ...
... ... @@ -125,4 +125,15 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
logger.info("appraise order appraiseFake update status, orderCode {} rows {}", orderCode, rows);
return rows;
}
@Override
public int shamDeliver(AppraiseOrder appraiseOrder){
long orderCode = appraiseOrder.getOrderCode();
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.SHAM_SEND_OUT,
expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
int rows = triggerStatusChange(orderCode, targetStatus, expectedStatus);
logger.info("appraise order appraiseFake update status, orderCode {} rows {}", orderCode, rows);
return rows;
}
}
... ...
... ... @@ -384,4 +384,6 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
public int unsure(AppraiseOrder appraiseOrder){
return super.unsure(appraiseOrder);
}
}
... ...
... ... @@ -132,6 +132,9 @@ public class BuyerOrderCancelService {
@Autowired
private ExpressInfoMapper expressInfoMapper;
@Autowired
private ServiceOrderProcessor serviceOrderProcessor;
@Resource(name = "tradeMqProducer")
private YhProducer tradeMqProducer;
... ... @@ -250,6 +253,13 @@ public class BuyerOrderCancelService {
}
public void cancelForSellerShamSendOut(int uid, long orderCode,OrderStatus targetStatus) {
if (serviceOrderProcessor.isGoodsServiceOrder(orderCode)){
logger.info("cancelForSellerShamSendOut isGoodsServiceOrder orderCode {}", orderCode);
ServiceOrderProcessor.ExistenceNode existenceNode = serviceOrderProcessor.findGoodsServiceInstanceAndExt(orderCode);
existenceNode.getGoodsService().shamDeliver(existenceNode.getAppraiseOrder());
}
new BuyerOrderCancelHandler(uid, orderCode)
.withBuyerOrderSupplier(buyerOrderMapper, buyerOrderGoodsMapper)
.withSellerOrderSupplier(sellerOrderGoodsMapper,sellerOrderMetaMapper)
... ...
package com.yohoufo.order.service.seller.deposit;
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.yohobuy.ufo.model.order.req.*;
... ... @@ -238,4 +239,11 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
return rows;
}
@Override
public int shamDeliver(AppraiseOrder appraiseOrder){
int rows = super.shamDeliver(appraiseOrder);
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
return rows;
}
}
... ...