|
@@ -9,6 +9,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -21,37 +22,6 @@ import com.alibaba.fastjson.TypeReference;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.auth.api.entity.SysUserRole;
|
|
|
-import com.ym.mec.biz.dal.dao.ChargeTypeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
|
|
|
-import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
|
|
|
-import com.ym.mec.biz.dal.dao.CooperationOrganDao;
|
|
|
-import com.ym.mec.biz.dal.dao.CourseScheduleDao;
|
|
|
-import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
|
|
|
-import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
|
|
|
-import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPurchaseListDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
|
|
|
-import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SchoolDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SubjectChangeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
-import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
|
|
|
-import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
import com.ym.mec.biz.dal.dto.CourseFormDto;
|
|
|
import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
|
|
@@ -259,6 +229,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
|
@Autowired
|
|
|
private SubjectChangeDao subjectChangeDao;
|
|
|
+ @Autowired
|
|
|
+ private StudentVisitDao studentVisitDao;
|
|
|
|
|
|
private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
@@ -1602,19 +1574,19 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentRegistration.setUpdateTime(date);
|
|
|
|
|
|
studentRegistrationDao.update(studentRegistration);
|
|
|
-
|
|
|
+
|
|
|
//更新服务指标、运营指标
|
|
|
int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
|
|
|
- if(remainCourseNum == 0){
|
|
|
- Student student = studentDao.get(userId);
|
|
|
- if(student == null){
|
|
|
- throw new BizException("学生信息查询失败");
|
|
|
- }
|
|
|
- student.setServiceTag(0);
|
|
|
- student.setOperatingTag(0);
|
|
|
- student.setOperatingTempTag(0);
|
|
|
- student.setUpdateTime(date);
|
|
|
- studentDao.update(student);
|
|
|
+ if (remainCourseNum == 0) {
|
|
|
+ Student student = studentDao.get(userId);
|
|
|
+ if (student == null) {
|
|
|
+ throw new BizException("学生信息查询失败");
|
|
|
+ }
|
|
|
+ student.setServiceTag(0);
|
|
|
+ student.setOperatingTag(0);
|
|
|
+ student.setOperatingTempTag(0);
|
|
|
+ student.setUpdateTime(date);
|
|
|
+ studentDao.update(student);
|
|
|
}
|
|
|
|
|
|
//删除用户购买的课程记录
|
|
@@ -1625,11 +1597,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
BigDecimal price = courseScheduleStudentPaymentDao.countFinishCoursePriceWithMusicGroup(musicGroupId, GroupType.MUSIC, userId);
|
|
|
BigDecimal subtractAmount = studentRegistration.getSurplusCourseFee();
|
|
|
- if(Objects.isNull(price)){
|
|
|
+ if (Objects.isNull(price)) {
|
|
|
price = new BigDecimal(0);
|
|
|
}
|
|
|
subtractAmount = subtractAmount.subtract(price);
|
|
|
- if(BigDecimal.ZERO.compareTo(subtractAmount)<0){
|
|
|
+ if (BigDecimal.ZERO.compareTo(subtractAmount) < 0) {
|
|
|
studentRegistrationService.updateUserSurplusCourseFee(userId, musicGroupId, subtractAmount.negate(), reason, operator.getId());
|
|
|
}
|
|
|
|
|
@@ -1637,10 +1609,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
// 判断乐器是否是租赁
|
|
|
MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
|
|
|
- if(musicGroupSubjectPlan != null){
|
|
|
- musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
- musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
- musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
|
+ if (musicGroupSubjectPlan != null) {
|
|
|
+ musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
+ musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
+ musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
|
}
|
|
|
|
|
|
StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
@@ -1752,21 +1724,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
studentRegistration.setUpdateTime(date);
|
|
|
|
|
|
studentRegistrationDao.update(studentRegistration);
|
|
|
-
|
|
|
+
|
|
|
//更新服务指标、运营指标
|
|
|
int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
|
|
|
- if(remainCourseNum == 0){
|
|
|
- Student student = studentDao.get(userId);
|
|
|
- if(student == null){
|
|
|
- throw new BizException("学生信息查询失败");
|
|
|
- }
|
|
|
- student.setServiceTag(0);
|
|
|
- student.setOperatingTag(0);
|
|
|
- student.setOperatingTempTag(0);
|
|
|
- student.setUpdateTime(date);
|
|
|
- studentDao.update(student);
|
|
|
- }
|
|
|
-
|
|
|
+ if (remainCourseNum == 0) {
|
|
|
+ Student student = studentDao.get(userId);
|
|
|
+ if (student == null) {
|
|
|
+ throw new BizException("学生信息查询失败");
|
|
|
+ }
|
|
|
+ student.setServiceTag(0);
|
|
|
+ student.setOperatingTag(0);
|
|
|
+ student.setOperatingTempTag(0);
|
|
|
+ student.setUpdateTime(date);
|
|
|
+ studentDao.update(student);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//删除用户购买的课程记录
|
|
|
musicGroupPaymentStudentCourseDetailDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
@@ -1776,11 +1748,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
BigDecimal price = courseScheduleStudentPaymentDao.countFinishCoursePriceWithMusicGroup(musicGroupId, GroupType.MUSIC, userId);
|
|
|
BigDecimal subtractAmount = studentRegistration.getSurplusCourseFee();
|
|
|
- if(Objects.isNull(price)){
|
|
|
+ if (Objects.isNull(price)) {
|
|
|
price = new BigDecimal(0);
|
|
|
}
|
|
|
subtractAmount = subtractAmount.subtract(price);
|
|
|
- if(BigDecimal.ZERO.compareTo(subtractAmount)<0){
|
|
|
+ if (BigDecimal.ZERO.compareTo(subtractAmount) < 0) {
|
|
|
studentRegistrationService.updateUserSurplusCourseFee(userId, musicGroupId, subtractAmount.negate(), reason, operator.getId());
|
|
|
}
|
|
|
|
|
@@ -1788,10 +1760,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
// 判断乐器是否是租赁
|
|
|
MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
|
|
|
- if(musicGroupSubjectPlan != null){
|
|
|
- musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
- musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
- musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
|
+ if (musicGroupSubjectPlan != null) {
|
|
|
+ musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
+ musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
+ musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
|
}
|
|
|
|
|
|
StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
@@ -1853,12 +1825,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
//缴费项目预计人数减一
|
|
|
- musicGroupPaymentCalenderDao.cutCalenderExpectNum(userId,musicGroupId);
|
|
|
+ musicGroupPaymentCalenderDao.cutCalenderExpectNum(userId, musicGroupId);
|
|
|
//删除缴费项目
|
|
|
- List<Long> calenderIds = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId,musicGroupId);
|
|
|
+ List<Long> calenderIds = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
|
|
|
//删除缴费项目详情
|
|
|
musicGroupPaymentCalenderDetailDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
|
- if(calenderIds != null && calenderIds.size() > 0){
|
|
|
+ if (calenderIds != null && calenderIds.size() > 0) {
|
|
|
musicGroupPaymentCalenderDao.delByIds(calenderIds);
|
|
|
}
|
|
|
return true;
|
|
@@ -2073,7 +2045,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, yimei, null, 0, "1", "",
|
|
|
studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
|
|
|
}
|
|
|
- studentRegistrationService.updateUserSurplusCourseFee(userId,musicGroupId,studentPaymentOrder.getExpectAmount(),"乐团续费",userId);
|
|
|
+ studentRegistrationService.updateUserSurplusCourseFee(userId, musicGroupId, studentPaymentOrder.getExpectAmount(), "乐团续费", userId);
|
|
|
return true;
|
|
|
} else {
|
|
|
if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().doubleValue() > 0) {
|
|
@@ -2275,11 +2247,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
if (group == null) {
|
|
|
throw new BizException("乐团信息不存在");
|
|
|
}
|
|
|
-
|
|
|
- if (!(group.getStatus() == MusicGroupStatusEnum.DRAFT || group.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED
|
|
|
- || group.getStatus() == MusicGroupStatusEnum.PROGRESS)) {
|
|
|
- throw new BizException("当前乐团状态不能修改基本信息");
|
|
|
- }
|
|
|
+
|
|
|
+ if (!(group.getStatus() == MusicGroupStatusEnum.DRAFT || group.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED
|
|
|
+ || group.getStatus() == MusicGroupStatusEnum.PROGRESS)) {
|
|
|
+ throw new BizException("当前乐团状态不能修改基本信息");
|
|
|
+ }
|
|
|
|
|
|
MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
|
|
|
musicGroup.setStatus(group.getStatus());
|
|
@@ -2300,9 +2272,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
|
|
|
if (regCalender != null) {
|
|
|
musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
|
|
|
-
|
|
|
+
|
|
|
List<Long> calenderIds = new ArrayList<Long>();
|
|
|
- calenderIds.add(regCalender.getId());
|
|
|
+ calenderIds.add(regCalender.getId());
|
|
|
musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
|
|
|
}
|
|
|
}
|
|
@@ -2401,7 +2373,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<CourseScheduleTeachersDto> queryTeacherSalary(Long courseScheduleId,Integer teacherId) {
|
|
|
+ public List<CourseScheduleTeachersDto> queryTeacherSalary(Long courseScheduleId, Integer teacherId) {
|
|
|
return courseScheduleTeacherSalaryDao.queryTeacherSalary(courseScheduleId, teacherId);
|
|
|
}
|
|
|
|
|
@@ -2507,6 +2479,25 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
} else {
|
|
|
throw new BizException("当前乐团状态不支持此操作");
|
|
|
}
|
|
|
+ //报名未交费的学生,完成回访才能到下一步
|
|
|
+ boolean hasNoVisit = false;
|
|
|
+ StringBuilder tipsMsg = new StringBuilder();
|
|
|
+ List<StudentRegistration> noPaymentStudents = studentRegistrationDao.getNoPaymentStudent(musicGroupId);
|
|
|
+ if (noPaymentStudents.size() > 0) {
|
|
|
+ tipsMsg.append("以下学生未完成回访,");
|
|
|
+ List<Integer> studentIds = noPaymentStudents.stream().map(StudentRegistration::getUserId).collect(Collectors.toList());
|
|
|
+ List<Integer> musicGroupVisitStudent = studentVisitDao.getMusicGroupVisitStudent(musicGroupId, studentIds);
|
|
|
+ for (StudentRegistration noPaymentStudent : noPaymentStudents) {
|
|
|
+ if (!musicGroupVisitStudent.contains(noPaymentStudent.getUserId())) {
|
|
|
+ hasNoVisit = true;
|
|
|
+ tipsMsg.append(noPaymentStudent.getName()).append("(").append(noPaymentStudent.getUserId()).append(")、");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (hasNoVisit) {
|
|
|
+ throw new BizException(tipsMsg.append("请完成回访").toString());
|
|
|
+ }
|
|
|
+
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, event, sysUser.getId(), ""));
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.PREPARE);
|
|
|
musicGroupDao.update(musicGroup);
|