fix: 修正企业签到时间与报名记录编译问题

This commit is contained in:
2026-07-24 12:39:00 +08:00
parent 0dc26a9e2e
commit 5f288060d1
2 changed files with 17 additions and 6 deletions

View File

@@ -311,7 +311,7 @@ public class AppOutdoorFairController extends BaseController
attendance.setFairId(fairId);
attendance.setCompanyId(company.getCompanyId());
attendance.setCreateBy(String.valueOf(appUser.getUserId()));
attendance.setCreateTime(checkInTime);
attendance.setCreateTime(formatBaseTime(checkInTime));
}
attendance.setCompanyName(company.getName());
attendance.setContactPerson(company.getContactPerson());
@@ -319,7 +319,7 @@ public class AppOutdoorFairController extends BaseController
attendance.setAttendanceStatus("1");
attendance.setCheckInTime(checkInTime);
attendance.setUpdateBy(String.valueOf(appUser.getUserId()));
attendance.setUpdateTime(checkInTime);
attendance.setUpdateTime(formatBaseTime(checkInTime));
boolean saved = attendance.getId() == null
? outdoorFairCompanyAttendanceMapper.insert(attendance) > 0
: outdoorFairCompanyAttendanceMapper.updateById(attendance) > 0;
@@ -404,6 +404,11 @@ public class AppOutdoorFairController extends BaseController
return null;
}
private static String formatBaseTime(Date value)
{
return value == null ? null : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value);
}
private boolean hasCheckedIn(Long fairId)
{
if (!SiteSecurityUtils.isLogin()) {

View File

@@ -16,6 +16,7 @@ import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.text.SimpleDateFormat;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -677,7 +678,7 @@ public class OutdoorFairController extends BaseController
attendance.setFairId(fairId);
attendance.setCompanyId(company.getCompanyId());
attendance.setCreateBy(getUsername());
attendance.setCreateTime(checkInTime);
attendance.setCreateTime(formatBaseTime(checkInTime));
}
attendance.setCompanyName(company.getName());
attendance.setContactPerson(company.getContactPerson());
@@ -685,7 +686,7 @@ public class OutdoorFairController extends BaseController
attendance.setAttendanceStatus("1");
attendance.setCheckInTime(checkInTime);
attendance.setUpdateBy(getUsername());
attendance.setUpdateTime(checkInTime);
attendance.setUpdateTime(formatBaseTime(checkInTime));
boolean saved = attendance.getId() == null
? outdoorFairCompanyAttendanceMapper.insert(attendance) > 0
: outdoorFairCompanyAttendanceMapper.updateById(attendance) > 0;
@@ -938,7 +939,7 @@ public class OutdoorFairController extends BaseController
if (company == null || company.getStatus() == null || company.getStatus() != 1) {
return AjaxResult.error("只能添加审核通过的企业");
}
FairCompany relation = ensureFairCompany(fairId, companyId);
FairCompany relation = ensureFairCompany(fairId, companyId, "1");
if ("1".equals(relation.getReviewStatus())) {
ensureCompanyAttendanceRecord(fairId, company);
}
@@ -1322,7 +1323,7 @@ public class OutdoorFairController extends BaseController
attendance.setContactPhone(company.getContactPersonPhone());
attendance.setAttendanceStatus("0");
attendance.setCreateBy(getUsername());
attendance.setCreateTime(new Date());
attendance.setCreateTime(formatBaseTime(new Date()));
outdoorFairCompanyAttendanceMapper.insert(attendance);
}
@@ -1341,6 +1342,11 @@ public class OutdoorFairController extends BaseController
.set("update_time", new Date()));
}
private static String formatBaseTime(Date value)
{
return value == null ? null : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(value);
}
private void validateReviewStatus(String reviewStatus)
{
if (!"0".equals(reviewStatus) && !"1".equals(reviewStatus) && !"2".equals(reviewStatus)) {