mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 09:55:16 +08:00
show设备展示添加 待修改
This commit is contained in:
parent
cf32e5e5ed
commit
39dc86655c
@ -0,0 +1,105 @@
|
|||||||
|
package org.dromara.web.controller.show;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.web.domain.vo.EqEquipmentVo;
|
||||||
|
import org.dromara.web.domain.bo.EqEquipmentBo;
|
||||||
|
import org.dromara.web.service.IEqEquipmentService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备信息
|
||||||
|
*
|
||||||
|
* @author zzc
|
||||||
|
* @date 2024-08-08
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/device/showEquipment")
|
||||||
|
public class EqShowEquipmentController extends BaseController {
|
||||||
|
|
||||||
|
private final IEqEquipmentService eqEquipmentService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备信息列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("device:showEquipment:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<EqEquipmentVo> list(EqEquipmentBo bo, PageQuery pageQuery) {
|
||||||
|
return eqEquipmentService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备信息列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("device:showEquipment:export")
|
||||||
|
@Log(title = "设备信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(EqEquipmentBo bo, HttpServletResponse response) {
|
||||||
|
List<EqEquipmentVo> list = eqEquipmentService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "设备信息", EqEquipmentVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备信息详细信息
|
||||||
|
*
|
||||||
|
* @param equipmentId 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("device:showEquipment:query")
|
||||||
|
@GetMapping("/{equipmentId}")
|
||||||
|
public R<EqEquipmentVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long equipmentId) {
|
||||||
|
return R.ok(eqEquipmentService.queryById(equipmentId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备信息
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("device:showEquipment:add")
|
||||||
|
@Log(title = "设备信息", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqEquipmentBo bo) {
|
||||||
|
return toAjax(eqEquipmentService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备信息
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("device:showEquipment:edit")
|
||||||
|
@Log(title = "设备信息", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EqEquipmentBo bo) {
|
||||||
|
return toAjax(eqEquipmentService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备信息
|
||||||
|
*
|
||||||
|
* @param equipmentIds 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("device:showEquipment:remove")
|
||||||
|
@Log(title = "设备信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{equipmentIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] equipmentIds) {
|
||||||
|
return toAjax(eqEquipmentService.deleteWithValidByIds(List.of(equipmentIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user