feat(wms): 新增摄像头管理功能

- 添加摄像头管理相关的实体类、Mapper、Service、Controller等
- 实现摄像头管理的基础功能,包括查询、新增、修改、删除等
- 添加摄像头管理的Excel导出功能
- 为摄像头管理相关操作添加权限控制
This commit is contained in:
2025-08-07 16:49:13 +08:00
parent ca78eeb1cf
commit 19c6ad37c6
8 changed files with 628 additions and 0 deletions

View File

@@ -0,0 +1,106 @@
package com.klp.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.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.domain.vo.WmsCameraManagementVo;
import com.klp.domain.bo.WmsCameraManagementBo;
import com.klp.service.IWmsCameraManagementService;
import com.klp.common.core.page.TableDataInfo;
/**
* 摄像头管理
*
* @author Joshi
* @date 2025-08-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/wms/cameraManagement")
public class WmsCameraManagementController extends BaseController {
private final IWmsCameraManagementService iWmsCameraManagementService;
/**
* 查询摄像头管理列表
*/
@SaCheckPermission("wms:cameraManagement:list")
@GetMapping("/list")
public TableDataInfo<WmsCameraManagementVo> list(WmsCameraManagementBo bo, PageQuery pageQuery) {
return iWmsCameraManagementService.queryPageList(bo, pageQuery);
}
/**
* 导出摄像头管理列表
*/
@SaCheckPermission("wms:cameraManagement:export")
@Log(title = "摄像头管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsCameraManagementBo bo, HttpServletResponse response) {
List<WmsCameraManagementVo> list = iWmsCameraManagementService.queryList(bo);
ExcelUtil.exportExcel(list, "摄像头管理", WmsCameraManagementVo.class, response);
}
/**
* 获取摄像头管理详细信息
*
* @param cameraId 主键
*/
@SaCheckPermission("wms:cameraManagement:query")
@GetMapping("/{cameraId}")
public R<WmsCameraManagementVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long cameraId) {
return R.ok(iWmsCameraManagementService.queryById(cameraId));
}
/**
* 新增摄像头管理
*/
@SaCheckPermission("wms:cameraManagement:add")
@Log(title = "摄像头管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsCameraManagementBo bo) {
return toAjax(iWmsCameraManagementService.insertByBo(bo));
}
/**
* 修改摄像头管理
*/
@SaCheckPermission("wms:cameraManagement:edit")
@Log(title = "摄像头管理", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsCameraManagementBo bo) {
return toAjax(iWmsCameraManagementService.updateByBo(bo));
}
/**
* 删除摄像头管理
*
* @param cameraIds 主键串
*/
@SaCheckPermission("wms:cameraManagement:remove")
@Log(title = "摄像头管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{cameraIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] cameraIds) {
return toAjax(iWmsCameraManagementService.deleteWithValidByIds(Arrays.asList(cameraIds), true));
}
}