From 043173fdbb065aa7981e17d0c52c001397c6d894 Mon Sep 17 00:00:00 2001 From: xiongcz Date: Mon, 26 May 2025 11:12:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(ysr):=20=E4=BC=98=E5=8C=96=20BOM=20?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增打印变更前后数量的调试信息- 增加对数量未变化的项的判断,避免不必要的处理 - 修改参数名称,提高代码可读性 - 修正获取数量属性的方法,使用字符串转 double --- .idea/vcs.xml | 6 ----- .../ysr/form/YSR8_ECN1RevisionMasterForm.java | 23 ++++++++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/cn/com/ebewin/ysr/form/YSR8_ECN1RevisionMasterForm.java b/src/cn/com/ebewin/ysr/form/YSR8_ECN1RevisionMasterForm.java index 0c6a905..db2b299 100644 --- a/src/cn/com/ebewin/ysr/form/YSR8_ECN1RevisionMasterForm.java +++ b/src/cn/com/ebewin/ysr/form/YSR8_ECN1RevisionMasterForm.java @@ -1245,6 +1245,11 @@ public class YSR8_ECN1RevisionMasterForm extends AbstractRendering { // } //߼ double[] ds = getBOMLineQuantity(beforeMap.get(key),afterMap.get(key)); + System.out.println("["+beforeMap.get(key)+"]ǰ=["+ds[0]+"]=["+ds[1]+"]"); + double changeNum = ds[1] - ds[0]; + if (changeNum == 0) { + continue; + } resultMap.put(afterMap.get(key), ds[1] - ds[0]); } } @@ -1378,22 +1383,24 @@ public class YSR8_ECN1RevisionMasterForm extends AbstractRendering { /** * ȡbomlineQuantityһ - * @param tcComponentBOMLine - * @param tcComponentBOMLine2 + * @param beforeBOMLine ǰ + * @param afterBOMLine2 * @return * @throws TCException */ - private double[] getBOMLineQuantity(TCComponentBOMLine tcComponentBOMLine, TCComponentBOMLine tcComponentBOMLine2) throws TCException { + private double[] getBOMLineQuantity(TCComponentBOMLine beforeBOMLine, TCComponentBOMLine afterBOMLine2) throws TCException { System.out.println("getBOMLineQuantityʼִС"); - if (tcComponentBOMLine == null || tcComponentBOMLine2 == null) { + if (beforeBOMLine == null || afterBOMLine2 == null) { System.out.println("getBOMLineQuantity쳣Ϊnull"); return null; } - String targetName = tcComponentBOMLine.getItem().getStringProperty("object_string"); - double bl_quantity1 = tcComponentBOMLine.getDoubleProperty("bl_quantity"); - double bl_quantity2 = tcComponentBOMLine2.getDoubleProperty("bl_quantity"); + String targetName = beforeBOMLine.getItem().getStringProperty("object_string"); + String bl_quantity1 = beforeBOMLine.getStringProperty("bl_quantity"); + String bl_quantity2 = afterBOMLine2afterBOMLine2.getStringProperty("bl_quantity"); + double bl1 = Double.parseDouble(bl_quantity1); + double bl2 = Double.parseDouble(bl_quantity2); System.out.println(targetName+"ӦbomlineǰԱ="+bl_quantity1+":"+bl_quantity2+""); - double[] re = {bl_quantity1,bl_quantity2}; + double[] re = {bl1, bl2}; return re; }