VehicleController.ts
5.2 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
import { FileInfo } from "autumn-vue/lib/core/bean/FileInfo";
import { Page } from "autumn-vue/lib/core/page/Page";
import { AxiosResponse, AxiosStatic } from "axios";
import dayjs, { Dayjs } from "dayjs";
import { NameCount } from "lib/src/entity/analysis/domain/NameCount";
import { VehicleHistoryProjection } from "lib/src/entity/vehicle/domain/VehicleHistoryProjection";
// region 前端扩展导入包
import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
// endregion
/**
* 库存车辆(Vehicle) PI接口
* @author gonglei
* @since 2025-10-13 12:18:11
*/
export const VehicleController = {
/**
* 新增库存车辆
* @param vehicle
* @return Vehicle
*/
addVehicle(axios: AxiosStatic, vehicle: any): Promise<AxiosResponse<Vehicle>> {
return axios.post("vehicle/addVehicle", vehicle);
},
/**
*/
exportCheckedVehicles(axios: AxiosStatic, vehicleIds: any, config?: any): Promise<AxiosResponse<void>> {
return axios.post("vehicle/exportCheckedVehicles", vehicleIds, config);
},
/**
*/
exportPriceVehicles(axios: AxiosStatic, pagination: any, config?: any): Promise<AxiosResponse<void>> {
return axios.post("vehicle/exportPriceVehicles", pagination, config);
},
/**
* 导出车辆列表
* @param pagination
* @param response
* @throws IOException
*/
exportVehicles(axios: AxiosStatic, pagination: any, config?: any): Promise<AxiosResponse<void>> {
return axios.post("vehicle/exportVehicles", pagination, config);
},
/**
*/
getTop3VehiclesByInventory(axios: AxiosStatic): Promise<AxiosResponse<Vehicle[]>> {
return axios.get("vehicle/getTop3VehiclesByInventory");
},
/**
* 按车辆品牌统计车辆数量
* @return List
*/
getVehicleBrandCounts(axios: AxiosStatic): Promise<AxiosResponse<NameCount[]>> {
return axios.get("vehicle/getVehicleBrandCounts");
},
/**
* 根据id查询库存车辆
* @param vehicleId
* @return Vehicle
*/
getVehicleById(axios: AxiosStatic, vehicleId: number): Promise<AxiosResponse<Vehicle>> {
return axios.get("vehicle/getVehicleById", { params: { vehicleId } });
},
/**
*/
getVehicleCountByProvinceName(axios: AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get("vehicle/getVehicleCountByProvinceName");
},
/**
*/
getVehicleCountBySource(axios: AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get("vehicle/getVehicleCountBySource");
},
/**
*/
getVehicleCountByState(axios: AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get("vehicle/getVehicleCountByState");
},
/**
*/
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, endDate },
});
},
/**
*/
getVehicleCountByVehicleClass(axios: AxiosStatic): Promise<AxiosResponse<any>> {
return axios.get("vehicle/getVehicleCountByVehicleClass");
},
/**
*/
getVehicleHistories(
axios: AxiosStatic,
vehicleId: number,
): Promise<AxiosResponse<VehicleHistoryProjection[]>> {
return axios.get("vehicle/getVehicleHistories", { params: { vehicleId } });
},
/**
*/
moveVehicleAlbum(
axios: AxiosStatic,
uid: string,
fileSubtype: string,
vehicleId: number,
): Promise<AxiosResponse<number>> {
return axios.get("vehicle/moveVehicleAlbum", {
params: { uid, fileSubtype, vehicleId },
});
},
/**
*/
pagePriceVehicle(axios: AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Vehicle>>> {
return axios.post("vehicle/pagePriceVehicle", pagination);
},
PAGE_PRICE_VEHICLE : "vehicle/pagePriceVehicle",
/**
* 分页查询库存车辆
* @param pagination
* @return Page
*/
pageVehicle(axios: AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Vehicle>>> {
return axios.post("vehicle/pageVehicle", pagination);
},
PAGE_VEHICLE : "vehicle/pageVehicle",
/**
* 删除库存车辆
* @param vehicleId
* @return int
*/
removeVehicleById(axios: AxiosStatic, vehicleId: number): Promise<AxiosResponse<number>> {
return axios.delete("vehicle/removeVehicleById", { params: { vehicleId } });
},
/**
* 修改库存车辆
* @param vehicle
* @return Vehicle
*/
updateVehicle(axios: AxiosStatic, vehicle: any): Promise<AxiosResponse<Vehicle>> {
return axios.post("vehicle/updateVehicle", vehicle);
},
/**
* x修改车辆地点
* @param vehicleVenue
* @return Vehicle
*/
updateVehicleVenue(axios: AxiosStatic, vehicleVenue: any): Promise<AxiosResponse<Vehicle>> {
return axios.post("vehicle/updateVehicleVenue", vehicleVenue);
},
/**
* 更新车辆封面
*/
uploadVehicleCover(axios: AxiosStatic, fileInfo: any, vehicleId: number): Promise<AxiosResponse<FileInfo>> {
return axios.post("vehicle/uploadVehicleCover", fileInfo, { params: { vehicleId } });
},
/**
* 整备入库车辆
* @param vehicle
* @return Vehicle
*/
warehousingVehicle(axios: AxiosStatic, vehicle: any): Promise<AxiosResponse<Vehicle>> {
return axios.post("vehicle/warehousingVehicle", vehicle);
},
// region 前端扩展代码区
// endregion
};