Browse Source

feat:乐理课

Joburgess 4 years ago
parent
commit
88e0015cd2

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java

@@ -162,6 +162,9 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 							TeacherDefaultVipGroupSalary origTdms = map.get(vipGroup.getVipGroupCategoryId());
 							TeacherDefaultVipGroupSalary origTdms = map.get(vipGroup.getVipGroupCategoryId());
 							if (tdms != null && origTdms != null) {
 							if (tdms != null && origTdms != null) {
 								Map<String, BigDecimal> teachModeSalaryMap = vipGroupService.countVipGroupCoursePredictFee(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
 								Map<String, BigDecimal> teachModeSalaryMap = vipGroupService.countVipGroupCoursePredictFee(vipGroup, ts.getUserId(), ts.getCourseScheduleId());
+								if(Objects.isNull(vipGroup.getVipGroupActivityId())){
+									teachModeSalaryMap = vipGroupService.countVipGroupPredictFee(vipGroup, ts.getUserId());
+								}
 								if(TeachModeEnum.ONLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("onlineTeacherSalary")){
 								if(TeachModeEnum.ONLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("onlineTeacherSalary")){
 									ts.setExpectSalary(teachModeSalaryMap.get("onlineTeacherSalary"));
 									ts.setExpectSalary(teachModeSalaryMap.get("onlineTeacherSalary"));
 								}else if(TeachModeEnum.OFFLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("offlineTeacherSalary")){
 								}else if(TeachModeEnum.OFFLINE.equals(ts.getCourseSchedule().getTeachMode())&&teachModeSalaryMap.containsKey("offlineTeacherSalary")){

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

@@ -987,7 +987,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			normalStudentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(GroupType.VIP, vipGroup.getId().toString());
 			normalStudentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(GroupType.VIP, vipGroup.getId().toString());
 		}
 		}
 
 
-		if(Objects.nonNull(vipGroupActivity)){
+		if(!vipGroupCategory.getMusicTheory()&&Objects.isNull(vipGroupActivity)){
+			throw new BizException("活动设置错误");
+		}
+
+		if(!vipGroupCategory.getMusicTheory()){
 			VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
 			VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
 
 
 			if(Objects.isNull(vipGroupSalarySettlementDto)){
 			if(Objects.isNull(vipGroupSalarySettlementDto)){
@@ -1124,11 +1128,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 
 			results.put("onlineTeacherSalary", ots);
 			results.put("onlineTeacherSalary", ots);
 			results.put("offlineTeacherSalary", ofts);
 			results.put("offlineTeacherSalary", ofts);
-		}else{
-
 		}
 		}
 
 
-		if(Objects.isNull(vipGroupActivity)||vipGroupCategory.getMusicTheory()){
+		if(vipGroupCategory.getMusicTheory()){
 			BigDecimal ots = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 			BigDecimal ots = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 			BigDecimal ofts = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 			BigDecimal ofts = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 			if(Objects.nonNull(vipGroup.getStatus())&&vipGroupCategory.getMusicTheory()){
 			if(Objects.nonNull(vipGroup.getStatus())&&vipGroupCategory.getMusicTheory()){
@@ -1143,6 +1145,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(vipGroup instanceof VipGroupApplyBaseInfoDto&&!CollectionUtils.isEmpty(((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices())){
 		if(vipGroup instanceof VipGroupApplyBaseInfoDto&&!CollectionUtils.isEmpty(((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices())){
 			vipGroup.setTotalPrice(new BigDecimal(0));
 			vipGroup.setTotalPrice(new BigDecimal(0));
 			for (VipGroupStudentCoursePrice vscp : ((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices()) {
 			for (VipGroupStudentCoursePrice vscp : ((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices()) {
+				if(!vipGroupCategory.getMusicTheory()){
+					results.put(vscp.getStudentId().toString(), vipGroup.getTotalPrice());
+					continue;
+				}
 				if(Objects.isNull(vscp.getOnlineClassesUnitPrice())||Objects.isNull(vscp.getOfflineClassesUnitPrice())){
 				if(Objects.isNull(vscp.getOnlineClassesUnitPrice())||Objects.isNull(vscp.getOfflineClassesUnitPrice())){
 					throw new BizException("请设置课程单价");
 					throw new BizException("请设置课程单价");
 				}
 				}

+ 13 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/VipGroupCategoryController.java

@@ -12,13 +12,16 @@ 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.http.HttpStatus;
 import org.springframework.http.HttpStatus;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 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.Date;
 import java.util.Date;
+import java.util.List;
 import java.util.Objects;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 
 @Api(tags = "vip课类别")
 @Api(tags = "vip课类别")
 @RequestMapping("vipGroupCategory")
 @RequestMapping("vipGroupCategory")
@@ -48,13 +51,21 @@ public class VipGroupCategoryController extends BaseController {
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 			return failed(HttpStatus.FORBIDDEN, "请登录");
 		}
 		}
 		if(Objects.nonNull(organId)){
 		if(Objects.nonNull(organId)){
-			return succeed(vipGroupCategoryService.findAllByOrgan(organId.toString()));
+			List<VipGroupCategory> result = vipGroupCategoryService.findAllByOrgan(organId.toString());
+			if(!CollectionUtils.isEmpty(result)){
+				result = result.stream().filter(c->c.getMusicTheory()).collect(Collectors.toList());
+			}
+			return succeed();
 		}else{
 		}else{
 			Teacher teacher = teacherDao.get(user.getId());
 			Teacher teacher = teacherDao.get(user.getId());
 			if(Objects.isNull(teacher)){
 			if(Objects.isNull(teacher)){
 				return failed("教师信息不存在");
 				return failed("教师信息不存在");
 			}
 			}
-			return succeed(vipGroupCategoryService.findAllByOrgan(teacher.getTeacherOrganId().toString()));
+			List<VipGroupCategory> result = vipGroupCategoryService.findAllByOrgan(teacher.getTeacherOrganId().toString());
+			if(!CollectionUtils.isEmpty(result)){
+				result = result.stream().filter(c->c.getMusicTheory()).collect(Collectors.toList());
+			}
+			return succeed(result);
 		}
 		}
 	}
 	}