add:库存可用数与冻结数校验

This commit is contained in:
zhangzhiqiang
2023-01-10 14:34:46 +08:00
parent 612aec2e50
commit 6d7ba328f1

View File

@@ -232,6 +232,11 @@ public class StorPublicServiceImpl implements StorPublicService {
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));
double add = NumberUtil.add(jo_in.getDoubleValue("canuse_qty"), jo_in.getDoubleValue("frozen_qty"));
double sub_qty = NumberUtil.sub(add,jo_in.getDoubleValue("ivt_qty"));
if (sub_qty != 0) {
throw new BadRequestException("库存 stockrecord_id:"+jo_in.getString("stockrecord_id")+"可用数加冻结数不等于总数");
}
jo_in.put("warehousing_qty",new BigDecimal(jo_in.getDoubleValue("warehousing_qty")).setScale(3, RoundingMode.HALF_UP));
switch (change_type_scode) {
case "11": //11加冻结、减可用出库分配、移库移出