Fix Bug #514: [库房管理-调拨管理-调拨] 调拨单保存与提交校验缺失 - 前端增加数量>0和库存校验,后端批量保存接口补充@Validated注解

根因:批量调拨页面handleSave仅校验单价未校验数量,submitApproval未校验数据完整性即提交审批;后端批量保存接口缺少@Validated导致DTO层@Min(1)未生效
修复:
1. batchTransfer/index.vue handleSave() 增加调拨数量>0和不超过源库存的前端校验
2. batchTransfer/index.vue handleSubmitApproval() 增加数量>0校验后再提交审批
3. ProductTransferController.java 批量保存接口添加@Validated注解启用DTO校验

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-17 21:18:47 +08:00
parent 71739cf271
commit 10a80587f1
2 changed files with 35 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ public class ProductTransferController {
* @return 操作结果
*/
@PutMapping("/product-transfer-batch")
public R<?> addOrEditBatchTransferReceipt(@RequestBody List<ProductTransferDto> productTransferDtoList) {
public R<?> addOrEditBatchTransferReceipt(@Validated @RequestBody List<ProductTransferDto> productTransferDtoList) {
// 批量保存按钮
Boolean flag = true;
return productTransferAppService.addOrEditBatchTransferReceipt(productTransferDtoList, flag);