xusl 9 miesięcy temu
rodzic
commit
a4cc42dd15

+ 1 - 1
ipp-ap/src/views/idp/control/dqIntervene/index.vue

@@ -118,7 +118,7 @@ export default {
     // 获取短期干预
     getDqData() {
       // 判断场站和干预日期是否选择
-      if(this.stationCode=='' || this.dateTime==''){
+      if(this.stationCode=='' || this.dateTime=='' || this.dateTime==null){
         this.$message.warning('请选择场站及干预日期')
         return
       }

+ 32 - 29
ipp-idp/src/main/java/com/jiayue/ipp/idp/controller/DqInterveneController.java

@@ -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();
 

+ 1 - 1
ipp-idp/src/main/java/com/jiayue/ipp/idp/job/ApiJob.java

@@ -25,7 +25,7 @@ public class ApiJob {
     @Autowired
     private CallPowerStationStatusDataApi callPowerStationStatusDataApi;
 
-    @Scheduled(cron = "30 0,15,30,45 * * * ? ")
+//    @Scheduled(cron = "30 0,15,30,45 * * * ? ")
     public void ultraShortTermApi(){
         callForecastPowerUltraShortTermApi.executeForecast();
     }

+ 1 - 0
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/impl/DqInterveneServiceImpl.java

@@ -54,6 +54,7 @@ public class DqInterveneServiceImpl extends ServiceImpl<DqInterveneMapper, DqInt
             // 再获取预设短期
             QueryWrapper<DqIntervene> presetsWrapper = new QueryWrapper<>();
             presetsWrapper.between("forecast_time", new Date(startTime), new Date(endTime));
+            presetsWrapper.eq("station_code", stationCode);
             List<DqIntervene> bizPresetsShortList = this.list(presetsWrapper);
             Map<Long, DqIntervene> bizPresetsShortMap = bizPresetsShortList.stream()
                     .collect(Collectors.toMap(