VehicleController.ts
5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import {AxiosResponse, AxiosStatic} from 'axios';
import dayjs,{Dayjs} from 'dayjs';
// region 前端扩展导入包
import {Vehicle} from "lib/src/entity/vehicle/entity/Vehicle";
import {Page} from "autumn-vue/lib/core/page/Page";
import {VehicleHistoryProjection} from "lib/src/entity/vehicle/domain/VehicleHistoryProjection";
import {NameCount} from "lib/src/entity/analysis/domain/NameCount";
import {FileInfo} from "autumn-vue/lib/core/bean/FileInfo";
// endregion
/**
* 库存车辆(Vehicle) PI接口
* @author gonglei
* @since 2025-10-13 12:18:11
*/
export class VehicleController{
/**
* 新增库存车辆
* @param vehicle
* @return Vehicle
*/
static addVehicle(axios:AxiosStatic, vehicle: any): Promise<AxiosResponse<Vehicle>> {
return axios.post('vehicle/addVehicle', vehicle);
}
/**
*/
static exportCheckedVehicles(axios:AxiosStatic, vehicleIds: any, config?:any): Promise<AxiosResponse<void>> {
return axios.post('vehicle/exportCheckedVehicles', vehicleIds, config);
}
/**
*/
static exportPriceVehicles(axios:AxiosStatic, pagination: any, config?:any): Promise<AxiosResponse<void>> {
return axios.post('vehicle/exportPriceVehicles', pagination, config);
}
/**
* 导出车辆列表
* @param pagination
* @param response
* @throws IOException
*/
static exportVehicles(axios:AxiosStatic, pagination: any, config?:any): Promise<AxiosResponse<void>> {
return axios.post('vehicle/exportVehicles', pagination, config);
}
/**
*/
static getTop3VehiclesByInventory(axios:AxiosStatic): Promise<AxiosResponse<Vehicle[]>> {
return axios.get('vehicle/getTop3VehiclesByInventory');
}
/**
* 按车辆品牌统计车辆数量
* @return List
*/
static getVehicleBrandCounts(axios:AxiosStatic): Promise<AxiosResponse<NameCount[]>> {
return axios.get('vehicle/getVehicleBrandCounts');
}
/**
* 根据id查询库存车辆
* @param vehicleId
* @return Vehicle
*/
static getVehicleById(axios:AxiosStatic, vehicleId: number): Promise<AxiosResponse<Vehicle>> {
return axios.get('vehicle/getVehicleById', {params: {vehicleId: vehicleId}});
}
/**
*/
static getVehicleCountByProvinceName(axios:AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get('vehicle/getVehicleCountByProvinceName');
}
/**
*/
static getVehicleCountBySource(axios:AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get('vehicle/getVehicleCountBySource');
}
/**
*/
static getVehicleCountByState(axios:AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get('vehicle/getVehicleCountByState');
}
/**
*/
static getVehicleCountByStateAndDateRange(axios:AxiosStatic, startDate: Dayjs | string, endDate: Dayjs | string): Promise<AxiosResponse<any>> {
if(startDate instanceof Object) {startDate = dayjs(startDate).format('YYYY-MM-DD') }
if(endDate instanceof Object) {endDate = dayjs(endDate).format('YYYY-MM-DD') }
return axios.get('vehicle/getVehicleCountByStateAndDateRange', {params: {startDate: startDate,endDate: endDate}});
}
/**
*/
static getVehicleCountByVehicleClass(axios:AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get('vehicle/getVehicleCountByVehicleClass');
}
/**
*/
static getVehicleHistories(axios:AxiosStatic, vehicleId: number): Promise<AxiosResponse<VehicleHistoryProjection[]>> {
return axios.get('vehicle/getVehicleHistories', {params: {vehicleId: vehicleId}});
}
/**
*/
static moveVehicleAlbum(axios:AxiosStatic, uid: string, fileSubtype: string, vehicleId: number): Promise<AxiosResponse<number>> {
return axios.get('vehicle/moveVehicleAlbum', {params: {uid: uid,fileSubtype: fileSubtype,vehicleId: vehicleId}});
}
/**
*/
static pagePriceVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Vehicle>>> {
return axios.post('vehicle/pagePriceVehicle', pagination);
}
static PAGE_PRICE_VEHICLE = 'vehicle/pagePriceVehicle';
/**
* 分页查询库存车辆
* @param pagination
* @return Page
*/
static pageVehicle(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Vehicle>>> {
return axios.post('vehicle/pageVehicle', pagination);
}
static PAGE_VEHICLE = 'vehicle/pageVehicle';
/**
* 删除库存车辆
* @param vehicleId
* @return int
*/
static removeVehicleById(axios:AxiosStatic, vehicleId: number): Promise<AxiosResponse<number>> {
return axios.delete('vehicle/removeVehicleById', {params: {vehicleId: vehicleId}});
}
/**
* 修改库存车辆
* @param vehicle
* @return Vehicle
*/
static updateVehicle(axios:AxiosStatic, vehicle: any): Promise<AxiosResponse<Vehicle>> {
return axios.post('vehicle/updateVehicle', vehicle);
}
/**
* x修改车辆地点
* @param vehicleVenue
* @return Vehicle
*/
static updateVehicleVenue(axios:AxiosStatic, vehicleVenue: any): Promise<AxiosResponse<Vehicle>> {
return axios.post('vehicle/updateVehicleVenue', vehicleVenue);
}
/**
* 更新车辆封面
*/
static uploadVehicleCover(axios:AxiosStatic, fileInfo: any, vehicleId: number): Promise<AxiosResponse<FileInfo>> {
return axios.post('vehicle/uploadVehicleCover', fileInfo, {params: {vehicleId: vehicleId}});
}
/**
* 整备入库车辆
* @param vehicle
* @return Vehicle
*/
static warehousingVehicle(axios:AxiosStatic, vehicle: any): Promise<AxiosResponse<Vehicle>> {
return axios.post('vehicle/warehousingVehicle', vehicle);
}
// region 前端扩展代码区
// endregion
}