zouxuan 5 years ago
parent
commit
fe25600beb

+ 6 - 5
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRegistrationController.java

@@ -10,12 +10,11 @@ import com.keao.edu.user.dto.ExamRecordDto;
 import com.keao.edu.user.dto.ExamRegistrationDto;
 import com.keao.edu.user.dto.ExamRegistrationRoomDto;
 import com.keao.edu.user.dto.ExamRegistrationStatisticsDto;
-import com.keao.edu.user.entity.Employee;
 import com.keao.edu.user.entity.ExamRegistration;
 import com.keao.edu.user.page.ExamRecordQueryInfo;
 import com.keao.edu.user.page.ExamRegistrationQueryInfo;
-import com.keao.edu.user.service.EmployeeService;
 import com.keao.edu.user.service.ExamRegistrationService;
+import com.keao.edu.user.service.OrganizationService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -26,7 +25,6 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
-import java.util.Objects;
 
 /**
  * @Author Joburgess
@@ -42,19 +40,22 @@ public class ExamRegistrationController extends BaseController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private EmployeeService employeeService;
+    private OrganizationService organizationService;
 
     @ApiOperation(value = "学员报名记录查询")
     @GetMapping(value = "list")
     @PreAuthorize("@pcs.hasPermissions('examRegistration/list')")
     public HttpResponseResult<PageInfo<ExamRegistrationRoomDto>> list(ExamRegistrationQueryInfo queryInfo) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        /*SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (!sysUser.getIsSuperAdmin() && Objects.isNull(queryInfo.getOrganId())) {
             Employee employee = employeeService.get(sysUser.getId());
             if(Objects.isNull(employee)){
                 return failed("用户信息异常");
             }
             queryInfo.setOrganId(employee.getOrganId());
+        }*/
+        if(queryInfo.getOrganId() != null){
+            queryInfo.setOrganIds(organizationService.getChildOrganIds(queryInfo.getOrganId(),true));
         }
         return succeed(examRegistrationService.queryExamRegistrationStudents(queryInfo));
     }