Browse Source

1、 VIP课管理-查看-VIP课程财务优化
2、乐团列表支持合作单位搜索
3、人力资源表新增搜索条件
4、异常处理导出新增字段

zouxuan 3 years ago
parent
commit
ca0b809136

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -187,6 +187,8 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                  @Param("educationUserId") Integer educationUserId,
                                  @Param("noPaymentType") Integer noPaymentType);
 
+
+
     List<Map<Integer, Integer>> countOrganNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
 
     List<String> getNoPaymentMusicGroup(@Param("organIds") Set<Integer> organIds, @Param("educationUserId") Integer educationUserId);
@@ -316,6 +318,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                                                  @Param("organIds") List<Integer> organIds);
 
     int countStudentErrorLeave(@Param("organIdList") Set<Integer> organIdList, @Param("format") String format, @Param("classGroupIds") List<Long> classGroupIds);
+    List<Map<Integer, Integer>> countOrganStudentErrorLeave(@Param("organIds") Set<Integer> organIds, @Param("classGroupIds") List<Long> classGroupIds);
 
     int countStudentErrorLeave1(Map<String, Object> params);
 

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

@@ -632,6 +632,15 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
     List<StudentRegistration> queryMemberEndAutoQuitMusic(@Param("memberEndAutoQuitMusic") String memberEndAutoQuitMusic,
                                                           @Param("educationUserId") Integer educationUserId,
                                                           @Param("organIds") String organIds);
