Browse Source

[fix] 仓库管理

修改暂收-采购入库页面:修改暂收合格数和实际到货数的填写校验。可以填写0;
修改暂收-仓库入库页面:修改暂收合格数和实际到货数的填写校验。可以填写0;
修改暂收-采购入库后端接口方法:新增对填写的暂收合格数和实际到货数的填写校验,设置非空判断,如果为空进行提示,不能提交成功
修改暂收-仓库入库后端接口方法:新增对填写的暂收合格数和实际到货数的填写校验,设置非空判断,如果为空进行提示,不能提交成功
dev
liuxiaoxu 4 months ago
parent
commit
72dc2b7187
  1. 49
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  2. 4
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchase.html
  3. 4
      ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchaseWarehouse.html

49
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -309,10 +309,29 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
warehouseStorageOrder.setWarehouseQualityStatus("0");
warehouseStorageOrder.setWarehouseEmployee(loginName);
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
int actualArriveNum = 0;
//检查填写的实际到货数是否有空值
boolean hasActualArriveNumNull = warehouseStorageOrderDetailList.stream()
.anyMatch(item -> item.getActualArriveNum() == null);
if (hasActualArriveNumNull) {
throw new BusinessException("存在实际到货数为空,请检查!");
}
//入库单主表的实际到货数为子表的合计
int actualArriveNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getActualArriveNum).sum();
actualArriveNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getActualArriveNum).sum();
int temporaryQualifiedNum = 0;
//检查填写的品质合格数是否有空值
boolean hasTemporaryQualifiedNumNull = warehouseStorageOrderDetailList.stream()
.anyMatch(item -> item.getTemporaryQualifiedNum() == null);
if (hasTemporaryQualifiedNumNull) {
throw new BusinessException("存在品质合格数为空,请检查!");
}
//入库单主表的暂收合格数为子表的合计
int temporaryQualifiedNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getTemporaryQualifiedNum).sum();
temporaryQualifiedNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getTemporaryQualifiedNum).sum();
if (actualArriveNum < temporaryQualifiedNum) {
throw new BusinessException("暂收合格数不能大于实际到货数");
}
@ -661,10 +680,32 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
warehouseStorageOrder.setWarehouseQualityStatus("0");
warehouseStorageOrder.setWarehouseEmployee(loginName);
List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
int actualArriveNum = 0;
//检查填写的实际到货数是否有空值
boolean hasActualArriveNumNull = warehouseStorageOrderDetailList.stream()
.anyMatch(item -> item.getActualArriveNum() == null);
if (hasActualArriveNumNull) {
throw new BusinessException("存在实际到货数为空,请检查!");
}
//入库单主表的实际到货数为子表的合计
int actualArriveNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getActualArriveNum).sum();
actualArriveNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getActualArriveNum).sum();
int temporaryQualifiedNum = 0;
//检查填写的品质合格数是否有空值
boolean hasTemporaryQualifiedNumNull = warehouseStorageOrderDetailList.stream()
.anyMatch(item -> item.getTemporaryQualifiedNum() == null);
if (hasTemporaryQualifiedNumNull) {
throw new BusinessException("存在品质合格数为空,请检查!");
}
//入库单主表的暂收合格数为子表的合计
int temporaryQualifiedNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getTemporaryQualifiedNum).sum();
temporaryQualifiedNum = warehouseStorageOrderDetailList.stream().mapToInt(WarehouseStorageOrderDetail::getTemporaryQualifiedNum).sum();
if (actualArriveNum < temporaryQualifiedNum) {
throw new BusinessException("暂收合格数不能大于实际到货数");
}

4
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchase.html

@ -281,7 +281,7 @@
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
if (processBadNum < 0) return '数量必须是整数';
}
}
},
@ -296,7 +296,7 @@
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
if (processBadNum < 0) return '数量必须是整数';
}
}
},

4
ruoyi-admin/src/main/resources/templates/warehouse/storageOrder/temporaryPurchaseWarehouse.html

@ -280,7 +280,7 @@
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
if (processBadNum < 0) return '数量必须是整数';
}
}
},
@ -295,7 +295,7 @@
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
if (processBadNum < 0) return '数量必须是整数';
}
}
},

Loading…
Cancel
Save