Browse Source

1、课酬确认相关
2、VIP课导出添加学生姓名和编号

Joburgess 5 years ago
parent
commit
c19a261b35

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherSalaryComplaintsDao.java

@@ -5,6 +5,8 @@ import com.ym.mec.biz.dal.enums.TeacherSalaryComplaintsStatusEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface TeacherSalaryComplaintsDao extends BaseDAO<Long, TeacherSalaryComplaints> {
 
     /**
@@ -23,4 +25,15 @@ public interface TeacherSalaryComplaintsDao extends BaseDAO<Long, TeacherSalaryC
      * @return
      */
     Object repealComplaints(@Param("salarySettlementMonth") String salarySettlementMonth, @Param("teacherId") Integer teacherId);
+
+    /**
+     * @describe 获取教师指定月份的申诉记录
+     * @author Joburgess
+     * @date 2020/4/16
+     * @param teacherId:
+     * @param month:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.TeacherSalaryComplaints>
+     */
+    List<TeacherSalaryComplaints> findTeacherSalaryComplaintsWithMonth(@Param("teacherId") Integer teacherId,
+                                                                       @Param("month") String month);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseTeacherSalaryStatisticsDto.java

@@ -14,10 +14,20 @@ public class CourseTeacherSalaryStatisticsDto {
 
     private String month;
 
+    private Integer courseTimes;
+
     private BigDecimal totalActualSalary;
 
     private BigDecimal totalReduceSalary;
 
+    public Integer getCourseTimes() {
+        return courseTimes;
+    }
+
+    public void setCourseTimes(Integer courseTimes) {
+        this.courseTimes = courseTimes;
+    }
+
     public String getMonth() {
         return month;
     }

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

@@ -73,6 +73,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     private VipGroupCategoryDao vipGroupCategoryDao;
     @Autowired
     private StudentAttendanceDao studentAttendanceDao;
+    @Autowired
+    private TeacherSalaryComplaintsDao teacherSalaryComplaintsDao;
 
     private static final Logger LOGGER = LoggerFactory
             .getLogger(CourseScheduleTeacherSalaryServiceImpl.class);
@@ -867,14 +869,26 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         PageInfo<TeacherCourseSalaryDetail4WebDto> pageInfo = findIsSettlementCourseSalarys(queryInfo4Web);
         Map<String, Object> result=new HashMap<>();
         result.put("pageInfo",pageInfo);
-        Map<String, BigDecimal> groupTypeSalaryMap = new HashMap<>();
+        List<CourseTeacherSalaryStatisticsDto> teacherGroupTypeSalary = new ArrayList<>();
         if(queryInfo4Web.getPage()<=1){
-            List<CourseTeacherSalaryStatisticsDto> teacherGroupTypeSalary = courseScheduleTeacherSalaryDao.getTeacherGroupTypeSalary(queryInfo4Web.getMonth(), queryInfo4Web.getTeacherId());
-            groupTypeSalaryMap = teacherGroupTypeSalary.stream()
-                    .collect(Collectors.toMap(c->c.getGroupType().getCode(),
-                            c -> Objects.isNull(c.getTotalReduceSalary()) ? c.getTotalActualSalary() : c.getTotalActualSalary().subtract(c.getTotalReduceSalary())));
+            teacherGroupTypeSalary = courseScheduleTeacherSalaryDao.getTeacherGroupTypeSalary(queryInfo4Web.getMonth(), queryInfo4Web.getTeacherId());
+        }
+        result.put("stat", teacherGroupTypeSalary);
+        if(!CollectionUtils.isEmpty(pageInfo.getRows())){
+            if(YesOrNoEnum.YES.equals(pageInfo.getRows().get(0).getConfirmStatus())){
+                result.put("confirmStatus",1);
+            }else{
+                result.put("confirmStatus",0);
+            }
+        }else{
+            result.put("confirmStatus",0);
+        }
+        List<TeacherSalaryComplaints> teacherSalaryComplaintsWithMonth = teacherSalaryComplaintsDao.findTeacherSalaryComplaintsWithMonth(queryInfo4Web.getTeacherId(), queryInfo4Web.getMonth());
+        if(CollectionUtils.isEmpty(teacherSalaryComplaintsWithMonth)){
+            result.put("haveComplaints",0);
+        }else{
+            result.put("haveComplaints",1);
         }
-        result.put("stat", groupTypeSalaryMap);
         return result;
     }
 

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

@@ -828,6 +828,7 @@
 	<resultMap id="CourseTeacherSalaryStatisticsDto" type="com.ym.mec.biz.dal.dto.CourseTeacherSalaryStatisticsDto">
 		<result property="groupType" column="group_type_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result property="month" column="month_"/>
+		<result property="courseTimes" column="course_times_"/>
 		<result property="totalActualSalary" column="total_actual_salary_"/>
 		<result property="totalReduceSalary" column="total_reduce_salary_"/>
 	</resultMap>
@@ -835,6 +836,7 @@
     <select id="getTeacherGroupTypeSalary" resultMap="CourseTeacherSalaryStatisticsDto">
 		SELECT
 			csts.group_type_,
+			COUNT(DISTINCT csts.course_schedule_id_) course_times_,
 			SUM(actual_salary_) total_actual_salary_,
 			SUM(reduce_salary) total_reduce_salary_
 		FROM

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

@@ -121,4 +121,9 @@
 		AND tsc.status_ = #{statusEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} LIMIT 1
 	</select>
 
+	<select id="findTeacherSalaryComplaintsWithMonth" resultMap="TeacherSalaryComplaints">
+		SELECT * FROM teacher_salary_complaints tsc
+		WHERE tsc.teacher_id_ = #{teacherId} AND tsc.salary_settlement_month_ = #{month}
+	</select>
+
 </mapper>