Browse Source

Merge remote-tracking branch 'origin/master'

zouxuan 4 years ago
parent
commit
6b3163875e

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SporadicChargeTypeEnum.java

@@ -15,7 +15,8 @@ public enum SporadicChargeTypeEnum implements BaseEnum<Integer, SporadicChargeTy
     MUSIC_UPKEEP(10,"乐保服务"),
     OTHER(11,"其他"),
     DOUBLE_ELEVEN2020(12,"2020双十一活动"),
-    HIGH_ONLINE_ACTIVITY(13,"网基课活动");
+    HIGH_ONLINE_ACTIVITY(13,"网基课活动"),
+    PRACTICE_GROUP_BUY(14,"关心包");
 
     private Integer code;
 

+ 214 - 212
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -244,7 +244,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     private SubjectDao subjectDao;
     @Autowired
     private SysUserCashAccountDao sysUserCashAccountDao;
-    
+
     @Autowired
     private StudentPreRegistrationDao studentPreRegistrationDao;
 
@@ -377,112 +377,112 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-	public boolean preRegister(StudentPreRegistration studentPreRegistration) {
-
-		String musicGroupId = studentPreRegistration.getMusicGroupId();
-
-		// 查询乐团状态
-		MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团信息查询失败");
-		}
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
-			throw new BizException("乐团当前状态不能预报名");
-		}
-
-		StudentPreRegistration originRegistration = studentPreRegistrationDao.queryByMusicGroupIdAndPhone(studentPreRegistration.getPhone(), musicGroupId);
-		if (originRegistration != null) {
-			throw new BizException("您已预报名成功,请勿重复提交资料");
-		}
-		Date date = new Date();
-
-		// 判断用户是否存在
-		SysUser user = sysUserFeignService.queryUserByMobile(studentPreRegistration.getPhone());
-		if (user == null || user.getId() == null) {
-			user = new SysUser();
-			user.setPhone(studentPreRegistration.getPhone());
-			user.setUsername(studentPreRegistration.getUserName());
-			user.setOrganId(musicGroup.getOrganId());
-			user.setUserType("STUDENT");
-			user.setCreateTime(date);
-			user.setUpdateTime(date);
-			// 注册账户信息
-			HttpResponseResult<Integer> result = sysUserFeignService.addUser(user);
-
-			Integer userId = result.getData();
-			user.setId(userId);
-
-			Student student = new Student();
-			student.setUserId(userId);
-			student.setCreateTime(date);
-			student.setUpdateTime(date);
-			student.setIsNewUser(true);
-			studentDao.insert(student);
-			sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
-		}
-
-		studentPreRegistration.setCreateTime(date);
-		studentPreRegistration.setUserId(user.getId());
-
-		studentPreRegistrationDao.insert(studentPreRegistration);
-		
-		// 添加成员
-		imGroupMemberService.join(Long.parseLong(musicGroupId), user.getId(), null, false);
-
-		return true;
-	}
-
-	@Override
-	public boolean finishPreApply(String musicGroupId, boolean isCheckStudentNum) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团信息查询失败");
-		}
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
-			throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
-		}
-		if (isCheckStudentNum) {
-			// 查询乐团已报名人数
-			List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
-			if (studentPreRegistrationList == null || studentPreRegistrationList.size() < 120) {
-				throw new BizException("操作失败:报名人数没有达到120人");
-			}
-		}
-		musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
-		musicGroup.setUpdateTime(new Date());
-		musicGroupDao.update(musicGroup);
-		
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if(sysUser == null || sysUser.getId() == null){
-			throw new BizException("请重新登录");
-		}
-		
-		//记录操作日志
-		musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(预报名 -> 准备创建缴费)", sysUser.getId(), ""));
-		
-		return true;
-	}
-
-	@Override
-	public boolean sendParentMeetingNotice(Integer userId, String musicGroupId, Date meetingDate, String address) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		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));
-		
-		String meetingDateStr = sdf_ymdhms.format(meetingDate);
-		sysMessageService.batchSendImGroupMessage(MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
-		sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
-		return true;
-	}
-
-	@Override
+    public boolean preRegister(StudentPreRegistration studentPreRegistration) {
+
+        String musicGroupId = studentPreRegistration.getMusicGroupId();
+
+        // 查询乐团状态
+        MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团信息查询失败");
+        }
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
+            throw new BizException("乐团当前状态不能预报名");
+        }
+
+        StudentPreRegistration originRegistration = studentPreRegistrationDao.queryByMusicGroupIdAndPhone(studentPreRegistration.getPhone(), musicGroupId);
+        if (originRegistration != null) {
+            throw new BizException("您已预报名成功,请勿重复提交资料");
+        }
+        Date date = new Date();
+
+        // 判断用户是否存在
+        SysUser user = sysUserFeignService.queryUserByMobile(studentPreRegistration.getPhone());
+        if (user == null || user.getId() == null) {
+            user = new SysUser();
+            user.setPhone(studentPreRegistration.getPhone());
+            user.setUsername(studentPreRegistration.getUserName());
+            user.setOrganId(musicGroup.getOrganId());
+            user.setUserType("STUDENT");
+            user.setCreateTime(date);
+            user.setUpdateTime(date);
+            // 注册账户信息
+            HttpResponseResult<Integer> result = sysUserFeignService.addUser(user);
+
+            Integer userId = result.getData();
+            user.setId(userId);
+
+            Student student = new Student();
+            student.setUserId(userId);
+            student.setCreateTime(date);
+            student.setUpdateTime(date);
+            student.setIsNewUser(true);
+            studentDao.insert(student);
+            sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
+        }
+
+        studentPreRegistration.setCreateTime(date);
+        studentPreRegistration.setUserId(user.getId());
+
+        studentPreRegistrationDao.insert(studentPreRegistration);
+
+        // 添加成员
+        imGroupMemberService.join(Long.parseLong(musicGroupId), user.getId(), null, false);
+
+        return true;
+    }
+
+    @Override
+    public boolean finishPreApply(String musicGroupId, boolean isCheckStudentNum) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团信息查询失败");
+        }
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
+            throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
+        }
+        if (isCheckStudentNum) {
+            // 查询乐团已报名人数
+            List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
+            if (studentPreRegistrationList == null || studentPreRegistrationList.size() < 120) {
+                throw new BizException("操作失败:报名人数没有达到120人");
+            }
+        }
+        musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
+        musicGroup.setUpdateTime(new Date());
+        musicGroupDao.update(musicGroup);
+
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null || sysUser.getId() == null) {
+            throw new BizException("请重新登录");
+        }
+
+        //记录操作日志
+        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(预报名 -> 准备创建缴费)", sysUser.getId(), ""));
+
+        return true;
+    }
+
+    @Override
+    public boolean sendParentMeetingNotice(Integer userId, String musicGroupId, Date meetingDate, String address) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        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));
+
+        String meetingDateStr = sdf_ymdhms.format(meetingDate);
+        sysMessageService.batchSendImGroupMessage(MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
+        sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
+        return true;
+    }
+
+    @Override
     @Transactional(rollbackFor = Exception.class)
     public Map sporadicPay(SporadicPayDto sporadicPayDto) throws Exception {
         //获取收费项价格
@@ -548,7 +548,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentPaymentOrder.setVersion(0);
         BigDecimal balance = BigDecimal.ZERO;
         if (sporadicPayDto.getUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) {
-            if (chargeInfo.getChargeType().getCode().equals(9) || chargeInfo.getChargeType().getCode().equals(13)) {
+            if (chargeInfo.getChargeType().getCode().equals(9) ||
+                    chargeInfo.getChargeType().getCode().equals(13) ||
+                    chargeInfo.getChargeType().getCode().equals(14)) {
                 throw new BizException(chargeInfo.getChargeType().getMsg() + "不支持余额支付");
             }
             SysUserCashAccount userCashAccount = sysUserCashAccountService.get(userId);
@@ -1090,8 +1092,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         });
         if (waringSubjectIds.size() > 0) {
             List<Subject> waringSubjects = subjectDao.findBySubjectIds(waringSubjectIds);
-            String waringSubjectStr  = waringSubjects.stream().map(Subject::getName).collect(Collectors.joining(","));
-            throw new BizException(waringSubjectStr+"存在学生,不能删除");
+            String waringSubjectStr = waringSubjects.stream().map(Subject::getName).collect(Collectors.joining(","));
+            throw new BizException(waringSubjectStr + "存在学生,不能删除");
         }
 
         if (musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED) {
@@ -1184,13 +1186,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         List<ClassGroup> classGroups = classGroupDao.queryClassGroups(musicGroupId, "MUSIC");
         for (ClassGroup classGroup : classGroups) {
             //获取班级关联的老师列表
-            Set<Integer> teacherIds = classGroupTeacherMapperDao.queryTeacherIdsByClassGroupId(classGroup.getId(),null,null);
+            Set<Integer> teacherIds = classGroupTeacherMapperDao.queryTeacherIdsByClassGroupId(classGroup.getId(), null, null);
             //获取班级关联的学员列表
-            Set<Integer> studentIds = classGroupStudentMapperDao.queryStudentIdsByClassGroupId(classGroup.getId(),null,null);
+            Set<Integer> studentIds = classGroupStudentMapperDao.queryStudentIdsByClassGroupId(classGroup.getId(), null, null);
             //创建IM群组
             classGroupService.addImGroup(classGroup, new ArrayList<>(studentIds), new ArrayList<>(teacherIds));
         }
-        imUserFriendService.refreshGroupImUserFriend(musicGroupId,GroupType.MUSIC);
+        imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
         //给老师发送乐团成立通知
         Map<Integer, String> map = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(musicGroupDao.queryTeacherIdMap(musicGroupId))), HashMap.class);
         if (map != null && map.size() > 0) {
@@ -1273,20 +1275,20 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 预报名)", sysUser.getId(), ""));
         musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
         musicGroupDao.update(musicGroup);
