From 7a4f9541331bef779a506b38a27ed5c3373c0bec Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 15 五月 2025 13:53:22 +0800 Subject: [PATCH] 开发二级等保功能及心跳消息队列修改 --- ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/BmsDemandAndChargerExportationServiceImpl.java | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/BmsDemandAndChargerExportationServiceImpl.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/BmsDemandAndChargerExportationServiceImpl.java index 534185b..fb6f731 100644 --- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/BmsDemandAndChargerExportationServiceImpl.java +++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/mongodb/service/impl/BmsDemandAndChargerExportationServiceImpl.java @@ -1,10 +1,14 @@ package com.ruoyi.integration.mongodb.service.impl; +import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.integration.iotda.constant.IotConstant; -import com.ruoyi.integration.mongodb.model.BmsDemandAndChargerExportation; +import com.ruoyi.integration.api.model.BmsDemandAndChargerExportation; import com.ruoyi.integration.mongodb.service.BmsDemandAndChargerExportationService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.data.mongodb.core.query.Criteria; +import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Service; import java.util.List; @@ -28,4 +32,17 @@ public List<BmsDemandAndChargerExportation> findAll() { return mongoTemplate.findAll(BmsDemandAndChargerExportation.class); } + + + @Override + public List<BmsDemandAndChargerExportation> getBmsDemandAndChargerExportation(String orderCode) { + Query query = new Query(); + if(StringUtils.isNotEmpty(orderCode)){ + query.addCriteria(Criteria.where("transaction_serial_number").is(orderCode)); + } + List<BmsDemandAndChargerExportation> uploadRealTimeMonitoringData = mongoTemplate.find( + query.with(Sort.by(Sort.Order.desc("create_time"))) + , BmsDemandAndChargerExportation.class); + return uploadRealTimeMonitoringData; + } } -- Gitblit v1.7.1