From 82f614e4646aeb179927dd82ccf0097a671dce48 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 03 七月 2026 14:19:38 +0800
Subject: [PATCH] 外购下单:出厂检验报告检验值小数位数生成错误问题修复

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
index 9d256d3..5257381 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -1765,7 +1765,7 @@
         IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId());
         //鏌ヨ闆朵欢灞炴��
         IfsPartPropsRecord ifsPartPropsRecord = ifsPartPropsRecordMapper.selectOne(Wrappers.<IfsPartPropsRecord>lambdaQuery()
-                .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId()));
+                .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId()).last("limit 1"));
         if (Objects.nonNull(ifsPartPropsRecord)) {
             enterFactoryReport.setOuterColor(StringUtils.equals(ifsPartPropsRecord.getOuterColor(),"/")?ifsPartPropsRecord.getInsulationColor():ifsPartPropsRecord.getOuterColor());
         }
@@ -4360,17 +4360,17 @@
     }
 
 
-    private static int getDecimalPlaces(String str) {
-        // 鏌ユ壘灏忔暟鐐逛綅缃�
-        int decimalPointIndex = str.lastIndexOf('.');
-
-        if (decimalPointIndex == -1) {
-            // 濡傛灉娌℃湁灏忔暟鐐癸紝杩斿洖0浣嶅皬鏁�
-            return 0;
+   private static int getDecimalPlaces(String str) {
+        // 浣跨敤姝e垯鍖归厤鎵�鏈夊甫灏忔暟鐐圭殑鏁板瓧锛屽彇鏈�澶у皬鏁颁綅鏁�
+        java.util.regex.Matcher matcher = Pattern.compile("\\d+\\.(\\d+)").matcher(str);
+        int maxDecimalPlaces = 0;
+        while (matcher.find()) {
+            int places = matcher.group(1).length();
+            if (places > maxDecimalPlaces) {
+                maxDecimalPlaces = places;
+            }
         }
-
-        // 璁$畻灏忔暟鐐瑰悗鐨勪綅鏁�
-        return str.length() - decimalPointIndex - 1;
+        return maxDecimalPlaces;
     }
 
     /**

--
Gitblit v1.9.3