Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
63a5f72e97

+ 9 - 12
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -1,23 +1,18 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 
 
-import org.apache.ibatis.annotations.Param;
-
-import com.ym.mec.biz.dal.dto.BasicUserDto;
-import com.ym.mec.biz.dal.dto.Practice4ExercisesSituationDto;
-import com.ym.mec.biz.dal.dto.StudentAttendanceStatisticsResponse;
-import com.ym.mec.biz.dal.dto.StudentCourseTimesDto;
-import com.ym.mec.biz.dal.dto.VipGroupGiveCourseSortDto;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.common.dal.BaseDAO;
-
 public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseScheduleStudentPayment> {
 public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseScheduleStudentPayment> {
 
 
     /**
     /**
@@ -259,4 +254,6 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @return
      * @return
      */
      */
     List<StudentCourseTimesDto> queryStudentCourseTimesOfOnline(Date startDate);
     List<StudentCourseTimesDto> queryStudentCourseTimesOfOnline(Date startDate);
+
+    List<StudentTeacherCourseDto> findAllStudentCourseInfo();
 }
 }

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherSalaryComplaintsDao.java

@@ -35,5 +35,7 @@ public interface TeacherSalaryComplaintsDao extends BaseDAO<Long, TeacherSalaryC
      * @return java.util.List<com.ym.mec.biz.dal.entity.TeacherSalaryComplaints>
      * @return java.util.List<com.ym.mec.biz.dal.entity.TeacherSalaryComplaints>
      */
      */
     List<TeacherSalaryComplaints> findTeacherSalaryComplaintsWithMonth(@Param("teacherId") Integer teacherId,
     List<TeacherSalaryComplaints> findTeacherSalaryComplaintsWithMonth(@Param("teacherId") Integer teacherId,
-                                                                       @Param("month") String month);
+                                                                       @Param("month") String month,
+                                                                        @Param("status") TeacherSalaryComplaintsStatusEnum status);
+
 }
 }

+ 73 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentTeacherCourseDto.java

@@ -0,0 +1,73 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.enums.GroupType;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/4/16
+ */
+public class StudentTeacherCourseDto {
+
+    private Integer studentId;
+
+    private Integer teacherId;
+
+    private GroupType groupType;
+
+    private String groupId;
+
+    private CourseSchedule.CourseScheduleType courseScheduleType;
+
+    private Date classesStartTime;
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    public CourseSchedule.CourseScheduleType getCourseScheduleType() {
+        return courseScheduleType;
+    }
+
+    public void setCourseScheduleType(CourseSchedule.CourseScheduleType courseScheduleType) {
+        this.courseScheduleType = courseScheduleType;
+    }
+
+    public Date getClassesStartTime() {
+        return classesStartTime;
+    }
+
+    public void setClassesStartTime(Date classesStartTime) {
+        this.classesStartTime = classesStartTime;
+    }
+}

+ 10 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/StudentService.java

@@ -1,12 +1,12 @@
 package com.ym.mec.biz.service;
 package com.ym.mec.biz.service;
 
 
