|
@@ -1,5 +1,6 @@
|
|
|
package cn.iocoder.yudao.module.pms.controller.admin.iotsapstock;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
@@ -25,7 +26,9 @@ import java.io.IOException;
|
|
|
import java.util.List;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_SAP_STOCK_NOT_EXISTS;
|
|
|
|
|
|
@Tag(name = "管理后台 - PMS SAP 库存(通用库存/项目部库存)")
|
|
|
@RestController
|
|
@@ -51,6 +54,16 @@ public class IotSapStockController {
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/batchSetSafetyStock")
|
|
|
+ @Operation(summary = "批量设置安全库存")
|
|
|
+ @PreAuthorize("@ss.hasPermission('pms:iot-sap-stock:update')")
|
|
|
+ public CommonResult<Long> batchSetSafetyStock(@Valid @RequestBody List<IotSapStockSaveReqVO> sapStocks) {
|
|
|
+ if (CollUtil.isEmpty(sapStocks)) {
|
|
|
+ throw exception(IOT_SAP_STOCK_NOT_EXISTS);
|
|
|
+ }
|
|
|
+ return success(iotSapStockService.batchSetSafetyStock(sapStocks));
|
|
|
+ }
|
|
|
+
|
|
|
@DeleteMapping("/delete")
|
|
|
@Operation(summary = "删除PMS SAP 库存(通用库存/项目部库存)")
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|