|
@@ -91,38 +91,41 @@ public class DqInterveneController {
|
|
|
urlWrapper.eq(ParsingUrl::getStationCode, stationCode);
|
|
|
List<ParsingUrl> parsingUrlList = parsingUrlService.list(urlWrapper);
|
|
|
if (parsingUrlList.size()>0){
|
|
|
- // 获取ftp通道
|
|
|
- LambdaQueryWrapper<ParsingChannel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(ParsingChannel::getAnChannelType, "E1");
|
|
|
- lambdaQueryWrapper.eq(ParsingChannel::getUseStatus, "E1");
|
|
|
- lambdaQueryWrapper.eq(ParsingChannel::getId, parsingUrlList.get(0).getCId());
|
|
|
- ParsingChannel parsingChannel = parsingChannelService.getOne(lambdaQueryWrapper);
|
|
|
+ for (ParsingUrl parsingUrl:parsingUrlList){
|
|
|
+ // 获取ftp通道
|
|
|
+ LambdaQueryWrapper<ParsingChannel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(ParsingChannel::getAnChannelType, "E1");
|
|
|
+ lambdaQueryWrapper.eq(ParsingChannel::getUseStatus, "E1");
|
|
|
+ lambdaQueryWrapper.eq(ParsingChannel::getId, parsingUrl.getCId());
|
|
|
+ ParsingChannel parsingChannel = parsingChannelService.getOne(lambdaQueryWrapper);
|
|
|
+ if (parsingChannel!=null){
|
|
|
+ String distPath = "/home"+ File.separator+parsingChannel.getUsername()+File.separator+"download";
|
|
|
+ File dirFile = new File(distPath);
|
|
|
+ if (!dirFile.exists()) {
|
|
|
+ dirFile.mkdirs();
|
|
|
+ }
|
|
|
+ VelocityContext velocityContext = new VelocityContext();
|
|
|
+ List<ForecastData> vList = new ArrayList<>();
|
|
|
|
|
|
- String distPath = "/home"+ File.separator+parsingChannel.getUsername()+File.separator+"download";
|
|
|
- File dirFile = new File(distPath);
|
|
|
- if (!dirFile.exists()) {
|
|
|
- dirFile.mkdirs();
|
|
|
- }
|
|
|
- VelocityContext velocityContext = new VelocityContext();
|
|
|
- List<ForecastData> vList = new ArrayList<>();
|
|
|
-
|
|
|
- for (DqIntervene d1:presetsShortList) {
|
|
|
- ForecastData forecastData = new ForecastData();
|
|
|
- forecastData.setTime(DateFormatUtils.format(d1.getForecastTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
- forecastData.setPower(d1.getActivePower().toString());
|
|
|
- vList.add(forecastData);
|
|
|
- }
|
|
|
+ for (DqIntervene d1:presetsShortList) {
|
|
|
+ ForecastData forecastData = new ForecastData();
|
|
|
+ forecastData.setTime(DateFormatUtils.format(d1.getForecastTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ forecastData.setPower(d1.getActivePower().toString());
|
|
|
+ vList.add(forecastData);
|
|
|
+ }
|
|
|
|
|
|
- velocityContext.put("vList", vList);
|
|
|
- // 系统当前日期
|
|
|
- velocityContext.put("currentTime", DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
- StringWriter writer = new StringWriter();
|
|
|
- org.apache.velocity.Template template = this.velocityEngine.getTemplate(FileUtil.getResourceBasePath() + "/templates/send_dq.vm");
|
|
|
- template.merge(velocityContext, writer);
|
|
|
+ velocityContext.put("vList", vList);
|
|
|
+ // 系统当前日期
|
|
|
+ velocityContext.put("currentTime", DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ StringWriter writer = new StringWriter();
|
|
|
+ org.apache.velocity.Template template = this.velocityEngine.getTemplate(FileUtil.getResourceBasePath() + "/templates/send_dq.vm");
|
|
|
+ template.merge(velocityContext, writer);
|
|
|
|
|
|
- String vmFileName = "send_"+stationCode+"_dq_"+gyrq+".WPD";
|
|
|
- createSendDqFile(writer,new File(distPath + File.separator+vmFileName));
|
|
|
- log.info(stationCode+"下发嘉越DQ数据成功:"+gyrq);
|
|
|
+ String vmFileName = "send_"+stationCode+"_dq_"+gyrq+".WPD";
|
|
|
+ createSendDqFile(writer,new File(distPath + File.separator+vmFileName));
|
|
|
+ log.info(stationCode+"下发嘉越DQ数据成功:"+gyrq);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return R.ok();
|
|
|
|