diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/entity/XYXX.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/entity/XYXX.java index ef00939ad..b251d0880 100644 --- a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/entity/XYXX.java +++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/entity/XYXX.java @@ -14,7 +14,7 @@ import lombok.Data; public class XYXX { /** 编号 */ - @TableId(value = "编号", type = IdType.INPUT) + @TableId(value = "编号") private String bh; /** 学号 */ diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/LogServiceImpl.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/LogServiceImpl.java index fb8adec99..aab906487 100644 --- a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/LogServiceImpl.java +++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/LogServiceImpl.java @@ -3,6 +3,7 @@ package com.roomroot.jwgl.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.roomroot.common.utils.uuid.UUID; import com.roomroot.jwgl.entity.*; import com.roomroot.jwgl.mapper.*; import com.roomroot.jwgl.mapper.*; @@ -11,6 +12,7 @@ import com.roomroot.jwgl.service.LogService; import com.roomroot.jwgl.unit.PageQuery; import com.roomroot.jwgl.unit.PageResult; import com.roomroot.jwgl.utils.JwglRoleHelper; +import com.roomroot.jwgl.utils.UuidUtil; import com.roomroot.jwgl.vo.log.TeacherHoursVO; import com.roomroot.jwgl.vo.log.TeachingLogListVO; import org.springframework.stereotype.Service; @@ -203,6 +205,7 @@ public class LogServiceImpl implements LogService { @Transactional public void importLog(java.util.List list) { for (SSKCB_RZ item : list) { + if(item.getBh()==null)item.setBh(UuidUtil.getUUID()); if (item.getZt() == null) item.setZt("系统创建"); if (item.getCjsj() == null) item.setCjsj(LocalDateTime.now()); sskcbRzMapper.insert(item); @@ -221,6 +224,7 @@ public class LogServiceImpl implements LogService { org.apache.poi.ss.usermodel.Row row = sheet.getRow(i); if (row == null) continue; SSKCB_RZ entity = new SSKCB_RZ(); + entity.setBh(UuidUtil.getUUID()); entity.setRq(parseDate(getCellValue(row.getCell(3)))); entity.setQsjc(toInt(getCellValue(row.getCell(4)))); entity.setJsjc(toInt(getCellValue(row.getCell(5)))); @@ -233,6 +237,7 @@ public class LogServiceImpl implements LogService { entity.setYdrs(toInt(getCellValue(row.getCell(13)))); entity.setSdrs(toInt(getCellValue(row.getCell(14)))); entity.setJsfs(getCellValue(row.getCell(15))); + entity.setCjsj(LocalDateTime.now()); fillNotNullDefaults(entity); sskcbRzMapper.insert(entity); } diff --git a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java index 86d1fe3dd..bca441b35 100644 --- a/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java +++ b/backend/roomroot-jwgl/src/main/java/com/roomroot/jwgl/service/impl/StudentRecordsServiceImpl.java @@ -1,6 +1,7 @@ package com.roomroot.jwgl.service.impl; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -324,6 +325,10 @@ public class StudentRecordsServiceImpl implements StudentRecordsService { if (tableField != null && tableField.value() != null && !tableField.value().isEmpty()) { return tableField.value(); } + TableId tableId = field.getAnnotation(TableId.class); + if (tableId != null && tableId.value() != null && !tableId.value().isEmpty()) { + return tableId.value(); + } return field.getName(); }