合并冗余文件路径字段
This commit is contained in:
parent
1328d1f5b8
commit
dc03b4f020
|
@ -64,16 +64,13 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
|
||||
@Value("${spring.baseHome}")
|
||||
private String baseHome;
|
||||
@Value("${spring.CMAQ.cmaqLocalShellHome}")
|
||||
private String cmaqLocalShellHome;
|
||||
@Value("${spring.CMAQ.outputLocalPath}")
|
||||
private String outputLocalPath;
|
||||
@Value("${spring.CMAQ.cshTemFielPath}")
|
||||
@Value("${spring.localFilePrefix}")
|
||||
private String localFilePrefix;
|
||||
@Value("${spring.cshTemFielPath}")
|
||||
private String cshTemFielPath;
|
||||
@Value("${spring.CMAQ.pythonPath}")
|
||||
private String pythonPath;
|
||||
@Value("${spring.WRF.wrfLocalPrefix}")
|
||||
private String wrfLocalPrefix;
|
||||
|
||||
@Value("${spring.Linux.ip}")
|
||||
private String ip;
|
||||
@Value("${spring.Linux.username}")
|
||||
|
@ -83,7 +80,7 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
@Value("${spring.Linux.port}")
|
||||
private Integer port;
|
||||
|
||||
private String genMcipsShell(String allRunPath, String startTime, String endTime,Integer domain,String ncols,String nrows) throws IOException, SftpException {
|
||||
private String genMcipsShell(String allRunPath, String targetFilePath, String startTime, String endTime,Integer domain,String ncols,String nrows) throws IOException, SftpException {
|
||||
String fileName = "all_run_mcip.csh";
|
||||
String data = new String(readAllBytes(get(cshTemFielPath + "all_run_mcip_tem.csh")));
|
||||
data = data
|
||||
|
@ -93,19 +90,17 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
.replace("#{domain}", domain+"")
|
||||
.replace("#{NCOLS_ARR}", ncols)
|
||||
.replace("#{NROWS_ARR}", nrows);
|
||||
String targetFilePath = cmaqLocalShellHome + "MCIP/" + fileName;
|
||||
FileUtil.writeString(data, targetFilePath, "UTF-8");
|
||||
sftpUpload(targetFilePath,allRunPath + "CMAQ/PREP/mcip/scripts/", fileName);
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public String genIconShell(String allRunPath,String startTime,String endTime,Integer domain){
|
||||
public String genIconShell(String allRunPath, String targetFilePath, String startTime,String endTime,Integer domain){
|
||||
String fileName = "all_run_icon.csh";
|
||||
try {
|
||||
String data = new String(readAllBytes(get(cshTemFielPath + "all_run_icon_tem.csh")));
|
||||
data = data.replace("#{RUN_PATH}", allRunPath).replace("#{START_DATE}", startTime).replace("#{END_DATE}", endTime).replace("#{domain}", domain+"");
|
||||
// todo sftp 上传
|
||||
String targetFilePath = cmaqLocalShellHome + "ICON/" + fileName;
|
||||
FileUtil.writeString(data, targetFilePath, "UTF-8");
|
||||
sftpUpload(targetFilePath,allRunPath + "CMAQ/PREP/icon/scripts/", fileName);
|
||||
} catch (Exception e) {
|
||||
|
@ -114,13 +109,12 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
return fileName;
|
||||
}
|
||||
|
||||
public String genBconShell(String allRunPath,String startTime,String endTime,Integer domain) {
|
||||
public String genBconShell(String allRunPath, String targetFilePath, String startTime,String endTime,Integer domain) {
|
||||
String fileName = "all_run_bcon.csh";
|
||||
try {
|
||||
String data = new String(readAllBytes(get(cshTemFielPath + "all_run_bcon_tem.csh")));
|
||||
data = data.replace("#{RUN_PATH}", allRunPath).replace("#{START_DATE}", startTime).replace("#{END_DATE}", endTime).replace("#{domain}", domain + "");
|
||||
// todo sftp 上传
|
||||
String targetFilePath = cmaqLocalShellHome + "BCON/" + fileName;
|
||||
FileUtil.writeString(data, targetFilePath, "UTF-8");
|
||||
sftpUpload(targetFilePath, allRunPath + "CMAQ/PREP/bcon/scripts/", fileName);
|
||||
} catch (Exception e) {
|
||||
|
@ -129,14 +123,13 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
return fileName;
|
||||
}
|
||||
|
||||
public String genCctmShell(String allRunPath, String startDate, String endDate, String stTime, String nSteps, String tStep) {
|
||||
public String genCctmShell(String allRunPath,String targetFilePath, String startDate, String endDate, String stTime, String nSteps, String tStep) {
|
||||
String fileName = "run_cctm_2016.csh";
|
||||
try {
|
||||
String data = new String(readAllBytes(get(cshTemFielPath + "run_cctm_2016_tem.csh")));
|
||||
data = data.replace("#{START_DATE}", startDate).replace("#{END_DATE}", endDate).replace("#{STTIME}", stTime)
|
||||
.replace("#{NSTEPS}", nSteps).replace("#{TSTEP}", tStep);
|
||||
// todo sftp 上传
|
||||
String targetFilePath = cmaqLocalShellHome + "CCTM/" + fileName;
|
||||
FileUtil.writeString(data, targetFilePath, "UTF-8");
|
||||
sftpUpload(targetFilePath,allRunPath + "CMAQ/CCTM/scripts/",fileName);
|
||||
} catch (Exception e) {
|
||||
|
@ -151,9 +144,11 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
BizWrf wrf = bizWrfMapper.selectOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engineeringId));
|
||||
|
||||
String allRunPath = baseHome + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + wrf.getTimeStamp() + "/";
|
||||
String targetFilePath = localFilePrefix + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + "MCIP/";
|
||||
|
||||
try {
|
||||
// todo step1 mcip
|
||||
String mcipFileName = genMcipsShell(allRunPath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom(),cmaq.getColsN(),cmaq.getRowsN());
|
||||
String mcipFileName = genMcipsShell(allRunPath,targetFilePath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom(),cmaq.getColsN(),cmaq.getRowsN());
|
||||
// todo 执行mcip.csh
|
||||
runCmd(allRunPath + "CMAQ/","PREP/mcip",mcipFileName);
|
||||
} catch (Exception e) {
|
||||
|
@ -166,9 +161,10 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
public boolean runIconShell(String engineeringId) {
|
||||
BizWrf wrf = bizWrfMapper.selectOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engineeringId));
|
||||
String allRunPath = baseHome + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + wrf.getTimeStamp() + "/";
|
||||
String targetFilePath = localFilePrefix + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + "ICON/";
|
||||
try {
|
||||
// todo step2 icon
|
||||
String iconFileName = genIconShell(allRunPath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom());
|
||||
String iconFileName = genIconShell(allRunPath,targetFilePath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom());
|
||||
// todo 执行icon.csh
|
||||
runCmd(allRunPath + "CMAQ/","PREP/icon",iconFileName);
|
||||
} catch (Exception e) {
|
||||
|
@ -181,9 +177,10 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
public boolean runBconShell(String engineeringId) {
|
||||
BizWrf wrf = bizWrfMapper.selectOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engineeringId));
|
||||
String allRunPath = baseHome + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + wrf.getTimeStamp() + "/";
|
||||
String targetFilePath = localFilePrefix + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + "BCON/";
|
||||
try {
|
||||
// todo step2 bcon
|
||||
String iconFileName = genBconShell(allRunPath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom());
|
||||
String iconFileName = genBconShell(allRunPath,targetFilePath,wrf.getStartTime().substring(0, 10),wrf.getEndTime().substring(0, 10),wrf.getMaxDom());
|
||||
// todo 执行bcon.csh
|
||||
runCmd(allRunPath + "CMAQ/","PREP/bcon",iconFileName);
|
||||
} catch (Exception e) {
|
||||
|
@ -210,6 +207,7 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
BizCmaq cmaq = getOne(new LambdaQueryWrapper<BizCmaq>().eq(BizCmaq::getEngineeringId,engineeringId));
|
||||
BizOpenfoam openfoam = bizOpenfoamService.getOne(new LambdaQueryWrapper<BizOpenfoam>().eq(BizOpenfoam::getEngineeringId, engineeringId));
|
||||
String allRunPath = baseHome + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + wrf.getTimeStamp() + "/";
|
||||
String targetFilePath = localFilePrefix + wrf.getCreateBy() + wrf.getEngineeringId() + "/" + "CCTM/";
|
||||
|
||||
String ymdFormat = "yyyy-MM-dd";
|
||||
String yymdFormat = "yyMMdd";
|
||||
|
@ -248,14 +246,14 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
}
|
||||
try {
|
||||
// todo step2 cctm
|
||||
String cctmFileName = genCctmShell(allRunPath,newStartTime,newEndTime,cmaq.getSttime(), cmaq.getNsteps(), cmaq.getTstep());
|
||||
String cctmFileName = genCctmShell(allRunPath,targetFilePath,newStartTime,newEndTime,cmaq.getSttime(), cmaq.getNsteps(), cmaq.getTstep());
|
||||
// todo 执行cctm.csh
|
||||
runCmd(allRunPath + "CMAQ/","CCTM",cctmFileName);
|
||||
String ncName = "CCTM_ACONC_v532_2016_12SE1_"+newStartTime.replace("-","")+".nc";
|
||||
String ncLocalName = "CCTM_ACONC_v532_2016_12SE1_"+DateUtil.format(new Date(startTimeSecs), ymdFormat).replace("-","")+".nc";
|
||||
SFTPUtil sftpUtil = new SFTPUtil();
|
||||
sftpUtil.login(username, password,ip,port);
|
||||
sftpUtil.download(allRunPath + "CMAQ/data/output/v532_2016_12SE1/",ncName,outputLocalPath + ncLocalName);
|
||||
sftpUtil.download(allRunPath + "CMAQ/data/output/v532_2016_12SE1/",ncName,localFilePrefix + ncLocalName);
|
||||
sftpUtil.logout();
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
|
@ -275,10 +273,10 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
NetcdfFile griddot2d = NetcdfDataset.open("C:\\Users\\13673\\Desktop\\某源\\Nuclear\\file\\wrfout_d01_2016-07-01_00_00_00");
|
||||
NetcdfFile ncfile = NetcdfDataset.open("C:\\Users\\13673\\Desktop\\某源\\Nuclear\\file\\CCTM_ACONC_v532_2016_12SE1_20160701.nc");
|
||||
// String ncName = "CCTM_ACONC_v532_2016_12SE1_" + sdf.format(sdf.parse(bizCmaq.getStartDate())).replace("-", "") + ".nc";
|
||||
// NetcdfFile ncfile = NetcdfDataset.open(outputLocalPath + ncName);
|
||||
// NetcdfFile ncfile = NetcdfDataset.open(localFilePrefix + ncName);
|
||||
// BizWrf bizWrf = bizWrfService.getOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId, bizEngineeringByState.getId()));
|
||||
// String ncNameWrf = "wrfout_d01_" + bizWrf.getStartTime();
|
||||
// NetcdfFile griddot2d = NetcdfDataset.open(wrfLocalPrefix + ncNameWrf);
|
||||
// NetcdfFile griddot2d = NetcdfDataset.open(localFilePrefix + ncNameWrf);
|
||||
List<List<List<Double>>> coAllList = getNCByName(ncfile, "CO", layer);
|
||||
List<List<List<Double>>> no2AllList = getNCByName(ncfile, "NO2", layer);
|
||||
List<List<List<Double>>> no3AllList = getNCByName(ncfile, "NO3", layer);
|
||||
|
@ -332,7 +330,7 @@ public class BizCmaqServiceImpl extends ServiceImpl<BizCmaqMapper, BizCmaq> impl
|
|||
String newStartTime = DateUtil.format(new Date(startTimeSecs + oneDaySecs), ymdFormat);
|
||||
String ncName = "CCTM_ACONC_v532_2016_12SE1_" + newStartTime.replace("-", "") + ".nc";
|
||||
try {
|
||||
NetcdfFile ncfile = NetcdfDataset.open(outputLocalPath + ncName);
|
||||
NetcdfFile ncfile = NetcdfDataset.open(localFilePrefix + ncName);
|
||||
List<Variable> variables = ncfile.getVariables();
|
||||
variables.forEach(li ->{
|
||||
variableNames.add(li.getShortName());
|
||||
|
|
|
@ -80,7 +80,7 @@ public class BizOpenfoamController extends JeecgController<BizOpenfoam, IBizOpen
|
|||
|
||||
@Value("${spring.baseHome}")
|
||||
private String baseHome;
|
||||
@Value("${spring.CMAQ.cshTemFielPath}")
|
||||
@Value("${spring.cshTemFielPath}")
|
||||
private String cshTemFielPath;
|
||||
@Value("${spring.Linux.ip}")
|
||||
private String ip;
|
||||
|
|
|
@ -41,14 +41,14 @@ public class BizUpdateFileController extends JeecgController<BizUploadFile, BizU
|
|||
@Autowired
|
||||
private BizUploadFileService bizUploadFileService;
|
||||
|
||||
@Value("${spring.WRF.wpsLocalPrefix}")
|
||||
private String wpsLocalPrefix;
|
||||
@Value("${spring.localFilePrefix}")
|
||||
private String localFilePrefix;
|
||||
|
||||
@PostMapping(value = "/uploadFile")
|
||||
public boolean uploadFile(@RequestParam String relevanceId, @RequestParam Integer type, @RequestParam List<MultipartFile> files) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
try{
|
||||
// String localFilePrefix = wpsLocalPrefix + loginUser.getUsername() + "/" + relevanceId + "/";
|
||||
// String localFilePrefix = localFilePrefix + loginUser.getUsername() + "/" + relevanceId + "/";
|
||||
String localFilePrefix = "D:\\upload\\" + loginUser.getUsername() + "/" + relevanceId + "/";
|
||||
if (!FileUtil.exist(localFilePrefix)) {
|
||||
FileUtil.mkdir(localFilePrefix);
|
||||
|
|
|
@ -19,8 +19,8 @@ import java.util.List;
|
|||
@Service
|
||||
public class BizUploadFileServiceImpl extends ServiceImpl<BizUploadFileMapper, BizUploadFile> implements BizUploadFileService {
|
||||
|
||||
@Value("${spring.WRF.wpsLocalPrefix}")
|
||||
private String wpsLocalPrefix;
|
||||
@Value("${spring.localFilePrefix}")
|
||||
private String localFilePrefix;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
@ -39,13 +39,13 @@ public class BizUploadFileServiceImpl extends ServiceImpl<BizUploadFileMapper, B
|
|||
bizUploadFile.setFilePath(dbDir);
|
||||
// 全路径
|
||||
String descDir = "";
|
||||
wpsLocalPrefix = "D:\\upload\\";
|
||||
localFilePrefix = "D:\\upload\\";
|
||||
if(type == 1){
|
||||
descDir = wpsLocalPrefix + userName + "/" + relevanceId;
|
||||
descDir = localFilePrefix + userName + "/" + relevanceId;
|
||||
}else if (type == 1){
|
||||
descDir = wpsLocalPrefix + userName + "/" + relevanceId;
|
||||
descDir = localFilePrefix + userName + "/" + relevanceId;
|
||||
}else{
|
||||
descDir = wpsLocalPrefix + userName + "/" + relevanceId;
|
||||
descDir = localFilePrefix + userName + "/" + relevanceId;
|
||||
}
|
||||
bizUploadFile.setFileFullPath(descDir);
|
||||
//删除之前导入的相同类型数据
|
||||
|
|
|
@ -86,11 +86,9 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
|
||||
@Value("${spring.baseHome}")
|
||||
private String baseHome;
|
||||
@Value("${spring.WRF.wpsLocalPrefix}")
|
||||
private String wpsLocalPrefix;
|
||||
@Value("${spring.WRF.wrfLocalPrefix}")
|
||||
private String wrfLocalPrefix;
|
||||
@Value("${spring.CMAQ.cshTemFielPath}")
|
||||
@Value("${spring.localFilePrefix}")
|
||||
private String localFilePrefix;
|
||||
@Value("${spring.cshTemFielPath}")
|
||||
private String cshTemFielPath;
|
||||
@Value("${spring.WRF.geog_data_path}")
|
||||
private String geog_data_path;
|
||||
|
@ -172,7 +170,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
|
||||
public void saveWpsFile(BizWrf bizWrf){
|
||||
String allRunPath = baseHome + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/" + bizWrf.getTimeStamp() + "/";
|
||||
String localFilePrefix = wpsLocalPrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
String localFilePath = localFilePrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
String fileName = "namelist.wps";
|
||||
try {
|
||||
String startStr = "";
|
||||
|
@ -209,8 +207,8 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
.replace("#{geog_data_path}", geog_data_path)
|
||||
.replace("#{opt_output_from_metgrid_path}",allRunPath+"WRF/run");
|
||||
// todo sftp 上传
|
||||
FileUtil.writeString(data, localFilePrefix + fileName, "UTF-8");
|
||||
sftpUpload(localFilePrefix + fileName, allRunPath + "WPS", fileName);
|
||||
FileUtil.writeString(data, localFilePath + fileName, "UTF-8");
|
||||
sftpUpload(localFilePath + fileName, allRunPath + "WPS", fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -218,7 +216,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
|
||||
public void saveInputFile(BizWrf bizWrf){
|
||||
String allRunPath = baseHome + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/" + bizWrf.getTimeStamp() + "/";
|
||||
String localFilePrefix = wpsLocalPrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
String localFilePath = localFilePrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
|
||||
Calendar startCal = Calendar.getInstance();
|
||||
|
@ -294,8 +292,8 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
.replace("#{j_parent_start}", bizWrf.getParentStartJ())
|
||||
.replace("#{parent_grid_ratio}", bizWrf.getParentGridRatio());
|
||||
// todo sftp 上传
|
||||
FileUtil.writeString(data, localFilePrefix + fileName, "UTF-8");
|
||||
sftpUpload(localFilePrefix + fileName, allRunPath + "WRF/run", fileName);
|
||||
FileUtil.writeString(data, localFilePath + fileName, "UTF-8");
|
||||
sftpUpload(localFilePath + fileName, allRunPath + "WRF/run", fileName);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SftpException e) {
|
||||
|
@ -317,7 +315,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
String engineeringId = bizEngineeringService.getBizEngineeringByState().getId();
|
||||
BizWrf bizWrf = bizWrfService.getOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engineeringId));
|
||||
String allRunPath = baseHome + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/" + bizWrf.getTimeStamp() + "/";
|
||||
String localFilePrefix = wpsLocalPrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
String localFilePath = localFilePrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
|
||||
String format = "yyyy-MM-dd_hh:mm:ss";
|
||||
String ymdFormat = "yyyy-MM-dd";
|
||||
|
@ -338,9 +336,9 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
RemoteExecuteCommand.runRemoteLinuxCmd(ip, username, password, cdWPS + "./metgrid.exe");
|
||||
SFTPUtil sftpUtil = new SFTPUtil();
|
||||
sftpUtil.login(username, password,ip,port);
|
||||
sftpUtil.download(allRunPath + "WPS","metgrid.log",localFilePrefix + "metgrid.log");
|
||||
sftpUtil.download(allRunPath + "WPS","metgrid.log",localFilePath + "metgrid.log");
|
||||
sftpUtil.logout();
|
||||
String metgridLog = new String(readAllBytes(get(localFilePrefix + "metgrid.log")));
|
||||
String metgridLog = new String(readAllBytes(get(localFilePath + "metgrid.log")));
|
||||
if(metgridLog.indexOf("Successful completion of program metgrid.exe") > 0){
|
||||
return Result.OK(metgridLog);
|
||||
}
|
||||
|
@ -357,7 +355,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
String engineeringId = bizEngineeringService.getBizEngineeringByState().getId();
|
||||
BizWrf bizWrf = bizWrfService.getOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engineeringId));
|
||||
String allRunPath = baseHome + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/" + bizWrf.getTimeStamp() + "/";
|
||||
String localFilePrefix = wpsLocalPrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
String localFilePath = localFilePrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
|
||||
String cdWRF = "cd " + allRunPath + "WRF/run;";
|
||||
RemoteExecuteCommand.runRemoteLinuxCmd(ip, username, password, cdWRF + "ulimit -s unlimited;./real.exe >&real.log");
|
||||
|
@ -365,17 +363,17 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
|
||||
SFTPUtil sftpUtil = new SFTPUtil();
|
||||
sftpUtil.login(username, password,ip,port);
|
||||
sftpUtil.download(allRunPath + "WRF/run","wrf.log",localFilePrefix + "wrf.log");
|
||||
String wrfLog = new String(readAllBytes(get(localFilePrefix + "wrf.log")));
|
||||
// sftpUtil.download(allRunPath + "WRF/run","rsl.out.0000",localFilePrefix + "rsl.out.0000");
|
||||
// String wrfLog = new String(readAllBytes(get(localFilePrefix + "rsl.out.0000")));
|
||||
sftpUtil.download(allRunPath + "WRF/run","wrf.log",localFilePath + "wrf.log");
|
||||
String wrfLog = new String(readAllBytes(get(localFilePath + "wrf.log")));
|
||||
// sftpUtil.download(allRunPath + "WRF/run","rsl.out.0000",localFilePath + "rsl.out.0000");
|
||||
// String wrfLog = new String(readAllBytes(get(localFilePath + "rsl.out.0000")));
|
||||
if(wrfLog.indexOf("SUCCESS COMPLETE WRF") > 0){
|
||||
String format = "yyyy-MM-dd_HH:mm:ss";
|
||||
DateTime startTime = DateUtil.parse(bizWrf.getStartTime(), format);
|
||||
long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs), format);
|
||||
String ncNameWrf = "wrfout_d01_" + newStartTime;
|
||||
sftpUtil.download(allRunPath + "WRF/run/",ncNameWrf,localFilePrefix + ncNameWrf);
|
||||
sftpUtil.download(allRunPath + "WRF/run/",ncNameWrf,localFilePath + ncNameWrf);
|
||||
sftpUtil.logout();
|
||||
return Result.OK("SUCCESS COMPLETE WRF");
|
||||
}else{
|
||||
|
@ -386,7 +384,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
// long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
// String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs), format);
|
||||
// String ncNameWrf = "wrfout_d01_" + newStartTime;
|
||||
// sftpUtil.download(allRunPath + "WRF/run/",ncNameWrf,wrfLocalPrefix + ncNameWrf);
|
||||
// sftpUtil.download(allRunPath + "WRF/run/",ncNameWrf,localFilePrefix + ncNameWrf);
|
||||
// sftpUtil.logout();
|
||||
// return Result.OK("SUCCESS COMPLETE WRF");
|
||||
return Result.error(wrfLog);
|
||||
|
@ -403,14 +401,14 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
String engineeringId = bizEngineeringService.getBizEngineeringByState().getId();
|
||||
BizWrf bizWrf = bizWrfService.getOne(new LambdaQueryWrapper<BizWrf>().eq(BizWrf::getEngineeringId,engineeringId));
|
||||
String allRunPath = baseHome + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/" + bizWrf.getTimeStamp() + "/";
|
||||
String localFilePrefix = wpsLocalPrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
String localFilePath = localFilePrefix + "/" + bizWrf.getCreateBy() + bizWrf.getEngineeringId() + "/";
|
||||
|
||||
SFTPUtil sftpUtil = new SFTPUtil();
|
||||
sftpUtil.login(username, password,ip,port);
|
||||
// sftpUtil.download(allRunPath + "WRF/run/","rsl.out.0000",wrfLocalPrefix + "rsl.out.0000");
|
||||
sftpUtil.download(allRunPath + "WRF/run","wrf.log",localFilePrefix + "wrf.log");
|
||||
// sftpUtil.download(allRunPath + "WRF/run/","rsl.out.0000",localFilePrefix + "rsl.out.0000");
|
||||
sftpUtil.download(allRunPath + "WRF/run","wrf.log",localFilePath + "wrf.log");
|
||||
sftpUtil.logout();
|
||||
String wrfLog = new String(readAllBytes(get(localFilePrefix + "wrf.log")));
|
||||
String wrfLog = new String(readAllBytes(get(localFilePath + "wrf.log")));
|
||||
// String wrfLog = new String(readAllBytes(get("C:\\Users\\13673\\Desktop\\Nuclear\\file\\wrf.log")));
|
||||
return Result.OK(wrfLog);
|
||||
}catch (Exception e){
|
||||
|
@ -438,7 +436,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
// long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
// String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs), format);
|
||||
// String ncNameWrf = "wrfout_d01_" + newStartTime;
|
||||
// NetcdfFile ncfile = NetcdfDataset.open(wrfLocalPrefix + ncNameWrf);
|
||||
// NetcdfFile ncfile = NetcdfDataset.open(localFilePrefix + ncNameWrf);
|
||||
List<List<List<Double>>> xlatAllList = getNCByName(ncfile, "XLAT",layer);
|
||||
List<List<List<Double>>> xlongAllList = getNCByName(ncfile, "XLONG",layer);
|
||||
List<List<List<Double>>> uAllList = getNCByName(ncfile, "U",layer);
|
||||
|
@ -499,7 +497,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
// long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
// String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs), format);
|
||||
// String ncNameWrf = "wrfout_d01_" + newStartTime;
|
||||
// NetcdfFile ncfile = NetcdfDataset.open(wrfLocalPrefix + ncNameWrf);
|
||||
// NetcdfFile ncfile = NetcdfDataset.open(localFilePrefix + ncNameWrf);
|
||||
List<List<List<Double>>> hgtAllList = getNCByName(ncfile, "HGT",0);
|
||||
List<List<List<Double>>> xlatAllList = getNCByName(ncfile, "XLAT",0);
|
||||
List<List<List<Double>>> xlongAllList = getNCByName(ncfile, "XLONG",0);
|
||||
|
@ -550,7 +548,7 @@ public class BizWrfController extends JeecgController<BizWrf, IBizWrfService> {
|
|||
long oneDaySecs = 60 * 60 * 24 * 1000;
|
||||
String newStartTime = DateUtil.format(new Date(startTime.getTime() + oneDaySecs), format);
|
||||
String ncNameWrf = "wrfout_d01_" + newStartTime;
|
||||
NetcdfFile ncfile = NetcdfDataset.open(wrfLocalPrefix + ncNameWrf);
|
||||
NetcdfFile ncfile = NetcdfDataset.open(localFilePrefix + ncNameWrf);
|
||||
List<List<List<Double>>> uAllList = getNCByName(ncfile, "U",0);
|
||||
List<List<List<Double>>> vAllList = getNCByName(ncfile, "V",0);
|
||||
List<List<List<Double>>> pAllList = getNCByName(ncfile, "P",0);
|
||||
|
|
|
@ -20,21 +20,18 @@ management:
|
|||
include: metrics,httptrace
|
||||
|
||||
spring:
|
||||
baseHome: /home/openfoam/
|
||||
baseHome: /home/wmhr/
|
||||
cshTemFielPath: /home/wmhr/java/tem/
|
||||
localFilePrefix: /home/wmhr/java/file/
|
||||
WRF:
|
||||
wpsLocalPrefix: /home/openfoam/java/file/
|
||||
wrfLocalPrefix: /home/openfoam/java/file/
|
||||
geog_data_path: /home/openfoam/Build_WRF/WPS_GEOG
|
||||
fnldataPath: /home/openfoam/Build_WRF/WPS/fnldata/
|
||||
geog_data_path: /home/wmhr/Build_WRF/WPS_GEOG
|
||||
fnldataPath: /home/wmhr/Build_WRF/WPS/fnldata/
|
||||
CMAQ:
|
||||
cmaqLocalShellHome: /home/openfoam/java/file/
|
||||
outputLocalPath: /home/openfoam/java/file/
|
||||
cshTemFielPath: /home/openfoam/java/tem/
|
||||
pythonPath: /home/openfoam/python/
|
||||
pythonPath: /home/wmhr/python/
|
||||
Linux:
|
||||
ip: 127.0.0.1
|
||||
username: openfoam
|
||||
password: root
|
||||
ip: 192.168.115.128
|
||||
username: wmhr
|
||||
password: 123456
|
||||
port: 22
|
||||
servlet:
|
||||
multipart:
|
||||
|
|
Loading…
Reference in New Issue
Block a user