Ver código fonte

一体化云端:
修改给北京中央研究院上传sftp修改
去掉多余log日志输出

zhangchenglong 3 semanas atrás
pai
commit
e00fb2b7af

+ 1 - 1
in-cloud/src/main/java/com/jiayue/insu/incloud/pulldata/PullCorrectDataForLx.java

@@ -129,7 +129,7 @@ public class PullCorrectDataForLx implements IPullInitCorrectDataForSH {
                         long startTime = DateUtil.beginOfDay(DateUtil.tomorrow()).getTime();
                         long endTime = startTime + 10 * 24 * 3600 * 1000L - 1;
                         aList = forecastDataService.findTimeByStation(station.getStationCode(), startTime, endTime);
-                        log.info(station.getStationCode() + " 请求短期修正数据返回内容:{}", response);
+//                        log.info(station.getStationCode() + " 请求短期修正数据返回内容:{}", response);
                         try {
                             list = correctWindData(response.toString(), station);
 

+ 1 - 1
in-cloud/src/main/java/com/jiayue/insu/incloud/pulldata/PullCorrectDataForQNHL.java

@@ -147,7 +147,7 @@ public class PullCorrectDataForQNHL implements IPullInitCorrectData {
                             long startTime = DateUtil.beginOfDay(new Date()).getTime();
                             long endTime = DateUtil.offsetDay(DateUtil.beginOfDay(DateUtil.tomorrow()), st.getDays()).getTime();
                             aList = forecastDataService.findTimeByStation(station.getStationCode(), startTime, endTime);
-                            log.info(station.getStationCode() + " 请求短期修正数据返回内容:{}", response);
+//                            log.info(station.getStationCode() + " 请求短期修正数据返回内容:{}", response);
 
                             try {
 

+ 1 - 1
in-cloud/src/main/java/com/jiayue/insu/incloud/pulldata/PullCorrectDataForSH.java

@@ -132,7 +132,7 @@ public class PullCorrectDataForSH implements IPullInitCorrectDataForSH {
                         long startTime = DateUtil.beginOfDay(DateUtil.tomorrow()).getTime() + 15 * 60 * 1000L;
                         long endTime = startTime + 24 * 3600 * 1000L-1;
                         aList = forecastDataService.findTimeByStation(station.getStationCode(), startTime, endTime);
-                        log.info(station.getStationCode() + " 请求短期修正数据返回内容:{}", response);
+//                        log.info(station.getStationCode() + " 请求短期修正数据返回内容:{}", response);
 
                         try {
                             list = correctWindData(responseSHLNVo.getData());

+ 5 - 1
in-cloud/src/main/java/com/jiayue/insu/incloud/pushdata/PushCommon.java

@@ -198,7 +198,7 @@ public class PushCommon {
             }
         }
 
-        String fileDateStr = DateUtil.format(DateUtil.beginOfDay(DateUtil.tomorrow()), "yyyyMMdd_HH:mm:ss");
+        String fileDateStr = DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyyMMdd_HH:mm:ss");
         String fileType = todayStr + File.separatorChar + "nwp";
         this.pushFileToSftp(record, vList, newFilePath, newFileName, templateName, station, fileType, companyCode, fileDateStr);
         return true;
@@ -224,10 +224,14 @@ public class PushCommon {
         velocityContext.put("stationCode", station.getStationCode());
         velocityContext.put("stationName", station.getName());
 
+        log.info("******templateName:{}",templateName);
         File newFile;
         // 生成新文件
         try {
             newFile = fileUtils.createFileByVelocityTemplate(newFilePath, newFileName, templateName, velocityContext);
+            if(newFile!=null){
+                log.info("生成文件路径:{}",newFile.getAbsolutePath());
+            }
         } catch (Exception e) {
             e.printStackTrace();
             record.setState(StatusEnum.CREATE_FILE_FAIL.getSign());

+ 2 - 2
in-cloud/src/main/java/com/jiayue/insu/incloud/pushdata/PushDataForBJZYYJYSD.java

@@ -208,12 +208,12 @@ public class PushDataForBJZYYJYSD implements IPushInitForecastData {
                     record.setState(StatusEnum.SUCCESS.getSign());
                     record.setStateContent(responseSDVo.getMsg());
                     log.info("=========={}:{} ==>上送短期原始数据成功  {}天==========", integrationCompany.getName(), station.getStationCode(), daysList.size());
-                    log.info("{} 原始数据:{}",stationCode,body);
+//                    log.info("{} 原始数据:{}",stationCode,body);
                     recordService.save(record);
                     return true;
                 } else {
                     log.error("=========={}:{} ==>上送数据失败 失败标识:{} ,失败原因:{} ==========", integrationCompany.getName(), station.getStationCode(), responseSDVo.getCode(), responseSDVo.getMsg());
-                    log.info("{} 原始数据:{}",stationCode,body);
+//                    log.info("{} 原始数据:{}",stationCode,body);
                     record.setState(StatusEnum.FILE_NULL.getSign());
                     record.setStateContent(responseSDVo.getMsg());
                     recordService.save(record);

+ 1 - 2
in-cloud/src/main/java/com/jiayue/insu/incloud/pushdata/PushDataForLX.java

@@ -280,7 +280,7 @@ public class PushDataForLX implements IPushInitForecastData {
                 record.setState(StatusEnum.SUCCESS.getSign());
                 record.setStateContent(responseLXVo.getMessage());
                 log.info("=========={}:{} ==>上送短期原始数据成功  {}条==========", integrationCompany.getName(), station.getStationCode(), dataList.size());
-                log.info("{} 原始数据:{}", stationCode, body);
+//                log.info("{} 原始数据:{}", stationCode, body);
                 recordService.save(record);
                 forecastDataLxService.saveBatch(forecastDataLxList);
                 return true;
@@ -458,7 +458,6 @@ public class PushDataForLX implements IPushInitForecastData {
                 return true;
             } else {
                 log.error("=========={}:{} ==>上送数据失败 失败标识:{} ,失败原因:{} ==========", integrationCompany.getName(), station.getStationCode(), responseLXVo.getCode(), responseLXVo.getMessage());
-                log.info("{} 原始数据:{}", stationCode, json);
                 record.setState(StatusEnum.FILE_NULL.getSign());
                 record.setStateContent(responseLXVo.getMessage());
                 recordService.save(record);

+ 2 - 2
in-cloud/src/main/java/com/jiayue/insu/incloud/pushdata/PushDataForSH.java

@@ -186,12 +186,12 @@ public class PushDataForSH implements IPushInitForecastData {
                 record.setState(StatusEnum.SUCCESS.getSign());
                 record.setStateContent(responseSHLNVo.getMessage());
                 log.info("=========={}:{} ==>上送短期原始数据成功  {}天==========", integrationCompany.getName(), station.getStationCode(), daysList.size());
-                log.info("{} 原始数据:{}", stationCode, body);
+//                log.info("{} 原始数据:{}", stationCode, body);
                 recordService.save(record);
                 return true;
             } else {
                 log.error("=========={}:{} ==>上送数据失败 失败标识:{} ,失败原因:{} ==========", integrationCompany.getName(), station.getStationCode(), responseSHLNVo.getCode(), responseSHLNVo.getMessage());
-                log.info("{} 原始数据:{}", stationCode, body);
+//                log.info("{} 原始数据:{}", stationCode, body);
                 record.setState(StatusEnum.FILE_NULL.getSign());
                 record.setStateContent(responseSHLNVo.getMessage());
                 recordService.save(record);

+ 4 - 0
in-cloud/src/main/java/com/jiayue/insu/incloud/pushdata/PushDataToSftp.java

@@ -111,6 +111,10 @@ public class PushDataToSftp implements IPushInitForecastData {
         // 生成新文件
         try {
             newFile = fileUtils.createFileByVelocityTemplate(newFilePath, newFileName, templateName, velocityContext);
+            if(newFile!=null){
+                log.info("生成文件路径:{}",newFile.getAbsolutePath());
+            }
+
         } catch (Exception e) {
             e.printStackTrace();
             record.setState(StatusEnum.CREATE_FILE_FAIL.getSign());

+ 4 - 4
in-cloud/src/main/resources/vms/DR_DQ.vm

@@ -1,7 +1,7 @@
-<! Entity=modeloutput time='${date}'!>
+<! Entity=modeloutput time='${date}' !>
 <modeloutput::${stationCode}J001>
-farmId  scDate	scTime	preDate	preTime	t	rh	pressure	swr	lwr	senf	latf	momf	mslp	clc	prt	prl	prc	ws10	ws30	ws50	ws70	ws80	ws90	ws100	ws170	wd10	wd30	wd50	wd70	wd80	wd90	wd100	wd170
-#foreach( $nwp in $vList )
-${nwp.farmId} ${nwp.scDate} ${nwp.scTime} ${nwp.preDate} ${nwp.preTime} ${nwp.t} ${nwp.rh} ${nwp.pressure} ${nwp.swr} ${nwp.lwr} ${nwp.senf} ${nwp.latf} ${nwp.momf} ${nwp.mslp} ${nwp.clc} ${nwp.prt} ${nwp.prl} ${nwp.prc} ${nwp.ws10} ${nwp.ws30} ${nwp.ws50} ${nwp.ws70} ${nwp.ws80} ${nwp.ws90} ${nwp.ws100} ${nwp.ws170} ${nwp.wd10} ${nwp.wd30} ${nwp.wd50} ${nwp.wd70} ${nwp.wd80} ${nwp.wd90} ${nwp.wd100} ${nwp.wd170}
+times	prepower	upper	lower
+#foreach( $dq in $vList )
+${dq.forecastTime}	${dq.fpValue}	NULL	NULL
 #end
 </modeloutput::${stationCode}J001>

+ 1 - 1
in-cloud/src/main/resources/vms/DR_NWP.vm

@@ -1,5 +1,5 @@
 <! Entity=modeloutput time='${date}'!>
-<气象预测::${stationName} date='${date}'>
+<气象预测::${stationCode} date='${date}'>
 farmId	scDate	scTime	preDate	preTime	t	rh	pressure	swr	lwr	senf	ws10	ws30	ws50	ws70	ws80	ws90	ws100	ws170	wd10	wd30	wd50	wd70	wd80	wd90	wd100	wd170
 #foreach( $nwp in $vList )
 ${nwp.farmId} ${nwp.scDate} ${nwp.scTime} ${nwp.preDate} ${nwp.preTime} ${nwp.t} ${nwp.rh} ${nwp.pressure} ${nwp.swr} ${nwp.lwr} ${nwp.senf} ${nwp.ws10} ${nwp.ws30} ${nwp.ws50} ${nwp.ws70} ${nwp.ws80} ${nwp.ws90} ${nwp.ws100} ${nwp.ws170} ${nwp.wd10} ${nwp.wd30} ${nwp.wd50} ${nwp.wd70} ${nwp.wd80} ${nwp.wd90} ${nwp.wd100} ${nwp.wd170}