From 1164b9c9ea7e4c58cc872394649aebf012c45bdd Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Mon, 28 Aug 2023 17:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B0=E7=AB=99=E8=BF=90=E8=A1=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=9F=A5=E8=AF=A2=E6=9C=89=E6=95=88=E7=8E=87=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B0=E5=A2=9Eused=E8=BF=94=E5=9B=9E=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/CalculateDataRateThread.java | 1 + .../modules/mapper/CalCulStationInfoMapper.java | 4 ++++ .../modules/mapper/xml/calCulStationInfoMapper.xml | 4 ++++ .../modules/service/ICalCulStationDataService.java | 2 ++ .../service/impl/CalCulStationInfoServiceImpl.java | 14 ++++++++++++++ 5 files changed, 25 insertions(+) diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateDataRateThread.java b/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateDataRateThread.java index 662fae54..e831dd38 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateDataRateThread.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/common/CalculateDataRateThread.java @@ -61,6 +61,7 @@ public class CalculateDataRateThread implements Runnable{ calculateDataRate.setParameter(mRateparam); //根据台站编码 查询 台站信息 StationInfo stationInfo = calCulStationDataService.getStationInfo(originalstationsinfo.getStationCode()); + stationInfo.setUsed(calCulStationDataService.getUsed(Integer.valueOf(stationInfo.getId()))); //赋值台站信息 calculateDataRate.setMStationId(stationInfo.getId()); calculateDataRate.setMStationCode(stationInfo.getStationCode()); diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/CalCulStationInfoMapper.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/CalCulStationInfoMapper.java index 508da7b0..cf730183 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/CalCulStationInfoMapper.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/CalCulStationInfoMapper.java @@ -4,6 +4,8 @@ import org.apache.ibatis.annotations.Param; import org.jeecg.modules.entity.data.ProvisionData; import org.jeecg.modules.entity.data.StationInfo; +import java.util.List; + public interface CalCulStationInfoMapper { StationInfo getStationInfo(@Param("stationCode") String stationCode); @@ -62,4 +64,6 @@ public interface CalCulStationInfoMapper { ProvisionData findSphdMetSohProvisionParticulate(@Param("SPHD_NUM") String SPHD_NUM, @Param("MET_NUM") String MET_NUM, @Param("curDateTime") String curDateTime, @Param("pretime") String pretime, @Param("sphdMetSoh") String sphdMetSoh, @Param("stationId") String stationId); + List getUsed(Integer stationId); + } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/calCulStationInfoMapper.xml b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/calCulStationInfoMapper.xml index 678504e9..52081c98 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/calCulStationInfoMapper.xml +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/mapper/xml/calCulStationInfoMapper.xml @@ -395,4 +395,8 @@ + + \ No newline at end of file diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/ICalCulStationDataService.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/ICalCulStationDataService.java index b00184da..ac504a1f 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/ICalCulStationDataService.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/ICalCulStationDataService.java @@ -61,4 +61,6 @@ public interface ICalCulStationDataService { ProvisionData findSphdMetSohProvisionParticulate(String SPHD_NUM, String MET_NUM, String curDateTime, String pretime, String sphdMetSoh,String stationId); + String getUsed(Integer stationId); + } diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/CalCulStationInfoServiceImpl.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/CalCulStationInfoServiceImpl.java index 2db7a7da..cdade4d4 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/CalCulStationInfoServiceImpl.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/CalCulStationInfoServiceImpl.java @@ -1,12 +1,18 @@ package org.jeecg.modules.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import org.jeecg.modules.entity.data.ProvisionData; import org.jeecg.modules.entity.data.StationInfo; import org.jeecg.modules.mapper.CalCulStationInfoMapper; import org.jeecg.modules.service.ICalCulStationDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Objects; @Service("calCulStationDataService") @DS("ora") @@ -440,5 +446,13 @@ public class CalCulStationInfoServiceImpl implements ICalCulStationDataService { return sphdMetSohProvision; } + @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) + public String getUsed(Integer stationId){ + List detectorIds = calCulStationInfoMapper.getUsed(stationId); + String result = CollectionUtils.isNotEmpty(detectorIds) ? "YES" : "NO"; + return result; + } + }