소스 검색

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

yonge 5 년 전
부모
커밋
4619fb0a0d

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupCategoryDao.java

@@ -10,6 +10,8 @@ public interface VipGroupCategoryDao extends BaseDAO<Integer, VipGroupCategory>
 
     List<VipGroupCategory> findAllByOrgan(String organId);
 
+    List<VipGroupCategory> findTeacherDefaultSalary(Integer userId);
+
     List<ConditionDto> findConditionCategorys();
 
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupCategoryService.java

@@ -10,5 +10,7 @@ public interface VipGroupCategoryService extends BaseService<Integer, VipGroupCa
 
     List<VipGroupCategory> findAllByOrgan(String organId);
 
+    List<VipGroupCategory> findTeacherSalary(Integer userId);
+
     List<ConditionDto> findConditionCategorys();
 }

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

@@ -226,7 +226,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                     return;
                 }
                 //计算教师责任总占比
-                double teacherLiabilityRatioSum = courseStudentComplaints.stream().mapToDouble(CourseScheduleComplaints::getTeacherLiabilityRatio).sum();
+                double teacherLiabilityRatioSum = courseStudentComplaints.stream().mapToDouble(courseScheduleComplaint->Objects.isNull(courseScheduleComplaint.getTeacherLiabilityRatio())?0:courseScheduleComplaint.getTeacherLiabilityRatio()).sum();
                 teacherLiabilityAllratio = new BigDecimal(teacherLiabilityRatioSum);
             } else {
                 //如果没有投诉,则教师和学生的责任占比为0
@@ -282,6 +282,9 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 }
                 if (!CollectionUtils.isEmpty(currentCourseScheduleComplaints)) {
                     Double temp = currentCourseScheduleComplaints.get(0).getStudentLiabilityRatio();
+                    if(Objects.isNull(temp)){
+                        temp=0.0;
+                    }
                     studentLiabilityRatio = new BigDecimal(temp);
                 } else {
                     studentLiabilityRatio = new BigDecimal(0);

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupCategoryServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dto.ConditionDto;
+import com.ym.mec.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -11,6 +12,7 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
 import java.util.List;
+import java.util.Objects;
 
 @Service
 public class VipGroupCategoryServiceImpl extends BaseServiceImpl<Integer, VipGroupCategory>  implements VipGroupCategoryService {
@@ -29,6 +31,14 @@ public class VipGroupCategoryServiceImpl extends BaseServiceImpl<Integer, VipGro
 	}
 
 	@Override
+	public List<VipGroupCategory> findTeacherSalary(Integer userId) {
+		if(Objects.isNull(userId)){
+			throw new BizException("请确定教师");
+		}
+		return vipGroupCategoryDao.findTeacherDefaultSalary(userId);
+	}
+
+	@Override
 	public List<ConditionDto> findConditionCategorys() {
 		return vipGroupCategoryDao.findConditionCategorys();
 	}

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

@@ -174,7 +174,6 @@
 		<where>
 			vg.id_=#{vipGroupId}
 			AND cs.group_type_='VIP'
-			AND FIND_IN_SET(#{organId},vg.organ_id_list_)
 			<if test="startTime!=null and endTime!=null">
 				AND (cs.class_date_ BETWEEN #{startTime} AND #{endTime})
 			</if>

+ 14 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml

@@ -37,6 +37,20 @@
 		ORDER BY id_
 	</select>
 
+	<select id="findTeacherDefaultSalary" resultMap="VipGroupCategory">
+		SELECT
+			vgc.*,
+			tdvgs.online_classes_salary_ online_classes_unit_price_,
+			tdvgs.offline_classes_salary_ offline_classes_unit_price_
+		FROM
+			vip_group_category vgc
+			LEFT JOIN teacher_default_vip_group_salary tdvgs ON vgc.id_ = tdvgs.vip_group_category_id_ AND tdvgs.user_id_=#{userId}
+		WHERE
+			vgc.del_flag_ = 0
+		ORDER BY
+			id_
+	</select>
+
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.VipGroupCategory"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">

+ 0 - 1
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/RedisIdGeneratorService.java

@@ -7,7 +7,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.ValueOperations;
 import org.springframework.stereotype.Service;

+ 5 - 1
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -233,7 +233,11 @@ public class RoomServiceImpl implements RoomService {
         String userId = user.getId().toString();
         Teacher teacher = teacherDao.get(user.getId());
         if(teacher != null){
-            teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId.substring(4)),user.getId(), SignStatusEnum.SIGN_OUT,true);
+            try {
+                teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId.substring(4)),user.getId(), SignStatusEnum.SIGN_OUT,true);
+            }catch (Exception e){
+                e.printStackTrace();
+            }
         }
         
         CheckUtils.checkArgument(user != null, "user must't be null");

+ 2 - 1
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -48,7 +49,7 @@ public class MusicGroupRegisterController extends BaseController {
         if (hasReg != null) {
             return failed("该乐团您已报名");
         }
-        if (musicGroup.getApplyExpireDate().compareTo(date) <= 0) {
+        if (DateUtil.daysBetween(musicGroup.getApplyExpireDate(),date) > 0) {
             return failed("乐团已截止报名");
         }
 

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupCategoryController.java

@@ -45,6 +45,14 @@ public class VipGroupCategoryController extends BaseController {
 		return succeed(vipGroupCategoryService.queryPage(queryInfo));
 	}
 
+	@ApiOperation("获取教师课酬")
+	@PostMapping(value = "/findTeacherDefaultSalary")
+	@PreAuthorize("@pcs.hasPermissions('vipGroupCategory/findTeacherDefaultSalary')")
+	public Object findTeacherDefaultSalary(Integer userId) {
+		return succeed(vipGroupCategoryService.findTeacherSalary(userId));
+	}
+
+
 	@ApiOperation("新增")
 	@PostMapping(value = "/add")
     @PreAuthorize("@pcs.hasPermissions('vipGroupCategory/add')")