From f450ac2435504d266348f9264e91b556a6006d21 Mon Sep 17 00:00:00 2001 From: xiongcz Date: Wed, 21 May 2025 13:28:35 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ysr):=20=E9=87=8D=E6=9E=84=20ECN1=20?= =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E4=B8=BB=E8=A1=A8=E5=8D=95=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=20BOM=20=E6=95=B0=E9=87=8F=E6=AF=94=E8=BE=83=E9=80=BB=E8=BE=91?= =?UTF-8?q?-=20=E6=B3=A8=E9=87=8A=E6=8E=89=E5=8E=9F=E6=9C=89=E7=9A=84?= =?UTF-8?q?=E6=AF=94=E8=BE=83=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E7=9A=84=20getBOMLineQuantity=20=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=20-=20=E6=96=B0=E5=A2=9E=20getBOMLineQuantit?= =?UTF-8?q?y=20=E6=96=B9=E6=B3=95=EF=BC=8C=E7=9B=B4=E6=8E=A5=E6=AF=94?= =?UTF-8?q?=E8=BE=83=20BOM=20=E8=A1=8C=E7=9A=84=E6=95=B0=E9=87=8F=20-=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E9=AB=98=E4=BA=86=E5=8F=AF=E8=AF=BB=E6=80=A7?= =?UTF-8?q?=E5=92=8C=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/git_toolbox_prj.xml | 15 ++++++++ .../ysr/form/YSR8_ECN1RevisionMasterForm.java | 36 +++++++++++++++---- 2 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 .idea/git_toolbox_prj.xml diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml new file mode 100644 index 0000000..02b915b --- /dev/null +++ b/.idea/git_toolbox_prj.xml @@ -0,0 +1,15 @@ + + + + + + + \ 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 631ace6..0c6a905 100644 --- a/src/cn/com/ebewin/ysr/form/YSR8_ECN1RevisionMasterForm.java +++ b/src/cn/com/ebewin/ysr/form/YSR8_ECN1RevisionMasterForm.java @@ -1237,12 +1237,15 @@ public class YSR8_ECN1RevisionMasterForm extends AbstractRendering { System.out.println("1_afterMap ["+key+"] : ["+afterMap.get(key)+"]"); if (afterMap.containsKey(key)) { System.out.println("1"); - Object compResult = TCUtil.compareBOMLineQuantity(beforeMap.get(key), afterMap.get(key)); - if (compResult instanceof double[]) { - System.out.println("2"); - double[] ds = (double[]) compResult; - resultMap.put(afterMap.get(key), ds[1] - ds[0]); - } +// Object compResult = TCUtil.compareBOMLineQuantity(beforeMap.get(key), afterMap.get(key));//原生方法:根据“安装位置限定”计算更改前后零部件的数量 +// if (compResult instanceof double[]) { +// System.out.println("2"); +// double[] ds = (double[]) compResult; +// resultMap.put(afterMap.get(key), ds[1] - ds[0]); +// } + //新增的逻辑 + double[] ds = getBOMLineQuantity(beforeMap.get(key),afterMap.get(key)); + resultMap.put(afterMap.get(key), ds[1] - ds[0]); } } for (Map.Entry afterEntry : afterMap.entrySet()) { @@ -1373,6 +1376,27 @@ public class YSR8_ECN1RevisionMasterForm extends AbstractRendering { } } + /** + * 获取两个bomline的Quantity数量,并返回一个数组 + * @param tcComponentBOMLine + * @param tcComponentBOMLine2 + * @return + * @throws TCException + */ + private double[] getBOMLineQuantity(TCComponentBOMLine tcComponentBOMLine, TCComponentBOMLine tcComponentBOMLine2) throws TCException { + System.out.println("getBOMLineQuantity开始执行···"); + if (tcComponentBOMLine == null || tcComponentBOMLine2 == 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"); + System.out.println(targetName+"对应的bomline前后数量对比=【"+bl_quantity1+":"+bl_quantity2+"】"); + double[] re = {bl_quantity1,bl_quantity2}; + return re; + } + public void countYsr8_SubTotalExpense() { double ysr8_SubTotalExpense = 0.0; FormUtil.JTableInfo ci = (FormUtil.JTableInfo) fu.allComponentInfos.get("ecn1.141.11.11");