Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

周箭河 5 gadi atpakaļ
vecāks
revīzija
c011c607cb
44 mainītis faili ar 687 papildinājumiem un 116 dzēšanām
  1. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  2. 33 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  3. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  4. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentAttendanceDao.java
  5. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCourseHomeworkDao.java
  6. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java
  7. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherAttendanceDao.java
  8. 32 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java
  9. 76 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentCourseHomeworkDto.java
  10. 24 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentAttendance.java
  11. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseHomework.java
  12. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherAttendance.java
  13. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentAttendanceService.java
  14. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentCourseHomeworkService.java
  15. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java
  16. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
  17. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java
  18. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java
  19. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseHomeworkServiceImpl.java
  20. 19 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  21. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  22. 9 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  23. 21 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  24. 22 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java
  25. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  26. 6 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysUserCashAccountServiceImpl.java
  27. 9 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  28. 6 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherLeaveRecordServiceImpl.java
  29. 108 72
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  30. 4 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  31. 3 1
      mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml
  32. 34 14
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  33. 3 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  34. 16 0
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  35. 24 0
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml
  36. 9 1
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  37. 8 0
      mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml
  38. 1 1
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  39. 1 2
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherLeaveRecordController.java
  40. 16 0
      mec-util/src/main/java/com/ym/mec/util/date/DateUtil.java
  41. 33 1
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java
  42. 7 0
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java
  43. 1 0
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherLeaveRecordController.java
  44. 9 0
      mec-web/src/main/java/com/ym/mec/web/controller/student/StudentAttendanceController.java

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -577,4 +577,11 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @return java.util.List<java.lang.Integer>
      */
     List<Integer> findClassGroupIdsByTeacher(@Param("search") String search);
+
+    /**
+     * 获取基础技能版数量
+     * @param musicGroupId
+     * @return
+     */
+    Integer countClassNumByType(String musicGroupId);
 }

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

@@ -979,4 +979,37 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * @return java.util.List<java.lang.Integer>
      */
     List<Integer> findCourseIdsByTeacher(String search);
+
+    /**
+     * @describe 统计团体下的总课次
+     * @author Joburgess
+     * @date 2020/1/16
+     * @param groupType:
+     * @param groupId:
+     * @return int
+     */
+    int countGroupAllCourses(@Param("groupType") GroupType groupType,
+                             @Param("groupId") String groupId);
+
+    /**
+     * @describe 获取乐团开课时间
+     * @author Joburgess
+     * @date 2020/1/16
+     * @param groupType:
+     * @param groupId:
+     * @return java.util.Date
+     */
+    Date findGroupCourseStartTime(@Param("groupType") GroupType groupType,
+                                  @Param("groupId") String groupId);
+
+    /**
+     * @describe 获取乐团课程结束时间
+     * @author Joburgess
+     * @date 2020/1/16
+     * @param groupType:
+     * @param groupId:
+     * @return java.util.Date
+     */
+    Date findGroupCourseEndTime(@Param("groupType") GroupType groupType,
+                                  @Param("groupId") String groupId);
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -203,4 +203,11 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupGiveCourseSortDto>
      */
     List<VipGroupGiveCourseSortDto> findVipGroupSortCourseByGroup(@Param("groupId") String groupId);
+
+    /**
+     * 获取课程学员数量
+     * @param courseScheduleId
+     * @return
+     */
+    Integer countStudentNum(Integer courseScheduleId);
 }

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

@@ -191,4 +191,18 @@ public interface StudentAttendanceDao extends BaseDAO<Long, StudentAttendance> {
      */
     List<Map<Long,Integer>> countCourseLeaveStudentNumWithFourHoursAgo(@Param("courseScheduleIds") List<Long> courseScheduleIds,
                                                                        @Param("hours") Integer hours);
+
+    /**
+     * 获取某节课所有学员签到记录
+     * @param params
+     * @return
+     */
+    List<StudentAttendance> findStudentAttendance(Map<String, Object> params);
+
+    /**
+     * COUNT某节课所有学员签到记录
+     * @param params
+     * @return
+     */
+    int countStudentAttendance(Map<String, Object> params);
 }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCourseHomeworkDao.java

@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
+import java.util.Map;
 
 public interface StudentCourseHomeworkDao extends BaseDAO<Long, StudentCourseHomework> {
 
@@ -75,4 +76,18 @@ public interface StudentCourseHomeworkDao extends BaseDAO<Long, StudentCourseHom
      * @return
      */
     List<StudentCourseHomework> queryNotDoneHomeworkList();
+
+    /**
+     * count课程学员作业列表
+     * @param params
+     * @return
+     */
+    int countStudentCourseHomeworks(Map<String, Object> params);
+
+    /**
+     * 获取课程学员作业列表
+     * @param params
+     * @return
+     */
+    List<StudentCourseHomework> findStudentCourseHomeworks(Map<String, Object> params);
 }

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.*;
 
+import com.ym.mec.biz.dal.entity.StudentAttendance;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import org.apache.ibatis.annotations.Param;
@@ -212,4 +213,26 @@ public interface StudentManageDao {
      * @return
      */
     Long getHasCourse(Integer userId);
+
+    /**
+     * 获取签到学员数
+     * @param courseScheduleId
+     * @param status
+     * @return
+     */
+    Integer countStudentSignInNum(@Param("courseScheduleId") Integer courseScheduleId,@Param("status") String status);
+
+    /**
+     * 获取交了作业的学生数
+     * @param courseScheduleId
+     * @return
+     */
+    Integer countHomeworkNum(Integer courseScheduleId);
+
+    /**
+     * 获取已回复的数量
+     * @param courseScheduleId
+     * @return
+     */
+    Integer countRepliedNum(Integer courseScheduleId);
 }

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

@@ -6,7 +6,6 @@ import com.ym.mec.biz.dal.dto.TeacherPersonalAttendanceDto;
 import com.ym.mec.biz.dal.entity.TeacherAttendance;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.dal.BaseDAO;
-
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
@@ -146,4 +145,6 @@ public interface TeacherAttendanceDao extends BaseDAO<Long, TeacherAttendance> {
 	 * @return int
 	 */
 	int cleanCourseTeacherSignInfo(@Param("courseScheduleId") Long courseScheduleId);
+
+    TeacherAttendance getTeacherPersonalAttendance(Integer courseScheduleId);
 }

