46 lines
1.6 KiB
Java
46 lines
1.6 KiB
Java
|
package com.ruoyi.business.controller;
|
||
|
|
||
|
import com.ruoyi.common.core.controller.BaseController;
|
||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||
|
import com.ruoyi.database.domain.VehicleRequest;
|
||
|
import com.ruoyi.database.service.VehicleRequestService;
|
||
|
import io.swagger.annotations.Api;
|
||
|
import io.swagger.annotations.ApiOperation;
|
||
|
import lombok.RequiredArgsConstructor;
|
||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
/**
|
||
|
* @Description VehicleRequestController
|
||
|
* @Author lijingtong
|
||
|
* @Date 2025-05-28
|
||
|
*/
|
||
|
|
||
|
@RestController
|
||
|
@RequiredArgsConstructor
|
||
|
@RequestMapping("/business/vehicleRequest")
|
||
|
@Api(tags = "公务用车出县申请")
|
||
|
public class VehicleRequestController extends BaseController {
|
||
|
private final VehicleRequestService vehicleRequestService;
|
||
|
|
||
|
@ApiOperation("新增公务用车出县申请")
|
||
|
@RequestMapping("/add")
|
||
|
public AjaxResult add(@RequestBody VehicleRequest vehicleRequest) {
|
||
|
if (vehicleRequest.getId()==null){
|
||
|
boolean result = vehicleRequestService.save(vehicleRequest);
|
||
|
if (!result){
|
||
|
return AjaxResult.error("新增公务用车出县申请失败");
|
||
|
}
|
||
|
return AjaxResult.success(result);
|
||
|
}else {
|
||
|
boolean result = vehicleRequestService.updateById(vehicleRequest);
|
||
|
if (!result){
|
||
|
return AjaxResult.error("修改公务用车出县申请失败");
|
||
|
}
|
||
|
return AjaxResult.success(result);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|