fix:配粉出库:库存表与桶表精度不一致问题(暂时处理:代码兼容)
This commit is contained in:
@@ -216,8 +216,9 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
throw new PdaRequestException("该物料的库存信息找不到!");
|
||||
}
|
||||
String canuse_qty = ivtjo.getString("canuse_qty");
|
||||
BigDecimal ivtflag = NumberUtil.sub(canuse_qty, out_qty);
|
||||
if (ivtflag.doubleValue() < 0) {
|
||||
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) {
|
||||
throw new PdaRequestException("库存的可用数量小于出库数量!");
|
||||
}
|
||||
//4、 查询【桶记录表】,判断桶号、物料批次、品质类型、库存等级、是否可用的库存是否存在,不存在提示错误,同时判断库存可用量是否满足出库重量,不满足提示错误;
|
||||
@@ -225,7 +226,6 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
if (ObjectUtil.isEmpty(bucketjo)) {
|
||||
throw new PdaRequestException("该物料的桶信息查询不到!");
|
||||
}
|
||||
String storage_qty = bucketjo.getString("storage_qty");
|
||||
double bucketflag = NumberUtil.round(bucketjo.getDouble("storage_qty")-Double.valueOf(out_qty),3).doubleValue();
|
||||
|
||||
if (bucketflag < 0) {
|
||||
@@ -531,8 +531,11 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
throw new PdaRequestException("该物料的库存信息找不到!");
|
||||
}
|
||||
String canuse_qty = ivtjo.getString("canuse_qty");
|
||||
BigDecimal ivtflag = NumberUtil.sub(canuse_qty, out_qty);
|
||||
if (ivtflag.doubleValue() < 0) {
|
||||
|
||||
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) {
|
||||
throw new PdaRequestException("库存的可用数量小于出库数量!");
|
||||
}
|
||||
//4、 查询【桶记录表】,判断桶号、物料批次、品质类型、库存等级、是否可用的库存是否存在,不存在提示错误,同时判断库存可用量是否满足出库重量,不满足提示错误;
|
||||
@@ -542,6 +545,15 @@ 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("桶记录的数量小于出库数量!");
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
@@ -226,6 +228,11 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
|
||||
// 获取仓位物料信息
|
||||
JSONObject jo_in = wql.query(sql_where.toString()).uniqueResult(0);
|
||||
//TODO:兼容小数点不一致问题:后续有问题保留三位处理
|
||||
jo_in.put("canuse_qty",new BigDecimal(jo_in.getDoubleValue("canuse_qty")).setScale(3, RoundingMode.HALF_UP));
|
||||
jo_in.put("frozen_qty",new BigDecimal(jo_in.getDoubleValue("frozen_qty")).setScale(3, RoundingMode.HALF_UP));
|
||||
jo_in.put("ivt_qty",new BigDecimal(jo_in.getDoubleValue("ivt_qty")).setScale(3, RoundingMode.HALF_UP));
|
||||
jo_in.put("warehousing_qty",new BigDecimal(jo_in.getDoubleValue("warehousing_qty")).setScale(3, RoundingMode.HALF_UP));
|
||||
switch (change_type_scode) {
|
||||
case "11": //11加冻结、减可用:出库分配、移库移出
|
||||
if (jo_in != null) {
|
||||
|
||||
Reference in New Issue
Block a user