fix:手持库存计算小数不一致问题
This commit is contained in:
@@ -34,6 +34,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -804,8 +805,11 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
if (ObjectUtil.isEmpty(ivtjo)) {
|
||||
throw new PdaRequestException("物料为【'" + material_id + "'】,批次为【'" + pcsn + "'】,库存等级为【'" + ivt_level + "'】,品质类型为【'" + quality_scode + "'】的物料在仓库未找到!");
|
||||
}
|
||||
BigDecimal qty_flag = NumberUtil.sub(storage_qty, ivtjo.getString("canuse_qty"));
|
||||
if (qty_flag.doubleValue() != 0) {
|
||||
BigDecimal storage_qty_bigDecimal = new BigDecimal(null == storage_qty ? "0" : storage_qty).setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal canuse_qty_bigDecimal = new BigDecimal(null == ivtjo.getString("canuse_qty") ? "0" : storage_qty).setScale(3, RoundingMode.HALF_UP);
|
||||
// BigDecimal qty_flag = NumberUtil.sub(storage_qty, ivtjo.getString("canuse_qty"));
|
||||
if (NumberUtil.sub(storage_qty_bigDecimal,canuse_qty_bigDecimal).doubleValue() != 0) {
|
||||
log.error("仓库库存对应不上,storage_qty_bigDecimal:{},canuse_qty_bigDecimal:{}",storage_qty_bigDecimal,canuse_qty_bigDecimal);
|
||||
throw new PdaRequestException("物料为【'" + material_id + "'】,批次为【'" + pcsn + "'】,库存等级为【'" + ivt_level + "'】,品质类型为【'" + quality_scode + "'】的物料桶库存,跟仓库库存对应不上!");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user