Explorar o código

Merge remote-tracking branch 'origin/master'

zouxuan %!s(int64=4) %!d(string=hai) anos
pai
achega
5de872dcf1

+ 9 - 15
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -41,52 +41,46 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @describe 统计系统中指定时间段的学员注册数据
      * @author Joburgess
      * @date 2021/1/7 0007
-     * @param month:
      * @return java.util.List<com.ym.mec.biz.dal.dto.IndexBaseMonthDto>
      */
-    List<IndexBaseMonthData> getStudentSignUpData(@Param("month") String month);
+    List<IndexBaseMonthData> getStudentSignUpData();
 
     /**
      * @describe 统计作业布置数据
      * @author Joburgess
      * @date 2021/1/7 0007
-     * @param month:
      * @return java.util.List<com.ym.mec.biz.dal.dto.IndexBaseMonthDto>
      */
-    List<IndexBaseMonthData> getHomeworkData(@Param("month") String month,
-                                             @Param("type") String type);
+    List<IndexBaseMonthData> getHomeworkData(@Param("type") String type);
 
     /**
      * @describe 统计合作单位数据
      * @author Joburgess
      * @date 2021/1/11 0011
-     * @param month:
      * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
      */
-    List<IndexBaseMonthData> getSchoolData(@Param("month") String month);
+    List<IndexBaseMonthData> getSchoolData();
 
     /**
      * @describe 统计乐团数据
      * @author Joburgess
      * @date 2021/1/11 0011
-     * @param month:
      * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
      */
-    List<IndexBaseMonthData> getMusicData(@Param("month") String month);
+    List<IndexBaseMonthData> getMusicData();
 
     /**
      * @describe 统计乐团学员数据
      * @author Joburgess
      * @date 2021/1/11 0011
-     * @param month:
      * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
      */
-    List<IndexBaseMonthData> getMusicStudentData(@Param("month") String month);
+    List<IndexBaseMonthData> getMusicStudentData();
 
-    List<IndexBaseMonthData> getTeacherData(@Param("month") String month,
-                                            @Param("jobNature") JobNatureEnum jobNature,
+    List<IndexBaseMonthData> getOtherStudentData();
+
+    List<IndexBaseMonthData> getTeacherData(@Param("jobNature") JobNatureEnum jobNature,
                                             @Param("isDemission") Boolean isDemission);
 
-    List<IndexBaseMonthData> getGroupCourseData(@Param("month") String month,
-                                                @Param("groupType")GroupType groupType);
+    List<IndexBaseMonthData> getGroupCourseData(@Param("groupType")GroupType groupType);
 }

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

@@ -93,16 +93,16 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		startMonth = df.format(nowDate);
 
 		//运营数据
-		saveData(indexBaseMonthDataDao.getSchoolData(startMonth), startMonth, IndexDataType.SCHOOL);
-		saveData(indexBaseMonthDataDao.getMusicData(startMonth), startMonth, IndexDataType.MUSIC_GROUP_NUM);
-		saveData(indexBaseMonthDataDao.getMusicStudentData(startMonth), startMonth, IndexDataType.MUSIC_GROUP_STUDENT);
-		saveData(null, startMonth, IndexDataType.OTHER_STUDENT);
+		saveData(indexBaseMonthDataDao.getSchoolData(), startMonth, IndexDataType.SCHOOL);
+		saveData(indexBaseMonthDataDao.getMusicData(), startMonth, IndexDataType.MUSIC_GROUP_NUM);
+		saveData(indexBaseMonthDataDao.getMusicStudentData(), startMonth, IndexDataType.MUSIC_GROUP_STUDENT);
+		saveData(indexBaseMonthDataDao.getOtherStudentData(), startMonth, IndexDataType.OTHER_STUDENT);
 
 		//业务数据
-		saveData(indexBaseMonthDataDao.getStudentSignUpData(startMonth), startMonth, IndexDataType.ACTIVATION_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, null), startMonth, IndexDataType.HOMEWORK_CREATE_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, "submit"), startMonth, IndexDataType.HOMEWORK_SUBMIT_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData(startMonth, "comment"), startMonth, IndexDataType.HOMEWORK_COMMENT_RATE);
+		saveData(indexBaseMonthDataDao.getStudentSignUpData(), startMonth, IndexDataType.ACTIVATION_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData(null), startMonth, IndexDataType.HOMEWORK_CREATE_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData("submit"), startMonth, IndexDataType.HOMEWORK_SUBMIT_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData("comment"), startMonth, IndexDataType.HOMEWORK_COMMENT_RATE);
 
 		//经营数据
 		saveData(null, startMonth, IndexDataType.SHOULD_INCOME_MONEY);
@@ -112,10 +112,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		saveData(null, startMonth, IndexDataType.REVENUE_MONEY);
 
 		//人事数据
