From ae138915aea989f4ed98797c84f5c80ef4f77a01 Mon Sep 17 00:00:00 2001 From: zhaoqing <3160641494@qq.com> Date: Fri, 7 Aug 2026 18:51:04 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix(system):=20=E5=BA=93=E4=BD=8D=E5=BA=93?= =?UTF-8?q?=E5=8C=BA=E6=8E=92=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/basic/storageLocation/StorageLocationMapper.xml | 4 ++-- .../mapper/basic/storageSection/StorageSectionMapper.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mhd-modules/mhd-system/src/main/resources/mapper/basic/storageLocation/StorageLocationMapper.xml b/mhd-modules/mhd-system/src/main/resources/mapper/basic/storageLocation/StorageLocationMapper.xml index e2915658e..e9aa41514 100644 --- a/mhd-modules/mhd-system/src/main/resources/mapper/basic/storageLocation/StorageLocationMapper.xml +++ b/mhd-modules/mhd-system/src/main/resources/mapper/basic/storageLocation/StorageLocationMapper.xml @@ -185,8 +185,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - order by a.create_time desc + order by a.storage_name asc, a.create_time desc \ No newline at end of file From 6b2adce82fc28321a1e85abd53ef3ce989079318 Mon Sep 17 00:00:00 2001 From: zhaoqing <3160641494@qq.com> Date: Sat, 8 Aug 2026 10:01:54 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix(system):=20=E5=A4=8D=E6=A0=B8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReviewOrderApplicationService.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java index 0329feb68..7262f1440 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java @@ -792,11 +792,18 @@ public class ReviewOrderApplicationService { private void refreshReviewOrderStatus(Long reviewOrderId) { List rows = reviewOrderMapper.queryDetailByReviewOrderId(reviewOrderId); - // 业务口径:只有全部明细待复核=0 时,状态才置为 2;部分复核仍保持 1。 - // 状态 3 仅在 checkConfirm 中设置。 - boolean allReviewed = !CollectionUtils.isEmpty(rows) - && rows.stream().allMatch(r -> nz(r.getPendingReviewQty()).compareTo(BigDecimal.ZERO) == 0); - Integer targetStatus = allReviewed ? 2 : 1; + // ================== 旧口径:全部明细待复核=0 置 2,部分复核保持 1 ================== +// // 业务口径:只有全部明细待复核=0 时,状态才置为 2;部分复核仍保持 1。 +// // 状态 3 仅在 checkConfirm 中设置。 +// boolean allReviewed = !CollectionUtils.isEmpty(rows) +// && rows.stream().allMatch(r -> nz(r.getPendingReviewQty()).compareTo(BigDecimal.ZERO) == 0); +// Integer targetStatus = allReviewed ? 2 : 1; + // ================== 新口径:部分复核/全部复核完未确认均置 复核中(2),完全未复核保持 待复核(1) ================== + // 只要有任意明细已复核数量>0(部分复核 / 全部复核完未确认)即为复核中(2); + // 完全未复核(全部已复核=0)保持待复核(1)。状态 3 仅在 checkConfirm 中设置。 + boolean anyReviewed = !CollectionUtils.isEmpty(rows) + && rows.stream().anyMatch(r -> nz(r.getReviewedQty()).compareTo(BigDecimal.ZERO) > 0); + Integer targetStatus = anyReviewed ? 2 : 1; ReviewOrder order = reviewOrderMapper.selectById(reviewOrderId); if (order == null) { From 0f88ad75b9ae77471abaa9990789ff3db3c186cf Mon Sep 17 00:00:00 2001 From: rcx <3084692334@qq.com> Date: Sat, 8 Aug 2026 10:07:39 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix(wms=20=E5=BA=93=E5=AD=98=E6=A8=A1?= =?UTF-8?q?=E5=9D=97):=20=E4=BF=AE=E5=A4=8D=E5=BA=93=E5=AD=98=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E5=88=86=E7=BB=84=E6=8B=86=E5=88=86bug=E5=B9=B6?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=BA=93=E5=AD=98=E8=B0=83=E6=95=B4=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E7=A9=BA=E5=80=BC=E6=A0=A1=E9=AA=8C=201.=20queryListB?= =?UTF-8?q?yHzWlUnit=E3=80=81queryListByWlExpiry=20=E7=9A=84=20GROUP=20BY?= =?UTF-8?q?=20=E7=A7=BB=E9=99=A4=20=20=20=20shipper=5Fcode/material=5Fcode?= =?UTF-8?q?=20=E7=AD=89=E6=8F=8F=E8=BF=B0=E5=88=97=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E4=BF=9D=E7=95=99ID=E5=88=97=EF=BC=9B=E5=AF=B9=E5=BA=94SELECT?= =?UTF-8?q?=20=20=20=20=E6=8F=8F=E8=BF=B0=E5=88=97=E6=94=B9=E7=94=A8MAX()?= =?UTF-8?q?=E8=81=9A=E5=90=88=EF=BC=8C=E9=81=BF=E5=85=8D=E5=90=8CID?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=9B=A0=E6=8F=8F=E8=BF=B0=E5=88=97NULL/?= =?UTF-8?q?=E5=80=BC=E4=B8=8D=E4=B8=80=E8=87=B4=E8=A2=AB=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8B=86=E5=88=86=E3=80=82=202.=20=E5=BA=93=E5=AD=98=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E=20ObjectUtil.isNo?= =?UTF-8?q?tNull(warehousePO)=20=E7=A9=BA=E5=80=BC=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nventoryAdjustmentRecordDomainService.java | 2 +- .../MaterialInventoryMapper.xml | 75 +++++++++++-------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java index 2f0fe6053..51ad599be 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java @@ -292,7 +292,7 @@ public class InventoryAdjustmentRecordDomainService { //推送oms库存调整记录 try{ // 当仓库启用 oms 才进行推送 - if (warehousePO.getIsEnable() == 1) { + if (ObjectUtil.isNotNull(warehousePO) && warehousePO.getIsEnable() == 1) { Boolean pushSuccess = pushOms(materialInventory, inventoryAdjustmentRecordDO); if (!pushSuccess) { throw new ServiceException("库存调整推送OMS失败,请稍后重试"); diff --git a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml index 8656e711d..25a2173a3 100644 --- a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml @@ -458,8 +458,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -531,28 +531,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - a.shipper_id, a.shipper_code, a.shipper_name, - b.material_base_info_id, b.material_code, b.material_name, b.SPECIFICATION_MODEL, - a.warehouse_id, a.warehouse_code, a.warehouse_name, - a.organization_id, a.organization_name, a.top_organization_id, - MAX(b.material_type) AS material_type, - MAX(b.material_type_name) AS material_type_name, - MAX(b.bar_code) AS bar_code, - MAX(nvl(a.unit_name, b.unit_name)) AS unit_name, - MAX(b.pack_id) AS pack_id, - MAX(b.pack_code) AS pack_code, - MAX(b.pack_name) AS pack_name, - MAX(a.unit) AS unit, - IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity, - IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity, - IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity, - IFNULL(SUM(a.area), 0) AS area, - IFNULL(SUM(a.NET_WEIGHT), 0) AS NET_WEIGHT, - IFNULL(SUM(a.GROSS_WEIGHT), 0) AS GROSS_WEIGHT, - IFNULL(SUM(a.VOLUME), 0) AS VOLUME, - MIN(a.create_time) AS create_time, -- 新增:首次入库时间 - MAX(a.update_time) AS update_time, - CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order + a.shipper_id, + MAX(a.shipper_code) AS shipper_code, + MAX(a.shipper_name) AS shipper_name, + b.material_base_info_id, + MAX(b.material_code) AS material_code, + MAX(b.material_name) AS material_name, + MAX(b.SPECIFICATION_MODEL) AS SPECIFICATION_MODEL, + a.warehouse_id, + MAX(a.warehouse_code) AS warehouse_code, + MAX(a.warehouse_name) AS warehouse_name, + a.organization_id, + MAX(a.organization_name) AS organization_name, + a.top_organization_id, + MAX(b.material_type) AS material_type, + MAX(b.material_type_name) AS material_type_name, + MAX(b.bar_code) AS bar_code, + MAX(nvl(a.unit_name, b.unit_name)) AS unit_name, + MAX(b.pack_id) AS pack_id, + MAX(b.pack_code) AS pack_code, + MAX(b.pack_name) AS pack_name, + MAX(a.unit) AS unit, + IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity, + IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity, + IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity, + IFNULL(SUM(a.area), 0) AS area, + IFNULL(SUM(a.NET_WEIGHT), 0) AS NET_WEIGHT, + IFNULL(SUM(a.GROSS_WEIGHT), 0) AS GROSS_WEIGHT, + IFNULL(SUM(a.VOLUME), 0) AS VOLUME, + MIN(a.create_time) AS create_time, + MAX(a.update_time) AS update_time, + CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order From 02de8706e223b9a03923acf9aa5c4fdc4ebb018e Mon Sep 17 00:00:00 2001 From: zhaoqing <3160641494@qq.com> Date: Sat, 8 Aug 2026 11:46:55 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix(wms):=20=E5=A4=8D=E6=A0=B8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReviewOrderApplicationService.java | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java index 7262f1440..8b805a8e7 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/reviewOrder/ReviewOrderApplicationService.java @@ -234,7 +234,7 @@ public class ReviewOrderApplicationService { } db.setPendingReviewQty(pending.subtract(qty)); db.setReviewedQty(reviewed.add(qty)); - // 同步页面传入的重量/体积/面积 + // 同步页面传入的重量/体积/面积/尺寸 if (i.getNetWeightKg() != null) { db.setNetWeightKg(i.getNetWeightKg()); } @@ -247,6 +247,9 @@ public class ReviewOrderApplicationService { if (i.getAreaSqm() != null) { db.setAreaSqm(i.getAreaSqm()); } + if (i.getSize() != null) { + db.setSize(i.getSize()); + } fillOperator(db); reviewMaterialDetailMapper.updateById(db); } @@ -288,7 +291,7 @@ public class ReviewOrderApplicationService { db.setReviewedQty(reviewed.subtract(qty)); db.setPendingReviewQty(pending.add(qty)); db.setCancelQty(cancel.add(qty)); - // 同步页面传入的重量/体积/面积 + // 同步页面传入的重量/体积/面积/尺寸 if (i.getNetWeightKg() != null) { db.setNetWeightKg(i.getNetWeightKg()); } @@ -301,6 +304,9 @@ public class ReviewOrderApplicationService { if (i.getAreaSqm() != null) { db.setAreaSqm(i.getAreaSqm()); } + if (i.getSize() != null) { + db.setSize(i.getSize()); + } fillOperator(db); reviewMaterialDetailMapper.updateById(db); } @@ -337,16 +343,16 @@ public class ReviewOrderApplicationService { // 与出库单「复核确认」一致:复核数量与拣货数量不一致时生成复核异常单(FHYC) genOutOrderAbnormalAfterReviewConfirm(reviewOrderId); // 校验:复核确认前,已复核数量必须等于计划数量 - List details = reviewOrderMapper.queryDetailByReviewOrderId(reviewOrderId); - if (!CollectionUtils.isEmpty(details)) { - for (ReviewMaterialDetailPO detail : details) { - BigDecimal reviewed = nz(detail.getReviewedQty()); - BigDecimal plan = nz(detail.getMaterialPlanQty()); - if (reviewed.compareTo(plan) != 0) { - throw new ServiceException("该物料已复核数量不等于计划数量"); - } - } - } +// List details = reviewOrderMapper.queryDetailByReviewOrderId(reviewOrderId); +// if (!CollectionUtils.isEmpty(details)) { +// for (ReviewMaterialDetailPO detail : details) { +// BigDecimal reviewed = nz(detail.getReviewedQty()); +// BigDecimal plan = nz(detail.getMaterialPlanQty()); +// if (reviewed.compareTo(plan) != 0) { +// throw new ServiceException("该物料已复核数量不等于计划数量"); +// } +// } +// } ReviewOrder order = reviewOrderMapper.selectById(reviewOrderId); if (order == null) { continue; @@ -751,8 +757,11 @@ public class ReviewOrderApplicationService { if (i.getAreaSqm() != null) { db.setAreaSqm(i.getAreaSqm()); } + if (i.getSize() != null) { + db.setSize(i.getSize()); + } if (qtyTouched || i.getNetWeightKg() != null || i.getGrossWeightKg() != null - || i.getVolumeCbm() != null || i.getAreaSqm() != null) { + || i.getVolumeCbm() != null || i.getAreaSqm() != null || i.getSize() != null) { fillOperator(db); reviewMaterialDetailMapper.updateById(db); } From 969d90fff51fae310a294f7e35040930f623d16c Mon Sep 17 00:00:00 2001 From: rcx <3084692334@qq.com> Date: Sat, 8 Aug 2026 15:08:01 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix(wms=20=E5=BA=93=E5=AD=98=E6=A8=A1?= =?UTF-8?q?=E5=9D=97):=20=E4=BF=AE=E5=A4=8D=E5=BA=93=E5=AD=98=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=90=84=E9=A1=B5=E7=AD=BE=E5=88=86=E7=BB=84=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E4=B8=8D=E7=AC=A6=E5=90=88=E9=9C=80=E6=B1=82=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. queryListByWl(物料查询):原按单物料分组会把同一物料跨仓库库存合并成一行,丢失仓库维度。子查询 partition by 增加 warehouse_id、join 增加 warehouse_id 关联、外层 GROUP BY 增加 warehouse_id,改为按"物料+仓库"汇总。 2. queryListByWlKw(物料/库位查询):GROUP BY 增加 shipper_id,改为按"货主+库位+物料"汇总,避免不同货主在同库位同物料的库存被错误合并。 3. queryListByHz(按货主查询):GROUP BY 增加 warehouse_id,改为按"货主+仓库"汇总;hzwl 分支改走 queryListByHz,符合"按货主查询:货主+仓库"需求。 --- ...nventoryAdjustmentRecordDomainService.java | 6 +-- .../persistence/MaterialInventoryImpl.java | 3 +- .../MaterialInventoryMapper.xml | 50 +++++++++---------- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java index 51ad599be..482c92cfc 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java @@ -3,7 +3,7 @@ package com.mhd.wms.domain.inventoryAdjustmentRecord.service; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson2.JSONObject; -import com.aliyun.oss.ServiceException; +import com.mhd.common.core.exception.ServiceException; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.mhd.common.core.constant.SnowFlakeConstants; import com.mhd.common.core.domain.po.UserPo; @@ -175,7 +175,7 @@ public class InventoryAdjustmentRecordDomainService { } materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity())); if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) { - throw new ServiceException("可用数量调整之后不能小于0"); + throw new ServiceException("调整之后可用数量不能小于0"); } } inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); @@ -231,7 +231,7 @@ public class InventoryAdjustmentRecordDomainService { } materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity())); if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) { - throw new ServiceException("可用数量调整之后不能小于0"); + throw new ServiceException("调整之后可用数量不能小于0"); } inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity()); inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity()); diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java index a536436ce..ee83c4cd7 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java @@ -78,7 +78,8 @@ public class MaterialInventoryImpl extends ServiceImpl - GROUP BY a.MATERIAL_BASE_INFO_ID,a.WAREHOUSE_ID,a.STORAGE_SECTION_ID,a.STORAGE_LOCATION_ID order by sort_order, a.update_time desc + GROUP BY a.SHIPPER_ID,a.MATERIAL_BASE_INFO_ID,a.WAREHOUSE_ID,a.STORAGE_SECTION_ID,a.STORAGE_LOCATION_ID order by sort_order, a.update_time desc @@ -534,7 +534,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.shipper_id, MAX(a.shipper_code) AS shipper_code, MAX(a.shipper_name) AS shipper_name, - b.material_base_info_id, + MAX(b.material_base_info_id) AS material_base_info_id, MAX(b.material_code) AS material_code, MAX(b.material_name) AS material_name, MAX(b.SPECIFICATION_MODEL) AS SPECIFICATION_MODEL, @@ -551,7 +551,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" MAX(b.pack_id) AS pack_id, MAX(b.pack_code) AS pack_code, MAX(b.pack_name) AS pack_name, - MAX(a.unit) AS unit, + MAX(a.unit) AS unit, IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity, IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity, IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity, @@ -580,7 +580,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY a.shipper_id, - b.material_base_info_id, + b.material_code, a.warehouse_id, a.organization_id, a.top_organization_id ORDER BY sort_order, MAX(a.update_time) DESC @@ -596,7 +596,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - GROUP BY a.SHIPPER_ID order by sort_order, a.update_time desc + GROUP BY a.SHIPPER_ID, a.WAREHOUSE_ID order by sort_order, a.update_time desc From 64bb96c97cef0edf191b3f9ce0ec1fbd5f900d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Mon, 10 Aug 2026 17:36:04 +0800 Subject: [PATCH 6/7] =?UTF-8?q?BI=E6=9C=88=E5=8F=B0=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/BiPlatformRealDataMapper.java | 34 +++++++ .../repository/po/RealPlatformOverviewPO.java | 18 ++++ .../repository/po/RealPlatformVehiclePO.java | 30 ++++++ .../repository/po/RealTaskLoadPO.java | 18 ++++ .../repository/po/RealVehicleStatusPO.java | 24 +++++ .../service/BiPlatformRealDataService.java | 92 ++++++++++++++++++ .../service/BiReportSnapshotSyncService.java | 93 ++++++++++++++++++- .../BiPlatformRealDataMapper.xml | 85 +++++++++++++++++ 8 files changed, 392 insertions(+), 2 deletions(-) create mode 100644 mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/mapper/BiPlatformRealDataMapper.java create mode 100644 mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformOverviewPO.java create mode 100644 mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformVehiclePO.java create mode 100644 mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealTaskLoadPO.java create mode 100644 mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealVehicleStatusPO.java create mode 100644 mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java create mode 100644 mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/mapper/BiPlatformRealDataMapper.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/mapper/BiPlatformRealDataMapper.java new file mode 100644 index 000000000..9fa3ed755 --- /dev/null +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/mapper/BiPlatformRealDataMapper.java @@ -0,0 +1,34 @@ +package com.mhd.bi.domain.biPlatformRealData.repository.mapper; + +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO; + +import java.util.List; + +/** + * 月台监测-真实数据 Mapper + * 数据来源:TEST_NGWL_YMS 库(达梦,跨库访问) + * 注:列名按达梦默认大写规则;若实际库中小写请反馈调整 + */ +public interface BiPlatformRealDataMapper { + + /** 作业车辆状态列表 */ + List queryVehicles(); + + /** 月台实时概览(总数 / 当前作业中) */ + RealPlatformOverviewPO queryPlatformOverview(); + + /** 今日作业任务数 */ + Long countTodayTasks(); + + /** 车辆状态统计(今日) */ + RealVehicleStatusPO queryVehicleStatusToday(); + + /** 本月任务量 */ + Long countMonthTasks(); + + /** 任务负荷(今日 24 小时) */ + List queryTaskLoadToday(); +} \ No newline at end of file diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformOverviewPO.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformOverviewPO.java new file mode 100644 index 000000000..bc1948549 --- /dev/null +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformOverviewPO.java @@ -0,0 +1,18 @@ +package com.mhd.bi.domain.biPlatformRealData.repository.po; + +import lombok.Data; +import java.io.Serializable; + +/** + * 月台实时概览(真实数据,来自 TEST_NGWL_YMS.QMS_WINDOW_INFO) + */ +@Data +public class RealPlatformOverviewPO implements Serializable { + private static final long serialVersionUID = 1L; + + /** 月台总数 */ + private Long totalPlatforms; + + /** 当前作业中(月台作业状态=占用) */ + private Long operatingPlatforms; +} \ No newline at end of file diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformVehiclePO.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformVehiclePO.java new file mode 100644 index 000000000..71112888b --- /dev/null +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealPlatformVehiclePO.java @@ -0,0 +1,30 @@ +package com.mhd.bi.domain.biPlatformRealData.repository.po; + +import lombok.Data; +import java.io.Serializable; + +/** + * 月台监测-作业车辆(真实数据,来自 TEST_NGWL_YMS.QMS_MAIN_BUSINESS 等) + */ +@Data +public class RealPlatformVehiclePO implements Serializable { + private static final long serialVersionUID = 1L; + + /** 车牌号(qms_main_business.CARNO) */ + private String plateNumber; + + /** 流程状态(qms_main_business.FLOWSTATUS) */ + private String status; + + /** 叫号月台(qms_queue_list.WINDOWNAME) */ + private String platformId; + + /** 月台作业时长,分钟(EXITTIME - ENTRYTIME) */ + private Long platformDuration; + + /** 预约申请时间(qms_main_business.CREATE_TIME) */ + private String appointmentTime; + + /** 作业楼层(qms_window_info.PLATFORMFLOOR) */ + private String workFloor; +} \ No newline at end of file diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealTaskLoadPO.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealTaskLoadPO.java new file mode 100644 index 000000000..d9c70f669 --- /dev/null +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealTaskLoadPO.java @@ -0,0 +1,18 @@ +package com.mhd.bi.domain.biPlatformRealData.repository.po; + +import lombok.Data; +import java.io.Serializable; + +/** + * 任务负荷统计(按小时,来自 TEST_NGWL_YMS.QMS_MAIN_BUSINESS) + */ +@Data +public class RealTaskLoadPO implements Serializable { + private static final long serialVersionUID = 1L; + + /** 0-23 小时 */ + private Integer hourOfDay; + + /** 该小时段任务数 */ + private Long taskCount; +} \ No newline at end of file diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealVehicleStatusPO.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealVehicleStatusPO.java new file mode 100644 index 000000000..7f2f782a7 --- /dev/null +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/repository/po/RealVehicleStatusPO.java @@ -0,0 +1,24 @@ +package com.mhd.bi.domain.biPlatformRealData.repository.po; + +import lombok.Data; +import java.io.Serializable; + +/** + * 作业车辆状态统计(真实数据,来自 TEST_NGWL_YMS.QMS_MAIN_BUSINESS) + */ +@Data +public class RealVehicleStatusPO implements Serializable { + private static final long serialVersionUID = 1L; + + /** 今日预约车辆 */ + private Long todayReservedVehicles; + + /** 当前未签到 */ + private Long notCheckedIn; + + /** 当前作业中 */ + private Long operatingVehicles; + + /** 作业完成 */ + private Long completedVehicles; +} \ No newline at end of file diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java new file mode 100644 index 000000000..0069c653f --- /dev/null +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java @@ -0,0 +1,92 @@ +package com.mhd.bi.domain.biPlatformRealData.service; + +import com.mhd.bi.domain.biPlatformRealData.repository.mapper.BiPlatformRealDataMapper; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 月台监测-真实数据业务层(封装 YMS 跨库查询) + * 注:列名大小写、字段类型需以实际库为准;若 YMS 库无数据/无权限,相关方法应返回空/0,不影响写死字段写入快照 + */ +@Service +public class BiPlatformRealDataService { + + @Resource + private BiPlatformRealDataMapper biPlatformRealDataMapper; + + public List queryVehicles() { + try { + return biPlatformRealDataMapper.queryVehicles(); + } catch (Exception e) { + return java.util.Collections.emptyList(); + } + } + + public RealPlatformOverviewPO queryPlatformOverview() { + try { + RealPlatformOverviewPO po = biPlatformRealDataMapper.queryPlatformOverview(); + if (po == null) { + po = new RealPlatformOverviewPO(); + } + if (po.getTotalPlatforms() == null) po.setTotalPlatforms(0L); + if (po.getOperatingPlatforms() == null) po.setOperatingPlatforms(0L); + return po; + } catch (Exception e) { + RealPlatformOverviewPO po = new RealPlatformOverviewPO(); + po.setTotalPlatforms(0L); + po.setOperatingPlatforms(0L); + return po; + } + } + + public long countTodayTasks() { + try { + Long n = biPlatformRealDataMapper.countTodayTasks(); + return n == null ? 0L : n; + } catch (Exception e) { + return 0L; + } + } + + public RealVehicleStatusPO queryVehicleStatusToday() { + try { + RealVehicleStatusPO po = biPlatformRealDataMapper.queryVehicleStatusToday(); + if (po == null) po = new RealVehicleStatusPO(); + if (po.getTodayReservedVehicles() == null) po.setTodayReservedVehicles(0L); + if (po.getNotCheckedIn() == null) po.setNotCheckedIn(0L); + if (po.getOperatingVehicles() == null) po.setOperatingVehicles(0L); + if (po.getCompletedVehicles() == null) po.setCompletedVehicles(0L); + return po; + } catch (Exception e) { + RealVehicleStatusPO po = new RealVehicleStatusPO(); + po.setTodayReservedVehicles(0L); + po.setNotCheckedIn(0L); + po.setOperatingVehicles(0L); + po.setCompletedVehicles(0L); + return po; + } + } + + public long countMonthTasks() { + try { + Long n = biPlatformRealDataMapper.countMonthTasks(); + return n == null ? 0L : n; + } catch (Exception e) { + return 0L; + } + } + + public List queryTaskLoadToday() { + try { + return biPlatformRealDataMapper.queryTaskLoadToday(); + } catch (Exception e) { + return java.util.Collections.emptyList(); + } + } +} \ No newline at end of file diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java index 2f42acdf8..ea997db21 100644 --- a/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biSnapshotSync/service/BiReportSnapshotSyncService.java @@ -13,10 +13,20 @@ import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformSurveillance import com.mhd.bi.interfaces.facadeApi.biReport.vo.hkMacaoZone.HkMacaoServiceZoneVO; import com.mhd.bi.interfaces.facadeApi.biReport.vo.transportZone.TransportOperationZoneVO; import com.mhd.bi.interfaces.facadeApi.biReport.vo.warehouseZone.WarehouseOperationZoneVO; +import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformVehicleItemVO; +import com.mhd.bi.domain.biPlatformRealData.service.BiPlatformRealDataService; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO; +import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.HashMap; import java.util.Random; /** @@ -34,6 +44,7 @@ public class BiReportSnapshotSyncService { private final BiSnapshotWriteMapper biSnapshotWriteMapper; private final ObjectMapper objectMapper; + private final BiPlatformRealDataService biPlatformRealDataService; /** * 依次同步各快照表;单表失败不影响其它表,只记日志。 @@ -137,9 +148,87 @@ public class BiReportSnapshotSyncService { return BiSnapshotWeeklyRandomDataBuilder.warehouseTransport(new Random()); } - /** TODO 业务落地:改为查询真实数据。临时实现见 {@link BiSnapshotWeeklyRandomDataBuilder#platformSurveillance(Random)}。 */ + /** TODO 业务落地:部分字段改为真实数据,其余仍写死。 */ protected PlatformSurveillanceVO buildPlatformSurveillanceSnapshot() { - return BiSnapshotWeeklyRandomDataBuilder.platformSurveillance(new Random()); + Random r = new Random(); + // 写死数据复用原 builder + PlatformSurveillanceVO template = BiSnapshotWeeklyRandomDataBuilder.platformSurveillance(r); + + // ====== 真实数据:作业车辆列表 ====== + List realVehicles = biPlatformRealDataService.queryVehicles(); + List vehicleVos = new ArrayList<>(); + for (RealPlatformVehiclePO rv : realVehicles) { + PlatformVehicleItemVO v = new PlatformVehicleItemVO(); + v.setAppointmentTime(rv.getAppointmentTime()); + v.setWorkFloor(rv.getWorkFloor()); + v.setPlateNumber(rv.getPlateNumber()); + v.setStatus(rv.getStatus()); + v.setPlatformId(rv.getPlatformId()); + v.setPlatformDuration(rv.getPlatformDuration() == null ? 0 : rv.getPlatformDuration().intValue()); + vehicleVos.add(v); + } + if (!vehicleVos.isEmpty()) { + template.setVehicles(vehicleVos); + } + + // ====== 真实数据:月台实时概览 ====== + RealPlatformOverviewPO ov = biPlatformRealDataService.queryPlatformOverview(); + if (template.getPlatformOverview() != null) { + template.getPlatformOverview().setTotalPlatforms(ov.getTotalPlatforms().intValue()); + template.getPlatformOverview().setOperatingPlatforms(ov.getOperatingPlatforms().intValue()); + int total = ov.getTotalPlatforms().intValue(); + int occ = ov.getOperatingPlatforms().intValue(); + int rate = total > 0 ? (int) Math.round(((double) occ / total) * 100.0) : 0; + template.getPlatformOverview().setCurrentOccupancyRate(rate); + } + long todayTasks = biPlatformRealDataService.countTodayTasks(); + if (template.getPlatformOverview() != null) { + template.getPlatformOverview().setTodayTasks((int) todayTasks); + } + + // ====== 真实数据:作业车辆状态统计 ====== + RealVehicleStatusPO vs = biPlatformRealDataService.queryVehicleStatusToday(); + if (template.getVehicleStatus() != null) { + template.getVehicleStatus().setTodayReservedVehicles(vs.getTodayReservedVehicles().intValue()); + template.getVehicleStatus().setNotCheckedIn(vs.getNotCheckedIn().intValue()); + template.getVehicleStatus().setOperatingVehicles(vs.getOperatingVehicles().intValue()); + template.getVehicleStatus().setCompletedVehicles(vs.getCompletedVehicles().intValue()); + } + + // ====== 真实数据:本月任务统计 taskTotal ====== + long monthTasks = biPlatformRealDataService.countMonthTasks(); + if (template.getMonthlyTaskStatistics() != null) { + template.getMonthlyTaskStatistics().setTaskTotal((int) monthTasks); + } + + // ====== 真实数据:任务负荷(今日 24 小时) ====== + List loads = biPlatformRealDataService.queryTaskLoadToday(); + if (!loads.isEmpty() && template.getTaskLoadStatistics() != null) { + Map hourMap = new HashMap<>(); + for (RealTaskLoadPO l : loads) { + hourMap.put(l.getHourOfDay(), l.getTaskCount()); + } + for (com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.TaskLoadItemVO item : template.getTaskLoadStatistics()) { + Integer hour = parseHourFromLabel(item.getTime()); + if (hour != null) { + Long n = hourMap.get(hour); + if (n != null) item.setTaskCount(n.intValue()); + } + } + } + + return template; + } + + private static Integer parseHourFromLabel(String label) { + if (label == null) return null; + // "15时" -> 15 + try { + String s = label.replace("时", "").trim(); + return Integer.parseInt(s); + } catch (Exception e) { + return null; + } } /** diff --git a/mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml b/mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml new file mode 100644 index 000000000..e4dbeba6a --- /dev/null +++ b/mhd-bi/src/main/resources/mapper/biPlatformRealData/BiPlatformRealDataMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From d4f660bc7eecf39a4a603dd63cf00ddccff0cd77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Mon, 10 Aug 2026 17:59:59 +0800 Subject: [PATCH 7/7] =?UTF-8?q?BI=E6=9C=88=E5=8F=B0=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BiPlatformRealDataService.java | 92 +++++++++++++++++++ .../facadeApi/biReport/BiReportApi.java | 10 +- 2 files changed, 99 insertions(+), 3 deletions(-) diff --git a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java index 0069c653f..da9fba312 100644 --- a/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java +++ b/mhd-bi/src/main/java/com/mhd/bi/domain/biPlatformRealData/service/BiPlatformRealDataService.java @@ -5,10 +5,18 @@ import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO; import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO; import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO; import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO; +import com.mhd.bi.domain.biSnapshotSync.support.BiSnapshotWeeklyRandomDataBuilder; +import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformSurveillanceVO; +import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformVehicleItemVO; +import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.TaskLoadItemVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Random; /** * 月台监测-真实数据业务层(封装 YMS 跨库查询) @@ -89,4 +97,88 @@ public class BiPlatformRealDataService { return java.util.Collections.emptyList(); } } + + /** + * 实时组装月台监测数据:真实字段查 YMS 库,写死字段保留静态值。 + * 每次调用实时查库,不经过快照表。 + */ + public PlatformSurveillanceVO buildRealTimePlatformSurveillance() { + Random r = new Random(); + PlatformSurveillanceVO template = BiSnapshotWeeklyRandomDataBuilder.platformSurveillance(r); + + // 作业车辆列表 + List realVehicles = queryVehicles(); + List vehicleVos = new ArrayList<>(); + for (RealPlatformVehiclePO rv : realVehicles) { + PlatformVehicleItemVO v = new PlatformVehicleItemVO(); + v.setAppointmentTime(rv.getAppointmentTime()); + v.setWorkFloor(rv.getWorkFloor()); + v.setPlateNumber(rv.getPlateNumber()); + v.setStatus(rv.getStatus()); + v.setPlatformId(rv.getPlatformId()); + v.setPlatformDuration(rv.getPlatformDuration() == null ? 0 : rv.getPlatformDuration().intValue()); + vehicleVos.add(v); + } + if (!vehicleVos.isEmpty()) { + template.setVehicles(vehicleVos); + } + + // 月台实时概览 + RealPlatformOverviewPO ov = queryPlatformOverview(); + if (template.getPlatformOverview() != null) { + template.getPlatformOverview().setTotalPlatforms(ov.getTotalPlatforms().intValue()); + template.getPlatformOverview().setOperatingPlatforms(ov.getOperatingPlatforms().intValue()); + int total = ov.getTotalPlatforms().intValue(); + int occ = ov.getOperatingPlatforms().intValue(); + int rate = total > 0 ? (int) Math.round(((double) occ / total) * 100.0) : 0; + template.getPlatformOverview().setCurrentOccupancyRate(rate); + } + long todayTasks = countTodayTasks(); + if (template.getPlatformOverview() != null) { + template.getPlatformOverview().setTodayTasks((int) todayTasks); + } + + // 作业车辆状态统计 + RealVehicleStatusPO vs = queryVehicleStatusToday(); + if (template.getVehicleStatus() != null) { + template.getVehicleStatus().setTodayReservedVehicles(vs.getTodayReservedVehicles().intValue()); + template.getVehicleStatus().setNotCheckedIn(vs.getNotCheckedIn().intValue()); + template.getVehicleStatus().setOperatingVehicles(vs.getOperatingVehicles().intValue()); + template.getVehicleStatus().setCompletedVehicles(vs.getCompletedVehicles().intValue()); + } + + // 本月任务统计 taskTotal + long monthTasks = countMonthTasks(); + if (template.getMonthlyTaskStatistics() != null) { + template.getMonthlyTaskStatistics().setTaskTotal((int) monthTasks); + } + + // 任务负荷(今日 24 小时) + List loads = queryTaskLoadToday(); + if (!loads.isEmpty() && template.getTaskLoadStatistics() != null) { + Map hourMap = new HashMap<>(); + for (RealTaskLoadPO l : loads) { + hourMap.put(l.getHourOfDay(), l.getTaskCount()); + } + for (TaskLoadItemVO item : template.getTaskLoadStatistics()) { + Integer hour = parseHourFromLabel(item.getTime()); + if (hour != null) { + Long n = hourMap.get(hour); + if (n != null) item.setTaskCount(n.intValue()); + } + } + } + + return template; + } + + private static Integer parseHourFromLabel(String label) { + if (label == null) return null; + try { + String s = label.replace("时", "").trim(); + return Integer.parseInt(s); + } catch (Exception e) { + return null; + } + } } \ No newline at end of file diff --git a/mhd-bi/src/main/java/com/mhd/bi/interfaces/facadeApi/biReport/BiReportApi.java b/mhd-bi/src/main/java/com/mhd/bi/interfaces/facadeApi/biReport/BiReportApi.java index 6d6156940..4aa56c70f 100644 --- a/mhd-bi/src/main/java/com/mhd/bi/interfaces/facadeApi/biReport/BiReportApi.java +++ b/mhd-bi/src/main/java/com/mhd/bi/interfaces/facadeApi/biReport/BiReportApi.java @@ -3,6 +3,7 @@ package com.mhd.bi.interfaces.facadeApi.biReport; import com.mhd.bi.domain.biSnapshotSync.service.BiReportSnapshotSyncService; import com.mhd.bi.domain.biComprehensive.service.BiComprehensiveReportService; import com.mhd.bi.domain.biPlatformSurveillance.service.BiPlatformSurveillanceReportService; +import com.mhd.bi.domain.biPlatformRealData.service.BiPlatformRealDataService; import com.mhd.bi.domain.biOverallOperation.service.BiOverallOperationReportService; import com.mhd.bi.domain.biHkMacaoServiceZone.service.BiHkMacaoServiceZoneReportService; import com.mhd.bi.domain.biTransportOperationZone.service.BiTransportOperationZoneReportService; @@ -48,6 +49,9 @@ public class BiReportApi extends BaseController { @Autowired private BiPlatformSurveillanceReportService biPlatformSurveillanceReportService; + @Autowired + private BiPlatformRealDataService biPlatformRealDataService; + @Autowired private BiOverallOperationReportService biOverallOperationReportService; @@ -92,12 +96,12 @@ public class BiReportApi extends BaseController { } /** - * 月台监测指标查询(按照 del_flag=1,按 create_time 最新一条) + * 月台监测指标查询(实时查 YMS 库,真实字段 + 写死字段) */ - @ApiOperation(value = "月台监测指标查询", notes = "返回 DEL_FLAG=1 且 CREATE_TIME 最新的一条快照") + @ApiOperation(value = "月台监测指标查询", notes = "每次调用实时查询 YMS 库组装;部分字段为真实业务数据,部分为写死数据") @GetMapping("/platformSurveillance") public BiApiResult platformSurveillance() { - PlatformSurveillanceVO data = biPlatformSurveillanceReportService.loadLatestPlatformSurveillance(); + PlatformSurveillanceVO data = biPlatformRealDataService.buildRealTimePlatformSurveillance(); return BiApiResult.ok(data); } //园区物流大屏接口----------------------------------------------------------------------