瀏覽代碼

首页异常处理

zouxuan 4 年之前
父節點
當前提交
01e043f04c

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

@@ -109,9 +109,9 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     int countNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds);
     List<String> getNoPaymentMusicGroup(@Param("organIds") Set<Integer> organIds);
 
-    int countApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds);
+    List<Long> queryApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds);
 
-    int countStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
+    List<Long> queryStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
                                    @Param("type") String type);
 
 

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

@@ -53,6 +53,17 @@ public class StudentAttendanceQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "分部")
     private String organId;
 
+    @ApiModelProperty(value = "courseScheduleStudentPaymentId")
+    private String ids;
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
+
     public Long getCourseScheduleId() {
         return courseScheduleId;
     }

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

@@ -336,9 +336,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<IndexErrInfoDto> twoChild = new ArrayList<>();
 
 		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds), indexBaseMonthDataDao.getNoPaymentMusicGroup(organIds)));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), indexBaseMonthDataDao.countApplyForQuitGroupNum(organIds),  null));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode()), null));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode()), null));
+		List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
+		List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode());
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo.size(), attendanceInfo));
+		List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode());
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1.size(), attendanceInfo1));
 		two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 		two.setResult(twoChild);
 		all.add(two);
@@ -360,7 +363,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
 		List<Long> lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
-		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), null));
+		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), lowTeacherSalary));
 
 		List<Long> inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr);
 		threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem.size(), inspectionItem));

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

@@ -523,8 +523,8 @@
 			</if>
 	</select>
 
-	<select id="countApplyForQuitGroupNum" resultType="int">
-		SELECT COUNT(mgq.id_) FROM music_group_quit mgq
+	<select id="queryApplyForQuitGroupNum" resultType="java.lang.Long">
+		SELECT mgq.id_ FROM music_group_quit mgq
 			LEFT JOIN music_group mg ON mgq.music_group_id_=mg.id_
 		WHERE mg.status_='PROGRESS'
 		  AND mgq.status_='PROCESSING'
@@ -536,9 +536,9 @@
 		</if>
 	</select>
 
-	<select id="countStudentAttendanceInfo" resultType="java.lang.Integer">
+	<select id="queryStudentAttendanceInfo" resultType="java.lang.Long">
 		SELECT
-			COUNT( DISTINCT cssp.user_id_ )
+			DISTINCT cssp.user_id_
 		FROM
 			course_schedule_student_payment cssp
 			LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_

+ 44 - 78
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -493,98 +493,64 @@
         LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
         left join sys_user tu on tu.id_ = cs.actual_teacher_id_
         left join organization o on o.id_ = cs.organ_id_
+        <include refid="findStudentAttendanceSql"/>
+        ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
+        <include refid="global.limit"/>
+    </select>
+    <sql id="findStudentAttendanceSql">
         <where>
-        	<if test="courseScheduleId != null">
-        		cssp.course_schedule_id_ = #{courseScheduleId}
-        	</if>
-        	<if test="search != null">
-        		and cssp.course_schedule_id_ = #{search}
-        	</if>
-        	<if test="studentID != null">
-        		and cssp.user_id_ = #{studentID}
-        	</if>
-        	<if test="startDateOfCourse != null">
-        		and cs.class_date_ &gt;= #{startDateOfCourse}
-        	</if>
-        	<if test="endDateOfCourse != null">
-        		and cs.class_date_ &lt;= #{endDateOfCourse}
-        	</if>
-        	<if test="courseScheduleType != null">
-        		and cs.type_ = #{courseScheduleType}
-        	</if>
-        	<if test="teacherId != null">
-        		and cs.actual_teacher_id_ = #{teacherId}
-        	</if>
-        	<if test="courseStatus != null">
-        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
+            <if test="courseScheduleId != null">
+                cssp.course_schedule_id_ = #{courseScheduleId}
+            </if>
+            <if test="search != null">
+                and cssp.course_schedule_id_ = #{search}
+            </if>
+            <if test="studentID != null">
+                and cssp.user_id_ = #{studentID}
+            </if>
+            <if test="startDateOfCourse != null">
+                and cs.class_date_ &gt;= #{startDateOfCourse}
+            </if>
+            <if test="endDateOfCourse != null">
+                and cs.class_date_ &lt;= #{endDateOfCourse}
+            </if>
+            <if test="courseScheduleType != null">
+                and cs.type_ = #{courseScheduleType}
+            </if>
+            <if test="teacherId != null">
+                and cs.actual_teacher_id_ = #{teacherId}
+            </if>
+            <if test="courseStatus != null">
+                and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="status != null">
                 and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
                 <if test="status.code == 'TRUANT'">
                     OR sa.id_ IS NULL
                 </if>
                 )
