中文提示信息修改为英文提示

台站运行管理查询台站监测数据信息增加新的参数
This commit is contained in:
qiaoqinzheng 2023-10-28 15:36:56 +08:00
parent 87fb378000
commit 00264c1056
8 changed files with 41 additions and 32 deletions

View File

@ -88,7 +88,7 @@ public class FTPUtil {
ServletOutputStream out = null; ServletOutputStream out = null;
FTPClient ftpClient = this.LoginFTP(); FTPClient ftpClient = this.LoginFTP();
if (Objects.isNull(ftpClient)){ if (Objects.isNull(ftpClient)){
throw new RuntimeException("ftp连接失败!"); throw new RuntimeException("ftp connection failed!");
} }
//传输模式 //传输模式
try { try {

View File

@ -26,7 +26,7 @@ public class LogManageServiceImpl implements ILogManageService {
List<LogManage> result = new ArrayList<>(); List<LogManage> result = new ArrayList<>();
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if(Objects.isNull(ftpClient)){ if(Objects.isNull(ftpClient)){
throw new RuntimeException("ftp连接失败!"); throw new RuntimeException("ftp connection failed!");
} }
try { try {
//切换被动模式 //切换被动模式
@ -79,7 +79,7 @@ public class LogManageServiceImpl implements ILogManageService {
List<FileInfo> result = new ArrayList<>(); List<FileInfo> result = new ArrayList<>();
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)){ if (Objects.isNull(ftpClient)){
throw new RuntimeException("ftp连接失败!"); throw new RuntimeException("ftp connection failed!");
} }
try { try {
//切换被动模式 //切换被动模式

View File

@ -3512,14 +3512,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
// 获取自动处理生成的报告地址 // 获取自动处理生成的报告地址
String reportPath = spectrumAnalysisMapper.viewARR(sampleId); String reportPath = spectrumAnalysisMapper.viewARR(sampleId);
if (StringUtils.isBlank(reportPath)) { 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 pathName = StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt"; String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH) + 1) + ".txt";
// 连接ftp // 连接ftp
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)) { if (Objects.isNull(ftpClient)) {
throw new RuntimeException("ftp连接失败"); throw new RuntimeException("ftp connection failed");
} }
InputStream inputStream = null; InputStream inputStream = null;
ServletOutputStream outputStream = null; ServletOutputStream outputStream = null;
@ -3569,7 +3569,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
// 连接ftp // 连接ftp
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)) { if (Objects.isNull(ftpClient)) {
throw new RuntimeException("ftp连接失败"); throw new RuntimeException("ftp connection failed");
} }
InputStream inputStream = null; InputStream inputStream = null;
ServletOutputStream outputStream = null; ServletOutputStream outputStream = null;
@ -4100,14 +4100,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) { public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) {
String logPath = spectrumAnalysisMapper.findAutomaticLogPath(sampleId); String logPath = spectrumAnalysisMapper.findAutomaticLogPath(sampleId);
if (StringUtils.isBlank(logPath)) { 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 pathName = StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH));
String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1); String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1);
// 连接ftp // 连接ftp
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)) { if (Objects.isNull(ftpClient)) {
throw new RuntimeException("ftp连接失败"); throw new RuntimeException("ftp connection failed");
} }
InputStream inputStream = null; InputStream inputStream = null;
ServletOutputStream outputStream = null; ServletOutputStream outputStream = null;

View File

@ -183,6 +183,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} }
System.out.println(sbSql.toString()); System.out.println(sbSql.toString());
List<GardsSampleDataSpectrum> sampleData = Lists.newArrayList(); List<GardsSampleDataSpectrum> sampleData = Lists.newArrayList();
long start = System.currentTimeMillis();
try (Connection connection = jdbcTemplate.getDataSource().getConnection(); try (Connection connection = jdbcTemplate.getDataSource().getConnection();
PreparedStatement statement = connection.prepareStatement(sbSql.toString()); PreparedStatement statement = connection.prepareStatement(sbSql.toString());
ResultSet resultSet = statement.executeQuery()) { ResultSet resultSet = statement.executeQuery()) {
@ -202,6 +203,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }
System.out.println(">>>>>>>>>>>>>"+(System.currentTimeMillis() - start));
// List<GardsSampleDataSpectrum> sampleData = spectrumAnalysisMapper.getDBSearchList(dbName, stationTypes, userStations, AllUsers); // List<GardsSampleDataSpectrum> sampleData = spectrumAnalysisMapper.getDBSearchList(dbName, stationTypes, userStations, AllUsers);
//获取台站编码 //获取台站编码
List<String> stationCodes = new LinkedList<>(); List<String> stationCodes = new LinkedList<>();
@ -587,7 +589,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)){ if (Objects.isNull(ftpClient)){
throw new RuntimeException("ftp连接失败"); throw new RuntimeException("ftp connection failed");
} }
InputStream inputStream = null; InputStream inputStream = null;
File file = null; File file = null;
@ -719,14 +721,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
//获取自动处理生成的报告地址 //获取自动处理生成的报告地址
String reportPath = spectrumAnalysisMapper.viewARR(sampleId); String reportPath = spectrumAnalysisMapper.viewARR(sampleId);
if (StringUtils.isBlank(reportPath)){ 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 pathName = StringPool.SLASH + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + reportPath.substring(0, reportPath.lastIndexOf(StringPool.SLASH));
String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH)+1)+".txt"; String fileName = reportPath.substring(reportPath.lastIndexOf(StringPool.SLASH)+1)+".txt";
//连接ftp //连接ftp
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)){ if (Objects.isNull(ftpClient)){
throw new RuntimeException("ftp连接失败"); throw new RuntimeException("ftp connection failed");
} }
InputStream inputStream = null; InputStream inputStream = null;
ServletOutputStream outputStream = null; ServletOutputStream outputStream = null;
@ -3869,14 +3871,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) { public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) {
String logPath = spectrumAnalysisMapper.findAutomaticLogPath(sampleId); String logPath = spectrumAnalysisMapper.findAutomaticLogPath(sampleId);
if (StringUtils.isBlank(logPath)){ 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 pathName = StringPool.SLASH + spectrumPathProperties.getLogPath() + StringPool.SLASH + logPath.substring(0, logPath.lastIndexOf(StringPool.SLASH));
String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1); String fileName = logPath.substring(logPath.lastIndexOf(StringPool.SLASH) + 1);
//连接ftp //连接ftp
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
if (Objects.isNull(ftpClient)){ if (Objects.isNull(ftpClient)){
throw new RuntimeException("ftp连接失败"); throw new RuntimeException("ftp connection failed");
} }
InputStream inputStream = null; InputStream inputStream = null;
ServletOutputStream outputStream = null; ServletOutputStream outputStream = null;
@ -4560,12 +4562,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
if (!CollUtil.contains(skip, line)) if (!CollUtil.contains(skip, line))
newLines.add(line); newLines.add(line);
} }
String export = "SaveToTxt.txt";
String export = "SaveToTxt.txt"; writer = ExportUtil.streamWriter(response, export);
writer = ExportUtil.streamWriter(response, export); for (String newLine : newLines) {
for (String newLine : newLines) { writer.println(newLine);
writer.println(newLine); }
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
}finally { }finally {

View File

@ -60,10 +60,11 @@ public class StationOperationController {
@GetMapping("getDataReceivingStatus") @GetMapping("getDataReceivingStatus")
@ApiOperation(value = "查询台站监测数据信息", notes = "查询台站监测数据信息") @ApiOperation(value = "查询台站监测数据信息", notes = "查询台站监测数据信息")
public Result getDataReceivingStatus(String userId){ public Result getDataReceivingStatus(String userId, String oneStationId){
return stationOperationService.getDataReceivingStatus(userId); return stationOperationService.getDataReceivingStatus(userId, oneStationId);
} }
@GetMapping("getDataProvisionEfficiency") @GetMapping("getDataProvisionEfficiency")
@ApiOperation(value = "查询台站数据提供率及有效率", notes = "查询台站数据提供率及有效率") @ApiOperation(value = "查询台站数据提供率及有效率", notes = "查询台站数据提供率及有效率")
public Result getDataProvisionEfficiency(){ public Result getDataProvisionEfficiency(){

View File

@ -46,9 +46,10 @@ public interface IStationOperationService extends IService<StationOperation> {
/** /**
* 查询台站监测数据 * 查询台站监测数据
* @param userId * @param userId
* @param stationId
* @return * @return
*/ */
Result getDataReceivingStatus(String userId); Result getDataReceivingStatus(String userId, String oneStationId);
/** /**
* 获取台站数据的提供率及有效率 * 获取台站数据的提供率及有效率

View File

@ -384,7 +384,7 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
} }
@Override @Override
public Result getDataReceivingStatus(String userId) { public Result getDataReceivingStatus(String userId, String oneStationId) {
Result result = new Result(); Result result = new Result();
Map<String, StationData> stationDataMap = (Map<String, StationData>) redisUtil.get("stationDataMap"); Map<String, StationData> stationDataMap = (Map<String, StationData>) redisUtil.get("stationDataMap");
// //获取四项缓存数据的对应内容 // //获取四项缓存数据的对应内容
@ -401,18 +401,24 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
// result.error500("The cache time cannot be empty"); // result.error500("The cache time cannot be empty");
// return result; // return result;
// } // }
//根据用户id查询出当前用户关注的台站信息
LambdaQueryWrapper<SysUserFocusStationStation> userFocusStationQueryWrapper = new LambdaQueryWrapper<>();
userFocusStationQueryWrapper.eq(SysUserFocusStationStation::getUserId, userId);
List<SysUserFocusStationStation> userFocusStations = sysUserFocusStationMapper.selectList(userFocusStationQueryWrapper);
List<String> stationIds = userFocusStations.stream().map(SysUserFocusStation::getStationId).collect(Collectors.toList());
//过滤出当前用户关注的台站信息 //过滤出当前用户关注的台站信息
List<StationData> stationDataList = new LinkedList<>(); List<StationData> stationDataList = new LinkedList<>();
for (String stationId:stationIds) { if (StringUtils.isNotBlank(oneStationId)) {
if (Objects.nonNull(stationDataMap.get(stationId))) { StationData stationData = stationDataMap.get(oneStationId);
stationDataList.add(stationDataMap.get(stationId)); stationDataList.add(stationData);
} else {
//根据用户id查询出当前用户关注的台站信息
LambdaQueryWrapper<SysUserFocusStationStation> userFocusStationQueryWrapper = new LambdaQueryWrapper<>();
userFocusStationQueryWrapper.eq(SysUserFocusStationStation::getUserId, userId);
List<SysUserFocusStationStation> userFocusStations = sysUserFocusStationMapper.selectList(userFocusStationQueryWrapper);
List<String> 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中获取台站信息 // //从redis中获取台站信息
// Map<Integer, String> stationInfoMap = (Map<Integer, String>)redisUtil.get("stationMap"); // Map<Integer, String> stationInfoMap = (Map<Integer, String>)redisUtil.get("stationMap");
// //从redis中获取探测器信息 // //从redis中获取探测器信息

View File

@ -41,7 +41,7 @@ public class ReadLineUtil {
FTPClient ftpClient = ftpUtil.LoginFTP(); FTPClient ftpClient = ftpUtil.LoginFTP();
//判断ftp是否连接成功 //判断ftp是否连接成功
if (Objects.isNull(ftpClient)){ if (Objects.isNull(ftpClient)){
throw new RuntimeException("ftp连接失败!"); throw new RuntimeException("ftp connection failed!");
} }
InputStream iStream = null; InputStream iStream = null;
File file = null; File file = null;