瀏覽代碼

学员考勤列表,管理员看不到记录的问题

zouxuan 3 年之前
父節點
當前提交
0b67797c43

+ 8 - 37
mec-web/src/main/java/com/ym/mec/web/controller/student/StudentAttendanceController.java

@@ -1,31 +1,18 @@
 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;
-import org.springframework.web.bind.annotation.PostMapping;
-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;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("studentAttendance")
 @Api(tags = "学生考勤服务")
@@ -37,9 +24,7 @@ public class StudentAttendanceController extends BaseController {
     @Autowired
     private ClassGroupService classGroupService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
-    private EmployeeDao employeeDao;
+    private OrganizationService organizationService;
 
     //修复逻辑:是连堂课,有签退记录,某个月,遍历有学员签到记录的每节课
     @GetMapping("/repairStudentAttendance")
@@ -67,21 +52,7 @@ public class StudentAttendanceController extends BaseController {
     @RequestMapping("/findStudentAttendance")
     @PreAuthorize("@pcs.hasPermissions('studentAttendance/findStudentAttendance')")
     public Object findStudentAttendance(StudentAttendanceQueryInfo queryInfo){
-    	SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
-        }
-        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("非法请求");
-            }
-        }
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         //按考勤状态和回访状态排序
         queryInfo.setOrderFlag(true);
         return succeed(studentAttendanceService.findStudentAttendance(queryInfo));