mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-01 18:27:02 +00:00
feat 驾驶舱接口
This commit is contained in:
@@ -58,18 +58,18 @@ public class CockpitReportController {
|
||||
return Res.ok(cockpitReportService.getRefundOrderCount(query));
|
||||
}
|
||||
|
||||
@Operation(summary = "支付通道折线图")
|
||||
@GetMapping("/getPayChannelLine")
|
||||
public ResResult<List<ChannelLineReport>> getPayChannelLine(@ParameterObject CockpitReportQuery query){
|
||||
@Operation(summary = "显示通道支付订单金额和订单数")
|
||||
@GetMapping("/getPayChannelInfo")
|
||||
public ResResult<List<ChannelLineReport>> getPayChannelInfo(@ParameterObject CockpitReportQuery query){
|
||||
ValidationUtil.validateParam(query);
|
||||
return Res.ok(cockpitReportService.getPayChannelLine(query));
|
||||
return Res.ok(cockpitReportService.getPayChannelInfo(query));
|
||||
}
|
||||
|
||||
@Operation(summary = "退款通道折线图")
|
||||
@GetMapping("/getRefundChannelLine")
|
||||
public ResResult<List<ChannelLineReport>> getRefundChannelLine(@ParameterObject CockpitReportQuery query){
|
||||
@Operation(summary = "显示通道退款订单金额和订单数")
|
||||
@GetMapping("/getRefundChannelInfo")
|
||||
public ResResult<List<ChannelLineReport>> getRefundChannelInfo(@ParameterObject CockpitReportQuery query){
|
||||
ValidationUtil.validateParam(query);
|
||||
return Res.ok(cockpitReportService.getRefundChannelLine(query));
|
||||
return Res.ok(cockpitReportService.getRefundChannelInfo(query));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ import cn.bootx.platform.daxpay.service.param.report.CockpitReportQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 查询报表
|
||||
@@ -17,12 +18,12 @@ public interface CockpitReportMapper {
|
||||
/**
|
||||
* 获取支付金额
|
||||
*/
|
||||
Integer getPayAmount(CockpitReportQuery query);
|
||||
Optional<Integer> getPayAmount(CockpitReportQuery query);
|
||||
|
||||
/**
|
||||
* 获取退款金额
|
||||
*/
|
||||
Integer getRefundAmount(CockpitReportQuery query);
|
||||
Optional<Integer> getRefundAmount(CockpitReportQuery query);
|
||||
|
||||
/**
|
||||
* 获取支付订单数量
|
||||
@@ -37,12 +38,12 @@ public interface CockpitReportMapper {
|
||||
/**
|
||||
* 支付通道订单折线图
|
||||
*/
|
||||
List<ChannelOrderLine> getPayChannelLine(CockpitReportQuery query);
|
||||
List<ChannelOrderLine> getPayChannelInfo(CockpitReportQuery query);
|
||||
|
||||
/**
|
||||
* 退款通道订单折线图
|
||||
*/
|
||||
List<ChannelOrderLine> getRefundChannelLine(CockpitReportQuery query);
|
||||
List<ChannelOrderLine> getRefundChannelInfo(CockpitReportQuery query);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -34,14 +34,14 @@ public class CockpitReportService {
|
||||
*/
|
||||
public Integer getPayAmount(CockpitReportQuery query){
|
||||
// 获取支付成功的订单
|
||||
return cockpitReportMapper.getPayAmount(query);
|
||||
return cockpitReportMapper.getPayAmount(query).orElse(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款金额(分)
|
||||
*/
|
||||
public Integer getRefundAmount(CockpitReportQuery query){
|
||||
return cockpitReportMapper.getRefundAmount(query);
|
||||
return cockpitReportMapper.getRefundAmount(query).orElse(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,10 +59,10 @@ public class CockpitReportService {
|
||||
}
|
||||
|
||||
/**
|
||||
* (折线图)显示各通道支付分为支付金额和订单数,
|
||||
* (折线图/占比图)显示各通道支付分为支付金额和订单数
|
||||
*/
|
||||
public List<ChannelLineReport> getPayChannelLine(CockpitReportQuery query){
|
||||
Map<String, ChannelOrderLine> lineMap = cockpitReportMapper.getPayChannelLine(query)
|
||||
public List<ChannelLineReport> getPayChannelInfo(CockpitReportQuery query){
|
||||
Map<String, ChannelOrderLine> lineMap = cockpitReportMapper.getPayChannelInfo(query)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(ChannelOrderLine::getChannel, Function.identity(), CollectorsFunction::retainLatest));
|
||||
// 根据系统中有的通道编码,获取对应的通道名称
|
||||
@@ -83,10 +83,10 @@ public class CockpitReportService {
|
||||
}
|
||||
|
||||
/**
|
||||
* (折线图)显示各通道退款金额和订单数,
|
||||
* (折线图/占比图)显示各通道退款金额和订单数,
|
||||
*/
|
||||
public List<ChannelLineReport> getRefundChannelLine(CockpitReportQuery query){
|
||||
Map<String, ChannelOrderLine> lineMap = cockpitReportMapper.getRefundChannelLine(query)
|
||||
public List<ChannelLineReport> getRefundChannelInfo(CockpitReportQuery query){
|
||||
Map<String, ChannelOrderLine> lineMap = cockpitReportMapper.getRefundChannelInfo(query)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(ChannelOrderLine::getChannel, Function.identity(), CollectorsFunction::retainLatest));
|
||||
// 根据系统中有的通道编码,获取对应的通道名称
|
||||
|
@@ -26,8 +26,8 @@ public class CockpitReportQuery {
|
||||
@DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@NotNull(message = "开始时间不得为空")
|
||||
@Schema(description = "开始时间")
|
||||
@NotNull(message = "结束时间不得为空")
|
||||
@Schema(description = "结束时间")
|
||||
@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
@DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
private LocalDateTime endTime;
|
||||
|
@@ -47,7 +47,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 支付通道折线图 -->
|
||||
<select id="getPayChannelLine" resultType="cn.bootx.platform.daxpay.service.core.report.entity.ChannelOrderLine">
|
||||
<select id="getPayChannelInfo" resultType="cn.bootx.platform.daxpay.service.core.report.entity.ChannelOrderLine">
|
||||
SELECT
|
||||
channel,
|
||||
count(*) as count,
|
||||
@@ -62,7 +62,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 退款通道折线图 -->
|
||||
<select id="getRefundChannelLine" resultType="cn.bootx.platform.daxpay.service.core.report.entity.ChannelOrderLine">
|
||||
<select id="getRefundChannelInfo" resultType="cn.bootx.platform.daxpay.service.core.report.entity.ChannelOrderLine">
|
||||
SELECT
|
||||
channel,
|
||||
count(*) as count,
|
||||
|
Reference in New Issue
Block a user