+ 32 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 
+import java.util.Date;
+
 /**
  * @Author Joburgess
  * @Date 2019/12/27
@@ -14,12 +16,42 @@ public class CourseScheduleEndDto extends CourseSchedule {
 
     private String organName;
 
+    private String remark;
+
     private int isSignIn;
 
     private int isSignOut;
 
     private int isCallNames;
 
+    private Date signInTime;
+
+    private Date signOutTime;
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getSignInTime() {
+        return signInTime;
+    }
+
+    public void setSignInTime(Date signInTime) {
+        this.signInTime = signInTime;
+    }
+
+    public Date getSignOutTime() {
+        return signOutTime;
+    }
+
+    public void setSignOutTime(Date signOutTime) {
+        this.signOutTime = signOutTime;
+    }
+
     public int getIsSignIn() {
         return isSignIn;
     }

+ 76 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentCourseHomeworkDto.java

@@ -0,0 +1,76 @@
+package com.ym.mec.biz.dal.dto;
+
+
+import java.util.Date;
+
+public class StudentCourseHomeworkDto {
+    private String phone;
+
+    private String username;
+
+    private String subjectName;
+
+    private String url;
+
+    private Date createTime;
+
+    private Integer isReplied;
+
+    private Integer isView;
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Integer getIsReplied() {
+        return isReplied;
+    }
+
+    public void setIsReplied(Integer isReplied) {
+        this.isReplied = isReplied;
+    }
+
+    public Integer getIsView() {
+        return isView;
+    }
+
+    public void setIsView(Integer isView) {
+        this.isView = isView;
+    }
+}

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentAttendance.java

@@ -34,6 +34,14 @@ public class StudentAttendance {
 	/**  */
 	@ApiModelProperty(value = "学生编号",required = false)
 	private Integer userId;
+
+	/**  */
+	@ApiModelProperty(value = "学生姓名",required = false)
+	private String username;
+
+	/**  */
+	@ApiModelProperty(value = "学生手机号",required = false)
+	private String phone;
 	
 	/** 点名的教师 */
 	@ApiModelProperty(value = "点名的教师",required = false)