-        
+
         // 创建群
         imGroupService.create(Long.parseLong(musicGroupId), null, "乐团预报名", null, musicGroup.getName(), musicGroup.getName(), null, GroupType.MUSIC.getCode());
-        
-        Map<Integer,String> userRoleMap = new HashMap<Integer, String>();
-        
-        if(musicGroup.getTeamTeacherId() != null){
-        	userRoleMap.put(musicGroup.getTeamTeacherId(), "运营主管");
+
+        Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
+
+        if (musicGroup.getTeamTeacherId() != null) {
+            userRoleMap.put(musicGroup.getTeamTeacherId(), "运营主管");
         }
-        if(musicGroup.getEducationalTeacherId() != null){
-        	userRoleMap.put(musicGroup.getEducationalTeacherId(), "乐团主管");
+        if (musicGroup.getEducationalTeacherId() != null) {
+            userRoleMap.put(musicGroup.getEducationalTeacherId(), "乐团主管");
         }
-        if(musicGroup.getDirectorUserId() != null){
-        	userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
+        if (musicGroup.getDirectorUserId() != null) {
+            userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
         }
         // 添加成员
         imGroupMemberService.join(Long.parseLong(musicGroupId), userRoleMap);
@@ -1659,8 +1661,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     }
 
     @Override
-	public boolean extensionPreApplyExpireDate(String musicGroupId, Date expireDate) {
-    	SysUser sysUser = sysUserFeignService.queryUserInfo();
+    public boolean extensionPreApplyExpireDate(String musicGroupId, Date expireDate) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
@@ -1684,9 +1686,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupDao.update(musicGroup);
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "延长预报名时间", sysUser.getId(), ""));
         return true;
-	}
+    }
 