-import java.text.ParseException;
-
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
+import java.text.ParseException;
+
 public interface StudentService extends BaseService<Integer, Student> {
 public interface StudentService extends BaseService<Integer, Student> {
 
 
     PageInfo findStudentVipGroupList(StudentQueryInfo queryInfo);
     PageInfo findStudentVipGroupList(StudentQueryInfo queryInfo);
@@ -19,4 +19,12 @@ public interface StudentService extends BaseService<Integer, Student> {
      * @throws ParseException 
      * @throws ParseException 
      */
      */
     boolean updateOperatingTag() throws ParseException;
     boolean updateOperatingTag() throws ParseException;
+
+    /**
+     * @describe 初始化教师编号
+     * @author Joburgess
+     * @date 2020/4/16
+     * @return void
+     */
+    void initTeacherId();
 }
 }

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

@@ -859,7 +859,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             dataList = courseScheduleTeacherSalaryDao.findIsSettlementCourseSalarys(params);
             dataList = courseScheduleTeacherSalaryDao.findIsSettlementCourseSalarys(params);
             for (TeacherCourseSalaryDetail4WebDto teacherCourseSalaryDetail4WebDto : dataList) {
             for (TeacherCourseSalaryDetail4WebDto teacherCourseSalaryDetail4WebDto : dataList) {
                 if(Objects.nonNull(teacherCourseSalaryDetail4WebDto.getReduceSalary())){
                 if(Objects.nonNull(teacherCourseSalaryDetail4WebDto.getReduceSalary())){
-                    teacherCourseSalaryDetail4WebDto.setFinalSalary(teacherCourseSalaryDetail4WebDto.getActualSalary().multiply(teacherCourseSalaryDetail4WebDto.getReduceSalary()));
+                    teacherCourseSalaryDetail4WebDto.setFinalSalary(teacherCourseSalaryDetail4WebDto.getActualSalary().subtract(teacherCourseSalaryDetail4WebDto.getReduceSalary()));
                 }else{
                 }else{
                     teacherCourseSalaryDetail4WebDto.setFinalSalary(teacherCourseSalaryDetail4WebDto.getActualSalary());
                     teacherCourseSalaryDetail4WebDto.setFinalSalary(teacherCourseSalaryDetail4WebDto.getActualSalary());
                 }
                 }
@@ -895,7 +895,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         }else{
         }else{
             result.put("confirmStatus",0);
             result.put("confirmStatus",0);
         }
         }
-        List<TeacherSalaryComplaints> teacherSalaryComplaintsWithMonth = teacherSalaryComplaintsDao.findTeacherSalaryComplaintsWithMonth(queryInfo4Web.getTeacherId(), queryInfo4Web.getMonth());
+        List<TeacherSalaryComplaints> teacherSalaryComplaintsWithMonth = teacherSalaryComplaintsDao.findTeacherSalaryComplaintsWithMonth(queryInfo4Web.getTeacherId(), queryInfo4Web.getMonth(), TeacherSalaryComplaintsStatusEnum.PENDING);
         if(CollectionUtils.isEmpty(teacherSalaryComplaintsWithMonth)){
         if(CollectionUtils.isEmpty(teacherSalaryComplaintsWithMonth)){
             result.put("haveComplaints",0);
             result.put("haveComplaints",0);
         }else{
         }else{

+ 62 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -1,21 +1,10 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
 import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
 import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
 import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dto.StudentCourseTimesDto;
 import com.ym.mec.biz.dal.dto.StudentCourseTimesDto;
+import com.ym.mec.biz.dal.dto.StudentTeacherCourseDto;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
 import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.biz.service.StudentService;
@@ -23,6 +12,15 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 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 org.springframework.util.CollectionUtils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
 
 
 @Service
 @Service
 public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implements StudentService {
 public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implements StudentService {
@@ -98,4 +96,55 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 		
 		
 		return true;
 		return true;
 	}
 	}
+
+	@Override
+	public void initTeacherId() {
+		List<StudentTeacherCourseDto> allStudentCourseInfo = courseScheduleStudentPaymentDao.findAllStudentCourseInfo();
+		Map<Integer, List<StudentTeacherCourseDto>> studentCoursesMap = allStudentCourseInfo.stream().collect(Collectors.groupingBy(StudentTeacherCourseDto::getStudentId));
+		List<Student> students=new ArrayList<>();
+		for (Map.Entry<Integer, List<StudentTeacherCourseDto>> studentCoursesEntry : studentCoursesMap.entrySet()) {
+			Map<CourseSchedule.CourseScheduleType, List<StudentTeacherCourseDto>> courseTypeCourseMap = studentCoursesEntry.getValue().stream().collect(Collectors.groupingBy(StudentTeacherCourseDto::getCourseScheduleType));
+			List<StudentTeacherCourseDto> practiceCourses = courseTypeCourseMap.get(CourseSchedule.CourseScheduleType.PRACTICE);
+			if (!CollectionUtils.isEmpty(practiceCourses)) {
+				practiceCourses.sort(Comparator.comparing(StudentTeacherCourseDto::getClassesStartTime).reversed());
+				Student student=new Student(studentCoursesEntry.getKey());
+				student.setTeacherId(practiceCourses.get(0).getTeacherId());
+				students.add(student);
+				continue;
+			}
+
+			List<StudentTeacherCourseDto> vipCourses = courseTypeCourseMap.get(CourseSchedule.CourseScheduleType.VIP);
+			if (!CollectionUtils.isEmpty(vipCourses)) {
+				Student student=new Student(studentCoursesEntry.getKey());
+				vipCourses.sort(Comparator.comparing(StudentTeacherCourseDto::getClassesStartTime).reversed());
+				student.setTeacherId(vipCourses.get(0).getTeacherId());
+				students.add(student);
+				continue;
+			}
+
+			List<StudentTeacherCourseDto> singleCourses = courseTypeCourseMap.get(CourseSchedule.CourseScheduleType.SINGLE);
+			if (!CollectionUtils.isEmpty(singleCourses)) {
+				Student student=new Student(studentCoursesEntry.getKey());
+				singleCourses.sort(Comparator.comparing(StudentTeacherCourseDto::getClassesStartTime).reversed());
+				student.setTeacherId(singleCourses.get(0).getTeacherId());
+				students.add(student);
+				continue;
+			}
+
+			List<StudentTeacherCourseDto> mixCourses = courseTypeCourseMap.get(CourseSchedule.CourseScheduleType.MIX);
+			if (!CollectionUtils.isEmpty(mixCourses)) {
+				Student student=new Student(studentCoursesEntry.getKey());
+				mixCourses.sort(Comparator.comparing(StudentTeacherCourseDto::getClassesStartTime).reversed());
+				student.setTeacherId(mixCourses.get(0).getTeacherId());
+				students.add(student);
+				continue;
+			}
+		}
+		if(!CollectionUtils.isEmpty(students)){
+			studentDao.batchUpdate(students);
+		}
+		students=null;
+		studentCoursesMap=null;
+		allStudentCourseInfo=null;
+	}
 }
 }

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

@@ -391,4 +391,29 @@
 		WHERE cs.`teach_mode_` = 'ONLINE' AND cs.`class_date_` &gt;= #{startDate}
 		WHERE cs.`teach_mode_` = 'ONLINE' AND cs.`class_date_` &gt;= #{startDate}
 		GROUP BY cssp.`user_id_`
 		GROUP BY cssp.`user_id_`
 	</select>
 	</select>
+
+	<resultMap id="StudentTeacherCourseDto" type="com.ym.mec.biz.dal.dto.StudentTeacherCourseDto">
+		<result property="studentId" column="student_id_"/>
+		<result property="teacherId" column="teacher_id_"/>
+		<result property="groupType" column="group_type_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result property="groupId" column="group_id_"/>
+		<result property="courseScheduleType" column="course_schedule_type_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result property="classesStartTime" column="classes_start_time_"/>
+	</resultMap>
+
+	<select id="findAllStudentCourseInfo" resultMap="StudentTeacherCourseDto">
+		SELECT
+			cssp.user_id_ student_id_,
+			cssp.group_type_ group_type_,
+			cssp.music_group_id_ group_id_,
+			cs.type_ course_schedule_type_,
+			CONCAT(cs.class_date_, ' ', cs.start_class_time_) classes_start_time_,
+			cgtm.user_id_ teacher_id_
+		FROM
+			student s
+			LEFT JOIN course_schedule_student_payment cssp ON s.user_id_=cssp.user_id_
+			LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+			LEFT JOIN class_group_teacher_mapper cgtm ON cssp.class_group_id_=cgtm.class_group_id_
+		WHERE cs.type_ IN ('PRACTICE', 'VIP', 'SINGLE', 'MIX') AND cgtm.teacher_role_='BISHOP';
+	</select>
 </mapper>
 </mapper>

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

@@ -746,7 +746,7 @@
 		<result property="signOutTime" column="sign_out_time_" />
 		<result property="signOutTime" column="sign_out_time_" />
 		<result property="expectSalary" column="expect_salary_" />
 		<result property="expectSalary" column="expect_salary_" />
 		<result property="actualSalary" column="actual_salary_" />
 		<result property="actualSalary" column="actual_salary_" />
-		<result property="reduceSalary" column="reduce_salary_" />
+		<result property="reduceSalary" column="reduce_salary" />
 		<result property="confirmStatus" column="confirm_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result property="confirmStatus" column="confirm_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result property="memo" column="memo_" />
 		<result property="memo" column="memo_" />
 	</resultMap>
 	</resultMap>

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

@@ -5,15 +5,16 @@
 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 -->
 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.StudentDao">
 <mapper namespace="com.ym.mec.biz.dal.dao.StudentDao">
-
-    <resultMap type="com.ym.mec.biz.dal.entity.Student" id="Student">
-        <result column="user_id_" property="userId"/>
-        <result column="subject_id_list_" property="subjectIdList"/>
-        <result column="service_tag_" property="serviceTag"/>
-        <result column="operating_tag_" property="operatingTag"/>
-        <result column="create_time_" property="createTime"/>
-        <result column="update_time_" property="updateTime"/>
-    </resultMap>
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.Student" id="Student">
+		<result column="user_id_" property="userId" />
+		<result column="subject_id_list_" property="subjectIdList" />
+		<result column="service_tag_" property="serviceTag" />
+		<result column="operating_tag_" property="operatingTag" />
+		<result column="teacher_id_" property="teacherId" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="Student">
     <select id="get" resultMap="Student">
@@ -28,122 +29,120 @@
         FROM student
         FROM student
     </select>
     </select>
 
 
-    <select id="lockUser" resultType="int" useCache="false" flushCache="true">
-        SELECT id_
-        FROM sys_user
-        WHERE id_ = #{userId} FOR
-        UPDATE
-    </select>
+	<select id="lockUser" resultType="int" useCache="false" flushCache="true">
+		SELECT id_ FROM sys_user WHERE id_=#{userId} FOR UPDATE
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Student" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO student (user_id_,subject_id_list_,
+		<if test="serviceTag != null">
+			service_tag_,
+		</if>
+		<if test="operatingTag != null">
+			operating_tag_,
+		</if>
+		teacher_id_,create_time_,update_time_)
+		VALUES
+		(#{userId},#{subjectIdList},
+		<if test="serviceTag != null">
+			#{serviceTag},
+		</if>
+		<if test="operatingTag != null">
+			#{operatingTag},
+		</if>
+		#{teacherId},NOW(),NOW())
+	</insert>
 
 
-    <!-- 向数据库增加一条记录 -->
-    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Student" useGeneratedKeys="true" keyColumn="id"
-            keyProperty="id">
-        INSERT INTO student (user_id_,subject_id_list_,
-        <if test="serviceTag != null">
-            service_tag_,
-        </if>
-        <if test="operatingTag != null">
-            operating_tag_,
-        </if>
-        create_time_,update_time_)
-        VALUES
-        (#{userId},#{subjectIdList},
-        <if test="serviceTag != null">
-            #{serviceTag},
-        </if>
-        <if test="operatingTag != null">
-            #{operatingTag},
-        </if>
-        NOW(),NOW())
-    </insert>
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
+		UPDATE student
+		<set>
+			<if test="subjectIdList != null">
+				subject_id_list_ = #{subjectIdList},
+			</if>
+			<if test="serviceTag != null">
+				service_tag_ = #{serviceTag},
+			</if>
+			<if test="operatingTag != null">
+				operating_tag_ = #{operatingTag},
+			</if>
+			<if test="teacherId != null">
+				teacher_id_=#{teacherId},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="updateTime == null">
+				update_time_ = NOW()
+			</if>
+		</set>
+		WHERE user_id_ = #{userId}
+	</update>
 
 
-    <update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
-        UPDATE student
-        <set>
-            <if test="subjectIdList != null">
-                subject_id_list_ = #{subjectIdList},
-            </if>
-            <if test="serviceTag != null">
-                service_tag_ = #{serviceTag},
-            </if>
-            <if test="operatingTag != null">
-                operating_tag_ = #{operatingTag},
-            </if>
-            <if test="updateTime != null">
-                update_time_ = #{updateTime},
-            </if>
-            <if test="updateTime == null">
-                update_time_ = NOW()
-            </if>
-        </set>
-        WHERE user_id_ = #{userId}
-    </update>
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="Student" parameterType="map">
+		SELECT * FROM student <include refid="global.limit"/>
+	</select>
 
 
-    <!-- 分页查询 -->
-    <select id="queryPage" resultMap="Student" parameterType="map">
-        SELECT * FROM student
-        <include refid="global.limit"/>
-    </select>
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM student
+	</select>
+	<select id="findStudents" resultMap="com.ym.mec.biz.dal.dao.TeacherDao.SysUser">
+		SELECT id_, username_, phone_,avatar_ FROM sys_user
+		<include refid="studentQueryCondition"/>
+		ORDER BY id_
+		<include refid="global.limit"/>
+	</select>
+	<select id="countStudents" resultType="int">
+		SELECT COUNT(id_) FROM sys_user
+		<include refid="studentQueryCondition"/>
+	</select>
+	<sql id="studentQueryCondition">
+		<where>
+			<if test="organIdList!=null">
+				organ_id_ IN
+				<foreach collection="organIdList" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+			<if test="search!=null">
+				AND (username_ LIKE CONCAT('%', #{search}, '%') OR phone_ LIKE CONCAT('%', #{search}, '%'))
+			</if>
+			AND FIND_IN_SET("STUDENT", user_type_)
+		</where>
+	</sql>
 
 
-    <!-- 查询当前表的总记录数 -->
-    <select id="queryCount" resultType="int">
-        SELECT COUNT(*)
-        FROM student
-    </select>
-    <select id="findStudents" resultMap="com.ym.mec.biz.dal.dao.TeacherDao.SysUser">
-        SELECT id_, username_, phone_,avatar_ FROM sys_user
-        <include refid="studentQueryCondition"/>
-        ORDER BY id_
-        <include refid="global.limit"/>
-    </select>
-    <select id="countStudents" resultType="int">
-        SELECT COUNT(id_) FROM sys_user
-        <include refid="studentQueryCondition"/>
-    </select>
-    <sql id="studentQueryCondition">
-        <where>
-            <if test="organIdList!=null">
-                organ_id_ IN
-                <foreach collection="organIdList" item="organId" open="(" close=")" separator=",">
-                    #{organId}
-                </foreach>
-            </if>
-            <if test="search!=null">
-                AND (username_ LIKE CONCAT('%', #{search}, '%') OR phone_ LIKE CONCAT('%', #{search}, '%'))
-            </if>
-            AND FIND_IN_SET("STUDENT", user_type_)
-        </where>
-    </sql>
-
-    <select id="queryByOperatingTag" resultMap="Student">
-        SELECT *
-        FROM student
-        WHERE operating_tag_ = #{operatingTag}
-    </select>
+	<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
-            <set>
-                <if test="item.subjectIdList != null">
-                    subject_id_list_ = #{item.subjectIdList},
-                </if>
-                <if test="item.serviceTag != null">
-                    service_tag_ = #{item.serviceTag},
-                </if>
-                <if test="item.operatingTag != null">
-                    operating_tag_ = #{item.operatingTag},
-                </if>
-                <if test="item.updateTime != null">
-                    update_time_ = #{item.updateTime},
-                </if>
-                <if test="item.updateTime == null">
-                    update_time_ = NOW()
-                </if>
-            </set>
-            WHERE user_id_ = #{item.userId}
+	<update id="batchUpdate" parameterType="java.util.List">
+    	<foreach collection="studentList" item="item" index="index" open="" close="" separator=";">
+			UPDATE student
+			<set>
+				<if test="item.subjectIdList != null">
+					subject_id_list_ = #{item.subjectIdList},
+				</if>
+				<if test="item.serviceTag != null">
+					service_tag_ = #{item.serviceTag},
+				</if>
+				<if test="item.operatingTag != null">
+					operating_tag_ = #{item.operatingTag},
+				</if>
+				<if test="item.teacherId != null">
+					teacher_id_=#{item.teacherId},
+				</if>
+				<if test="item.updateTime != null">
+					update_time_ = #{item.updateTime},
+				</if>
+				<if test="item.updateTime == null">
+					update_time_ = NOW()
+				</if>
+			</set>
+			WHERE user_id_ = #{item.userId}
         </foreach>
         </foreach>
-    </update>
+	</update>
 
 
     <resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
     <resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
         <result column="organ_name_" property="organName"/>
         <result column="organ_name_" property="organName"/>

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

@@ -124,6 +124,9 @@
 	<select id="findTeacherSalaryComplaintsWithMonth" resultMap="TeacherSalaryComplaints">
 	<select id="findTeacherSalaryComplaintsWithMonth" resultMap="TeacherSalaryComplaints">
 		SELECT * FROM teacher_salary_complaints tsc
 		SELECT * FROM teacher_salary_complaints tsc
 		WHERE tsc.teacher_id_ = #{teacherId} AND tsc.salary_settlement_month_ = #{month}
 		WHERE tsc.teacher_id_ = #{teacherId} AND tsc.salary_settlement_month_ = #{month}
+		<if test="status!=null">
+			AND tsc.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+		</if>
 	</select>
 	</select>
 
 
 </mapper>
 </mapper>

+ 15 - 5
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -6,11 +6,9 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.UpdateStudentFeeDto;
 import com.ym.mec.biz.dal.dto.UpdateStudentFeeDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.*;
 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.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.*;
 import io.swagger.annotations.*;
@@ -25,7 +23,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import java.util.Arrays;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 @Api(tags = "学生管理")
 @Api(tags = "学生管理")
@@ -45,6 +42,8 @@ public class StudentManageController extends BaseController {
     private StudentCourseHomeworkService studentCourseHomeworkService;
     private StudentCourseHomeworkService studentCourseHomeworkService;
     @Autowired
     @Autowired
     private EmployeeDao employeeDao;
     private EmployeeDao employeeDao;
+    @Autowired
+    private StudentService studentService;
 
 
     private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
     private final Logger LOGGER = LoggerFactory.getLogger(this.getClass());
     @ApiOperation(value = "获取学生列表")
     @ApiOperation(value = "获取学生列表")
@@ -286,4 +285,15 @@ public class StudentManageController extends BaseController {
         }
         }
         return succeed(studentManageService.getOperatingStudents(queryInfo));
         return succeed(studentManageService.getOperatingStudents(queryInfo));
     }
     }
+
+    @ApiOperation(value = "初始化教师编号")
+    @GetMapping("/initTeacherId")
+    public HttpResponseResult initTeacherId(){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        studentService.initTeacherId();
+        return succeed();
+    }
 }
 }