Browse Source

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

zouxuan 5 years ago
parent
commit
7132aaf0dd

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java

@@ -395,6 +395,17 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
 											 @Param("month") String month);
 
 	/**
+	 * @describe 更新指定课酬的确认状态
+	 * @author Joburgess
+	 * @date 2020/4/15
+	 * @param ids:
+	 * @param confirmStatus:
+	 * @return int
+	 */
+	int updateTeacherSalaryConfirmStatus(@Param("ids") List<Long> ids,
+                                         @Param("confirmStatus") Integer confirmStatus);
+
+	/**
 	 * @describe 统计教师指定月份不同团体类型的课酬
 	 * @author Joburgess
 	 * @date 2020/4/15

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

@@ -832,7 +832,11 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         if(Objects.isNull(month)){
             month=DateUtil.dateToString(DateUtil.addMonths(new Date(), -1), "yyyy-MM");
         }
-        courseScheduleTeacherSalaryDao.findTeacherSalaryIdsWithMonth(teacherId,month);
+        List<Long> teacherSalaryIds = courseScheduleTeacherSalaryDao.findTeacherSalaryIdsWithMonth(teacherId, month);
+        if(CollectionUtils.isEmpty(teacherSalaryIds)){
+            return;
+        }
+        courseScheduleTeacherSalaryDao.updateTeacherSalaryConfirmStatus(teacherSalaryIds,1);
     }
 
     @Override

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

@@ -627,8 +627,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 						}else{
 							BigDecimal overCoursesOfMonth=new BigDecimal(overCourses),allClassTimes=new BigDecimal(totalClassTimes);
 
-							Integer monthConsumeRate=overCoursesOfMonth.divide(allClassTimes,CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_HALF_UP).intValue();
-							vipGroup.setMonthConsumeRate(monthConsumeRate * 100);
+							Integer monthConsumeRate=overCoursesOfMonth.divide(allClassTimes,CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue();
+							vipGroup.setMonthConsumeRate(monthConsumeRate);
 						}
 					}
 				}

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

@@ -448,8 +448,15 @@
 		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}
 	</update>
+	<update id="updateTeacherSalaryConfirmStatus">
+		UPDATE course_schedule_teacher_salary SET confirm_status_=#{confirmStatus}
+		WHERE id_ IN
+		<foreach collection="ids" item="id" open="(" close=")" separator=",">
+			#{id}
+		</foreach>
+	</update>
 
-    <select id="findCourseScheduleTeacherSalaryByMusicGroupId" resultMap="CourseScheduleTeacherSalary">
+	<select id="findCourseScheduleTeacherSalaryByMusicGroupId" resultMap="CourseScheduleTeacherSalary">
 		SELECT * FROM course_schedule_teacher_salary WHERE music_group_id_=#{musicGroupId} AND group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 	</select>
 	<select id="countActualAmount" resultType="java.util.Map">

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

@@ -10,6 +10,7 @@ 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.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -29,7 +30,7 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
     private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "确定教师指定月份的课酬")
-    @GetMapping("confirmTeacherMonthSalary")
+    @PostMapping("confirmTeacherMonthSalary")
     public HttpResponseResult confirmTeacherMonthSalary(String month){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {