1. 增加支付交易分页 API 接口
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.mall.managementweb.client.pay.transaction;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.payservice.rpc.transaction.PayTransactionRpc;
|
||||
import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionPageReqDTO;
|
||||
import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionRespDTO;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PayTransactionClient {
|
||||
|
||||
@DubboReference(version = "${dubbo.consumer.PayTransactionRpc.version}")
|
||||
private PayTransactionRpc payTransactionRpc;
|
||||
|
||||
public PageResult<PayTransactionRespDTO> pagePayTransaction(PayTransactionPageReqDTO pageReqDTO) {
|
||||
CommonResult<PageResult<PayTransactionRespDTO>> pagePayTransactionResult = payTransactionRpc.pagePayTransaction(pageReqDTO);
|
||||
pagePayTransactionResult.checkError();
|
||||
return pagePayTransactionResult.getData();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
### /product-spu/page 成功(全部)
|
||||
GET {{baseUrl}}/pay/transaction/page?pageNo=1&pageSize=10
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Authorization: Bearer {{accessToken}}
|
||||
dubbo-tag: {{dubboTag}}
|
||||
|
||||
###
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.mall.managementweb.controller.pay;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.managementweb.controller.pay.vo.transaction.PayTransactionPageReqVO;
|
||||
import cn.iocoder.mall.managementweb.controller.pay.vo.transaction.PayTransactionRespVO;
|
||||
import cn.iocoder.mall.managementweb.service.pay.transaction.PayTransactionService;
|
||||
import cn.iocoder.security.annotations.RequiresPermissions;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
@Api("支付交易单 API")
|
||||
@RestController
|
||||
@RequestMapping("/pay/transaction")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class PayTransactionController {
|
||||
|
||||
@Autowired
|
||||
private PayTransactionService payTransactionService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@RequiresPermissions("pay:transaction:page")
|
||||
@ApiOperation("获得交易支付单分页")
|
||||
public CommonResult<PageResult<PayTransactionRespVO>> pagePayTransaction(PayTransactionPageReqVO pageReqVO) {
|
||||
// 执行查询
|
||||
return success(payTransactionService.pagePayTransaction(pageReqVO));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.mall.managementweb.controller.pay.vo.transaction;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("支付交易分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class PayTransactionPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "创建时间(开始)", example = "2019-10-10 11:12:13")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createBeginTime;
|
||||
@ApiModelProperty(value = "创建时间(结束)", example = "2019-10-10 11:12:13")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createEndTime;
|
||||
|
||||
@ApiModelProperty(value = "创建时间()", example = "2019-10-10 11:12:13")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date paymentBeginTime;
|
||||
@ApiModelProperty(value = "创建时间()", example = "2019-10-10 11:12:13")
|
||||
private Date paymentEndTime;
|
||||
|
||||
@ApiModelProperty(value = "支付状态", example = "1", notes = "参见 PayTransactionStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否退款", example = "true")
|
||||
private Boolean hasRefund;
|
||||
|
||||
@ApiModelProperty(value = "支付渠道", example = "1", notes = "参见 PayChannelEnum 枚举")
|
||||
private Integer payChannel;
|
||||
|
||||
@ApiModelProperty(value = "商品标题", example = "芋头")
|
||||
private String orderSubject;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package cn.iocoder.mall.managementweb.controller.pay.vo.transaction;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("支付交易单 Response VO")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PayTransactionRespVO {
|
||||
|
||||
@ApiModelProperty(value = "交易编号", required = true, example = "POd4RC6a")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户编号", required = true, example = "1024")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "应用编号", required = true, example = "POd4RC6a")
|
||||
private String appId;
|
||||
|
||||
@ApiModelProperty(value = "发起交易的 IP", required = true, example = "192.168.10.1")
|
||||
private String createIp;
|
||||
|
||||
@ApiModelProperty(value = "订单号不能为空", required = true, example = "1024")
|
||||
private String orderId;
|
||||
|
||||
@ApiModelProperty(value = "商品名", required = true, example = "芋道源码")
|
||||
private String orderSubject;
|
||||
|
||||
@ApiModelProperty(value = "订单商品描述", required = true, example = "绵啾啾的")
|
||||
private String orderDescription;
|
||||
|
||||
@ApiModelProperty(value = "订单商品备注", example = "绵啾啾的")
|
||||
private String orderMemo;
|
||||
|
||||
@ApiModelProperty(value = "支付金额,单位:分。", required = true, example = "10")
|
||||
private Integer price;
|
||||
|
||||
@ApiModelProperty(value = "订单状态", required = true, example = "1", notes = "参见 PayTransactionStatusEnum 枚举")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "交易过期时间", required = true)
|
||||
private Date expireTime;
|
||||
|
||||
@ApiModelProperty(value = "回调业务线完成时间")
|
||||
private Date finishTime;
|
||||
|
||||
@ApiModelProperty(value = "成功支付的交易拓展编号", example = "1024")
|
||||
private Integer extensionId;
|
||||
|
||||
@ApiModelProperty(value = "支付成功的支付渠道", example = "1", notes = "参见 PayChannelEnum 枚举")
|
||||
private Integer payChannel;
|
||||
|
||||
@ApiModelProperty(value = "第三方支付成功的时间")
|
||||
private Date paymentTime;
|
||||
|
||||
@ApiModelProperty(value = "收到第三方系统通知的时间")
|
||||
private Date notifyTime;
|
||||
|
||||
@ApiModelProperty(value = "第三方的流水号", example = "11122233344444")
|
||||
private String tradeNo;
|
||||
|
||||
@ApiModelProperty(value = "添加时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
// ========== 退款相关 ==========
|
||||
|
||||
@ApiModelProperty(value = "退款总金额,单位:分", example = "100")
|
||||
private Integer refundTotal;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.iocoder.mall.managementweb.convert.pay.transaction;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.managementweb.controller.pay.vo.transaction.PayTransactionPageReqVO;
|
||||
import cn.iocoder.mall.managementweb.controller.pay.vo.transaction.PayTransactionRespVO;
|
||||
import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionPageReqDTO;
|
||||
import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionRespDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface PayTransactionConvert {
|
||||
|
||||
PayTransactionConvert INSTANCE = Mappers.getMapper(PayTransactionConvert.class);
|
||||
|
||||
PayTransactionPageReqDTO convert(PayTransactionPageReqVO bean);
|
||||
|
||||
PageResult<PayTransactionRespVO> convertPage(PageResult<PayTransactionRespDTO> bean);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.iocoder.mall.managementweb.service.pay.transaction;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.managementweb.client.pay.transaction.PayTransactionClient;
|
||||
import cn.iocoder.mall.managementweb.controller.pay.vo.transaction.PayTransactionPageReqVO;
|
||||
import cn.iocoder.mall.managementweb.controller.pay.vo.transaction.PayTransactionRespVO;
|
||||
import cn.iocoder.mall.managementweb.convert.pay.transaction.PayTransactionConvert;
|
||||
import cn.iocoder.mall.payservice.rpc.transaction.dto.PayTransactionRespDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PayTransactionService {
|
||||
|
||||
@Autowired
|
||||
private PayTransactionClient payTransactionClient;
|
||||
|
||||
public PageResult<PayTransactionRespVO> pagePayTransaction(PayTransactionPageReqVO pageReqVO) {
|
||||
PageResult<PayTransactionRespDTO> payTransactionPage = payTransactionClient.pagePayTransaction(
|
||||
PayTransactionConvert.INSTANCE.convert(pageReqVO));
|
||||
return PayTransactionConvert.INSTANCE.convertPage(payTransactionPage);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,6 +66,8 @@ dubbo:
|
||||
version: 1.0.0
|
||||
ProductRecommendRpc:
|
||||
version: 1.0.0
|
||||
PayTransactionRpc:
|
||||
version: 1.0.0
|
||||
|
||||
# Swagger 配置项
|
||||
swagger:
|
||||
|
||||
Reference in New Issue
Block a user