1
This commit is contained in:
parent
b357f62209
commit
ac71e0d45c
|
|
@ -24,6 +24,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
|
|
@ -33,8 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/app/vehicle")
|
||||
public class AppVehicleController extends BaseController
|
||||
{
|
||||
public class AppVehicleController extends BaseController {
|
||||
@Autowired
|
||||
private IAppVehicleService appVehicleService;
|
||||
|
||||
|
|
@ -44,8 +44,7 @@ public class AppVehicleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:vehicle:list')")
|
||||
@GetMapping("/list")
|
||||
@EnhanceDataList(entityType = AppVehicle.class)
|
||||
public TableDataInfo list(AppVehicle appVehicle)
|
||||
{
|
||||
public TableDataInfo list(AppVehicle appVehicle) {
|
||||
startPage();
|
||||
List<AppVehicle> list = appVehicleService.selectAppVehicleList(appVehicle);
|
||||
return getDataTable(list);
|
||||
|
|
@ -57,20 +56,34 @@ public class AppVehicleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:vehicle:export')")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AppVehicle appVehicle)
|
||||
{
|
||||
public void export(HttpServletResponse response, AppVehicle appVehicle) {
|
||||
List<AppVehicle> list = appVehicleService.selectAppVehicleList(appVehicle);
|
||||
ExcelUtil<AppVehicle> util = new ExcelUtil<AppVehicle>(AppVehicle.class);
|
||||
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}")
|
||||
@Anonymous
|
||||
public AjaxResult getInfo(@PathVariable("vehicleId") String vehicleId)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("vehicleId") String vehicleId) {
|
||||
return success(appVehicleService.selectAppVehicleByVehicleId(vehicleId));
|
||||
}
|
||||
|
||||
|
|
@ -80,8 +93,7 @@ public class AppVehicleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:vehicle:add')")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AppVehicle appVehicle)
|
||||
{
|
||||
public AjaxResult add(@RequestBody AppVehicle appVehicle) {
|
||||
return toAjax(appVehicleService.insertAppVehicle(appVehicle));
|
||||
}
|
||||
|
||||
|
|
@ -91,8 +103,7 @@ public class AppVehicleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:vehicle:edit')")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AppVehicle appVehicle)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody AppVehicle appVehicle) {
|
||||
return toAjax(appVehicleService.updateAppVehicle(appVehicle));
|
||||
}
|
||||
|
||||
|
|
@ -102,8 +113,7 @@ public class AppVehicleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:vehicle:remove')")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{vehicleIds}")
|
||||
public AjaxResult remove(@PathVariable String[] vehicleIds)
|
||||
{
|
||||
public AjaxResult remove(@PathVariable String[] vehicleIds) {
|
||||
return toAjax(appVehicleService.deleteAppVehicleByVehicleIds(vehicleIds));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user