| | |
| | | package com.qxueyou.scc.controller; |
| | | |
| | | import com.qxueyou.scc.admin.attendance.AttendanceService; |
| | | import com.qxueyou.scc.base.model.Result; |
| | | import com.qxueyou.scc.base.util.CollectionUtils; |
| | | import com.qxueyou.scc.base.util.QBeanUtils; |
| | | import com.qxueyou.scc.teach.student.model.StuStudent; |
| | | import com.qxueyou.scc.teach.subject.service.impl.SubjectService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags="考勤管理接口") |
| | | import java.util.List; |
| | | |
| | | @Api(tags="考勤管理接口") |
| | | @RestController |
| | | @RequestMapping("/admin/AttendanceController") |
| | | @RequestMapping("/admin/Attendance") |
| | | public class AttendanceController { |
| | | @Autowired |
| | | private AttendanceService attendanceService; |
| | | |
| | | @ApiOperation(value = "打卡", notes = "") |
| | | @PostMapping(value = "/attendanceUpAndAdd") |
| | | public String attendanceUpAndAdd(String studentId, String subjectId) { |
| | | return attendanceService.attendanceUpAndAdd(studentId,subjectId); |
| | | private SubjectService subjectService; |
| | | |
| | | @ApiOperation(value = "打卡", notes = "") |
| | | @GetMapping(value = "/attendanceUpAndAdd") |
| | | public String attendanceUpAndAdd(String userId, String subjectId, String subjectName) { |
| | | return attendanceService.attendanceUpAndAdd(userId,subjectId,subjectName); |
| | | } |
| | | |
| | | @ApiOperation(value = "考勤信息", notes = "") |
| | | @GetMapping(value = "/attendanceList") |
| | | public Result attendanceList(@RequestParam(defaultValue = "10") Integer limit, @RequestParam(defaultValue = "1") Integer pageNum, String keyword, String subjectId) { |
| | | |
| | | List<StuStudent> attendanceList = attendanceService.findAttendanceList(limit, pageNum, keyword,subjectId); |
| | | |
| | | int count = attendanceService.findAttendanceListCount(keyword,subjectId); |
| | | |
| | | |
| | | return new Result(true,"success", CollectionUtils.newObjectMap("attendanceList", |
| | | QBeanUtils.listBean2ListMap(attendanceList, |
| | | CollectionUtils.newStringMap("name", "studentName", "studentNo", "studentNo","sex","sex","mobilePhone","mobilePhone", "attendanceStatus", |
| | | "attendanceStatus", "createTime", "createTime", "studentId", "studentId")), |
| | | "attendanceCount", count)); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改考勤状态", notes = "") |
| | | @GetMapping(value = "/updateAttendanceStatus") |
| | | public Result updateAttendanceStatus(String[] studentId, String attendanceStatus) { |
| | | return attendanceService.updateAttendanceStatus(studentId,attendanceStatus); |
| | | } |
| | | } |