yonge 5 лет назад
Родитель
Сommit
92cdbba29a

+ 4 - 1
mec-biz/src/main/resources/config/mybatis/SchoolMapper.xml

@@ -136,6 +136,9 @@
         select * from school where del_flag_ != 1 and user_id_ = #{userId}
     </select>
     <select id="findVipSchoolByUserId" resultMap="School">
-        SELECT * FROM school WHERE del_flag_ != 1 AND (FIND_IN_SET(organ_id_,#{organId}) and user_id_ is NULL) or user_id_ = #{userId}
+        SELECT * FROM school WHERE del_flag_ != 1 or user_id_ = #{userId}
+        <if test="organId != null">
+        AND (FIND_IN_SET(organ_id_,#{organId}) and user_id_ is NULL)
+        </if>
     </select>
 </mapper>

+ 11 - 1
mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.timevale.tgtext.text.pdf.PdfStructTreeController.returnType;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
@@ -8,9 +9,11 @@ import com.ym.mec.biz.dal.entity.School;
 import com.ym.mec.biz.dal.page.SchoolQueryInfo;
 import com.ym.mec.biz.service.SchoolService;
 import com.ym.mec.common.controller.BaseController;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -119,7 +122,14 @@ public class SchoolController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        String organidList = sysUser.getOrganId();
+        String organidList = null;
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if(employee == null){
+            	return failed("非法请求");
+            }
+            organidList = employee.getOrganIdList();
+        }
         return succeed(schoolService.findVipSchoolByTeacher(userId,organidList,null));
     }
 }