|
|
@@ -2,6 +2,7 @@ package com.xjrsoft.module.student.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
@@ -10,6 +11,7 @@ import com.xjrsoft.common.enums.StudentChangeTypeEnum;
|
|
|
import com.xjrsoft.common.enums.StudyStatusEnum;
|
|
|
import com.xjrsoft.module.organization.entity.User;
|
|
|
import com.xjrsoft.module.organization.service.IUserService;
|
|
|
+import com.xjrsoft.module.room.entity.RoomBed;
|
|
|
import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
|
|
|
import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
|
|
|
import com.xjrsoft.module.student.dto.StudentReportSignDto;
|
|
|
@@ -80,20 +82,28 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
|
|
|
StudentReportRecord record = this.getById(dto.getId());
|
|
|
record.setModifyDate(new Date());
|
|
|
record.setUserId(StpUtil.getLoginIdAsLong());
|
|
|
- record.setReportTime(new Date());
|
|
|
- this.updateById(record);
|
|
|
+ if(record.getReportTime() != null){
|
|
|
+ UpdateWrapper<StudentReportRecord> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("id", dto.getId());
|
|
|
+ updateWrapper.setSql("report_time = null");
|
|
|
+ this.update(record, updateWrapper);
|
|
|
+ }else{
|
|
|
+ record.setReportTime(new Date());
|
|
|
+ this.updateById(record);
|
|
|
|
|
|
- BaseStudent student = studentService.getOne(
|
|
|
- new QueryWrapper<BaseStudent>().lambda()
|
|
|
- .eq(BaseStudent::getUserId, record.getUserId())
|
|
|
- .eq(BaseStudent::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
- );
|
|
|
- student.setIsNormal(1);
|
|
|
- studentService.updateById(student);
|
|
|
+ BaseStudent student = studentService.getOne(
|
|
|
+ new QueryWrapper<BaseStudent>().lambda()
|
|
|
+ .eq(BaseStudent::getUserId, record.getUserId())
|
|
|
+ .eq(BaseStudent::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ student.setIsNormal(1);
|
|
|
+ studentService.updateById(student);
|
|
|
+
|
|
|
+ User user = userService.getById(record.getUserId());
|
|
|
+ user.setEnabledMark(EnabledMark.ENABLED.getCode());
|
|
|
+ userService.updateById(user);
|
|
|
+ }
|
|
|
|
|
|
- User user = userService.getById(record.getUserId());
|
|
|
- user.setEnabledMark(EnabledMark.ENABLED.getCode());
|
|
|
- userService.updateById(user);
|
|
|
return true;
|
|
|
}
|
|
|
|