Authored by chenchao

fix unsure not refund money

... ... @@ -19,10 +19,7 @@ import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.AppraiseOrderGoodsMapper;
import com.yohoufo.dal.order.AppraiseOrderMapper;
import com.yohoufo.dal.order.AppraiseOrderMetaMapper;
import com.yohoufo.dal.order.model.AppraiseOrder;
import com.yohoufo.dal.order.model.AppraiseOrderGoods;
import com.yohoufo.dal.order.model.AppraiseOrderMeta;
import com.yohoufo.dal.order.model.QiniuLiveRecord;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.order.common.ClientType;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.convert.AppraiseOrderGoodsConvertor;
... ... @@ -30,6 +27,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.handler.GoodsServiceRefundHandler;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
... ... @@ -85,6 +83,9 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
@Autowired
private InBoxFacade inBoxFacade;
@Autowired
private PayRefundService payRefundService;
public AppraiseOrderComputeResp compute(AppraiseOrderComputeReq req){
logger.info("in AppraiseOrderService.compute req {}", req);
... ... @@ -399,6 +400,7 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
public int appraiseFake(AppraiseOrder appraiseOrder){
int rows;
if ((rows=super.appraiseFake(appraiseOrder))>0){
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.CHECKING_FAKE;
inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
}
... ... @@ -413,6 +415,14 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
public int unsure(AppraiseOrder appraiseOrder){
int rows;
if ((rows=super.unsure(appraiseOrder))>0){
//refund amount
new GoodsServiceRefundHandler()
.loadLogger(logger)
.loadUser(appraiseOrder.getUid())
.loadActionCase(SellerWalletDetail.Type.APPRAISE_UNSURE)
.loadRefundAction(payRefundService::refund)
.loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
.refund();
AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
}
... ...
... ... @@ -421,6 +421,15 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
if (rows == 0){
return rows;
}
//refund amount
new GoodsServiceRefundHandler()
.loadLogger(logger)
.loadUser(appraiseOrder.getUid())
.loadActionCase(SellerWalletDetail.Type.APPRAISE_UNSURE)
.loadRefundAction(payRefundService::refund)
.loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
.refund();
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());
... ...