-        	</if>
-        	<if test="groupType != null">
-        		and cssp.group_type_ = #{groupType}
-        	</if>
-        	<if test="musicGroupId != null">
-        		and cssp.music_group_id_ = #{musicGroupId}
-        	</if>
+            </if>
+            <if test="groupType != null">
+                and cssp.group_type_ = #{groupType}
+            </if>
+            <if test="musicGroupId != null">
+                and cssp.music_group_id_ = #{musicGroupId}
+            </if>
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(cs.organ_id_,#{organId})
             </if>
+            <if test="ids != null and ids != ''">
+                AND FIND_IN_SET(cssp.id_,#{ids})
+            </if>
         </where>
-        ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
-        <include refid="global.limit"/>
-    </select>
+    </sql>
     
     <select id="countStudentAttendance" resultType="java.lang.Integer">
         SELECT count(cssp.id_) 
-        FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
+        FROM course_schedule_student_payment cssp
+        left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
         left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
-        <where>
-        	<if test="courseScheduleId != null">
-        		cssp.course_schedule_id_ = #{courseScheduleId}
-        	</if>
-        	<if test="search != null">
-        		and cssp.course_schedule_id_ = #{search}
-        	</if>
-        	<if test="studentID != null">
-        		and cssp.user_id_ = #{studentID}
-        	</if>
-        	<if test="startDateOfCourse != null">
-        		and cs.class_date_ &gt;= #{startDateOfCourse}
-        	</if>
-        	<if test="endDateOfCourse != null">
-        		and cs.class_date_ &lt;= #{endDateOfCourse}
-        	</if>
-        	<if test="courseScheduleType != null">
-        		and cs.type_ = #{courseScheduleType}
-        	</if>
-        	<if test="teacherId != null">
-        		and cs.actual_teacher_id_ = #{teacherId}
-        	</if>
-        	<if test="courseStatus != null">
-        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
-        		and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-                <if test="status.code == 'TRUANT'">
-                    OR sa.id_ IS NULL
-                </if>
-                )
-        	</if>
-        	<if test="groupType != null">
-        		and cssp.group_type_ = #{groupType}
-        	</if>
-        	<if test="musicGroupId != null">
-        		and cssp.music_group_id_ = #{musicGroupId}
-        	</if>
-            <if test="organId != null and organId != ''">
-                AND FIND_IN_SET(cs.organ_id_,#{organId})
-            </if>
-        </where>
+        <include refid="findStudentAttendanceSql"/>
     </select>
     <select id="findByCourseId" resultMap="StudentAttendance">
         SELECT * FROM student_attendance WHERE course_schedule_id_=#{courseId}

+ 7 - 6
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -196,16 +196,17 @@ public class EmployeeController extends BaseController {
     @ApiOperation(value = "获取维修技师")
     @GetMapping("/findTechnician")
     @PreAuthorize("@pcs.hasPermissions('employee/findTechnician')")
-    public HttpResponseResult findTechnician(){
+    public HttpResponseResult findTechnician(String organIds){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds = new String();
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        if (!sysUser.getIsSuperAdmin()) {
-            Employee employee = employeeService.get(sysUser.getId());
-            if (StringUtils.isEmpty(organIds)) {
-                organIds=employee.getOrganIdList();
+        if(StringUtils.isEmpty(organIds)){
+            if (!sysUser.getIsSuperAdmin()) {
+                Employee employee = employeeService.get(sysUser.getId());
+                if (StringUtils.isEmpty(organIds)) {
+                    organIds=employee.getOrganIdList();
+                }
             }
         }
         return succeed(employeeService.findByRole("37",organIds));