This commit is contained in:
15066119699 2025-03-06 16:44:01 +08:00
parent b357f62209
commit ac71e0d45c

View File

@ -24,6 +24,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 请填写功能名称Controller * 请填写功能名称Controller
@ -33,8 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/app/vehicle") @RequestMapping("/app/vehicle")
public class AppVehicleController extends BaseController public class AppVehicleController extends BaseController {
{
@Autowired @Autowired
private IAppVehicleService appVehicleService; private IAppVehicleService appVehicleService;
@ -44,8 +44,7 @@ public class AppVehicleController extends BaseController
@PreAuthorize("@ss.hasPermi('system:vehicle:list')") @PreAuthorize("@ss.hasPermi('system:vehicle:list')")
@GetMapping("/list") @GetMapping("/list")
@EnhanceDataList(entityType = AppVehicle.class) @EnhanceDataList(entityType = AppVehicle.class)
public TableDataInfo list(AppVehicle appVehicle) public TableDataInfo list(AppVehicle appVehicle) {
{
startPage(); startPage();
List<AppVehicle> list = appVehicleService.selectAppVehicleList(appVehicle); List<AppVehicle> list = appVehicleService.selectAppVehicleList(appVehicle);
return getDataTable(list); return getDataTable(list);
@ -57,20 +56,34 @@ public class AppVehicleController extends BaseController
@PreAuthorize("@ss.hasPermi('system:vehicle:export')") @PreAuthorize("@ss.hasPermi('system:vehicle:export')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, AppVehicle appVehicle) public void export(HttpServletResponse response, AppVehicle appVehicle) {
{
List<AppVehicle> list = appVehicleService.selectAppVehicleList(appVehicle); List<AppVehicle> list = appVehicleService.selectAppVehicleList(appVehicle);
ExcelUtil<AppVehicle> util = new ExcelUtil<AppVehicle>(AppVehicle.class); ExcelUtil<AppVehicle> util = new ExcelUtil<AppVehicle>(AppVehicle.class);
util.exportExcel(response, list, "【请填写功能名称】数据"); util.exportExcel(response, list, "【请填写功能名称】数据");
} }
@Log(title = "容器管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:vehicle:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<AppVehicle> util = new ExcelUtil<AppVehicle>(AppVehicle.class);
List<AppVehicle> vehicleList = util.importExcel(file.getInputStream());
String message = appVehicleService.importVehicle(vehicleList, updateSupport);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<AppVehicle> util = new ExcelUtil<AppVehicle>(AppVehicle.class);
util.importTemplateExcel(response, "用户数据");
}
/** /**
* 获取请填写功能名称详细信息 * 获取请填写功能名称详细信息
*/ */
@GetMapping(value = "/{vehicleId}") @GetMapping(value = "/{vehicleId}")
@Anonymous @Anonymous
public AjaxResult getInfo(@PathVariable("vehicleId") String vehicleId) public AjaxResult getInfo(@PathVariable("vehicleId") String vehicleId) {
{
return success(appVehicleService.selectAppVehicleByVehicleId(vehicleId)); return success(appVehicleService.selectAppVehicleByVehicleId(vehicleId));
} }
@ -80,8 +93,7 @@ public class AppVehicleController extends BaseController
@PreAuthorize("@ss.hasPermi('system:vehicle:add')") @PreAuthorize("@ss.hasPermi('system:vehicle:add')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody AppVehicle appVehicle) public AjaxResult add(@RequestBody AppVehicle appVehicle) {
{
return toAjax(appVehicleService.insertAppVehicle(appVehicle)); return toAjax(appVehicleService.insertAppVehicle(appVehicle));
} }
@ -91,8 +103,7 @@ public class AppVehicleController extends BaseController
@PreAuthorize("@ss.hasPermi('system:vehicle:edit')") @PreAuthorize("@ss.hasPermi('system:vehicle:edit')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AppVehicle appVehicle) public AjaxResult edit(@RequestBody AppVehicle appVehicle) {
{
return toAjax(appVehicleService.updateAppVehicle(appVehicle)); return toAjax(appVehicleService.updateAppVehicle(appVehicle));
} }
@ -102,8 +113,7 @@ public class AppVehicleController extends BaseController
@PreAuthorize("@ss.hasPermi('system:vehicle:remove')") @PreAuthorize("@ss.hasPermi('system:vehicle:remove')")
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
@DeleteMapping("/{vehicleIds}") @DeleteMapping("/{vehicleIds}")
public AjaxResult remove(@PathVariable String[] vehicleIds) public AjaxResult remove(@PathVariable String[] vehicleIds) {
{
return toAjax(appVehicleService.deleteAppVehicleByVehicleIds(vehicleIds)); return toAjax(appVehicleService.deleteAppVehicleByVehicleIds(vehicleIds));
} }