Browse Source

Merge branch 'master' into origin_master

Joburgess 4 years ago
parent
commit
2a7bf6a69f

+ 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);
 }

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

@@ -542,5 +542,5 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @param courseIds
      * @param classGroupStudents
      */
-    void spanGroupClassAdjustPass(Integer masterClassGroupId,List<Integer> studentIds,List<Long> courseIds,List<Map<Integer, String>> classGroupStudents,List<Long> allLockCourseIds,String batchNo);
+    void spanGroupClassAdjustPass(Integer masterClassGroupId,List<Integer> studentIds,List<Long> courseIds,List<Map<String, String>> classGroupStudents,List<Long> allLockCourseIds,String batchNo);
 }

+ 7 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -3777,7 +3777,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         musicGroupStudentClassAdjustDao.insert(musicGroupStudentClassAdjust);
         //没有需要审核的缴费项目
         if (paymentCalenderDto.getStatus() != AUDITING) {
-            spanGroupClassAdjustPass(masterClassGroupId,studentIds,courseIds,classGroupStudents,allLockCourseIds,paymentCalenderDto.getBatchNo());
+            List<Map<String,String>> classGroupStudents1 = (List<Map<String,String>>)JSON.parse(musicGroupStudentClassAdjust.getClassGroupStudents());
+            spanGroupClassAdjustPass(masterClassGroupId,studentIds,courseIds,classGroupStudents1,allLockCourseIds,paymentCalenderDto.getBatchNo());
         }else {
 //                冻结班级
             classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds, 1);
@@ -3786,17 +3787,17 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
     }
 
-    public void spanGroupClassAdjustPass(Integer masterClassGroupId,List<Integer> studentIds,List<Long> courseIds,List<Map<Integer, String>> classGroupStudents,List<Long> allLockCourseIds,String batchNo){
+    public void spanGroupClassAdjustPass(Integer masterClassGroupId,List<Integer> studentIds,List<Long> courseIds,List<Map<String, String>> classGroupStudents,List<Long> allLockCourseIds,String batchNo){
         //将学员加进班级未开始的课程,以及班级关联、加群
         classGroupStudentMapperService.updateClassGroupStudents1(masterClassGroupId.longValue(),studentIds,allLockCourseIds,batchNo);
         //删除学员课程
         courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, studentIds);
         //删除班级关联的学员
         if (classGroupStudents != null && classGroupStudents.size() > 0) {
-            for (Map<Integer, String> classGroupStudent : classGroupStudents) {
-                Set<Integer> integers = classGroupStudent.keySet();
-                for (Integer integer : integers) {
-                    classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(integer, classGroupStudent.get(integer));
+            for (Map<String, String> classGroupStudent : classGroupStudents) {
+                Set<String> integers = classGroupStudent.keySet();
+                for (String integer : integers) {
+                    classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(Integer.parseInt(integer), classGroupStudent.get(integer));
                 }
             }
         }

+ 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;
 	}

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

@@ -756,7 +756,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
 				//删除和解冻班级,课程信息
 				MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-				List<Map<Integer,String>> classGroupStudents = (List<Map<Integer,String>>)JSON.parse(adjust.getClassGroupStudents());
+				List<Map<String,String>> classGroupStudents = (List<Map<String,String>>)JSON.parse(adjust.getClassGroupStudents());
 				List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
 				List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
 				List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
@@ -1071,7 +1071,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
 			//删除和解冻班级,课程信息
 			MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-			List<Map<Integer,String>> classGroupStudents = (List<Map<Integer,String>>)JSON.parse(adjust.getClassGroupStudents());
+			List<Map<String,String>> classGroupStudents = (List<Map<String,String>>)JSON.parse(adjust.getClassGroupStudents());
 			List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
 			List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
 			List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);

+ 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>