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.DeviceSpec60rVo;
|
|
import com.ruoyi.system.domain.bo.DeviceSpec60rBo;
|
|
import com.ruoyi.system.service.IDeviceSpec60rService;
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 60R设备规格参数
|
|
*
|
|
* @author ruoyi
|
|
* @date 2025-12-03
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/system/spec60r")
|
|
public class DeviceSpec60rController extends BaseController {
|
|
|
|
private final IDeviceSpec60rService iDeviceSpec60rService;
|
|
|
|
/**
|
|
* 查询60R设备规格参数列表
|
|
*/
|
|
@SaCheckPermission("system:spec60r:list")
|
|
@GetMapping("/list")
|
|
public TableDataInfo<DeviceSpec60rVo> list(DeviceSpec60rBo bo, PageQuery pageQuery) {
|
|
return iDeviceSpec60rService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出60R设备规格参数列表
|
|
*/
|
|
@SaCheckPermission("system:spec60r:export")
|
|
@Log(title = "60R设备规格参数", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(DeviceSpec60rBo bo, HttpServletResponse response) {
|
|
List<DeviceSpec60rVo> list = iDeviceSpec60rService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "60R设备规格参数", DeviceSpec60rVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取60R设备规格参数详细信息
|
|
*
|
|
* @param id 主键
|
|
*/
|
|
@SaCheckPermission("system:spec60r:query")
|
|
@GetMapping("/{id}")
|
|
public R<DeviceSpec60rVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long id) {
|
|
return R.ok(iDeviceSpec60rService.queryById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增60R设备规格参数
|
|
*/
|
|
@SaCheckPermission("system:spec60r:add")
|
|
@Log(title = "60R设备规格参数", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody DeviceSpec60rBo bo) {
|
|
return toAjax(iDeviceSpec60rService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改60R设备规格参数
|
|
*/
|
|
@SaCheckPermission("system:spec60r:edit")
|
|
@Log(title = "60R设备规格参数", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DeviceSpec60rBo bo) {
|
|
return toAjax(iDeviceSpec60rService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除60R设备规格参数
|
|
*
|
|
* @param ids 主键串
|
|
*/
|
|
@SaCheckPermission("system:spec60r:remove")
|
|
@Log(title = "60R设备规格参数", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ids}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] ids) {
|
|
return toAjax(iDeviceSpec60rService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
}
|
|
}
|