Browse Source

系统收费

zouxuan 4 years ago
parent
commit
3a92fe9ad2

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

@@ -637,5 +637,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @param memberEndAutoQuitMusic
      * @return
      */
-    List<StudentRegistration> queryMemberEndAutoQuitMusic(@Param("memberEndAutoQuitMusic") String memberEndAutoQuitMusic, @Param("endDay") Integer endDay);
+    List<StudentRegistration> queryMemberEndAutoQuitMusic(@Param("memberEndAutoQuitMusic") String memberEndAutoQuitMusic,
+                                                          @Param("endDay") Integer endDay,
+                                                          @Param("educationUserId") Integer educationUserId);
 }

+ 21 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -532,7 +532,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
 
 			//乐团学员会员到期首页提醒
-			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic("1",null);
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic("1",null,educationUserId);
 			IndexErrInfoDto noClassMusicGroupStudentInfo = new IndexErrInfoDto();
 			Set<String> musicGroupIds = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
 			Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
@@ -910,7 +910,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		if(StringUtils.isEmpty(configValue)){
 			configValue = "15";
 		}
-		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,0);
+		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,0,educationUserId);
 		Set<String> musicGroupIdList = studentRegistrations.stream().map(e -> e.getMusicGroupId()).collect(Collectors.toSet());
 		Set<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
 		IndexErrInfoDto infoDto = new IndexErrInfoDto();
@@ -982,6 +982,16 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				flag2 = true;
 			}
 		}
+		if(!flag2){
+			String configValue = sysConfigDao.findConfigValue(SysConfigService.PUSH_MEMBER_RENEW_QUIT);
+			if(StringUtils.isEmpty(configValue)){
+				configValue = "15";
+			}
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,0,educationUserId);
+			if(studentRegistrations.size() > 0){
+				flag2 = true;
+			}
+		}
 
 		resultMap.put("studentInfo",flag2);
 		boolean flag3 = false;
@@ -1084,6 +1094,15 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				}
 			}
 		}
+		if(!flag5){
+			//获取关联的乐团列表
+			if(!flag2){
+				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic("1",null,educationUserId);
+				if(studentRegistrations.size() > 0){
+					flag5 = true;
+				}
+			}
+		}
 		resultMap.put("remindMatterData",flag5);
 
 		return resultMap;

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1540,7 +1540,8 @@
         SELECT sr.music_group_id_,sr.user_id_ FROM student_registration sr
         LEFT JOIN music_group mg ON mg.id_ = sr.music_group_id_
         LEFT JOIN cloud_teacher_order cto ON cto.student_id_ = sr.user_id_
-        WHERE sr.music_group_status_ != 'QUIT' AND mg.course_view_type_ = 1 AND mg.status_ = 'PROGRESS' AND cto.status_ IN (1,2)
+        WHERE sr.music_group_status_ != 'QUIT' AND mg.course_view_type_ = 1
+        AND mg.status_ = 'PROGRESS' AND cto.status_ IN (1,2) AND mg.educational_teacher_id_ = #{educationUserId}
         GROUP BY cto.student_id_ HAVING MIN(cto.status_) != 1 AND DATEDIFF(NOW(),MAX(cto.end_time_)) >= #{memberEndAutoQuitMusic}
         <if test="endDay != null">
             AND DATEDIFF(NOW(),MAX(cto.end_time_)) &lt; #{endDay}