Browse Source

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

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java
#	mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleTeacherSalary.java
#	mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
zouxuan 5 years ago
parent
commit
1ecb18889d

+ 18 - 13
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java

@@ -1,24 +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.CourseScheduleTeacherSalary;
+import com.ym.mec.biz.dal.entity.TeacherSalaryModifyLog;
+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 com.ym.mec.biz.dal.entity.TeacherSalaryModifyLog;
-import org.apache.ibatis.annotations.Param;
-
-import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
-import com.ym.mec.biz.dal.dto.ExportTeacherSalaryDto;
-import com.ym.mec.biz.dal.dto.TeacherSalaryDto;
-import com.ym.mec.biz.dal.dto.TeacherVipSalaryDto;
-import com.ym.mec.biz.dal.dto.VipGroupSalaryDto;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.common.dal.BaseDAO;
-
 public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseScheduleTeacherSalary> {
 public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseScheduleTeacherSalary> {
 
 
 	/**
 	/**
@@ -379,6 +373,17 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
 	Integer countTeacherGiveLesson(Integer userId);
 	Integer countTeacherGiveLesson(Integer userId);
 
 
 	/**
 	/**
+	 * @describe 获取课酬记录
+	 * @author Joburgess
+	 * @date 2020/4/15
+	 * @param params:
+	 * @return java.util.List<com.ym.mec.biz.dal.dto.TeacherCourseSalaryDetail4WebDto>
+	 */
+	List<TeacherCourseSalaryDetail4WebDto> findIsSettlementCourseSalarys(Map<String, Object> params);
+
+	int countIsSettlementCourseSalarys(Map<String, Object> params);
+
+	/**
 	 * 调整已结算的课酬
 	 * 调整已结算的课酬
 	 * @param modifyLog
 	 * @param modifyLog
 	 */
 	 */

+ 194 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherCourseSalaryDetail4WebDto.java

@@ -0,0 +1,194 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/4/15
+ */
+public class TeacherCourseSalaryDetail4WebDto {
+
+    private Long id;
+
+    private Integer organId;
+
+    private String organName;
+
+    private GroupType groupType;
+
+    private Long courseScheduleId;
+
+    private Date startClassTime;
+
+    private String courseName;
+
+    private Integer teacherId;
+
+    private String teacherName;
+
+    private java.util.Date signInTime;
+
+    private YesOrNoEnum signInStatus;
+
+    private YesOrNoEnum signOutStatus;
+
+    private Date signOutTime;
+
+    private java.math.BigDecimal expectSalary;
+
+    private java.math.BigDecimal actualSalary;
+
+    private BigDecimal reduceSalary;
+
+    private YesOrNoEnum confirmStatus;
+
+    private String memo;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public Date getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(Date startClassTime) {
+        this.startClassTime = startClassTime;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Date getSignInTime() {
+        return signInTime;
+    }
+
+    public void setSignInTime(Date signInTime) {
+        this.signInTime = signInTime;
+    }
+
+    public YesOrNoEnum getSignInStatus() {
+        return signInStatus;
+    }
+
+    public void setSignInStatus(YesOrNoEnum signInStatus) {
+        this.signInStatus = signInStatus;
+    }
+
+    public YesOrNoEnum getSignOutStatus() {
+        return signOutStatus;
+    }
+
+    public void setSignOutStatus(YesOrNoEnum signOutStatus) {
+        this.signOutStatus = signOutStatus;
+    }
+
+    public Date getSignOutTime() {
+        return signOutTime;
+    }
+
+    public void setSignOutTime(Date signOutTime) {
+        this.signOutTime = signOutTime;
+    }
+
+    public BigDecimal getExpectSalary() {
+        return expectSalary;
+    }
+
+    public void setExpectSalary(BigDecimal expectSalary) {
+        this.expectSalary = expectSalary;
+    }
+
+    public BigDecimal getActualSalary() {
+        return actualSalary;
+    }
+
+    public void setActualSalary(BigDecimal actualSalary) {
+        this.actualSalary = actualSalary;
+    }
+
+    public BigDecimal getReduceSalary() {
+        return reduceSalary;
+    }
+
+    public void setReduceSalary(BigDecimal reduceSalary) {
+        this.reduceSalary = reduceSalary;
+    }
+
+    public YesOrNoEnum getConfirmStatus() {
+        return confirmStatus;
+    }
+
+    public void setConfirmStatus(YesOrNoEnum confirmStatus) {
+        this.confirmStatus = confirmStatus;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+}

+ 23 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleTeacherSalary.java

@@ -2,9 +2,8 @@ package com.ym.mec.biz.dal.entity;
 
 
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.TeachTypeEnum;
 import com.ym.mec.biz.dal.enums.TeachTypeEnum;
-
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
-
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -49,9 +48,6 @@ public class CourseScheduleTeacherSalary {
 	
 	
 	/** 实际薪水 */
 	/** 实际薪水 */
 	private java.math.BigDecimal actualSalary;
 	private java.math.BigDecimal actualSalary;
-
-	/** 扣除金额 */
-	private java.math.BigDecimal reduceSalary;
 	
 	
 	/** 结算时间 */
 	/** 结算时间 */
 	private java.util.Date settlementTime;
 	private java.util.Date settlementTime;
@@ -60,6 +56,12 @@ public class CourseScheduleTeacherSalary {
 	
 	
 	private CourseSchedule courseSchedule = new CourseSchedule();
 	private CourseSchedule courseSchedule = new CourseSchedule();
 
 
+	private BigDecimal reduceSalary;
+
+	private YesOrNoEnum confirmStatus;
+
+	private String memo;
+
 	public CourseScheduleTeacherSalary() {
 	public CourseScheduleTeacherSalary() {
 	}
 	}
 
 
@@ -92,6 +94,22 @@ public class CourseScheduleTeacherSalary {
 		this.reduceSalary = reduceSalary;
 		this.reduceSalary = reduceSalary;
 	}
 	}
 
 
+	public YesOrNoEnum getConfirmStatus() {
+		return confirmStatus;
+	}
+
+	public void setConfirmStatus(YesOrNoEnum confirmStatus) {
+		this.confirmStatus = confirmStatus;
+	}
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
 	public String getUserName() {
 	public String getUserName() {
 		return userName;
 		return userName;
 	}
 	}

+ 101 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseSalaryQueryInfo4Web.java

@@ -0,0 +1,101 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.common.page.QueryInfo;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/4/15
+ */
+public class CourseSalaryQueryInfo4Web extends QueryInfo {
+
+    private Integer teacherId;
+
+    private String month;
+
+    private String organIdList;
+
+    private GroupType groupType;
+
+    private Long courseScheduleId;
+
+    private String groupName;
+
+    private Integer signInStatus;
+
+    private Integer signOutStatus;
+
+    private Integer confirmStatus;
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
+
+    public String getOrganIdList() {
+        return organIdList;
+    }
+
+    public void setOrganIdList(String organIdList) {
+        this.organIdList = organIdList;
+    }
+
+    public GroupType getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(GroupType groupType) {
+        this.groupType = groupType;
+    }
+
+    public Long getCourseScheduleId() {
+        return courseScheduleId;
+    }
+
+    public void setCourseScheduleId(Long courseScheduleId) {
+        this.courseScheduleId = courseScheduleId;
+    }
+
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    public Integer getSignInStatus() {
+        return signInStatus;
+    }
+
+    public void setSignInStatus(Integer signInStatus) {
+        this.signInStatus = signInStatus;
+    }
+
+    public Integer getSignOutStatus() {
+        return signOutStatus;
+    }
+
+    public void setSignOutStatus(Integer signOutStatus) {
+        this.signOutStatus = signOutStatus;
+    }
+
+    public Integer getConfirmStatus() {
+        return confirmStatus;
+    }
+
+    public void setConfirmStatus(Integer confirmStatus) {
+        this.confirmStatus = confirmStatus;
+    }
+}

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleTeacherSalaryService.java

@@ -1,10 +1,12 @@
 package com.ym.mec.biz.service;
 package com.ym.mec.biz.service;
 
 
 import com.ym.mec.biz.dal.dto.ExportTeacherSalaryDto;
 import com.ym.mec.biz.dal.dto.ExportTeacherSalaryDto;
+import com.ym.mec.biz.dal.dto.TeacherCourseSalaryDetail4WebDto;
 import com.ym.mec.biz.dal.dto.TeacherSalaryDto;
 import com.ym.mec.biz.dal.dto.TeacherSalaryDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
 import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
 import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.entity.VipGroup;
+import com.ym.mec.biz.dal.page.CourseSalaryQueryInfo4Web;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.ExportTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.ExportTeacherSalaryQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageInfo;
@@ -12,6 +14,7 @@ import com.ym.mec.common.service.BaseService;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 public interface CourseScheduleTeacherSalaryService extends BaseService<Long, CourseScheduleTeacherSalary> {
 public interface CourseScheduleTeacherSalaryService extends BaseService<Long, CourseScheduleTeacherSalary> {
 
 
@@ -95,4 +98,22 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      * @return
      * @return
      */
      */
     List<Long> querySettlementScheduleId(String courseScheduleIds);
     List<Long> querySettlementScheduleId(String courseScheduleIds);
+
+    /**
+     * @describe 获取课酬记录
+     * @author Joburgess
+     * @date 2020/4/15
+     * @param queryInfo:
+     * @return com.ym.mec.common.page.PageInfo<com.ym.mec.biz.dal.dto.TeacherCourseSalaryDetail4WebDto>
+     */
+    PageInfo<TeacherCourseSalaryDetail4WebDto> findIsSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo);
+
+    /**
+     * @describe 获取老师指定月份课酬信息
+     * @author Joburgess
+     * @date 2020/4/15
+     * @param queryInfo4Web:
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    Map<String, Object> findTeacherSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo4Web);
 }
 }

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

@@ -2,12 +2,10 @@ package com.ym.mec.biz.service.impl;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.ExportTeacherSalaryDto;
-import com.ym.mec.biz.dal.dto.RewardsRulesJsonDto;
-import com.ym.mec.biz.dal.dto.TaskRewardsRulesDto;
-import com.ym.mec.biz.dal.dto.TeacherSalaryDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.page.CourseSalaryQueryInfo4Web;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.ExportTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.ExportTeacherSalaryQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.biz.service.*;
@@ -828,4 +826,35 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     public List<Long> querySettlementScheduleId(String courseScheduleIds) {
     public List<Long> querySettlementScheduleId(String courseScheduleIds) {
         return courseScheduleTeacherSalaryDao.querySettlementScheduleId(courseScheduleIds);
         return courseScheduleTeacherSalaryDao.querySettlementScheduleId(courseScheduleIds);
     }
     }
+
+    @Override
+    public PageInfo<TeacherCourseSalaryDetail4WebDto> findIsSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo) {
+        PageInfo<TeacherCourseSalaryDetail4WebDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<TeacherCourseSalaryDetail4WebDto> dataList = null;
+        int count = courseScheduleTeacherSalaryDao.countIsSettlementCourseSalarys(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = courseScheduleTeacherSalaryDao.findIsSettlementCourseSalarys(params);
+        }
+        if (count == 0) {
+            dataList = new ArrayList<>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
+
+    @Override
+    public Map<String, Object> findTeacherSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo4Web) {
+        if(Objects.isNull(queryInfo4Web.getMonth())){
+            queryInfo4Web.setMonth(DateUtil.dateToString(DateUtil.addMonths(new Date(), -1), "yyyy-MM"));
+        }
+        PageInfo<TeacherCourseSalaryDetail4WebDto> pageInfo = findIsSettlementCourseSalarys(queryInfo4Web);
+        Map<String, Object> result=new HashMap<>();
+        result.put("pageInfo",pageInfo);
+        return result;
+    }
 }
 }

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

@@ -11,7 +11,6 @@ import com.ym.mec.biz.dal.entity.CourseHomework;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleReview;
 import com.ym.mec.biz.dal.entity.CourseScheduleReview;
 import com.ym.mec.biz.dal.entity.StudentCourseHomework;
 import com.ym.mec.biz.dal.entity.StudentCourseHomework;
-import com.ym.mec.biz.dal.enums.ImSendTypeEnum;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;

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

@@ -27,6 +27,8 @@
 		<result column="start_class_time_" property="courseSchedule.startClassTime" />
 		<result column="start_class_time_" property="courseSchedule.startClassTime" />
 		<result column="end_class_time_" property="courseSchedule.endClassTime" />
 		<result column="end_class_time_" property="courseSchedule.endClassTime" />
 		<result column="reduce_salary" property="reduceSalary" />
 		<result column="reduce_salary" property="reduceSalary" />
+		<result column="confirm_status_" property="confirmStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result column="memo_" property="memo" />
 	</resultMap>
 	</resultMap>
 	
 	
 	<resultMap type="com.ym.mec.biz.dal.dto.TeacherVipSalaryDto" id="teacherVipSalaryDto" extends="CourseScheduleTeacherSalary">
 	<resultMap type="com.ym.mec.biz.dal.dto.TeacherVipSalaryDto" id="teacherVipSalaryDto" extends="CourseScheduleTeacherSalary">
@@ -49,15 +51,21 @@
 	<!-- 向数据库增加一条记录 -->
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO course_schedule_teacher_salary (id_,group_type_,music_group_id_,course_schedule_id_,teacher_role_,
 		INSERT INTO course_schedule_teacher_salary (id_,group_type_,music_group_id_,course_schedule_id_,teacher_role_,
-		user_id_,expect_salary_,create_time_,update_time_,subsidy_,actual_salary_,settlement_time_,class_group_id_)
+		user_id_,expect_salary_,create_time_,update_time_,subsidy_,actual_salary_,settlement_time_,class_group_id_,
+		reduce_salary,confirm_status_,memo_)
 		VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{courseScheduleId},
 		VALUES(#{id},#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{musicGroupId},#{courseScheduleId},
-		#{teacherRole},#{userId},#{expectSalary},now(),now(),#{subsidy},#{actualSalary},#{settlementTime},#{classGroupId})
+		#{teacherRole},#{userId},#{expectSalary},now(),now(),#{subsidy},#{actualSalary},#{settlementTime},#{classGroupId},
+		#{reduceSalary},#{confirmStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{memo})
 	</insert>
 	</insert>
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
-		INSERT INTO course_schedule_teacher_salary (id_,group_type_,music_group_id_,course_schedule_id_,teacher_role_,user_id_,expect_salary_,create_time_,update_time_,subsidy_,actual_salary_,settlement_time_,class_group_id_)
+		INSERT INTO course_schedule_teacher_salary (id_,group_type_,music_group_id_,course_schedule_id_,teacher_role_,
+		user_id_,expect_salary_,create_time_,update_time_,subsidy_,actual_salary_,settlement_time_,class_group_id_,
+		reduce_salary,confirm_status_,memo_)
 		VALUES
 		VALUES
 		<foreach collection="list" item="data" separator=",">
 		<foreach collection="list" item="data" separator=",">
-			(#{data.id},#{data.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{data.musicGroupId},#{data.courseScheduleId},#{data.teacherRole},#{data.userId},#{data.expectSalary},now(),now(),#{data.subsidy},#{data.actualSalary},#{data.settlementTime},#{data.classGroupId})
+			(#{data.id},#{data.groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{data.musicGroupId},#{data.courseScheduleId},
+			#{data.teacherRole},#{data.userId},#{data.expectSalary},now(),now(),#{data.subsidy},#{data.actualSalary},#{data.settlementTime},
+			#{data.classGroupId},#{data.reduceSalary},#{data.confirmStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{data.memo})
 		</foreach>
 		</foreach>
     </insert>
     </insert>
 
 
@@ -65,9 +73,6 @@
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary">
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary">
 		UPDATE course_schedule_teacher_salary 
 		UPDATE course_schedule_teacher_salary 
 		<set>
 		<set>
-			<if test="reduceSalary != null">
-				reduce_salary = #{reduceSalary},
-			</if>
 			<if test="userId != null">
 			<if test="userId != null">
 				user_id_ = #{userId},
 				user_id_ = #{userId},
 			</if>
 			</if>
@@ -101,6 +106,15 @@
 			<if test="classGroupId != null">
 			<if test="classGroupId != null">
 				class_group_id_ = #{classGroupId},
 				class_group_id_ = #{classGroupId},
 			</if>
 			</if>
+			<if test="reduceSalary != null">
+				reduce_salary = #{reduceSalary},
+			</if>
+			<if test="confirmStatus != null">
+				confirm_status_ = #{confirmStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="memo != null">
+				memo_ = #{memo},
+			</if>
 		</set> WHERE id_ = #{id} 
 		</set> WHERE id_ = #{id} 
 	</update>
 	</update>
 
 
@@ -429,7 +443,8 @@
 		</foreach>
 		</foreach>
 		AND csts.teacher_role_ = 'BISHOP'
 		AND csts.teacher_role_ = 'BISHOP'
 	</update>
 	</update>
-    <update id="updateSalary">
+
+    <update id="updateSalary" parameterType="com.ym.mec.biz.dal.entity.TeacherSalaryModifyLog">
 		UPDATE course_schedule_teacher_salary SET actual_salary_ = #{modifyLog.currentExpectSalary},reduce_salary = #{modifyLog.currentReduceSalary},update_time_ = NOW()
 		UPDATE course_schedule_teacher_salary SET actual_salary_ = #{modifyLog.currentExpectSalary},reduce_salary = #{modifyLog.currentReduceSalary},update_time_ = NOW()
 		WHERE course_schedule_id_ = #{modifyLog.courseScheduleId} AND user_id_ = #{modifyLog.teacherId}
 		WHERE course_schedule_id_ = #{modifyLog.courseScheduleId} AND user_id_ = #{modifyLog.teacherId}
 	</update>
 	</update>
@@ -698,4 +713,108 @@
 		LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
 		LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
 		WHERE NOW() >= CONCAT(cs.class_date_ ,' ',cs.end_class_time_) AND csts.user_id_ = #{userId}
 		WHERE NOW() >= CONCAT(cs.class_date_ ,' ',cs.end_class_time_) AND csts.user_id_ = #{userId}
 	</select>
 	</select>
+
+	<resultMap id="TeacherCourseSalaryDetail4WebDto" type="com.ym.mec.biz.dal.dto.TeacherCourseSalaryDetail4WebDto">
+		<result property="id" column="id_" />
+		<result property="organId" column="organ_id_" />
+		<result property="organName" column="organ_name_" />
+		<result property="groupType" column="group_type_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result property="courseScheduleId" column="course_schedule_id_" />
+		<result property="startClassTime" column="classes_start_time_" />
+		<result property="courseName" column="course_name_" />
+		<result property="teacherId" column="teacher_id_" />
+		<result property="teacherName" column="teacher_name_" />
+		<result property="signInTime" column="sign_in_time_" />
+		<result property="signInStatus" column="sign_in_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result property="signOutStatus" column="sign_out_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result property="signOutTime" column="sign_out_time_" />
+		<result property="expectSalary" column="expect_salary_" />
+		<result property="actualSalary" column="actual_salary_" />
+		<result property="reduceSalary" column="reduce_salary_" />
+		<result property="confirmStatus" column="confirm_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result property="memo" column="memo_" />
+	</resultMap>
+
+	<sql id="queryCourseSalaryCondition">
+		<where>
+			(cs.del_flag_ IS NULL OR cs.del_flag_=0)
+			AND csts.settlement_time_ IS NOT NULL
+			<if test="teacherId!=null">
+				AND csts.user_id_=#{teacherId}
+			</if>
+			<if test="groupType!=null">
+				AND cs.group_type_=#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="courseScheduleId!=null">
+				AND cs.id_=#{courseScheduleId}
+			</if>
+			<if test="signInStatus!=null">
+				AND ta.sign_in_status_=#{signInStatus}
+			</if>
+			<if test="signOutStatus!=null">
+				AND ta.sign_out_status_=#{signOutStatus}
+			</if>
+			<if test="confirmStatus!=null">
+				AND csts.reduce_salary=#{confirmStatus}
+			</if>
+			<if test="groupName!=null">
+				AND cs.name_ LIKE CONCAT('%', #{groupName}, '%')
+			</if>
+			<if test="month!=null">
+				AND DATE_FORMAT(cs.class_date_, '%Y-%m') = #{month}
+			</if>
+			<if test="organIdList">
+				AND FIND_IN_SET(t.organ_id_,#{organIdList})
+			</if>
+			<if test="search!=null">
+				AND (csts.user_id_=#{search} OR su.real_name_ LIKE CONCAT('%', #{search}, '%'))
+			</if>
+		</where>
+	</sql>
+
+	<select id="findIsSettlementCourseSalarys" resultMap="TeacherCourseSalaryDetail4WebDto">
+		SELECT
+			csts.id_,
+			cs.id_ course_schedule_id_,
+			cs.group_type_,
+			CONCAT(cs.class_date_, ' ', cs.start_class_time_) classes_start_time_,
+			cs.name_,
+			csts.user_id_ teacher_id_,
+			su.real_name_ teacher_name_,
+			t.organ_id_,
+			o.name_ organ_name_,
+			ta.sign_in_time_,
+			ta.sign_in_status_,
+			ta.sign_out_time_,
+			ta.sign_out_status_,
+			csts.expect_salary_,
+			csts.actual_salary_,
+			csts.reduce_salary,
+			csts.confirm_status_,
+			csts.memo_
+		FROM
+			course_schedule_teacher_salary csts
+			LEFT JOIN course_schedule cs ON csts.course_schedule_id_=cs.id_
+			LEFT JOIN teacher_attendance ta ON csts.course_schedule_id_=ta.course_schedule_id_
+			LEFT JOIN teacher t ON csts.user_id_=t.id_
+			LEFT JOIN sys_user su ON csts.user_id_=su.id_
+			LEFT JOIN organization o ON t.organ_id_=o.id_
+		<include refid="queryCourseSalaryCondition"/>
+		ORDER BY classes_start_time_ DESC
+		<include refid="global.limit"/>
+	</select>
+
+	<select id="countIsSettlementCourseSalarys" resultType="int">
+		SELECT
+			COUNT(csts.id_)
+		FROM
+			course_schedule_teacher_salary csts
+		LEFT JOIN course_schedule cs ON csts.course_schedule_id_=cs.id_
+		LEFT JOIN teacher_attendance ta ON csts.course_schedule_id_=ta.course_schedule_id_
+		LEFT JOIN teacher t ON csts.user_id_=t.id_
+		LEFT JOIN sys_user su ON csts.user_id_=su.id_
+		<include refid="queryCourseSalaryCondition"/>
+		ORDER BY csts.id_ DESC
+		<include refid="global.limit"/>
+	</select>
 </mapper>
 </mapper>

+ 42 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseScheduleTeacherSalaryController.java

@@ -0,0 +1,42 @@
+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.page.CourseSalaryQueryInfo4Web;
+import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/4/15
+ */
+@RequestMapping("courseScheduleTeacherSalary")
+@Api(tags = "课酬服务")
+@RestController
+public class CourseScheduleTeacherSalaryController extends BaseController {
+
+    @Autowired
+    private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "获取老师指定月份课酬信息")
+    @GetMapping("findTeacherSettlementCourseSalarys")
+    public HttpResponseResult findTeacherSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        queryInfo.setTeacherId(sysUser.getId());
+        return succeed(courseScheduleTeacherSalaryService.findTeacherSettlementCourseSalarys(queryInfo));
+    }
+
+}

+ 39 - 4
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleTeacherSalaryController.java

@@ -1,21 +1,28 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
-import java.util.Date;
-
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.page.CourseSalaryQueryInfo4Web;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
 import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.biz.service.VipGroupService;
 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 io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 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.Date;
+import java.util.List;
+
 @RequestMapping("courseScheduleTeacherSalary")
 @RequestMapping("courseScheduleTeacherSalary")
 @Api(tags = "教师薪酬服务")
 @Api(tags = "教师薪酬服务")
 @RestController
 @RestController
@@ -26,6 +33,10 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
     
     
     @Autowired
     @Autowired
     private VipGroupService vipGroupService;
     private VipGroupService vipGroupService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeDao employeeDao;
 
 
     @ApiOperation(value = "分页查询教师薪酬列表")
     @ApiOperation(value = "分页查询教师薪酬列表")
     @GetMapping("/queryPage")
     @GetMapping("/queryPage")
@@ -39,4 +50,28 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
     	vipGroupService.updateHistoryTeacherSalaryOfOnline(startDate, endDate);
     	vipGroupService.updateHistoryTeacherSalaryOfOnline(startDate, endDate);
         return succeed();
         return succeed();
     }
     }
+
+    @ApiOperation(value = "获取已结算的课酬记录")
+    @GetMapping("/findIsSettlementCourseSalarys")
+    @PreAuthorize("@pcs.hasPermissions('courseScheduleTeacherSalary/findIsSettlementCourseSalarys')")
+    public HttpResponseResult findIsSettlementCourseSalarys(CourseSalaryQueryInfo4Web queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            throw new BizException("用户信息获取失败");
+        }
+        if (!sysUser.getIsSuperAdmin()) {
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
+                queryInfo.setOrganIdList(employee.getOrganIdList());
+            } else if (org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())) {
+                throw new BizException("用户所在分部异常");
+            } else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if (!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))) {
+                    throw new BizException("非法请求");
+                }
+            }
+        }
+        return succeed(courseScheduleTeacherSalaryService.findIsSettlementCourseSalarys(queryInfo));
+    }
 }
 }

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

@@ -1,32 +1,14 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dto.ClassGroup4MixDto;
-import com.ym.mec.biz.dal.dto.HighClassGroupDto;
-import com.ym.mec.biz.dal.dto.TestDto;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.TeacherSalaryModifyLog;
 import com.ym.mec.biz.dal.entity.TeacherSalaryModifyLog;
-import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
-import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
-import com.ym.mec.biz.dal.page.queryMusicGroupCourseScheduleQueryInfo;
-import com.ym.mec.biz.service.ClassGroupService;
-import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
 import com.ym.mec.biz.service.TeacherSalaryModifyLogService;
 import com.ym.mec.biz.service.TeacherSalaryModifyLogService;
 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.page.QueryInfo;
-import io.swagger.annotations.*;
-import org.apache.commons.lang3.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
-import java.util.List;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 
 @RequestMapping("teacherSalaryModifyLog")
 @RequestMapping("teacherSalaryModifyLog")
 @Api(tags = "班级服务")
 @Api(tags = "班级服务")