From 29bce66d63f38155af7d010f2e1ea67bd7ba741c Mon Sep 17 00:00:00 2001 From: weicw <594098497@qq.com> Date: Wed, 28 Oct 2026 16:14:20 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=96=B0=E5=A2=9E=E8=B0=83?= =?UTF-8?q?=E5=BA=A6=E7=AB=AF=E6=A1=A3=E6=A1=88=E7=BB=9F=E8=AE=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E4=BE=9B=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=B5=84?= =?UTF-8?q?=E6=96=99=E9=A1=B5=E5=8F=96=E5=8F=B8=E6=9C=BA=E4=B8=8E=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E8=AF=81=E7=85=A7=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/vo/ArchiveManageStatsVO.java | 47 ++++++++++++++ .../controller/ManageArchiveController.java | 64 +++++++++++++++++++ .../service/IManageArchiveService.java | 37 +++++++++++ .../impl/ManageArchiveServiceImpl.java | 54 ++++++++++++++++ 4 files changed, 202 insertions(+) create mode 100644 blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ArchiveManageStatsVO.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ManageArchiveController.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/IManageArchiveService.java create mode 100644 blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ManageArchiveServiceImpl.java diff --git a/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ArchiveManageStatsVO.java b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ArchiveManageStatsVO.java new file mode 100644 index 00000000..085673f4 --- /dev/null +++ b/blade-service-api/blade-transport-api/src/main/java/org/springblade/transport/pojo/vo/ArchiveManageStatsVO.java @@ -0,0 +1,47 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.pojo.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 调度端档案统计(司机 + 车辆证件有效期) + */ +@Data +@Schema(description = "调度端档案统计") +public class ArchiveManageStatsVO implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + @Schema(description = "司机证件有效期统计") + private DriverExpiryStatVO driver = new DriverExpiryStatVO(); + + @Schema(description = "车辆证件有效期统计") + private TransportVehicleExpiryStatVO vehicle = new TransportVehicleExpiryStatVO(); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ManageArchiveController.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ManageArchiveController.java new file mode 100644 index 00000000..e38ba183 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/controller/ManageArchiveController.java @@ -0,0 +1,64 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springblade.transport.pojo.vo.ArchiveManageStatsVO; +import org.springblade.transport.service.IManageArchiveService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 调度端档案(小程序管理端) + *

+ * 对外完整路径:{@code /api/blade-transport/archive/manage/**} + * (网关 StripPrefix 去掉 {@code blade-transport} 后落入 {@code /archive/manage/**})。 + * 同时兼容未去前缀直连({@code /blade-transport/archive/manage/**})。 + * 仅需登录态,不挂管理端菜单鉴权。 + *

+ * 为什么单独一个接口:管理端 {@code /driver/expiry-stat}、{@code /transport-vehicle/expiry-stat} + * 挂在 {@code @PreAuth(menu = "driver")} / {@code @PreAuth(menu = "transport_vehicle")} 下, + * 小程序登录的令牌 roleId 是占位值 "0"、查不到 blade_role_menu,必然被拒(401 请求未授权)。 + */ +@RestController +@AllArgsConstructor +@RequestMapping({"/archive/manage", "/blade-transport/archive/manage"}) +@Tag(name = "调度端档案", description = "小程序调度端资料页档案统计") +public class ManageArchiveController extends BladeController { + + private final IManageArchiveService manageArchiveService; + + @GetMapping("/stats") + @ApiOperationSupport(order = 1) + @Operation(summary = "档案统计", description = "司机档案与车辆档案的总数、30 天内到期数、已到期数;不按组织收口") + public R stats() { + return R.data(manageArchiveService.stats()); + } + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IManageArchiveService.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IManageArchiveService.java new file mode 100644 index 00000000..478f7654 --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/IManageArchiveService.java @@ -0,0 +1,37 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service; + +import org.springblade.transport.pojo.vo.ArchiveManageStatsVO; + +/** + * 调度端档案统计 + */ +public interface IManageArchiveService { + + /** + * 司机与车辆档案的证件有效期统计 + */ + ArchiveManageStatsVO stats(); + +} diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ManageArchiveServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ManageArchiveServiceImpl.java new file mode 100644 index 00000000..8bf23edf --- /dev/null +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/ManageArchiveServiceImpl.java @@ -0,0 +1,54 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.transport.service.impl; + +import lombok.AllArgsConstructor; +import org.springblade.transport.pojo.vo.ArchiveManageStatsVO; +import org.springblade.transport.pojo.vo.DriverVO; +import org.springblade.transport.pojo.vo.TransportVehicleVO; +import org.springblade.transport.service.IDriverService; +import org.springblade.transport.service.IManageArchiveService; +import org.springblade.transport.service.ITransportVehicleService; +import org.springframework.stereotype.Service; + +/** + * 调度端档案统计 + */ +@Service +@AllArgsConstructor +public class ManageArchiveServiceImpl implements IManageArchiveService { + + private final IDriverService driverService; + private final ITransportVehicleService transportVehicleService; + + @Override + public ArchiveManageStatsVO stats() { + // 复用管理端同一套统计:today / warningDate 由各 service 的 prepareQuery 自己填, + // 不传筛选条件即全量计数(与小程序侧 searchDrivers 同口径,未按组织收口) + ArchiveManageStatsVO vo = new ArchiveManageStatsVO(); + vo.setDriver(driverService.expiryStat(new DriverVO())); + vo.setVehicle(transportVehicleService.expiryStat(new TransportVehicleVO())); + return vo; + } + +}