wlzboy
4 天以前 cfe0b79fbea0fb1d7a5a796e71ada7d3b7812046
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
package com.ruoyi.web.controller.system;
 
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IVehicleSyncDataService;
import com.ruoyi.system.service.IVehicleSyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 车辆同步Controller
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@RestController
@RequestMapping("/system/vehicle/sync")
public class VehicleSyncController extends BaseController
{
    @Autowired
    private IVehicleSyncService vehicleSyncService;
 
    @Autowired
    private IVehicleSyncDataService vehicleSyncDataService;
    /**
     * 手动同步旧系统车辆数据
     */
    @PreAuthorize("@ss.hasPermi('system:vehicle:sync')")
    @PostMapping("/legacy")
    public AjaxResult syncLegacyVehicles()
    {
        return vehicleSyncService.syncVehicles(this.vehicleSyncDataService.getVehiclesFromSqlServer());
    }
}