Commit 721adfbf6052e7820c583fbeb50d865fd087f4d3
1 parent
3caa5f14
mall + pay:
1. 优化退款管理的导出实现
Showing
7 changed files
with
90 additions
and
168 deletions
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/PayRefundController.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.controller.admin.refund; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollectionUtil; |
| 4 | -import cn.hutool.core.util.ObjectUtil; | |
| 5 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 6 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 6 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 8 | 7 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 9 | -import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; | |
| 10 | 8 | import cn.iocoder.yudao.module.pay.controller.admin.refund.vo.*; |
| 11 | 9 | import cn.iocoder.yudao.module.pay.convert.refund.PayRefundConvert; |
| 12 | 10 | import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; |
| 13 | -import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO; | |
| 14 | 11 | import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; |
| 15 | 12 | import cn.iocoder.yudao.module.pay.service.app.PayAppService; |
| 16 | 13 | import cn.iocoder.yudao.module.pay.service.order.PayOrderService; |
| ... | ... | @@ -62,8 +59,7 @@ public class PayRefundController { |
| 62 | 59 | |
| 63 | 60 | // 拼接数据 |
| 64 | 61 | PayAppDO app = appService.getApp(refund.getAppId()); |
| 65 | - PayOrderDO order = orderService.getOrder(refund.getOrderId()); | |
| 66 | - return success(PayRefundConvert.INSTANCE.convert(refund, order, app)); | |
| 62 | + return success(PayRefundConvert.INSTANCE.convert(refund, app)); | |
| 67 | 63 | } |
| 68 | 64 | |
| 69 | 65 | @GetMapping("/page") |
| ... | ... | @@ -93,29 +89,11 @@ public class PayRefundController { |
| 93 | 89 | return; |
| 94 | 90 | } |
| 95 | 91 | |
| 96 | - // 处理应用ID数据 | |
| 97 | - Map<Long, PayAppDO> appMap = appService.getAppMap( | |
| 98 | - convertList(list, PayRefundDO::getAppId)); | |
| 99 | - | |
| 100 | - List<PayRefundExcelVO> excelDatum = new ArrayList<>(list.size()); | |
| 101 | - // 处理商品名称数据 | |
| 102 | - Map<Long, PayOrderDO> orderMap = orderService.getOrderSubjectMap( | |
| 103 | - convertList(list, PayRefundDO::getOrderId)); | |
| 104 | - | |
| 105 | - list.forEach(c -> { | |
| 106 | - PayAppDO appDO = appMap.get(c.getAppId()); | |
| 107 | - PayChannelEnum channelEnum = PayChannelEnum.getByCode(c.getChannelCode()); | |
| 108 | - | |
| 109 | - PayRefundExcelVO excelItem = PayRefundConvert.INSTANCE.excelConvert(c); | |
| 110 | - excelItem.setAppName(ObjectUtil.isNotNull(appDO) ? appDO.getName() : "未知应用"); | |
| 111 | - excelItem.setChannelCodeName(ObjectUtil.isNotNull(channelEnum) ? channelEnum.getName() : "未知渠道"); | |
| 112 | - excelItem.setSubject(orderMap.get(c.getOrderId()).getSubject()); | |
| 113 | - | |
| 114 | - excelDatum.add(excelItem); | |
| 115 | - }); | |
| 116 | - | |
| 92 | + // 拼接返回 | |
| 93 | + Map<Long, PayAppDO> appMap = appService.getAppMap(convertList(list, PayRefundDO::getAppId)); | |
| 94 | + List<PayRefundExcelVO> excelList = PayRefundConvert.INSTANCE.convertList(list, appMap); | |
| 117 | 95 | // 导出 Excel |
| 118 | - ExcelUtils.write(response, "退款订单.xls", "数据", PayRefundExcelVO.class, excelDatum); | |
| 96 | + ExcelUtils.write(response, "退款订单.xls", "数据", PayRefundExcelVO.class, excelList); | |
| 119 | 97 | } |
| 120 | 98 | |
| 121 | 99 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExcelVO.java
| ... | ... | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.pay.controller.admin.refund.vo; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| 5 | +import cn.iocoder.yudao.framework.excel.core.convert.MoneyConvert; | |
| 5 | 6 | import cn.iocoder.yudao.module.pay.enums.DictTypeConstants; |
| 6 | 7 | import com.alibaba.excel.annotation.ExcelProperty; |
| 7 | 8 | import lombok.Data; |
| ... | ... | @@ -19,56 +20,42 @@ public class PayRefundExcelVO { |
| 19 | 20 | @ExcelProperty("支付退款编号") |
| 20 | 21 | private Long id; |
| 21 | 22 | |
| 22 | - @ExcelProperty("商品名称") | |
| 23 | - private String subject; | |
| 23 | + @ExcelProperty("创建时间") | |
| 24 | + private LocalDateTime createTime; | |
| 24 | 25 | |
| 25 | - @ExcelProperty(value = "应用名称") | |
| 26 | - private String appName; | |
| 26 | + @ExcelProperty(value = "支付金额", converter = MoneyConvert.class) | |
| 27 | + private Integer payPrice; | |
| 27 | 28 | |
| 28 | - @ExcelProperty(value = "渠道编号名称") | |
| 29 | - private String channelCodeName; | |
| 29 | + @ExcelProperty(value = "退款金额", converter = MoneyConvert.class) | |
| 30 | + private Integer refundPrice; | |
| 30 | 31 | |
| 31 | - @ExcelProperty("交易订单号") | |
| 32 | - private String tradeNo; | |
| 32 | + @ExcelProperty("商户退款单号") | |
| 33 | + private String merchantRefundId; | |
| 34 | + @ExcelProperty("退款单号") | |
| 35 | + private String no; | |
| 36 | + @ExcelProperty("渠道退款单号") | |
| 37 | + private String channelRefundNo; | |
| 33 | 38 | |
| 34 | - @ExcelProperty("商户订单编号") | |
| 39 | + @ExcelProperty("商户支付单号") | |
| 35 | 40 | private String merchantOrderId; |
| 41 | + @ExcelProperty("渠道支付单号") | |
| 42 | + private String channelOrderNo; | |
| 36 | 43 | |
| 37 | - @ExcelProperty("商户退款订单号") | |
| 38 | - private String merchantRefundNo; | |
| 39 | - | |
| 40 | - @ExcelProperty("异步通知商户地址") | |
| 41 | - private String notifyUrl; | |
| 42 | - | |
| 43 | - @DictFormat(DictTypeConstants.REFUND_STATUS) | |
| 44 | 44 | @ExcelProperty(value = "退款状态", converter = DictConvert.class) |
| 45 | + @DictFormat(DictTypeConstants.REFUND_STATUS) | |
| 45 | 46 | private Integer status; |
| 46 | 47 | |
| 47 | - @ExcelProperty("支付金额,单位:元") | |
| 48 | - private String payPrice; | |
| 48 | + @ExcelProperty(value = "退款渠道", converter = DictConvert.class) | |
| 49 | + @DictFormat(DictTypeConstants.CHANNEL_CODE) | |
| 50 | + private String channelCode; | |
| 49 | 51 | |
| 50 | - @ExcelProperty("退款金额,单位:元") | |
| 51 | - private String refundPrice; | |
| 52 | + @ExcelProperty("成功时间") | |
| 53 | + private LocalDateTime successTime; | |
| 54 | + | |
| 55 | + @ExcelProperty(value = "支付应用") | |
| 56 | + private String appName; | |
| 52 | 57 | |
| 53 | 58 | @ExcelProperty("退款原因") |
| 54 | 59 | private String reason; |
| 55 | 60 | |
| 56 | - @ExcelProperty("用户付款 IP") | |
| 57 | - private String userIp; | |
| 58 | - | |
| 59 | - @ExcelProperty("渠道订单号") | |
| 60 | - private String channelOrderNo; | |
| 61 | - | |
| 62 | - @ExcelProperty("渠道退款单号") | |
| 63 | - private String channelRefundNo; | |
| 64 | - | |
| 65 | - @ExcelProperty("创建时间") | |
| 66 | - private LocalDateTime createTime; | |
| 67 | - | |
| 68 | - @ExcelProperty("退款成功时间") | |
| 69 | - private LocalDateTime successTime; | |
| 70 | - | |
| 71 | - @ExcelProperty("退款失效时间") | |
| 72 | - private LocalDateTime expireTime; | |
| 73 | - | |
| 74 | 61 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/refund/PayRefundConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.convert.refund; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 4 | 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 5 | 6 | import cn.iocoder.yudao.module.pay.api.refund.dto.PayRefundCreateReqDTO; |
| 6 | 7 | import cn.iocoder.yudao.module.pay.api.refund.dto.PayRefundRespDTO; |
| ... | ... | @@ -13,8 +14,7 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; |
| 13 | 14 | import org.mapstruct.Mapper; |
| 14 | 15 | import org.mapstruct.factory.Mappers; |
| 15 | 16 | |
| 16 | -import java.math.BigDecimal; | |
| 17 | -import java.math.RoundingMode; | |
| 17 | +import java.util.List; | |
| 18 | 18 | import java.util.Map; |
| 19 | 19 | |
| 20 | 20 | @Mapper |
| ... | ... | @@ -23,9 +23,8 @@ public interface PayRefundConvert { |
| 23 | 23 | PayRefundConvert INSTANCE = Mappers.getMapper(PayRefundConvert.class); |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - default PayRefundDetailsRespVO convert(PayRefundDO refund, PayOrderDO order, PayAppDO app) { | |
| 27 | - PayRefundDetailsRespVO respVO = convert(refund) | |
| 28 | - .setOrder(convert(order)); | |
| 26 | + default PayRefundDetailsRespVO convert(PayRefundDO refund, PayAppDO app) { | |
| 27 | + PayRefundDetailsRespVO respVO = convert(refund); | |
| 29 | 28 | if (app != null) { |
| 30 | 29 | respVO.setAppName(app.getName()); |
| 31 | 30 | } |
| ... | ... | @@ -41,44 +40,17 @@ public interface PayRefundConvert { |
| 41 | 40 | } |
| 42 | 41 | PageResult<PayRefundPageItemRespVO> convertPage(PageResult<PayRefundDO> page); |
| 43 | 42 | |
| 44 | - /** | |
| 45 | - * 退款订单DO 转 导出excel VO | |
| 46 | - * | |
| 47 | - * @param bean 退款订单DO | |
| 48 | - * @return 导出 excel VO | |
| 49 | - */ | |
| 50 | - default PayRefundExcelVO excelConvert(PayRefundDO bean) { | |
| 51 | - if (bean == null) { | |
| 52 | - return null; | |
| 53 | - } | |
| 54 | - | |
| 55 | - PayRefundExcelVO payRefundExcelVO = new PayRefundExcelVO(); | |
| 56 | - | |
| 57 | - payRefundExcelVO.setId(bean.getId()); | |
| 58 | - payRefundExcelVO.setTradeNo(bean.getNo()); | |
| 59 | - payRefundExcelVO.setMerchantOrderId(bean.getMerchantOrderId()); | |
| 60 | - // TODO 芋艿:晚点在改 | |
| 61 | -// payRefundExcelVO.setMerchantRefundNo(bean.getMerchantRefundNo()); | |
| 62 | - payRefundExcelVO.setNotifyUrl(bean.getNotifyUrl()); | |
| 63 | - payRefundExcelVO.setStatus(bean.getStatus()); | |
| 64 | - payRefundExcelVO.setReason(bean.getReason()); | |
| 65 | - payRefundExcelVO.setUserIp(bean.getUserIp()); | |
| 66 | - payRefundExcelVO.setChannelOrderNo(bean.getChannelOrderNo()); | |
| 67 | - payRefundExcelVO.setChannelRefundNo(bean.getChannelRefundNo()); | |
| 68 | - payRefundExcelVO.setSuccessTime(bean.getSuccessTime()); | |
| 69 | - payRefundExcelVO.setCreateTime(bean.getCreateTime()); | |
| 70 | - | |
| 71 | - BigDecimal multiple = new BigDecimal(100); | |
| 72 | - payRefundExcelVO.setPayPrice(BigDecimal.valueOf(bean.getPayPrice()) | |
| 73 | - .divide(multiple, 2, RoundingMode.HALF_UP).toString()); | |
| 74 | - payRefundExcelVO.setRefundPrice(BigDecimal.valueOf(bean.getRefundPrice()) | |
| 75 | - .divide(multiple, 2, RoundingMode.HALF_UP).toString()); | |
| 76 | - | |
| 77 | - return payRefundExcelVO; | |
| 78 | - } | |
| 79 | - | |
| 80 | 43 | PayRefundDO convert(PayRefundCreateReqDTO bean); |
| 81 | 44 | |
| 82 | 45 | PayRefundRespDTO convert02(PayRefundDO bean); |
| 83 | 46 | |
| 47 | + default List<PayRefundExcelVO> convertList(List<PayRefundDO> list, Map<Long, PayAppDO> appMap) { | |
| 48 | + return CollectionUtils.convertList(list, order -> { | |
| 49 | + PayRefundExcelVO excelVO = convertExcel(order); | |
| 50 | + MapUtils.findAndThen(appMap, order.getAppId(), app -> excelVO.setAppName(app.getName())); | |
| 51 | + return excelVO; | |
| 52 | + }); | |
| 53 | + } | |
| 54 | + PayRefundExcelVO convertExcel(PayRefundDO bean); | |
| 55 | + | |
| 84 | 56 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderService.java
| 1 | 1 | package cn.iocoder.yudao.module.pay.service.order; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 5 | 4 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO; |
| 6 | 5 | import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO; |
| 7 | 6 | import cn.iocoder.yudao.module.pay.controller.admin.order.vo.PayOrderExportReqVO; |
| ... | ... | @@ -13,9 +12,7 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderExtensionDO; |
| 13 | 12 | |
| 14 | 13 | import javax.validation.Valid; |
| 15 | 14 | import javax.validation.constraints.NotEmpty; |
| 16 | -import java.util.Collection; | |
| 17 | 15 | import java.util.List; |
| 18 | -import java.util.Map; | |
| 19 | 16 | |
| 20 | 17 | /** |
| 21 | 18 | * 支付订单 Service 接口 |
| ... | ... | @@ -66,25 +63,6 @@ public interface PayOrderService { |
| 66 | 63 | List<PayOrderDO> getOrderList(PayOrderExportReqVO exportReqVO); |
| 67 | 64 | |
| 68 | 65 | /** |
| 69 | - * 获得支付订单列表 | |
| 70 | - * | |
| 71 | - * @param ids 订单 ID 集合 | |
| 72 | - * @return 支付订单列表 | |
| 73 | - */ | |
| 74 | - List<PayOrderDO> getOrderList(Collection<Long> ids); | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * 获得支付订单 Map | |
| 78 | - * | |
| 79 | - * @param ids 订单 ID 集合 | |
| 80 | - * @return 支付订单 Map 集合 | |
| 81 | - */ | |
| 82 | - default Map<Long, PayOrderDO> getOrderSubjectMap(Collection<Long> ids) { | |
| 83 | - List<PayOrderDO> list = getOrderList(ids); | |
| 84 | - return CollectionUtils.convertMap(list, PayOrderDO::getId); | |
| 85 | - } | |
| 86 | - | |
| 87 | - /** | |
| 88 | 66 | * 创建支付单 |
| 89 | 67 | * |
| 90 | 68 | * @param reqDTO 创建请求 | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java
| ... | ... | @@ -41,7 +41,6 @@ import org.springframework.validation.annotation.Validated; |
| 41 | 41 | |
| 42 | 42 | import javax.annotation.Resource; |
| 43 | 43 | import java.time.LocalDateTime; |
| 44 | -import java.util.Collection; | |
| 45 | 44 | import java.util.List; |
| 46 | 45 | import java.util.Objects; |
| 47 | 46 | |
| ... | ... | @@ -103,11 +102,6 @@ public class PayOrderServiceImpl implements PayOrderService { |
| 103 | 102 | } |
| 104 | 103 | |
| 105 | 104 | @Override |
| 106 | - public List<PayOrderDO> getOrderList(Collection<Long> ids) { | |
| 107 | - return orderMapper.selectBatchIds(ids); | |
| 108 | - } | |
| 109 | - | |
| 110 | - @Override | |
| 111 | 105 | public Long createOrder(PayOrderCreateReqDTO reqDTO) { |
| 112 | 106 | // 校验 App |
| 113 | 107 | PayAppDO app = appService.validPayApp(reqDTO.getAppId()); | ... | ... |
yudao-ui-admin/src/views/pay/order/index.vue
| ... | ... | @@ -127,7 +127,7 @@ |
| 127 | 127 | <el-tag size="small">{{ orderDetail.merchantOrderId }}</el-tag> |
| 128 | 128 | </el-descriptions-item> |
| 129 | 129 | <el-descriptions-item label="支付单号"> |
| 130 | - <el-tag type="warning" v-if="orderDetail.no">{{ orderDetail.no }}</el-tag> | |
| 130 | + <el-tag type="warning" size="small" v-if="orderDetail.no">{{ orderDetail.no }}</el-tag> | |
| 131 | 131 | </el-descriptions-item> |
| 132 | 132 | </el-descriptions> |
| 133 | 133 | <el-descriptions :column="2" label-class-name="desc-label"> |
| ... | ... | @@ -278,7 +278,6 @@ export default { |
| 278 | 278 | this.open = true; |
| 279 | 279 | }); |
| 280 | 280 | }, |
| 281 | - | |
| 282 | 281 | /** 导出按钮操作 */ |
| 283 | 282 | handleExport() { |
| 284 | 283 | // 处理查询参数 | ... | ... |
yudao-ui-admin/src/views/pay/refund/index.vue
| ... | ... | @@ -78,7 +78,7 @@ |
| 78 | 78 | <el-tag size="mini">商户</el-tag> {{scope.row.merchantRefundId}} |
| 79 | 79 | </p> |
| 80 | 80 | <p class="order-font"> |
| 81 | - <el-tag size="mini" type="warning">支付</el-tag> {{scope.row.no}} | |
| 81 | + <el-tag size="mini" type="warning">退款</el-tag> {{scope.row.no}} | |
| 82 | 82 | </p> |
| 83 | 83 | <p class="order-font" v-if="scope.row.channelRefundNo"> |
| 84 | 84 | <el-tag size="mini" type="success">渠道</el-tag> {{scope.row.channelRefundNo}} |
| ... | ... | @@ -110,6 +110,11 @@ |
| 110 | 110 | <span>{{ parseTime(scope.row.successTime) }}</span> |
| 111 | 111 | </template> |
| 112 | 112 | </el-table-column> |
| 113 | + <el-table-column label="支付应用" align="center" prop="successTime" width="100"> | |
| 114 | + <template v-slot="scope"> | |
| 115 | + <span>{{ scope.row.appName }}</span> | |
| 116 | + </template> | |
| 117 | + </el-table-column> | |
| 113 | 118 | <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width"> |
| 114 | 119 | <template v-slot="scope"> |
| 115 | 120 | <el-button size="mini" type="text" icon="el-icon-search" @click="handleQueryDetails(scope.row)" |
| ... | ... | @@ -122,64 +127,75 @@ |
| 122 | 127 | <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" |
| 123 | 128 | @pagination="getList"/> |
| 124 | 129 | |
| 125 | - <!-- 对话框(添加 / 修改) --> | |
| 130 | + <!-- 对话框(详情) --> | |
| 126 | 131 | <el-dialog title="退款订单详情" :visible.sync="open" width="700px" append-to-body> |
| 127 | 132 | <el-descriptions :column="2" label-class-name="desc-label"> |
| 128 | - <el-descriptions-item label="应用名称">{{ refundDetail.appName }}</el-descriptions-item> | |
| 129 | - <el-descriptions-item label="商品名称">{{ refundDetail.subject }}</el-descriptions-item> | |
| 133 | + <el-descriptions-item label="商户退款单号"> | |
| 134 | + <el-tag size="small">{{ refundDetail.merchantRefundId }}</el-tag> | |
| 135 | + </el-descriptions-item> | |
| 136 | + <el-descriptions-item label="渠道退款单号"> | |
| 137 | + <el-tag type="success" size="small" v-if="refundDetail.channelRefundNo">{{ refundDetail.channelRefundNo }}</el-tag> | |
| 138 | + </el-descriptions-item> | |
| 130 | 139 | </el-descriptions> |
| 131 | - <el-divider></el-divider> | |
| 132 | 140 | <el-descriptions :column="2" label-class-name="desc-label"> |
| 133 | - <el-descriptions-item label="商户退款单号"> | |
| 134 | - <el-tag size="mini">{{ refundDetail.merchantRefundNo }}</el-tag> | |
| 141 | + <el-descriptions-item label="商户支付单号"> | |
| 142 | + <el-tag size="small">{{ refundDetail.merchantOrderId }}</el-tag> | |
| 143 | + </el-descriptions-item> | |
| 144 | + <el-descriptions-item label="渠道支付单号"> | |
| 145 | + <el-tag type="success" size="small">{{ refundDetail.channelOrderNo }}</el-tag> | |
| 135 | 146 | </el-descriptions-item> |
| 136 | - <el-descriptions-item label="商户订单号">{{ refundDetail.merchantOrderId }}</el-descriptions-item> | |
| 137 | - <el-descriptions-item label="交易订单号">{{ refundDetail.tradeNo }}</el-descriptions-item> | |
| 138 | 147 | </el-descriptions> |
| 139 | - <el-divider></el-divider> | |
| 148 | + <el-descriptions :column="2" label-class-name="desc-label"> | |
| 149 | + <el-descriptions-item label="应用编号">{{ refundDetail.appId }}</el-descriptions-item> | |
| 150 | + <el-descriptions-item label="应用名称">{{ refundDetail.appName }}</el-descriptions-item> | |
| 151 | + </el-descriptions> | |
| 140 | 152 | <el-descriptions :column="2" label-class-name="desc-label"> |
| 141 | 153 | <el-descriptions-item label="支付金额"> |
| 142 | - {{ parseFloat(refundDetail.payPrice / 100).toFixed(2) }} | |
| 154 | + <el-tag type="success" size="small">¥{{ (refundDetail.payPrice / 100.0).toFixed(2) }}</el-tag> | |
| 143 | 155 | </el-descriptions-item> |
| 144 | - <el-descriptions-item label="退款金额" size="mini"> | |
| 145 | - <el-tag class="tag-purple" size="mini">{{ parseFloat(refundDetail.refundPrice / 100).toFixed(2) }}</el-tag> | |
| 156 | + <el-descriptions-item label="退款金额"> | |
| 157 | + <el-tag size="mini" type="danger">¥{{ (refundDetail.refundPrice / 100.0).toFixed(2) }}</el-tag> | |
| 146 | 158 | </el-descriptions-item> |
| 159 | + </el-descriptions> | |
| 160 | + <el-descriptions :column="2" label-class-name="desc-label"> | |
| 147 | 161 | <el-descriptions-item label="退款状态"> |
| 148 | 162 | <dict-tag :type="DICT_TYPE.PAY_REFUND_STATUS" :value="refundDetail.status" /> |
| 149 | 163 | </el-descriptions-item> |
| 164 | + <el-descriptions-item label="退款时间">{{ parseTime(refundDetail.successTime) }}</el-descriptions-item> | |
| 165 | + </el-descriptions> | |
| 166 | + <el-descriptions :column="2" label-class-name="desc-label"> | |
| 150 | 167 | <el-descriptions-item label="创建时间">{{ parseTime(refundDetail.createTime) }}</el-descriptions-item> |
| 151 | - <el-descriptions-item label="退款成功时间">{{ parseTime(refundDetail.successTime) }}</el-descriptions-item> | |
| 152 | - <el-descriptions-item label="退款失效时间">{{ parseTime(refundDetail.expireTime) }}</el-descriptions-item> | |
| 153 | 168 | <el-descriptions-item label="更新时间">{{ parseTime(refundDetail.updateTime) }}</el-descriptions-item> |
| 154 | 169 | </el-descriptions> |
| 155 | - <el-divider></el-divider> | |
| 170 | + <!-- 分割线 --> | |
| 171 | + <el-divider /> | |
| 156 | 172 | <el-descriptions :column="2" label-class-name="desc-label"> |
| 157 | - <el-descriptions-item label="支付渠道"> | |
| 158 | - {{ refundDetail.channelCodeName }} | |
| 173 | + <el-descriptions-item label="退款渠道"> | |
| 174 | + <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="refundDetail.channelCode" /> | |
| 159 | 175 | </el-descriptions-item> |
| 160 | - <el-descriptions-item label="支付IP" size="mini"> | |
| 161 | - {{refundDetail.userIp}} | |
| 162 | - </el-descriptions-item> | |
| 163 | - <el-descriptions-item label="回调地址">{{ refundDetail.notifyUrl }}</el-descriptions-item> | |
| 176 | + <el-descriptions-item label="退款原因">{{ refundDetail.reason }}</el-descriptions-item> | |
| 177 | + </el-descriptions> | |
| 178 | + <el-descriptions :column="2" label-class-name="desc-label"> | |
| 179 | + <el-descriptions-item label="退款 IP">{{ refundDetail.userIp }}</el-descriptions-item> | |
| 180 | + <el-descriptions-item label="通知 URL">{{ refundDetail.notifyUrl }}</el-descriptions-item> | |
| 164 | 181 | </el-descriptions> |
| 182 | + <!-- 分割线 --> | |
| 165 | 183 | <el-divider></el-divider> |
| 166 | 184 | <el-descriptions :column="2" label-class-name="desc-label"> |
| 167 | - <el-descriptions-item label="渠道订单号">{{ refundDetail.channelOrderNo }}</el-descriptions-item> | |
| 168 | - <el-descriptions-item label="渠道退款单号">{{ refundDetail.channelRefundNo }}</el-descriptions-item> | |
| 169 | 185 | <el-descriptions-item label="渠道错误码">{{refundDetail.channelErrorCode}}</el-descriptions-item> |
| 170 | 186 | <el-descriptions-item label="渠道错误码描述">{{refundDetail.channelErrorMsg}}</el-descriptions-item> |
| 171 | 187 | </el-descriptions> |
| 172 | - <br> | |
| 173 | 188 | <el-descriptions :column="1" label-class-name="desc-label" direction="vertical" border> |
| 174 | - <el-descriptions-item label="渠道额外参数">{{ refundDetail.channelExtras }}</el-descriptions-item> | |
| 175 | - <el-descriptions-item label="退款原因">{{ refundDetail.reason }}</el-descriptions-item> | |
| 189 | + <el-descriptions-item label="支付通道异步回调内容"> | |
| 190 | + {{ refundDetail.channelNotifyData }} | |
| 191 | + </el-descriptions-item> | |
| 176 | 192 | </el-descriptions> |
| 177 | 193 | </el-dialog> |
| 178 | 194 | </div> |
| 179 | 195 | </template> |
| 180 | 196 | |
| 181 | 197 | <script> |
| 182 | -import {getRefundPage, exportRefundExcel, getRefund} from "@/api/pay/refund"; | |
| 198 | +import { getRefundPage, exportRefundExcel, getRefund } from "@/api/pay/refund"; | |
| 183 | 199 | import { getAppList } from "@/api/pay/app"; |
| 184 | 200 | |
| 185 | 201 | export default { |
| ... | ... | @@ -213,7 +229,7 @@ export default { |
| 213 | 229 | createTime: [] |
| 214 | 230 | }, |
| 215 | 231 | // 支付应用列表集合 |
| 216 | - appList: null, | |
| 232 | + appList: [], | |
| 217 | 233 | // 退款订单详情 |
| 218 | 234 | refundDetail: {}, |
| 219 | 235 | }; |
| ... | ... | @@ -263,9 +279,7 @@ export default { |
| 263 | 279 | this.$download.excel(response, '退款订单.xls'); |
| 264 | 280 | }).catch(() => {}); |
| 265 | 281 | }, |
| 266 | - /** | |
| 267 | - * 查看订单详情 | |
| 268 | - */ | |
| 282 | + /** 详情按钮操作 */ | |
| 269 | 283 | handleQueryDetails(row) { |
| 270 | 284 | this.refundDetail = {}; |
| 271 | 285 | getRefund(row.id).then(response => { | ... | ... |