fix:库存数量判断
This commit is contained in:
@@ -218,7 +218,7 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
String canuse_qty = ivtjo.getString("canuse_qty");
|
||||
BigDecimal canuse_qty_bigDecimal = new BigDecimal(null == canuse_qty ? "0" : canuse_qty).setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal out_qty_bigDecimal = new BigDecimal(null == out_qty ? "0" : out_qty).setScale(3, RoundingMode.HALF_UP);
|
||||
if (NumberUtil.sub(canuse_qty_bigDecimal,out_qty_bigDecimal).doubleValue() != 0) {
|
||||
if (NumberUtil.sub(canuse_qty_bigDecimal,out_qty_bigDecimal).doubleValue() < 0) {
|
||||
throw new PdaRequestException("库存的可用数量小于出库数量!");
|
||||
}
|
||||
//4、 查询【桶记录表】,判断桶号、物料批次、品质类型、库存等级、是否可用的库存是否存在,不存在提示错误,同时判断库存可用量是否满足出库重量,不满足提示错误;
|
||||
@@ -535,9 +535,10 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
BigDecimal canuse_qty_bigDecimal = new BigDecimal(null == canuse_qty ? "0" : canuse_qty).setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal out_qty_bigDecimal = new BigDecimal(null == out_qty ? "0" : out_qty).setScale(3, RoundingMode.HALF_UP);
|
||||
// BigDecimal qty_flag = NumberUtil.sub(storage_qty, ivtjo.getString("canuse_qty"));
|
||||
if (NumberUtil.sub(canuse_qty_bigDecimal,out_qty_bigDecimal).doubleValue() != 0) {
|
||||
if (NumberUtil.sub(canuse_qty_bigDecimal,out_qty_bigDecimal).doubleValue() < 0) {
|
||||
throw new PdaRequestException("库存的可用数量小于出库数量!");
|
||||
}
|
||||
|
||||
//4、 查询【桶记录表】,判断桶号、物料批次、品质类型、库存等级、是否可用的库存是否存在,不存在提示错误,同时判断库存可用量是否满足出库重量,不满足提示错误;
|
||||
JSONObject bucketjo = bucket_table.query("bucketunique='" + bucketunique + "' and material_id ='" + material_id + "' and quality_scode ='" + quality_scode + "' and pcsn ='" + pcsn + "' and ivt_level='" + ivt_level + "' and is_active='"+is_active+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(bucketjo)) {
|
||||
@@ -546,14 +547,6 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
String storage_qty = bucketjo.getString("storage_qty");
|
||||
BigDecimal bucketflag = NumberUtil.sub(storage_qty, out_qty);
|
||||
|
||||
if (NumberUtil.sub(bucketjo.getString("storage_qty"), out_qty).doubleValue() < 0) {
|
||||
throw new PdaRequestException("桶记录的数量小于出库数量!");
|
||||
}
|
||||
|
||||
BigDecimal storage_qty_bigDecimal = new BigDecimal(null == storage_qty ? "0" : storage_qty).setScale(3, RoundingMode.HALF_UP);
|
||||
if (NumberUtil.sub(storage_qty_bigDecimal,out_qty_bigDecimal).doubleValue() != 0) {
|
||||
throw new PdaRequestException("库存的可用数量小于出库数量!");
|
||||
}
|
||||
if (bucketflag.doubleValue() < 0) {
|
||||
throw new PdaRequestException("桶记录的数量小于出库数量!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user