diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java index 309d3694..164ebabf 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/FTPUtil.java @@ -55,6 +55,10 @@ public class FTPUtil { return this.encoding; } + public String getFtpRootPath() { + return this.ftpRootPath; + } + /** * 登录ftp * @return @@ -88,7 +92,7 @@ public class FTPUtil { ServletOutputStream out = null; FTPClient ftpClient = this.LoginFTP(); if (Objects.isNull(ftpClient)){ - throw new RuntimeException("ftp连接失败!"); + throw new RuntimeException("ftp connection failed!"); } //传输模式 try { diff --git a/jeecg-module-log-manage/src/main/java/org/jeecg/modules/service/impl/LogManageServiceImpl.java b/jeecg-module-log-manage/src/main/java/org/jeecg/modules/service/impl/LogManageServiceImpl.java index bd824cd0..3138b956 100644 --- a/jeecg-module-log-manage/src/main/java/org/jeecg/modules/service/impl/LogManageServiceImpl.java +++ b/jeecg-module-log-manage/src/main/java/org/jeecg/modules/service/impl/LogManageServiceImpl.java @@ -26,7 +26,7 @@ public class LogManageServiceImpl implements ILogManageService { List result = new ArrayList<>(); FTPClient ftpClient = ftpUtil.LoginFTP(); if(Objects.isNull(ftpClient)){ - throw new RuntimeException("ftp连接失败!"); + throw new RuntimeException("ftp connection failed!"); } try { //切换被动模式 @@ -36,6 +36,7 @@ public class LogManageServiceImpl implements ILogManageService { ftpClient.setControlEncoding("UTF-8"); ftpClient.setFileTransferMode(FTPClient.STREAM_TRANSFER_MODE); //切换工作文件路径 + workPath = ftpUtil.getFtpRootPath()+StringPool.SLASH+workPath; ftpClient.changeWorkingDirectory(workPath); List ftpFiles = Arrays.asList(ftpClient.listDirectories()); if (CollectionUtils.isNotEmpty(ftpFiles)){ @@ -79,7 +80,7 @@ public class LogManageServiceImpl implements ILogManageService { List result = new ArrayList<>(); FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)){ - throw new RuntimeException("ftp连接失败!"); + throw new RuntimeException("ftp connection failed!"); } try { //切换被动模式 diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index 963a99a9..53ecda17 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -3512,14 +3512,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi // 获取自动处理生成的报告地址 String reportPath = spectrumAnalysisMapper.viewARR(sampleId); if (StringUtils.isBlank(reportPath)) { - throw new RuntimeException("自动处理程序生成报告不存在!"); + throw new RuntimeException("The automatic handler generated report does not exist!"); } String pathName = StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH)); String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt"; // 连接ftp FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)) { - throw new RuntimeException("ftp连接失败"); + throw new RuntimeException("ftp connection failed"); } InputStream inputStream = null; ServletOutputStream outputStream = null; @@ -3569,7 +3569,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi // 连接ftp FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)) { - throw new RuntimeException("ftp连接失败"); + throw new RuntimeException("ftp connection failed"); } InputStream inputStream = null; ServletOutputStream outputStream = null; @@ -4100,14 +4100,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) { String logPath = spectrumAnalysisMapper.findAutomaticLogPath(sampleId); if (StringUtils.isBlank(logPath)) { - throw new RuntimeException("自动处理程序生成日志不存在!"); + throw new RuntimeException("The log generated by the automatic processor does not exist!"); } String pathName = StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH)); String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1); // 连接ftp FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)) { - throw new RuntimeException("ftp连接失败"); + throw new RuntimeException("ftp connection failed"); } InputStream inputStream = null; ServletOutputStream outputStream = null; @@ -4476,7 +4476,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi } String efficiency = NumberFormatUtil.numberFormat(String.valueOf(nuc.getEfficiency())); String activity = NumberFormatUtil.numberFormat(String.valueOf(nuc.getActivity())); - String actErr = NumberFormatUtil.numberFormat(String.valueOf(nuc.getAct_err() / nuc.getActivity() * 100)); + String actErr = ""; + if (nuc.getActivity() > 0) { + actErr = NumberFormatUtil.numberFormat(String.valueOf(nuc.getAct_err() / nuc.getActivity() * 100)); + } String mda = NumberFormatUtil.numberFormat(String.valueOf(nuc.getMda())); String conc = NumberFormatUtil.numberFormat(String.valueOf(nuc.getConcentration())); String mdc = NumberFormatUtil.numberFormat(String.valueOf(nuc.getMdc())); @@ -4603,7 +4606,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi double activityValue = nuclideActMda.getActivity(); String activity = NumberFormatUtil.numberFormat(String.valueOf(activityValue)); nuclideActMdaDto.setActivity(activity); - String actErr = NumberFormatUtil.numberFormat(String.valueOf(actErrValue / activityValue * 100)); + String actErr = ""; + if (activityValue > 0) { + actErr = NumberFormatUtil.numberFormat(String.valueOf(actErrValue / activityValue * 100)); + } nuclideActMdaDto.setActErr(actErr); String mda = NumberFormatUtil.numberFormat(String.valueOf(nuclideActMda.getMda())); nuclideActMdaDto.setMda(mda); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index 8648bae7..ee798f3f 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -183,6 +183,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } System.out.println(sbSql.toString()); List sampleData = Lists.newArrayList(); + long start = System.currentTimeMillis(); try (Connection connection = jdbcTemplate.getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement(sbSql.toString()); ResultSet resultSet = statement.executeQuery()) { @@ -202,6 +203,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } catch (SQLException e) { e.printStackTrace(); } + System.out.println(">>>>>>>>>>>>>"+(System.currentTimeMillis() - start)); // List sampleData = spectrumAnalysisMapper.getDBSearchList(dbName, stationTypes, userStations, AllUsers); //获取台站编码 List stationCodes = new LinkedList<>(); @@ -587,7 +589,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { Map map = new HashMap<>(); FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)){ - throw new RuntimeException("ftp连接失败"); + throw new RuntimeException("ftp connection failed"); } InputStream inputStream = null; File file = null; @@ -719,14 +721,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { //获取自动处理生成的报告地址 String reportPath = spectrumAnalysisMapper.viewARR(sampleId); if (StringUtils.isBlank(reportPath)){ - throw new RuntimeException("自动处理程序生成报告不存在!"); + throw new RuntimeException("The automatic handler generated report does not exist!"); } String pathName = StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH)); String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH)+1)+".txt"; //连接ftp FTPClient ftpClient = ftpUtil.LoginFTP(); if (Objects.isNull(ftpClient)){ - throw new RuntimeException("ftp连接失败"); + throw new RuntimeException("ftp connection failed"); } InputStream inputStream = null; ServletOutputStream outputStream = null; @@ -2855,8 +2857,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { Cache> cache = betaCache.getBetaCache(); Map cacheMap = new HashMap<>(); Map map = new HashMap<>(); - if ((CollectionUtils.isNotEmpty(tempPoints) && Objects.nonNull(count) && tempPoints.size() != count) || (Objects.isNull(paramA) || StringUtils.isBlank(String.valueOf(paramA))) - || (Objects.isNull(paramB) || StringUtils.isBlank(String.valueOf(paramB))) || (Objects.isNull(paramC) || StringUtils.isBlank(String.valueOf(paramC))) ){ + //tempPoint数组大小需要大于2个值 + if ((CollectionUtils.isNotEmpty(tempPoints) && tempPoints.size() > 2 && Objects.nonNull(count) && tempPoints.size() != count) + || (Objects.isNull(paramA) || StringUtils.isBlank(String.valueOf(paramA))) + || (Objects.isNull(paramB) || StringUtils.isBlank(String.valueOf(paramB))) + || (Objects.isNull(paramC) || StringUtils.isBlank(String.valueOf(paramC))) ){ List xs = new LinkedList<>(); List ys = new LinkedList<>(); for (int i=0; i { /** * 查询台站监测数据 * @param userId + * @param stationId * @return */ - Result getDataReceivingStatus(String userId); + Result getDataReceivingStatus(String userId, String oneStationId); /** * 获取台站数据的提供率及有效率 diff --git a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java index 7f76dba1..feb2fec6 100644 --- a/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java +++ b/jeecg-module-station-operation/src/main/java/org/jeecg/modules/service/impl/StationOperationServiceImpl.java @@ -251,16 +251,18 @@ public class StationOperationServiceImpl extends ServiceImpl stationDataMap = (Map) redisUtil.get("stationDataMap"); // //获取四项缓存数据的对应内容 @@ -401,18 +403,24 @@ public class StationOperationServiceImpl extends ServiceImpl userFocusStationQueryWrapper = new LambdaQueryWrapper<>(); - userFocusStationQueryWrapper.eq(SysUserFocusStationStation::getUserId, userId); - List userFocusStations = sysUserFocusStationMapper.selectList(userFocusStationQueryWrapper); - List stationIds = userFocusStations.stream().map(SysUserFocusStation::getStationId).collect(Collectors.toList()); //过滤出当前用户关注的台站信息 List stationDataList = new LinkedList<>(); - for (String stationId:stationIds) { - if (Objects.nonNull(stationDataMap.get(stationId))) { - stationDataList.add(stationDataMap.get(stationId)); + if (StringUtils.isNotBlank(oneStationId)) { + StationData stationData = stationDataMap.get(oneStationId); + stationDataList.add(stationData); + } else { + //根据用户id查询出当前用户关注的台站信息 + LambdaQueryWrapper userFocusStationQueryWrapper = new LambdaQueryWrapper<>(); + userFocusStationQueryWrapper.eq(SysUserFocusStationStation::getUserId, userId); + List userFocusStations = sysUserFocusStationMapper.selectList(userFocusStationQueryWrapper); + List stationIds = userFocusStations.stream().map(SysUserFocusStation::getStationId).collect(Collectors.toList()); + for (String stationId:stationIds) { + if (Objects.nonNull(stationDataMap.get(stationId))) { + stationDataList.add(stationDataMap.get(stationId)); + } } } + // //从redis中获取台站信息 // Map stationInfoMap = (Map)redisUtil.get("stationMap"); // //从redis中获取探测器信息 diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/common/util/ReadLineUtil.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/common/util/ReadLineUtil.java index 26a27197..88328c91 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/common/util/ReadLineUtil.java +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/common/util/ReadLineUtil.java @@ -41,7 +41,7 @@ public class ReadLineUtil { FTPClient ftpClient = ftpUtil.LoginFTP(); //判断ftp是否连接成功 if (Objects.isNull(ftpClient)){ - throw new RuntimeException("ftp连接失败!"); + throw new RuntimeException("ftp connection failed!"); } InputStream iStream = null; File file = null; diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java index bb112f96..a84c4edf 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/GardsSampleDataWebMapper.java @@ -15,4 +15,6 @@ public interface GardsSampleDataWebMapper extends BaseMapper Page findReviewedPage(String startDate, String endDate, List stationIdList, Page page); + Page findParticulatePage(String dataType, String spectralQualifie, String startDate, String endDate, List stationIdList, Page page); + } diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml index 1f3fcb63..ac6fd63e 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/mapper/xml/GardsSampleDataWebMapper.xml @@ -82,4 +82,48 @@ ORDER BY sam.ACQUISITION_START DESC + + \ No newline at end of file