| 
					
				 | 
			
			
				@@ -1,8 +1,12 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.ym.mec.web.controller.student; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.Arrays; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.security.access.prepost.PreAuthorize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.web.bind.annotation.GetMapping; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -11,7 +15,11 @@ import org.springframework.web.bind.annotation.RequestBody; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.auth.api.client.SysUserFeignService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.auth.api.entity.SysUser; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.biz.dal.dao.EmployeeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.dto.StudentAttendanceDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.biz.dal.entity.Employee; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.service.ClassGroupService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -28,6 +36,10 @@ public class StudentAttendanceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private StudentAttendanceService studentAttendanceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private ClassGroupService classGroupService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private SysUserFeignService sysUserFeignService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private EmployeeDao employeeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //修复逻辑:是连堂课,有签退记录,某个月,遍历有学员签到记录的每节课 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @GetMapping("/repairStudentAttendance") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -55,6 +67,23 @@ public class StudentAttendanceController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @GetMapping("/findStudentAttendance") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @PreAuthorize("@pcs.hasPermissions('studentAttendance/findStudentAttendance')") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Object findStudentAttendance(StudentAttendanceQueryInfo queryInfo){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    	SysUser sysUser = sysUserFeignService.queryUserInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (sysUser == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return failed("用户信息获取失败"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(!sysUser.getIsSuperAdmin()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Employee employee = employeeDao.get(sysUser.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (StringUtils.isEmpty(queryInfo.getOrganId())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                queryInfo.setOrganId(employee.getOrganIdList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else if(StringUtils.isEmpty(employee.getOrganIdList())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return failed("用户所在分部异常"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<String> list = Arrays.asList(employee.getOrganIdList().split(",")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return failed("非法请求"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return succeed(studentAttendanceService.findStudentAttendance(queryInfo)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |