更新若干功能
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
2026-08-20 19:16:49 +08:00
parent 72bc6502eb
commit 4ddf5e3c5f
48 changed files with 1908 additions and 18 deletions

View File

@@ -191,6 +191,7 @@ class WxListService extends BaseWxService
}
$priceSheetId = (int) ($params['price_sheet_id'] ?? 0);
$quantity = max(1, (int) ($params['quantity'] ?? 1));
\App\Service\business\StockService::getInstance()->assertAvailable($priceSheetId, $quantity);
$exists = ListItemModel::where('list_id', $listId)
->where('catalogue_id', $catalogueId)
@@ -242,6 +243,8 @@ class WxListService extends BaseWxService
$this->utils->errorThrow('明细不存在');
}
$sheetId = (int) ($update['price_sheet_id'] ?? $item['price_sheet_id']);
$qty = (int) ($update['quantity'] ?? $item['quantity']);
\App\Service\business\StockService::getInstance()->assertAvailable($sheetId, $qty);
$material = (string) ($update['material_key'] ?? $item['material_key'] ?? 'routine');
if ($sheetId > 0) {
$sheet = PriceSheetModel::where('id', $sheetId)->where('deleted_at', 0)->first();
@@ -255,4 +258,13 @@ class WxListService extends BaseWxService
}
return ListItemModel::where('id', $itemId)->whereIn('list_id', $listIds)->update($update);
}
/**
* 导出本人清单报价,给分享/下载用
*/
public function exportQuote(int $id): array
{
$info = $this->detail($id);
return \App\Service\common\ExcelCsvService::getInstance()->quoteFromList($info);
}
}