mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
code review:订单统计
This commit is contained in:
parent
0dcab0363d
commit
4b0333f3e9
@ -88,6 +88,8 @@ public class ServletUtils {
|
|||||||
return ServletUtil.getClientIP(request);
|
return ServletUtil.getClientIP(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @疯狂:terminal 还是从 ServletUtils 里拿,更容易全局治理;
|
||||||
|
|
||||||
public static boolean isJsonRequest(ServletRequest request) {
|
public static boolean isJsonRequest(ServletRequest request) {
|
||||||
return StrUtil.startWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE);
|
return StrUtil.startWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE);
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,7 @@ public class TradeStatisticsController {
|
|||||||
// 订单统计
|
// 订单统计
|
||||||
Long undeliveredCount = tradeOrderStatisticsService.getCountByStatusAndDeliveryType(
|
Long undeliveredCount = tradeOrderStatisticsService.getCountByStatusAndDeliveryType(
|
||||||
TradeOrderStatusEnum.UNDELIVERED.getStatus(), DeliveryTypeEnum.EXPRESS.getType());
|
TradeOrderStatusEnum.UNDELIVERED.getStatus(), DeliveryTypeEnum.EXPRESS.getType());
|
||||||
|
// TODO @疯狂:订单支付后,如果是门店自提的,需要 update 成 DELIVERED;;目前还没搞~~突然反应过来
|
||||||
Long pickUpCount = tradeOrderStatisticsService.getCountByStatusAndDeliveryType(
|
Long pickUpCount = tradeOrderStatisticsService.getCountByStatusAndDeliveryType(
|
||||||
TradeOrderStatusEnum.DELIVERED.getStatus(), DeliveryTypeEnum.PICK_UP.getType());
|
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.convert.Convert;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||||
@ -10,6 +11,7 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
// TODO 芋艿:缺个 Job 的配置;等和 Product 一起配置
|
||||||
/**
|
/**
|
||||||
* 交易统计 Job
|
* 交易统计 Job
|
||||||
*
|
*
|
||||||
@ -31,9 +33,9 @@ public class TradeStatisticsJob implements JobHandler {
|
|||||||
@TenantJob
|
@TenantJob
|
||||||
public String execute(String param) {
|
public String execute(String param) {
|
||||||
// 默认昨日
|
// 默认昨日
|
||||||
if (StrUtil.isBlank(param)) {
|
param = ObjUtil.defaultIfBlank(param, "1");
|
||||||
param = "1";
|
// 校验参数的合理性
|
||||||
} else if (!NumberUtil.isInteger(param)) {
|
if (!NumberUtil.isInteger(param)) {
|
||||||
throw new RuntimeException("交易统计任务的参数只能为是正整数");
|
throw new RuntimeException("交易统计任务的参数只能为是正整数");
|
||||||
}
|
}
|
||||||
Integer days = Convert.toInt(param, 0);
|
Integer days = Convert.toInt(param, 0);
|
||||||
|
@ -129,7 +129,6 @@ public class TradeStatisticsServiceImpl implements TradeStatisticsService {
|
|||||||
entity = TradeStatisticsConvert.INSTANCE.convert(date, orderSummary, afterSaleSummary, brokerageSettlementPrice,
|
entity = TradeStatisticsConvert.INSTANCE.convert(date, orderSummary, afterSaleSummary, brokerageSettlementPrice,
|
||||||
walletSummary);
|
walletSummary);
|
||||||
tradeStatisticsMapper.insert(entity);
|
tradeStatisticsMapper.insert(entity);
|
||||||
// TODO @疯狂:这里是不是也要把日期带上?类似 108 那边; 110 已经带上了
|
|
||||||
return stopWatch.prettyPrint();
|
return stopWatch.prettyPrint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ public enum TradeOrderOperateTypeEnum {
|
|||||||
MEMBER_RECEIVE(30, "用户已收货"),
|
MEMBER_RECEIVE(30, "用户已收货"),
|
||||||
SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"),
|
SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"),
|
||||||
ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"),
|
ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"),
|
||||||
MEMBER_PICK_UP_RECEIVE(32, "用户自提收货"),
|
|
||||||
MEMBER_COMMENT(33, "用户评价"),
|
MEMBER_COMMENT(33, "用户评价"),
|
||||||
SYSTEM_COMMENT(34, "到期未评价,系统自动评价"),
|
SYSTEM_COMMENT(34, "到期未评价,系统自动评价"),
|
||||||
MEMBER_CANCEL(40, "取消订单"),
|
MEMBER_CANCEL(40, "取消订单"),
|
||||||
|
@ -131,7 +131,7 @@ public class TradeOrderController {
|
|||||||
@Parameter(name = "id", description = "交易订单编号")
|
@Parameter(name = "id", description = "交易订单编号")
|
||||||
@PreAuthorize("@ss.hasPermission('trade:order:pick-up')")
|
@PreAuthorize("@ss.hasPermission('trade:order:pick-up')")
|
||||||
public CommonResult<Boolean> pickUpOrderById(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> pickUpOrderById(@RequestParam("id") Long id) {
|
||||||
tradeOrderUpdateService.pickUpOrderByMember(id);
|
tradeOrderUpdateService.pickUpOrderByAdmin(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public interface TradeOrderUpdateService {
|
|||||||
*
|
*
|
||||||
* @param id 订单编号
|
* @param id 订单编号
|
||||||
*/
|
*/
|
||||||
void pickUpOrderByMember(Long id);
|
void pickUpOrderByAdmin(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【管理员】核销订单
|
* 【管理员】核销订单
|
||||||
|
@ -669,8 +669,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.MEMBER_PICK_UP_RECEIVE)
|
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_PICK_UP_RECEIVE)
|
||||||
public void pickUpOrderByMember(Long id) {
|
public void pickUpOrderByAdmin(Long id) {
|
||||||
getSelf().pickUpOrder(tradeOrderMapper.selectById(id));
|
getSelf().pickUpOrder(tradeOrderMapper.selectById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user