Browse Source

系统收费

zouxuan 4 years ago
parent
commit
4a8a7d6a51

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

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

+ 5 - 6
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,educationUserId);
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(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,educationUserId);
+		List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,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();
@@ -987,7 +987,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			if(StringUtils.isEmpty(configValue)){
 				configValue = "15";
 			}
-			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,0,educationUserId);
+			List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(configValue,educationUserId);
 			if(studentRegistrations.size() > 0){
 				flag2 = true;
 			}
@@ -1095,9 +1095,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 		}
 		if(!flag5){
-			//获取关联的乐团列表
-			if(!flag2){
-				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic("1",null,educationUserId);
+			if(!flag5){
+				List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryMemberEndAutoQuitMusic(null,educationUserId);
 				if(studentRegistrations.size() > 0){
 					flag5 = true;
 				}

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

@@ -110,7 +110,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 //			}
 //		}
 		if(expectAmount.doubleValue() > 0){
-			BigDecimal totalAmount = calender.getPaymentAmount().add(calender.getMemberPaymentAmount());
+			BigDecimal totalAmount = calender.getPaymentAmount();
 			BigDecimal subExpectAmount = expectAmount;
 			if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.SPAN_GROUP_CLASS_ADJUST){
 				List<MusicGroupPaymentCalenderStudentDetail> studentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNoAndUserId(calender.getBatchNo(), calenderDetails.get(0).getUserId());

+ 10 - 4
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1541,10 +1541,16 @@
         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) 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}
+        AND mg.status_ = 'PROGRESS' AND cto.status_ IN (1,2)
+        <if test="educationUserId != null">
+            AND mg.educational_teacher_id_ = #{educationUserId}
+        </if>
+        GROUP BY cto.student_id_ HAVING MIN(cto.status_) != 1
+        <if test="memberEndAutoQuitMusic != null">
+            AND DATEDIFF(MAX(cto.end_time_),NOW()) &lt;= #{memberEndAutoQuitMusic} AND DATEDIFF(NOW(),MAX(cto.end_time_)) >= 0
+        </if>
+        <if test="memberEndAutoQuitMusic == null">
+            AND DATEDIFF(MAX(cto.end_time_),NOW()) &lt; 0
         </if>
     </select>
 </mapper>

+ 1 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupPaymentCalenderController.java

@@ -83,6 +83,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
             }else {
                 model.put("calenderCourseSettings", musicGroupPaymentStudentCourseDetailDao.findByCalenderAndUserId(calenderId,userId));
             }
+            calender.setMemberPaymentAmount(calenderDetail.getExpectMemberAmount());
             model.put("musicGroup",musicGroupDao.get(musicGroupId));
             model.put("amount", calenderDetail.getExpectAmount().add(calenderDetail.getExpectMemberAmount()));
             model.put("balance",studentRegistration.getBalance());