Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 years ago
parent
commit
f1d0b9b634

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -111,7 +111,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             Set<Integer> subjectIds = dataList.stream().map(e -> e.getActualSubjectId()).collect(Collectors.toSet());
             Map<Integer,String> subjectMap = MapUtil.convertIntegerMap(musicGroupSubjectPlanDao.findSubjectMap(subjectIds,queryInfo.getMusicGroupId()));
             dataList.forEach(e->{
-                e.setKitGroupPurchaseTypeEnum(KitGroupPurchaseTypeEnum.valueOf(subjectMap.get(e.getActualSubjectId())));
+            	if(StringUtils.isNotBlank(subjectMap.get(e.getActualSubjectId()))){
+            		e.setKitGroupPurchaseTypeEnum(KitGroupPurchaseTypeEnum.valueOf(subjectMap.get(e.getActualSubjectId())));
+            	}
             });
         }
         if (count == 0) {

+ 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));
     }
 }