xhxu 3 лет назад
Родитель
Сommit
dae9152259
2 измененных файлов: 40 добавлений и 31 удалений
  1. +40
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java
  2. +0
    -31
      mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java

+ 40
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java Просмотреть файл

@@ -1,7 +1,12 @@
package com.iformall.controller.market;

import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.ErrorCode;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxCardSpend;
import com.iformall.domain.po.WxMerchant;
import com.iformall.service.WxCardSpendService;
import com.iformall.service.WxMerchantService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -18,6 +23,9 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/refund")
@Api(description = "微信退款订单接口")
@@ -27,6 +35,12 @@ public class WxRefundOrderController extends BaseController {
@Autowired
private WxRefundOrderService wxRefundOrderService;

@Autowired
private WxCardSpendService wxCardSpendService;

@Autowired
private WxMerchantService wxMerchantService;


@ApiOperation("分页列表接口")
@GetMapping("list")
@@ -81,4 +95,30 @@ public class WxRefundOrderController extends BaseController {
}


@ApiOperation("根据id查询接口")
@GetMapping("/findCardSendDetail")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData findCardSendDetail(Long id) {
if(id == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
Map<String,Object> map = new HashMap<>();
WxRefundOrder refundOrder = wxRefundOrderService.getById(id);
if(refundOrder == null){
return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"退款订单未找到");
}
map.put("refundOrder",refundOrder);
Long cardSpendId = Long.parseLong(refundOrder.getPayOrderNo());
WxCardSpend cardSpend = wxCardSpendService.getById(cardSpendId);
if(cardSpend == null){
return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"付款订单未找到");
}
map.put("refundOrder",refundOrder);
WxMerchant merchant = wxMerchantService.getById(cardSpend.getMerchantId());
map.put("merchant",merchant);

return new ResultData(map);
}


}

+ 0
- 31
mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java Просмотреть файл

@@ -38,11 +38,6 @@ public class WxRefundOrderController extends BaseController {
@Autowired
private WxRefundOrderService wxRefundOrderService;

@Autowired
private WxCardSpendService wxCardSpendService;

@Autowired
private WxMerchantService wxMerchantService;

@ApiOperation(value = "退券退款", notes = "{\"couponOrderId\":\"string\"}")
@PostMapping("/create")
@@ -99,30 +94,4 @@ public class WxRefundOrderController extends BaseController {
}


@ApiOperation("根据id查询接口")
@GetMapping("/findCardSendDetail")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData findCardSendDetail(Long id) {
if(id == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
Map<String,Object> map = new HashMap<>();
WxRefundOrder refundOrder = wxRefundOrderService.getById(id);
if(refundOrder == null){
return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"退款订单未找到");
}
map.put("refundOrder",refundOrder);
Long cardSpendId = Long.parseLong(refundOrder.getPayOrderNo());
WxCardSpend cardSpend = wxCardSpendService.getById(cardSpendId);
if(cardSpend == null){
return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"付款订单未找到");
}
map.put("refundOrder",refundOrder);
WxMerchant merchant = wxMerchantService.getById(cardSpend.getMerchantId());
map.put("merchant",merchant);

return new ResultData(map);
}


}

Загрузка…
Отмена
Сохранить