Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 years ago
parent
commit
340fd4ec58

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1312,6 +1312,20 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
                                                                @Param("endTime") Date endTime,
                                                             @Param("groupType") GroupType groupType);
 
+
+    /**
+     * @describe 统计学生在指定周期内的付费网管课数量
+     * @author Joburgess
+     * @date 2020.05.06
+     * @param studentIds:
+     * @param startTime:
+     * @param endTime:
+     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Long>>
+     */
+    List<Map<Integer, Long>> countStudentPayPracticeCoursesWithDate(@Param("studentIds") List<Integer> studentIds,
+                                                            @Param("startTime") Date startTime,
+                                                            @Param("endTime") Date endTime);
+
     /**
      * @describe 统计学生在未来的vip课数量
      * @author Joburgess

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

@@ -39,6 +39,17 @@ public class StudentExercisesSituationQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "是否存在vip课")
     private Integer existVipCourse;
 
+    @ApiModelProperty(value = "是否存在网管课")
+    private Integer existPracticeCourse;
+
+    public Integer getExistPracticeCourse() {
+        return existPracticeCourse;
+    }
+
+    public void setExistPracticeCourse(Integer existPracticeCourse) {
+        this.existPracticeCourse = existPracticeCourse;
+    }
+
     public Integer getExistVipCourse() {
         return existVipCourse;
     }

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

@@ -53,7 +53,7 @@ public class StudentExtracurricularExercisesSituationServiceImpl extends BaseSer
 			if(Objects.isNull(queryInfo.getExistVipCourse())){
 				List<Integer> studentIds = dataList.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
 				List<Map<Integer, Long>> studentVipCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.VIP);
-				List<Map<Integer, Long>> studentPracticeCoursesMaps = courseScheduleDao.countStudentVipCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday(), GroupType.PRACTICE);
+				List<Map<Integer, Long>> studentPracticeCoursesMaps = courseScheduleDao.countStudentPayPracticeCoursesWithDate(studentIds, queryInfo.getMonday(), queryInfo.getSunday());
 				Map<Integer, Long> studentVipCourseMap = MapUtil.convertIntegerMap(studentVipCoursesMaps);
 				Map<Integer, Long> studentPracticeCourseMap = MapUtil.convertIntegerMap(studentPracticeCoursesMaps);
 				for (StudentExercisesSituationDto exercisesSituationDto : dataList) {

+ 20 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -3009,6 +3009,26 @@
         GROUP BY
         cssp.user_id_
     </select>
+    <select id="countStudentPayPracticeCoursesWithDate" resultType="map">
+        SELECT
+        cssp.user_id_ as 'key',
+        COUNT( cs.id_ ) as 'value'
+        FROM
+        course_schedule_student_payment cssp
+        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_
+        WHERE
+        cssp.user_id_ IN
+        <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
+            #{studentId}
+        </foreach>
+        AND cssp.group_type_ = 'PRACTICE'
+        AND pg.type_='CHARGE'
+        AND cs.class_date_ BETWEEN #{startTime} AND #{endTime}
+        GROUP BY
+        cssp.user_id_
+    </select>
+
     <select id="countStudentVipCoursesInFuture" resultType="map">
         SELECT
           cssp.user_id_ as 'key',

+ 12 - 0
mec-biz/src/main/resources/config/mybatis/StudentExtracurricularExercisesSituationMapper.xml

@@ -158,6 +158,12 @@
 			<if test="existVipCourse!=null and existVipCourse==0">
 				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
 			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==1">
+				AND EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==0">
+				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
 			GROUP BY
 			student_id_,teacher_id_
 			<trim prefix="HAVING" suffixOverrides="and">
@@ -218,6 +224,12 @@
 			<if test="existVipCourse!=null and existVipCourse==0">
 				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='VIP' AND class_date_ BETWEEN #{monday} AND #{sunday})
 			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==1">
+				AND EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
+			<if test="existPracticeCourse!=null and existPracticeCourse==0">
+				AND NOT EXISTS (SELECT cssp.id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ LEFT JOIN practice_group pg ON pg.id_=cssp.music_group_id_ WHERE cssp.user_id_=sees.student_id_ AND cssp.group_type_='PRACTICE' AND pg.type_='CHARGE' AND class_date_ BETWEEN #{monday} AND #{sunday})
+			</if>
 			GROUP BY
 			student_id_,teacher_id_
 			<trim prefix="HAVING" suffixOverrides="and">

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

@@ -1223,8 +1223,8 @@ public class ExportController extends BaseController {
         OutputStream ouputStream = null;
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(
-                    new String[]{"学员编号", "学员姓名", "所属分部", "指导老师", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数"},
-                    new String[]{"studentId", "studentName", "organName", "teacherName", "expectExercisesNum", "actualExercisesNum", "exercisesReplyNum", "exercisesMessageNum", "exercisesMessageTimelyNum"}, rows);
+                    new String[]{"学员编号", "学员姓名", "所属分部", "指导老师", "预期安排", "实际安排", "提交次数", "评价次数", "及时评价次数", "付费网管课", "VIP课"},
+                    new String[]{"studentId", "studentName", "organName", "teacherName", "expectExercisesNum", "actualExercisesNum", "exercisesReplyNum", "exercisesMessageNum", "exercisesMessageTimelyNum", "existPracticeCourse", "existVipCourse"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             ouputStream = response.getOutputStream();
@@ -1243,7 +1243,7 @@ public class ExportController extends BaseController {
         }
     }
 
-    @ApiOperation(value = "课外训练-教学导出")
+    @ApiOperation(value = "教师课酬导出")
     @GetMapping("export/isSettlementCourseSalarys")
     @PreAuthorize("@pcs.hasPermissions('export/isSettlementCourseSalarys')")
     public void isSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo, HttpServletResponse response) throws IOException {

+ 19 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentExtracurricularExercisesSituationController.java

@@ -4,8 +4,11 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.page.StudentCourseHomeworkReplyQueryInfo;
 import com.ym.mec.biz.dal.page.StudentExercisesSituationQueryInfo;
 import com.ym.mec.biz.dal.page.StudentServiceDetailQueryInfo;
+import com.ym.mec.biz.service.ExtracurricularExercisesMessageService;
+import com.ym.mec.biz.service.StudentCourseHomeworkReplyService;
 import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -37,6 +40,12 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
     private SysUserFeignService sysUserFeignService;
 
     @Autowired
+    private ExtracurricularExercisesMessageService extracurricularExercisesMessageService;
+
+    @Autowired
+    private StudentCourseHomeworkReplyService studentCourseHomeworkReplyService;
+
+    @Autowired
     private EmployeeDao employeeDao;
 
     @ApiOperation(value = "课外训练-教学")
@@ -70,4 +79,14 @@ public class StudentExtracurricularExercisesSituationController extends BaseCont
         return succeed(studentExtracurricularExercisesSituationService.findServiceStudentDetail(queryInfo));
     }
 
+    @ApiOperation(value = "回复查询")
+    @GetMapping("/findStudentHomeworkComments")
+    public Object findStudentHomeworkComments(StudentCourseHomeworkReplyQueryInfo queryInfo){
+        if(!queryInfo.isExtra()){
+            return succeed(studentCourseHomeworkReplyService.queryPage(queryInfo));
+        }else{
+            return succeed(extracurricularExercisesMessageService.findStudentExtraExerciseComments(queryInfo));
+        }
+    }
+
 }