统计:交易统计定时任务
parent
df4716d5a1
commit
a9e822762d
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.statistics.job.trade;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||||
|
import cn.iocoder.yudao.module.statistics.service.trade.TradeStatisticsService;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易统计 Job
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class TradeStatisticsJob implements JobHandler {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TradeStatisticsService tradeStatisticsService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@TenantJob
|
||||||
|
public String execute(String param) {
|
||||||
|
String times = tradeStatisticsService.statisticsYesterdayTrade();
|
||||||
|
return StrUtil.format("交易统计耗时: {}", times);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.api.aftersale;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.trade.api.aftersale.dto.AfterSaleSummaryRespDTO;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后 API 接口
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
public interface TradeAfterSaleApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取售后单统计
|
||||||
|
*
|
||||||
|
* @param beginTime 起始时间
|
||||||
|
* @param endTime 截止时间
|
||||||
|
* @return 售后统计结果
|
||||||
|
*/
|
||||||
|
AfterSaleSummaryRespDTO getAfterSaleSummary(LocalDateTime beginTime, LocalDateTime endTime);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.api.brokerage;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销 API 接口
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
public interface TradeBrokerageApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取已结算的佣金金额
|
||||||
|
*
|
||||||
|
* @param beginTime 起始时间
|
||||||
|
* @param endTime 截止时间
|
||||||
|
* @return 已结算的佣金金额
|
||||||
|
*/
|
||||||
|
Integer getBrokerageSettlementPriceSummary(LocalDateTime beginTime, LocalDateTime endTime);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.api.aftersale;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.trade.api.aftersale.dto.AfterSaleSummaryRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后 API 接口实现类
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class TradeAfterSaleApiImpl implements TradeAfterSaleApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AfterSaleService afterSaleService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AfterSaleSummaryRespDTO getAfterSaleSummary(LocalDateTime beginTime, LocalDateTime endTime) {
|
||||||
|
return afterSaleService.getAfterSaleSummary(beginTime, endTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.api.brokerage;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.trade.service.brokerage.BrokerageRecordService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单 API 接口实现类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class TradeBrokerageApiImpl implements TradeBrokerageApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BrokerageRecordService brokerageRecordService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getBrokerageSettlementPriceSummary(LocalDateTime beginTime, LocalDateTime endTime) {
|
||||||
|
return brokerageRecordService.getBrokerageSettlementPriceSummary(beginTime, endTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.pay.api.wallet;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.pay.api.wallet.dto.WalletSummaryRespDTO;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钱包 API 接口
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
public interface PayWalletApi {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取钱包统计
|
||||||
|
*
|
||||||
|
* @param beginTime 起始时间
|
||||||
|
* @param endTime 截止时间
|
||||||
|
* @return 钱包统计
|
||||||
|
*/
|
||||||
|
WalletSummaryRespDTO getWalletSummary(LocalDateTime beginTime, LocalDateTime endTime);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.pay.api.wallet;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.pay.api.wallet.dto.WalletSummaryRespDTO;
|
||||||
|
import cn.iocoder.yudao.module.pay.enums.member.PayWalletBizTypeEnum;
|
||||||
|
import cn.iocoder.yudao.module.pay.service.wallet.PayWalletRechargeService;
|
||||||
|
import cn.iocoder.yudao.module.pay.service.wallet.PayWalletTransactionService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钱包 API 接口实现类
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class PayWalletApiImpl implements PayWalletApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PayWalletRechargeService payWalletRechargeService;
|
||||||
|
@Resource
|
||||||
|
private PayWalletTransactionService payWalletTransactionService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WalletSummaryRespDTO getWalletSummary(LocalDateTime beginTime, LocalDateTime endTime) {
|
||||||
|
WalletSummaryRespDTO walletSummary = payWalletRechargeService.getWalletSummary(beginTime, endTime);
|
||||||
|
walletSummary.setOrderWalletPayPrice(payWalletTransactionService.getPriceSummary(PayWalletBizTypeEnum.PAYMENT, beginTime, endTime));
|
||||||
|
return walletSummary;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue