中文提示信息修改为英文提示
台站运行管理查询台站监测数据信息增加新的参数
This commit is contained in:
parent
87fb378000
commit
00264c1056
|
@ -88,7 +88,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 {
|
||||
|
|
|
@ -26,7 +26,7 @@ public class LogManageServiceImpl implements ILogManageService {
|
|||
List<LogManage> result = new ArrayList<>();
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
if(Objects.isNull(ftpClient)){
|
||||
throw new RuntimeException("ftp连接失败!");
|
||||
throw new RuntimeException("ftp connection failed!");
|
||||
}
|
||||
try {
|
||||
//切换被动模式
|
||||
|
@ -79,7 +79,7 @@ public class LogManageServiceImpl implements ILogManageService {
|
|||
List<FileInfo> result = new ArrayList<>();
|
||||
FTPClient ftpClient = ftpUtil.LoginFTP();
|
||||
if (Objects.isNull(ftpClient)){
|
||||
throw new RuntimeException("ftp连接失败!");
|
||||
throw new RuntimeException("ftp connection failed!");
|
||||
}
|
||||
try {
|
||||
//切换被动模式
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -183,6 +183,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
System.out.println(sbSql.toString());
|
||||
List<GardsSampleDataSpectrum> 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<GardsSampleDataSpectrum> sampleData = spectrumAnalysisMapper.getDBSearchList(dbName, stationTypes, userStations, AllUsers);
|
||||
//获取台站编码
|
||||
List<String> stationCodes = new LinkedList<>();
|
||||
|
@ -587,7 +589,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
Map<String, Object> 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;
|
||||
|
@ -3869,14 +3871,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
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;
|
||||
|
@ -4560,12 +4562,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (!CollUtil.contains(skip, line))
|
||||
newLines.add(line);
|
||||
}
|
||||
|
||||
String export = "SaveToTxt.txt";
|
||||
writer = ExportUtil.streamWriter(response, export);
|
||||
for (String newLine : newLines) {
|
||||
writer.println(newLine);
|
||||
}
|
||||
String export = "SaveToTxt.txt";
|
||||
writer = ExportUtil.streamWriter(response, export);
|
||||
for (String newLine : newLines) {
|
||||
writer.println(newLine);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
|
|
|
@ -60,10 +60,11 @@ public class StationOperationController {
|
|||
|
||||
@GetMapping("getDataReceivingStatus")
|
||||
@ApiOperation(value = "查询台站监测数据信息", notes = "查询台站监测数据信息")
|
||||
public Result getDataReceivingStatus(String userId){
|
||||
return stationOperationService.getDataReceivingStatus(userId);
|
||||
public Result getDataReceivingStatus(String userId, String oneStationId){
|
||||
return stationOperationService.getDataReceivingStatus(userId, oneStationId);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("getDataProvisionEfficiency")
|
||||
@ApiOperation(value = "查询台站数据提供率及有效率", notes = "查询台站数据提供率及有效率")
|
||||
public Result getDataProvisionEfficiency(){
|
||||
|
|
|
@ -46,9 +46,10 @@ public interface IStationOperationService extends IService<StationOperation> {
|
|||
/**
|
||||
* 查询台站监测数据
|
||||
* @param userId
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
Result getDataReceivingStatus(String userId);
|
||||
Result getDataReceivingStatus(String userId, String oneStationId);
|
||||
|
||||
/**
|
||||
* 获取台站数据的提供率及有效率
|
||||
|
|
|
@ -384,7 +384,7 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result getDataReceivingStatus(String userId) {
|
||||
public Result getDataReceivingStatus(String userId, String oneStationId) {
|
||||
Result result = new Result();
|
||||
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");
|
||||
// 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<>();
|
||||
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<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中获取台站信息
|
||||
// Map<Integer, String> stationInfoMap = (Map<Integer, String>)redisUtil.get("stationMap");
|
||||
// //从redis中获取探测器信息
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user