Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
Joburgess 5 years ago
parent
commit
d0496ab15e

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

@@ -14,14 +14,16 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
 
 
     List<SysUser> findStudents(Map<String, Object> params);
+
     int countStudents(Map<String, Object> params);
-    
+
     List<Student> queryByOperatingTag(Integer operatingTag);
-    
+
     int batchUpdate(@Param("studentList") List<Student> studentList);
 
     /**
      * 查询运营学生列表
+     *
      * @param params
      * @return
      */
@@ -29,8 +31,16 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
 
     /**
      * 查询运营学生总数
+     *
      * @param params
      * @return
      */
     Integer countOperatingStudents(Map<String, Object> params);
+
+    /**
+     * 批量获取老师体验学生数
+     * @param teacherIds
+     * @return
+     */
+    List<Student4operating> getTeacherOperatingStudentsNum(@Param("teacherIds") String teacherIds);
 }

+ 130 - 122
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/Student4operating.java

@@ -4,137 +4,145 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
 
 public class Student4operating {
 
-private String organName;
-private String organId;
-private String studentName;
-private Integer studentId;
-private String teacherId;
-private String teacherName;
-private Integer operatingTag;
-private Integer vipTimes;
-private Integer freePracticeTimes;
-private Integer buyPracticeTimes;
-
-private String operatingTagStr;
-private String vipTimesStr;
-private String freePracticeTimesStr;
-private String buyPracticeTimesStr;
-
-
-	public String getOrganName() {
-		return organName;
-	}
-
-	public void setOrganName(String organName) {
-		this.organName = organName;
-	}
-
-	public String getOrganId() {
-		return organId;
-	}
-
-	public void setOrganId(String organId) {
-		this.organId = organId;
-	}
-
-	public String getStudentName() {
-		return studentName;
-	}
-
-	public void setStudentName(String studentName) {
-		this.studentName = studentName;
-	}
-
-	public Integer getStudentId() {
-		return studentId;
-	}
-
-	public void setStudentId(Integer studentId) {
-		this.studentId = studentId;
-	}
-
-	public String getTeacherId() {
-		return teacherId;
-	}
-
-	public void setTeacherId(String teacherId) {
-		this.teacherId = teacherId;
-	}
-
-	public String getTeacherName() {
-		return teacherName;
-	}
-
-	public void setTeacherName(String teacherName) {
-		this.teacherName = teacherName;
-	}
+    private String organName;
+    private String organId;
+    private String studentName;
+    private Integer studentId;
+    private String teacherId;
+    private String teacherName;
+    private Integer operatingTag;
+    private Integer vipTimes;
+    private Integer freePracticeTimes;
+    private Integer buyPracticeTimes;
+
+    private String operatingTagStr;
+    private String vipTimesStr;
+    private String freePracticeTimesStr;
+    private String buyPracticeTimesStr;
+    private Integer studentNum;
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(String organId) {
+        this.organId = organId;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(String teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Integer getOperatingTag() {
+        return operatingTag;
+    }
+
+    public void setOperatingTag(Integer operatingTag) {
+        this.operatingTag = operatingTag;
+    }
+
+    public Integer getVipTimes() {
+        return vipTimes;
+    }
+
+    public void setVipTimes(Integer vipTimes) {
+        this.vipTimes = vipTimes;
+    }
+
+    public Integer getFreePracticeTimes() {
+        return freePracticeTimes;
+    }
+
+    public void setFreePracticeTimes(Integer freePracticeTimes) {
+        this.freePracticeTimes = freePracticeTimes;
+    }
+
+    public Integer getBuyPracticeTimes() {
+        return buyPracticeTimes;
+    }
+
+    public void setBuyPracticeTimes(Integer buyPracticeTimes) {
+        this.buyPracticeTimes = buyPracticeTimes;
+    }
+
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    public String getOperatingTagStr() {
+        return operatingTagStr;
+    }
 
-	public Integer getOperatingTag() {
-		return operatingTag;
-	}
-
-	public void setOperatingTag(Integer operatingTag) {
-		this.operatingTag = operatingTag;
-	}
-
-	public Integer getVipTimes() {
-		return vipTimes;
-	}
-
-	public void setVipTimes(Integer vipTimes) {
-		this.vipTimes = vipTimes;
-	}
+    public void setOperatingTagStr(String operatingTagStr) {
+        this.operatingTagStr = operatingTagStr;
+    }
 
-	public Integer getFreePracticeTimes() {
-		return freePracticeTimes;
-	}
+    public String getVipTimesStr() {
+        return vipTimesStr;
+    }
 
-	public void setFreePracticeTimes(Integer freePracticeTimes) {
-		this.freePracticeTimes = freePracticeTimes;
-	}
+    public void setVipTimesStr(String vipTimesStr) {
+        this.vipTimesStr = vipTimesStr;
+    }
 
-	public Integer getBuyPracticeTimes() {
-		return buyPracticeTimes;
-	}
+    public String getFreePracticeTimesStr() {
+        return freePracticeTimesStr;
+    }
 
-	public void setBuyPracticeTimes(Integer buyPracticeTimes) {
-		this.buyPracticeTimes = buyPracticeTimes;
-	}
+    public void setFreePracticeTimesStr(String freePracticeTimesStr) {
+        this.freePracticeTimesStr = freePracticeTimesStr;
+    }
 
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
+    public String getBuyPracticeTimesStr() {
+        return buyPracticeTimesStr;
+    }
 
-	public String getOperatingTagStr() {
-		return operatingTagStr;
-	}
-
-	public void setOperatingTagStr(String operatingTagStr) {
-		this.operatingTagStr = operatingTagStr;
-	}
-
-	public String getVipTimesStr() {
-		return vipTimesStr;
-	}
-
-	public void setVipTimesStr(String vipTimesStr) {
-		this.vipTimesStr = vipTimesStr;
-	}
-
-	public String getFreePracticeTimesStr() {
-		return freePracticeTimesStr;
-	}
-
-	public void setFreePracticeTimesStr(String freePracticeTimesStr) {
-		this.freePracticeTimesStr = freePracticeTimesStr;
-	}
+    public void setBuyPracticeTimesStr(String buyPracticeTimesStr) {
+        this.buyPracticeTimesStr = buyPracticeTimesStr;
+    }
 
-	public String getBuyPracticeTimesStr() {
-		return buyPracticeTimesStr;
+	public Integer getStudentNum() {
+		return studentNum;
 	}
 
-	public void setBuyPracticeTimesStr(String buyPracticeTimesStr) {
-		this.buyPracticeTimesStr = buyPracticeTimesStr;
+	public void setStudentNum(Integer studentNum) {
+		this.studentNum = studentNum;
 	}
 }

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TeacherSalaryComplaintsStatusEnum.java

@@ -4,10 +4,10 @@ import com.ym.mec.common.enums.BaseEnum;
 
 public enum TeacherSalaryComplaintsStatusEnum implements BaseEnum<String, TeacherSalaryComplaintsStatusEnum> {
 	PENDING("PENDING", "待处理"),
-	Done("DONE", "完成"),
-	AGREED("AGREED", "同意"),
-	DENIED("DENIED", "拒绝"),
-	WITHDRAWN("WITHDRAWN", "撤回");
+	Done("DONE", "完成"),
+	AGREED("AGREED", "同意"),
+	DENIED("DENIED", "拒绝"),
+	WITHDRAWN("WITHDRAWN", "撤回");
 
 	private String code;
 

+ 37 - 36
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
 
 @Service
 public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance>  implements StudentAttendanceService {
-	
+
 	@Autowired
 	private StudentAttendanceDao studentAttendanceDao;
 	@Autowired
@@ -265,8 +265,8 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 				case LEAVE:
 					result.put("numberOfLeavePeoples",studentStatusCount.getNumberOfStudent());
 					break;
-			default:
-				break;
+				default:
+					break;
 
 			}
 		});
@@ -297,18 +297,18 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public boolean leave(Integer userId, Long courseScheduleId, String remark) {
-		
+
 		CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId);
 		if(courseSchedule == null){
 			throw new BizException("课程编号异常");
 		}
-		
+
 		if(courseSchedule.getStatus() == CourseStatusEnum.OVER){
 			throw new BizException("课程已结束");
 		}
 
 		Date date = new Date();
-		
+
 		int hours = 4;
 		String str = sysConfigDao.findConfigValue(SysConfigService.ADVANCE_LEAVE_HOURS);
 		if (StringUtils.isNotBlank(str)) {
@@ -318,7 +318,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		if(DateUtil.addHours(date, hours).after(courseSchedule.getStartClassTime())){
 			throw new BizException("开课{}小时之前才可以请假",hours);
 		}
-		
+
 		StudentAttendance studentAttendance  = studentAttendanceDao.findByStatusAndCourseScheduleId(userId,courseScheduleId.intValue());
 		if(Objects.isNull(studentAttendance)){
 			studentAttendance=new StudentAttendance();
@@ -338,7 +338,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		}else{
 			studentAttendanceDao.insert(studentAttendance);
 		}
-		
+
 		ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.query(courseSchedule.getClassGroupId(), userId);
 		if(Objects.isNull(classGroupStudentMapper)){
 			throw new BizException("您不在此课程对应班级上");
@@ -500,7 +500,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 			if(DateUtil.minutesBetween(classEndDateTime,date) >= 0){
 				String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
 				if(StringUtils.isEmpty(continueCourseTime)){
-					continueCourseTime = "3";
+					continueCourseTime = "10";
 				}
 				List<CourseSchedule> courseSchedules = new ArrayList<>();
 				CourseSchedule cs = courseSchedule;
@@ -530,34 +530,35 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 							//获取当前课程的单节课时长
 							int signClassMinutes = courseScheduleDao.getSingleClassMinutes(e.getId());
 							totalMinutes -= signClassMinutes;
-							//补充签到签退时间
-							courseClassDate = DateUtil.format(e.getClassDate(), DateUtil.DEFAULT_PATTERN);
-							courseStartDateTime = DateUtil.format(e.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-							courseEndDateTime = DateUtil.format(e.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-							Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-							Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-							StudentAttendance byStatusAndCourseScheduleId = studentAttendanceDao.findByStatusAndCourseScheduleId(userId, e.getId().intValue());
-							if(byStatusAndCourseScheduleId != null){
-								byStatusAndCourseScheduleId.setSignOutTime(date);
-								byStatusAndCourseScheduleId.setStatus(statusEnum);
-								byStatusAndCourseScheduleId.setUpdateTime(date);
-								studentAttendanceDao.update(byStatusAndCourseScheduleId);
+							if(totalMinutes >= 0){
+								//补充签到签退时间
+								courseClassDate = DateUtil.format(e.getClassDate(), DateUtil.DEFAULT_PATTERN);
+								courseStartDateTime = DateUtil.format(e.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+								courseEndDateTime = DateUtil.format(e.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+								Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+								Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
+								StudentAttendance byStatusAndCourseScheduleId = studentAttendanceDao.findByStatusAndCourseScheduleId(userId, e.getId().intValue());
+								if(byStatusAndCourseScheduleId != null){
+									byStatusAndCourseScheduleId.setSignOutTime(date);
+									byStatusAndCourseScheduleId.setStatus(statusEnum);
+									byStatusAndCourseScheduleId.setUpdateTime(date);
+									studentAttendanceDao.update(byStatusAndCourseScheduleId);
+								}else {
+									byStatusAndCourseScheduleId = new StudentAttendance();
+									byStatusAndCourseScheduleId.setSignOutTime(endDateTime);
+									byStatusAndCourseScheduleId.setStatus(statusEnum);
+									byStatusAndCourseScheduleId.setSignInTime(startDateTime);
+									byStatusAndCourseScheduleId.setUpdateTime(date);
+									byStatusAndCourseScheduleId.setUserId(userId);
+									byStatusAndCourseScheduleId.setTeacherId(courseSchedule.getActualTeacherId());
+									byStatusAndCourseScheduleId.setClassGroupId(e.getClassGroupId());
+									byStatusAndCourseScheduleId.setCourseScheduleId(e.getId());
+									byStatusAndCourseScheduleId.setMusicGroupId(e.getMusicGroupId());
+									byStatusAndCourseScheduleId.setGroupType(e.getGroupType());
+									byStatusAndCourseScheduleId.setCurrentClassTimes(classGroup.getCurrentClassTimes() + 1);
+									studentAttendanceDao.insert(byStatusAndCourseScheduleId);
+								}
 							}else {
-								byStatusAndCourseScheduleId = new StudentAttendance();
-								byStatusAndCourseScheduleId.setSignOutTime(endDateTime);
-								byStatusAndCourseScheduleId.setStatus(statusEnum);
-								byStatusAndCourseScheduleId.setSignInTime(startDateTime);
-								byStatusAndCourseScheduleId.setUpdateTime(date);
-								byStatusAndCourseScheduleId.setUserId(userId);
-								byStatusAndCourseScheduleId.setTeacherId(courseSchedule.getActualTeacherId());
-								byStatusAndCourseScheduleId.setClassGroupId(e.getClassGroupId());
-								byStatusAndCourseScheduleId.setCourseScheduleId(e.getId());
-								byStatusAndCourseScheduleId.setMusicGroupId(e.getMusicGroupId());
-								byStatusAndCourseScheduleId.setGroupType(e.getGroupType());
-								byStatusAndCourseScheduleId.setCurrentClassTimes(classGroup.getCurrentClassTimes() + 1);
-								studentAttendanceDao.insert(byStatusAndCourseScheduleId);
-							}
-							if(totalMinutes < 0){
 								break;
 							}
 						}

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

@@ -30,7 +30,7 @@ import java.util.*;
 
 @Service
 public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherAttendance>  implements TeacherAttendanceService {
-	
+
 	@Autowired
 	private TeacherAttendanceDao teacherAttendanceDao;
 	@Autowired
@@ -38,6 +38,8 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 	@Autowired
 	private CourseHomeworkService courseHomeworkService;
 	@Autowired
+	private StudentAttendanceDao studentAttendanceDao;
+	@Autowired
 	private StudentCourseHomeworkDao studentCourseHomeworkDao;
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
@@ -289,6 +291,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 				//正常签到范围(开始之前)
 				isSign = true;
 			}else {
+//			}else if(DateUtil.minutesBetween(add1Minutes,date) >= 0){
 				//异常签到范围(开始之后)
 				isSign = true;
 				teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
@@ -348,12 +351,6 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 								Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
 								teacherAttendanceDao.cuntinueCourseSign(e.getId(),startDateTime,endDateTime,1);
 							}else {
-								courseClassDate = DateUtil.format(e.getClassDate(), DateUtil.DEFAULT_PATTERN);
-								courseStartDateTime = DateUtil.format(e.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-								courseEndDateTime = DateUtil.format(e.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
-								Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-								Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
-								teacherAttendanceDao.cuntinueCourseSign(e.getId(),startDateTime,endDateTime,0);
 								break;
 							}
 						}
@@ -389,7 +386,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 
 	@Override
 	public boolean pushNoSignOutMessage() {
-		
+
 		Integer minutes = Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.SIGN_OUT_MESSAGE_PUSH_MINUTE));;
 
 		List<Mapper> list = teacherAttendanceDao.queryNoSignOutListByOverMinutes(minutes);
@@ -398,7 +395,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			Map<Integer, String> receivers = new HashMap<Integer, String>();
 			Integer userId = (Integer) mapper.getKey();
 			receivers.put(userId, userId + "");
-			
+
 			String key = "SignOut_" + userId + "_" + mapper.getCourseScheduleId();
 
 			if (!redisCache.exists(key)) {

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

@@ -2,20 +2,26 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dao.TeacherSalaryComplaintsDao;
 import com.ym.mec.biz.dal.entity.TeacherSalaryComplaints;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.TeacherSalaryComplaintsStatusEnum;
+import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.biz.service.TeacherSalaryComplaintsService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
+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;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.TeacherSalaryComplaintsStatusEnum.PENDING;
 
@@ -27,6 +33,8 @@ public class TeacherSalaryComplaintsServiceImpl extends BaseServiceImpl<Long, Te
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
+	private SysConfigDao sysConfigDao;
+	@Autowired
 	private SysMessageService sysMessageService;
 
 	@Override
@@ -56,7 +64,14 @@ public class TeacherSalaryComplaintsServiceImpl extends BaseServiceImpl<Long, Te
 		salaryComplaints.setHandingSuggestion(complaints.getHandingSuggestion());
 		salaryComplaints.setOperatorId(sysUser.getId());
 		teacherSalaryComplaintsDao.update(salaryComplaints);
-//		sysMessageService.batchSendMessage();
+		Map<Integer, String> map = new HashMap<>(1);
+		map.put(salaryComplaints.getTeacherId(), salaryComplaints.getTeacherId().toString());
+		if (map != null && map.size() > 0) {
+			sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+			String url = new StringBuffer(sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL)).append("/#/appealResult?id").append(salaryComplaints.getId()).toString();
+			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.COURSE_SALARY_COMPLAINTS_RESULT, map, null, 0, url,
+					"TEACHER", DateUtil.format(salaryComplaints.getCreateTime(),DateUtil.DEFAULT_PATTERN),complaints.getStatusEnum().getMsg());
+		}
 	}
 
 	@Override

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

@@ -2957,10 +2957,12 @@
     </select>
     <select id="getLastCourse" resultMap="CourseSchedule">
         SELECT cs.* FROM course_schedule cs
+        LEFT JOIN teacher_attendance ta ON cs.id_ = ta.course_schedule_id_ AND ta.teacher_id_ = cs.actual_teacher_id_
+        LEFT JOIN student_attendance sa ON cs.id_ = sa.course_schedule_id_
         WHERE cs.class_group_id_ = #{classGroupId}
         AND TIMESTAMPDIFF(MINUTE, CONCAT(cs.class_date_," ",cs.end_class_time_),#{startTime}) &lt;= #{continueCourseTime}
         AND TIMESTAMPDIFF(MINUTE, CONCAT(cs.class_date_," ",cs.end_class_time_),#{startTime}) >= 0
-        AND cs.actual_teacher_id_ = #{teacherId} AND CONCAT(cs.class_date_," ",cs.end_class_time_) > NOW()
+        AND cs.actual_teacher_id_ = #{teacherId} AND ta.sign_in_time_ IS NOT NULL AND sa.id_ IS NOT NULL
         ORDER BY cs.class_date_ DESC,cs.end_class_time_ DESC
         LIMIT 1
     </select>

+ 131 - 118
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -16,15 +16,18 @@
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
 
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="Student">
-		SELECT * FROM student WHERE user_id_ = #{id}
-	</select>
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="Student">
+        SELECT *
+        FROM student
+        WHERE user_id_ = #{id}
+    </select>
 
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="Student">
-		SELECT * FROM student
-	</select>
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="Student">
+        SELECT *
+        FROM student
+    </select>
 
 	<select id="lockUser" resultType="int" useCache="false" flushCache="true">
 		SELECT id_ FROM sys_user WHERE id_=#{userId} FOR UPDATE
@@ -50,7 +53,7 @@
 		</if>
 		#{teacherId},NOW(),NOW())
 	</insert>
-	
+
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
 		UPDATE student
 		<set>
@@ -75,12 +78,12 @@
 		</set>
 		WHERE user_id_ = #{userId}
 	</update>
-	
+
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="Student" parameterType="map">
 		SELECT * FROM student <include refid="global.limit"/>
 	</select>
-	
+
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM student
@@ -109,11 +112,11 @@
 			AND FIND_IN_SET("STUDENT", user_type_)
 		</where>
 	</sql>
-	
+
 	<select id="queryByOperatingTag" resultMap="Student">
 		SELECT * FROM student WHERE operating_tag_ = #{operatingTag}
 	</select>
-	
+
 	<update id="batchUpdate" parameterType="java.util.List">
     	<foreach collection="studentList" item="item" index="index" open="" close="" separator=";">
 			UPDATE student
@@ -141,113 +144,123 @@
         </foreach>
 	</update>
 
-	<resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
-		<result column="organ_name_" property="organName"/>
-		<result column="organ_id_" property="organId"/>
-		<result column="student_name_" property="studentName"/>
-		<result column="student_id_" property="studentId"/>
-		<result column="teacher_id_" property="teacherId"/>
-		<result column="teacher_name_" property="teacherName"/>
-		<result column="operating_tag_" property="operatingTag"/>
-		<result column="vip_times_" property="vipTimes"/>
-		<result column="free_practice_times_" property="freePracticeTimes"/>
-		<result column="buy_practice_times_" property="buyPracticeTimes"/>
-	</resultMap>
+    <resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
+        <result column="organ_name_" property="organName"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="student_name_" property="studentName"/>
+        <result column="student_id_" property="studentId"/>
+        <result column="teacher_id_" property="teacherId"/>
+        <result column="teacher_name_" property="teacherName"/>
+        <result column="operating_tag_" property="operatingTag"/>
+        <result column="vip_times_" property="vipTimes"/>
+        <result column="free_practice_times_" property="freePracticeTimes"/>
+        <result column="buy_practice_times_" property="buyPracticeTimes"/>
+        <result column="student_num_" property="studentNum"/>
+    </resultMap>
 
-	<select id="getOperatingStudents" resultMap="student4operating">
-		SELECT su.organ_id_,
-		o.name_ organ_name_,
-		su.username_   student_name_,
-		s.user_id_     student_id_,
-		tsu.id_        teacher_id_,
-		tsu.real_name_ teacher_name_,
-		s.operating_tag_,
-		a.vip_times_,
-		a.buy_practice_times_,
-		p.free_practice_times_
-		FROM student s
-		LEFT JOIN sys_user su ON s.user_id_ = su.id_
-		LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
-		LEFT JOIN organization o ON o.id_ = su.organ_id_
-		LEFT JOIN (
-		SELECT s.user_id_,
-		SUM(case when (cs.group_type_ = 'VIP') then 1 ELSE 0 END) vip_times_,
-		SUM(case when (pg.buy_months_ > 0) then 1 ELSE 0 END)     buy_practice_times_
-		FROM student s
-		LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_
-		LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
-		LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
-		WHERE cs.status_ IN ('NOT_START','UNDERWAY')
-		GROUP BY s.user_id_
-		) a on a.user_id_ = s.user_id_
-		LEFT JOIN (
-		SELECT student_id_, count(id_) free_practice_times_
-		FROM practice_group
-		WHERE buy_months_ IS NULL
-		GROUP BY student_id_
-		) p ON p.student_id_ = s.user_id_
-		<include refid="student4OperatingQueryCondition"/>
-		ORDER BY s.user_id_
-		<include refid="global.limit"/>
-	</select>
+    <select id="getOperatingStudents" resultMap="student4operating">
+        SELECT su.organ_id_,
+        o.name_ organ_name_,
+        su.username_ student_name_,
+        s.user_id_ student_id_,
+        tsu.id_ teacher_id_,
+        tsu.real_name_ teacher_name_,
+        s.operating_tag_,
+        a.vip_times_,
+        a.buy_practice_times_,
+        p.free_practice_times_
+        FROM student s
+        LEFT JOIN sys_user su ON s.user_id_ = su.id_
+        LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
+        LEFT JOIN organization o ON o.id_ = su.organ_id_
+        LEFT JOIN (
+        SELECT s.user_id_,
+        SUM(case when (cs.group_type_ = 'VIP' AND cs.teach_mode_='ONLINE') then 1 ELSE 0 END) vip_times_,
+        SUM(case when (pg.buy_months_ > 0) then 1 ELSE 0 END) buy_practice_times_
+        FROM student s
+        LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_
+        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
+        WHERE cs.status_ IN ('NOT_START','UNDERWAY') AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
+        GROUP BY s.user_id_
+        ) a on a.user_id_ = s.user_id_
+        LEFT JOIN (
+        SELECT student_id_, count(id_) free_practice_times_
+        FROM practice_group
+        WHERE buy_months_ IS NULL
+        GROUP BY student_id_
+        ) p ON p.student_id_ = s.user_id_
+        <include refid="student4OperatingQueryCondition"/>
+        ORDER BY s.user_id_
+        <include refid="global.limit"/>
+    </select>
 
-	<select id="countOperatingStudents" resultType="int">
-		SELECT COUNT(s.user_id_) FROM student s
-		LEFT JOIN sys_user su ON s.user_id_ = su.id_
-		LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
-		LEFT JOIN (
-		SELECT s.user_id_,
-		SUM(case when (cs.group_type_ = 'VIP') then 1 ELSE 0 END) vip_times_,
-		SUM(case when (pg.buy_months_ > 0) then 1 ELSE 0 END)     buy_practice_times_
-		FROM student s
-		LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_
-		LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
-		LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
-		WHERE cs.status_ IN ('NOT_START','UNDERWAY')
-		GROUP BY s.user_id_
-		) a on a.user_id_ = s.user_id_
-		LEFT JOIN (
-		SELECT student_id_, count(id_) free_practice_times_
-		FROM practice_group
-		WHERE buy_months_ IS NULL
-		GROUP BY student_id_
-		) p ON p.student_id_ = s.user_id_
+    <select id="countOperatingStudents" resultType="int">
+        SELECT COUNT(s.user_id_) FROM student s
+        LEFT JOIN sys_user su ON s.user_id_ = su.id_
+        LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
+        LEFT JOIN (
+        SELECT s.user_id_,
+        SUM(case when (cs.group_type_ = 'VIP' AND cs.teach_mode_='ONLINE') then 1 ELSE 0 END) vip_times_,
+        SUM(case when (pg.buy_months_ > 0) then 1 ELSE 0 END) buy_practice_times_
+        FROM student s
+        LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_
+        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
+        WHERE cs.status_ IN ('NOT_START','UNDERWAY') AND (cs.is_lock_ IS NULL OR cs.is_lock_=0)
+        GROUP BY s.user_id_
+        ) a on a.user_id_ = s.user_id_
+        LEFT JOIN (
+        SELECT student_id_, count(id_) free_practice_times_
+        FROM practice_group
+        WHERE buy_months_ IS NULL
+        GROUP BY student_id_
+        ) p ON p.student_id_ = s.user_id_
 
-		<include refid="student4OperatingQueryCondition"/>
-	</select>
+        <include refid="student4OperatingQueryCondition"/>
+    </select>
 
-	<sql id="student4OperatingQueryCondition">
-		<where>
-			<if test="search != null and search != ''">
-				AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_ LIKE CONCAT('%',#{search},'%'))
-			</if>
-			<if test="organId != null and organId != ''">
-				AND FIND_IN_SET(su.organ_id_,#{organId})
-			</if>
-			<if test="teacherId!=null">
-				AND s.teacher_id_ = #{teacherId}
-			</if>
-			<if test="operatingTag !=null">
-				AND s.operating_tag_ = #{operatingTag}
-			</if>
-			<if test='hasVip != null and hasVip=="1"'>
-				AND a.vip_times_ >=1
-			</if>
-			<if test='hasVip != null and hasVip=="0"'>
-				AND (a.vip_times_ =0 OR a.vip_times_ IS NULL)
-			</if>
-			<if test='HasFreePractice != null and HasFreePractice=="1"'>
-				AND p.free_practice_times_ >=1
-			</if>
-			<if test='HasFreePractice != null and HasFreePractice=="0"'>
-				AND (p.free_practice_times_ =0 OR p.free_practice_times_ IS NULL)
-			</if>
-			<if test='HasBuyPractice != null and HasBuyPractice=="1"'>
-				AND a.buy_practice_times_ >=1
-			</if>
-			<if test='HasBuyPractice != null and HasBuyPractice=="0"'>
-				AND (a.buy_practice_times_ =0 OR a.buy_practice_times_ IS NULL)
-			</if>
-		</where>
-	</sql>
+    <sql id="student4OperatingQueryCondition">
+        <where>
+            su.user_type_ LIKE '%STUDENT%' AND su.del_flag_ = 0
+            <if test="search != null and search != ''">
+                AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_
+                LIKE CONCAT('%',#{search},'%'))
+            </if>
+            <if test="organId != null and organId != ''">
+                AND FIND_IN_SET(su.organ_id_,#{organId})
+            </if>
+            <if test="teacherId!=null">
+                AND s.teacher_id_ = #{teacherId}
+            </if>
+            <if test="operatingTag !=null">
+                AND s.operating_tag_ = #{operatingTag}
+            </if>
+            <if test='hasVip != null and hasVip=="1"'>
+                AND a.vip_times_ >=1
+            </if>
+            <if test='hasVip != null and hasVip=="0"'>
+                AND (a.vip_times_ =0 OR a.vip_times_ IS NULL)
+            </if>
+            <if test='hasFreePractice != null and hasFreePractice=="1"'>
+                AND p.free_practice_times_ >=1
+            </if>
+            <if test='hasFreePractice != null and hasFreePractice=="0"'>
+                AND (p.free_practice_times_ =0 OR p.free_practice_times_ IS NULL)
+            </if>
+            <if test='hasBuyPractice != null and hasBuyPractice=="1"'>
+                AND a.buy_practice_times_ >=1
+            </if>
+            <if test='hasBuyPractice != null and hasBuyPractice=="0"'>
+                AND (a.buy_practice_times_ =0 OR a.buy_practice_times_ IS NULL)
+            </if>
+        </where>
+    </sql>
+
+    <select id="getTeacherOperatingStudentsNum" resultMap="student4operating">
+        select teacher_id_, count(*) student_num_
+        FROM student
+        WHERE FIND_IN_SET(teacher_id_, #{teacherIds})
+        GROUP BY teacher_id_
+    </select>
 </mapper>

+ 21 - 4
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -112,7 +112,7 @@ public class RoomServiceImpl implements RoomService {
         Teacher teacher = teacherDao.get(Integer.parseInt(userId));
         CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
 
-        String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
+        /*String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
         if(StringUtils.isEmpty(continueCourseTime)){
             continueCourseTime = "3";
         }
@@ -127,8 +127,8 @@ public class RoomServiceImpl implements RoomService {
             }else {
                 break;
             }
-        }
-        /*try {
+        }*/
+        try {
             if(teacher != null && teacher.getId().equals(courseSchedule.getActualTeacherId())){
                 teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId),courseSchedule.getActualTeacherId(), SignStatusEnum.SIGN_IN,true);
             }else {
@@ -136,7 +136,7 @@ public class RoomServiceImpl implements RoomService {
             }
         }catch (Exception e){
             e.printStackTrace();
-        }*/
+        }
         if(courseSchedule.getGroupType() == GroupType.COMM){
             roomId = "I" + roomId;
         }else {
@@ -245,6 +245,23 @@ public class RoomServiceImpl implements RoomService {
         log.info("roomSignIn: roomId={}, userId={}", roomId, userId);
         Teacher teacher = teacherDao.get(Integer.parseInt(userId));
         CourseSchedule courseSchedule = courseScheduleDao.get(roomId);
+
+        /*String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
+        if(StringUtils.isEmpty(continueCourseTime)){
+            continueCourseTime = "3";
+        }
+        CourseSchedule schedule = courseSchedule;
+        //如果当前课程是连堂课,那么获取第一节课的课程编号
+        while (true){
+            String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
+            String startClassTime = DateUtil.format(schedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+            schedule = courseScheduleDao.getLastCourse(schedule.getClassGroupId(),classDate + " " + startClassTime,schedule.getActualTeacherId(),continueCourseTime);
+            if(schedule != null){
+                roomId = schedule.getId();
+            }else {
+                break;
+            }
+        }*/
         try {
             if(teacher != null && teacher.getId().equals(courseSchedule.getActualTeacherId())){
                 teacherAttendanceService.addTeacherAttendanceRecord(roomId.intValue(),courseSchedule.getActualTeacherId(), SignStatusEnum.SIGN_IN,true);

+ 17 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherSalaryComplaintsController.java

@@ -1,9 +1,13 @@
 package com.ym.mec.teacher.controller;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.TeacherSalaryComplaints;
 import com.ym.mec.biz.dal.page.TeacherSalaryModifyQueryInfo;
 import com.ym.mec.biz.service.TeacherSalaryComplaintsService;
 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.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,6 +22,19 @@ public class TeacherSalaryComplaintsController extends BaseController {
 
     @Autowired
     private TeacherSalaryComplaintsService teacherSalaryComplaintsService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "申述列表")
+    @RequestMapping("/queryPage")
+    public Object queryPage(TeacherSalaryModifyQueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            throw new BizException("用户信息获取失败");
+        }
+        queryInfo.setTeacherId(sysUser.getId());
+        return succeed(teacherSalaryComplaintsService.queryPage(queryInfo));
+    }
 
     @ApiOperation(value = "课酬申述")
     @RequestMapping("/add")

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

@@ -1263,26 +1263,26 @@ public class ExportController extends BaseController {
                 row.setOperatingTagStr("否");
             }
             if(row.getVipTimes() != null && row.getVipTimes() >0){
-                row.setVipTimesStr("");
+                row.setVipTimesStr("");
             }else {
-                row.setVipTimesStr("");
+                row.setVipTimesStr("");
             }
             if(row.getFreePracticeTimes() != null && row.getFreePracticeTimes() >0){
-                row.setFreePracticeTimesStr("");
+                row.setFreePracticeTimesStr("");
             }else {
-                row.setFreePracticeTimesStr("");
+                row.setFreePracticeTimesStr("");
             }
             if(row.getBuyPracticeTimes() != null && row.getBuyPracticeTimes() >0){
-                row.setBuyPracticeTimesStr("");
+                row.setBuyPracticeTimesStr("");
             }else {
-                row.setBuyPracticeTimesStr("");
+                row.setBuyPracticeTimesStr("");
             }
         }
         OutputStream ouputStream = null;
         try {
 
             HSSFWorkbook workbook = POIUtil.exportExcel(
-                    new String[]{"分部", "学生", "学生编号", "指导老师","指导老师id", "运营指标", "VIP课", "免费网管课", "付费网管课"},
+                    new String[]{"分部", "学生", "学生编号", "指导老师","指导老师id", "参与运营指标", "有线上VIP课", "参与免费网管课", "付费网管课"},
                     new String[]{"organName", "studentName", "studentId", "teacherName","teacherId", "operatingTagStr", "vipTimesStr", "freePracticeTimesStr", "buyPracticeTimesStr"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");

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

@@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 @RequestMapping("teacherSalaryModifyLog")
-@Api(tags = "班级服务")
+@Api(tags = "教师课酬调整")
 @RestController
 public class TeacherSalaryModifyLogController extends BaseController {
 
     @Autowired
     private TeacherSalaryModifyLogService teacherSalaryModifyLogService;
 
-    @ApiOperation(value = "终极班级信息获取")
+    @ApiOperation(value = "调整课酬")
     @RequestMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('teacherSalaryModifyLog/add')")
     public Object add(TeacherSalaryModifyLog modifyLog){