fix:出/入库时间

This commit is contained in:
nieziyan 2024-01-15 13:54:19 +08:00
parent 12217f261e
commit bd3f76d8a4
3 changed files with 20 additions and 0 deletions

View File

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

View File

@ -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());
//处理解析失败的文件

View File

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