@@ -55,6 +63,22 @@ public class StudentAttendance {
 	@ApiModelProperty(value = "当前课时")
 	private Integer currentClassTimes;
 
+	public String getPhone() {
+		return phone;
+	}
+
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
 	public Date getUpdateTime() {
 		return updateTime;
 	}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseHomework.java

@@ -20,6 +20,9 @@ public class StudentCourseHomework {
 	@ApiModelProperty(value = "用户名")
 	private String userName;
 
+	@ApiModelProperty(value = "手机号")
+	private String phone;
+
 	@ApiModelProperty(value = "头像")
 	private String avatar;
 	
@@ -62,6 +65,14 @@ public class StudentCourseHomework {
 	@ApiModelProperty(value = "是否已查看")
 	private YesOrNoEnum isView;
 
+	public String getPhone() {
+		return phone;
+	}
+
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+
 	public Long getCourseScheduleId() {
 		return courseScheduleId;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherAttendance.java

@@ -65,8 +65,18 @@ public class TeacherAttendance {
 
 	private String signOutLongitudeLatitude;
 
+	private String schoolLongitudeLatitude;
+
 	private Integer update;
 
+	public String getSchoolLongitudeLatitude() {
+		return schoolLongitudeLatitude;
+	}
+
+	public void setSchoolLongitudeLatitude(String schoolLongitudeLatitude) {
+		this.schoolLongitudeLatitude = schoolLongitudeLatitude;
+	}
+
 	public Integer getUpdate() {
 		return update;
 	}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentAttendanceService.java

@@ -10,6 +10,8 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
+import javax.validation.constraints.Max;
+import java.util.List;
 import java.util.Map;
 
 public interface StudentAttendanceService extends BaseService<Long, StudentAttendance> {
@@ -71,4 +73,11 @@ public interface StudentAttendanceService extends BaseService<Long, StudentAtten
 	 * @param statusEnum
 	 */
 	void addStudentAttendanceRecord(Integer courseScheduleId, Integer userId, StudentAttendanceStatusEnum statusEnum);
+
+	/**
+	 * 某节课所有学员签到状态
+	 * @param queryInfo
+	 * @return
+	 */
+	PageInfo<StudentAttendance> findStudentAttendance(QueryInfo queryInfo);
 }

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

@@ -2,6 +2,8 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.CourseHomeworkStudentDetailDto;
 import com.ym.mec.biz.dal.entity.StudentCourseHomework;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.List;
@@ -30,7 +32,6 @@ public interface StudentCourseHomeworkService extends BaseService<Long, StudentC
      * @author Joburgess
      * @date 2019/10/20
      * @param teacherId: 教师编号
-     * @param courseScheduelId: 课程计划编号
      * @param studentId: 学生编号
      * @return boolean
      */
@@ -42,4 +43,11 @@ public interface StudentCourseHomeworkService extends BaseService<Long, StudentC
      * @return
      */
     void homeworkRemind();
+
+    /**
+     * 获取课程学员作业列表
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<StudentCourseHomework> findStudentCourseHomeworks(QueryInfo queryInfo);
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java

@@ -2,10 +2,12 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.StudentAttendance;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.common.page.PageInfo;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Author Joburgess
@@ -137,4 +139,10 @@ public interface StudentManageService {
      */
     List<StudentHasCourseDto> queryHasCourseStudent(String organId);
 
+    /**
+     * 课表列表签到详情统计接口
+     * @param courseScheduleId
+     * @return
+     */
+    Map<String,Integer> sumStudentAttendance(Integer courseScheduleId);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java

@@ -64,6 +64,8 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
 
     String MUSIC_GROUP_SETTLEMENT_CLASS_MINUTES = "music_group_settlement_class_minutes";
 
+    String MUSIC_GROUP_SETTLEMENT_DAY = "music_group_settlement_day";
+
     String MUSIC_GROUP_SETTLEMENT_SINGLE_CLASS_MINUTES = "music_group_settlement_single_class_minutes";
 
     String REFUND_PERIOD = "refund_period";

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java

@@ -89,4 +89,10 @@ public interface TeacherAttendanceService extends BaseService<Long, TeacherAtten
 	 */
 	TeacherSignOutDto getTeacherSignDetail(Integer courseScheduleId, Integer userId);
 
+	/**
+	 * 获取单节课教师签到记录
+	 * @param courseScheduleId
+	 * @return
+	 */
+	TeacherAttendance getTeacherPersonalAttendance(Integer courseScheduleId);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java

@@ -24,6 +24,15 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
     void createVipGroup(VipGroupApplyDto vipGroup);
 
     /**
+     * @describe 检测vip课程是否超过范围
+     * @author Joburgess
+     * @date 2020/1/16
+     * @param vipGroupId: 小课编号
+     * @return void
+     */
+    void checkVipCourseIsInScore(Long vipGroupId);
+
+    /**
      * @describe 更新vip课程信息
      * @author Joburgess
      * @date 2019/10/30

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

@@ -77,7 +77,7 @@ public class CourseHomeworkServiceImpl extends BaseServiceImpl<Long, CourseHomew
 		List<Mapper> list = courseHomeworkDao.queryTeacerNoReplyNum();
 
 		for (Mapper mapper : list) {
-			Map<Integer, String> receivers = new HashMap<Integer, String>();
+			Map<Integer, String> receivers = new HashMap<>();
 			Integer userId = (Integer) mapper.getKey();
 			receivers.put(userId, userId + "");
 

+ 19 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -1151,6 +1151,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         checkNewCourseSchedules(courseSchedules, false);
         courseScheduleDao.batchUpdate(courseSchedules);
         classGroupService.updateClassGroupInfo(classGroup.getId());
+//        vipGroupService.checkVipCourseIsInScore(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
 //        courseScheduleStudentPaymentService.updateVipGiveCourse(vipGroup.getId());
     }
 
@@ -1324,6 +1325,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         vipGroupApplyDto.setSingleClassPrice(vipGroupCourseAdjustInfo.getSingleClassPrice());
         vipGroupService.appendVipGroupCourseSchedules(vipGroupApplyDto);
         classGroupService.updateClassGroupInfo(classGroup.getId());
+//        vipGroupService.checkVipCourseIsInScore(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
     }
 
     @Override
@@ -1432,7 +1434,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
         Date now = new Date();
         //明天日期
-        Date tomorrow = DateUtil.addDays1(now, 1);
+//        Date tomorrow = DateUtil.addDays1(now, 1);
 
         //需要生成课程课酬的课程计划
         List<CourseSchedule> needCreateCourseScheduleTeacherSalaryCourse = new ArrayList<>();
@@ -1466,7 +1468,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             if (!sysUser.getUserType().contains("SYSTEM") && sysUser.getUserType().contains("TEACHER")) {
                 Long normalStudentNum = classGroupStudentNumMap.get(oldCourseSchedule.getClassGroupId());
                 Long courseLeaveStudentNum = courseLeaveStudentNumMap.get(newCourseSchedule.getId());
-                ClassGroup classGroup=idClassGroupMap.get(oldCourseSchedule.getClassGroupId());
                 if(oldCourseSchedule.getGroupType().equals(GroupType.VIP)
                         &&Objects.nonNull(courseLeaveStudentNum)
                         &&Objects.nonNull(normalStudentNum)
@@ -1573,7 +1574,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 }
                 //修改后的课程助教编号列表
                 List<Integer> newTeachingTeacherIdList = newCourseSchedule.getTeachingTeacherIdList();
-                List<Integer> newCreateSalaryTeachingTeacherIds = null;
+
+                if(Objects.isNull(newTeachingTeacherIdList)){
+                    newTeachingTeacherIdList=new ArrayList<>();
+                }
+
+                List<Integer> newCreateSalaryTeachingTeacherIds;
 
                 //找出重复的助教编号
                 List<Integer> foundInCurrentCourseTeachingTeacherIds = newTeachingTeacherIdList.stream().filter(currentCourseTeachingTeacherIds::contains).collect(Collectors.toList());
@@ -1632,6 +1638,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             studentAttendanceDao.deleteByCourseSchedules(needCreateStudentPaymentCourses.stream().map(CourseSchedule::getId).collect(Collectors.toList()));
         }
 
+        if (!sysUser.getUserType().contains("SYSTEM") && sysUser.getUserType().contains("TEACHER")) {
+            if (!CollectionUtils.isEmpty(oldCourseScheduleList) && oldCourseScheduleList.get(0).getGroupType().equals(GroupType.VIP)) {
+                vipGroupService.checkVipCourseIsInScore(Long.valueOf(oldCourseScheduleList.get(0).getMusicGroupId()));
+            }
+        }
+
 //        if(oldCourseScheduleList.get(0).getGroupType().equals(GroupType.VIP)){
 //            courseScheduleStudentPaymentService.updateVipGiveCourse(Long.valueOf(oldCourseScheduleList.get(0).getMusicGroupId()));
 //        }
@@ -1677,7 +1689,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             throw new BizException("未找到对应课程");
         }
 
-        if(!courseSchedule1.getType().equals(courseSchedule2.getGroupType())
+        if(!courseSchedule1.getGroupType().equals(courseSchedule2.getGroupType())
             ||!courseSchedule1.getMusicGroupId().equals(courseSchedule2.getMusicGroupId())){
             throw new BizException("不能跨乐团进行课时交换");
         }
@@ -2321,6 +2333,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                     TeacherAttendance teacherAttendance=courseTeacherAttendances.get(0);
                     result.setIsSignIn(Objects.isNull(teacherAttendance.getSignInStatus())?3:teacherAttendance.getSignInStatus().getCode());
                     result.setIsSignOut(Objects.isNull(teacherAttendance.getSignOutStatus())?3:teacherAttendance.getSignOutStatus().getCode());
+                    result.setSignInTime(teacherAttendance.getSignInTime());
+                    result.setSignOutTime(teacherAttendance.getSignOutTime());
+                    result.setRemark(teacherAttendance.getRemark());
                 }
                 Long studentNum = studentNumCourseMap.get(result.getId());
                 if (Objects.nonNull(studentNum)) {

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

@@ -352,12 +352,12 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     @Transactional(rollbackFor = Exception.class)
     public void musicGroupTeacherSalarySettlement() {
         Date now = new Date();
-        Date yesterday = DateUtil.addDays1(now, -1);
+        Date settleTime = DateUtil.addDays1(now, -sysConfigDao.findByParamName(SysConfigService.MUSIC_GROUP_SETTLEMENT_DAY).getParanValue(Integer.class));
         Integer settlementClassMinutes = Integer.parseInt(sysConfigDao.findByParamName(SysConfigService.MUSIC_GROUP_SETTLEMENT_CLASS_MINUTES).getParanValue());
         Integer singleClassTime = Integer.parseInt(sysConfigDao.findByParamName(SysConfigService.MUSIC_GROUP_SETTLEMENT_SINGLE_CLASS_MINUTES).getParanValue());
         Date entryDate = DateUtil.stringToDate(sysConfigDao.findByParamName(SysConfigService.TEACHER_ENTRY_DATE).getParanValue(),"yyyy-MM-dd");
         //获取昨天的课程计划
-        List<CourseSchedule> yesterdayCourseSchedules = courseScheduleDao.findCourseScheduleWithDate(yesterday);
+        List<CourseSchedule> yesterdayCourseSchedules = courseScheduleDao.findCourseScheduleWithDate(settleTime);
         //课程编号列表
         List<Long> courseScheduleIds = yesterdayCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
         if (CollectionUtils.isEmpty(courseScheduleIds)) {

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

@@ -1025,8 +1025,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     public void pushMessage(String musicGroupId) throws IOException {
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
         if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
-            //3.0发送该消息
-            if (new Integer(3).equals(musicGroup.getChargeTypeId())) {
+            //是否有基础训练班
+            Integer num = classGroupDao.countClassNumByType(musicGroupId);
+            if(num != null && num > 0){
                 Map<Integer, String> studentMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findIdMapByMusicGroupId(musicGroupId, 2))), HashMap.class);
                 if (studentMap != null && studentMap.size() > 0) {
                     String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
@@ -1532,6 +1533,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroupStudentFee == null) {
             throw new BizException("个人续费信息错误");
         }
+        
+        StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
+        if(studentRegistration == null || studentRegistration.getPaymentStatus() != PaymentStatusEnum.YES){
+        	throw new BizException("请走报名缴费流程");
+        }
+        
         //判断是否是续费
 		/*List<StudentPaymentOrder> orderList = studentPaymentOrderDao.queryByCondition(GroupType.MUSIC, musicGroupId, userId, DealStatusEnum.SUCCESS);
 		if (orderList == null || orderList.size() == 0) {

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

@@ -235,7 +235,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	@Override
 	public PageInfo<StudentPersonalAttendanceDto> getStudentPersonalAttendances(QueryInfo queryInfo) {
 		PageInfo<StudentPersonalAttendanceDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-		Map<String, Object> params = new HashMap<String, Object>();
+		Map<String, Object> params = new HashMap<>();
 		MapUtil.populateMap(params, queryInfo);
 
 		List<StudentPersonalAttendanceDto> dataList = null;
@@ -444,4 +444,24 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 			}
 		}
 	}
+
+	@Override
+	public PageInfo<StudentAttendance> findStudentAttendance(QueryInfo queryInfo) {
+		PageInfo<StudentAttendance> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<StudentAttendance> dataList = null;
+		int count = studentAttendanceDao.countStudentAttendance(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentAttendanceDao.findStudentAttendance(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

+ 22 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -22,14 +22,12 @@ import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 
+import com.ym.mec.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 @Service
 public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, StudentCourseHomework> implements StudentCourseHomeworkService {
@@ -136,4 +134,24 @@ public class StudentCourseHomeworkServiceImpl extends BaseServiceImpl<Long, Stud
 					.getMusicGroup().getName(), sch.getCourseHomework().getClassGroup().getName());
 		}
 	}
+
+	@Override
+	public PageInfo<StudentCourseHomework> findStudentCourseHomeworks(QueryInfo queryInfo) {
+		PageInfo<StudentCourseHomework> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<StudentCourseHomework> dataList = null;
+		int count = studentCourseHomeworkDao.countStudentCourseHomeworks(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = studentCourseHomeworkDao.findStudentCourseHomeworks(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -360,4 +360,22 @@ public class StudentManageServiceImpl implements StudentManageService {
     public List<StudentHasCourseDto> queryHasCourseStudent(String organId) {
         return studentManageDao.queryHasCourseStudent(organId);
     }
+
+    @Override
+    public Map<String, Integer> sumStudentAttendance(Integer courseScheduleId) {
+        Map<String, Integer> sum = new HashMap<>(5);
+        Integer studentNum = scheduleStudentPaymentDao.countStudentNum(courseScheduleId);
+        sum.put("studentNum",studentNum);
+        Integer signInNum = studentManageDao.countStudentSignInNum(courseScheduleId, "NORMAL");
+        sum.put("signInNum",signInNum);
+        Integer leaveNum = studentManageDao.countStudentSignInNum(courseScheduleId, "LEAVE");
+        sum.put("leaveNum",leaveNum);
+        studentNum = studentNum==null?0:studentNum;
+        signInNum = signInNum==null?0:signInNum;
+        leaveNum = leaveNum==null?0:leaveNum;
+        sum.put("truantNum",studentNum-signInNum-leaveNum);
+        sum.put("homeworkNum",studentManageDao.countHomeworkNum(courseScheduleId));
+        sum.put("repliedNum",studentManageDao.countRepliedNum(courseScheduleId));
+        return sum;
+    }
 }

+ 6 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysUserCashAccountServiceImpl.java

@@ -105,14 +105,15 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
 		sysUserCashAccountDao.update(cashAccount);
 
 		//推送余额消费信息
-		Map<Integer,String> map = new HashMap<>(1);
+		Map<Integer,String> phoneMap = new HashMap<>(1);
 		SysUser sysUser = sysUserFeignService.queryUserById(userId);
-		map.put(userId,sysUser.getPhone());
+		phoneMap.put(userId,sysUser.getPhone());
 		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.STUDENT_SMS_BALANCE_CONSUME,
-				map,null,0,null,"",decimal,balance);
-		map.put(userId,userId.toString());
+				phoneMap,null,0,null,"",decimal,balance);
+		Map<Integer,String> idMap = new HashMap<>(1);
+		idMap.put(userId,userId.toString());
 		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_SMS_BALANCE_CONSUME,
-				map,null,0,null,"",decimal,balance);
+				idMap,null,0,null,"",decimal,balance);
 		return true;
 	}
 

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

@@ -6,7 +6,10 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.SignStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.TeacherCloseQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
@@ -17,7 +20,6 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
-
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -403,4 +405,9 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		teacherSignDetail.setCourseHomeworkInfo(courseHomewok);
 		return teacherSignDetail;
 	}
+
+	@Override
+	public TeacherAttendance getTeacherPersonalAttendance(Integer courseScheduleId) {
+		return teacherAttendanceDao.getTeacherPersonalAttendance(courseScheduleId);
+	}
 }

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

@@ -8,10 +8,12 @@ import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dao.TeacherLeaveRecordDao;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.entity.TeacherLeaveRecord;
 import com.ym.mec.biz.dal.entity.TeacherLeaveRecord.CoursesScheduleHistory;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.SysMessageService;
@@ -22,6 +24,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.json.JsonUtil;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -80,7 +83,9 @@ public class TeacherLeaveRecordServiceImpl extends BaseServiceImpl<Long, Teacher
 				List<CourseSchedule> list = new ArrayList<CourseSchedule>();
 
 				for (CoursesScheduleHistory his : coursesScheduleHistoryList) {
-
+					if (his.getBefore().getType() != CourseScheduleType.VIP) {
+						continue;
+					}
 					if(!teacherLeaveRecord.getEndTime().before(his.getAfter().getStartClassTime())
 							&&!teacherLeaveRecord.getStartTime().after(his.getAfter().getEndClassTime())){
 						throw new BizException("课程时间与老师请假时间存在冲突");

+ 108 - 72
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -288,6 +288,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		//课程结束时间为排课的最后一节课的结束时间
 		vipGroupApplyBaseInfoDto.setCoursesExpireDate(latestCourseSchedule.getEndClassTime());
 
+		vipGroupApplyBaseInfoDto.setPaymentExpireDate(DateUtil.getLastSecondWithDay(vipGroupApplyBaseInfoDto.getPaymentExpireDate()));
+
         //获取vip课类型信息
         VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupCategoryId().intValue());
 
@@ -387,7 +389,40 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 //		}
 	}
 
-	@Override
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void checkVipCourseIsInScore(Long vipGroupId) {
+	    if(Objects.isNull(vipGroupId)){
+	        return;
+        }
+	    VipGroup vipGroup=vipGroupDao.get(vipGroupId);
+	    if(Objects.isNull(vipGroup)){
+	        throw new BizException("课程不存在");
+        }
+        Date groupCourseStartTime=courseScheduleDao.findGroupCourseStartTime(GroupType.VIP,vipGroupId.toString());
+        Date groupCourseEndTime=courseScheduleDao.findGroupCourseEndTime(GroupType.VIP,vipGroupId.toString());
+
+        //获取活动信息
+        VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
+        if(Objects.nonNull(vipGroupActivity.getCoursesEndTime())||Objects.nonNull(vipGroupActivity.getCoursesStartTime())){
+            if(groupCourseEndTime.after(vipGroupActivity.getCoursesEndTime())
+                    ||groupCourseStartTime.before(vipGroupActivity.getCoursesStartTime())){
+                throw new BizException("课时安排时间超出范围!");
+            }
+        }else{
+            int totalClassTimes = courseScheduleDao.countGroupAllCourses(GroupType.VIP, vipGroupId.toString());
+            VipGroupDefaultClassesCycle vipGroupDefaultClassesCycle = vipGroupDefaultClassesCycleDao.findByOrganAndClassTimes(totalClassTimes);
+
+            if (vipGroupDefaultClassesCycle != null) {
+                int month = DateUtil.monthsBetween(groupCourseStartTime, groupCourseEndTime);
+                if (month > vipGroupDefaultClassesCycle.getMonth()) {
+                    throw new BizException("课时安排时间超出范围!");
+                }
+            }
+        }
+    }
+
+    @Override
 	@Transactional(rollbackFor = Exception.class)
 	public void updateVipGroup(VipGroupApplyDto vipGroupApplyInfo) {
 		VipGroupApplyBaseInfoDto vipGroupUpdateInfo = vipGroupApplyInfo.getVipGroupApplyBaseInfo();
@@ -472,9 +507,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			map.put(vipGroup.getUserId(),vipGroup.getUserId().toString());
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,MessageTypeEnum.TEACHER_SMS_VIP_COURSE_APPLY_RESULT,
 					map,null,0,"7","TEACHER",vipGroup.getName(),vipGroup.getAuditStatus().getMsg());
-			map.put(vipGroup.getUserId(),teacher.getPhone());
+			Map<Integer,String> map1 = new HashMap<>(1);
+			map1.put(vipGroup.getUserId(),teacher.getPhone());
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,MessageTypeEnum.TEACHER_SMS_VIP_COURSE_APPLY_RESULT,
-					map,null,0,"7","",vipGroup.getName(),vipGroup.getAuditStatus().getMsg());
+					map1,null,0,"7","",vipGroup.getName(),vipGroup.getAuditStatus().getMsg());
 		}
 	}
 
@@ -1661,59 +1697,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		return studentRecoverInfoDto;
     }
 
-//    @Override
-//	@Transactional(rollbackFor = Exception.class)
-//	public Map<String, BigDecimal> getStudentSurplusCourseFee(Long vipGroupId, Integer studentId) {
-//		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){
-//			throw new BizException("请指定课程和学生");
-//		}
-//		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
-//		if(Objects.isNull(vipGroup)){
-//			throw new BizException("未找到指定vip课");
-//		}
-//		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
-//			throw new BizException("不能对已停止的课程进行退课操作");
-//		}
-//		Date now = new Date();
-//        BigDecimal bigDecimal;
-//        List<StudentCourseInfoDto> userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.VIP, vipGroupId.toString(), studentId, null);
-//		if(CollectionUtils.isEmpty(userCourseInfos)&&vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
-//            StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
-//            if(Objects.isNull(studentPaymentOrder)){
-//                bigDecimal=new BigDecimal(0);
-//            }else{
-//                bigDecimal=studentPaymentOrder.getActualAmount();
-//            }
-//        }else if(!CollectionUtils.isEmpty(userCourseInfos)){
-//            BigDecimal historyPrice=new BigDecimal(0);
-//            BigDecimal allPrice=new BigDecimal(0);
-//            for (StudentCourseInfoDto userCourseInfo : userCourseInfos) {
-//                allPrice=allPrice.add(userCourseInfo.getExpectPrice());
-//                if(now.after(userCourseInfo.getStartClassTime())){
-//                    historyPrice=historyPrice.add(userCourseInfo.getTeachMode().equals(TeachModeEnum.ONLINE)?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
-//                }
-//            }
-//            bigDecimal=allPrice.subtract(historyPrice);
-//            if(bigDecimal.longValue()<0){
-//                bigDecimal=new BigDecimal(0);
-//            }
-//        }else{
-//		    bigDecimal=new BigDecimal(0);
-//        }
-//        Map<String,BigDecimal> result=new HashMap<>();
-//		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
-//		if(Objects.isNull(classGroup)){
-//			throw new BizException("未找到对应班级");
-//		}
-//		if(Objects.isNull(bigDecimal)){
-//			bigDecimal = new BigDecimal(0);
-//		}
-//		bigDecimal = bigDecimal.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
-//		result.put("suplusCourseFee", bigDecimal);
-//		return result;
-//	}
-
-	@Override
+    @Override
 	@Transactional(rollbackFor = Exception.class)
 	public Map<String, BigDecimal> getStudentSurplusCourseFee(Long vipGroupId, Integer studentId) {
 		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){
@@ -1726,26 +1710,37 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
 			throw new BizException("不能对已停止的课程进行退课操作");
 		}
-		Map<String,BigDecimal> result=new HashMap<>();
-		if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
-			StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
-			if(Objects.isNull(studentPaymentOrder)){
-				BigDecimal surplusCourseFee = studentPaymentOrderDao.sumSurplusCourseFee(vipGroupId.toString(), studentId);
-				if(Objects.isNull(surplusCourseFee)){
-					result.put("suplusCourseFee",new BigDecimal(0));
-				}else{
-					result.put("suplusCourseFee",surplusCourseFee);
-				}
-			}else{
-				result.put("suplusCourseFee",studentPaymentOrder.getActualAmount());
-			}
-			return result;
-		}
+		Date now = new Date();
+        BigDecimal bigDecimal;
+        List<StudentCourseInfoDto> userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.VIP, vipGroupId.toString(), studentId, null);
+		if(CollectionUtils.isEmpty(userCourseInfos)&&vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
+            StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
+            if(Objects.isNull(studentPaymentOrder)){
+                bigDecimal=new BigDecimal(0);
+            }else{
+                bigDecimal=studentPaymentOrder.getActualAmount();
+            }
+        }else if(!CollectionUtils.isEmpty(userCourseInfos)){
+            BigDecimal historyPrice=new BigDecimal(0);
+            BigDecimal allPrice=new BigDecimal(0);
+            for (StudentCourseInfoDto userCourseInfo : userCourseInfos) {
+                allPrice=allPrice.add(userCourseInfo.getExpectPrice());
+                if(now.after(userCourseInfo.getStartClassTime())){
+                    historyPrice=historyPrice.add(userCourseInfo.getTeachMode().equals(TeachModeEnum.ONLINE)?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
+                }
+            }
+            bigDecimal=allPrice.subtract(historyPrice);
+            if(bigDecimal.longValue()<0){
+                bigDecimal=new BigDecimal(0);
+            }
+        }else{
+		    bigDecimal=new BigDecimal(0);
+        }
+        Map<String,BigDecimal> result=new HashMap<>();
 		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
 		if(Objects.isNull(classGroup)){
 			throw new BizException("未找到对应班级");
 		}
-		BigDecimal bigDecimal = courseScheduleStudentPaymentDao.countSurplusCourseFee(classGroup.getId(), studentId);
 		if(Objects.isNull(bigDecimal)){
 			bigDecimal = new BigDecimal(0);
 		}
@@ -1754,6 +1749,47 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		return result;
 	}
 
+//	@Override
+//	@Transactional(rollbackFor = Exception.class)
+//	public Map<String, BigDecimal> getStudentSurplusCourseFee(Long vipGroupId, Integer studentId) {
+//		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){
+//			throw new BizException("请指定课程和学生");
+//		}
+//		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
+//		if(Objects.isNull(vipGroup)){
+//			throw new BizException("未找到指定vip课");
+//		}
+//		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
+//			throw new BizException("不能对已停止的课程进行退课操作");
+//		}
+//		Map<String,BigDecimal> result=new HashMap<>();
+//		if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
+//			StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
+//			if(Objects.isNull(studentPaymentOrder)){
+//				BigDecimal surplusCourseFee = studentPaymentOrderDao.sumSurplusCourseFee(vipGroupId.toString(), studentId);
+//				if(Objects.isNull(surplusCourseFee)){
+//					result.put("suplusCourseFee",new BigDecimal(0));
+//				}else{
+//					result.put("suplusCourseFee",surplusCourseFee);
+//				}
+//			}else{
+//				result.put("suplusCourseFee",studentPaymentOrder.getActualAmount());
+//			}
+//			return result;
+//		}
+//		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
+//		if(Objects.isNull(classGroup)){
+//			throw new BizException("未找到对应班级");
+//		}
+//		BigDecimal bigDecimal = courseScheduleStudentPaymentDao.countSurplusCourseFee(classGroup.getId(), studentId);
+//		if(Objects.isNull(bigDecimal)){
+//			bigDecimal = new BigDecimal(0);
+//		}
+//		bigDecimal = bigDecimal.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+//		result.put("suplusCourseFee", bigDecimal);
+//		return result;
+//	}
+
 	@Transactional(rollbackFor = Exception.class)
 	@Override
 	public void applyRefundAudit(Long id, StudentApplyRefundsStatus status, String remark,BigDecimal amount) {

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

@@ -360,6 +360,7 @@
             AND cg.name_ LIKE CONCAT('%',#{search},'%')
         </if>
     </select>
+
     <select id="findNoClassSubjects" resultMap="ClassGroup">
         SELECT cg.* FROM class_group cg LEFT JOIN class_group_relation cgr ON cgr.sub_class_group_id_=cg.id_
         WHERE cg.music_group_id_=#{musicGroupId} AND cg.type_ = 'NORMAL'
@@ -1006,6 +1007,9 @@
             LEFT JOIN sys_user su ON cgtm.user_id_ = su.id_
         WHERE su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.id_=#{search}
     </select>
+    <select id="countClassNumByType" resultType="java.lang.Integer">
+        SELECT COUNT(id_) FROM class_group WHERE type_ = 'HIGH' AND del_flag_ = '0'
+    </select>
 
 
 </mapper>

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml

@@ -232,6 +232,8 @@
 	</select>
 	
 	<select id="queryTeacerNoReplyNum" resultMap="Mapper">
-		select cs.actual_teacher_id_ key_,count(1) value_ from student_course_homework sch left join course_schedule cs on sch.course_schedule_id_ = cs.id_ where (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL) AND csh.is_replied_ = 0 group by cs.actual_teacher_id_
+		select cs.actual_teacher_id_ key_,count(1) value_ from student_course_homework sch
+		left join course_schedule cs on sch.course_schedule_id_ = cs.id_
+		where (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL) AND csh.is_replied_ = 0 group by cs.actual_teacher_id_
 	</select>
 </mapper>

+ 34 - 14
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -829,17 +829,20 @@
 
     <sql id="queryStudentCourseScheduleRecordCondition">
         <where>
-            (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
-            AND sa.user_id_=#{userId}
+            cssp.user_id_=#{userId}
             AND cs.status_ != 'NOT_START'
+            AND cs.del_flag_ = 0
             <if test="teachMode!=null and teachMode!=''">
                 AND cs.teach_mode_=#{teachMode}
             </if>
             <if test="type!=null and type!=''">
                 AND cs.group_type_ = #{type}
             </if>
-            <if test="status!=null and status!=''">
-                AND sa.status_=#{status}
+            <if test="status != null and status != 'TRUANT'">
+                AND sa.status_ = #{status}
+            </if>
+            <if test="status != null and status = 'TRUANT'">
+                AND (sa.status_ = #{status} OR sa.status_ IS NULL)
             </if>
         </where>
     </sql>
@@ -847,7 +850,7 @@
     <select id="findStudentCourseScheduleRecords" resultMap="studentCourseScheduleRecord">
         SELECT
             sa.id_,
-            sa.status_,
+            IF(sa.status_ IS NULL,'TRUANT',sa.status_) status_,
             sa.teacher_id_,
             su.username_,
             cs.id_ course_schedule_id_,
@@ -857,8 +860,8 @@
             CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
             cs.teacher_id_,
             cs.teach_mode_
-        FROM
-          student_attendance sa
+        FROM course_schedule_student_payment cssp
+            LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
             LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
             LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
         <include refid="queryStudentCourseScheduleRecordCondition"/>
@@ -867,9 +870,9 @@
     </select>
     <select id="countStudentCourseScheduleRecords" resultType="int">
         SELECT
-        count(*)
-        FROM
-        student_attendance sa
+        count(cssp.id_)
+        FROM course_schedule_student_payment cssp
+        LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
         LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
         LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
         <include refid="queryStudentCourseScheduleRecordCondition"/>
@@ -1921,13 +1924,13 @@
         <where>
             <if test="search != null">
                 AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search}
-                  <if test="groups != null and organIdList==null">
+                  <if test="groups != null and groupId==null">
                       OR cs.music_group_id_ IN
                       <foreach collection="groups" item="group" open="(" close=")" separator=",">
                           #{group.id}
                       </foreach>
                   </if>
-                  <if test="courseIds != null and organIdList==null">
+                  <if test="courseIds != null and groupId==null">
                     OR cs.id_ IN
                     <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
                         #{courseId}
@@ -1935,13 +1938,13 @@
                   </if>
                 )
             </if>
-            <if test="groups != null and organIdList!=null">
+            <if test="groups != null and groupId!=null">
                 AND cs.music_group_id_ IN
                 <foreach collection="groups" item="group" open="(" close=")" separator=",">
                     #{group.id}
                 </foreach>
             </if>
-            <if test="courseIds != null and organIdList!=null">
+            <if test="courseIds != null and groupId!=null">
                 AND cs.id_ IN
                 <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
                     #{courseId}
@@ -2055,4 +2058,21 @@
         AND cs.class_date_&gt;=DATE_FORMAT(#{fromDate},"%Y-%m-%d")
         AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
     </select>
+
+    <select id="findGroupCourseStartTime" resultType="java.util.Date">
+        SELECT MIN(CONCAT(class_date_,' ',start_class_time_)) FROM course_schedule
+        WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                AND music_group_id_=#{groupId}
+    </select>
+
+    <select id="findGroupCourseEndTime" resultType="java.util.Date">
+        SELECT MAX(CONCAT(class_date_,' ',end_class_time_)) FROM course_schedule
+        WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                AND music_group_id_=#{groupId}
+    </select>
+    <select id="countGroupAllCourses" resultType="int">
+        SELECT COUNT(*) FROM course_schedule
+        WHERE group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                AND music_group_id_=#{groupId}
+    </select>
 </mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -283,6 +283,9 @@
 -- 		AND CONCAT(cs.class_date_,' ',cs.start_class_time_) &gt; NOW()
 		AND cssp.settlement_time_ IS NULL
 	</select>
+	<select id="countStudentNum" resultType="java.lang.Integer">
+		SELECT COUNT(id_) FROM course_schedule_student_payment WHERE course_schedule_id_ = #{courseScheduleId}
+	</select>
 
 	<delete id="deleteStudentCourseSchedule">
 		DELETE FROM course_schedule_student_payment WHERE user_id_ = #{userId} AND course_schedule_id_ IN

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -13,6 +13,8 @@
         <result column="class_group_id_" property="classGroupId"/>
         <result column="course_schedule_id_" property="courseScheduleId"/>
         <result column="user_id_" property="userId"/>
+        <result column="username_" property="username"/>
+        <result column="phone_" property="phone"/>
         <result column="teacher_id_" property="teacherId"/>
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="create_time_" property="createTime"/>
@@ -406,4 +408,18 @@
             </foreach>
             GROUP BY sa.course_schedule_id_
     </select>
+    <select id="findStudentAttendance" resultMap="StudentAttendance">
+        SELECT sa.*,su.username_,su.phone_
+        FROM course_schedule_student_payment cssp
+        LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
+        LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
+        WHERE cssp.course_schedule_id_ = #{search}
+        ORDER BY sa.id_ DESC
+        <include refid="global.limit"/>
+    </select>
+    <select id="countStudentAttendance" resultType="java.lang.Integer">
+        SELECT COUNT(id_)
+        FROM course_schedule_student_payment
+        WHERE course_schedule_id_ = #{search}
+    </select>
 </mapper>

+ 24 - 0
mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml

@@ -10,6 +10,7 @@
         <result column="id_" property="id"/>
         <result column="user_id_" property="userId"/>
         <result column="username_" property="userName"/>
+        <result column="phone_" property="phone"/>
         <result column="avatar_" property="avatar"/>
         <result column="course_homework_id_" property="courseHomeworkId"/>
         <result column="course_schedule_id_" property="courseScheduleId"/>
@@ -264,4 +265,27 @@
     <select id="queryNotDoneHomeworkList" resultMap="StudentCourseHomeworkFull">
 		SELECT sch.*,cg.name_ classGroupName,mg.name_ musicGroupName FROM student_course_homework sch left join course_homework ch on sch.course_homework_id_ = ch.id_ left join music_group mg on ch.music_group_id_ = mg.id_ left join class_group cg on ch.class_group_id_ = cg.id_ where sch.status_ = 0
 	</select>
+    <select id="countStudentCourseHomeworks" resultType="java.lang.Integer">
+        SELECT COUNT(id_) FROM course_schedule_student_payment WHERE course_schedule_id_ = #{search}
+    </select>
+    <resultMap id="StudentCourseHomeworkDtoMap" type="com.ym.mec.biz.dal.dto.StudentCourseHomeworkDto">
+        <result column="username_" property="username"/>
+        <result column="phone_" property="phone"/>
+        <result column="subject_name_" property="subjectName"/>
+        <result column="attachments_" property="url"/>
+        <result column="is_replied_" property="isReplied"/>
+        <result column="is_view_" property="isView"/>
+        <result column="create_time_" property="createTime"/>
+    </resultMap>
+    <select id="findStudentCourseHomeworks" resultMap="StudentCourseHomeworkDtoMap">
+        SELECT sch.attachments_,sch.is_replied_,sch.is_view_,sch.create_time_,su.username_,su.phone_,s.name_ subject_name_
+        FROM course_schedule_student_payment cssp
+        LEFT JOIN student_course_homework sch ON sch.course_schedule_id_ = cssp.course_schedule_id_
+        LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
+        LEFT JOIN student_registration sr ON cssp.music_group_id_ = sr.music_group_id_ AND cssp.user_id_ = sr.user_id_
+        LEFT JOIN `subject` s ON s.id_ = sr.actual_subject_id_
+        WHERE cssp.course_schedule_id_ = #{search}
+        ORDER BY sch.id_ DESC
+        <include refid="global.limit"/>
+    </select>
 </mapper>

+ 9 - 1
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -668,5 +668,13 @@
         LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
         WHERE cs.status_ != 'OVER' AND su.id_ = #{userId}
     </select>
-
+    <select id="countStudentSignInNum" resultType="java.lang.Integer">
+        SELECT COUNT(id_) FROM student_attendance WHERE course_schedule_id_ = #{courseScheduleId} AND status_ = #{status}
+    </select>
+    <select id="countHomeworkNum" resultType="java.lang.Integer">
+        SELECT COUNT(id_) FROM student_course_homework WHERE course_schedule_id_ = #{courseScheduleId}
+    </select>
+    <select id="countRepliedNum" resultType="java.lang.Integer">
+        SELECT COUNT(id_) FROM student_course_homework WHERE course_schedule_id_ = #{courseScheduleId} AND is_replied_ = 1
+    </select>
 </mapper>

+ 8 - 0
mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml

@@ -22,6 +22,7 @@
         <result column="current_class_times_" property="currentClassTimes"/>
         <result column="sign_in_longitude_latitude_" property="signInLongitudeLatitude"/>
         <result column="sign_out_longitude_latitude_" property="signOutLongitudeLatitude"/>
+        <result column="longitude_latitude_" property="schoolLongitudeLatitude"/>
     </resultMap>
     
     <resultMap type="com.ym.mec.biz.dal.dto.Mapper" id="Mapper">
@@ -335,6 +336,13 @@
                 #{courseScheduleId}
             </foreach>
     </select>
+    <select id="getTeacherPersonalAttendance" resultMap="TeacherAttendance">
+        SELECT ta.sign_in_longitude_latitude_,ta.sign_out_longitude_latitude_,s.longitude_latitude_ FROM teacher_attendance ta
+        LEFT JOIN course_schedule cs ON ta.course_schedule_id_ = cs.id_
+        LEFT JOIN school s ON cs.schoole_id_ = s.id_
+        WHERE ta.course_schedule_id_ = #{courseScheduleId}
+        LIMIT 1
+    </select>
 
     <update id="updateViPSignOutStatus" parameterType="string">
     	update teacher_attendance set sign_out_status_ = 1,sign_out_time_= now()

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -159,7 +159,7 @@
             1=1
             AND vg.audit_status_='PASS'
             <if test="search!=null and search!=''">
-                AND (vg.name_ LIKE CONCAT('%',#{search},'%') OR vg.id_=#{search})
+                AND (vg.name_ LIKE CONCAT('%',#{search},'%') OR vg.id_= #{search})
             </if>
             <if test="teacherId!=null">
                 AND vg.user_id_=#{teacherId}

+ 1 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherLeaveRecordController.java

@@ -17,7 +17,6 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.entity.TeacherLeaveRecord;
-import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.service.TeacherLeaveRecordService;
 import com.ym.mec.common.controller.BaseController;
 
@@ -42,7 +41,7 @@ public class TeacherLeaveRecordController extends BaseController {
 		if (Objects.isNull(sysUser)) {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
-		return succeed(courseScheduleDao.queryTeacherCourseScheduleListByTimeRangeAndType(sysUser.getId(), CourseScheduleType.VIP, startTime, endTime));
+		return succeed(courseScheduleDao.queryTeacherCourseScheduleListByTimeRangeAndType(sysUser.getId(), null, startTime, endTime));
 	}
 
 	@ApiOperation(value = "请假")

+ 16 - 0
mec-util/src/main/java/com/ym/mec/util/date/DateUtil.java

@@ -916,6 +916,22 @@ public class DateUtil {
 	}
 
 	/**
+	 * @describe 获取指定时间再当天最后一秒的时间
+	 * @author Joburgess
+	 * @date 2020/1/16
+	 * @param date: 时间
+	 * @return java.util.Date
+	 */
+	public static Date getLastSecondWithDay(Date date){
+		Calendar calendar=Calendar.getInstance();
+		calendar.setTime(date);
+		calendar.set(Calendar.HOUR_OF_DAY,23);
+		calendar.set(Calendar.MINUTE, 59);
+		calendar.set(Calendar.SECOND, 59);
+		return calendar.getTime();
+	}
+
+	/**
 	 * @describe 根据日期获取所在周的周一
 	 * @author Joburgess
 	 * @date 2019/10/25

+ 33 - 1
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -7,10 +7,12 @@ import com.ym.mec.biz.dal.dto.UpdateStudentFeeDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.MusicGroupStudentFeeService;
+import com.ym.mec.biz.service.StudentCourseHomeworkService;
 import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -18,7 +20,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
-
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
@@ -37,7 +38,10 @@ public class StudentManageController extends BaseController {
     @Autowired
     private MusicGroupStudentFeeService musicGroupStudentFeeService;
     @Autowired
+    private StudentCourseHomeworkService studentCourseHomeworkService;
+    @Autowired
     private EmployeeDao employeeDao;
+
     private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
 
     @ApiOperation(value = "获取学生列表")
@@ -234,4 +238,32 @@ public class StudentManageController extends BaseController {
         }
         return succeed(musicGroupStudentFeeService.findByUser(studentId,musicGroupId));
     }
+
+    /**
+     * 获取课程学员作业列表
+     * @return
+     */
+    @GetMapping(value = "/findStudentCourseHomeworks")
+    @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentCourseHomeworks')")
+    public Object findStudentCourseHomeworks(QueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("用户信息获取失败");
+        }
+        return succeed(studentCourseHomeworkService.findStudentCourseHomeworks(queryInfo));
+    }
+
+    /**
+     * 获取课程学员作业列表
+     * @return
+     */
+    @GetMapping(value = "/sumStudentAttendance")
+    @PreAuthorize("@pcs.hasPermissions('studentManage/sumStudentAttendance')")
+    public Object sumStudentAttendance(Integer courseScheduleId) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("用户信息获取失败");
+        }
+        return succeed(studentManageService.sumStudentAttendance(courseScheduleId));
+    }
 }

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java

@@ -25,4 +25,11 @@ public class TeacherAttendanceController extends BaseController {
     public Object getTeacherPersonalAttendances(TeacherCloseQueryInfo queryInfo){
         return succeed(teacherAttendanceService.getTeacherPersonalAttendances(queryInfo));
     }
+
+    @ApiOperation(value = "查询某节课教师签到记录")
+    @GetMapping("/getTeacherPersonalAttendance")
+    @PreAuthorize("@pcs.hasPermissions('teacherAttendance/getTeacherPersonalAttendance')")
+    public Object getTeacherPersonalAttendances(Integer courseScheduleId){
+        return succeed(teacherAttendanceService.getTeacherPersonalAttendance(courseScheduleId));
+    }
 }

+ 1 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TeacherLeaveRecordController.java

@@ -51,6 +51,7 @@ public class TeacherLeaveRecordController extends BaseController {
     	
     	SysUser user = sysUserFeignService.queryUserById(teacherLeaveRecord.getUserId());
     	teacherLeaveRecord.getUser().setUsername(user.getUsername());
+    	teacherLeaveRecord.getUser().setId(user.getId());
     	
         return succeed(teacherLeaveRecord);
     }

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/controller/student/StudentAttendanceController.java

@@ -4,9 +4,11 @@ import com.ym.mec.biz.dal.dto.StudentAttendanceDto;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 @RequestMapping("studentAttendance")
@@ -30,4 +32,11 @@ public class StudentAttendanceController extends BaseController {
         return succeed(studentAttendanceService.getStudentPersonalAttendances(queryInfo));
     }
 
+    @ApiOperation(value = "获取某节课学生签到列表")
+    @GetMapping("/findStudentAttendance")
+    @PreAuthorize("@pcs.hasPermissions('studentAttendance/findStudentAttendance')")
+    public Object findStudentAttendance(QueryInfo queryInfo){
+        return succeed(studentAttendanceService.findStudentAttendance(queryInfo));
+    }
+
 }