Joburgess 5 years ago
parent
commit
aa9b9e8706

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/StudentAttendanceService.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.CourseScheduleResponse;
-import com.ym.mec.biz.dal.dto.StudentAttendanceDto;
 import com.ym.mec.biz.dal.dto.StudentPersonalAttendanceDto;
 import com.ym.mec.biz.dal.entity.StudentAttendance;
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
@@ -10,6 +9,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
 import java.util.Map;
 
 public interface StudentAttendanceService extends BaseService<Long, StudentAttendance> {
@@ -19,7 +19,7 @@ public interface StudentAttendanceService extends BaseService<Long, StudentAtten
 	 * @Date: 2019/9/11
 	 * 批量插入学生上课签到信息
 	 */
-	Map addStudentAttendances(StudentAttendanceDto studentAttendanceInfo);
+	Map addStudentAttendances(List<StudentAttendance> studentAttendances);
 
 	/**
 	 * @describe 获取当前课程的学生

+ 8 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -66,8 +66,8 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public Map addStudentAttendances(StudentAttendanceDto studentAttendanceInfos) {
-		List<StudentAttendance> studentAttendances=studentAttendanceInfos.getStudentAttendances();
+	public Map addStudentAttendances(List<StudentAttendance> studentAttendances) {
+//		List<StudentAttendance> studentAttendances=studentAttendanceInfos.getStudentAttendances();
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if(Objects.isNull(sysUser)){
 			throw new BizException("请登录");
@@ -135,11 +135,12 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		courseSchedule.setLeaveStudentNum(leaveStudentNum);
 		courseScheduleDao.update(courseSchedule);
 
-		TeacherSignOutDto teacherSignOutDto=new TeacherSignOutDto();
-		TeacherAttendance teacherAttendance = new TeacherAttendance(courseSchedule.getId(), 0);
-		teacherAttendance.setSignInLongitudeLatitude(studentAttendanceInfos.getSignInLongitudeLatitude());
-		teacherSignOutDto.setTeacherAttendanceInfo(teacherAttendance);
-		return teacherAttendanceService.addTeacherAttendanceRecord(teacherSignOutDto);
+//		TeacherSignOutDto teacherSignOutDto=new TeacherSignOutDto();
+//		TeacherAttendance teacherAttendance = new TeacherAttendance(courseSchedule.getId(), 0);
+//		teacherAttendance.setSignInLongitudeLatitude(studentAttendanceInfos.getSignInLongitudeLatitude());
+//		teacherSignOutDto.setTeacherAttendanceInfo(teacherAttendance);
+//		return teacherAttendanceService.addTeacherAttendanceRecord(teacherSignOutDto);
+        return null;
 	}
 
 	@Override

+ 5 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherAttendanceController.java

@@ -1,7 +1,7 @@
 package com.ym.mec.teacher.controller;
 
-import com.ym.mec.biz.dal.dto.StudentAttendanceDto;
 import com.ym.mec.biz.dal.dto.TeacherSignOutDto;
+import com.ym.mec.biz.dal.entity.StudentAttendance;
 import com.ym.mec.biz.dal.page.TeacherAttendanceQueryInfo;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.StudentAttendanceService;
@@ -12,6 +12,8 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 @RequestMapping("teacherAttendance")
 @Api(tags = "教师签到服务")
 @RestController
@@ -46,7 +48,7 @@ public class TeacherAttendanceController extends BaseController {
 
     @ApiOperation(value = "点名")
     @PostMapping("/addStudentAttendances")
-    public Object addStudentAttendances(@RequestBody StudentAttendanceDto studentAttendanceInfo){
-        return succeed(studentAttendanceService.addStudentAttendances(studentAttendanceInfo));
+    public Object addStudentAttendances(@RequestBody List<StudentAttendance> studentAttendances){
+        return succeed(studentAttendanceService.addStudentAttendances(studentAttendances));
     }
 }