添加日志的操作人和时间的完整性

This commit is contained in:
sh
2026-02-04 23:13:13 +08:00
parent f7f31ae0fa
commit a5af4b6615
17 changed files with 361 additions and 25 deletions

View File

@@ -43,6 +43,10 @@ public class SysJobLog extends BaseEntity
@Excel(name = "异常信息")
private String exceptionInfo;
/**时间加密字段*/
@Excel(name = "时间加密字段")
private String createTimeCipher;
/** 开始时间 */
private Date startTime;
@@ -139,6 +143,14 @@ public class SysJobLog extends BaseEntity
this.stopTime = stopTime;
}
public String getCreateTimeCipher() {
return createTimeCipher;
}
public void setCreateTimeCipher(String createTimeCipher) {
this.createTimeCipher = createTimeCipher;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -150,6 +162,7 @@ public class SysJobLog extends BaseEntity
.append("exceptionInfo", getExceptionInfo())
.append("startTime", getStartTime())
.append("stopTime", getStopTime())
.append("createTimeCipher", getCreateTimeCipher())
.toString();
}
}

View File

@@ -1,6 +1,9 @@
package com.ruoyi.quartz.util;
import java.util.Date;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.EncryptDecryptUtil;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -91,7 +94,14 @@ public abstract class AbstractQuartzJob implements Job
{
sysJobLog.setStatus(Constants.SUCCESS);
}
try {
String createTime=DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,startTime);
String createTimeCipher =SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(createTime);
sysJobLog.setCreateTimeCipher(createTimeCipher);
sysJobLog.setCreateTime(createTime);
}catch (org.quickssl.api.CryptoClient.CryptoException ex){
ex.printStackTrace();
}
// 写入数据库当中
SpringUtils.getBean(ISysJobLogService.class).addJobLog(sysJobLog);
}