-		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, null, null), startMonth, IndexDataType.TEACHER_NUM);
-		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, JobNatureEnum.FULL_TIME, null), startMonth, IndexDataType.FULL_TIME_NUM);
-		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, JobNatureEnum.PART_TIME, null), startMonth, IndexDataType.PART_TIME_NUM);
-		saveData(indexBaseMonthDataDao.getTeacherData(startMonth, null, true), startMonth, IndexDataType.DIMISSION_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(null, null), startMonth, IndexDataType.TEACHER_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.FULL_TIME, null), startMonth, IndexDataType.FULL_TIME_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(JobNatureEnum.PART_TIME, null), startMonth, IndexDataType.PART_TIME_NUM);
+		saveData(indexBaseMonthDataDao.getTeacherData(null, true), startMonth, IndexDataType.DIMISSION_NUM);
 
 		//学员变动
 		saveData(null, startMonth, IndexDataType.NEWLY_STUDENT_NUM);
@@ -123,9 +123,9 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		saveData(null, startMonth, IndexDataType.STUDENT_CONVERSION);
 
 		//课程数据
-		saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.MUSIC), startMonth, IndexDataType.MUSIC_GROUP_COURSE);
-		saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.VIP), startMonth, IndexDataType.VIP_GROUP_COURSE);
-		saveData(indexBaseMonthDataDao.getGroupCourseData(startMonth, GroupType.PRACTICE), startMonth, IndexDataType.PRACTICE_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.MUSIC), startMonth, IndexDataType.MUSIC_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.VIP), startMonth, IndexDataType.VIP_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(GroupType.PRACTICE), startMonth, IndexDataType.PRACTICE_GROUP_COURSE);
 
 		return result;
 	}

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -1618,6 +1618,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Transactional(rollbackFor = Exception.class)
     public Boolean batchDelRegs(String musicGroupId, List<Integer> userIds) {
         List<StudentRegistration> registrations = studentRegistrationDao.findStudentListByUserIdList(musicGroupId, userIds);
+        for (StudentRegistration registration : registrations) {
+            if(registration.getPaymentStatus().equals(PaymentStatusEnum.OPEN)||registration.getPaymentStatus().equals(PaymentStatusEnum.YES)){
+                throw new BizException("开启缴费/已缴费的学员不能删除");
+            }
+        }
         if (registrations.size() <= 0) {
             throw new BizException("删除的学员不存在,请核查");
         }

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

@@ -178,7 +178,7 @@
 		LEFT JOIN sys_user su ON sees.student_id_=su.id_
 		WHERE su.del_flag_=0
 			AND su.organ_id_ IS NOT NULL
-			AND DATE_FORMAT(sees.monday_, '%Y-%m')=#{month}
+			AND YEAR(sees.monday_)=YEAR(NOW())
 		GROUP BY su.organ_id_
 		ORDER BY su.organ_id_
 	</select>
@@ -195,7 +195,6 @@
 		WHERE
 			del_flag_ = 0
 		  	AND organ_id_ IS NOT NULL
-			AND YEAR(create_time_)=YEAR(NOW())
 		GROUP BY
 			organ_id_
 		ORDER BY
@@ -214,7 +213,6 @@
 			del_flag_ = 0
 			AND status_ = 'PROGRESS'
 			AND organ_id_ IS NOT NULL
-			AND YEAR(create_time_)=YEAR(NOW())
 		GROUP BY
 			organ_id_
 		ORDER BY
@@ -234,7 +232,6 @@
 			AND mg.status_ = 'PROGRESS'
 			AND mg.organ_id_ IS NOT NULL
 			AND sr.music_group_status_='NORMAL'
-			AND YEAR(sr.create_time_)=YEAR(NOW())
 		GROUP BY
 			mg.organ_id_
 		ORDER BY
@@ -253,7 +250,6 @@
 				LEFT JOIN sys_user su ON su.id_ = t.id_
 		WHERE
 			su.del_flag_ = 0
-		  	AND YEAR(t.create_time_)=YEAR(NOW())
 		  	<if test="isDemission==null">
 				AND su.lock_flag_ = 0
 			</if>
@@ -283,7 +279,6 @@
 			m.del_flag_ = 0
 			AND m.is_lock_ = 0
 			AND m.organ_id_ IS NOT NULL
-			AND YEAR(m.create_time_)=YEAR(NOW())
 			<if test="groupType!=null">
 				AND m.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
@@ -292,4 +287,25 @@
 		ORDER BY
 			m.organ_id_;
 	</select>
+
+	<select id="getOtherStudentData" resultMap="IndexBaseMonthData">
+		SELECT
+			m.organ_id_,
+			CONCAT(DATE_FORMAT(NOW(), '%Y-%m'), '-01') month_,
+			COUNT( DISTINCT s.user_id_ ) total_num_,
+			COUNT( DISTINCT s.user_id_ ) activate_num_,
+			COUNT( DISTINCT s.user_id_ ) percent_
+		FROM
+			course_schedule_student_payment s
+				LEFT JOIN course_schedule m ON s.course_schedule_id_=m.id_
+		WHERE
+			m.del_flag_ = 0
+		  AND m.is_lock_ = 0
+		  AND m.organ_id_ IS NOT NULL
+		  AND m.group_type_ IN ('VIP', 'PRACTICE')
+		GROUP BY
+			m.organ_id_
+		ORDER BY
+			m.organ_id_;
+	</select>
 </mapper>