-	@Override
+    @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public boolean applyQuitMusicGroup(String musicGroupId, String reason) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -1753,9 +1755,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup == null) {
             throw new BizException("乐团不存在");
         }
-		if (musicGroupQuit.getStatus() != ApprovalStatus.PROCESSING) {
-			throw new BizException("当前状态下不能取消");
-		}
+        if (musicGroupQuit.getStatus() != ApprovalStatus.PROCESSING) {
+            throw new BizException("当前状态下不能取消");
+        }
         musicGroupQuit.setStatus(ApprovalStatus.CANCELED);
         musicGroupQuit.setReason(reason);
         musicGroupQuit.setQuitDate(new Date());
@@ -1791,12 +1793,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("申请失败,乐团状态[已取消]或[已暂停]");
         }
 
-		// 有进行中的课程不能退团
-		List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
-				"UNDERWAY", userId);
-		if (courseScheduleList != null && courseScheduleList.size() > 0) {
-			throw new BizException("退团失败,存在[进行中]的课程");
-		}
+        // 有进行中的课程不能退团
+        List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
+                "UNDERWAY", userId);
+        if (courseScheduleList != null && courseScheduleList.size() > 0) {
+            throw new BizException("退团失败,存在[进行中]的课程");
+        }
 
         musicGroupQuit.setStatus(status);
         musicGroupQuit.setReason(reason);
