Merge remote-tracking branch 'origin/master'
commit
5a012a38ff
@ -0,0 +1,118 @@
|
||||
package org.dromara.wms.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.wms.domain.bo.BaseMaterialCategoryBo;
|
||||
import org.dromara.wms.domain.vo.BaseMaterialCategoryVo;
|
||||
import org.dromara.wms.service.IBaseMaterialCategoryService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料大类信息
|
||||
* 前端访问路由地址为:/wms/baseMaterialCategory
|
||||
*
|
||||
* @author xins
|
||||
* @date 2025-02-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/baseMaterialCategory")
|
||||
public class BaseMaterialCategoryController extends BaseController {
|
||||
|
||||
private final IBaseMaterialCategoryService baseMaterialCategoryService;
|
||||
|
||||
/**
|
||||
* 查询物料大类信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialCategory:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BaseMaterialCategoryVo> list(BaseMaterialCategoryBo bo, PageQuery pageQuery) {
|
||||
return baseMaterialCategoryService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料大类信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialCategory:export")
|
||||
@Log(title = "物料大类信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseMaterialCategoryBo bo, HttpServletResponse response) {
|
||||
List<BaseMaterialCategoryVo> list = baseMaterialCategoryService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物料大类信息", BaseMaterialCategoryVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料大类信息详细信息
|
||||
*
|
||||
* @param materialCategoryId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialCategory:query")
|
||||
@GetMapping("/{materialCategoryId}")
|
||||
public R<BaseMaterialCategoryVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long materialCategoryId) {
|
||||
return R.ok(baseMaterialCategoryService.queryById(materialCategoryId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料大类信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialCategory:add")
|
||||
@Log(title = "物料大类信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseMaterialCategoryBo bo) {
|
||||
return toAjax(baseMaterialCategoryService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料大类信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialCategory:edit")
|
||||
@Log(title = "物料大类信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseMaterialCategoryBo bo) {
|
||||
return toAjax(baseMaterialCategoryService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料大类信息
|
||||
*
|
||||
* @param materialCategoryIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialCategory:remove")
|
||||
@Log(title = "物料大类信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{materialCategoryIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] materialCategoryIds) {
|
||||
return toAjax(baseMaterialCategoryService.deleteWithValidByIds(List.of(materialCategoryIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询物料大类信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getBaseMaterialCategoryList")
|
||||
public R<List<BaseMaterialCategoryVo>> getBaseMaterialCategoryList(BaseMaterialCategoryBo bo) {
|
||||
List<BaseMaterialCategoryVo> list = baseMaterialCategoryService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue