|
|
|
@@ -1,76 +0,0 @@
|
|
|
|
package com.niuan.erp.module.production.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
|
|
|
import com.niuan.erp.common.annotation.ApiLog;
|
|
|
|
|
|
|
|
import com.niuan.erp.common.annotation.ModuleLog;
|
|
|
|
|
|
|
|
import com.niuan.erp.common.base.BaseDeleteBody;
|
|
|
|
|
|
|
|
import com.niuan.erp.common.base.BasePageReqParams;
|
|
|
|
|
|
|
|
import com.niuan.erp.common.base.BaseResult;
|
|
|
|
|
|
|
|
import com.niuan.erp.common.base.CommonValidateGroup.*;
|
|
|
|
|
|
|
|
import com.niuan.erp.common.base.OperationType;
|
|
|
|
|
|
|
|
import com.niuan.erp.module.production.controller.dto.BomItemDto;
|
|
|
|
|
|
|
|
import com.niuan.erp.module.production.entity.BomItem;
|
|
|
|
|
|
|
|
import com.niuan.erp.module.production.service.BomItemService;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Tag(name = "BomItem")
|
|
|
|
|
|
|
|
@ModuleLog("BomItem管理")
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
|
|
@RequestMapping("/production/bomitem")
|
|
|
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
|
|
|
public class BomItemController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final BomItemService bomItemService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "分页查询BomItem数据", operationId = "getBomItemPage")
|
|
|
|
|
|
|
|
@GetMapping("/getBomItemPage")
|
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('bomitem:index')")
|
|
|
|
|
|
|
|
public BaseResult<IPage<BomItemDto>> getBomItemPage(@Validated BasePageReqParams pageParams,
|
|
|
|
|
|
|
|
@Validated(Get.class) BomItemDto searchParams) {
|
|
|
|
|
|
|
|
var wrapper = new LambdaQueryWrapper<BomItem>();
|
|
|
|
|
|
|
|
return BaseResult.successWithData(bomItemService.getBomItemPage(pageParams, wrapper));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiLog(type = OperationType.ADD, remark = "新增一条BomItem记录")
|
|
|
|
|
|
|
|
@Operation(summary = "新增BomItem", operationId = "addBomItem")
|
|
|
|
|
|
|
|
@PostMapping("/addBomItem")
|
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('bomitem:add')")
|
|
|
|
|
|
|
|
public BaseResult<?> addBomItem(@Validated(Add.class) @RequestBody BomItemDto dto) {
|
|
|
|
|
|
|
|
bomItemService.addBomItem(dto);
|
|
|
|
|
|
|
|
return BaseResult.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiLog(type = OperationType.UPDATE, remark = "更新一条BomItem记录")
|
|
|
|
|
|
|
|
@Operation(summary = "更新BomItem", operationId = "updateBomItem")
|
|
|
|
|
|
|
|
@PostMapping("/updateBomItem")
|
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('bomitem:update')")
|
|
|
|
|
|
|
|
public BaseResult<?> updateBomItem(@Validated(Update.class) @RequestBody BomItemDto dto) {
|
|
|
|
|
|
|
|
bomItemService.updateBomItem(dto);
|
|
|
|
|
|
|
|
return BaseResult.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiLog(type = OperationType.DELETE, remark = "删除一条BomItem记录")
|
|
|
|
|
|
|
|
@Operation(summary = "删除BomItem", operationId = "deleteBomItem")
|
|
|
|
|
|
|
|
@PostMapping("/deleteBomItem")
|
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('bomitem:delete')")
|
|
|
|
|
|
|
|
public BaseResult<?> deleteBomItem(@Validated(DeleteOne.class) @RequestBody BaseDeleteBody req) {
|
|
|
|
|
|
|
|
bomItemService.deleteBomItem(req.id());
|
|
|
|
|
|
|
|
return BaseResult.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiLog(type = OperationType.DELETE, remark = "批量删除BomItem记录")
|
|
|
|
|
|
|
|
@Operation(summary = "批量删除BomItem", operationId = "deleteBomItemBatch")
|
|
|
|
|
|
|
|
@PostMapping("/deleteBomItemBatch")
|
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('bomitem:deleteBatch')")
|
|
|
|
|
|
|
|
public BaseResult<?> deleteBomItemBatch(@Validated(DeleteBatch.class) @RequestBody BaseDeleteBody req) {
|
|
|
|
|
|
|
|
bomItemService.deleteBatch(req.ids());
|
|
|
|
|
|
|
|
return BaseResult.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|