@@ -1835,7 +1837,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             studentRegistrationDao.update(studentRegistration);
 
             //更新服务指标、运营指标
-            int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
+            /*int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
             if (remainCourseNum == 0) {
                 Student student = studentDao.get(userId);
                 if (student == null) {
@@ -1846,31 +1848,31 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 student.setOperatingTempTag(0);
                 student.setUpdateTime(date);
                 studentDao.update(student);
-            }
+            }*/
 
             //删除进行中加学生,且在审批中或拒绝的缴费
             List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
-            if(paymentCalenderIdList != null && paymentCalenderIdList.size() > 0){
-            	musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+            if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
+                musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
             }
-            
+
             //查询未交费的项目
             List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
-            
-			for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
-				MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
-				if (mgpc != null) {
-					if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
-						musicGroupPaymentCalenderDao.delete(mgpc.getId());
-					} else {
-						// 缴费项目预计人数减一
-						mgpc.setExpectNum(mgpc.getExpectNum() - 1);
-						mgpc.setUpdateTime(date);
-						musicGroupPaymentCalenderDao.update(mgpc);
-					}
-				}
-				musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
-			}
+
+            for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
+                MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+                if (mgpc != null) {
+                    if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
+                        musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                    } else {
+                        // 缴费项目预计人数减一
+                        mgpc.setExpectNum(mgpc.getExpectNum() - 1);
+                        mgpc.setUpdateTime(date);
+                        musicGroupPaymentCalenderDao.update(mgpc);
+                    }
+                }
+                musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
+            }
             //删除用户购买的课程记录
             musicGroupPaymentStudentCourseDetailDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
 
@@ -1883,11 +1885,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 musicGroupSubjectPlan.setUpdateTime(date);
                 musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
             }
-            
-            if(currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL){
-            	return true;
+
+            if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
+                return true;
             }
-            
+
             if (isRefundCourseFee) {
                 // 退课程费用
                 amount = amount.add(surplusCourseFee);
@@ -1896,7 +1898,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
 
             if (studentPaymentOrder != null) {
-            	List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
+                List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
 
                 SubjectChange studentLastChange = null;
                 if (isRefundInstrumentFee || isRefundTeachingAssistantsFee) {
@@ -1932,7 +1934,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 }
             }
 
-            
+
             if (amount.doubleValue() > 0) {
                 // 增加交易流水
                 sysUserCashAccountDetailService.addCashAccountDetail(userId, amount, SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "",
@@ -1959,12 +1961,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("退团失败,乐团状态[已取消]或[已暂停]");
         }
 
-		// 有进行中的课程不能退团
-		List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
-				"UNDERWAY", userId);
-		if (courseScheduleList != null && courseScheduleList.size() > 0) {
-			throw new BizException("退团失败,存在[进行中]的课程");
-		}
+        // 有进行中的课程不能退团
+        List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
+                "UNDERWAY", userId);
+        if (courseScheduleList != null && courseScheduleList.size() > 0) {
+            throw new BizException("退团失败,存在[进行中]的课程");
+        }
 
         courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), Arrays.asList(userId), GroupType.MUSIC);
 
@@ -1972,7 +1974,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
         if (studentRegistration == null) {
             throw new BizException("用户注册信息不存在");
-		}
+        }
 
         Date date = new Date();
 
@@ -2010,7 +2012,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentRegistrationDao.update(studentRegistration);
 
         //更新服务指标、运营指标
