From f23e21599c80522dc2a380b39f3eb2596f52e41e Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Wed, 29 Apr 2026 16:08:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=88=E6=9D=BF=E4=BD=8D=E5=88=A9=E7=94=A8?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gaotao/modules/dashboard/dao/DashboardDao.java | 2 ++ .../modules/dashboard/task/DashboardPushTask.java | 12 +++++++++++- .../modules/po/service/impl/PoServiceImpl.java | 7 +------ src/main/resources/mapper/dashboard/DashboardDao.xml | 12 ++++++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gaotao/modules/dashboard/dao/DashboardDao.java b/src/main/java/com/gaotao/modules/dashboard/dao/DashboardDao.java index 872af24..1e62fcb 100644 --- a/src/main/java/com/gaotao/modules/dashboard/dao/DashboardDao.java +++ b/src/main/java/com/gaotao/modules/dashboard/dao/DashboardDao.java @@ -170,5 +170,7 @@ public interface DashboardDao { * @return 产成品库存趋势列表 */ List> queryFinishedGoodsInventoryTrend(); + + List> queryGongGeUsed(); } diff --git a/src/main/java/com/gaotao/modules/dashboard/task/DashboardPushTask.java b/src/main/java/com/gaotao/modules/dashboard/task/DashboardPushTask.java index 3fe1aa2..3c240ac 100644 --- a/src/main/java/com/gaotao/modules/dashboard/task/DashboardPushTask.java +++ b/src/main/java/com/gaotao/modules/dashboard/task/DashboardPushTask.java @@ -14,6 +14,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.*; /** @@ -753,11 +755,19 @@ public class DashboardPushTask { emptyContainerInventoryData.put("flatPallet", emptyFlatPallet); // 空盘-平托 emptyContainerInventoryData.put("framePallet", emptyFramePallet); // 空盘-围框托盘 emptyContainerInventoryData.put("steelPallet", emptySteelPallet); // 空盘-钢底托 - + List> ggList = dashboardDao.queryGongGeUsed(); + BigDecimal utilizationRate2 = BigDecimal.ZERO; + if (!ggList.isEmpty()) { + Object utilizationRate2Obj = ggList.getFirst().get("utilizationRate2"); + utilizationRate2 = utilizationRate2Obj != null + ? new BigDecimal(utilizationRate2Obj.toString()).setScale(2, RoundingMode.HALF_UP) + : BigDecimal.ZERO; + } // 构造返回数据 Map storageData = new HashMap<>(); storageData.put("totalSlots", totalSlots); // 总库位数 storageData.put("usedSlots", usedSlots); // 已使用库位数 + storageData.put("utilizationRate2", utilizationRate2); // 成品位利用率(宫格使用率) storageData.put("utilizationRate", utilizationRate); // 利用率 storageData.put("materialInventory", materialInventoryData); // 物料盘库存 storageData.put("emptyContainerInventory", emptyContainerInventoryData); // 空盘库存 diff --git a/src/main/java/com/gaotao/modules/po/service/impl/PoServiceImpl.java b/src/main/java/com/gaotao/modules/po/service/impl/PoServiceImpl.java index 8874efb..a5b0ca9 100644 --- a/src/main/java/com/gaotao/modules/po/service/impl/PoServiceImpl.java +++ b/src/main/java/com/gaotao/modules/po/service/impl/PoServiceImpl.java @@ -237,12 +237,7 @@ public class PoServiceImpl extends ServiceImpl implemen handlePartAttribute(inData); // 同步到IFS syncToIFS(inData); - /* Map weiwaiMap = isWeiwai(inData); - if (weiwaiMap!=null) { - syncToIFSOfWeiWai(inData,weiwaiMap); - } else { - syncToIFS(inData); - }*/ + return receiptNo; } catch (Exception e) { log.error("采购入库失败,PO号: {}, 错误: {}", inData.getPoNo(), e.getMessage()); diff --git a/src/main/resources/mapper/dashboard/DashboardDao.xml b/src/main/resources/mapper/dashboard/DashboardDao.xml index d876ca1..25e40cc 100644 --- a/src/main/resources/mapper/dashboard/DashboardDao.xml +++ b/src/main/resources/mapper/dashboard/DashboardDao.xml @@ -108,5 +108,17 @@ select * from view_board_master_finish + +