fix:出/入库时间
This commit is contained in:
parent
12217f261e
commit
bd3f76d8a4
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.spectrum;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.constant.StringConstant;
|
||||
import org.jeecg.common.properties.SpectrumPathProperties;
|
||||
|
@ -88,6 +89,11 @@ public class AlertSpectrum extends AbstractSpectrumHandler{
|
|||
//若本次文件来自于undel目录,解析成功则删除
|
||||
deleteIfFromUndelFile();
|
||||
}catch (Exception e){
|
||||
// 如果解析流程异常 入库开始/结束时间赋初始值
|
||||
if (ObjectUtil.isNull(this.startIntoDatabaseTime))
|
||||
this.startIntoDatabaseTime = new Date();
|
||||
if (ObjectUtil.isNull(this.endIntoDatabaseTime))
|
||||
this.endIntoDatabaseTime = new Date();
|
||||
//异常返回文件名称用于报错日志
|
||||
super.returnFileName.append(super.spectrumFile.getName());
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.spectrum;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.constant.StringConstant;
|
||||
import org.jeecg.common.properties.SpectrumPathProperties;
|
||||
|
@ -89,6 +90,12 @@ public class HealthStatusSpectrum extends AbstractSpectrumHandler{
|
|||
//若本次文件来自于undel目录,解析成功则删除
|
||||
deleteIfFromUndelFile();
|
||||
}catch (Exception e){
|
||||
// 如果解析流程异常 入库开始/结束时间赋初始值
|
||||
if (ObjectUtil.isNull(this.startIntoDatabaseTime))
|
||||
this.startIntoDatabaseTime = new Date();
|
||||
if (ObjectUtil.isNull(this.endIntoDatabaseTime))
|
||||
this.endIntoDatabaseTime = new Date();
|
||||
|
||||
//异常返回文件名称用于报错日志
|
||||
super.returnFileName.append(super.spectrumFile.getName());
|
||||
//处理解析失败的文件
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.jeecg.modules.spectrum;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.constant.StringConstant;
|
||||
import org.jeecg.common.properties.SpectrumPathProperties;
|
||||
|
@ -80,6 +81,12 @@ public class MetSpectrum extends AbstractSpectrumHandler{
|
|||
//若本次文件来自于undel目录,解析成功则删除
|
||||
deleteIfFromUndelFile();
|
||||
}catch (Exception e){
|
||||
// 如果解析流程异常 入库开始/结束时间赋初始值
|
||||
if (ObjectUtil.isNull(this.startIntoDatabaseTime))
|
||||
this.startIntoDatabaseTime = new Date();
|
||||
if (ObjectUtil.isNull(this.endIntoDatabaseTime))
|
||||
this.endIntoDatabaseTime = new Date();
|
||||
|
||||
//异常返回文件名称用于报错日志
|
||||
super.returnFileName.append(super.spectrumFile.getName());
|
||||
throw e;
|
||||
|
|
Loading…
Reference in New Issue
Block a user