-        int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
+        /*int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
         if (remainCourseNum == 0) {
             Student student = studentDao.get(userId);
             if (student == null) {
@@ -2021,34 +2023,34 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             student.setOperatingTempTag(0);
             student.setUpdateTime(date);
             studentDao.update(student);
-        }
+        }*/
 
         //删除进行中加学生,且在审批中或拒绝的缴费
         List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
-        if(paymentCalenderIdList != null && paymentCalenderIdList.size() > 0){
-        	musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+        if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
+            musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
         }
-        
+
         //查询未交费的项目
         List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
-        
-		for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
-			MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
-			if (mgpc != null) {
-				if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
-					musicGroupPaymentCalenderDao.delete(mgpc.getId());
-				} else {
-					// 缴费项目预计人数减一
-					mgpc.setExpectNum(mgpc.getExpectNum() - 1);
-					mgpc.setUpdateTime(date);
-					musicGroupPaymentCalenderDao.update(mgpc);
-				}
-			}
-			musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
-		}
+
+        for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
+            MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+            if (mgpc != null) {
+                if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
+                    musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                } else {
+                    // 缴费项目预计人数减一
+                    mgpc.setExpectNum(mgpc.getExpectNum() - 1);
+                    mgpc.setUpdateTime(date);
+                    musicGroupPaymentCalenderDao.update(mgpc);
+                }
+            }
+            musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
+        }
         //删除用户购买的课程记录
         musicGroupPaymentStudentCourseDetailDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
-        
+
         BigDecimal amount = new BigDecimal(0);
 
         // 判断乐器是否是租赁
@@ -2058,11 +2060,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             musicGroupSubjectPlan.setUpdateTime(date);
             musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
         }
-        
-        if(currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL){
-        	return true;
+
+        if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
+            return true;
         }
