|
|
|
@@ -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); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |