zouxuan 3 anni fa
parent
commit
5af0381367
19 ha cambiato i file con 193 aggiunte e 51 eliminazioni
  1. 9 7
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ActivityUserMapperDao.java
  2. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/GoodsSellDto.java
  3. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ActivityUserMapperService.java
  4. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  5. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ActivityUserMapperServiceImpl.java
  6. 9 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  7. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  8. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java
  9. 14 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  10. 86 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  11. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java
  12. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java
  13. 5 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  14. 3 0
      mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml
  15. 7 1
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml
  16. 3 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  17. 3 0
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml
  18. 16 10
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java
  19. 2 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/CourseHomeworkController.java

+ 9 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ActivityUserMapperDao.java

@@ -58,12 +58,14 @@ public interface ActivityUserMapperDao extends BaseDAO<Integer, ActivityUserMapp
             @Param("groupId") Long groupId);
 
     /**
-    * @description:
+     * @description:
      * @param groupId
- * @param groupType
-    * @return com.ym.mec.biz.dal.entity.ActivityUserMapper
-    * @author zx
-    * @date 2021/10/22 17:36
-    */
-    ActivityUserMapper findVipUserMapper(@Param("groupId") Long groupId, @Param("groupType") String groupType);
+     * @param groupType
+     * @return com.ym.mec.biz.dal.entity.ActivityUserMapper
+     * @author zx
+     * @date 2021/10/22 17:36
+     */
+    ActivityUserMapper findVipUserMapper(@Param("groupId") Long groupId,
+                                         @Param("groupType") String groupType,
+                                         @Param("studentId") Integer studentId);
 }

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/GoodsSellDto.java

@@ -24,13 +24,24 @@ public class GoodsSellDto{
 	@ApiModelProperty(value = "商品销售价", required = false)
 	private BigDecimal goodsPrice = BigDecimal.ZERO;
 
+	@ApiModelProperty(value = "商品团购价", required = false)
+	private BigDecimal goodsGroupPrice = BigDecimal.ZERO;
+
 	@ApiModelProperty(value = "商品销售总价", required = false)
 	private BigDecimal totalGoodsPrice = BigDecimal.ZERO;
 
     @ApiModelProperty(value = "辅件商品列表", required = false)
     private String complementGoodsIdList;
 
-    public String getComplementGoodsIdList() {
+	public BigDecimal getGoodsGroupPrice() {
+		return goodsGroupPrice;
+	}
+
+	public void setGoodsGroupPrice(BigDecimal goodsGroupPrice) {
+		this.goodsGroupPrice = goodsGroupPrice;
+	}
+
+	public String getComplementGoodsIdList() {
         return complementGoodsIdList;
     }
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/ActivityUserMapperService.java

@@ -58,5 +58,5 @@ public interface ActivityUserMapperService extends BaseService<Integer, Activity
     * @author zx
     * @date 2021/10/22 17:35
     */
-    ActivityUserMapper findVipUserMapper(Long groupId,String groupType);
+    ActivityUserMapper findVipUserMapper(Long groupId,String groupType,Integer studentId);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java

@@ -402,4 +402,13 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	Integer countTeacherPracticeGroups(Integer teacherId);
 
 	Object getPracticeGroupPayInfo(Long practiceGroupId, Integer userId);
+
+	/**
+	* @description: 获取学生指定网管课的剩余课时费用
+	 * @param practiceGroupId
+	* @return java.lang.Object
+	* @author zx
+	* @date 2021/11/2 18:07
+	*/
+	Map<String,BigDecimal> getStudentSurplusCourseFee(Long practiceGroupId);
 }

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

@@ -42,7 +42,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 	}
 
 	@Override
-	public ActivityUserMapper findVipUserMapper(Long groupId, String groupType) {
-		return activityUserMapperDao.findVipUserMapper(groupId,groupType);
+	public ActivityUserMapper findVipUserMapper(Long groupId, String groupType,Integer studentId) {
+		return activityUserMapperDao.findVipUserMapper(groupId,groupType,studentId);
 	}
 }

+ 9 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -668,7 +668,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							}
 							Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 							if(vipGroupActivityId != null){
-								ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+								ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 								if(activityUserMapper != null){
 									Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, cgtm.getUserId());
 									if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){
@@ -2794,7 +2794,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					Integer allowOnlineToOffline = 0;
 					if(Objects.nonNull(vipGroupActivity)){
 						allowOnlineToOffline = vipGroupActivity.getAllowOnlineToOffline();
-						ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP");
+						ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP",null);
 						if(activityUserMapper != null){
 							if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 								allowOnlineToOffline = vipGroupActivity.getGiveAllowOnlineToOffline();
@@ -3009,7 +3009,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				Integer allowOnlineToOffline = 0;
 				if(Objects.nonNull(vipGroupActivity)){
 					allowOnlineToOffline = vipGroupActivity.getAllowOnlineToOffline();
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP",null);
 					if(activityUserMapper != null){
 						if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 							allowOnlineToOffline = vipGroupActivity.getGiveAllowOnlineToOffline();
@@ -3463,7 +3463,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				Integer allowOnlineToOffline = 0;
 				if(Objects.nonNull(vipGroupActivity)){
 					allowOnlineToOffline = vipGroupActivity.getAllowOnlineToOffline();
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP",null);
 					if(activityUserMapper != null){
 						if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 							allowOnlineToOffline = vipGroupActivity.getGiveAllowOnlineToOffline();
@@ -3810,7 +3810,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, teacherId, ts.getCourseScheduleId());
 							BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
 							//是否是赠送课程
-							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP");
+							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP",null);
 							if(activityUserMapper != null){
 								if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 									teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
@@ -3839,7 +3839,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							if(practiceGroup != null){
 								Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 								if(vipGroupActivityId != null){
-									ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+									ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 									if(activityUserMapper != null){
 										Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, ts.getUserId());
 										if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){
@@ -4044,7 +4044,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(byCourseSchedule, newCourseSchedule.getActualTeacherId(), newCourseSchedule.getId());
 					BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
 					//是否是赠送课程
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(byCourseSchedule.getId(),"VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(byCourseSchedule.getId(),"VIP",null);
 					if(activityUserMapper != null){
 						if(byCourseSchedule.getId().equals(activityUserMapper.getGiveVipGroupId())){
 							teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
@@ -5131,7 +5131,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if(practiceGroup != null){
 			Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 			if(vipGroupActivityId != null){
-				ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+				ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 				if(activityUserMapper != null){
 					Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, teacherId);
 					if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){
@@ -5255,7 +5255,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					if(practiceGroup != null){
 						Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 						if(vipGroupActivityId != null){
-							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 							if(activityUserMapper != null){
 								Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, teacherId);
 								if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){

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

@@ -931,7 +931,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByGroupWithNotStart(vipGroupId.toString(), GroupType.VIP.getCode());
         if(!CollectionUtils.isEmpty(courseScheduleTeacherSalaries)){
             //是否是赠送课程
-            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP");
+            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP",null);
             Map<String, BigDecimal> salary = vipGroupService.countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
             for(int i=0;i<courseScheduleTeacherSalaries.size();i++){
                 if(!courseScheduleTeacherSalaries.get(i).getEnableChangeSalary()){
@@ -1413,7 +1413,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     private void createVipGroupCourseTeacherSalaries(CourseSchedule courseSchedule, List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries){
         VipGroup vipGroup = vipGroupService.get(Long.valueOf(courseSchedule.getMusicGroupId()));
         //是否是赠送课程
-        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP");
+        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP",null);
         for (CourseScheduleTeacherSalary courseScheduleTeacherSalary : courseScheduleTeacherSalaries) {
             Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, courseSchedule.getActualTeacherId(), courseSchedule.getId());
             BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
@@ -1465,7 +1465,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 if(practiceGroup != null){
                     Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
                     if(vipGroupActivityId != null){
-                        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+                        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
                         if(activityUserMapper != null){
                             Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, courseScheduleTeacherSalary.getUserId());
                             if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){

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

@@ -173,7 +173,7 @@ public class GroupClassServiceImpl implements GroupClassService {
             if (!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL) || practiceGroup.getCoursesExpireDate().before(now)) {
                 throw new BizException("当前课程组不可关闭");
             }
-            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
             HttpResponseResult result = quitActivityGive(activityUserMapper, returnFeeDto.getConfirmReturnActivityGive(), practiceGroup.getId(),GroupType.PRACTICE);
             if(result.getCode() != 200){
                 return result;

+ 14 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -642,17 +642,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup == null) {
             throw new BizException("乐团信息查询失败");
         }
-        if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
-            throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
-        }
-
-        List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
-        Map<Integer, String> receiverList = studentPreRegistrationList.stream().collect(Collectors.toMap(StudentPreRegistration::getUserId, StudentPreRegistration::getPhone));
+        if (musicGroup.getStatus() == MusicGroupStatusEnum.PRE_APPLY || musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
+            Map<Integer, String> receiverList = null;
+            if(musicGroup.getStatus() == MusicGroupStatusEnum.PRE_APPLY){
+                List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
+                receiverList = studentPreRegistrationList.stream().collect(Collectors.toMap(StudentPreRegistration::getUserId, StudentPreRegistration::getPhone));
+            }else {
+                receiverList = MapUtil.convertMybatisMap(studentRegistrationDao.findMapByMusicGroupId(musicGroupId, 2));
+            }
 
-        String meetingDateStr = sdf_ymdhms.format(meetingDate);
-        sysMessageService.batchSendImGroupMessage(MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
-        sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
-        return true;
+            String meetingDateStr = sdf_ymdhms.format(meetingDate);
+            sysMessageService.batchSendImGroupMessage(MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
+            sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
+            return true;
+        }
+        return false;
     }
 
     @Override

+ 86 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -48,6 +48,7 @@ import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.SignInStatusEnum.*;
 import static java.math.BigDecimal.ROUND_DOWN;
+import static java.math.BigDecimal.ZERO;
 
 @Service
 public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGroup> implements PracticeGroupService {
@@ -144,6 +145,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     private StudentService studentService;
     @Autowired
     private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
+    @Autowired
+    private VipGroupDao vipGroupDao;
+    @Autowired
+    private VipGroupCategoryDao vipGroupCategoryDao;
 
     private static Map<Integer, Map<Integer, List<Integer>>> schoolSubjectTeachersMap;
 
@@ -5505,4 +5510,85 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         vipGroupPayInfo.setBalance(sysUserCashAccount.getBalance());
         return vipGroupPayInfo;
     }
+
+    @Override
+    public Map<String, BigDecimal> getStudentSurplusCourseFee(Long practiceGroupId) {
+        if(Objects.isNull(practiceGroupId)){
+            throw new BizException("请指定课程");
+        }
+        PracticeGroup practiceGroup = practiceGroupDao.get(practiceGroupId);
+        if(Objects.isNull(practiceGroup)){
+            throw new BizException("未找到指定网管课");
+        }
+        Integer studentId = practiceGroup.getStudentId();
+        if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)){
+            throw new BizException("只有进行中的网管课可以关闭");
+        }
+        Map<String,BigDecimal> result = new HashMap<>();
+        Date now = new Date();
+        BigDecimal bigDecimal;
+        List<StudentCourseInfoDto> userCourseInfos = new ArrayList<>();
+        VipGroupCategory vipGroupCategory = null;
+        //是否关联活动
+        if(practiceGroup.getVipGroupActivityId() != null){
+            ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(practiceGroupId,"PRACTICE", studentId);
+            if(activityUserMapper != null && !activityUserMapper.getReturnFee()){
+                if(Objects.nonNull(activityUserMapper.getVipGroupId())){
+                    VipGroup group = vipGroupDao.get(activityUserMapper.getVipGroupId());
+                    vipGroupCategory = vipGroupCategoryDao.get(group.getVipGroupCategoryId().intValue());
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.VIP, activityUserMapper.getVipGroupId().toString(), studentId, null));
+                }
+                if(Objects.nonNull(activityUserMapper.getGiveVipGroupId())){
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.VIP, activityUserMapper.getGiveVipGroupId().toString(), studentId, null));
+                }
+                if(Objects.nonNull(activityUserMapper.getPracticeGroupId())){
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, activityUserMapper.getPracticeGroupId().toString(), studentId, null));
+                }
+                if(Objects.nonNull(activityUserMapper.getGivePracticeGroupId())){
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, activityUserMapper.getGivePracticeGroupId().toString(), studentId, null));
+                }
+                userCourseInfos.removeAll(Collections.singleton(null));
+            }else {
+                userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, practiceGroupId.toString(), studentId, null);
+            }
+        }else {
+            userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, practiceGroupId.toString(), studentId, null);
+        }
+
+        if(!CollectionUtils.isEmpty(userCourseInfos)){
+            BigDecimal historyPrice = ZERO;
+            BigDecimal allPrice = ZERO;
+            int overNum = 0;
+            for (StudentCourseInfoDto userCourseInfo : userCourseInfos) {
+                allPrice = allPrice.add(userCourseInfo.getExpectPrice());
+                if(now.after(userCourseInfo.getStartClassTime())){
+                    overNum++;
+                    historyPrice = historyPrice.add(userCourseInfo.getOriginalPrice());
+                }
+            }
+            bigDecimal = allPrice.subtract(historyPrice);
+            if(bigDecimal.compareTo(ZERO) < 0){
+                bigDecimal = ZERO;
+            }
+            if(overNum == userCourseInfos.size()){
+                bigDecimal = ZERO;
+            }
+            result.put("suplusCourseOriginalFee", allPrice);
+        }else{
+            bigDecimal = new BigDecimal(0);
+            result.put("suplusCourseOriginalFee", bigDecimal);
+        }
+        ClassGroup classGroup = classGroupDao.findByGroupAndType(practiceGroupId.toString(), "PRACTICE");
+        if(Objects.isNull(classGroup)){
+            throw new BizException("未找到对应班级");
+        }
+
+        if(vipGroupCategory == null || vipGroupCategory.getStudentNum() <= 1){
+            bigDecimal = bigDecimal.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+        }else{
+            bigDecimal = bigDecimal.multiply(new BigDecimal(0.7)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+        }
+        result.put("suplusCourseFee", bigDecimal);
+        return result;
+    }
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -189,21 +189,28 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
         Map<Integer, String> integerStringMap = getMap("goods", "id_", "type_", goodsIds, Integer.class, String.class);
         Map<Integer, BigDecimal> map = getMap("goods", "id_", "discount_price_", goodsIds, Integer.class, BigDecimal.class);
+        Map<Integer, BigDecimal> groupPriceMap = getMap("goods", "id_", "group_purchase_price_", goodsIds, Integer.class, BigDecimal.class);
         for (GoodsSellDto goodsSellDto : goodsSellDtos) {
             goodsSellDto.setGoodsType(integerStringMap.get(goodsSellDto.getGoodsId()));
             if (StringUtils.isNotEmpty(goodsSellDto.getComplementGoodsIdList())) {
                 goodsSellDto.setGoodsSellDtos(goodsService.queryGoodsSellDtos(goodsSellDto.getComplementGoodsIdList()));
             }
             goodsSellDto.setGoodsPrice(map.get(goodsSellDto.getGoodsId()));
+            goodsSellDto.setGoodsGroupPrice(groupPriceMap.get(goodsSellDto.getGoodsId()));
             goodsSellDto.setTotalGoodsPrice(map.get(goodsSellDto.getGoodsId()).multiply(new BigDecimal(goodsSellDto.getGoodsNum())));
         }
         Map<Integer, List<GoodsSellDto>> goodsMap = goodsSellDtos.stream().collect(Collectors.groupingBy(GoodsSellDto::getGoodsId));
         BigDecimal amount = BigDecimal.ZERO;
+        BigDecimal groupAmount = BigDecimal.ZERO;
         for (Integer id : goodsIds) {
             GoodsSellDto goodsSellDto = goodsMap.get(id).get(0);
             amount = amount.add(goodsSellDto.getTotalGoodsPrice());
+            groupAmount = groupAmount.add(goodsSellDto.getGoodsGroupPrice());
         }
         amount = amount.subtract(studentGoodsSell.getMarketAmount());
+        if(amount.compareTo(groupAmount) < 0){
+            throw new BizException("操作失败:该金额减免后商品价格不可低于商品团购价");
+        }
         if (amount.signum() < 0) {
             throw new BizException("操作失败:订单金额异常");
         }

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

@@ -140,7 +140,7 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 					// 批量修改课程课酬
 					List<CourseScheduleTeacherSalary> list = new ArrayList<CourseScheduleTeacherSalary>();
 
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(Long.parseLong(updateTeacherSalaryList.get(0).getMusicGroupId()),"VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(Long.parseLong(updateTeacherSalaryList.get(0).getMusicGroupId()),"VIP",null);
 					for (CourseScheduleTeacherSalary ts : updateTeacherSalaryList) {
 						//课酬调整后不能更新课酬
 						if(!ts.getEnableChangeSalary()){

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

@@ -979,7 +979,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 					vipGroupApplyBaseInfoDto.getUserId(), null);
 			BigDecimal teacherSalary = costInfo.get("offlineTeacherSalary");
 			//是否是赠送课程
-			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroupApplyBaseInfoDto.getId(),"VIP");
+			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroupApplyBaseInfoDto.getId(),"VIP",null);
 			if(activityUserMapper != null){
 				if(vipGroupApplyBaseInfoDto.getId().equals(activityUserMapper.getGiveVipGroupId())){
 					teacherSalary = costInfo.get("giveOfflineTeacherSalary");
@@ -2265,7 +2265,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
 
 			//是否是赠送课程
-			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 			if(activityUserMapper != null){
 				if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 					giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
@@ -3348,7 +3348,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 			BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
 			//是否是赠送课程
-			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 			if(activityUserMapper != null){
 				if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 					teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
@@ -4038,7 +4038,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<String, BigDecimal> map = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 		BigDecimal offlineTeacherSalary = map.get("offlineTeacherSalary");
 		//是否是赠送课程
-		ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+		ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 		if(activityUserMapper != null){
 			if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 				offlineTeacherSalary = map.get("giveOfflineTeacherSalary");
@@ -4182,7 +4182,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 				BigDecimal offlineTeacherSalary = salaryMap.get("offlineTeacherSalary");
 				//是否是赠送课程
-				ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+				ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 				if(activityUserMapper != null){
 					if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 						offlineTeacherSalary = salaryMap.get("giveOfflineTeacherSalary");

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml

@@ -182,6 +182,9 @@
 		<if test="groupType == 'PRACTICE'">
 			AND (practice_group_id_ = #{groupId} OR give_practice_group_id_ = #{groupId})
 		</if>
+		<if test="studentId != null">
+			AND user_id_ = #{studentId}
+		</if>
 		LIMIT 1
 	</select>
 </mapper>

+ 7 - 1
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -518,7 +518,13 @@
 
 	<sql id="getEduHomeworkListCondition">
 		<where>
-			EXISTS (SELECT user_id_ FROM student_registration sr LEFT JOIN music_group mg ON mg.id_=sr.music_group_id_ WHERE sr.user_id_ = eer.user_id_ AND sr.music_group_status_='NORMAL' AND mg.status_ = 'PROGRESS' AND mg.transaction_teacher_id_=#{transactionTeacherId})
+			EXISTS (SELECT user_id_ FROM student_registration sr
+			LEFT JOIN music_group mg ON mg.id_=sr.music_group_id_
+			WHERE sr.user_id_ = eer.user_id_ AND sr.music_group_status_='NORMAL'
+			AND mg.status_ = 'PROGRESS' AND mg.transaction_teacher_id_=#{transactionTeacherId})
+			<if test="search != null and search != ''">
+				AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.id_ = #{search})
+			</if>
 			<if test="startTime!=null">
 				AND DATE_FORMAT(ee.create_time_, "%Y-%m-%d") &gt;= DATE_FORMAT(#{startTime}, "%Y-%m-%d")
 			</if>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -257,6 +257,9 @@
             <if test="organId != null">
                 AND FIND_IN_SET(organ_id_,#{organId})
             </if>
+            <if test="cooperationOrganId != null">
+                AND cooperation_organ_id_ = #{cooperationOrganId}
+            </if>
             <if test="musicGroupName != null and musicGroupName != ''">
                 AND (name_ LIKE CONCAT('%',#{musicGroupName},'%') OR id_ LIKE CONCAT('%',#{musicGroupName},'%'))
             </if>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml

@@ -500,6 +500,9 @@
             mg.transaction_teacher_id_ = #{transactionTeacherId}
             AND mg.status_ = "PROGRESS"
             AND sr.music_group_status_='NORMAL'
+            <if test="search != null and search != ''">
+                AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.id_ = #{search})
+            </if>
             <if test="startTime!=null">
                 AND cs.class_date_ &gt;= DATE_FORMAT(#{startTime}, "%Y-%m-%d")
             </if>

+ 16 - 10
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -115,17 +115,17 @@ public class PracticeGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+            return failed("用户所在分部异常");
+        } else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                return failed("非法请求");
             }
+        }
         return succeed(practiceGroupService.findPracticeGroupReviews(queryInfo));
     }
 
@@ -205,4 +205,10 @@ public class PracticeGroupManageController extends BaseController {
         applyBaseInfoDto.setMemo("指导老师申请网管课");
         return practiceGroupService.createPracticeGroup(practiceGroupApplyDto);
     }
+
+    @ApiOperation(value = "获取学生指定网管课的剩余课时费用")
+    @GetMapping(value = "/getStudentSurplusCourseFee")
+    public Object getStudentSurplusCourseFee(Long practiceGroupId){
+        return succeed(practiceGroupService.getStudentSurplusCourseFee(practiceGroupId));
+    }
 }

+ 2 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/CourseHomeworkController.java

@@ -80,12 +80,14 @@ public class CourseHomeworkController extends BaseController {
         if(!extra){
             CourseHomework courseHomework = courseHomeworkService.get(homeworkId);
             if(Objects.nonNull(courseHomework)){
+                result.put("title", courseHomework.getTitle());
                 result.put("content", courseHomework.getContent());
             }
             result.put("data", studentCourseHomeworkService.findStudentCourseHomeworkByCourse(null, homeworkId,userName));
         }else{
             ExtracurricularExercises extracurricularExercises = extracurricularExercisesService.get(homeworkId);
             if(Objects.nonNull(extracurricularExercises)){
+                result.put("title", extracurricularExercises.getTitle());
                 result.put("content", extracurricularExercises.getContent());
             }
             result.put("data", extracurricularExercisesReplyService.findExtraExerciseStudents(homeworkId,userName));