mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
code review:订单统计
This commit is contained in:
parent
0dcab0363d
commit
4b0333f3e9
@ -88,6 +88,8 @@ public class ServletUtils {
|
||||
return ServletUtil.getClientIP(request);
|
||||
}
|
||||
|
||||
// TODO @疯狂:terminal 还是从 ServletUtils 里拿,更容易全局治理;
|
||||
|
||||
public static boolean isJsonRequest(ServletRequest request) {
|
||||
return StrUtil.startWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE);
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@ public enum TradeOrderOperateTypeEnum {
|
||||
MEMBER_RECEIVE(30, "用户已收货"),
|
||||
SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"),
|
||||
ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"),
|
||||
MEMBER_PICK_UP_RECEIVE(32, "用户自提收货"),
|
||||
MEMBER_COMMENT(33, "用户评价"),
|
||||
SYSTEM_COMMENT(34, "到期未评价,系统自动评价"),
|
||||
MEMBER_CANCEL(40, "取消订单"),
|
||||
|
@ -131,7 +131,7 @@ public class TradeOrderController {
|
||||
@Parameter(name = "id", description = "交易订单编号")
|
||||
@PreAuthorize("@ss.hasPermission('trade:order:pick-up')")
|
||||
public CommonResult<Boolean> pickUpOrderById(@RequestParam("id") Long id) {
|
||||
tradeOrderUpdateService.pickUpOrderByMember(id);
|
||||
tradeOrderUpdateService.pickUpOrderByAdmin(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ public interface TradeOrderUpdateService {
|
||||
*
|
||||
* @param id 订单编号
|
||||
*/
|
||||
void pickUpOrderByMember(Long id);
|
||||
void pickUpOrderByAdmin(Long id);
|
||||
|
||||
/**
|
||||
* 【管理员】核销订单
|
||||
|
@ -669,8 +669,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.MEMBER_PICK_UP_RECEIVE)
|
||||
public void pickUpOrderByMember(Long id) {
|
||||
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_PICK_UP_RECEIVE)
|
||||
public void pickUpOrderByAdmin(Long id) {
|
||||
getSelf().pickUpOrder(tradeOrderMapper.selectById(id));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user