Kaynağa Gözat

首页异常提醒调整

zouxuan 2 yıl önce
ebeveyn
işleme
f9f3e367ba

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

@@ -195,7 +195,8 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
     int countNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds,
                                  @Param("educationUserId") Integer educationUserId,
-                                 @Param("noPaymentType") Integer noPaymentType,@Param("tenantId") Integer tenantId);
+                                 @Param("tenantId") Integer tenantId,
+                                 @Param("hasCourse") Boolean hasCourse);
 
 
 

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ArrearageStudentsQueryInfo.java

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.dal.page;
 
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -23,6 +22,17 @@ public class ArrearageStudentsQueryInfo extends QueryInfo {
 
     private Integer courseViewType;
 
+    @ApiModelProperty(value = "是否排课(用于区分欠费学员异常和欠费学员提醒)")
+    private Boolean hasCourse = true;
+
+    public Boolean getHasCourse() {
+        return hasCourse;
+    }
+
+    public void setHasCourse(Boolean hasCourse) {
+        this.hasCourse = hasCourse;
+    }
+
     public Integer getCourseViewType() {
         return courseViewType;
     }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/NoClassMusicStudentQueryInfo.java

@@ -14,6 +14,17 @@ public class NoClassMusicStudentQueryInfo extends EducationBaseQueryInfo {
     @ApiModelProperty(value = "学员姓名/编号")
     private String studentSearch;
 
+    @ApiModelProperty(value = "乐团是否开课")
+    private Boolean hasCourse = true;
+
+    public Boolean getHasCourse() {
+        return hasCourse;
+    }
+
+    public void setHasCourse(Boolean hasCourse) {
+        this.hasCourse = hasCourse;
+    }
+
     public String getMusicGroupSearch() {
         return musicGroupSearch;
     }

+ 6 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -722,7 +722,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_ERROR_LEAVE, IndexErrorType.STUDENT_ERROR_LEAVE.getMsg(),studentErrorLeave , null));
 
 			//未缴费学员数
-			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_ARREARAGE, IndexErrorType.STUDENT_ARREARAGE.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId,0,tenantId), Arrays.asList(educationUserId)));
+			twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_ARREARAGE, IndexErrorType.STUDENT_ARREARAGE.getMsg(),
+					indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId,tenantId,true), Arrays.asList(educationUserId)));
 
 			//申请退团学员数
 			List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds,educationUserId,tenantId);
@@ -1107,7 +1108,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<IndexErrInfoDto> result = new ArrayList<>();
 
 		//未缴费学员数
-		result.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIdSet,educationUserId, 1, tenantId), Arrays.asList(educationUserId)));
+		result.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(),
+				indexBaseMonthDataDao.countNoPaymentStudentNum(organIdSet,educationUserId,tenantId,false), Arrays.asList(educationUserId)));
 
 		String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
 		//全职未离职老师
@@ -1200,7 +1202,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 
 		if(!flag2){
-			int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId, 0, tenantId);
+			int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId, tenantId,true);
 			if(countNoPaymentStudentNum > 0){
 				flag2 = true;
 			}
@@ -1321,7 +1323,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 		}
 		if(!flag5){
-			int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId, 1, tenantId);
+			int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds,educationUserId, tenantId,false);
 			if(countNoPaymentStudentNum > 0){
 				flag5 = true;
 			}

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -834,20 +834,21 @@
 			COUNT(DISTINCT mgpc.music_group_id_,mgpcd.user_id_)
 		FROM
 		music_group_payment_calender_detail mgpcd
+		LEFT JOIN music_group_payment_student_course_detail mgpsc ON mgpsc.music_group_payment_calender_id_ = mgpcd.music_group_payment_calender_id_
 		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
 		LEFT JOIN music_group mg ON mgpc.music_group_id_ = mg.id_
 		LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_ AND mgpcd.user_id_ = sr.user_id_
 		WHERE
 		mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId}
 		AND ((mgpc.member_rank_setting_id_ IS NOT NULL AND (sr.membership_end_time_ &lt; NOW() OR sr.membership_end_time_ IS NULL)) OR mgpc.member_rank_setting_id_ IS NULL)
-		<if test="noPaymentType==null or noPaymentType==0">
-			AND DATE_FORMAT(NOW(),'%Y-%m-%d') > DATE_FORMAT(mgpc.deadline_payment_date_,'%Y-%m-%d')
-		</if>
-		<if test="noPaymentType!=null and noPaymentType==1">
-			AND DATE_FORMAT(NOW(),'%Y-%m-%d') BETWEEN DATE_FORMAT(mgpc.start_payment_date_,'%Y-%m-%d') AND DATE_FORMAT(mgpc.deadline_payment_date_,'%Y-%m-%d')
-		</if>
 		AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.batch_no_ IS NOT NULL AND mgpc.pay_user_type_ = 'STUDENT'
 		AND mgpc.current_total_amount_ > 0
+		<if test="hasCourse != null and hasCourse == 'true'">
+			AND mgpsc.used_course_minutes_ > 0
+		</if>
+		<if test="hasCourse != null and hasCourse == 'false'">
+			AND mgpsc.used_course_minutes_ = 0
+		</if>
 		<if test="educationUserId != null">
 			AND mg.educational_teacher_id_ = #{educationUserId}
 		</if>

+ 7 - 1
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -440,8 +440,14 @@
 
 	<sql id="queryArrearageStudentsCondition">
 		<where>
-			mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId} AND mgpsc.used_course_minutes_ > 0
+			mg.status_ = 'PROGRESS' and mg.tenant_id_ = #{tenantId}
 			AND ((mgpc.member_rank_setting_id_ IS NOT NULL AND (sr.membership_end_time_ &lt; NOW() OR sr.membership_end_time_ IS NULL)) OR mgpc.member_rank_setting_id_ IS NULL)
+			<if test="hasCourse != null and hasCourse == 'true'">
+				AND mgpsc.used_course_minutes_ > 0
+			</if>
+			<if test="hasCourse != null and hasCourse == 'false'">
+				AND mgpsc.used_course_minutes_ = 0
+			</if>
 			<if test="noPaymentType==null or noPaymentType==0">
 				AND DATE_FORMAT(NOW(),'%Y-%m-%d') > DATE_FORMAT(mgpc.deadline_payment_date_,'%Y-%m-%d')
 			</if>

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

@@ -1240,10 +1240,16 @@
         <where>
             sr.music_group_status_ = 'NORMAL' and sr.tenant_id_ = #{tenantId}
             AND mg.status_ = 'PROGRESS'
-            AND cgsm.id_ IS NULL AND mg.first_course_start_time_ >= NOW()
+            AND cgsm.id_ IS NULL
             <if test="organIds != null and organIds != ''">
                 AND FIND_IN_SET(mg.organ_id_,#{organIds})
             </if>
+            <if test="hasCourse != null and hasCourse == 'true'">
+                AND mg.first_course_start_time_ >= NOW()
+            </if>
+            <if test="hasCourse != null and hasCourse == 'false'">
+                AND (mg.first_course_start_time_ &lt; NOW() OR mg.first_course_start_time_ IS NULL)
+            </if>
             <if test="educationUserId != null">
                 AND mg.educational_teacher_id_ = #{educationUserId}
             </if>