| | |
| | | return success(plan.getId()); |
| | | } |
| | | |
| | | @GetMapping("/get-stock-alert-suggest-items") |
| | | @Operation(summary = "获取库存预警建议采购明细", description = "遍历启用安全库存的物料,按默认仓库缺量返回建议采购明细,不落库") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-plan:create')") |
| | | public CommonResult<List<ErpPurchasePlanRespVO.Item>> getStockAlertSuggestItems() { |
| | | List<ErpPurchasePlanRespVO.Item> items = purchasePlanService.getStockAlertSuggestItems(); |
| | | if (CollUtil.isEmpty(items)) { |
| | | return success(items); |
| | | } |
| | | // 1.2 单位信息 |
| | | Map<Long, MdmUnitMeasureRespDTO> unitMeasureMap = mdmUnitMeasureApi.getUnitMeasureMap( |
| | | convertSet(items, ErpPurchasePlanRespVO.Item::getProductUnitId)); |
| | | items.forEach(item -> MapUtils.findAndThen(unitMeasureMap, item.getProductUnitId(), |
| | | unit -> item.setProductUnitName(unit.getName()))); |
| | | return success(items); |
| | | } |
| | | |
| | | @PostMapping("/generate-requests") |
| | | @Operation(summary = "生成采购申请") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-plan:generate-request')") |