Commit 62b2f7d229f355279b53fe0d92692aa62b22d058

Authored by fengliang
1 parent cc70857c

update:增加返回参数

etrade-order/src/main/java/com/diligrp/etrade/order/controller/OrderManagerController.java
@@ -42,7 +42,7 @@ public class OrderManagerController { @@ -42,7 +42,7 @@ public class OrderManagerController {
42 * @return 42 * @return
43 */ 43 */
44 @RequestMapping(value = "/refund",method = {RequestMethod.POST},produces="application/json;charset=UTF-8") 44 @RequestMapping(value = "/refund",method = {RequestMethod.POST},produces="application/json;charset=UTF-8")
45 - public Message refund(@RequestBody OrderRefundDto refundDto){ 45 + public Message<OrderRefund> refund(@RequestBody OrderRefundDto refundDto){
46 UserTicket userTicket = SessionContext.getUserTicket(); 46 UserTicket userTicket = SessionContext.getUserTicket();
47 try{ 47 try{
48 RLock lock = redissonClient.getLock(OrderConstant.OrderLock + refundDto.getCode()); 48 RLock lock = redissonClient.getLock(OrderConstant.OrderLock + refundDto.getCode());
etrade-order/src/main/java/com/diligrp/etrade/order/service/OrderRefundService.java
@@ -19,7 +19,7 @@ public interface OrderRefundService { @@ -19,7 +19,7 @@ public interface OrderRefundService {
19 * @param userTicket 19 * @param userTicket
20 * @return 20 * @return
21 */ 21 */
22 - Message addRefund(OrderRefundDto refundDto, UserTicket userTicket); 22 + Message<OrderRefund> addRefund(OrderRefundDto refundDto, UserTicket userTicket);
23 23
24 /** 24 /**
25 * 根据退款单发起退款 25 * 根据退款单发起退款
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderRefundServiceImpl.java
@@ -60,7 +60,7 @@ public class OrderRefundServiceImpl implements OrderRefundService { @@ -60,7 +60,7 @@ public class OrderRefundServiceImpl implements OrderRefundService {
60 private WeChatPayRpcResolver weChatPayRpcResolver; 60 private WeChatPayRpcResolver weChatPayRpcResolver;
61 @Transactional(rollbackFor = Exception.class) 61 @Transactional(rollbackFor = Exception.class)
62 @Override 62 @Override
63 - public Message addRefund(OrderRefundDto refundDto, UserTicket userTicket) { 63 + public Message<OrderRefund> addRefund(OrderRefundDto refundDto, UserTicket userTicket) {
64 //基础参数效验 64 //基础参数效验
65 LOGGER.info("退款单入参{},操作员{}",refundDto,userTicket); 65 LOGGER.info("退款单入参{},操作员{}",refundDto,userTicket);
66 Order order = orderService.getOneOrder(new OrderGetDto(null, refundDto.getCode(), refundDto.getMarketId())); 66 Order order = orderService.getOneOrder(new OrderGetDto(null, refundDto.getCode(), refundDto.getMarketId()));
@@ -93,7 +93,7 @@ public class OrderRefundServiceImpl implements OrderRefundService { @@ -93,7 +93,7 @@ public class OrderRefundServiceImpl implements OrderRefundService {
93 if(orderRefund.getState().equals(OrderRefundState.SUCCESS.getCode())){ 93 if(orderRefund.getState().equals(OrderRefundState.SUCCESS.getCode())){
94 order.setTotalRefundAmount(order.getTotalRefundAmount()+refundAmount); 94 order.setTotalRefundAmount(order.getTotalRefundAmount()+refundAmount);
95 orderService.updateByOnly(order); 95 orderService.updateByOnly(order);
96 - return Message.success(); 96 + return Message.success(orderRefund);
97 }else{ 97 }else{
98 return Message.failure(OrderErrorCode.PARAM_ERROR,"已成功发起退款,退款结果暂未获得"); 98 return Message.failure(OrderErrorCode.PARAM_ERROR,"已成功发起退款,退款结果暂未获得");
99 } 99 }