From 37c7c23704221e45abb011cb703af2b3b5bffc53 Mon Sep 17 00:00:00 2001 From: DouDou <877258667@qq.com> Date: Mon, 7 Jul 2025 14:57:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E5=AD=A6=E8=AE=A1=E6=95=B0=E6=B3=95BU?= =?UTF-8?q?G?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/spring/ifs/api/BomApi.java | 24 +++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/spring/ifs/api/BomApi.java b/src/main/java/com/spring/ifs/api/BomApi.java index dc4d8afb..9739bb77 100644 --- a/src/main/java/com/spring/ifs/api/BomApi.java +++ b/src/main/java/com/spring/ifs/api/BomApi.java @@ -525,11 +525,29 @@ public class BomApi { tempItem.setPrintUnit(tempMap.get("UNITMEAS")); tempItem.setLineSequence(tempMap.get("LINE_SEQUENCE")); tempItem.setComponentPart(tempMap.get("COMPONENT_PART")); - tempItem.setQtyPerAssembly(tempMap.get("QTY_PER_ASSEMBLY")); + //处理字符串含有E 科学计数法 + String strQtyPerAssembly = tempMap.get("QTY_PER_ASSEMBLY"); + BigDecimal bigQtyPerAssembly = new BigDecimal(strQtyPerAssembly); + bigQtyPerAssembly = bigQtyPerAssembly.stripTrailingZeros(); + String formatterQtyPerAssembly = bigQtyPerAssembly.toPlainString(); + tempItem.setQtyPerAssembly(formatterQtyPerAssembly); + + String strComponentScrap= tempMap.get("COMPONENT_SCRAP"); + BigDecimal bigComponentScrap = new BigDecimal(strComponentScrap); + bigComponentScrap = bigComponentScrap.stripTrailingZeros(); + String formatterComponentScrap = bigComponentScrap.toPlainString(); + tempItem.setComponentScrap(formatterComponentScrap); + + String strShrinkageFactor= tempMap.get("SHRINKAGE_FACTOR"); + BigDecimal bigShrinkageFactor = new BigDecimal(strShrinkageFactor); + bigShrinkageFactor = bigShrinkageFactor.stripTrailingZeros(); + String formatterShrinkageFactor = bigShrinkageFactor.toPlainString(); + tempItem.setShrinkageFactor(formatterShrinkageFactor); + tempItem.setIssueType(tempMap.get("ISSUE_TYPE")); tempItem.setOperationNo(tempMap.get("OPERATION_NO")); - tempItem.setComponentScrap(tempMap.get("COMPONENT_SCRAP")); - tempItem.setShrinkageFactor(tempMap.get("SHRINKAGE_FACTOR")); + + //添加对象 resultItems.add(tempItem); }