Authored by chenchao

fix unsure not refund money

@@ -19,10 +19,7 @@ import com.yohoufo.common.utils.DateUtil; @@ -19,10 +19,7 @@ import com.yohoufo.common.utils.DateUtil;
19 import com.yohoufo.dal.order.AppraiseOrderGoodsMapper; 19 import com.yohoufo.dal.order.AppraiseOrderGoodsMapper;
20 import com.yohoufo.dal.order.AppraiseOrderMapper; 20 import com.yohoufo.dal.order.AppraiseOrderMapper;
21 import com.yohoufo.dal.order.AppraiseOrderMetaMapper; 21 import com.yohoufo.dal.order.AppraiseOrderMetaMapper;
22 -import com.yohoufo.dal.order.model.AppraiseOrder;  
23 -import com.yohoufo.dal.order.model.AppraiseOrderGoods;  
24 -import com.yohoufo.dal.order.model.AppraiseOrderMeta;  
25 -import com.yohoufo.dal.order.model.QiniuLiveRecord; 22 +import com.yohoufo.dal.order.model.*;
26 import com.yohoufo.order.common.ClientType; 23 import com.yohoufo.order.common.ClientType;
27 import com.yohoufo.order.constants.MetaKey; 24 import com.yohoufo.order.constants.MetaKey;
28 import com.yohoufo.order.convert.AppraiseOrderGoodsConvertor; 25 import com.yohoufo.order.convert.AppraiseOrderGoodsConvertor;
@@ -30,6 +27,7 @@ import com.yohoufo.order.convert.SellerOrderConvertor; @@ -30,6 +27,7 @@ import com.yohoufo.order.convert.SellerOrderConvertor;
30 import com.yohoufo.order.model.dto.AppraiseOrderContext; 27 import com.yohoufo.order.model.dto.AppraiseOrderContext;
31 import com.yohoufo.order.service.IExpressInfoService; 28 import com.yohoufo.order.service.IExpressInfoService;
32 import com.yohoufo.order.service.IGoodsService; 29 import com.yohoufo.order.service.IGoodsService;
  30 +import com.yohoufo.order.service.handler.GoodsServiceRefundHandler;
33 import com.yohoufo.order.service.proxy.InBoxFacade; 31 import com.yohoufo.order.service.proxy.InBoxFacade;
34 import com.yohoufo.order.service.proxy.ProductProxyService; 32 import com.yohoufo.order.service.proxy.ProductProxyService;
35 import com.yohoufo.order.service.proxy.UserProxyService; 33 import com.yohoufo.order.service.proxy.UserProxyService;
@@ -85,6 +83,9 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements @@ -85,6 +83,9 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
85 @Autowired 83 @Autowired
86 private InBoxFacade inBoxFacade; 84 private InBoxFacade inBoxFacade;
87 85
  86 + @Autowired
  87 + private PayRefundService payRefundService;
  88 +
88 89
89 public AppraiseOrderComputeResp compute(AppraiseOrderComputeReq req){ 90 public AppraiseOrderComputeResp compute(AppraiseOrderComputeReq req){
90 logger.info("in AppraiseOrderService.compute req {}", req); 91 logger.info("in AppraiseOrderService.compute req {}", req);
@@ -399,6 +400,7 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements @@ -399,6 +400,7 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
399 public int appraiseFake(AppraiseOrder appraiseOrder){ 400 public int appraiseFake(AppraiseOrder appraiseOrder){
400 int rows; 401 int rows;
401 if ((rows=super.appraiseFake(appraiseOrder))>0){ 402 if ((rows=super.appraiseFake(appraiseOrder))>0){
  403 +
402 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.CHECKING_FAKE; 404 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.CHECKING_FAKE;
403 inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus); 405 inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
404 } 406 }
@@ -413,6 +415,14 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements @@ -413,6 +415,14 @@ public class AppraiseOrderService extends AbsGoodsServiceOrderService implements
413 public int unsure(AppraiseOrder appraiseOrder){ 415 public int unsure(AppraiseOrder appraiseOrder){
414 int rows; 416 int rows;
415 if ((rows=super.unsure(appraiseOrder))>0){ 417 if ((rows=super.unsure(appraiseOrder))>0){
  418 + //refund amount
  419 + new GoodsServiceRefundHandler()
  420 + .loadLogger(logger)
  421 + .loadUser(appraiseOrder.getUid())
  422 + .loadActionCase(SellerWalletDetail.Type.APPRAISE_UNSURE)
  423 + .loadRefundAction(payRefundService::refund)
  424 + .loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
  425 + .refund();
416 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE; 426 AppraiseOrderStatus targetStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
417 inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus); 427 inBoxFacade.paidAppraiseOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetStatus);
418 } 428 }
@@ -421,6 +421,15 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple @@ -421,6 +421,15 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
421 if (rows == 0){ 421 if (rows == 0){
422 return rows; 422 return rows;
423 } 423 }
  424 + //refund amount
  425 + new GoodsServiceRefundHandler()
  426 + .loadLogger(logger)
  427 + .loadUser(appraiseOrder.getUid())
  428 + .loadActionCase(SellerWalletDetail.Type.APPRAISE_UNSURE)
  429 + .loadRefundAction(payRefundService::refund)
  430 + .loadOrder(appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode(), appraiseOrder.getPayment(), appraiseOrder.getAmount())
  431 + .refund();
  432 +
424 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE; 433 AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE;
425 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus); 434 inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), targetOrderStatus);
426 depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode()); 435 depositService.insertFakeDeposit(appraiseOrder.getUid(), appraiseOrder.getOrderCode(), appraiseOrder.getParentOrderCode());