mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 16:35:06 +08:00
code review:订单统计
This commit is contained in:
@ -108,6 +108,7 @@ public class TradeStatisticsController {
|
||||
// 订单统计
|
||||
Long undeliveredCount = tradeOrderStatisticsService.getCountByStatusAndDeliveryType(
|
||||
TradeOrderStatusEnum.UNDELIVERED.getStatus(), DeliveryTypeEnum.EXPRESS.getType());
|
||||
// TODO @疯狂:订单支付后,如果是门店自提的,需要 update 成 DELIVERED;;目前还没搞~~突然反应过来
|
||||
Long pickUpCount = tradeOrderStatisticsService.getCountByStatusAndDeliveryType(
|
||||
TradeOrderStatusEnum.DELIVERED.getStatus(), DeliveryTypeEnum.PICK_UP.getType());
|
||||
// 售后统计
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.statistics.job.trade;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
@ -10,6 +11,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
// TODO 芋艿:缺个 Job 的配置;等和 Product 一起配置
|
||||
/**
|
||||
* 交易统计 Job
|
||||
*
|
||||
@ -30,10 +32,10 @@ public class TradeStatisticsJob implements JobHandler {
|
||||
@Override
|
||||
@TenantJob
|
||||
public String execute(String param) {
|
||||
// 默认 昨日
|
||||
if (StrUtil.isBlank(param)) {
|
||||
param = "1";
|
||||
} else if (!NumberUtil.isInteger(param)) {
|
||||
// 默认昨日
|
||||
param = ObjUtil.defaultIfBlank(param, "1");
|
||||
// 校验参数的合理性
|
||||
if (!NumberUtil.isInteger(param)) {
|
||||
throw new RuntimeException("交易统计任务的参数只能为是正整数");
|
||||
}
|
||||
Integer days = Convert.toInt(param, 0);
|
||||
|
@ -129,7 +129,6 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService {
|
||||
entity = TradeStatisticsConvert.INSTANCE.convert(date, orderSummary, afterSaleSummary, brokerageSettlementPrice,
|
||||
walletSummary);
|
||||
tradeStatisticsMapper.insert(entity);
|
||||
// TODO @疯狂:这里是不是也要把日期带上?类似 108 那边; 110 已经带上了
|
||||
return stopWatch.prettyPrint();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user