소스 검색

Merge branch 'active_course_2021-09-26~29' of http://git.dayaedu.com/yonge/mec into 2021-double-eleven

zouxuan 3 년 전
부모
커밋
4c0af7ee1c

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationDao.java

@@ -33,7 +33,7 @@ public interface OrganizationDao extends BaseDAO<Integer, Organization> {
      * @param userId
      * @return
      */
-    List<Organization> queryEmployeeOrgan(@Param("userId") Integer userId);
+    List<Organization> queryEmployeeOrgan(@Param("userId") Integer userId, @Param("organId") String organId);
 
     /**
      * 根据分部编号获取分部名称map

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroup.java

@@ -205,6 +205,9 @@ public class ClassGroup {
 	}
 
 	public void setStudentNum(Integer studentNum) {
+		if(studentNum == null || studentNum < 0){
+			studentNum = 0;
+		}
 		this.studentNum = studentNum;
 	}
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java

@@ -22,7 +22,7 @@ public interface OrganizationService extends BaseService<Integer, Organization>
      * 获取员工坐在分部列表
      * @return
      */
-    List<Organization> queryEmployeeOrgan(Integer userId) throws Exception;
+    List<Organization> queryEmployeeOrgan(Integer userId,String organId) throws Exception;
 
     /**
      * 获取员工坐在分部列表

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

@@ -42,8 +42,8 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	}
 
 	@Override
-	public List<Organization> queryEmployeeOrgan(Integer userId){
-		return organizationDao.queryEmployeeOrgan(userId);
+	public List<Organization> queryEmployeeOrgan(Integer userId,String organId){
+		return organizationDao.queryEmployeeOrgan(userId,organId);
 	}
 
 	@Override
@@ -56,7 +56,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		if(sysUser.getIsSuperAdmin()){
 			userId = null;
 		}
-		return organizationDao.queryEmployeeOrgan(userId);
+		return organizationDao.queryEmployeeOrgan(userId,null);
 	}
 
 	@Override

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -119,6 +119,9 @@
             <if test="userId != null">
                 AND FIND_IN_SET(o.id_,(SELECT GROUP_CONCAT(organ_id_list_) FROM employee e WHERE e.user_id_ = #{userId}))
             </if>
+            <if test="organId != null and organId != ''">
+                AND FIND_IN_SET(o.id_,#{organId})
+            </if>
         </where>
     </select>
     <select id="findOrganNameMap" resultType="java.util.Map">

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

@@ -50,7 +50,7 @@ public class OrganizationController extends BaseController {
 			throw new BizException("获取用户信息失败");
 		}
 		Integer userId = sysUser.getId();
-        return succeed(organizationService.queryEmployeeOrgan(userId));
+        return succeed(organizationService.queryEmployeeOrgan(userId,null));
     }
 
     @ApiOperation(value = "获取员工所在分部列表(管理员查看所有的分部)")

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -437,7 +437,7 @@ public class StudentManageController extends BaseController {
         if(StringUtils.isNotBlank(organIds)){
             organIdsList = Arrays.stream(organIds.split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
         }else{
-            List<Organization> organizations = organizationService.queryEmployeeOrgan(sysUser.getId());
+            List<Organization> organizations = organizationService.queryEmployeeOrgan(sysUser.getId(),null);
             if(CollectionUtils.isEmpty(organizations)){
                 return succeed();
             }
@@ -454,7 +454,7 @@ public class StudentManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        List<Organization> organizations = organizationService.queryEmployeeOrgan(sysUser.getId());
+        List<Organization> organizations = organizationService.queryEmployeeOrgan(sysUser.getId(),null);
         List<Integer> organIds = new ArrayList<>();
         if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
             organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/ActivityController.java

@@ -240,7 +240,7 @@ public class ActivityController extends BaseController {
     @ApiOperation(value = "云教练活动统计")
     @GetMapping("/countCloudTeacherActive")
     public Object countCloudTeacherActive(CloudTeacherActiveQueryInfo queryInfo) throws Exception {
-        List<Organization> organizations = organizationService.queryEmployeeOrgan(null);
+        List<Organization> organizations = organizationService.queryEmployeeOrgan(null,null);
         List<Integer> organIds = new ArrayList<>();
         if(StringUtils.isNotBlank(queryInfo.getOrganIds())){
             organIds = Arrays.stream(queryInfo.getOrganIds().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/education/EduOrganizationController.java

@@ -33,8 +33,8 @@ public class EduOrganizationController extends BaseController {
 
     @ApiOperation(value = "获取员工所在分部列表")
     @GetMapping("/queryAllOrgan")
-    public Object queryAllOrgan() throws Exception {
-        return succeed(organizationService.queryEmployeeOrgan(null));
+    public Object queryAllOrgan(String organId) throws Exception {
+        return succeed(organizationService.queryEmployeeOrgan(null,organId));
     }
 
     @ApiOperation(value = "获取员工所在分部列表")
@@ -45,7 +45,7 @@ public class EduOrganizationController extends BaseController {
 			throw new BizException("获取用户信息失败");
 		}
 		Integer userId = sysUser.getId();
-        return succeed(organizationService.queryEmployeeOrgan(userId));
+        return succeed(organizationService.queryEmployeeOrgan(userId,null));
     }
 
     @ApiOperation(value = "根据分部id获取合作单位(学校)列表")

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentController.java

@@ -55,7 +55,7 @@ public class EduStudentController extends BaseController {
 			throw new BizException("获取用户信息失败");
 		}
 		Integer userId = sysUser.getId();
-        List<Organization> organizations = organizationService.queryEmployeeOrgan(userId);
+        List<Organization> organizations = organizationService.queryEmployeeOrgan(userId,null);
         if(CollectionUtils.isEmpty(organizations)){
             return succeed(Collections.emptyList());
         }