|
@@ -5,15 +5,15 @@ import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.biz.dal.dao.StudentAttendanceDao;
|
|
import com.ym.mec.biz.dal.dao.StudentAttendanceDao;
|
|
import com.ym.mec.biz.dal.dto.StudentAttendanceDto;
|
|
import com.ym.mec.biz.dal.dto.StudentAttendanceDto;
|
|
import com.ym.mec.biz.dal.dto.TeacherSignOutDto;
|
|
import com.ym.mec.biz.dal.dto.TeacherSignOutDto;
|
|
|
|
+import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
import com.ym.mec.biz.dal.entity.StudentAttendance;
|
|
import com.ym.mec.biz.dal.entity.StudentAttendance;
|
|
|
|
+import com.ym.mec.biz.dal.enums.GroupType;
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
|
|
import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
|
|
import com.ym.mec.biz.dal.enums.UpdateAttendanceEnum;
|
|
import com.ym.mec.biz.dal.enums.UpdateAttendanceEnum;
|
|
import com.ym.mec.biz.dal.page.TeacherAttendanceQueryInfo;
|
|
import com.ym.mec.biz.dal.page.TeacherAttendanceQueryInfo;
|
|
-import com.ym.mec.biz.service.ClassGroupService;
|
|
|
|
-import com.ym.mec.biz.service.StudentAttendanceService;
|
|
|
|
-import com.ym.mec.biz.service.SysMessageService;
|
|
|
|
-import com.ym.mec.biz.service.TeacherAttendanceService;
|
|
|
|
|
|
+import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.exception.BizException;
|
|
@@ -50,6 +50,10 @@ public class TeacherAttendanceController extends BaseController {
|
|
private SysUserFeignService sysUserFeignService;
|
|
private SysUserFeignService sysUserFeignService;
|
|
@Autowired
|
|
@Autowired
|
|
private SysMessageService sysMessageService;
|
|
private SysMessageService sysMessageService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CourseScheduleService courseScheduleService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MusicGroupService musicGroupService;
|
|
|
|
|
|
@ApiOperation(value = "新增教师签到")
|
|
@ApiOperation(value = "新增教师签到")
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
@@ -84,6 +88,7 @@ public class TeacherAttendanceController extends BaseController {
|
|
if(remindNum>0){
|
|
if(remindNum>0){
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
+ CourseSchedule courseSchedule = courseScheduleService.get(courseId);
|
|
//获取正常签到的学生信息
|
|
//获取正常签到的学生信息
|
|
List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseId(courseId);
|
|
List<StudentAttendance> studentAttendances = studentAttendanceDao.findByCourseId(courseId);
|
|
if(CollectionUtils.isEmpty(studentAttendances)){
|
|
if(CollectionUtils.isEmpty(studentAttendances)){
|
|
@@ -102,6 +107,19 @@ public class TeacherAttendanceController extends BaseController {
|
|
return failed("还未有学生到课");
|
|
return failed("还未有学生到课");
|
|
}
|
|
}
|
|
studentAttendanceDao.updateNormalRemind(courseId);
|
|
studentAttendanceDao.updateNormalRemind(courseId);
|
|
|
|
+ if(Objects.nonNull(courseSchedule)&& GroupType.MUSIC.equals(courseSchedule.getGroupType())){
|
|
|
|
+ MusicGroup musicGroup = musicGroupService.get(courseSchedule.getMusicGroupId());
|
|
|
|
+ if(Objects.isNull(musicGroup)||Objects.isNull(musicGroup.getTransactionTeacherId())){
|
|
|
|
+ return succeed();
|
|
|
|
+ }
|
|
|
|
+ int normalStudentNum = normal.size();
|
|
|
|
+ long leaveStudentNum = studentAttendances.stream().filter(studentAttendance -> studentAttendance.getStatus() == StudentAttendanceStatusEnum.LEAVE).count();
|
|
|
|
+ long truantStudentNum = studentAttendances.stream().filter(studentAttendance -> studentAttendance.getStatus() == StudentAttendanceStatusEnum.TRUANT).count();
|
|
|
|
+ Map<Integer, String> receivers = new HashMap<>();
|
|
|
|
+ receivers.put(musicGroup.getTransactionTeacherId(), musicGroup.getTransactionTeacherId().toString());
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SYSTEM_PUSH_NAMES_ACHIEVE,
|
|
|
|
+ receivers, null, 0, null, "SYSTEM", normalStudentNum, leaveStudentNum, truantStudentNum);
|
|
|
|
+ }
|
|
return succeed();
|
|
return succeed();
|
|
}
|
|
}
|
|
|
|
|