107 lines
3.5 KiB
Java
107 lines
3.5 KiB
Java
package com.ruoyi.system.controller;
|
|
|
|
import java.util.List;
|
|
import java.util.Arrays;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.constraints.*;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
import com.ruoyi.common.annotation.Log;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.domain.PageQuery;
|
|
import com.ruoyi.common.core.domain.R;
|
|
import com.ruoyi.common.core.validate.AddGroup;
|
|
import com.ruoyi.common.core.validate.EditGroup;
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
import com.ruoyi.system.domain.vo.DeviceSpec35rVo;
|
|
import com.ruoyi.system.domain.bo.DeviceSpec35rBo;
|
|
import com.ruoyi.system.service.IDeviceSpec35rService;
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 35R设备规格参数
|
|
*
|
|
* @author ruoyi
|
|
* @date 2025-12-01
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/system/spec35r")
|
|
public class DeviceSpec35rController extends BaseController {
|
|
|
|
private final IDeviceSpec35rService iDeviceSpec35rService;
|
|
|
|
/**
|
|
* 查询35R设备规格参数列表
|
|
*/
|
|
@SaCheckPermission("system:spec35r:list")
|
|
@GetMapping("/list")
|
|
public TableDataInfo<DeviceSpec35rVo> list(DeviceSpec35rBo bo, PageQuery pageQuery) {
|
|
return iDeviceSpec35rService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出35R设备规格参数列表
|
|
*/
|
|
@SaCheckPermission("system:spec35r:export")
|
|
@Log(title = "35R设备规格参数", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(DeviceSpec35rBo bo, HttpServletResponse response) {
|
|
List<DeviceSpec35rVo> list = iDeviceSpec35rService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "35R设备规格参数", DeviceSpec35rVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取35R设备规格参数详细信息
|
|
*
|
|
* @param id 主键
|
|
*/
|
|
@SaCheckPermission("system:spec35r:query")
|
|
@GetMapping("/{id}")
|
|
public R<DeviceSpec35rVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long id) {
|
|
return R.ok(iDeviceSpec35rService.queryById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增35R设备规格参数
|
|
*/
|
|
@SaCheckPermission("system:spec35r:add")
|
|
@Log(title = "35R设备规格参数", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody DeviceSpec35rBo bo) {
|
|
return toAjax(iDeviceSpec35rService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改35R设备规格参数
|
|
*/
|
|
@SaCheckPermission("system:spec35r:edit")
|
|
@Log(title = "35R设备规格参数", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DeviceSpec35rBo bo) {
|
|
return toAjax(iDeviceSpec35rService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除35R设备规格参数
|
|
*
|
|
* @param ids 主键串
|
|
*/
|
|
@SaCheckPermission("system:spec35r:remove")
|
|
@Log(title = "35R设备规格参数", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ids}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] ids) {
|
|
return toAjax(iDeviceSpec35rService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
}
|
|
}
|