feat: 新增 yudao-module-asset 车辆管理模块(独立微服务)
- 10张数据表 DDL(vehicle/licence/insurance/equipment/ext/driver/device/type/model) - 75个Java文件:DO/VO/Mapper/Service/Controller 完整实现 - AssetServerApplication 独立微服务启动类(端口48084) - 车辆状态机、VIN/车牌唯一性校验、合同占用校验 - 导入/导出 Excel 功能 - 编译通过
This commit is contained in:
33
CLAUDE.md
Normal file
33
CLAUDE.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# OneOS V5 Backend
|
||||
|
||||
## 技术栈
|
||||
- yudao-cloud 框架,JDK 17,Spring Boot 3.2,MyBatis-Plus
|
||||
- 包前缀: cn.iocoder.yudao.module
|
||||
- DO 基类: TenantBaseDO
|
||||
|
||||
## 构建命令
|
||||
```bash
|
||||
# 编译 asset 模块(独立微服务)
|
||||
mvn clean package -pl yudao-module-asset/yudao-module-asset-server -am -DskipTests
|
||||
```
|
||||
|
||||
## 模块结构
|
||||
业务模块: yudao-module-asset/
|
||||
- yudao-module-asset-api: 对外 API + 枚举 + ErrorCode
|
||||
- yudao-module-asset-server: 独立微服务,有自己的 Application 启动类
|
||||
|
||||
## ⚠️ 重要:独立微服务部署
|
||||
- asset-server 是独立微服务,不挂在 system-server 下
|
||||
- 需要自己的 AssetServerApplication 启动类
|
||||
- 需要自己的 application.yaml(端口 48084)
|
||||
- 需要 Nacos 服务注册
|
||||
- Gateway 需要添加 asset-server 路由
|
||||
|
||||
## 代码规范
|
||||
- Controller: @RestController + @Validated, 路径 /admin-api/asset/xxx
|
||||
- 返回: CommonResult<T>
|
||||
- Service: 接口 + Impl 分离
|
||||
- Mapper: 继承 BaseMapperX
|
||||
- DO: @TableName + @KeySequence, 继承 TenantBaseDO
|
||||
- 分页: PageResult<T>
|
||||
- 导出: @ExcelProperty
|
||||
1
pom.xml
1
pom.xml
@@ -26,6 +26,7 @@
|
||||
<module>yudao-module-erp</module>
|
||||
<module>yudao-module-ai</module>
|
||||
<module>yudao-module-iot</module>
|
||||
<module>yudao-module-asset</module>
|
||||
</modules>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
389
sql/mysql/asset.sql
Normal file
389
sql/mysql/asset.sql
Normal file
@@ -0,0 +1,389 @@
|
||||
-- =============================================
|
||||
-- 车辆资产管理模块 DDL
|
||||
-- =============================================
|
||||
|
||||
-- 2.1 asset_vehicle — 车辆主表
|
||||
DROP TABLE IF EXISTS `asset_vehicle`;
|
||||
CREATE TABLE `asset_vehicle` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
-- 基本标识
|
||||
`plate_number` varchar(20) NOT NULL COMMENT '车牌号',
|
||||
`vin` varchar(50) DEFAULT NULL COMMENT '车架号(VIN码)',
|
||||
`vehicle_code` varchar(64) DEFAULT NULL COMMENT '车辆编号',
|
||||
-- 型号参数
|
||||
`vehicle_type_id` bigint DEFAULT NULL COMMENT '车辆类型ID(关联 asset_vehicle_type)',
|
||||
`vehicle_model_id` bigint DEFAULT NULL COMMENT '车辆型号ID(关联 asset_vehicle_model)',
|
||||
`brand` varchar(64) DEFAULT NULL COMMENT '品牌',
|
||||
`model` varchar(64) DEFAULT NULL COMMENT '型号',
|
||||
`color` varchar(32) DEFAULT NULL COMMENT '车身颜色',
|
||||
`engine_no` varchar(64) DEFAULT NULL COMMENT '发动机号/电机编号',
|
||||
`energy_type` tinyint DEFAULT NULL COMMENT '能源类型',
|
||||
`seat_count` int DEFAULT NULL COMMENT '座位数',
|
||||
`load_capacity` decimal(10,2) DEFAULT NULL COMMENT '额定载重(吨)',
|
||||
-- 运营归属
|
||||
`province` varchar(32) DEFAULT NULL COMMENT '运营省份',
|
||||
`city` varchar(32) DEFAULT NULL COMMENT '运营城市',
|
||||
`parking_id` bigint DEFAULT NULL COMMENT '停车场ID(关联 asset_parking)',
|
||||
`parking_position` varchar(128) DEFAULT NULL COMMENT '停车位置',
|
||||
`owner_company` varchar(128) DEFAULT NULL COMMENT '登记所有权公司',
|
||||
`ownership_type` tinyint DEFAULT NULL COMMENT '归属类型',
|
||||
`dept_id` bigint DEFAULT NULL COMMENT '所属部门ID',
|
||||
-- 采购信息
|
||||
`purchase_date` date DEFAULT NULL COMMENT '采购入库日期',
|
||||
`purchase_price` decimal(12,2) DEFAULT NULL COMMENT '购入价格(元)',
|
||||
`manufacture_year` int DEFAULT NULL COMMENT '出厂年份',
|
||||
`registration_date` date DEFAULT NULL COMMENT '注册登记日期',
|
||||
`mandatory_scrap_date` date DEFAULT NULL COMMENT '强制报废期',
|
||||
-- 里程
|
||||
`mileage` decimal(12,2) DEFAULT 0.00 COMMENT '当前里程(公里)',
|
||||
-- 多维状态
|
||||
`rent_status` tinyint NOT NULL DEFAULT 0 COMMENT '租赁状态',
|
||||
`operational_status` tinyint NOT NULL DEFAULT 0 COMMENT '运营状态',
|
||||
`preparation_status` tinyint NOT NULL DEFAULT 0 COMMENT '整备状态',
|
||||
`repair_status` tinyint NOT NULL DEFAULT 0 COMMENT '维修状态',
|
||||
`license_status` tinyint NOT NULL DEFAULT 0 COMMENT '证照状态',
|
||||
`scrap_status` tinyint NOT NULL DEFAULT 0 COMMENT '报废状态',
|
||||
-- 业务关联(冗余字段加速查询)
|
||||
`contract_id` bigint DEFAULT NULL COMMENT '当前合同ID',
|
||||
`contract_no` varchar(64) DEFAULT NULL COMMENT '当前合同编号',
|
||||
`customer_name` varchar(128) DEFAULT NULL COMMENT '当前客户名称',
|
||||
-- 交还车快照
|
||||
`last_delivery_time` datetime DEFAULT NULL COMMENT '最近交车时间',
|
||||
`last_delivery_mileage` decimal(12,2) DEFAULT NULL COMMENT '最近交车里程',
|
||||
`last_return_time` datetime DEFAULT NULL COMMENT '最近还车时间',
|
||||
`last_return_mileage` decimal(12,2) DEFAULT NULL COMMENT '最近还车里程',
|
||||
-- 评级
|
||||
`resource_category` varchar(32) DEFAULT NULL COMMENT '资源分类',
|
||||
`asset_rating` varchar(32) DEFAULT NULL COMMENT '资产评级',
|
||||
`rating_time` date DEFAULT NULL COMMENT '评级时间',
|
||||
-- GPS
|
||||
`current_location` varchar(256) DEFAULT NULL COMMENT 'GPS当前位置',
|
||||
`longitude` decimal(10,7) DEFAULT NULL COMMENT 'GPS经度',
|
||||
`latitude` decimal(10,7) DEFAULT NULL COMMENT 'GPS纬度',
|
||||
`gps_last_time` datetime DEFAULT NULL COMMENT 'GPS最后上报时间',
|
||||
-- 通用
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_plate_number` (`plate_number`, `tenant_id`),
|
||||
UNIQUE KEY `uk_vin` (`vin`, `tenant_id`),
|
||||
KEY `idx_vehicle_type_id` (`vehicle_type_id`),
|
||||
KEY `idx_vehicle_model_id` (`vehicle_model_id`),
|
||||
KEY `idx_rent_status` (`rent_status`),
|
||||
KEY `idx_dept_id` (`dept_id`),
|
||||
KEY `idx_parking_id` (`parking_id`),
|
||||
KEY `idx_contract_id` (`contract_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆主表';
|
||||
|
||||
-- 2.2 asset_vehicle_licence — 车辆证照表
|
||||
DROP TABLE IF EXISTS `asset_vehicle_licence`;
|
||||
CREATE TABLE `asset_vehicle_licence` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`vehicle_id` bigint NOT NULL COMMENT '车辆ID',
|
||||
-- 行驶证
|
||||
`driving_register_date` date DEFAULT NULL COMMENT '行驶证注册日期',
|
||||
`driving_expire_date` date DEFAULT NULL COMMENT '行驶证有效期',
|
||||
`driving_scrap_date` date DEFAULT NULL COMMENT '行驶证强制报废日期',
|
||||
-- 营运证
|
||||
`operation_num` varchar(64) DEFAULT NULL COMMENT '营运证编号',
|
||||
`operation_register_date` date DEFAULT NULL COMMENT '营运证注册日期',
|
||||
`operation_expire_date` date DEFAULT NULL COMMENT '营运证有效期',
|
||||
`operation_verify_expire_date` date DEFAULT NULL COMMENT '营运证审验有效期',
|
||||
-- 通行证
|
||||
`pass_num` varchar(64) DEFAULT NULL COMMENT '通行证编号',
|
||||
`pass_area` varchar(256) DEFAULT NULL COMMENT '通行区域',
|
||||
`pass_expire_date` date DEFAULT NULL COMMENT '通行证有效期',
|
||||
-- 加氢证
|
||||
`hydrogen_num` varchar(64) DEFAULT NULL COMMENT '加氢证编码',
|
||||
`hydrogen_check_date` date DEFAULT NULL COMMENT '加氢证检验日期',
|
||||
`hydrogen_card_num` varchar(64) DEFAULT NULL COMMENT '加氢卡编码',
|
||||
`hydrogen_expire_date` date DEFAULT NULL COMMENT '加氢证有效期',
|
||||
-- 氢瓶/安全阀/压力表检验
|
||||
`hydrogen_cylinder_factory` varchar(128) DEFAULT NULL COMMENT '氢气瓶厂家',
|
||||
`hydrogen_cylinder_inspect_date` date DEFAULT NULL COMMENT '氢气瓶检验日期',
|
||||
`hydrogen_cylinder_inspect_cycle` int DEFAULT NULL COMMENT '氢气瓶检验周期(月)',
|
||||
`hydrogen_cylinder_expire_date` date DEFAULT NULL COMMENT '氢瓶检测有效期',
|
||||
`safety_valve_inspect_date` date DEFAULT NULL COMMENT '安全阀检验日期',
|
||||
`safety_valve_inspect_cycle` int DEFAULT NULL COMMENT '安全阀检验周期(月)',
|
||||
`safety_valve_expire_date` date DEFAULT NULL COMMENT '安全阀检测有效期',
|
||||
`pressure_gauge_inspect_date` date DEFAULT NULL COMMENT '压力表检验日期',
|
||||
`pressure_gauge_inspect_cycle` int DEFAULT NULL COMMENT '压力表检验周期(月)',
|
||||
`pressure_gauge_expire_date` date DEFAULT NULL COMMENT '压力表检测有效期',
|
||||
-- 年审
|
||||
`annual_review_expire_date` date DEFAULT NULL COMMENT '年审到期时间',
|
||||
`rating_date` date DEFAULT NULL COMMENT '等评时间',
|
||||
-- 附件
|
||||
`attachment_urls` varchar(1024) DEFAULT NULL COMMENT '证照附件URL(JSON数组)',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_vehicle_id` (`vehicle_id`, `tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆证照表';
|
||||
|
||||
-- 2.3 asset_vehicle_insurance — 车辆保险表
|
||||
DROP TABLE IF EXISTS `asset_vehicle_insurance`;
|
||||
CREATE TABLE `asset_vehicle_insurance` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`vehicle_id` bigint NOT NULL COMMENT '车辆ID',
|
||||
`insurance_type` tinyint NOT NULL COMMENT '保险类型',
|
||||
`insurance_company_id` bigint DEFAULT NULL COMMENT '保险公司ID(关联 asset_insurance_company)',
|
||||
`insurance_company_name` varchar(128) DEFAULT NULL COMMENT '保险公司名称(冗余)',
|
||||
`policy_no` varchar(128) DEFAULT NULL COMMENT '保单号',
|
||||
`third_party_limit` decimal(14,2) DEFAULT NULL COMMENT '第三者责任额度(元)',
|
||||
`premium` decimal(12,2) DEFAULT NULL COMMENT '保费(元)',
|
||||
`cost_bearing_org` varchar(128) DEFAULT NULL COMMENT '保费承担公司',
|
||||
`effective_date` date DEFAULT NULL COMMENT '保单生效日期',
|
||||
`expire_date` date DEFAULT NULL COMMENT '保单到期日期',
|
||||
`warranty_attachment` varchar(512) DEFAULT NULL COMMENT '保单附件URL',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_vehicle_id` (`vehicle_id`),
|
||||
KEY `idx_expire_date` (`expire_date`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆保险表';
|
||||
|
||||
-- 2.4 asset_vehicle_equipment — 后装设备表
|
||||
DROP TABLE IF EXISTS `asset_vehicle_equipment`;
|
||||
CREATE TABLE `asset_vehicle_equipment` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`vehicle_id` bigint NOT NULL COMMENT '车辆ID',
|
||||
`equipment_type` tinyint NOT NULL COMMENT '设备类型',
|
||||
`equipment_name` varchar(128) DEFAULT NULL COMMENT '设备名称',
|
||||
`equipment_no` varchar(128) DEFAULT NULL COMMENT '设备编号',
|
||||
`supplier_name` varchar(128) DEFAULT NULL COMMENT '供应商',
|
||||
`install_date` date DEFAULT NULL COMMENT '安装日期',
|
||||
`expire_date` date DEFAULT NULL COMMENT '到期日期',
|
||||
`equipment_status` varchar(32) DEFAULT NULL COMMENT '设备状态',
|
||||
-- 尾板专用字段
|
||||
`tailboard_model` varchar(64) DEFAULT NULL COMMENT '尾板型号',
|
||||
`tailboard_no` varchar(64) DEFAULT NULL COMMENT '尾板编号',
|
||||
`tailboard_weight` decimal(10,2) DEFAULT NULL COMMENT '尾板自重(kg)',
|
||||
`tailboard_rated_load` decimal(10,2) DEFAULT NULL COMMENT '尾板额定载荷(t)',
|
||||
`tailboard_info` varchar(500) DEFAULT NULL COMMENT '尾板信息',
|
||||
`certificate_attachment` varchar(512) DEFAULT NULL COMMENT '合格证附件URL',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_vehicle_id` (`vehicle_id`),
|
||||
KEY `idx_equipment_type` (`equipment_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆后装设备表';
|
||||
|
||||
-- 2.5 asset_vehicle_ext — 车辆扩展信息表
|
||||
DROP TABLE IF EXISTS `asset_vehicle_ext`;
|
||||
CREATE TABLE `asset_vehicle_ext` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`vehicle_id` bigint NOT NULL COMMENT '车辆ID',
|
||||
-- 车身广告
|
||||
`has_body_advertisement` tinyint DEFAULT 0 COMMENT '是否有车身广告(0否 1是)',
|
||||
`advertisement_apply_date` date DEFAULT NULL COMMENT '广告喷涂时间',
|
||||
`advertisement_remark` varchar(500) DEFAULT NULL COMMENT '广告备注',
|
||||
`advertisement_photo_urls` varchar(1024) DEFAULT NULL COMMENT '广告照片URL(JSON数组)',
|
||||
-- 氢能参数
|
||||
`hydrogen_capacity` decimal(10,2) DEFAULT NULL COMMENT '氢瓶容量(L)',
|
||||
`battery_capacity` decimal(10,2) DEFAULT NULL COMMENT '储电量(kWh)',
|
||||
`battery_factory` varchar(128) DEFAULT NULL COMMENT '电池厂家',
|
||||
`fuel_cell_factory` varchar(128) DEFAULT NULL COMMENT '电堆厂家',
|
||||
`hydrogen_system_factory` varchar(128) DEFAULT NULL COMMENT '氢系统厂家',
|
||||
`chiller_factory` varchar(128) DEFAULT NULL COMMENT '冷机厂家',
|
||||
-- 轮胎
|
||||
`tire_count` int DEFAULT NULL COMMENT '轮胎数量',
|
||||
`tire_spec` varchar(64) DEFAULT NULL COMMENT '轮胎规格',
|
||||
-- 车辆尺寸
|
||||
`body_length` decimal(10,2) DEFAULT NULL COMMENT '车身长(mm)',
|
||||
`body_width` decimal(10,2) DEFAULT NULL COMMENT '车身宽(mm)',
|
||||
`body_height` decimal(10,2) DEFAULT NULL COMMENT '车身高(mm)',
|
||||
-- 公告信息
|
||||
`notice_model` varchar(128) DEFAULT NULL COMMENT '公告型号',
|
||||
`dashboard_mode` varchar(64) DEFAULT NULL COMMENT '仪表盘模式',
|
||||
-- 租赁来源
|
||||
`rent_from_company` varchar(128) DEFAULT NULL COMMENT '租赁来源公司',
|
||||
-- 车辆批次
|
||||
`vehicle_batch` varchar(64) DEFAULT NULL COMMENT '车辆批次',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_vehicle_id` (`vehicle_id`, `tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆扩展信息表';
|
||||
|
||||
-- 2.6 asset_driver — 司机表
|
||||
DROP TABLE IF EXISTS `asset_driver`;
|
||||
CREATE TABLE `asset_driver` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`user_id` bigint DEFAULT NULL COMMENT '关联系统用户ID',
|
||||
`name` varchar(64) NOT NULL COMMENT '姓名',
|
||||
`phone` varchar(20) DEFAULT NULL COMMENT '手机号',
|
||||
`id_card_no` varchar(30) DEFAULT NULL COMMENT '身份证号',
|
||||
`gender` tinyint DEFAULT NULL COMMENT '性别(1男 2女)',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生日期',
|
||||
`driver_license_no` varchar(64) DEFAULT NULL COMMENT '驾驶证号',
|
||||
`driver_license_type` varchar(10) DEFAULT NULL COMMENT '驾驶证类型(A1/A2/B1/B2/C1等)',
|
||||
`driver_license_expire` date DEFAULT NULL COMMENT '驾驶证到期日',
|
||||
`qualification_cert_no` varchar(64) DEFAULT NULL COMMENT '从业资格证号',
|
||||
`qualification_cert_expire` date DEFAULT NULL COMMENT '从业资格证到期日',
|
||||
`entry_date` date DEFAULT NULL COMMENT '入职日期',
|
||||
`leave_date` date DEFAULT NULL COMMENT '离职日期',
|
||||
`monthly_pay` decimal(10,2) DEFAULT NULL COMMENT '月薪(元)',
|
||||
`emergency_contact` varchar(64) DEFAULT NULL COMMENT '紧急联系人',
|
||||
`emergency_phone` varchar(20) DEFAULT NULL COMMENT '紧急联系电话',
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_phone` (`phone`),
|
||||
KEY `idx_id_card_no` (`id_card_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='司机信息表';
|
||||
|
||||
-- 2.7 asset_driver_vehicle — 司机车辆绑定表
|
||||
DROP TABLE IF EXISTS `asset_driver_vehicle`;
|
||||
CREATE TABLE `asset_driver_vehicle` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`driver_id` bigint NOT NULL COMMENT '司机ID',
|
||||
`vehicle_id` bigint NOT NULL COMMENT '车辆ID',
|
||||
`plate_number` varchar(20) DEFAULT NULL COMMENT '车牌号(冗余)',
|
||||
`driver_name` varchar(64) DEFAULT NULL COMMENT '司机姓名(冗余)',
|
||||
`driver_phone` varchar(20) DEFAULT NULL COMMENT '司机电话(冗余)',
|
||||
`bind_time` datetime DEFAULT NULL COMMENT '绑定时间',
|
||||
`unbind_time` datetime DEFAULT NULL COMMENT '解绑时间',
|
||||
`bind_status` tinyint NOT NULL DEFAULT 1 COMMENT '绑定状态(0已解绑 1已绑定)',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_driver_id` (`driver_id`),
|
||||
KEY `idx_vehicle_id` (`vehicle_id`),
|
||||
KEY `idx_bind_status` (`bind_status`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='司机车辆绑定表';
|
||||
|
||||
-- 2.8 asset_device — IoT设备表
|
||||
DROP TABLE IF EXISTS `asset_device`;
|
||||
CREATE TABLE `asset_device` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`imei` varchar(64) NOT NULL COMMENT '设备IMEI号',
|
||||
`name` varchar(128) DEFAULT NULL COMMENT '设备名称',
|
||||
`type` tinyint NOT NULL COMMENT '设备类型',
|
||||
`brand` varchar(64) DEFAULT NULL COMMENT '品牌',
|
||||
`model` varchar(64) DEFAULT NULL COMMENT '型号',
|
||||
`sim_no` varchar(32) DEFAULT NULL COMMENT 'SIM卡号',
|
||||
`bind_status` tinyint NOT NULL DEFAULT 0 COMMENT '绑定状态(0未绑定 1已绑定)',
|
||||
`vehicle_id` bigint DEFAULT NULL COMMENT '当前绑定车辆ID',
|
||||
`service_expire_time` date DEFAULT NULL COMMENT '服务到期时间',
|
||||
`dept_id` bigint DEFAULT NULL COMMENT '所属部门ID',
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_imei` (`imei`, `tenant_id`),
|
||||
KEY `idx_type` (`type`),
|
||||
KEY `idx_bind_status` (`bind_status`),
|
||||
KEY `idx_vehicle_id` (`vehicle_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='IoT设备表';
|
||||
|
||||
-- 2.9 asset_vehicle_type — 车型表
|
||||
DROP TABLE IF EXISTS `asset_vehicle_type`;
|
||||
CREATE TABLE `asset_vehicle_type` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`code` varchar(64) NOT NULL COMMENT '类型编码',
|
||||
`name` varchar(128) NOT NULL COMMENT '类型名称',
|
||||
`group_name` varchar(128) DEFAULT NULL COMMENT '类型分组',
|
||||
`sort` int NOT NULL DEFAULT 0 COMMENT '排序',
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_code` (`code`, `tenant_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆类型表';
|
||||
|
||||
-- 2.10 asset_vehicle_model — 车辆型号参数表
|
||||
DROP TABLE IF EXISTS `asset_vehicle_model`;
|
||||
CREATE TABLE `asset_vehicle_model` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`brand_name` varchar(64) NOT NULL COMMENT '品牌名',
|
||||
`model_name` varchar(64) NOT NULL COMMENT '型号名',
|
||||
`vehicle_type` varchar(64) DEFAULT NULL COMMENT '车辆类型',
|
||||
`fuel_type` varchar(32) DEFAULT NULL COMMENT '燃料种类',
|
||||
`plate_color` tinyint DEFAULT NULL COMMENT '车牌颜色(0绿 1黄 2黄绿)',
|
||||
-- 尺寸
|
||||
`body_length` decimal(10,2) DEFAULT NULL COMMENT '车身长(mm)',
|
||||
`body_width` decimal(10,2) DEFAULT NULL COMMENT '车身宽(mm)',
|
||||
`body_height` decimal(10,2) DEFAULT NULL COMMENT '车身高(mm)',
|
||||
-- 轮胎
|
||||
`tire_count` int DEFAULT NULL COMMENT '轮胎数量',
|
||||
`tire_spec` varchar(64) DEFAULT NULL COMMENT '轮胎规格',
|
||||
-- 电池
|
||||
`battery_type` tinyint DEFAULT NULL COMMENT '电池类型(0磷酸铁锂 1三元锂)',
|
||||
`battery_maker` varchar(128) DEFAULT NULL COMMENT '电池厂家',
|
||||
`battery_capacity` decimal(10,2) DEFAULT NULL COMMENT '储电量(kWh)',
|
||||
`electric_range` decimal(10,2) DEFAULT NULL COMMENT '纯电续航(KM)',
|
||||
-- 氢能
|
||||
`hydrogen_capacity` decimal(10,2) DEFAULT NULL COMMENT '氢箱容量(L)',
|
||||
`hydrogen_range` decimal(10,2) DEFAULT NULL COMMENT '氢续航(KM)',
|
||||
`hydrogen_system_maker` varchar(128) DEFAULT NULL COMMENT '氢系统厂家',
|
||||
`fuel_cell_maker` varchar(128) DEFAULT NULL COMMENT '电堆厂家',
|
||||
-- 其他
|
||||
`chiller_maker` varchar(128) DEFAULT NULL COMMENT '冷机厂家',
|
||||
`dashboard_mode` varchar(64) DEFAULT NULL COMMENT '仪表盘模式',
|
||||
`notice_model` varchar(128) DEFAULT NULL COMMENT '公告型号',
|
||||
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
-- yudao 标准字段
|
||||
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_brand_model` (`brand_name`, `model_name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='车辆型号参数表';
|
||||
24
yudao-module-asset/pom.xml
Normal file
24
yudao-module-asset/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-asset</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
asset 模块,车辆资产管理
|
||||
</description>
|
||||
|
||||
<modules>
|
||||
<module>yudao-module-asset-api</module>
|
||||
<module>yudao-module-asset-server</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
33
yudao-module-asset/yudao-module-asset-api/pom.xml
Normal file
33
yudao-module-asset/yudao-module-asset-api/pom.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-asset</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-asset-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
asset 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.asset.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* Asset 错误码枚举类
|
||||
* asset 系统,使用 1-030-000-000 段
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 车辆管理 1-030-001-000 ==========
|
||||
ErrorCode VEHICLE_NOT_EXISTS = new ErrorCode(1_030_001_000, "车辆不存在");
|
||||
ErrorCode VEHICLE_VIN_DUPLICATE = new ErrorCode(1_030_001_001, "车架号VIN已存在");
|
||||
ErrorCode VEHICLE_PLATE_NUMBER_DUPLICATE = new ErrorCode(1_030_001_002, "车牌号已存在");
|
||||
ErrorCode VEHICLE_STATUS_TRANSITION_INVALID = new ErrorCode(1_030_001_003, "车辆状态流转不合法");
|
||||
ErrorCode VEHICLE_NOT_AVAILABLE = new ErrorCode(1_030_001_004, "车辆不是空闲状态,无法锁定");
|
||||
ErrorCode VEHICLE_CONTRACT_BINDIED = new ErrorCode(1_030_001_005, "车辆正在合同中使用,无法删除");
|
||||
ErrorCode VEHICLE_DEVICE_BINDIED = new ErrorCode(1_030_001_006, "车辆有绑定设备,请先解绑");
|
||||
|
||||
// ========== 司机管理 1-030-002-000 ==========
|
||||
ErrorCode DRIVER_NOT_EXISTS = new ErrorCode(1_030_002_000, "司机不存在");
|
||||
|
||||
// ========== 设备管理 1-030-003-000 ==========
|
||||
ErrorCode DEVICE_NOT_EXISTS = new ErrorCode(1_030_003_000, "设备不存在");
|
||||
ErrorCode DEVICE_IMEI_DUPLICATE = new ErrorCode(1_030_003_001, "设备IMEI已存在");
|
||||
ErrorCode DEVICE_BINDIED = new ErrorCode(1_030_003_002, "设备已绑定");
|
||||
ErrorCode DEVICE_NOT_BINDIED = new ErrorCode(1_030_003_003, "设备未绑定");
|
||||
|
||||
// ========== 车辆证照 1-030-025-000 ==========
|
||||
ErrorCode VEHICLE_LICENCE_NOT_EXISTS = new ErrorCode(1_030_025_000, "车辆证照不存在");
|
||||
|
||||
// ========== 车辆保险 1-030-026-000 ==========
|
||||
ErrorCode VEHICLE_INSURANCE_NOT_EXISTS = new ErrorCode(1_030_026_000, "车辆保险不存在");
|
||||
|
||||
// ========== 车辆后装设备 1-030-027-000 ==========
|
||||
ErrorCode VEHICLE_EQUIPMENT_NOT_EXISTS = new ErrorCode(1_030_027_000, "车辆后装设备不存在");
|
||||
|
||||
// ========== 车辆扩展 1-030-028-000 ==========
|
||||
ErrorCode VEHICLE_EXT_NOT_EXISTS = new ErrorCode(1_030_028_000, "车辆扩展信息不存在");
|
||||
|
||||
// ========== 司机车辆绑定 1-030-029-000 ==========
|
||||
ErrorCode DRIVER_VEHICLE_NOT_EXISTS = new ErrorCode(1_030_029_000, "司机车辆绑定不存在");
|
||||
|
||||
// ========== 车辆型号 1-030-030-000 ==========
|
||||
ErrorCode VEHICLE_MODEL_NOT_EXISTS = new ErrorCode(1_030_030_000, "车辆型号不存在");
|
||||
|
||||
// ========== 车辆类型 1-030-031-000 ==========
|
||||
ErrorCode VEHICLE_TYPE_NOT_EXISTS = new ErrorCode(1_030_031_000, "车辆类型不存在");
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.asset.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 车辆租赁状态枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum VehicleRentStatusEnum {
|
||||
|
||||
IDLE(0, "空闲"),
|
||||
RENTED(1, "在租"),
|
||||
RETURNING(2, "还车中"),
|
||||
REPAIRING(3, "维修中"),
|
||||
STANDBY(4, "备车"),
|
||||
SCRAPPED(5, "已报废");
|
||||
|
||||
private final Integer status;
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* 合法流转矩阵
|
||||
* key: 当前状态, value: 允许流转到的目标状态集合
|
||||
*/
|
||||
private static final Map<Integer, Set<Integer>> TRANSITIONS = new HashMap<>();
|
||||
static {
|
||||
TRANSITIONS.put(0, Set.of(1, 3, 4, 5)); // 空闲 → 在租/维修/备车/报废
|
||||
TRANSITIONS.put(1, Set.of(2, 3)); // 在租 → 还车中/维修中
|
||||
TRANSITIONS.put(2, Set.of(0)); // 还车中 → 空闲
|
||||
TRANSITIONS.put(3, Set.of(0, 1)); // 维修中 → 空闲/在租
|
||||
TRANSITIONS.put(4, Set.of(0, 1)); // 备车 → 空闲/在租
|
||||
TRANSITIONS.put(5, Collections.emptySet()); // 报废=终态
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断状态流转是否合法
|
||||
*
|
||||
* @param from 当前状态
|
||||
* @param to 目标状态
|
||||
* @return 是否合法
|
||||
*/
|
||||
public static boolean isValidTransition(Integer from, Integer to) {
|
||||
Set<Integer> allowed = TRANSITIONS.get(from);
|
||||
return allowed != null && allowed.contains(to);
|
||||
}
|
||||
|
||||
}
|
||||
120
yudao-module-asset/yudao-module-asset-server/pom.xml
Normal file
120
yudao-module-asset/yudao-module-asset-server/pom.xml
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-asset</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-asset-server</artifactId>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
asset 模块 Server,车辆资产管理的实现
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-env</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 依赖服务 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-asset-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-infra-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Registry 注册中心 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- Config 配置中心 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Redis -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 监控 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.asset;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class AssetServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AssetServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.device;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.device.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.device.DeviceDO;
|
||||
import cn.iocoder.yudao.module.asset.service.device.DeviceService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 设备管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/device")
|
||||
@Validated
|
||||
public class DeviceController {
|
||||
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备")
|
||||
@PreAuthorize("@ss.hasPermission('asset:device:create')")
|
||||
public CommonResult<Long> createDevice(@Valid @RequestBody DeviceSaveReqVO createReqVO) {
|
||||
return success(deviceService.createDevice(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备")
|
||||
@PreAuthorize("@ss.hasPermission('asset:device:update')")
|
||||
public CommonResult<Boolean> updateDevice(@Valid @RequestBody DeviceSaveReqVO updateReqVO) {
|
||||
deviceService.updateDevice(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:device:delete')")
|
||||
public CommonResult<Boolean> deleteDevice(@RequestParam("id") Long id) {
|
||||
deviceService.deleteDevice(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取设备详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:device:query')")
|
||||
public CommonResult<DeviceRespVO> getDevice(@RequestParam("id") Long id) {
|
||||
DeviceDO device = deviceService.getDevice(id);
|
||||
return success(BeanUtils.toBean(device, DeviceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取设备分页")
|
||||
@PreAuthorize("@ss.hasPermission('asset:device:query')")
|
||||
public CommonResult<PageResult<DeviceRespVO>> getDevicePage(@Valid DevicePageReqVO pageReqVO) {
|
||||
PageResult<DeviceDO> pageResult = deviceService.getDevicePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获取设备精简列表")
|
||||
@Parameter(name = "bindStatus", description = "绑定状态")
|
||||
public CommonResult<List<DeviceSimpleRespVO>> getSimpleList(
|
||||
@RequestParam(value = "bindStatus", required = false) Integer bindStatus) {
|
||||
return success(BeanUtils.toBean(deviceService.getSimpleList(bindStatus), DeviceSimpleRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/bind")
|
||||
@Operation(summary = "绑定设备到车辆")
|
||||
@PreAuthorize("@ss.hasPermission('asset:device:update')")
|
||||
public CommonResult<Boolean> bindDevice(@Valid @RequestBody DeviceBindReqVO reqVO) {
|
||||
deviceService.bindDevice(reqVO.getDeviceId(), reqVO.getVehicleId());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/unbind")
|
||||
@Operation(summary = "解绑设备")
|
||||
@Parameter(name = "deviceId", description = "设备ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:device:update')")
|
||||
public CommonResult<Boolean> unbindDevice(@RequestParam("deviceId") Long deviceId) {
|
||||
deviceService.unbindDevice(deviceId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.device.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 设备绑定 Request VO")
|
||||
@Data
|
||||
public class DeviceBindReqVO {
|
||||
|
||||
@NotNull(message = "设备ID不能为空")
|
||||
@Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long deviceId;
|
||||
|
||||
@NotNull(message = "车辆ID不能为空")
|
||||
@Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long vehicleId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.device.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DevicePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "IMEI号")
|
||||
private String imei;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "设备类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "绑定状态")
|
||||
private Integer bindStatus;
|
||||
|
||||
@Schema(description = "绑定车辆ID")
|
||||
private Long vehicleId;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.device.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 设备 Response VO")
|
||||
@Data
|
||||
public class DeviceRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "设备IMEI号")
|
||||
private String imei;
|
||||
@Schema(description = "设备名称")
|
||||
private String name;
|
||||
@Schema(description = "设备类型")
|
||||
private Integer type;
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
@Schema(description = "SIM卡号")
|
||||
private String simNo;
|
||||
@Schema(description = "绑定状态")
|
||||
private Integer bindStatus;
|
||||
@Schema(description = "当前绑定车辆ID")
|
||||
private Long vehicleId;
|
||||
@Schema(description = "绑定车辆车牌号")
|
||||
private String vehiclePlateNumber;
|
||||
@Schema(description = "服务到期时间")
|
||||
private LocalDate serviceExpireTime;
|
||||
@Schema(description = "所属部门ID")
|
||||
private Long deptId;
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.device.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "管理后台 - 设备创建/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceSaveReqVO {
|
||||
|
||||
@Schema(description = "编号(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "设备IMEI不能为空")
|
||||
@Schema(description = "设备IMEI号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String imei;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
private String name;
|
||||
|
||||
@NotNull(message = "设备类型不能为空")
|
||||
@Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "SIM卡号")
|
||||
private String simNo;
|
||||
|
||||
@Schema(description = "绑定车辆ID")
|
||||
private Long vehicleId;
|
||||
|
||||
@Schema(description = "服务到期时间")
|
||||
private LocalDate serviceExpireTime;
|
||||
|
||||
@Schema(description = "所属部门ID")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.device.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 设备精简 Response VO")
|
||||
@Data
|
||||
public class DeviceSimpleRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "IMEI号")
|
||||
private String imei;
|
||||
@Schema(description = "设备名称")
|
||||
private String name;
|
||||
@Schema(description = "设备类型")
|
||||
private Integer type;
|
||||
@Schema(description = "绑定状态")
|
||||
private Integer bindStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.driver;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.driver.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.driver.DriverDO;
|
||||
import cn.iocoder.yudao.module.asset.service.driver.DriverService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 司机管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/driver")
|
||||
@Validated
|
||||
public class DriverController {
|
||||
|
||||
@Resource
|
||||
private DriverService driverService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建司机")
|
||||
@PreAuthorize("@ss.hasPermission('asset:driver:create')")
|
||||
public CommonResult<Long> createDriver(@Valid @RequestBody DriverSaveReqVO createReqVO) {
|
||||
return success(driverService.createDriver(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新司机")
|
||||
@PreAuthorize("@ss.hasPermission('asset:driver:update')")
|
||||
public CommonResult<Boolean> updateDriver(@Valid @RequestBody DriverSaveReqVO updateReqVO) {
|
||||
driverService.updateDriver(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除司机")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:driver:delete')")
|
||||
public CommonResult<Boolean> deleteDriver(@RequestParam("id") Long id) {
|
||||
driverService.deleteDriver(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取司机详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:driver:query')")
|
||||
public CommonResult<DriverRespVO> getDriver(@RequestParam("id") Long id) {
|
||||
DriverDO driver = driverService.getDriver(id);
|
||||
return success(BeanUtils.toBean(driver, DriverRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取司机分页")
|
||||
@PreAuthorize("@ss.hasPermission('asset:driver:query')")
|
||||
public CommonResult<PageResult<DriverRespVO>> getDriverPage(@Valid DriverPageReqVO pageReqVO) {
|
||||
PageResult<DriverDO> pageResult = driverService.getDriverPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DriverRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获取司机精简列表")
|
||||
public CommonResult<List<DriverSimpleRespVO>> getSimpleList() {
|
||||
return success(BeanUtils.toBean(driverService.getSimpleList(), DriverSimpleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.driver.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 司机分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DriverPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "身份证号")
|
||||
private String idCardNo;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.driver.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 司机 Response VO")
|
||||
@Data
|
||||
public class DriverRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "关联系统用户ID")
|
||||
private Long userId;
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
@Schema(description = "身份证号")
|
||||
private String idCardNo;
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
@Schema(description = "出生日期")
|
||||
private LocalDate birthDate;
|
||||
@Schema(description = "驾驶证号")
|
||||
private String driverLicenseNo;
|
||||
@Schema(description = "驾驶证类型")
|
||||
private String driverLicenseType;
|
||||
@Schema(description = "驾驶证到期日")
|
||||
private LocalDate driverLicenseExpire;
|
||||
@Schema(description = "从业资格证号")
|
||||
private String qualificationCertNo;
|
||||
@Schema(description = "从业资格证到期日")
|
||||
private LocalDate qualificationCertExpire;
|
||||
@Schema(description = "入职日期")
|
||||
private LocalDate entryDate;
|
||||
@Schema(description = "离职日期")
|
||||
private LocalDate leaveDate;
|
||||
@Schema(description = "月薪(元)")
|
||||
private BigDecimal monthlyPay;
|
||||
@Schema(description = "紧急联系人")
|
||||
private String emergencyContact;
|
||||
@Schema(description = "紧急联系电话")
|
||||
private String emergencyPhone;
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.driver.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 司机创建/修改 Request VO")
|
||||
@Data
|
||||
public class DriverSaveReqVO {
|
||||
|
||||
@Schema(description = "编号(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
@Schema(description = "姓名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Size(min = 15, max = 18, message = "身份证号长度为15-18位")
|
||||
@Schema(description = "身份证号")
|
||||
private String idCardNo;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "出生日期")
|
||||
private LocalDate birthDate;
|
||||
|
||||
@Schema(description = "驾驶证号")
|
||||
private String driverLicenseNo;
|
||||
|
||||
@Schema(description = "驾驶证类型")
|
||||
private String driverLicenseType;
|
||||
|
||||
@Schema(description = "驾驶证到期日")
|
||||
private LocalDate driverLicenseExpire;
|
||||
|
||||
@Schema(description = "从业资格证号")
|
||||
private String qualificationCertNo;
|
||||
|
||||
@Schema(description = "从业资格证到期日")
|
||||
private LocalDate qualificationCertExpire;
|
||||
|
||||
@Schema(description = "入职日期")
|
||||
private LocalDate entryDate;
|
||||
|
||||
@Schema(description = "离职日期")
|
||||
private LocalDate leaveDate;
|
||||
|
||||
@Schema(description = "月薪(元)")
|
||||
private BigDecimal monthlyPay;
|
||||
|
||||
@Schema(description = "紧急联系人")
|
||||
private String emergencyContact;
|
||||
|
||||
@Schema(description = "紧急联系电话")
|
||||
private String emergencyPhone;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "绑定车辆ID列表")
|
||||
private List<Long> vehicleIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.driver.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 司机精简 Response VO")
|
||||
@Data
|
||||
public class DriverSimpleRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.*;
|
||||
import cn.iocoder.yudao.module.asset.service.vehicle.VehicleEquipmentService;
|
||||
import cn.iocoder.yudao.module.asset.service.vehicle.VehicleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 车辆管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/vehicle")
|
||||
@Validated
|
||||
public class VehicleController {
|
||||
|
||||
@Resource
|
||||
private VehicleService vehicleService;
|
||||
@Resource
|
||||
private VehicleEquipmentService vehicleEquipmentService;
|
||||
@Resource
|
||||
private VehicleLicenceMapper vehicleLicenceMapper;
|
||||
@Resource
|
||||
private VehicleInsuranceMapper vehicleInsuranceMapper;
|
||||
@Resource
|
||||
private VehicleExtMapper vehicleExtMapper;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建车辆")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:create')")
|
||||
public CommonResult<Long> createVehicle(@Valid @RequestBody VehicleSaveReqVO createReqVO) {
|
||||
return success(vehicleService.createVehicle(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新车辆")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:update')")
|
||||
public CommonResult<Boolean> updateVehicle(@Valid @RequestBody VehicleSaveReqVO updateReqVO) {
|
||||
vehicleService.updateVehicle(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除车辆")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:delete')")
|
||||
public CommonResult<Boolean> deleteVehicle(@RequestParam("id") Long id) {
|
||||
vehicleService.deleteVehicle(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取车辆详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:query')")
|
||||
public CommonResult<VehicleRespVO> getVehicle(@RequestParam("id") Long id) {
|
||||
VehicleDO vehicle = vehicleService.getVehicle(id);
|
||||
if (vehicle == null) {
|
||||
return success(null);
|
||||
}
|
||||
VehicleRespVO respVO = BeanUtils.toBean(vehicle, VehicleRespVO.class);
|
||||
// 关联子表数据
|
||||
respVO.setLicence(BeanUtils.toBean(vehicleLicenceMapper.selectByVehicleId(id), VehicleLicenceSaveReqVO.class));
|
||||
respVO.setInsurances(BeanUtils.toBean(vehicleInsuranceMapper.selectByVehicleId(id), VehicleInsuranceSaveReqVO.class));
|
||||
respVO.setExt(BeanUtils.toBean(vehicleExtMapper.selectByVehicleId(id), VehicleExtSaveReqVO.class));
|
||||
respVO.setEquipments(BeanUtils.toBean(vehicleEquipmentService.getEquipmentListByVehicleId(id), VehicleEquipmentRespVO.class));
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取车辆分页")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:query')")
|
||||
public CommonResult<PageResult<VehicleRespVO>> getVehiclePage(@Valid VehiclePageReqVO pageReqVO) {
|
||||
PageResult<VehicleDO> pageResult = vehicleService.getVehiclePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, VehicleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获取车辆精简列表")
|
||||
@Parameter(name = "rentStatus", description = "租赁状态")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:query')")
|
||||
public CommonResult<List<VehicleSimpleRespVO>> getSimpleVehicleList(
|
||||
@RequestParam(value = "rentStatus", required = false) Integer rentStatus) {
|
||||
return success(BeanUtils.toBean(vehicleService.getSimpleVehicleList(rentStatus), VehicleSimpleRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "更新车辆状态")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:update-status')")
|
||||
public CommonResult<Boolean> updateVehicleStatus(@Valid @RequestBody VehicleUpdateStatusReqVO reqVO) {
|
||||
vehicleService.updateVehicleStatus(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/lock")
|
||||
@Operation(summary = "合同锁定车辆")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:lock')")
|
||||
public CommonResult<Boolean> lockVehicle(@Valid @RequestBody VehicleLockReqVO reqVO) {
|
||||
vehicleService.lockVehicle(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/unlock")
|
||||
@Operation(summary = "合同释放车辆")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:unlock')")
|
||||
public CommonResult<Boolean> unlockVehicle(@Valid @RequestBody VehicleUnlockReqVO reqVO) {
|
||||
vehicleService.unlockVehicle(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/import-excel")
|
||||
@Operation(summary = "导入车辆 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:import')")
|
||||
public CommonResult<VehicleImportRespVO> importVehicleExcel(
|
||||
@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws IOException {
|
||||
List<VehicleImportExcelVO> list = ExcelUtils.read(file, VehicleImportExcelVO.class);
|
||||
return success(vehicleService.importVehicles(list, updateSupport));
|
||||
}
|
||||
|
||||
@GetMapping("/get-import-template")
|
||||
@Operation(summary = "获取导入模板")
|
||||
public void getImportTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtils.write(response, "车辆导入模板.xls", "车辆", VehicleImportExcelVO.class, Collections.emptyList());
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出车辆 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportVehicleExcel(@Valid VehiclePageReqVO reqVO, HttpServletResponse response) throws IOException {
|
||||
List<VehicleExportExcelVO> list = vehicleService.getExportList(reqVO);
|
||||
ExcelUtils.write(response, "车辆.xls", "数据", VehicleExportExcelVO.class, list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentRespVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleEquipmentDO;
|
||||
import cn.iocoder.yudao.module.asset.service.vehicle.VehicleEquipmentService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 车辆后装设备")
|
||||
@RestController
|
||||
@RequestMapping("/asset/vehicle-equipment")
|
||||
@Validated
|
||||
public class VehicleEquipmentController {
|
||||
|
||||
@Resource
|
||||
private VehicleEquipmentService vehicleEquipmentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建后装设备")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-equipment:create')")
|
||||
public CommonResult<Long> createEquipment(@Valid @RequestBody VehicleEquipmentSaveReqVO createReqVO) {
|
||||
return success(vehicleEquipmentService.createEquipment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新后装设备")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-equipment:update')")
|
||||
public CommonResult<Boolean> updateEquipment(@Valid @RequestBody VehicleEquipmentSaveReqVO updateReqVO) {
|
||||
vehicleEquipmentService.updateEquipment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除后装设备")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-equipment:delete')")
|
||||
public CommonResult<Boolean> deleteEquipment(@RequestParam("id") Long id) {
|
||||
vehicleEquipmentService.deleteEquipment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取后装设备详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-equipment:query')")
|
||||
public CommonResult<VehicleEquipmentRespVO> getEquipment(@RequestParam("id") Long id) {
|
||||
VehicleEquipmentDO equipment = vehicleEquipmentService.getEquipment(id);
|
||||
return success(BeanUtils.toBean(equipment, VehicleEquipmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取后装设备分页")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-equipment:query')")
|
||||
public CommonResult<PageResult<VehicleEquipmentRespVO>> getEquipmentPage(@Valid VehicleEquipmentPageReqVO pageReqVO) {
|
||||
PageResult<VehicleEquipmentDO> pageResult = vehicleEquipmentService.getEquipmentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, VehicleEquipmentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleModelDO;
|
||||
import cn.iocoder.yudao.module.asset.service.vehiclemodel.VehicleModelService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 车辆型号")
|
||||
@RestController
|
||||
@RequestMapping("/asset/vehicle-model")
|
||||
@Validated
|
||||
public class VehicleModelController {
|
||||
|
||||
@Resource
|
||||
private VehicleModelService vehicleModelService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建车辆型号")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-model:create')")
|
||||
public CommonResult<Long> createVehicleModel(@Valid @RequestBody VehicleModelSaveReqVO createReqVO) {
|
||||
return success(vehicleModelService.createVehicleModel(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新车辆型号")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-model:update')")
|
||||
public CommonResult<Boolean> updateVehicleModel(@Valid @RequestBody VehicleModelSaveReqVO updateReqVO) {
|
||||
vehicleModelService.updateVehicleModel(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除车辆型号")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-model:delete')")
|
||||
public CommonResult<Boolean> deleteVehicleModel(@RequestParam("id") Long id) {
|
||||
vehicleModelService.deleteVehicleModel(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取车辆型号详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-model:query')")
|
||||
public CommonResult<VehicleModelRespVO> getVehicleModel(@RequestParam("id") Long id) {
|
||||
VehicleModelDO vehicleModel = vehicleModelService.getVehicleModel(id);
|
||||
return success(BeanUtils.toBean(vehicleModel, VehicleModelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取车辆型号分页")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-model:query')")
|
||||
public CommonResult<PageResult<VehicleModelRespVO>> getVehicleModelPage(@Valid VehicleModelPageReqVO pageReqVO) {
|
||||
PageResult<VehicleModelDO> pageResult = vehicleModelService.getVehicleModelPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, VehicleModelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获取车辆型号精简列表")
|
||||
public CommonResult<List<VehicleModelSimpleRespVO>> getSimpleList() {
|
||||
return success(BeanUtils.toBean(vehicleModelService.getSimpleList(), VehicleModelSimpleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleTypeDO;
|
||||
import cn.iocoder.yudao.module.asset.service.vehicletype.VehicleTypeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 车辆类型")
|
||||
@RestController
|
||||
@RequestMapping("/asset/vehicle-type")
|
||||
@Validated
|
||||
public class VehicleTypeController {
|
||||
|
||||
@Resource
|
||||
private VehicleTypeService vehicleTypeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建车辆类型")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-type:create')")
|
||||
public CommonResult<Long> createVehicleType(@Valid @RequestBody VehicleTypeSaveReqVO createReqVO) {
|
||||
return success(vehicleTypeService.createVehicleType(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新车辆类型")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-type:update')")
|
||||
public CommonResult<Boolean> updateVehicleType(@Valid @RequestBody VehicleTypeSaveReqVO updateReqVO) {
|
||||
vehicleTypeService.updateVehicleType(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除车辆类型")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-type:delete')")
|
||||
public CommonResult<Boolean> deleteVehicleType(@RequestParam("id") Long id) {
|
||||
vehicleTypeService.deleteVehicleType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取车辆类型详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-type:query')")
|
||||
public CommonResult<VehicleTypeRespVO> getVehicleType(@RequestParam("id") Long id) {
|
||||
VehicleTypeDO vehicleType = vehicleTypeService.getVehicleType(id);
|
||||
return success(BeanUtils.toBean(vehicleType, VehicleTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取车辆类型分页")
|
||||
@PreAuthorize("@ss.hasPermission('asset:vehicle-type:query')")
|
||||
public CommonResult<PageResult<VehicleTypeRespVO>> getVehicleTypePage(@Valid VehicleTypePageReqVO pageReqVO) {
|
||||
PageResult<VehicleTypeDO> pageResult = vehicleTypeService.getVehicleTypePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, VehicleTypeRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获取车辆类型精简列表")
|
||||
public CommonResult<List<VehicleTypeSimpleRespVO>> getSimpleList() {
|
||||
return success(BeanUtils.toBean(vehicleTypeService.getSimpleList(), VehicleTypeSimpleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆后装设备分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VehicleEquipmentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "车辆ID")
|
||||
private Long vehicleId;
|
||||
|
||||
@Schema(description = "设备类型")
|
||||
private Integer equipmentType;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
private String equipmentNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆后装设备 Response VO")
|
||||
@Data
|
||||
public class VehicleEquipmentRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "车辆ID")
|
||||
private Long vehicleId;
|
||||
@Schema(description = "设备类型")
|
||||
private Integer equipmentType;
|
||||
@Schema(description = "设备名称")
|
||||
private String equipmentName;
|
||||
@Schema(description = "设备编号")
|
||||
private String equipmentNo;
|
||||
@Schema(description = "供应商")
|
||||
private String supplierName;
|
||||
@Schema(description = "安装日期")
|
||||
private LocalDate installDate;
|
||||
@Schema(description = "到期日期")
|
||||
private LocalDate expireDate;
|
||||
@Schema(description = "设备状态")
|
||||
private String equipmentStatus;
|
||||
@Schema(description = "尾板型号")
|
||||
private String tailboardModel;
|
||||
@Schema(description = "尾板编号")
|
||||
private String tailboardNo;
|
||||
@Schema(description = "尾板自重(kg)")
|
||||
private BigDecimal tailboardWeight;
|
||||
@Schema(description = "尾板额定载荷(t)")
|
||||
private BigDecimal tailboardRatedLoad;
|
||||
@Schema(description = "尾板信息")
|
||||
private String tailboardInfo;
|
||||
@Schema(description = "合格证附件URL")
|
||||
private String certificateAttachment;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆后装设备创建/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleEquipmentSaveReqVO {
|
||||
|
||||
@Schema(description = "编号(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@NotNull(message = "车辆ID不能为空")
|
||||
@Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long vehicleId;
|
||||
|
||||
@NotNull(message = "设备类型不能为空")
|
||||
@Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer equipmentType;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
private String equipmentName;
|
||||
@Schema(description = "设备编号")
|
||||
private String equipmentNo;
|
||||
@Schema(description = "供应商")
|
||||
private String supplierName;
|
||||
@Schema(description = "安装日期")
|
||||
private LocalDate installDate;
|
||||
@Schema(description = "到期日期")
|
||||
private LocalDate expireDate;
|
||||
@Schema(description = "设备状态")
|
||||
private String equipmentStatus;
|
||||
@Schema(description = "尾板型号")
|
||||
private String tailboardModel;
|
||||
@Schema(description = "尾板编号")
|
||||
private String tailboardNo;
|
||||
@Schema(description = "尾板自重(kg)")
|
||||
private BigDecimal tailboardWeight;
|
||||
@Schema(description = "尾板额定载荷(t)")
|
||||
private BigDecimal tailboardRatedLoad;
|
||||
@Schema(description = "尾板信息")
|
||||
private String tailboardInfo;
|
||||
@Schema(description = "合格证附件URL")
|
||||
private String certificateAttachment;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class VehicleExportExcelVO {
|
||||
|
||||
@ExcelProperty("车牌号")
|
||||
private String plateNumber;
|
||||
|
||||
@ExcelProperty("车架号VIN")
|
||||
private String vin;
|
||||
|
||||
@ExcelProperty("车辆编号")
|
||||
private String vehicleCode;
|
||||
|
||||
@ExcelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ExcelProperty("型号")
|
||||
private String model;
|
||||
|
||||
@ExcelProperty("车身颜色")
|
||||
private String color;
|
||||
|
||||
@ExcelProperty("发动机号")
|
||||
private String engineNo;
|
||||
|
||||
@ExcelProperty("能源类型")
|
||||
@DictFormat("asset_energy_type")
|
||||
private Integer energyType;
|
||||
|
||||
@ExcelProperty("座位数")
|
||||
private Integer seatCount;
|
||||
|
||||
@ExcelProperty("额定载重(吨)")
|
||||
private BigDecimal loadCapacity;
|
||||
|
||||
@ExcelProperty("运营城市")
|
||||
private String city;
|
||||
|
||||
@ExcelProperty("租赁状态")
|
||||
@DictFormat("asset_rent_status")
|
||||
private Integer rentStatus;
|
||||
|
||||
@ExcelProperty("运营状态")
|
||||
@DictFormat("asset_operational_status")
|
||||
private Integer operationalStatus;
|
||||
|
||||
@ExcelProperty("归属类型")
|
||||
@DictFormat("asset_ownership_type")
|
||||
private Integer ownershipType;
|
||||
|
||||
@ExcelProperty("合同编号")
|
||||
private String contractNo;
|
||||
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerName;
|
||||
|
||||
@ExcelProperty("采购日期")
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
@ExcelProperty("购入价格(元)")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@ExcelProperty("当前里程(公里)")
|
||||
private BigDecimal mileage;
|
||||
|
||||
@ExcelProperty("强制报废期")
|
||||
private LocalDate mandatoryScrapDate;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆扩展信息创建/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleExtSaveReqVO {
|
||||
|
||||
@Schema(description = "是否有车身广告(0否 1是)")
|
||||
private Integer hasBodyAdvertisement;
|
||||
@Schema(description = "广告喷涂时间")
|
||||
private LocalDate advertisementApplyDate;
|
||||
@Schema(description = "广告备注")
|
||||
private String advertisementRemark;
|
||||
@Schema(description = "广告照片URL(JSON数组)")
|
||||
private String advertisementPhotoUrls;
|
||||
|
||||
@Schema(description = "氢瓶容量(L)")
|
||||
private BigDecimal hydrogenCapacity;
|
||||
@Schema(description = "储电量(kWh)")
|
||||
private BigDecimal batteryCapacity;
|
||||
@Schema(description = "电池厂家")
|
||||
private String batteryFactory;
|
||||
@Schema(description = "电堆厂家")
|
||||
private String fuelCellFactory;
|
||||
@Schema(description = "氢系统厂家")
|
||||
private String hydrogenSystemFactory;
|
||||
@Schema(description = "冷机厂家")
|
||||
private String chillerFactory;
|
||||
|
||||
@Schema(description = "轮胎数量")
|
||||
private Integer tireCount;
|
||||
@Schema(description = "轮胎规格")
|
||||
private String tireSpec;
|
||||
|
||||
@Schema(description = "车身长(mm)")
|
||||
private BigDecimal bodyLength;
|
||||
@Schema(description = "车身宽(mm)")
|
||||
private BigDecimal bodyWidth;
|
||||
@Schema(description = "车身高(mm)")
|
||||
private BigDecimal bodyHeight;
|
||||
|
||||
@Schema(description = "公告型号")
|
||||
private String noticeModel;
|
||||
@Schema(description = "仪表盘模式")
|
||||
private String dashboardMode;
|
||||
|
||||
@Schema(description = "租赁来源公司")
|
||||
private String rentFromCompany;
|
||||
@Schema(description = "车辆批次")
|
||||
private String vehicleBatch;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆导入 Excel VO")
|
||||
@Data
|
||||
public class VehicleImportExcelVO {
|
||||
|
||||
@ExcelProperty("车牌号")
|
||||
private String plateNumber;
|
||||
|
||||
@ExcelProperty("车架号VIN")
|
||||
private String vin;
|
||||
|
||||
@ExcelProperty("车辆编号")
|
||||
private String vehicleCode;
|
||||
|
||||
@ExcelProperty("品牌")
|
||||
private String brand;
|
||||
|
||||
@ExcelProperty("型号")
|
||||
private String model;
|
||||
|
||||
@ExcelProperty("车身颜色")
|
||||
private String color;
|
||||
|
||||
@ExcelProperty("发动机号")
|
||||
private String engineNo;
|
||||
|
||||
@ExcelProperty("能源类型")
|
||||
private String energyType;
|
||||
|
||||
@ExcelProperty("座位数")
|
||||
private Integer seatCount;
|
||||
|
||||
@ExcelProperty("额定载重(吨)")
|
||||
private BigDecimal loadCapacity;
|
||||
|
||||
@ExcelProperty("运营城市")
|
||||
private String city;
|
||||
|
||||
@ExcelProperty("登记所有权公司")
|
||||
private String ownerCompany;
|
||||
|
||||
@ExcelProperty("归属类型")
|
||||
private String ownershipType;
|
||||
|
||||
@ExcelProperty("采购日期")
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
@ExcelProperty("购入价格(元)")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@ExcelProperty("强制报废期")
|
||||
private LocalDate mandatoryScrapDate;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆导入结果 Response VO")
|
||||
@Data
|
||||
public class VehicleImportRespVO {
|
||||
|
||||
@Schema(description = "创建数量")
|
||||
private Integer createCount;
|
||||
|
||||
@Schema(description = "更新数量")
|
||||
private Integer updateCount;
|
||||
|
||||
@Schema(description = "失败消息列表")
|
||||
private List<String> failureMessages;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆保险创建/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleInsuranceSaveReqVO {
|
||||
|
||||
@Schema(description = "编号(更新时有值)")
|
||||
private Long id;
|
||||
|
||||
@NotNull(message = "保险类型不能为空")
|
||||
@Schema(description = "保险类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer insuranceType;
|
||||
|
||||
@Schema(description = "保险公司ID")
|
||||
private Long insuranceCompanyId;
|
||||
|
||||
@Schema(description = "保险公司名称")
|
||||
private String insuranceCompanyName;
|
||||
|
||||
@Schema(description = "保单号")
|
||||
private String policyNo;
|
||||
|
||||
@Schema(description = "第三者责任额度(元)")
|
||||
private BigDecimal thirdPartyLimit;
|
||||
|
||||
@Schema(description = "保费(元)")
|
||||
private BigDecimal premium;
|
||||
|
||||
@Schema(description = "保费承担公司")
|
||||
private String costBearingOrg;
|
||||
|
||||
@Schema(description = "保单生效日期")
|
||||
private LocalDate effectiveDate;
|
||||
|
||||
@Schema(description = "保单到期日期")
|
||||
private LocalDate expireDate;
|
||||
|
||||
@Schema(description = "保单附件URL")
|
||||
private String warrantyAttachment;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆证照创建/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleLicenceSaveReqVO {
|
||||
|
||||
@Schema(description = "行驶证注册日期")
|
||||
private LocalDate drivingRegisterDate;
|
||||
@Schema(description = "行驶证有效期")
|
||||
private LocalDate drivingExpireDate;
|
||||
@Schema(description = "行驶证强制报废日期")
|
||||
private LocalDate drivingScrapDate;
|
||||
|
||||
@Schema(description = "营运证编号")
|
||||
private String operationNum;
|
||||
@Schema(description = "营运证注册日期")
|
||||
private LocalDate operationRegisterDate;
|
||||
@Schema(description = "营运证有效期")
|
||||
private LocalDate operationExpireDate;
|
||||
@Schema(description = "营运证审验有效期")
|
||||
private LocalDate operationVerifyExpireDate;
|
||||
|
||||
@Schema(description = "通行证编号")
|
||||
private String passNum;
|
||||
@Schema(description = "通行区域")
|
||||
private String passArea;
|
||||
@Schema(description = "通行证有效期")
|
||||
private LocalDate passExpireDate;
|
||||
|
||||
@Schema(description = "加氢证编码")
|
||||
private String hydrogenNum;
|
||||
@Schema(description = "加氢证检验日期")
|
||||
private LocalDate hydrogenCheckDate;
|
||||
@Schema(description = "加氢卡编码")
|
||||
private String hydrogenCardNum;
|
||||
@Schema(description = "加氢证有效期")
|
||||
private LocalDate hydrogenExpireDate;
|
||||
|
||||
@Schema(description = "氢气瓶厂家")
|
||||
private String hydrogenCylinderFactory;
|
||||
@Schema(description = "氢气瓶检验日期")
|
||||
private LocalDate hydrogenCylinderInspectDate;
|
||||
@Schema(description = "氢气瓶检验周期(月)")
|
||||
private Integer hydrogenCylinderInspectCycle;
|
||||
@Schema(description = "氢瓶检测有效期")
|
||||
private LocalDate hydrogenCylinderExpireDate;
|
||||
|
||||
@Schema(description = "安全阀检验日期")
|
||||
private LocalDate safetyValveInspectDate;
|
||||
@Schema(description = "安全阀检验周期(月)")
|
||||
private Integer safetyValveInspectCycle;
|
||||
@Schema(description = "安全阀检测有效期")
|
||||
private LocalDate safetyValveExpireDate;
|
||||
|
||||
@Schema(description = "压力表检验日期")
|
||||
private LocalDate pressureGaugeInspectDate;
|
||||
@Schema(description = "压力表检验周期(月)")
|
||||
private Integer pressureGaugeInspectCycle;
|
||||
@Schema(description = "压力表检测有效期")
|
||||
private LocalDate pressureGaugeExpireDate;
|
||||
|
||||
@Schema(description = "年审到期时间")
|
||||
private LocalDate annualReviewExpireDate;
|
||||
@Schema(description = "等评时间")
|
||||
private LocalDate ratingDate;
|
||||
|
||||
@Schema(description = "证照附件URL(JSON数组)")
|
||||
private String attachmentUrls;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆锁定 Request VO")
|
||||
@Data
|
||||
public class VehicleLockReqVO {
|
||||
|
||||
@NotNull(message = "车辆ID不能为空")
|
||||
@Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@NotNull(message = "合同ID不能为空")
|
||||
@Schema(description = "合同ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "合同编号")
|
||||
private String contractNo;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆型号分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VehicleModelPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "品牌名")
|
||||
private String brandName;
|
||||
|
||||
@Schema(description = "型号名")
|
||||
private String modelName;
|
||||
|
||||
@Schema(description = "车辆类型")
|
||||
private String vehicleType;
|
||||
|
||||
@Schema(description = "燃料种类")
|
||||
private String fuelType;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆型号 Response VO")
|
||||
@Data
|
||||
public class VehicleModelRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "品牌名")
|
||||
private String brandName;
|
||||
@Schema(description = "型号名")
|
||||
private String modelName;
|
||||
@Schema(description = "车辆类型")
|
||||
private String vehicleType;
|
||||
@Schema(description = "燃料种类")
|
||||
private String fuelType;
|
||||
@Schema(description = "车牌颜色")
|
||||
private Integer plateColor;
|
||||
@Schema(description = "车身长(mm)")
|
||||
private BigDecimal bodyLength;
|
||||
@Schema(description = "车身宽(mm)")
|
||||
private BigDecimal bodyWidth;
|
||||
@Schema(description = "车身高(mm)")
|
||||
private BigDecimal bodyHeight;
|
||||
@Schema(description = "轮胎数量")
|
||||
private Integer tireCount;
|
||||
@Schema(description = "轮胎规格")
|
||||
private String tireSpec;
|
||||
@Schema(description = "电池类型")
|
||||
private Integer batteryType;
|
||||
@Schema(description = "电池厂家")
|
||||
private String batteryMaker;
|
||||
@Schema(description = "储电量(kWh)")
|
||||
private BigDecimal batteryCapacity;
|
||||
@Schema(description = "纯电续航(KM)")
|
||||
private BigDecimal electricRange;
|
||||
@Schema(description = "氢箱容量(L)")
|
||||
private BigDecimal hydrogenCapacity;
|
||||
@Schema(description = "氢续航(KM)")
|
||||
private BigDecimal hydrogenRange;
|
||||
@Schema(description = "氢系统厂家")
|
||||
private String hydrogenSystemMaker;
|
||||
@Schema(description = "电堆厂家")
|
||||
private String fuelCellMaker;
|
||||
@Schema(description = "冷机厂家")
|
||||
private String chillerMaker;
|
||||
@Schema(description = "仪表盘模式")
|
||||
private String dashboardMode;
|
||||
@Schema(description = "公告型号")
|
||||
private String noticeModel;
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆型号创建/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleModelSaveReqVO {
|
||||
|
||||
@Schema(description = "编号(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "品牌名不能为空")
|
||||
@Schema(description = "品牌名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String brandName;
|
||||
|
||||
@NotBlank(message = "型号名不能为空")
|
||||
@Schema(description = "型号名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String modelName;
|
||||
|
||||
@Schema(description = "车辆类型")
|
||||
private String vehicleType;
|
||||
@Schema(description = "燃料种类")
|
||||
private String fuelType;
|
||||
@Schema(description = "车牌颜色")
|
||||
private Integer plateColor;
|
||||
@Schema(description = "车身长(mm)")
|
||||
private BigDecimal bodyLength;
|
||||
@Schema(description = "车身宽(mm)")
|
||||
private BigDecimal bodyWidth;
|
||||
@Schema(description = "车身高(mm)")
|
||||
private BigDecimal bodyHeight;
|
||||
@Schema(description = "轮胎数量")
|
||||
private Integer tireCount;
|
||||
@Schema(description = "轮胎规格")
|
||||
private String tireSpec;
|
||||
@Schema(description = "电池类型")
|
||||
private Integer batteryType;
|
||||
@Schema(description = "电池厂家")
|
||||
private String batteryMaker;
|
||||
@Schema(description = "储电量(kWh)")
|
||||
private BigDecimal batteryCapacity;
|
||||
@Schema(description = "纯电续航(KM)")
|
||||
private BigDecimal electricRange;
|
||||
@Schema(description = "氢箱容量(L)")
|
||||
private BigDecimal hydrogenCapacity;
|
||||
@Schema(description = "氢续航(KM)")
|
||||
private BigDecimal hydrogenRange;
|
||||
@Schema(description = "氢系统厂家")
|
||||
private String hydrogenSystemMaker;
|
||||
@Schema(description = "电堆厂家")
|
||||
private String fuelCellMaker;
|
||||
@Schema(description = "冷机厂家")
|
||||
private String chillerMaker;
|
||||
@Schema(description = "仪表盘模式")
|
||||
private String dashboardMode;
|
||||
@Schema(description = "公告型号")
|
||||
private String noticeModel;
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆型号精简 Response VO")
|
||||
@Data
|
||||
public class VehicleModelSimpleRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "品牌名")
|
||||
private String brandName;
|
||||
@Schema(description = "型号名")
|
||||
private String modelName;
|
||||
@Schema(description = "车辆类型")
|
||||
private String vehicleType;
|
||||
@Schema(description = "燃料种类")
|
||||
private String fuelType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VehiclePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "车牌号")
|
||||
private String plateNumber;
|
||||
|
||||
@Schema(description = "车架号VIN")
|
||||
private String vin;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "能源类型")
|
||||
private Integer energyType;
|
||||
|
||||
@Schema(description = "租赁状态")
|
||||
private Integer rentStatus;
|
||||
|
||||
@Schema(description = "运营状态")
|
||||
private Integer operationalStatus;
|
||||
|
||||
@Schema(description = "归属类型")
|
||||
private Integer ownershipType;
|
||||
|
||||
@Schema(description = "运营城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所属部门ID")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "停车场ID")
|
||||
private Long parkingId;
|
||||
|
||||
@Schema(description = "车辆类型ID")
|
||||
private Long vehicleTypeId;
|
||||
|
||||
@Schema(description = "车辆型号ID")
|
||||
private Long vehicleModelId;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "公告型号(模糊搜索,查ext表)")
|
||||
private String noticeModel;
|
||||
|
||||
@Schema(description = "是否即将到期(证照30天内到期)")
|
||||
private Boolean expiringSoon;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆 Response VO")
|
||||
@Data
|
||||
public class VehicleRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "车牌号")
|
||||
private String plateNumber;
|
||||
@Schema(description = "车架号VIN")
|
||||
private String vin;
|
||||
@Schema(description = "车辆编号")
|
||||
private String vehicleCode;
|
||||
@Schema(description = "车辆类型ID")
|
||||
private Long vehicleTypeId;
|
||||
@Schema(description = "车辆类型名称")
|
||||
private String vehicleTypeName;
|
||||
@Schema(description = "车辆型号ID")
|
||||
private Long vehicleModelId;
|
||||
@Schema(description = "车辆型号名称")
|
||||
private String vehicleModelName;
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
@Schema(description = "车身颜色")
|
||||
private String color;
|
||||
@Schema(description = "发动机号")
|
||||
private String engineNo;
|
||||
@Schema(description = "能源类型")
|
||||
private Integer energyType;
|
||||
@Schema(description = "座位数")
|
||||
private Integer seatCount;
|
||||
@Schema(description = "额定载重(吨)")
|
||||
private BigDecimal loadCapacity;
|
||||
@Schema(description = "运营省份")
|
||||
private String province;
|
||||
@Schema(description = "运营城市")
|
||||
private String city;
|
||||
@Schema(description = "停车场ID")
|
||||
private Long parkingId;
|
||||
@Schema(description = "停车场名称")
|
||||
private String parkingName;
|
||||
@Schema(description = "停车位置")
|
||||
private String parkingPosition;
|
||||
@Schema(description = "登记所有权公司")
|
||||
private String ownerCompany;
|
||||
@Schema(description = "归属类型")
|
||||
private Integer ownershipType;
|
||||
@Schema(description = "所属部门ID")
|
||||
private Long deptId;
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
@Schema(description = "采购入库日期")
|
||||
private LocalDate purchaseDate;
|
||||
@Schema(description = "购入价格(元)")
|
||||
private BigDecimal purchasePrice;
|
||||
@Schema(description = "出厂年份")
|
||||
private Integer manufactureYear;
|
||||
@Schema(description = "注册登记日期")
|
||||
private LocalDate registrationDate;
|
||||
@Schema(description = "强制报废期")
|
||||
private LocalDate mandatoryScrapDate;
|
||||
@Schema(description = "当前里程(公里)")
|
||||
private BigDecimal mileage;
|
||||
@Schema(description = "租赁状态")
|
||||
private Integer rentStatus;
|
||||
@Schema(description = "运营状态")
|
||||
private Integer operationalStatus;
|
||||
@Schema(description = "整备状态")
|
||||
private Integer preparationStatus;
|
||||
@Schema(description = "维修状态")
|
||||
private Integer repairStatus;
|
||||
@Schema(description = "证照状态")
|
||||
private Integer licenseStatus;
|
||||
@Schema(description = "报废状态")
|
||||
private Integer scrapStatus;
|
||||
@Schema(description = "当前合同ID")
|
||||
private Long contractId;
|
||||
@Schema(description = "当前合同编号")
|
||||
private String contractNo;
|
||||
@Schema(description = "当前客户名称")
|
||||
private String customerName;
|
||||
@Schema(description = "最近交车时间")
|
||||
private LocalDateTime lastDeliveryTime;
|
||||
@Schema(description = "最近交车里程")
|
||||
private BigDecimal lastDeliveryMileage;
|
||||
@Schema(description = "最近还车时间")
|
||||
private LocalDateTime lastReturnTime;
|
||||
@Schema(description = "最近还车里程")
|
||||
private BigDecimal lastReturnMileage;
|
||||
@Schema(description = "资源分类")
|
||||
private String resourceCategory;
|
||||
@Schema(description = "资产评级")
|
||||
private String assetRating;
|
||||
@Schema(description = "评级时间")
|
||||
private LocalDate ratingTime;
|
||||
@Schema(description = "GPS当前位置")
|
||||
private String currentLocation;
|
||||
@Schema(description = "GPS经度")
|
||||
private BigDecimal longitude;
|
||||
@Schema(description = "GPS纬度")
|
||||
private BigDecimal latitude;
|
||||
@Schema(description = "GPS最后上报时间")
|
||||
private LocalDateTime gpsLastTime;
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
// ===== 子表数据(详情查询时返回) =====
|
||||
@Schema(description = "证照信息")
|
||||
private VehicleLicenceSaveReqVO licence;
|
||||
@Schema(description = "保险列表")
|
||||
private List<VehicleInsuranceSaveReqVO> insurances;
|
||||
@Schema(description = "扩展信息")
|
||||
private VehicleExtSaveReqVO ext;
|
||||
@Schema(description = "后装设备列表")
|
||||
private List<VehicleEquipmentRespVO> equipments;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆创建/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleSaveReqVO {
|
||||
|
||||
@Schema(description = "编号(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "车牌号不能为空")
|
||||
@Schema(description = "车牌号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String plateNumber;
|
||||
|
||||
@Schema(description = "车架号VIN")
|
||||
private String vin;
|
||||
|
||||
@Schema(description = "车辆编号")
|
||||
private String vehicleCode;
|
||||
|
||||
@Schema(description = "车辆类型ID")
|
||||
private Long vehicleTypeId;
|
||||
|
||||
@Schema(description = "车辆型号ID")
|
||||
private Long vehicleModelId;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "车身颜色")
|
||||
private String color;
|
||||
|
||||
@Schema(description = "发动机号")
|
||||
private String engineNo;
|
||||
|
||||
@Schema(description = "能源类型")
|
||||
private Integer energyType;
|
||||
|
||||
@Schema(description = "座位数")
|
||||
private Integer seatCount;
|
||||
|
||||
@Schema(description = "额定载重(吨)")
|
||||
private BigDecimal loadCapacity;
|
||||
|
||||
@Schema(description = "运营省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "运营城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "停车场ID")
|
||||
private Long parkingId;
|
||||
|
||||
@Schema(description = "停车位置")
|
||||
private String parkingPosition;
|
||||
|
||||
@Schema(description = "登记所有权公司")
|
||||
private String ownerCompany;
|
||||
|
||||
@Schema(description = "归属类型")
|
||||
private Integer ownershipType;
|
||||
|
||||
@Schema(description = "所属部门ID")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "采购入库日期")
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
@Schema(description = "购入价格(元)")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
@Schema(description = "出厂年份")
|
||||
private Integer manufactureYear;
|
||||
|
||||
@Schema(description = "注册登记日期")
|
||||
private LocalDate registrationDate;
|
||||
|
||||
@Schema(description = "强制报废期")
|
||||
private LocalDate mandatoryScrapDate;
|
||||
|
||||
@Schema(description = "当前里程(公里)")
|
||||
private BigDecimal mileage;
|
||||
|
||||
@Schema(description = "运营状态")
|
||||
private Integer operationalStatus;
|
||||
|
||||
@Schema(description = "资源分类")
|
||||
private String resourceCategory;
|
||||
|
||||
@Schema(description = "资产评级")
|
||||
private String assetRating;
|
||||
|
||||
@Schema(description = "评级时间")
|
||||
private LocalDate ratingTime;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
// ===== 子表数据(创建/编辑时一并提交) =====
|
||||
@Schema(description = "证照信息")
|
||||
private VehicleLicenceSaveReqVO licence;
|
||||
|
||||
@Schema(description = "保险列表")
|
||||
private List<VehicleInsuranceSaveReqVO> insurances;
|
||||
|
||||
@Schema(description = "扩展信息")
|
||||
private VehicleExtSaveReqVO ext;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆精简 Response VO(下拉选择用)")
|
||||
@Data
|
||||
public class VehicleSimpleRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "车牌号")
|
||||
private String plateNumber;
|
||||
@Schema(description = "车架号VIN")
|
||||
private String vin;
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
@Schema(description = "租赁状态")
|
||||
private Integer rentStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆类型分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VehicleTypePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "类型名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆类型 Response VO")
|
||||
@Data
|
||||
public class VehicleTypeRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "类型编码")
|
||||
private String code;
|
||||
@Schema(description = "类型名称")
|
||||
private String name;
|
||||
@Schema(description = "类型分组")
|
||||
private String groupName;
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆类型创建/修改 Request VO")
|
||||
@Data
|
||||
public class VehicleTypeSaveReqVO {
|
||||
|
||||
@Schema(description = "编号(更新时必填)")
|
||||
private Long id;
|
||||
|
||||
@NotBlank(message = "类型编码不能为空")
|
||||
@Schema(description = "类型编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String code;
|
||||
|
||||
@NotBlank(message = "类型名称不能为空")
|
||||
@Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型分组")
|
||||
private String groupName;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆类型精简 Response VO")
|
||||
@Data
|
||||
public class VehicleTypeSimpleRespVO {
|
||||
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
@Schema(description = "类型名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆解锁 Request VO")
|
||||
@Data
|
||||
public class VehicleUnlockReqVO {
|
||||
|
||||
@NotNull(message = "车辆ID不能为空")
|
||||
@Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 车辆状态变更 Request VO")
|
||||
@Data
|
||||
public class VehicleUpdateStatusReqVO {
|
||||
|
||||
@NotNull(message = "车辆ID不能为空")
|
||||
@Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@NotNull(message = "目标租赁状态不能为空")
|
||||
@Schema(description = "目标租赁状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer rentStatus;
|
||||
|
||||
@Schema(description = "变更原因")
|
||||
private String reason;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.device;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* IoT设备表 DO
|
||||
*/
|
||||
@TableName("asset_device")
|
||||
@KeySequence("asset_device_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 设备IMEI号 */
|
||||
private String imei;
|
||||
/** 设备名称 */
|
||||
private String name;
|
||||
/** 设备类型 */
|
||||
private Integer type;
|
||||
/** 品牌 */
|
||||
private String brand;
|
||||
/** 型号 */
|
||||
private String model;
|
||||
/** SIM卡号 */
|
||||
private String simNo;
|
||||
/** 绑定状态(0未绑定 1已绑定) */
|
||||
private Integer bindStatus;
|
||||
/** 当前绑定车辆ID */
|
||||
private Long vehicleId;
|
||||
/** 服务到期时间 */
|
||||
private LocalDate serviceExpireTime;
|
||||
/** 所属部门ID */
|
||||
private Long deptId;
|
||||
/** 状态(0正常 1停用) */
|
||||
private Integer status;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.driver;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 司机信息表 DO
|
||||
*/
|
||||
@TableName("asset_driver")
|
||||
@KeySequence("asset_driver_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DriverDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 关联系统用户ID */
|
||||
private Long userId;
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
/** 手机号 */
|
||||
private String phone;
|
||||
/** 身份证号 */
|
||||
private String idCardNo;
|
||||
/** 性别(1男 2女) */
|
||||
private Integer gender;
|
||||
/** 出生日期 */
|
||||
private LocalDate birthDate;
|
||||
/** 驾驶证号 */
|
||||
private String driverLicenseNo;
|
||||
/** 驾驶证类型(A1/A2/B1/B2/C1等) */
|
||||
private String driverLicenseType;
|
||||
/** 驾驶证到期日 */
|
||||
private LocalDate driverLicenseExpire;
|
||||
/** 从业资格证号 */
|
||||
private String qualificationCertNo;
|
||||
/** 从业资格证到期日 */
|
||||
private LocalDate qualificationCertExpire;
|
||||
/** 入职日期 */
|
||||
private LocalDate entryDate;
|
||||
/** 离职日期 */
|
||||
private LocalDate leaveDate;
|
||||
/** 月薪(元) */
|
||||
private BigDecimal monthlyPay;
|
||||
/** 紧急联系人 */
|
||||
private String emergencyContact;
|
||||
/** 紧急联系电话 */
|
||||
private String emergencyPhone;
|
||||
/** 状态(0正常 1停用) */
|
||||
private Integer status;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.driver;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 司机车辆绑定表 DO
|
||||
*/
|
||||
@TableName("asset_driver_vehicle")
|
||||
@KeySequence("asset_driver_vehicle_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DriverVehicleDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 司机ID */
|
||||
private Long driverId;
|
||||
/** 车辆ID */
|
||||
private Long vehicleId;
|
||||
/** 车牌号(冗余) */
|
||||
private String plateNumber;
|
||||
/** 司机姓名(冗余) */
|
||||
private String driverName;
|
||||
/** 司机电话(冗余) */
|
||||
private String driverPhone;
|
||||
/** 绑定时间 */
|
||||
private LocalDateTime bindTime;
|
||||
/** 解绑时间 */
|
||||
private LocalDateTime unbindTime;
|
||||
/** 绑定状态(0已解绑 1已绑定) */
|
||||
private Integer bindStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 车辆主表 DO
|
||||
*/
|
||||
@TableName("asset_vehicle")
|
||||
@KeySequence("asset_vehicle_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
// ===== 基本标识 =====
|
||||
/** 车牌号 */
|
||||
private String plateNumber;
|
||||
/** 车架号(VIN码) */
|
||||
private String vin;
|
||||
/** 车辆编号 */
|
||||
private String vehicleCode;
|
||||
|
||||
// ===== 型号参数 =====
|
||||
/** 车辆类型ID(关联 asset_vehicle_type) */
|
||||
private Long vehicleTypeId;
|
||||
/** 车辆型号ID(关联 asset_vehicle_model) */
|
||||
private Long vehicleModelId;
|
||||
/** 品牌 */
|
||||
private String brand;
|
||||
/** 型号 */
|
||||
private String model;
|
||||
/** 车身颜色 */
|
||||
private String color;
|
||||
/** 发动机号/电机编号 */
|
||||
private String engineNo;
|
||||
/** 能源类型 */
|
||||
private Integer energyType;
|
||||
/** 座位数 */
|
||||
private Integer seatCount;
|
||||
/** 额定载重(吨) */
|
||||
private BigDecimal loadCapacity;
|
||||
|
||||
// ===== 运营归属 =====
|
||||
/** 运营省份 */
|
||||
private String province;
|
||||
/** 运营城市 */
|
||||
private String city;
|
||||
/** 停车场ID */
|
||||
private Long parkingId;
|
||||
/** 停车位置 */
|
||||
private String parkingPosition;
|
||||
/** 登记所有权公司 */
|
||||
private String ownerCompany;
|
||||
/** 归属类型 */
|
||||
private Integer ownershipType;
|
||||
/** 所属部门ID */
|
||||
private Long deptId;
|
||||
|
||||
// ===== 采购信息 =====
|
||||
/** 采购入库日期 */
|
||||
private LocalDate purchaseDate;
|
||||
/** 购入价格(元) */
|
||||
private BigDecimal purchasePrice;
|
||||
/** 出厂年份 */
|
||||
private Integer manufactureYear;
|
||||
/** 注册登记日期 */
|
||||
private LocalDate registrationDate;
|
||||
/** 强制报废期 */
|
||||
private LocalDate mandatoryScrapDate;
|
||||
|
||||
// ===== 里程 =====
|
||||
/** 当前里程(公里) */
|
||||
private BigDecimal mileage;
|
||||
|
||||
// ===== 多维状态 =====
|
||||
/** 租赁状态 */
|
||||
private Integer rentStatus;
|
||||
/** 运营状态 */
|
||||
private Integer operationalStatus;
|
||||
/** 整备状态 */
|
||||
private Integer preparationStatus;
|
||||
/** 维修状态 */
|
||||
private Integer repairStatus;
|
||||
/** 证照状态 */
|
||||
private Integer licenseStatus;
|
||||
/** 报废状态 */
|
||||
private Integer scrapStatus;
|
||||
|
||||
// ===== 业务关联(冗余字段加速查询) =====
|
||||
/** 当前合同ID */
|
||||
private Long contractId;
|
||||
/** 当前合同编号 */
|
||||
private String contractNo;
|
||||
/** 当前客户名称 */
|
||||
private String customerName;
|
||||
|
||||
// ===== 交还车快照 =====
|
||||
/** 最近交车时间 */
|
||||
private LocalDateTime lastDeliveryTime;
|
||||
/** 最近交车里程 */
|
||||
private BigDecimal lastDeliveryMileage;
|
||||
/** 最近还车时间 */
|
||||
private LocalDateTime lastReturnTime;
|
||||
/** 最近还车里程 */
|
||||
private BigDecimal lastReturnMileage;
|
||||
|
||||
// ===== 评级 =====
|
||||
/** 资源分类 */
|
||||
private String resourceCategory;
|
||||
/** 资产评级 */
|
||||
private String assetRating;
|
||||
/** 评级时间 */
|
||||
private LocalDate ratingTime;
|
||||
|
||||
// ===== GPS =====
|
||||
/** GPS当前位置 */
|
||||
private String currentLocation;
|
||||
/** GPS经度 */
|
||||
private BigDecimal longitude;
|
||||
/** GPS纬度 */
|
||||
private BigDecimal latitude;
|
||||
/** GPS最后上报时间 */
|
||||
private LocalDateTime gpsLastTime;
|
||||
|
||||
// ===== 通用 =====
|
||||
/** 状态(0正常 1停用) */
|
||||
private Integer status;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 车辆后装设备表 DO
|
||||
*/
|
||||
@TableName("asset_vehicle_equipment")
|
||||
@KeySequence("asset_vehicle_equipment_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleEquipmentDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 车辆ID */
|
||||
private Long vehicleId;
|
||||
/** 设备类型 */
|
||||
private Integer equipmentType;
|
||||
/** 设备名称 */
|
||||
private String equipmentName;
|
||||
/** 设备编号 */
|
||||
private String equipmentNo;
|
||||
/** 供应商 */
|
||||
private String supplierName;
|
||||
/** 安装日期 */
|
||||
private LocalDate installDate;
|
||||
/** 到期日期 */
|
||||
private LocalDate expireDate;
|
||||
/** 设备状态 */
|
||||
private String equipmentStatus;
|
||||
|
||||
// ===== 尾板专用 =====
|
||||
/** 尾板型号 */
|
||||
private String tailboardModel;
|
||||
/** 尾板编号 */
|
||||
private String tailboardNo;
|
||||
/** 尾板自重(kg) */
|
||||
private BigDecimal tailboardWeight;
|
||||
/** 尾板额定载荷(t) */
|
||||
private BigDecimal tailboardRatedLoad;
|
||||
/** 尾板信息 */
|
||||
private String tailboardInfo;
|
||||
/** 合格证附件URL */
|
||||
private String certificateAttachment;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 车辆扩展信息表 DO
|
||||
*/
|
||||
@TableName("asset_vehicle_ext")
|
||||
@KeySequence("asset_vehicle_ext_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleExtDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 车辆ID */
|
||||
private Long vehicleId;
|
||||
|
||||
// ===== 车身广告 =====
|
||||
/** 是否有车身广告(0否 1是) */
|
||||
private Integer hasBodyAdvertisement;
|
||||
/** 广告喷涂时间 */
|
||||
private LocalDate advertisementApplyDate;
|
||||
/** 广告备注 */
|
||||
private String advertisementRemark;
|
||||
/** 广告照片URL(JSON数组) */
|
||||
private String advertisementPhotoUrls;
|
||||
|
||||
// ===== 氢能参数 =====
|
||||
/** 氢瓶容量(L) */
|
||||
private BigDecimal hydrogenCapacity;
|
||||
/** 储电量(kWh) */
|
||||
private BigDecimal batteryCapacity;
|
||||
/** 电池厂家 */
|
||||
private String batteryFactory;
|
||||
/** 电堆厂家 */
|
||||
private String fuelCellFactory;
|
||||
/** 氢系统厂家 */
|
||||
private String hydrogenSystemFactory;
|
||||
/** 冷机厂家 */
|
||||
private String chillerFactory;
|
||||
|
||||
// ===== 轮胎 =====
|
||||
/** 轮胎数量 */
|
||||
private Integer tireCount;
|
||||
/** 轮胎规格 */
|
||||
private String tireSpec;
|
||||
|
||||
// ===== 车辆尺寸 =====
|
||||
/** 车身长(mm) */
|
||||
private BigDecimal bodyLength;
|
||||
/** 车身宽(mm) */
|
||||
private BigDecimal bodyWidth;
|
||||
/** 车身高(mm) */
|
||||
private BigDecimal bodyHeight;
|
||||
|
||||
// ===== 公告信息 =====
|
||||
/** 公告型号 */
|
||||
private String noticeModel;
|
||||
/** 仪表盘模式 */
|
||||
private String dashboardMode;
|
||||
|
||||
// ===== 租赁来源 =====
|
||||
/** 租赁来源公司 */
|
||||
private String rentFromCompany;
|
||||
|
||||
// ===== 车辆批次 =====
|
||||
/** 车辆批次 */
|
||||
private String vehicleBatch;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 车辆保险表 DO
|
||||
*/
|
||||
@TableName("asset_vehicle_insurance")
|
||||
@KeySequence("asset_vehicle_insurance_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleInsuranceDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 车辆ID */
|
||||
private Long vehicleId;
|
||||
/** 保险类型 */
|
||||
private Integer insuranceType;
|
||||
/** 保险公司ID */
|
||||
private Long insuranceCompanyId;
|
||||
/** 保险公司名称(冗余) */
|
||||
private String insuranceCompanyName;
|
||||
/** 保单号 */
|
||||
private String policyNo;
|
||||
/** 第三者责任额度(元) */
|
||||
private BigDecimal thirdPartyLimit;
|
||||
/** 保费(元) */
|
||||
private BigDecimal premium;
|
||||
/** 保费承担公司 */
|
||||
private String costBearingOrg;
|
||||
/** 保单生效日期 */
|
||||
private LocalDate effectiveDate;
|
||||
/** 保单到期日期 */
|
||||
private LocalDate expireDate;
|
||||
/** 保单附件URL */
|
||||
private String warrantyAttachment;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 车辆证照表 DO
|
||||
*/
|
||||
@TableName("asset_vehicle_licence")
|
||||
@KeySequence("asset_vehicle_licence_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleLicenceDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 车辆ID */
|
||||
private Long vehicleId;
|
||||
|
||||
// ===== 行驶证 =====
|
||||
/** 行驶证注册日期 */
|
||||
private LocalDate drivingRegisterDate;
|
||||
/** 行驶证有效期 */
|
||||
private LocalDate drivingExpireDate;
|
||||
/** 行驶证强制报废日期 */
|
||||
private LocalDate drivingScrapDate;
|
||||
|
||||
// ===== 营运证 =====
|
||||
/** 营运证编号 */
|
||||
private String operationNum;
|
||||
/** 营运证注册日期 */
|
||||
private LocalDate operationRegisterDate;
|
||||
/** 营运证有效期 */
|
||||
private LocalDate operationExpireDate;
|
||||
/** 营运证审验有效期 */
|
||||
private LocalDate operationVerifyExpireDate;
|
||||
|
||||
// ===== 通行证 =====
|
||||
/** 通行证编号 */
|
||||
private String passNum;
|
||||
/** 通行区域 */
|
||||
private String passArea;
|
||||
/** 通行证有效期 */
|
||||
private LocalDate passExpireDate;
|
||||
|
||||
// ===== 加氢证 =====
|
||||
/** 加氢证编码 */
|
||||
private String hydrogenNum;
|
||||
/** 加氢证检验日期 */
|
||||
private LocalDate hydrogenCheckDate;
|
||||
/** 加氢卡编码 */
|
||||
private String hydrogenCardNum;
|
||||
/** 加氢证有效期 */
|
||||
private LocalDate hydrogenExpireDate;
|
||||
|
||||
// ===== 氢瓶检验 =====
|
||||
/** 氢气瓶厂家 */
|
||||
private String hydrogenCylinderFactory;
|
||||
/** 氢气瓶检验日期 */
|
||||
private LocalDate hydrogenCylinderInspectDate;
|
||||
/** 氢气瓶检验周期(月) */
|
||||
private Integer hydrogenCylinderInspectCycle;
|
||||
/** 氢瓶检测有效期 */
|
||||
private LocalDate hydrogenCylinderExpireDate;
|
||||
|
||||
// ===== 安全阀检验 =====
|
||||
/** 安全阀检验日期 */
|
||||
private LocalDate safetyValveInspectDate;
|
||||
/** 安全阀检验周期(月) */
|
||||
private Integer safetyValveInspectCycle;
|
||||
/** 安全阀检测有效期 */
|
||||
private LocalDate safetyValveExpireDate;
|
||||
|
||||
// ===== 压力表检验 =====
|
||||
/** 压力表检验日期 */
|
||||
private LocalDate pressureGaugeInspectDate;
|
||||
/** 压力表检验周期(月) */
|
||||
private Integer pressureGaugeInspectCycle;
|
||||
/** 压力表检测有效期 */
|
||||
private LocalDate pressureGaugeExpireDate;
|
||||
|
||||
// ===== 年审 =====
|
||||
/** 年审到期时间 */
|
||||
private LocalDate annualReviewExpireDate;
|
||||
/** 等评时间 */
|
||||
private LocalDate ratingDate;
|
||||
|
||||
// ===== 附件 =====
|
||||
/** 证照附件URL(JSON数组) */
|
||||
private String attachmentUrls;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 车辆型号参数表 DO
|
||||
*/
|
||||
@TableName("asset_vehicle_model")
|
||||
@KeySequence("asset_vehicle_model_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleModelDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 品牌名 */
|
||||
private String brandName;
|
||||
/** 型号名 */
|
||||
private String modelName;
|
||||
/** 车辆类型 */
|
||||
private String vehicleType;
|
||||
/** 燃料种类 */
|
||||
private String fuelType;
|
||||
/** 车牌颜色(0绿 1黄 2黄绿) */
|
||||
private Integer plateColor;
|
||||
|
||||
// ===== 尺寸 =====
|
||||
/** 车身长(mm) */
|
||||
private BigDecimal bodyLength;
|
||||
/** 车身宽(mm) */
|
||||
private BigDecimal bodyWidth;
|
||||
/** 车身高(mm) */
|
||||
private BigDecimal bodyHeight;
|
||||
|
||||
// ===== 轮胎 =====
|
||||
/** 轮胎数量 */
|
||||
private Integer tireCount;
|
||||
/** 轮胎规格 */
|
||||
private String tireSpec;
|
||||
|
||||
// ===== 电池 =====
|
||||
/** 电池类型(0磷酸铁锂 1三元锂) */
|
||||
private Integer batteryType;
|
||||
/** 电池厂家 */
|
||||
private String batteryMaker;
|
||||
/** 储电量(kWh) */
|
||||
private BigDecimal batteryCapacity;
|
||||
/** 纯电续航(KM) */
|
||||
private BigDecimal electricRange;
|
||||
|
||||
// ===== 氢能 =====
|
||||
/** 氢箱容量(L) */
|
||||
private BigDecimal hydrogenCapacity;
|
||||
/** 氢续航(KM) */
|
||||
private BigDecimal hydrogenRange;
|
||||
/** 氢系统厂家 */
|
||||
private String hydrogenSystemMaker;
|
||||
/** 电堆厂家 */
|
||||
private String fuelCellMaker;
|
||||
|
||||
// ===== 其他 =====
|
||||
/** 冷机厂家 */
|
||||
private String chillerMaker;
|
||||
/** 仪表盘模式 */
|
||||
private String dashboardMode;
|
||||
/** 公告型号 */
|
||||
private String noticeModel;
|
||||
/** 状态(0正常 1停用) */
|
||||
private Integer status;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 车辆类型表 DO
|
||||
*/
|
||||
@TableName("asset_vehicle_type")
|
||||
@KeySequence("asset_vehicle_type_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleTypeDO extends TenantBaseDO {
|
||||
|
||||
/** 主键 */
|
||||
@TableId
|
||||
private Long id;
|
||||
/** 类型编码 */
|
||||
private String code;
|
||||
/** 类型名称 */
|
||||
private String name;
|
||||
/** 类型分组 */
|
||||
private String groupName;
|
||||
/** 排序 */
|
||||
private Integer sort;
|
||||
/** 状态(0正常 1停用) */
|
||||
private Integer status;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.device;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.device.vo.DevicePageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.device.DeviceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DeviceMapper extends BaseMapperX<DeviceDO> {
|
||||
|
||||
default PageResult<DeviceDO> selectPage(DevicePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceDO>()
|
||||
.likeIfPresent(DeviceDO::getImei, reqVO.getImei())
|
||||
.likeIfPresent(DeviceDO::getName, reqVO.getName())
|
||||
.eqIfPresent(DeviceDO::getType, reqVO.getType())
|
||||
.eqIfPresent(DeviceDO::getBindStatus, reqVO.getBindStatus())
|
||||
.eqIfPresent(DeviceDO::getVehicleId, reqVO.getVehicleId())
|
||||
.eqIfPresent(DeviceDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(DeviceDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceDO::getId));
|
||||
}
|
||||
|
||||
default DeviceDO selectByImei(String imei) {
|
||||
return selectOne(DeviceDO::getImei, imei);
|
||||
}
|
||||
|
||||
default List<DeviceDO> selectSimpleList(Integer bindStatus) {
|
||||
return selectList(new LambdaQueryWrapperX<DeviceDO>()
|
||||
.eqIfPresent(DeviceDO::getBindStatus, bindStatus)
|
||||
.eq(DeviceDO::getStatus, 0)
|
||||
.orderByDesc(DeviceDO::getId));
|
||||
}
|
||||
|
||||
default List<DeviceDO> selectByVehicleId(Long vehicleId) {
|
||||
return selectList(new LambdaQueryWrapperX<DeviceDO>()
|
||||
.eq(DeviceDO::getVehicleId, vehicleId)
|
||||
.eq(DeviceDO::getBindStatus, 1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.driver;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.driver.vo.DriverPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.driver.DriverDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DriverMapper extends BaseMapperX<DriverDO> {
|
||||
|
||||
default PageResult<DriverDO> selectPage(DriverPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DriverDO>()
|
||||
.likeIfPresent(DriverDO::getName, reqVO.getName())
|
||||
.likeIfPresent(DriverDO::getPhone, reqVO.getPhone())
|
||||
.likeIfPresent(DriverDO::getIdCardNo, reqVO.getIdCardNo())
|
||||
.eqIfPresent(DriverDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(DriverDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DriverDO::getId));
|
||||
}
|
||||
|
||||
default List<DriverDO> selectSimpleList() {
|
||||
return selectList(new LambdaQueryWrapperX<DriverDO>()
|
||||
.eq(DriverDO::getStatus, 0)
|
||||
.orderByDesc(DriverDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.driver;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.driver.DriverVehicleDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DriverVehicleMapper extends BaseMapperX<DriverVehicleDO> {
|
||||
|
||||
default List<DriverVehicleDO> selectByDriverId(Long driverId) {
|
||||
return selectList(new LambdaQueryWrapperX<DriverVehicleDO>()
|
||||
.eq(DriverVehicleDO::getDriverId, driverId)
|
||||
.eq(DriverVehicleDO::getBindStatus, 1));
|
||||
}
|
||||
|
||||
default List<DriverVehicleDO> selectByVehicleId(Long vehicleId) {
|
||||
return selectList(new LambdaQueryWrapperX<DriverVehicleDO>()
|
||||
.eq(DriverVehicleDO::getVehicleId, vehicleId)
|
||||
.eq(DriverVehicleDO::getBindStatus, 1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleEquipmentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VehicleEquipmentMapper extends BaseMapperX<VehicleEquipmentDO> {
|
||||
|
||||
default PageResult<VehicleEquipmentDO> selectPage(VehicleEquipmentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<VehicleEquipmentDO>()
|
||||
.eqIfPresent(VehicleEquipmentDO::getVehicleId, reqVO.getVehicleId())
|
||||
.eqIfPresent(VehicleEquipmentDO::getEquipmentType, reqVO.getEquipmentType())
|
||||
.likeIfPresent(VehicleEquipmentDO::getEquipmentName, reqVO.getEquipmentName())
|
||||
.likeIfPresent(VehicleEquipmentDO::getEquipmentNo, reqVO.getEquipmentNo())
|
||||
.orderByDesc(VehicleEquipmentDO::getId));
|
||||
}
|
||||
|
||||
default List<VehicleEquipmentDO> selectByVehicleId(Long vehicleId) {
|
||||
return selectList(VehicleEquipmentDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
default int deleteByVehicleId(Long vehicleId) {
|
||||
return delete(VehicleEquipmentDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleExtDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface VehicleExtMapper extends BaseMapperX<VehicleExtDO> {
|
||||
|
||||
default VehicleExtDO selectByVehicleId(Long vehicleId) {
|
||||
return selectOne(VehicleExtDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
default int deleteByVehicleId(Long vehicleId) {
|
||||
return delete(VehicleExtDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleInsuranceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VehicleInsuranceMapper extends BaseMapperX<VehicleInsuranceDO> {
|
||||
|
||||
default List<VehicleInsuranceDO> selectByVehicleId(Long vehicleId) {
|
||||
return selectList(VehicleInsuranceDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
default int deleteByVehicleId(Long vehicleId) {
|
||||
return delete(VehicleInsuranceDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleLicenceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface VehicleLicenceMapper extends BaseMapperX<VehicleLicenceDO> {
|
||||
|
||||
default VehicleLicenceDO selectByVehicleId(Long vehicleId) {
|
||||
return selectOne(VehicleLicenceDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
default int deleteByVehicleId(Long vehicleId) {
|
||||
return delete(VehicleLicenceDO::getVehicleId, vehicleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehiclePageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VehicleMapper extends BaseMapperX<VehicleDO> {
|
||||
|
||||
default PageResult<VehicleDO> selectPage(VehiclePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<VehicleDO>()
|
||||
.likeIfPresent(VehicleDO::getPlateNumber, reqVO.getPlateNumber())
|
||||
.likeIfPresent(VehicleDO::getVin, reqVO.getVin())
|
||||
.likeIfPresent(VehicleDO::getBrand, reqVO.getBrand())
|
||||
.likeIfPresent(VehicleDO::getModel, reqVO.getModel())
|
||||
.eqIfPresent(VehicleDO::getEnergyType, reqVO.getEnergyType())
|
||||
.eqIfPresent(VehicleDO::getRentStatus, reqVO.getRentStatus())
|
||||
.eqIfPresent(VehicleDO::getOperationalStatus, reqVO.getOperationalStatus())
|
||||
.eqIfPresent(VehicleDO::getOwnershipType, reqVO.getOwnershipType())
|
||||
.likeIfPresent(VehicleDO::getCity, reqVO.getCity())
|
||||
.eqIfPresent(VehicleDO::getDeptId, reqVO.getDeptId())
|
||||
.eqIfPresent(VehicleDO::getParkingId, reqVO.getParkingId())
|
||||
.eqIfPresent(VehicleDO::getVehicleTypeId, reqVO.getVehicleTypeId())
|
||||
.eqIfPresent(VehicleDO::getVehicleModelId, reqVO.getVehicleModelId())
|
||||
.eqIfPresent(VehicleDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(VehicleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(VehicleDO::getId));
|
||||
}
|
||||
|
||||
default VehicleDO selectByPlateNumber(String plateNumber) {
|
||||
return selectOne(VehicleDO::getPlateNumber, plateNumber);
|
||||
}
|
||||
|
||||
default VehicleDO selectByVin(String vin) {
|
||||
return selectOne(VehicleDO::getVin, vin);
|
||||
}
|
||||
|
||||
default List<VehicleDO> selectSimpleList(Integer rentStatus) {
|
||||
return selectList(new LambdaQueryWrapperX<VehicleDO>()
|
||||
.eqIfPresent(VehicleDO::getRentStatus, rentStatus)
|
||||
.eq(VehicleDO::getStatus, 0)
|
||||
.orderByDesc(VehicleDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleModelPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleModelDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VehicleModelMapper extends BaseMapperX<VehicleModelDO> {
|
||||
|
||||
default PageResult<VehicleModelDO> selectPage(VehicleModelPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<VehicleModelDO>()
|
||||
.likeIfPresent(VehicleModelDO::getBrandName, reqVO.getBrandName())
|
||||
.likeIfPresent(VehicleModelDO::getModelName, reqVO.getModelName())
|
||||
.eqIfPresent(VehicleModelDO::getVehicleType, reqVO.getVehicleType())
|
||||
.eqIfPresent(VehicleModelDO::getFuelType, reqVO.getFuelType())
|
||||
.eqIfPresent(VehicleModelDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(VehicleModelDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(VehicleModelDO::getId));
|
||||
}
|
||||
|
||||
default List<VehicleModelDO> selectSimpleList() {
|
||||
return selectList(new LambdaQueryWrapperX<VehicleModelDO>()
|
||||
.eq(VehicleModelDO::getStatus, 0)
|
||||
.orderByDesc(VehicleModelDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleTypeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VehicleTypeMapper extends BaseMapperX<VehicleTypeDO> {
|
||||
|
||||
default PageResult<VehicleTypeDO> selectPage(VehicleTypePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<VehicleTypeDO>()
|
||||
.likeIfPresent(VehicleTypeDO::getName, reqVO.getName())
|
||||
.likeIfPresent(VehicleTypeDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(VehicleTypeDO::getStatus, reqVO.getStatus())
|
||||
.orderByAsc(VehicleTypeDO::getSort));
|
||||
}
|
||||
|
||||
default List<VehicleTypeDO> selectSimpleList() {
|
||||
return selectList(new LambdaQueryWrapperX<VehicleTypeDO>()
|
||||
.eq(VehicleTypeDO::getStatus, 0)
|
||||
.orderByAsc(VehicleTypeDO::getSort));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.asset.framework.security.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
|
||||
@Configuration(proxyBeanMethods = false, value = "assetSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean("assetAuthorizeRequestsCustomizer")
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
@Override
|
||||
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||
// Swagger API docs
|
||||
registry.requestMatchers("/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/webjars/**").permitAll()
|
||||
.requestMatchers("/swagger-ui").permitAll()
|
||||
.requestMatchers("/swagger-ui/**").permitAll();
|
||||
// Druid monitoring
|
||||
registry.requestMatchers("/druid/**").permitAll();
|
||||
// Spring Boot Actuator
|
||||
registry.requestMatchers("/actuator").permitAll()
|
||||
.requestMatchers("/actuator/**").permitAll();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.asset.service.device;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.device.vo.DevicePageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.device.vo.DeviceSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.device.DeviceDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceService {
|
||||
|
||||
Long createDevice(@Valid DeviceSaveReqVO createReqVO);
|
||||
|
||||
void updateDevice(@Valid DeviceSaveReqVO updateReqVO);
|
||||
|
||||
void deleteDevice(Long id);
|
||||
|
||||
DeviceDO getDevice(Long id);
|
||||
|
||||
PageResult<DeviceDO> getDevicePage(DevicePageReqVO pageReqVO);
|
||||
|
||||
List<DeviceDO> getSimpleList(Integer bindStatus);
|
||||
|
||||
void bindDevice(Long deviceId, Long vehicleId);
|
||||
|
||||
void unbindDevice(Long deviceId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.iocoder.yudao.module.asset.service.device;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.device.vo.DevicePageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.device.vo.DeviceSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.device.DeviceDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.device.DeviceMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.*;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceServiceImpl implements DeviceService {
|
||||
|
||||
@Resource
|
||||
private DeviceMapper deviceMapper;
|
||||
|
||||
@Override
|
||||
public Long createDevice(DeviceSaveReqVO createReqVO) {
|
||||
// 1. 校验 IMEI 唯一
|
||||
validateImeiUnique(null, createReqVO.getImei());
|
||||
// 2. 插入
|
||||
DeviceDO device = BeanUtils.toBean(createReqVO, DeviceDO.class);
|
||||
if (device.getVehicleId() != null) {
|
||||
device.setBindStatus(1);
|
||||
} else {
|
||||
device.setBindStatus(0);
|
||||
}
|
||||
deviceMapper.insert(device);
|
||||
return device.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDevice(DeviceSaveReqVO updateReqVO) {
|
||||
validateDeviceExists(updateReqVO.getId());
|
||||
validateImeiUnique(updateReqVO.getId(), updateReqVO.getImei());
|
||||
DeviceDO updateObj = BeanUtils.toBean(updateReqVO, DeviceDO.class);
|
||||
deviceMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDevice(Long id) {
|
||||
validateDeviceExists(id);
|
||||
deviceMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceDO getDevice(Long id) {
|
||||
return deviceMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceDO> getDevicePage(DevicePageReqVO pageReqVO) {
|
||||
return deviceMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceDO> getSimpleList(Integer bindStatus) {
|
||||
return deviceMapper.selectSimpleList(bindStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindDevice(Long deviceId, Long vehicleId) {
|
||||
DeviceDO device = validateDeviceExists(deviceId);
|
||||
if (Integer.valueOf(1).equals(device.getBindStatus())) {
|
||||
throw exception(DEVICE_BINDIED);
|
||||
}
|
||||
DeviceDO updateObj = new DeviceDO();
|
||||
updateObj.setId(deviceId);
|
||||
updateObj.setBindStatus(1);
|
||||
updateObj.setVehicleId(vehicleId);
|
||||
deviceMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbindDevice(Long deviceId) {
|
||||
DeviceDO device = validateDeviceExists(deviceId);
|
||||
if (!Integer.valueOf(1).equals(device.getBindStatus())) {
|
||||
throw exception(DEVICE_NOT_BINDIED);
|
||||
}
|
||||
DeviceDO updateObj = new DeviceDO();
|
||||
updateObj.setId(deviceId);
|
||||
updateObj.setBindStatus(0);
|
||||
updateObj.setVehicleId(null);
|
||||
deviceMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
private DeviceDO validateDeviceExists(Long id) {
|
||||
DeviceDO device = deviceMapper.selectById(id);
|
||||
if (device == null) {
|
||||
throw exception(DEVICE_NOT_EXISTS);
|
||||
}
|
||||
return device;
|
||||
}
|
||||
|
||||
private void validateImeiUnique(Long id, String imei) {
|
||||
if (StrUtil.isBlank(imei)) {
|
||||
return;
|
||||
}
|
||||
DeviceDO device = deviceMapper.selectByImei(imei);
|
||||
if (device == null) {
|
||||
return;
|
||||
}
|
||||
if (id == null || !id.equals(device.getId())) {
|
||||
throw exception(DEVICE_IMEI_DUPLICATE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.asset.service.driver;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.driver.vo.DriverPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.driver.vo.DriverSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.driver.DriverDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DriverService {
|
||||
|
||||
Long createDriver(@Valid DriverSaveReqVO createReqVO);
|
||||
|
||||
void updateDriver(@Valid DriverSaveReqVO updateReqVO);
|
||||
|
||||
void deleteDriver(Long id);
|
||||
|
||||
DriverDO getDriver(Long id);
|
||||
|
||||
PageResult<DriverDO> getDriverPage(DriverPageReqVO pageReqVO);
|
||||
|
||||
List<DriverDO> getSimpleList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package cn.iocoder.yudao.module.asset.service.driver;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.driver.vo.DriverPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.driver.vo.DriverSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.driver.DriverDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.driver.DriverVehicleDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.driver.DriverMapper;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.driver.DriverVehicleMapper;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.VehicleMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.DRIVER_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class DriverServiceImpl implements DriverService {
|
||||
|
||||
@Resource
|
||||
private DriverMapper driverMapper;
|
||||
@Resource
|
||||
private DriverVehicleMapper driverVehicleMapper;
|
||||
@Resource
|
||||
private VehicleMapper vehicleMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createDriver(DriverSaveReqVO createReqVO) {
|
||||
// 1. 插入司机
|
||||
DriverDO driver = BeanUtils.toBean(createReqVO, DriverDO.class);
|
||||
driverMapper.insert(driver);
|
||||
// 2. 绑定车辆
|
||||
if (CollUtil.isNotEmpty(createReqVO.getVehicleIds())) {
|
||||
bindVehicles(driver.getId(), driver.getName(), driver.getPhone(), createReqVO.getVehicleIds());
|
||||
}
|
||||
return driver.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateDriver(DriverSaveReqVO updateReqVO) {
|
||||
// 1. 校验存在
|
||||
DriverDO driver = validateDriverExists(updateReqVO.getId());
|
||||
// 2. 更新司机
|
||||
DriverDO updateObj = BeanUtils.toBean(updateReqVO, DriverDO.class);
|
||||
driverMapper.updateById(updateObj);
|
||||
// 3. 更新车辆绑定
|
||||
if (updateReqVO.getVehicleIds() != null) {
|
||||
updateVehicleBindings(driver.getId(),
|
||||
updateReqVO.getName() != null ? updateReqVO.getName() : driver.getName(),
|
||||
updateReqVO.getPhone() != null ? updateReqVO.getPhone() : driver.getPhone(),
|
||||
updateReqVO.getVehicleIds());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDriver(Long id) {
|
||||
// 1. 校验存在
|
||||
validateDriverExists(id);
|
||||
// 2. 逻辑删除
|
||||
driverMapper.deleteById(id);
|
||||
// 3. 解绑所有车辆
|
||||
List<DriverVehicleDO> bindings = driverVehicleMapper.selectByDriverId(id);
|
||||
for (DriverVehicleDO binding : bindings) {
|
||||
binding.setBindStatus(0);
|
||||
binding.setUnbindTime(LocalDateTime.now());
|
||||
driverVehicleMapper.updateById(binding);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DriverDO getDriver(Long id) {
|
||||
return driverMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DriverDO> getDriverPage(DriverPageReqVO pageReqVO) {
|
||||
return driverMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DriverDO> getSimpleList() {
|
||||
return driverMapper.selectSimpleList();
|
||||
}
|
||||
|
||||
// ===== 私有方法 =====
|
||||
|
||||
private DriverDO validateDriverExists(Long id) {
|
||||
DriverDO driver = driverMapper.selectById(id);
|
||||
if (driver == null) {
|
||||
throw exception(DRIVER_NOT_EXISTS);
|
||||
}
|
||||
return driver;
|
||||
}
|
||||
|
||||
private void bindVehicles(Long driverId, String driverName, String driverPhone, List<Long> vehicleIds) {
|
||||
for (Long vehicleId : vehicleIds) {
|
||||
VehicleDO vehicle = vehicleMapper.selectById(vehicleId);
|
||||
if (vehicle == null) {
|
||||
continue;
|
||||
}
|
||||
DriverVehicleDO binding = new DriverVehicleDO();
|
||||
binding.setDriverId(driverId);
|
||||
binding.setVehicleId(vehicleId);
|
||||
binding.setPlateNumber(vehicle.getPlateNumber());
|
||||
binding.setDriverName(driverName);
|
||||
binding.setDriverPhone(driverPhone);
|
||||
binding.setBindTime(LocalDateTime.now());
|
||||
binding.setBindStatus(1);
|
||||
driverVehicleMapper.insert(binding);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateVehicleBindings(Long driverId, String driverName, String driverPhone, List<Long> newVehicleIds) {
|
||||
// 当前绑定
|
||||
List<DriverVehicleDO> currentBindings = driverVehicleMapper.selectByDriverId(driverId);
|
||||
Set<Long> currentVehicleIds = currentBindings.stream()
|
||||
.map(DriverVehicleDO::getVehicleId).collect(Collectors.toSet());
|
||||
Set<Long> newVehicleIdSet = CollUtil.newHashSet(newVehicleIds);
|
||||
|
||||
// 需要解绑的
|
||||
for (DriverVehicleDO binding : currentBindings) {
|
||||
if (!newVehicleIdSet.contains(binding.getVehicleId())) {
|
||||
binding.setBindStatus(0);
|
||||
binding.setUnbindTime(LocalDateTime.now());
|
||||
driverVehicleMapper.updateById(binding);
|
||||
}
|
||||
}
|
||||
// 需要新增绑定的
|
||||
for (Long vehicleId : newVehicleIds) {
|
||||
if (!currentVehicleIds.contains(vehicleId)) {
|
||||
VehicleDO vehicle = vehicleMapper.selectById(vehicleId);
|
||||
if (vehicle == null) {
|
||||
continue;
|
||||
}
|
||||
DriverVehicleDO binding = new DriverVehicleDO();
|
||||
binding.setDriverId(driverId);
|
||||
binding.setVehicleId(vehicleId);
|
||||
binding.setPlateNumber(vehicle.getPlateNumber());
|
||||
binding.setDriverName(driverName);
|
||||
binding.setDriverPhone(driverPhone);
|
||||
binding.setBindTime(LocalDateTime.now());
|
||||
binding.setBindStatus(1);
|
||||
driverVehicleMapper.insert(binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleEquipmentDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VehicleEquipmentService {
|
||||
|
||||
Long createEquipment(@Valid VehicleEquipmentSaveReqVO createReqVO);
|
||||
|
||||
void updateEquipment(@Valid VehicleEquipmentSaveReqVO updateReqVO);
|
||||
|
||||
void deleteEquipment(Long id);
|
||||
|
||||
VehicleEquipmentDO getEquipment(Long id);
|
||||
|
||||
PageResult<VehicleEquipmentDO> getEquipmentPage(VehicleEquipmentPageReqVO pageReqVO);
|
||||
|
||||
List<VehicleEquipmentDO> getEquipmentListByVehicleId(Long vehicleId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleEquipmentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleEquipmentDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.VehicleEquipmentMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.VEHICLE_EQUIPMENT_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class VehicleEquipmentServiceImpl implements VehicleEquipmentService {
|
||||
|
||||
@Resource
|
||||
private VehicleEquipmentMapper vehicleEquipmentMapper;
|
||||
|
||||
@Override
|
||||
public Long createEquipment(VehicleEquipmentSaveReqVO createReqVO) {
|
||||
VehicleEquipmentDO equipment = BeanUtils.toBean(createReqVO, VehicleEquipmentDO.class);
|
||||
vehicleEquipmentMapper.insert(equipment);
|
||||
return equipment.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEquipment(VehicleEquipmentSaveReqVO updateReqVO) {
|
||||
validateEquipmentExists(updateReqVO.getId());
|
||||
VehicleEquipmentDO updateObj = BeanUtils.toBean(updateReqVO, VehicleEquipmentDO.class);
|
||||
vehicleEquipmentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEquipment(Long id) {
|
||||
validateEquipmentExists(id);
|
||||
vehicleEquipmentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleEquipmentDO getEquipment(Long id) {
|
||||
return vehicleEquipmentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<VehicleEquipmentDO> getEquipmentPage(VehicleEquipmentPageReqVO pageReqVO) {
|
||||
return vehicleEquipmentMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VehicleEquipmentDO> getEquipmentListByVehicleId(Long vehicleId) {
|
||||
return vehicleEquipmentMapper.selectByVehicleId(vehicleId);
|
||||
}
|
||||
|
||||
private void validateEquipmentExists(Long id) {
|
||||
if (vehicleEquipmentMapper.selectById(id) == null) {
|
||||
throw exception(VEHICLE_EQUIPMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehicle;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VehicleService {
|
||||
|
||||
Long createVehicle(@Valid VehicleSaveReqVO createReqVO);
|
||||
|
||||
void updateVehicle(@Valid VehicleSaveReqVO updateReqVO);
|
||||
|
||||
void deleteVehicle(Long id);
|
||||
|
||||
VehicleDO getVehicle(Long id);
|
||||
|
||||
PageResult<VehicleDO> getVehiclePage(VehiclePageReqVO pageReqVO);
|
||||
|
||||
List<VehicleDO> getSimpleVehicleList(Integer rentStatus);
|
||||
|
||||
void updateVehicleStatus(@Valid VehicleUpdateStatusReqVO reqVO);
|
||||
|
||||
void lockVehicle(@Valid VehicleLockReqVO reqVO);
|
||||
|
||||
void unlockVehicle(@Valid VehicleUnlockReqVO reqVO);
|
||||
|
||||
VehicleImportRespVO importVehicles(List<VehicleImportExcelVO> list, Boolean updateSupport);
|
||||
|
||||
List<VehicleExportExcelVO> getExportList(VehiclePageReqVO reqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehicle;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.device.DeviceDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.device.DeviceMapper;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.*;
|
||||
import cn.iocoder.yudao.module.asset.enums.VehicleRentStatusEnum;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.*;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class VehicleServiceImpl implements VehicleService {
|
||||
|
||||
@Resource
|
||||
private VehicleMapper vehicleMapper;
|
||||
@Resource
|
||||
private VehicleLicenceMapper vehicleLicenceMapper;
|
||||
@Resource
|
||||
private VehicleInsuranceMapper vehicleInsuranceMapper;
|
||||
@Resource
|
||||
private VehicleEquipmentMapper vehicleEquipmentMapper;
|
||||
@Resource
|
||||
private VehicleExtMapper vehicleExtMapper;
|
||||
@Resource
|
||||
private DeviceMapper deviceMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createVehicle(VehicleSaveReqVO createReqVO) {
|
||||
// 1. 校验 VIN 唯一
|
||||
validateVinUnique(null, createReqVO.getVin());
|
||||
// 2. 校验车牌号唯一
|
||||
validatePlateNumberUnique(null, createReqVO.getPlateNumber());
|
||||
// 3. 插入主表
|
||||
VehicleDO vehicle = BeanUtils.toBean(createReqVO, VehicleDO.class);
|
||||
vehicle.setRentStatus(VehicleRentStatusEnum.IDLE.getStatus());
|
||||
vehicle.setOperationalStatus(0); // 停运
|
||||
vehicleMapper.insert(vehicle);
|
||||
// 4. 插入子表
|
||||
createSubTables(vehicle.getId(), createReqVO);
|
||||
return vehicle.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateVehicle(VehicleSaveReqVO updateReqVO) {
|
||||
// 1. 校验存在
|
||||
validateVehicleExists(updateReqVO.getId());
|
||||
// 2. 校验唯一性
|
||||
validateVinUnique(updateReqVO.getId(), updateReqVO.getVin());
|
||||
validatePlateNumberUnique(updateReqVO.getId(), updateReqVO.getPlateNumber());
|
||||
// 3. 更新主表
|
||||
VehicleDO updateObj = BeanUtils.toBean(updateReqVO, VehicleDO.class);
|
||||
vehicleMapper.updateById(updateObj);
|
||||
// 4. 更新子表
|
||||
updateSubTables(updateReqVO.getId(), updateReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteVehicle(Long id) {
|
||||
// 1. 校验存在
|
||||
VehicleDO vehicle = validateVehicleExists(id);
|
||||
// 2. 校验合同占用
|
||||
if (vehicle.getContractId() != null) {
|
||||
throw exception(VEHICLE_CONTRACT_BINDIED);
|
||||
}
|
||||
// 3. 校验设备占用
|
||||
List<DeviceDO> devices = deviceMapper.selectByVehicleId(id);
|
||||
if (CollUtil.isNotEmpty(devices)) {
|
||||
throw exception(VEHICLE_DEVICE_BINDIED);
|
||||
}
|
||||
// 4. 逻辑删除主表 + 子表
|
||||
vehicleMapper.deleteById(id);
|
||||
vehicleLicenceMapper.deleteByVehicleId(id);
|
||||
vehicleInsuranceMapper.deleteByVehicleId(id);
|
||||
vehicleEquipmentMapper.deleteByVehicleId(id);
|
||||
vehicleExtMapper.deleteByVehicleId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleDO getVehicle(Long id) {
|
||||
return vehicleMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<VehicleDO> getVehiclePage(VehiclePageReqVO pageReqVO) {
|
||||
return vehicleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VehicleDO> getSimpleVehicleList(Integer rentStatus) {
|
||||
return vehicleMapper.selectSimpleList(rentStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateVehicleStatus(VehicleUpdateStatusReqVO reqVO) {
|
||||
// 1. 校验存在
|
||||
VehicleDO vehicle = validateVehicleExists(reqVO.getId());
|
||||
// 2. 校验状态流转合法
|
||||
if (!VehicleRentStatusEnum.isValidTransition(vehicle.getRentStatus(), reqVO.getRentStatus())) {
|
||||
throw exception(VEHICLE_STATUS_TRANSITION_INVALID);
|
||||
}
|
||||
// 3. 更新
|
||||
vehicleMapper.updateById(new VehicleDO().setId(reqVO.getId()).setRentStatus(reqVO.getRentStatus()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lockVehicle(VehicleLockReqVO reqVO) {
|
||||
// 1. 校验存在
|
||||
VehicleDO vehicle = validateVehicleExists(reqVO.getId());
|
||||
// 2. 校验空闲
|
||||
if (!VehicleRentStatusEnum.IDLE.getStatus().equals(vehicle.getRentStatus())) {
|
||||
throw exception(VEHICLE_NOT_AVAILABLE);
|
||||
}
|
||||
// 3. 更新
|
||||
VehicleDO updateObj = new VehicleDO();
|
||||
updateObj.setId(reqVO.getId());
|
||||
updateObj.setRentStatus(VehicleRentStatusEnum.RENTED.getStatus());
|
||||
updateObj.setContractId(reqVO.getContractId());
|
||||
updateObj.setContractNo(reqVO.getContractNo());
|
||||
updateObj.setCustomerName(reqVO.getCustomerName());
|
||||
updateObj.setLastDeliveryTime(LocalDateTime.now());
|
||||
updateObj.setLastDeliveryMileage(vehicle.getMileage());
|
||||
vehicleMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unlockVehicle(VehicleUnlockReqVO reqVO) {
|
||||
// 1. 校验存在
|
||||
VehicleDO vehicle = validateVehicleExists(reqVO.getId());
|
||||
// 2. 校验在租或还车中
|
||||
if (!VehicleRentStatusEnum.RENTED.getStatus().equals(vehicle.getRentStatus())
|
||||
&& !VehicleRentStatusEnum.RETURNING.getStatus().equals(vehicle.getRentStatus())) {
|
||||
throw exception(VEHICLE_NOT_AVAILABLE);
|
||||
}
|
||||
// 3. 更新
|
||||
VehicleDO updateObj = new VehicleDO();
|
||||
updateObj.setId(reqVO.getId());
|
||||
updateObj.setRentStatus(VehicleRentStatusEnum.IDLE.getStatus());
|
||||
updateObj.setContractId(null);
|
||||
updateObj.setContractNo(null);
|
||||
updateObj.setCustomerName(null);
|
||||
updateObj.setLastReturnTime(LocalDateTime.now());
|
||||
updateObj.setLastReturnMileage(vehicle.getMileage());
|
||||
vehicleMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public VehicleImportRespVO importVehicles(List<VehicleImportExcelVO> list, Boolean updateSupport) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
throw exception(VEHICLE_NOT_EXISTS);
|
||||
}
|
||||
VehicleImportRespVO respVO = new VehicleImportRespVO();
|
||||
respVO.setCreateCount(0);
|
||||
respVO.setUpdateCount(0);
|
||||
respVO.setFailureMessages(new ArrayList<>());
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
VehicleImportExcelVO importVO = list.get(i);
|
||||
int rowIndex = i + 2; // Excel 行号(含表头)
|
||||
try {
|
||||
// 根据 VIN 查已有车辆
|
||||
VehicleDO existVehicle = null;
|
||||
if (StrUtil.isNotBlank(importVO.getVin())) {
|
||||
existVehicle = vehicleMapper.selectByVin(importVO.getVin());
|
||||
}
|
||||
if (existVehicle == null && StrUtil.isNotBlank(importVO.getPlateNumber())) {
|
||||
existVehicle = vehicleMapper.selectByPlateNumber(importVO.getPlateNumber());
|
||||
}
|
||||
|
||||
if (existVehicle != null) {
|
||||
if (Boolean.TRUE.equals(updateSupport)) {
|
||||
VehicleDO updateObj = BeanUtils.toBean(importVO, VehicleDO.class);
|
||||
updateObj.setId(existVehicle.getId());
|
||||
vehicleMapper.updateById(updateObj);
|
||||
respVO.setUpdateCount(respVO.getUpdateCount() + 1);
|
||||
} else {
|
||||
respVO.getFailureMessages().add("第 " + rowIndex + " 行:车辆已存在(VIN: " + importVO.getVin() + ")");
|
||||
}
|
||||
} else {
|
||||
VehicleDO vehicle = BeanUtils.toBean(importVO, VehicleDO.class);
|
||||
vehicle.setRentStatus(VehicleRentStatusEnum.IDLE.getStatus());
|
||||
vehicle.setOperationalStatus(0);
|
||||
vehicleMapper.insert(vehicle);
|
||||
respVO.setCreateCount(respVO.getCreateCount() + 1);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
respVO.getFailureMessages().add("第 " + rowIndex + " 行:导入失败," + e.getMessage());
|
||||
}
|
||||
}
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VehicleExportExcelVO> getExportList(VehiclePageReqVO reqVO) {
|
||||
reqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<VehicleDO> list = vehicleMapper.selectPage(reqVO).getList();
|
||||
return BeanUtils.toBean(list, VehicleExportExcelVO.class);
|
||||
}
|
||||
|
||||
// ===== 私有方法 =====
|
||||
|
||||
private VehicleDO validateVehicleExists(Long id) {
|
||||
VehicleDO vehicle = vehicleMapper.selectById(id);
|
||||
if (vehicle == null) {
|
||||
throw exception(VEHICLE_NOT_EXISTS);
|
||||
}
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
private void validateVinUnique(Long id, String vin) {
|
||||
if (StrUtil.isBlank(vin)) {
|
||||
return;
|
||||
}
|
||||
VehicleDO vehicle = vehicleMapper.selectByVin(vin);
|
||||
if (vehicle == null) {
|
||||
return;
|
||||
}
|
||||
if (id == null || !id.equals(vehicle.getId())) {
|
||||
throw exception(VEHICLE_VIN_DUPLICATE);
|
||||
}
|
||||
}
|
||||
|
||||
private void validatePlateNumberUnique(Long id, String plateNumber) {
|
||||
if (StrUtil.isBlank(plateNumber)) {
|
||||
return;
|
||||
}
|
||||
VehicleDO vehicle = vehicleMapper.selectByPlateNumber(plateNumber);
|
||||
if (vehicle == null) {
|
||||
return;
|
||||
}
|
||||
if (id == null || !id.equals(vehicle.getId())) {
|
||||
throw exception(VEHICLE_PLATE_NUMBER_DUPLICATE);
|
||||
}
|
||||
}
|
||||
|
||||
private void createSubTables(Long vehicleId, VehicleSaveReqVO reqVO) {
|
||||
// 证照
|
||||
if (reqVO.getLicence() != null) {
|
||||
VehicleLicenceDO licence = BeanUtils.toBean(reqVO.getLicence(), VehicleLicenceDO.class);
|
||||
licence.setVehicleId(vehicleId);
|
||||
vehicleLicenceMapper.insert(licence);
|
||||
}
|
||||
// 保险
|
||||
if (CollUtil.isNotEmpty(reqVO.getInsurances())) {
|
||||
for (VehicleInsuranceSaveReqVO insuranceVO : reqVO.getInsurances()) {
|
||||
VehicleInsuranceDO insurance = BeanUtils.toBean(insuranceVO, VehicleInsuranceDO.class);
|
||||
insurance.setVehicleId(vehicleId);
|
||||
vehicleInsuranceMapper.insert(insurance);
|
||||
}
|
||||
}
|
||||
// 扩展
|
||||
if (reqVO.getExt() != null) {
|
||||
VehicleExtDO ext = BeanUtils.toBean(reqVO.getExt(), VehicleExtDO.class);
|
||||
ext.setVehicleId(vehicleId);
|
||||
vehicleExtMapper.insert(ext);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSubTables(Long vehicleId, VehicleSaveReqVO reqVO) {
|
||||
// 证照: insertOrUpdate
|
||||
if (reqVO.getLicence() != null) {
|
||||
VehicleLicenceDO existLicence = vehicleLicenceMapper.selectByVehicleId(vehicleId);
|
||||
VehicleLicenceDO licence = BeanUtils.toBean(reqVO.getLicence(), VehicleLicenceDO.class);
|
||||
licence.setVehicleId(vehicleId);
|
||||
if (existLicence != null) {
|
||||
licence.setId(existLicence.getId());
|
||||
vehicleLicenceMapper.updateById(licence);
|
||||
} else {
|
||||
vehicleLicenceMapper.insert(licence);
|
||||
}
|
||||
}
|
||||
// 保险: 先删后插
|
||||
if (reqVO.getInsurances() != null) {
|
||||
vehicleInsuranceMapper.deleteByVehicleId(vehicleId);
|
||||
for (VehicleInsuranceSaveReqVO insuranceVO : reqVO.getInsurances()) {
|
||||
VehicleInsuranceDO insurance = BeanUtils.toBean(insuranceVO, VehicleInsuranceDO.class);
|
||||
insurance.setVehicleId(vehicleId);
|
||||
insurance.setId(null); // 确保新插入
|
||||
vehicleInsuranceMapper.insert(insurance);
|
||||
}
|
||||
}
|
||||
// 扩展: insertOrUpdate
|
||||
if (reqVO.getExt() != null) {
|
||||
VehicleExtDO existExt = vehicleExtMapper.selectByVehicleId(vehicleId);
|
||||
VehicleExtDO ext = BeanUtils.toBean(reqVO.getExt(), VehicleExtDO.class);
|
||||
ext.setVehicleId(vehicleId);
|
||||
if (existExt != null) {
|
||||
ext.setId(existExt.getId());
|
||||
vehicleExtMapper.updateById(ext);
|
||||
} else {
|
||||
vehicleExtMapper.insert(ext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehiclemodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleModelPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleModelSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleModelDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VehicleModelService {
|
||||
|
||||
Long createVehicleModel(@Valid VehicleModelSaveReqVO createReqVO);
|
||||
|
||||
void updateVehicleModel(@Valid VehicleModelSaveReqVO updateReqVO);
|
||||
|
||||
void deleteVehicleModel(Long id);
|
||||
|
||||
VehicleModelDO getVehicleModel(Long id);
|
||||
|
||||
PageResult<VehicleModelDO> getVehicleModelPage(VehicleModelPageReqVO pageReqVO);
|
||||
|
||||
List<VehicleModelDO> getSimpleList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehiclemodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleModelPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleModelSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleModelDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.VehicleModelMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.VEHICLE_MODEL_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class VehicleModelServiceImpl implements VehicleModelService {
|
||||
|
||||
@Resource
|
||||
private VehicleModelMapper vehicleModelMapper;
|
||||
|
||||
@Override
|
||||
public Long createVehicleModel(VehicleModelSaveReqVO createReqVO) {
|
||||
VehicleModelDO vehicleModel = BeanUtils.toBean(createReqVO, VehicleModelDO.class);
|
||||
vehicleModelMapper.insert(vehicleModel);
|
||||
return vehicleModel.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateVehicleModel(VehicleModelSaveReqVO updateReqVO) {
|
||||
validateVehicleModelExists(updateReqVO.getId());
|
||||
VehicleModelDO updateObj = BeanUtils.toBean(updateReqVO, VehicleModelDO.class);
|
||||
vehicleModelMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteVehicleModel(Long id) {
|
||||
validateVehicleModelExists(id);
|
||||
vehicleModelMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleModelDO getVehicleModel(Long id) {
|
||||
return vehicleModelMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<VehicleModelDO> getVehicleModelPage(VehicleModelPageReqVO pageReqVO) {
|
||||
return vehicleModelMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VehicleModelDO> getSimpleList() {
|
||||
return vehicleModelMapper.selectSimpleList();
|
||||
}
|
||||
|
||||
private void validateVehicleModelExists(Long id) {
|
||||
if (vehicleModelMapper.selectById(id) == null) {
|
||||
throw exception(VEHICLE_MODEL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehicletype;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleTypeDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface VehicleTypeService {
|
||||
|
||||
Long createVehicleType(@Valid VehicleTypeSaveReqVO createReqVO);
|
||||
|
||||
void updateVehicleType(@Valid VehicleTypeSaveReqVO updateReqVO);
|
||||
|
||||
void deleteVehicleType(Long id);
|
||||
|
||||
VehicleTypeDO getVehicleType(Long id);
|
||||
|
||||
PageResult<VehicleTypeDO> getVehicleTypePage(VehicleTypePageReqVO pageReqVO);
|
||||
|
||||
List<VehicleTypeDO> getSimpleList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.asset.service.vehicletype;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleTypePageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.vehicle.vo.VehicleTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.vehicle.VehicleTypeDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.vehicle.VehicleTypeMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.VEHICLE_TYPE_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class VehicleTypeServiceImpl implements VehicleTypeService {
|
||||
|
||||
@Resource
|
||||
private VehicleTypeMapper vehicleTypeMapper;
|
||||
|
||||
@Override
|
||||
public Long createVehicleType(VehicleTypeSaveReqVO createReqVO) {
|
||||
VehicleTypeDO vehicleType = BeanUtils.toBean(createReqVO, VehicleTypeDO.class);
|
||||
vehicleTypeMapper.insert(vehicleType);
|
||||
return vehicleType.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateVehicleType(VehicleTypeSaveReqVO updateReqVO) {
|
||||
validateVehicleTypeExists(updateReqVO.getId());
|
||||
VehicleTypeDO updateObj = BeanUtils.toBean(updateReqVO, VehicleTypeDO.class);
|
||||
vehicleTypeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteVehicleType(Long id) {
|
||||
validateVehicleTypeExists(id);
|
||||
vehicleTypeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleTypeDO getVehicleType(Long id) {
|
||||
return vehicleTypeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<VehicleTypeDO> getVehicleTypePage(VehicleTypePageReqVO pageReqVO) {
|
||||
return vehicleTypeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VehicleTypeDO> getSimpleList() {
|
||||
return vehicleTypeMapper.selectSimpleList();
|
||||
}
|
||||
|
||||
private void validateVehicleTypeExists(Long id) {
|
||||
if (vehicleTypeMapper.selectById(id) == null) {
|
||||
throw exception(VEHICLE_TYPE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
username:
|
||||
password:
|
||||
discovery:
|
||||
namespace: dev
|
||||
group: DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0
|
||||
config:
|
||||
namespace: dev
|
||||
group: DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
autoconfigure:
|
||||
exclude:
|
||||
datasource:
|
||||
druid:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
login-username:
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic:
|
||||
druid:
|
||||
initial-size: 1
|
||||
min-idle: 1
|
||||
max-active: 20
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 600000
|
||||
max-evictable-idle-time-millis: 1800000
|
||||
validation-query: SELECT 1 FROM DUAL
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: 123456
|
||||
slave:
|
||||
lazy: true
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
# Redis 配置
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
database: 0
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
xxl:
|
||||
job:
|
||||
enabled: false
|
||||
admin:
|
||||
addresses: http://127.0.0.1:9090/xxl-job-admin
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
lock4j:
|
||||
acquire-timeout: 3000
|
||||
expire: 30000
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
include: '*'
|
||||
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: admin
|
||||
password: admin
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
level:
|
||||
cn.iocoder.yudao.module.asset.dal.mysql: debug
|
||||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
yudao:
|
||||
env:
|
||||
tag: ${HOSTNAME}
|
||||
security:
|
||||
mock-enable: true
|
||||
access-log:
|
||||
enable: true
|
||||
@@ -0,0 +1,108 @@
|
||||
spring:
|
||||
application:
|
||||
name: asset-server
|
||||
|
||||
profiles:
|
||||
active: local
|
||||
|
||||
main:
|
||||
allow-circular-references: true
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
config:
|
||||
import:
|
||||
- optional:classpath:application-${spring.profiles.active}.yaml
|
||||
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml
|
||||
|
||||
# Servlet 配置
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 16MB
|
||||
max-request-size: 32MB
|
||||
|
||||
# Jackson 配置项
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: true
|
||||
write-date-timestamps-as-nanoseconds: false
|
||||
write-durations-as-timestamps: true
|
||||
fail-on-empty-beans: false
|
||||
|
||||
# Cache 配置项
|
||||
cache:
|
||||
type: REDIS
|
||||
redis:
|
||||
time-to-live: 1h
|
||||
|
||||
server:
|
||||
port: 48084
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: ${user.home}/logs/${spring.application.name}.log
|
||||
|
||||
--- #################### 接口文档配置 ####################
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: true
|
||||
path: /v3/api-docs
|
||||
swagger-ui:
|
||||
enabled: true
|
||||
path: /swagger-ui
|
||||
default-flat-param-object: true
|
||||
|
||||
knife4j:
|
||||
enable: true
|
||||
setting:
|
||||
language: zh_cn
|
||||
|
||||
# MyBatis Plus 的配置项
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: NONE
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
banner: false
|
||||
type-aliases-package: ${yudao.info.base-package}.dal.dataobject
|
||||
encryptor:
|
||||
password: XDV71a+xqStEA3WH
|
||||
|
||||
mybatis-plus-join:
|
||||
banner: false
|
||||
|
||||
# Spring Data Redis 配置
|
||||
spring:
|
||||
data:
|
||||
redis:
|
||||
repositories:
|
||||
enabled: false
|
||||
|
||||
# VO 转换(数据翻译)相关
|
||||
easy-trans:
|
||||
is-enable-global: false
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
yudao:
|
||||
info:
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.yudao.module.asset
|
||||
web:
|
||||
admin-ui:
|
||||
url: http://dashboard.yudao.iocoder.cn
|
||||
xss:
|
||||
enable: false
|
||||
exclude-urls:
|
||||
- ${management.endpoints.web.base-path}/**
|
||||
swagger:
|
||||
title: 车辆资产管理
|
||||
description: 提供车辆资产管理的所有功能
|
||||
version: ${yudao.info.version}
|
||||
tenant:
|
||||
enable: true
|
||||
|
||||
debug: false
|
||||
Reference in New Issue
Block a user