-        
+
         if (isRefundCourseFee) {
             // 退课程费用
             amount = amount.add(surplusCourseFee);
@@ -2071,7 +2073,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
 
         if (studentPaymentOrder != null) {
-        	List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
+            List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
 
             SubjectChange studentLastChange = null;
             if (isRefundInstrumentFee || isRefundTeachingAssistantsFee) {
@@ -2107,7 +2109,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
-        
+
         if (amount.doubleValue() > 0) {
             // 增加交易流水
             sysUserCashAccountDetailService.addCashAccountDetail(userId, amount, SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "",
@@ -2271,7 +2273,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
             //如果是进行中加学员
             MusicGroupPaymentCalender paymentCalender = musicGroupPaymentCalenderDao.get(calenderDetail.getMusicGroupPaymentCalenderId());
-            if(paymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
+            if (paymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT) {
                 studentRegistration.setPaymentStatus(YES);
                 studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
                 studentRegistrationDao.update(studentRegistration);
@@ -2305,7 +2307,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             List<StudentPaymentOrderDetail> paymentOrderDetails = new ArrayList<>();
             List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderDetail.getMusicGroupPaymentCalenderId());
             //跨团合班没有settings
-            if(courseSettings.size() == 0){
+            if (courseSettings.size() == 0) {
                 List<MusicGroupPaymentCalenderStudentDetail> studentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNoAndUserId(paymentCalender.getBatchNo(), userId);
                 for (MusicGroupPaymentCalenderStudentDetail studentDetail : studentDetails) {
                     StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
@@ -2316,7 +2318,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
                     paymentOrderDetails.add(studentPaymentOrderDetail);
                 }
-            }else {
+            } else {
                 courseSettings.forEach(e -> {
                     StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
                     studentPaymentOrderDetail.setType(OrderDetailTypeEnum.valueOf(e.getCourseType().getCode()));
@@ -2327,7 +2329,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     paymentOrderDetails.add(studentPaymentOrderDetail);
                 });
             }
-            if(paymentOrderDetails.size() > 0){
+            if (paymentOrderDetails.size() > 0) {
                 studentPaymentOrderDetailService.batchAdd(paymentOrderDetails);
             }
 
@@ -2385,9 +2387,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (courseSchedule == null) {
             throw new BizException("课程信息不存在");
         }
-        
-        if(salary == null){
-        	throw new BizException("请设置老师课酬");
+
+        if (salary == null) {
+            throw new BizException("请设置老师课酬");
         }
 
         if ("all".equals(scope)) {
@@ -2519,7 +2521,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         Integer teamTeacherId = newMusicGroup.getTeamTeacherId();
         Integer educationalTeacherId = newMusicGroup.getEducationalTeacherId();
-        
+
         Integer oldDirectorUserId = oldMusicGroup.getDirectorUserId();
         if (oldDirectorUserId == null) {
             oldDirectorUserId = teamTeacherId;
@@ -2534,14 +2536,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         quitUserIdList.add(oldMusicGroup.getEducationalTeacherId());
         quitUserIdList.add(oldDirectorUserId);
 
-        Map<Integer,String> userRoleMap = new HashMap<Integer, String>();
+        Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
         userRoleMap.put(directorUserId, "乐队指导");
         userRoleMap.put(educationalTeacherId, "乐团主管");
         userRoleMap.put(teamTeacherId, "运营主管");
 
         classGroups.forEach(e -> {
-        	imGroupMemberService.quit(e.getId().longValue(), quitUserIdList);
-        	imGroupMemberService.join(e.getId().longValue(), userRoleMap);
+            imGroupMemberService.quit(e.getId().longValue(), quitUserIdList);
+            imGroupMemberService.join(e.getId().longValue(), userRoleMap);
         });
     }
 
@@ -2569,7 +2571,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             //如果已生成课表,那么修改未上课时教学点
             courseScheduleDao.updateCourseScheduleSchool("MUSIC", musicGroupId, musicGroup.getSchoolId());
         }
-        if(group.getStatus() == MusicGroupStatusEnum.PROGRESS){
+        if (group.getStatus() == MusicGroupStatusEnum.PROGRESS) {
             updateTeamTeacher(group, musicGroup);
         }
 
@@ -2597,8 +2599,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (subFeeSettingDto.getMusicGroupPaymentEntities() != null && subFeeSettingDto.getMusicGroupPaymentEntities().size() > 0) {
             musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(), musicGroupId);
         }
-        if(group.getStatus() == MusicGroupStatusEnum.PROGRESS){
-            imUserFriendService.refreshGroupImUserFriend(musicGroupId,GroupType.MUSIC);
+        if (group.getStatus() == MusicGroupStatusEnum.PROGRESS) {
+            imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
         }
         //记录操作日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "修改乐团基本信息数据", sysUser.getId(), JSONObject.toJSONString(subFeeSettingDto)));
@@ -2810,7 +2812,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             hasUsers.add(studentRegistration.getUserId());
             newRegs.add(studentRegistration);
         }
-        if(registerIds.size() >0 && newRegs.size()<=0){
+        if (registerIds.size() > 0 && newRegs.size() <= 0) {
             throw new BizException("添加的学员,乐团已存在");
         }
         studentRegistrations = newRegs;
@@ -2883,7 +2885,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //有进行中的课不能关闭乐团
         Integer underwayCourseNum = courseScheduleDao.getUnderwayCourseNum(musicGroup.getId(), GroupType.MUSIC, CourseStatusEnum.UNDERWAY);
-        if(underwayCourseNum >0){
+        if (underwayCourseNum > 0) {
             throw new BizException("乐团有进行的课程,不能关闭");
         }
         musicGroup.setStatus(MusicGroupStatusEnum.CLOSE);

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

@@ -110,7 +110,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
                 if (!appendCourseBalance) {
                     throw new BizException("增加用户课程余额失败");
                 }
-            } else if (info.getChargeType().getCode() == 9 || info.getChargeType().getCode() == 13) { //零星收费账户充值,网基课活动
+            } else if (info.getChargeType().getCode() == 9 || info.getChargeType().getCode() == 13 || info.getChargeType().getCode() == 14) { //零星收费账户充值,网基课活动,关心包
                 sysUserCashAccountService.updateBalance(userId, studentPaymentOrder.getActualAmount(), PlatformCashAccountDetailTypeEnum.RECHARGE, "零星收费"+info.getChargeType().getMsg(), studentPaymentOrder.getTransNo());
             } else if (info.getOrganId().equals(42) && info.getChargeType().equals(SporadicChargeTypeEnum.LEVEL)) {
                 degreeRegistrationService.updateStatus(studentPaymentOrder);

+ 4 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -541,15 +541,13 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
 
         if(!CollectionUtils.isEmpty(results)){
-
-            if(CollectionUtils.isEmpty(studentIds)){
-                studentIds = results.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
-            }
+            List<Integer> allStudentIds = new ArrayList<>();
+            allStudentIds = results.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
 
             Map<Integer, List<StudentServeCourseHomeworkDto>> studentHomeworkMap=new HashMap<>();
             Map<Integer, List<ExtracurricularExercisesReply>> studentExercisesMap=new HashMap<>();
 
-            List<StudentServeCourseHomeworkDto> allStudentHomeworks = studentCourseHomeworkDao.findStudentHomeworkWithCourseDateRange(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(studentIds));
+            List<StudentServeCourseHomeworkDto> allStudentHomeworks = studentCourseHomeworkDao.findStudentHomeworkWithCourseDateRange(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(allStudentIds));
             List<StudentServeCourseHomeworkDto> studentHomeworksTmp =new ArrayList<>();
             for (StudentServeCourseHomeworkDto studentHomework : allStudentHomeworks) {
                 LocalDate courseStartLocalDate = LocalDateTime.ofInstant(studentHomework.getCourseStartTime().toInstant(), DateUtil.zoneId).toLocalDate();
@@ -578,7 +576,7 @@ public class StudentServeServiceImpl implements StudentServeService {
             }
 
 
-            List<ExtracurricularExercisesReply> allStudentExercises = extracurricularExercisesReplyDao.getStudentExercisesWithTimeZone(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(studentIds));
+            List<ExtracurricularExercisesReply> allStudentExercises = extracurricularExercisesReplyDao.getStudentExercisesWithTimeZone(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(allStudentIds));
             if(!CollectionUtils.isEmpty(allStudentExercises)){
                 studentExercisesMap = allStudentExercises.stream().collect(Collectors.groupingBy(ExtracurricularExercisesReply::getUserId));
             }

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

@@ -621,7 +621,7 @@
 		FROM
 			inspection_item_plan
 		WHERE
-			conclusion_status_ = 0
+			conclusion_status_ = 1
 		<if test="organIds!=null and organIds.size()>0">
 			AND organ_id_ IN
 			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">

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

@@ -712,7 +712,7 @@
         SELECT DISTINCT sr.user_id_, mg.id_ group_id_, mg.name_ group_name_
         FROM student_registration sr
         LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
-        WHERE sr.payment_status_=2 AND sr.user_id_ IN
+        WHERE sr.payment_status_=2 AND sr.music_group_status_ = 'NORMAL' AND sr.user_id_ IN
         <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
             #{userId}
         </foreach>

+ 5 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1126,7 +1126,9 @@ public class ExportController extends BaseController {
                 } else {
                     if(row.getChargeType() != null && SporadicChargeTypeEnum.LEVEL.getCode().equals(row.getChargeType())){
                         row.setDegreeFee(row.getActualAmount());
-                    }else {
+                    }else if(row.getChargeType() != null && SporadicChargeTypeEnum.PRACTICE_GROUP_BUY.getCode().equals(row.getChargeType())){
+                        row.setPracticeCourseFee(row.getActualAmount());
+                    } else {
                         row.setOtherFee(row.getActualAmount());
                     }                }
                 if (row.getChargeType() != null) {
@@ -2258,6 +2260,8 @@ public class ExportController extends BaseController {
                 } else {
                     if(row.getChargeType() != null && SporadicChargeTypeEnum.LEVEL.getCode().equals(row.getChargeType())){
                         row.setDegreeFee(row.getActualAmount());
+                    }else if(row.getChargeType() != null && SporadicChargeTypeEnum.PRACTICE_GROUP_BUY.getCode().equals(row.getChargeType())){
+                        row.setPracticeCourseFee(row.getActualAmount());
                     }else {
                         row.setOtherFee(row.getActualAmount());
                     }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -92,7 +92,7 @@ public class VipGroupManageController extends BaseController {
                 throw new BizException("课程信息错误");
             }
             if(classGroup.getStudentNum()<3){
-                throw new BizException("班级任务尚未达到3人");
+                throw new BizException("班级人数未达到3人");
             }
         }
         vipGroupService.update(vipGroup);