From d0ddc6cf68cf3dfae4b6c10f823f654db4c760ac Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Tue, 13 Sep 2022 10:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../st/out/service/impl/HandCleanOutIvtServiceImpl.java | 9 ++++----- .../pda/st/out/service/impl/HandPFOutIvtServiceImpl.java | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandCleanOutIvtServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandCleanOutIvtServiceImpl.java index 000087ee..e278be3f 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandCleanOutIvtServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandCleanOutIvtServiceImpl.java @@ -239,12 +239,11 @@ public class HandCleanOutIvtServiceImpl implements HandCleanOutIvtService { } - BigDecimal left_qty = NumberUtil.sub(bucketjo.getString("storage_qty"), out_qty); - + double left_qty = NumberUtil.round(bucketjo.getDouble("storage_qty")-Double.valueOf(out_qty),3).doubleValue(); // 插入到【配粉间桶记录表】 String area_type = pointJO.getString("area_type"); - if (left_qty.doubleValue() == 0 && bill_type.equals("010501")) { + if (left_qty == 0 && bill_type.equals("010501")) { if (StrUtil.equals("22", area_type) || StrUtil.equals("23", area_type) || StrUtil.equals("24", area_type)) { bucketjo.put("area_type", area_type); bucketjo.put("create_time", DateUtil.now()); @@ -253,10 +252,10 @@ public class HandCleanOutIvtServiceImpl implements HandCleanOutIvtService { } String status = bucketjo.getString("status"); - if (left_qty.doubleValue() < 0) { + if (left_qty < 0) { throw new PdaRequestException("出库重量大于桶记录里面的库存数量!"); } - if (left_qty.doubleValue() == 0) { + if (left_qty == 0) { status = "04"; bucketjo.put("storagevehicle_id", ""); bucketjo.put("storagevehicle_code", ""); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandPFOutIvtServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandPFOutIvtServiceImpl.java index e7416f14..5b7b35b4 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandPFOutIvtServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandPFOutIvtServiceImpl.java @@ -213,8 +213,9 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService { throw new PdaRequestException("该物料的桶信息查询不到!"); } String storage_qty = bucketjo.getString("storage_qty"); - BigDecimal bucketflag = NumberUtil.sub(storage_qty, out_qty); - if (bucketflag.doubleValue() < 0) { + double bucketflag = NumberUtil.round(bucketjo.getDouble("storage_qty")-Double.valueOf(out_qty),3).doubleValue(); + + if (bucketflag < 0) { throw new PdaRequestException("桶记录的数量小于出库数量!"); } //插入主表,明细表,分配表,分配明细表 @@ -339,7 +340,7 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService { JSONObject ProducMaterialExtObj = WQLObject.getWQLObject("MD_ME_ProducMaterialExt").query("material_id='" + material_id + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(ProducMaterialExtObj) && bill_type.equals("010501")) { String is_need_move = ProducMaterialExtObj.getString("is_need_move"); - if (StrUtil.equals(is_need_move, "1") && bucketflag.doubleValue() == 0) ; + if (StrUtil.equals(is_need_move, "1") && bucketflag == 0) ; if (StrUtil.equals(area_type, "22") || StrUtil.equals(area_type, "23") || StrUtil.equals(area_type, "24")) { bucketjo.put("area_type", area_type); bucketjo.put("create_time", DateUtil.now()); @@ -354,7 +355,7 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService { bucketjo.put("outstor_optname", ""); bucketjo.put("outstor_time", now); //出完状态为出库 - if (bucketflag.doubleValue() == 0) { + if (bucketflag == 0) { status = "04"; bucketjo.put("storagevehicle_id", ""); bucketjo.put("storagevehicle_code", "");