|
|
@@ -9,6 +9,7 @@ import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
|
import com.xjrsoft.common.enums.StudentChangeTypeEnum;
|
|
|
import com.xjrsoft.common.enums.StudyStatusEnum;
|
|
|
+import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
|
|
|
@@ -16,11 +17,13 @@ import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
|
|
|
import com.xjrsoft.module.student.dto.StudentReportSignDto;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
+import com.xjrsoft.module.student.entity.StudentReportPlan;
|
|
|
import com.xjrsoft.module.student.entity.StudentReportRecord;
|
|
|
import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
|
|
|
import com.xjrsoft.module.student.service.IBaseStudentService;
|
|
|
import com.xjrsoft.module.student.service.IStudentChangeRecordService;
|
|
|
+import com.xjrsoft.module.student.service.IStudentReportPlanService;
|
|
|
import com.xjrsoft.module.student.service.IStudentReportRecordService;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
|
|
|
import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
|
|
|
@@ -30,6 +33,8 @@ import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -47,6 +52,7 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
|
|
|
private final IUserService userService;
|
|
|
private final IBaseStudentSchoolRollService rollService;
|
|
|
private final IStudentChangeRecordService changeRecordService;
|
|
|
+ private final IStudentReportPlanService planService;
|
|
|
@Override
|
|
|
public StudentReportRecordStatisticsVo getClassStatistics(StudentReportRecordStatisticsDto dto) {
|
|
|
return this.baseMapper.getClassStatistics(dto);
|
|
|
@@ -154,7 +160,14 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean updateStduyStatus(StudentReportSignDto dto) {
|
|
|
+ LocalDate now = LocalDate.now();
|
|
|
StudentReportRecord record = this.getById(dto.getId());
|
|
|
+ StudentReportPlan reportPlan = planService.getById(record.getStudentReportPlanId());
|
|
|
+ if(!(now.isAfter(reportPlan.getUpdateStartTime()) && now.isBefore(reportPlan.getUpdateEndTime())) || !now.equals(reportPlan.getUpdateStartTime()) || !now.equals(reportPlan.getUpdateEndTime())){
|
|
|
+ throw new MyException("不在修改时间内,无法修改");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
BaseStudentSchoolRoll roll = rollService.getOne(
|
|
|
new QueryWrapper<BaseStudentSchoolRoll>().lambda()
|
|
|
.eq(BaseStudentSchoolRoll::getUserId, record.getUserId())
|