+
+    /**
+     * 获取所有在会员团,但是没有会员,并且没有待生效的学员
+     * @param memberEndAutoQuitMusic
+     * @return
+     */
+    List<Map<Integer, Integer>> queryOrganMemberEndAutoQuitMusic(@Param("memberEndAutoQuitMusic") String memberEndAutoQuitMusic,
+                                                          @Param("educationUserId") Integer educationUserId,
+                                                          @Param("organIds") Set<Integer> organIds);
     
     /**
      * 统计指定乐团在读的声部人数

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexErrorDataExportDto.java

@@ -28,12 +28,18 @@ public class IndexErrorDataExportDto {
     @ApiModelProperty(value = "未加入任何班级学员")
     private int noClassMusicGroupStudentInfo;
 
+    @ApiModelProperty(value = "学员请假异常数")
+    private int studentErrorLeave;
+
     @ApiModelProperty(value = "未缴费学员数")
     private int studentNotPayment;
 
     @ApiModelProperty(value = "申请退团学员数")
     private int studentApplyForQuitMusicGroup;
 
+    @ApiModelProperty(value = "会员已过期数量")
+    private int noMemberStudentNum;
+
     @ApiModelProperty(value = "预计课酬较低")
     private int teacherExpectSalaryBeLow;
 
@@ -73,6 +79,22 @@ public class IndexErrorDataExportDto {
     @ApiModelProperty(value = "总计")
     private int total;
 
+    public int getStudentErrorLeave() {
+        return studentErrorLeave;
+    }
+
+    public void setStudentErrorLeave(int studentErrorLeave) {
+        this.studentErrorLeave = studentErrorLeave;
+    }
+
+    public int getNoMemberStudentNum() {
+        return noMemberStudentNum;
+    }
+
+    public void setNoMemberStudentNum(int noMemberStudentNum) {
+        this.noMemberStudentNum = noMemberStudentNum;
+    }
+
     public Integer getOrganId() {
         return organId;
     }

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

@@ -811,6 +811,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		Map<Integer, Integer> teacherNotAClassMap = new HashMap<>();
 		//服务指标异常
 		Map<Integer, Integer> teacherServeErrorMap = new HashMap<>();
+		//学员请假异常
+		Map<Integer, Integer> studentErrorLeaveMap = new HashMap<>();
+		//会员过期学员数
+		Map<Integer, Integer> noMemberStudentMap = new HashMap<>();
 
 		if(IndexErrorType.MUSIC_PATROL.equals(errorType)||Objects.isNull(errorType)){
 			//基础技能班学员数量异常
@@ -827,6 +831,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		}
 
 		if(IndexErrorType.STUDENT_INFO.equals(errorType)||Objects.isNull(errorType)){
+			//学员异常请假数
+			List<Map<Integer, Integer>> studentErrorLeaveMapList = indexBaseMonthDataDao.countOrganStudentErrorLeave(organIds, classGroupIds);
+			studentErrorLeaveMap = MapUtil.mapListToMap(studentErrorLeaveMapList, Integer.class, Integer.class);
+
 			//未缴费学员数
 			List<Map<Integer, Integer>> studentNotPaymentMapList = indexBaseMonthDataDao.countOrganNoPaymentStudentNum(organIds, educationUserId);
 			studentNotPaymentMap = MapUtil.mapListToMap(studentNotPaymentMapList, Integer.class, Integer.class);
@@ -834,6 +842,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			//申请退团学员数
 			List<Map<Integer, Integer>> studentApplyForQuitMusicGroupMapList = indexBaseMonthDataDao.queryOrganApplyForQuitGroupNum(organIds, educationUserId);
 			studentApplyForQuitMusicGroupMap = MapUtil.mapListToMap(studentApplyForQuitMusicGroupMapList, Integer.class, Integer.class);
+
+			//会员过期学员数
+			List<Map<Integer, Integer>> memberEndAutoQuitMusicMapList = studentRegistrationDao.queryOrganMemberEndAutoQuitMusic(null, educationUserId,organIds);
+			noMemberStudentMap = MapUtil.mapListToMap(memberEndAutoQuitMusicMapList, Integer.class, Integer.class);
 		}
 
 		if(IndexErrorType.TEACHER_INFO.equals(errorType)||Objects.isNull(errorType)){
@@ -921,6 +933,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 			total += indexErrorData.getNoClassMusicGroupStudentInfo();
 			totalData.setNoClassMusicGroupStudentInfo(totalData.getNoClassMusicGroupStudentInfo() + indexErrorData.getNoClassMusicGroupStudentInfo());
+			//学员请假异常数
+			if(studentErrorLeaveMap.containsKey(organ.getId())){
+				indexErrorData.setStudentErrorLeave(studentErrorLeaveMap.get(organ.getId()));
+			}
+			total += indexErrorData.getStudentErrorLeave();
+			totalData.setStudentErrorLeave(totalData.getStudentErrorLeave() + indexErrorData.getStudentErrorLeave());
 			//未缴费学员数
 			if(studentNotPaymentMap.containsKey(organ.getId())){
 				indexErrorData.setStudentNotPayment(studentNotPaymentMap.get(organ.getId()));
@@ -933,6 +951,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			}
 			total += indexErrorData.getStudentApplyForQuitMusicGroup();
 			totalData.setStudentApplyForQuitMusicGroup(totalData.getStudentApplyForQuitMusicGroup() + indexErrorData.getStudentApplyForQuitMusicGroup());
+			//会员已过期数量
+			if(noMemberStudentMap.containsKey(organ.getId())){
+				indexErrorData.setNoMemberStudentNum(noMemberStudentMap.get(organ.getId()));
+			}
+			total += indexErrorData.getNoMemberStudentNum();
+			totalData.setNoMemberStudentNum(totalData.getNoMemberStudentNum() + indexErrorData.getNoMemberStudentNum());
 			//预计课酬较低
 			if(teacherExpectSalaryBeLowMap.containsKey(organ.getId())){
 				indexErrorData.setTeacherExpectSalaryBeLow(teacherExpectSalaryBeLowMap.get(organ.getId()));

+ 21 - 0
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -1548,6 +1548,27 @@
 		GROUP BY sa.user_id_,DATE_FORMAT(cs.class_date_,'%Y-%m')
 		HAVING COUNT(sa.id_) > 1 AND COUNT(sa.id_) > SUM(sa.leave_visit_flag_)) c
 	</select>
+	<select id="countOrganStudentErrorLeave" resultType="map">
+		SELECT c.organ_id_ 'key',COUNT(c.user_id_) 'value' FROM (
+		SELECT sa.user_id_,cs.organ_id_ FROM student_attendance sa
+		LEFT JOIN course_schedule cs ON cs.id_ = sa.course_schedule_id_
+		WHERE DATE_FORMAT(cs.class_date_,'%Y-%m') >= '2021-11' AND sa.status_ = 'LEAVE' AND cs.pre_course_flag_ = 0
+		<if test="classGroupIds != null and classGroupIds.size() > 0">
+			AND cs.class_group_id_ IN
+			<foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+				#{classGroupId}
+			</foreach>
+		</if>
+		<if test="organIds != null and organIds.size > 0">
+			AND cs.organ_id_ IN
+			<foreach collection="organIds" open="(" close=")" item="item" separator=",">
+				#{item}
+			</foreach>
+		</if>
+		GROUP BY sa.user_id_
+		HAVING COUNT(sa.id_) > 1 AND COUNT(sa.id_) > SUM(sa.leave_visit_flag_))c
+		GROUP BY c.organ_id_
+	</select>
 	<select id="countStudentErrorLeave1" resultType="java.lang.Integer">
 		SELECT COUNT(DISTINCT c.user_id_) FROM (
 		SELECT sa.user_id_ FROM student_attendance sa

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1587,6 +1587,29 @@
         </if>
         GROUP BY sr.user_id_
     </select>
+    <select id="queryOrganMemberEndAutoQuitMusic" resultType="Map">
+        SELECT mg.organ_id_ 'key',COUNT(DISTINCT sr.user_id_) 'value' 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_ AND cto.status_ = 1 AND cto.music_group_id_ IS NOT NULL
+        WHERE sr.music_group_status_ = 'NORMAL' AND mg.course_view_type_ = 2 AND mg.status_ = 'PROGRESS'
+        AND cto.id_ IS NULL AND (sr.membership_end_time_ IS NULL OR sr.membership_end_time_ &lt; NOW())
+        <if test="educationUserId != null">
+            AND mg.educational_teacher_id_ = #{educationUserId}
+        </if>
+        <if test="organIds != null and organIds.size > 0">
+            AND mg.organ_id_ IN
+            <foreach collection="organIds" open="(" close=")" item="item" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="memberEndAutoQuitMusic != null">
+            AND cto.id_ IS NULL AND DATEDIFF(sr.membership_end_time_,NOW()) &lt;= #{memberEndAutoQuitMusic} AND sr.membership_end_time_ > NOW()
+        </if>
+        <if test="memberEndAutoQuitMusic == null">
+            AND cto.id_ IS NULL AND (sr.membership_end_time_ IS NULL OR sr.membership_end_time_ &lt; NOW())
+        </if>
+        GROUP BY mg.organ_id_
+    </select>
 
     <select id="countStudentWithSubjectByMusicGroupId" resultMap="Mapper">
         select sr.actual_subject_id_ subject_id_, s.name_ key_,count(sr.id_) value_ from student_registration sr LEFT JOIN subject s on sr.actual_subject_id_ = s.id_

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -2943,10 +2943,10 @@ public class ExportController extends BaseController {
         try {
             String[] header = {"分部", "基础技能班学员数量异常", "乐团巡查事项异常", "未在班级学员数", "欠费学员数",
                     "申请退团学员数", "预计课酬较低", "课程时间安排异常", "乐团巡查未计划", "乐团巡查任务未提交",
-                    "回访任务未完成", "课程考勤异常", "课程异常", "服务指标异常", "总计",};
+                    "回访任务未完成", "课程考勤异常", "课程异常", "服务指标异常", "异常请假", "会员过期学员数", "总计",};
             String[] body = {"organName", "highClassStudentLessThanThreeNum", "musicPatrolItem", "noClassMusicGroupStudentInfo", "studentNotPayment",
                     "studentApplyForQuitMusicGroup", "teacherExpectSalaryBeLow", "courseTimeError", "inspectionItem", "inspectionItemPlan",
-                    "studentVisit", "teacherExceptionAttendance", "teacherNotAClass", "teacherServeError", "total",};
+                    "studentVisit", "teacherExceptionAttendance", "teacherNotAClass", "teacherServeError", "studentErrorLeave", "noMemberStudentNum", "total",};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, result);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=teacherDefaultSalary-" + DateUtil.getDate(new Date()) + ".xls");