1.修改保存是create_time为空情况

2.修改职务录用是,修改岗位申请表录用状态
This commit is contained in:
sh
2025-10-14 13:32:46 +08:00
parent 60a9445e6f
commit d843197e5b
6 changed files with 36 additions and 13 deletions

View File

@@ -9,7 +9,8 @@ import com.ruoyi.common.utils.SiteSecurityUtils;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Objects;
/**
@@ -31,7 +32,8 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
Date date = new Date();
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
if(SecurityUtils.isLogin()) {
LoginUser loginUser = null;
LoginSiteUser siteUser = null;
@@ -50,12 +52,12 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
strictInsertFill(metaObject, CREATE_BY, String.class, name);
strictInsertFill(metaObject, CREATE_BY_ID, Long.class, userId);
// 创建时间
strictInsertFill(metaObject, CREATE_TIME, Date.class, date);
strictInsertFill(metaObject, CREATE_TIME, String.class, formattedDate);
// 更新者
strictInsertFill(metaObject, UPDATE_BY, String.class, name);
strictInsertFill(metaObject, UPDATE_BY_ID, Long.class, userId);
// 更新时间
strictInsertFill(metaObject, UPDATE_TIME, Date.class, date);
strictInsertFill(metaObject, UPDATE_TIME, String.class, formattedDate);
// 删除标识
strictInsertFill(metaObject, DEL_FLAG, String.class, "0");
}else {
@@ -63,12 +65,12 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
strictInsertFill(metaObject, CREATE_BY, String.class, "匿名登录");
strictInsertFill(metaObject, CREATE_BY_ID, Long.class, 0l);
// 创建时间
strictInsertFill(metaObject, CREATE_TIME, Date.class, date);
strictInsertFill(metaObject, CREATE_TIME, String.class, formattedDate);
// 更新者
strictInsertFill(metaObject, UPDATE_BY, String.class, "匿名登录");
strictInsertFill(metaObject, UPDATE_BY_ID, Long.class, 0l);
// 更新时间
strictInsertFill(metaObject, UPDATE_TIME, Date.class, date);
strictInsertFill(metaObject, UPDATE_TIME, String.class, formattedDate);
// 删除标识
strictInsertFill(metaObject, DEL_FLAG, String.class, "0");
}
@@ -81,6 +83,8 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
LoginSiteUser siteUser = null;
String name = "";
Long userId = null;
LocalDateTime now = LocalDateTime.now();
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
try {
loginUser = SecurityUtils.getLoginUser();
if(Objects.nonNull(loginUser)){
@@ -104,6 +108,6 @@ public class FieldMetaObjectConfig implements MetaObjectHandler {
strictUpdateFill(metaObject, UPDATE_BY_ID, Long.class, loginUser.getUserId());
}
// 更新时间
strictUpdateFill(metaObject, UPDATE_TIME, Date.class, new Date());
strictUpdateFill(metaObject, UPDATE_TIME, String.class, formattedDate);
}
}