|
@@ -26,15 +26,14 @@ import com.ym.mec.common.service.IdGeneratorService;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
-import com.ym.mec.util.date.DateUtil;
|
|
|
|
|
|
+
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -121,6 +120,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
private VipGroupActivityDao vipGroupActivityDao;
|
|
private VipGroupActivityDao vipGroupActivityDao;
|
|
@Autowired
|
|
@Autowired
|
|
private OperatingReportCloudService operatingReportCloudService;
|
|
private OperatingReportCloudService operatingReportCloudService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MusicGroupCalenderRefundPeriodService musicGroupCalenderRefundPeriodService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ImGroupService imGroupService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ImGroupMemberService imGroupMemberService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
|
|
public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
|
|
@@ -238,16 +243,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
throw new BizException("请登录");
|
|
throw new BizException("请登录");
|
|
});
|
|
});
|
|
|
|
|
|
- if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS && musicGroup.getStatus() != MusicGroupStatusEnum.PRE_BUILD_FEE) {
|
|
|
|
- throw new BizException("创建缴费失败:已存在缴费项目");
|
|
|
|
- }
|
|
|
|
- // 所有缴费项目已完成排课才能创建下一个缴费项目
|
|
|
|
- String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null, null);
|
|
|
|
- if (!musicGroupPaymentBaseCalender.getConfirmCreate() && StringUtils.isNoneBlank(orignBatchNo)) {
|
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
|
- return BaseController.failed(HttpStatus.MULTI_STATUS,"当前乐团存在未排课的缴费项目,请再次确认操作");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// 不是进行中,只能创建一次缴费
|
|
// 不是进行中,只能创建一次缴费
|
|
if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
|
|
if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
|
|
List<MusicGroupPaymentCalender> list = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
|
|
List<MusicGroupPaymentCalender> list = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
|
|
@@ -258,12 +253,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
//进行中加学员拓展信息
|
|
//进行中加学员拓展信息
|
|
CalenderAddStudent calenderAddStudent = musicGroupPaymentBaseCalender.getCalenderAddStudent();
|
|
CalenderAddStudent calenderAddStudent = musicGroupPaymentBaseCalender.getCalenderAddStudent();
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
|
|
+ BeanUtils.copyProperties(musicGroupPaymentBaseCalender,musicGroupPaymentCalender);
|
|
//判断缴费项目类型
|
|
//判断缴费项目类型
|
|
- if (musicGroup.getStatus() == MusicGroupStatusEnum.PRE_BUILD_FEE) {
|
|
|
|
- musicGroupPaymentBaseCalender.setPaymentType(MUSIC_APPLY);
|
|
|
|
|
|
+ if (musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED || musicGroup.getStatus() == MusicGroupStatusEnum.FEE_AUDIT_FAILED) {
|
|
|
|
+ musicGroupPaymentCalender.setPaymentType(MUSIC_APPLY);
|
|
} else {
|
|
} else {
|
|
if (calenderAddStudent != null && calenderAddStudent.getStudentIds() != null) {
|
|
if (calenderAddStudent != null && calenderAddStudent.getStudentIds() != null) {
|
|
- musicGroupPaymentBaseCalender.setPaymentType(ADD_STUDENT);
|
|
|
|
|
|
+ musicGroupPaymentCalender.setPaymentType(ADD_STUDENT);
|
|
//预计缴费人数
|
|
//预计缴费人数
|
|
musicGroupPaymentCalender.setAttribute1(calenderAddStudent.getClassGroupIds());
|
|
musicGroupPaymentCalender.setAttribute1(calenderAddStudent.getClassGroupIds());
|
|
musicGroupPaymentCalender.setStudentIds(calenderAddStudent.getStudentIds().toString());
|
|
musicGroupPaymentCalender.setStudentIds(calenderAddStudent.getStudentIds().toString());
|
|
@@ -272,9 +268,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
checkAddStudent(calenderAddStudent, musicGroup);
|
|
checkAddStudent(calenderAddStudent, musicGroup);
|
|
} else {
|
|
} else {
|
|
if (musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId() != null) {
|
|
if (musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId() != null) {
|
|
- musicGroupPaymentBaseCalender.setPaymentType(MUSIC_RENEW);
|
|
|
|
|
|
+ musicGroupPaymentCalender.setPaymentType(MUSIC_RENEW);
|
|
} else {
|
|
} else {
|
|
- musicGroupPaymentBaseCalender.setPaymentType(ADD_COURSE);
|
|
|
|
|
|
+ musicGroupPaymentCalender.setPaymentType(ADD_COURSE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -299,10 +295,29 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
BigDecimal actualTotalAmount = courseActualAmount.add(memberActualAmount)
|
|
BigDecimal actualTotalAmount = courseActualAmount.add(memberActualAmount)
|
|
.add(repairActualAmount)
|
|
.add(repairActualAmount)
|
|
.add(activityActualAmount).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
.add(activityActualAmount).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
+ //标记是否云教练缴费
|
|
|
|
+ if(musicGroupPaymentCalender.getPayUserType() == STUDENT && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
|
+ if(musicGroupPaymentCalender.getPaymentType() == ADD_STUDENT){
|
|
|
|
+ musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
|
|
|
|
+ }else if(memberActualAmount.compareTo(BigDecimal.ZERO) > 0 &&
|
|
|
|
+ ((courseActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList()))
|
|
|
|
+ || (activityActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getCalenderActivityList())))) {
|
|
|
|
+ musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(musicGroupPaymentBaseCalender.getPayUserType() == SCHOOL){
|
|
|
|
+ actualTotalAmount = musicGroupPaymentBaseCalender.getCurrentTotalAmount();
|
|
|
|
+ }
|
|
|
|
|
|
PaymentCalenderStatusEnum status;
|
|
PaymentCalenderStatusEnum status;
|
|
- if (musicGroupPaymentBaseCalender.getPayUserType() == SCHOOL) {
|
|
|
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPayUserType() == SCHOOL) {
|
|
status = AUDITING;
|
|
status = AUDITING;
|
|
|
|
+ if(musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY){
|
|
|
|
+ if(musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED){
|
|
|
|
+ status = DRAFT;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
//计算项目原现价
|
|
//计算项目原现价
|
|
BigDecimal courseCurrentAmount = musicGroupPaymentCalenderCourseSettingsService.getCurrentAmount(musicGroupPaymentBaseCalender);
|
|
BigDecimal courseCurrentAmount = musicGroupPaymentCalenderCourseSettingsService.getCurrentAmount(musicGroupPaymentBaseCalender);
|
|
@@ -321,26 +336,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
status = actualTotalAmount.compareTo(currentTotalAmount) == 0 ? NO : AUDITING;
|
|
status = actualTotalAmount.compareTo(currentTotalAmount) == 0 ? NO : AUDITING;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
|
|
|
- musicGroupPaymentCalender.setDeadlinePaymentDate(musicGroupPaymentBaseCalender.getDeadlinePaymentDate());
|
|
|
|
- musicGroupPaymentCalender.setMemo(musicGroupPaymentBaseCalender.getMemo());
|
|
|
|
musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
|
|
musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
|
|
- musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId());
|
|
|
|
- musicGroupPaymentCalender.setPayUserType(musicGroupPaymentBaseCalender.getPayUserType());
|
|
|
|
- musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentBaseCalender.getStartPaymentDate());
|
|
|
|
musicGroupPaymentCalender.setOperator(sysUser.getId());
|
|
musicGroupPaymentCalender.setOperator(sysUser.getId());
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
musicGroupPaymentCalender.setCreateTime(date);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
- musicGroupPaymentCalender.setPaymentType(musicGroupPaymentBaseCalender.getPaymentType());
|
|
|
|
musicGroupPaymentCalender.setCurrentTotalAmount(actualTotalAmount);
|
|
musicGroupPaymentCalender.setCurrentTotalAmount(actualTotalAmount);
|
|
musicGroupPaymentCalender.setOriginalTotalAmount(originalTotalAmount);
|
|
musicGroupPaymentCalender.setOriginalTotalAmount(originalTotalAmount);
|
|
musicGroupPaymentCalender.setStatus(status);
|
|
musicGroupPaymentCalender.setStatus(status);
|
|
musicGroupPaymentCalender.setOrganId(musicGroup.getOrganId());
|
|
musicGroupPaymentCalender.setOrganId(musicGroup.getOrganId());
|
|
- musicGroupPaymentCalender.setPaymentItemShowState(musicGroupPaymentBaseCalender.getPaymentItemShowState());
|
|
|
|
|
|
|
|
- if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
|
|
|
|
+ if (musicGroupPaymentCalender.getStatus() != AUDITING && musicGroupPaymentCalender.getPaymentType() != MUSIC_APPLY) {
|
|
if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
} else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
} else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
@@ -349,52 +356,40 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
// 设置批次号
|
|
// 设置批次号
|
|
String batchNo = idGeneratorService.generatorId() + "";
|
|
String batchNo = idGeneratorService.generatorId() + "";
|
|
musicGroupPaymentCalender.setBatchNo(batchNo);
|
|
musicGroupPaymentCalender.setBatchNo(batchNo);
|
|
- //标记是否云教练缴费
|
|
|
|
- if(musicGroupPaymentCalender.getPayUserType() == STUDENT && musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
|
- if(musicGroupPaymentCalender.getPaymentType() == ADD_STUDENT){
|
|
|
|
- musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
|
|
|
|
- }else if(memberActualAmount.compareTo(BigDecimal.ZERO) > 0 &&
|
|
|
|
- ((courseActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList()))
|
|
|
|
- || (activityActualAmount.compareTo(BigDecimal.ZERO) == 0 && CollectionUtils.isNotEmpty(musicGroupPaymentBaseCalender.getCalenderActivityList())))) {
|
|
|
|
- musicGroupPaymentCalender.setCloudTeacherPaymentFlag(true);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
|
|
+ musicGroupPaymentBaseCalender.setCurrentTotalAmount(musicGroupPaymentCalender.getCurrentTotalAmount());
|
|
|
|
+ musicGroupPaymentBaseCalender.setCalenderId(musicGroupPaymentCalender.getId());
|
|
|
|
+ //如果是学校缴费,需要保存还款周期
|
|
|
|
+ musicGroupCalenderRefundPeriodService.savePeriod(musicGroupPaymentBaseCalender);
|
|
|
|
|
|
|
|
+ //云教练团经营报表相关
|
|
operatingReportCloudService.save(musicGroupPaymentCalender);
|
|
operatingReportCloudService.save(musicGroupPaymentCalender);
|
|
Long calenderId = musicGroupPaymentCalender.getId();
|
|
Long calenderId = musicGroupPaymentCalender.getId();
|
|
//保存会员缴费信息
|
|
//保存会员缴费信息
|
|
MusicGroupPaymentCalenderMember calenderMember = musicGroupPaymentBaseCalender.getCalenderMember();
|
|
MusicGroupPaymentCalenderMember calenderMember = musicGroupPaymentBaseCalender.getCalenderMember();
|
|
if (calenderMember != null) {
|
|
if (calenderMember != null) {
|
|
calenderMember = musicGroupPaymentCalenderMemberService.initBean(calenderMember);
|
|
calenderMember = musicGroupPaymentCalenderMemberService.initBean(calenderMember);
|
|
|
|
+ calenderMember.setActualAmount(memberActualAmount);
|
|
calenderMember.setOriginalAmount(memberOriginalAmount);
|
|
calenderMember.setOriginalAmount(memberOriginalAmount);
|
|
calenderMember.setCalenderId(calenderId);
|
|
calenderMember.setCalenderId(calenderId);
|
|
- if (musicGroupPaymentBaseCalender.getPayUserType() == SCHOOL) {
|
|
|
|
- calenderMember.setActualAmount(BigDecimal.ZERO);
|
|
|
|
- }
|
|
|
|
musicGroupPaymentCalenderMemberService.insert(calenderMember);
|
|
musicGroupPaymentCalenderMemberService.insert(calenderMember);
|
|
}
|
|
}
|
|
//保存乐保缴费信息
|
|
//保存乐保缴费信息
|
|
MusicGroupPaymentCalenderRepair musicRepair = musicGroupPaymentBaseCalender.getMusicRepair();
|
|
MusicGroupPaymentCalenderRepair musicRepair = musicGroupPaymentBaseCalender.getMusicRepair();
|
|
if (musicRepair != null) {
|
|
if (musicRepair != null) {
|
|
musicRepair.setOriginalAmount(repairOriginalAmount);
|
|
musicRepair.setOriginalAmount(repairOriginalAmount);
|
|
|
|
+ musicRepair.setActualAmount(repairActualAmount);
|
|
musicRepair.setCalenderId(calenderId);
|
|
musicRepair.setCalenderId(calenderId);
|
|
- if (musicGroupPaymentBaseCalender.getPayUserType() == SCHOOL) {
|
|
|
|
- musicRepair.setActualAmount(BigDecimal.ZERO);
|
|
|
|
- }
|
|
|
|
musicGroupPaymentCalenderRepairService.insert(musicRepair);
|
|
musicGroupPaymentCalenderRepairService.insert(musicRepair);
|
|
}
|
|
}
|
|
//保存活动缴费信息
|
|
//保存活动缴费信息
|
|
List<MusicGroupPaymentCalenderActivity> calenderActivityList = musicGroupPaymentBaseCalender.getCalenderActivityList();
|
|
List<MusicGroupPaymentCalenderActivity> calenderActivityList = musicGroupPaymentBaseCalender.getCalenderActivityList();
|
|
if (calenderActivityList != null && calenderActivityList.size() > 0) {
|
|
if (calenderActivityList != null && calenderActivityList.size() > 0) {
|
|
musicGroupPaymentCalenderActivityService.initBean(calenderActivityList);
|
|
musicGroupPaymentCalenderActivityService.initBean(calenderActivityList);
|
|
- if (musicGroupPaymentBaseCalender.getPayUserType() == SCHOOL) {
|
|
|
|
- calenderActivityList.forEach(e -> e.setActualAmount(BigDecimal.ZERO));
|
|
|
|
- }
|
|
|
|
musicGroupPaymentCalenderActivityService.batchInsert(musicGroupPaymentBaseCalender, calenderId);
|
|
musicGroupPaymentCalenderActivityService.batchInsert(musicGroupPaymentBaseCalender, calenderId);
|
|
}
|
|
}
|
|
//保存课程费用列表
|
|
//保存课程费用列表
|
|
@@ -402,39 +397,35 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
|
|
musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
// 如果是报名,需要修改乐团状态
|
|
- if (musicGroupPaymentBaseCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
|
- if (status != AUDITING) {
|
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
|
|
|
|
- // 记录操作日志
|
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(创建缴费中 -> 报名中)", sysUser.getId(), ""));
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
|
+ // 记录操作日志
|
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功", sysUser.getId(), ""));
|
|
|
|
+ if(musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED){
|
|
musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
|
|
musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
|
|
- // 记录操作日志
|
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(创建缴费 -> 费用审核中)", sysUser.getId(), ""));
|
|
|
|
}
|
|
}
|
|
|
|
+ musicGroup.setApplyExpireDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
|
|
musicGroup.setUpdateTime(date);
|
|
musicGroup.setUpdateTime(date);
|
|
musicGroupDao.update(musicGroup);
|
|
musicGroupDao.update(musicGroup);
|
|
}
|
|
}
|
|
- if (status == AUDITING) {
|
|
|
|
- // 如果是审核中
|
|
|
|
- Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
|
- sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
|
|
|
|
- null, null, MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, organization.getName(), musicGroup.getName());
|
|
|
|
- } else {
|
|
|
|
- if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
|
- addStudent(musicGroupPaymentCalender, musicGroup);
|
|
|
|
- //将0元未缴费学员缴费状态更新为已缴费
|
|
|
|
- this.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender, true);
|
|
|
|
- // 学生加到班级
|
|
|
|
- classGroupService.addStudentToClassGroupAndCourseArranging(calenderAddStudent.getStudentIds(), calenderAddStudent.getClassGroupIds(),
|
|
|
|
- batchNo, musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList(), musicGroup);
|
|
|
|
- ExecutorService executor = Executors.newFixedThreadPool(5);
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
- imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
|
|
|
|
- }, executor);
|
|
|
|
- executor.shutdown();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
|
+ sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
|
|
|
|
+ null, null, MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, organization.getName(), musicGroup.getName());
|
|
|
|
+
|
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
|
|
|
|
+ addStudent(musicGroupPaymentCalender, musicGroup);
|
|
|
|
+ //将0元未缴费学员缴费状态更新为已缴费
|
|
|
|
+ this.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender, true);
|
|
|
|
+ // 学生加到班级
|
|
|
|
+ classGroupService.addStudentToClassGroupAndCourseArranging(calenderAddStudent.getStudentIds(), calenderAddStudent.getClassGroupIds(),
|
|
|
|
+ batchNo, musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList(), musicGroup);
|
|
|
|
+ ExecutorService executor = Executors.newFixedThreadPool(5);
|
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
|
+ imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
|
|
|
|
+ }, executor);
|
|
|
|
+ executor.shutdown();
|
|
|
|
+ }
|
|
|
|
+
|
|
ModelMap map = new ModelMap(1);
|
|
ModelMap map = new ModelMap(1);
|
|
map.put("musicGroupPaymentCalenderBatchNo", batchNo);
|
|
map.put("musicGroupPaymentCalenderBatchNo", batchNo);
|
|
return BaseController.succeed(map);
|
|
return BaseController.succeed(map);
|
|
@@ -484,7 +475,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Map<String, Object> getDetail(Long id) {
|
|
public Map<String, Object> getDetail(Long id) {
|
|
- Map<String, Object> result = new HashMap<>(10);
|
|
|
|
|
|
+ Map<String, Object> result = new HashMap<>(11);
|
|
//获取缴费项目详情
|
|
//获取缴费项目详情
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(id);
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(id);
|
|
//统计预计缴费人数
|
|
//统计预计缴费人数
|
|
@@ -497,6 +488,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
if (actualNumMap != null) {
|
|
if (actualNumMap != null) {
|
|
calender.setActualNum(actualNumMap.get(id) == null ? 0 : actualNumMap.get(id).intValue());
|
|
calender.setActualNum(actualNumMap.get(id) == null ? 0 : actualNumMap.get(id).intValue());
|
|
}
|
|
}
|
|
|
|
+ //如果是学校缴费并且金额不为0,返回费用信息
|
|
|
|
+ if (calender.getPayUserType() == SCHOOL && calender.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) > 0){
|
|
|
|
+ result.put("calenderRefundPeriods",musicGroupCalenderRefundPeriodService.findByCalenderId(id));
|
|
|
|
+ }
|
|
|
|
|
|
if (calender.getOrganId() != null) {
|
|
if (calender.getOrganId() != null) {
|
|
Organization organization = organizationDao.get(calender.getOrganId());
|
|
Organization organization = organizationDao.get(calender.getOrganId());
|
|
@@ -629,8 +624,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
musicGroupPaymentCalender.setBatchNo(batchNo);
|
|
musicGroupPaymentCalender.setBatchNo(batchNo);
|
|
musicGroupPaymentCalenderDto.setBatchNo(batchNo);
|
|
musicGroupPaymentCalenderDto.setBatchNo(batchNo);
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
|
|
-// List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
|
|
|
|
-// .getMusicGroupPaymentCalenderCourseSettingsList();
|
|
|
|
|
|
|
|
if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
if (musicGroupPaymentCalender.getStatus() != AUDITING) {
|
|
// 如果是进行中加学生
|
|
// 如果是进行中加学生
|
|
@@ -703,8 +696,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
if (StringUtils.isNoneBlank(studentIdStr)) {
|
|
if (StringUtils.isNoneBlank(studentIdStr)) {
|
|
//当前乐团是否有预排课计划
|
|
//当前乐团是否有预排课计划
|
|
MusicGroupSchoolTermCourseDetail termCourseDetail = musicGroupSchoolTermCourseDetailDao.findByCourseDateAndMusicGroupId(musicGroup.getId(), null, 0);
|
|
MusicGroupSchoolTermCourseDetail termCourseDetail = musicGroupSchoolTermCourseDetailDao.findByCourseDateAndMusicGroupId(musicGroup.getId(), null, 0);
|
|
-// List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
|
|
|
|
-// MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
|
|
|
|
|
|
|
|
List<MusicGroupPaymentCalenderActivity> calenderActivities = musicGroupPaymentCalenderActivityService.findByCalenderId(musicGroupPaymentCalender.getId());
|
|
List<MusicGroupPaymentCalenderActivity> calenderActivities = musicGroupPaymentCalenderActivityService.findByCalenderId(musicGroupPaymentCalender.getId());
|
|
Map<Integer, VipGroupActivity> collect = new HashMap<>();
|
|
Map<Integer, VipGroupActivity> collect = new HashMap<>();
|
|
@@ -787,92 +778,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
//统计变更学员数
|
|
//统计变更学员数
|
|
groupEventSource.musicGroupStudentChangeEvent(musicGroupPaymentCalender.getMusicGroupId(), StudentMusicGroupStatusEnum.NORMAL, new ArrayList<>(Arrays.asList(Integer.parseInt(studentId))));
|
|
groupEventSource.musicGroupStudentChangeEvent(musicGroupPaymentCalender.getMusicGroupId(), StudentMusicGroupStatusEnum.NORMAL, new ArrayList<>(Arrays.asList(Integer.parseInt(studentId))));
|
|
}
|
|
}
|
|
- /*if (musicGroupPaymentCalenderCourseSettingsList != null && musicGroupPaymentCalenderCourseSettingsList.size() > 0) {
|
|
|
|
- // 学生加课程明细
|
|
|
|
- for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
|
|
|
|
- if (courseSettings.getIsStudentOptional() == true) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setCreateTime(date);
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetail.getId());
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setCourseOriginalPrice(courseSettings.getCourseOriginalPrice());
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setCourseCurrentPrice(courseSettings.getCourseCurrentPrice());
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setUpdateTime(date);
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(courseSettings.getCourseTotalMinuties());
|
|
|
|
- musicGroupPaymentStudentCourseDetail.setUserId(Integer.parseInt(studentId));
|
|
|
|
- musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (musicGroupPaymentStudentCourseDetailList.size() > 0) {
|
|
|
|
- musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
|
|
|
|
- }*/
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void autoUpdateMusicGroupStudentFeeStatus() {
|
|
|
|
- Date date = new Date();
|
|
|
|
- String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
|
|
|
|
- // 获取距离缴费开启指定天数后的缴费明细
|
|
|
|
- String configValue = sysConfigDao.findConfigValue("push_payment_detail");
|
|
|
|
- Map<Long, Long> maps = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.queryCalenderByDay(configValue, format));
|
|
|
|
- if (maps != null && maps.size() > 0) {
|
|
|
|
- Set<Long> calenderId = maps.keySet();
|
|
|
|
- List<CalenderPushDto> calenderPushDtos = musicGroupPaymentCalenderDao.getCalenderPushDto(calenderId);
|
|
|
|
- Map<Long, List<CalenderPushDto>> collect = calenderPushDtos.stream().collect(Collectors.groupingBy(CalenderPushDto::getCalenderId));
|
|
|
|
- calenderId.forEach(e -> {
|
|
|
|
- CalenderPushDto calenderPushDto = collect.get(e).get(0);
|
|
|
|
- Map<Integer, String> receivers = new HashMap<>(1);
|
|
|
|
- receivers.put(calenderPushDto.getTeacherId(), calenderPushDto.getTeacherPhone());
|
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SYSTEM_SMS_PUSH_PAYMENT_DETAIL, receivers, null, 0,
|
|
|
|
- null, null, calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate(),
|
|
|
|
- maps.get(e));
|
|
|
|
- Map<Integer, String> receivers1 = new HashMap<>(1);
|
|
|
|
- receivers1.put(calenderPushDto.getTeacherId(), calenderPushDto.getTeacherId().toString());
|
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SYSTEM_SMS_PUSH_PAYMENT_DETAIL, receivers1, null, 0,
|
|
|
|
- null, "SYSTEM", calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate(),
|
|
|
|
- maps.get(e));
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- // 获取离截止还有指定时间的缴费项,并发送推送消息给指定老师
|
|
|
|
- String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
|
|
|
|
- List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format, null);
|
|
|
|
- if (calenderIds != null && calenderIds.size() > 0) {
|
|
|
|
- List<CalenderPushDto> calenderPushDtos = musicGroupPaymentCalenderDao.getCalenderPushDto(calenderIds);
|
|
|
|
- Map<Long, List<CalenderPushDto>> collect = calenderPushDtos.stream().collect(Collectors.groupingBy(CalenderPushDto::getCalenderId));
|
|
|
|
- calenderIds.forEach(e -> {
|
|
|
|
- CalenderPushDto calenderPushDto = collect.get(e).get(0);
|
|
|
|
- Map<Integer, String> receivers = new HashMap<>(1);
|
|
|
|
- receivers.put(calenderPushDto.getTeacherId(), calenderPushDto.getTeacherPhone());
|
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SYSTEM_SMS_PUSH_PAYMENT_CREATE, receivers, null, 0,
|
|
|
|
- null, null, calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate());
|
|
|
|
- Map<Integer, String> receivers1 = new HashMap<>(1);
|
|
|
|
- receivers1.put(calenderPushDto.getTeacherId(), calenderPushDto.getTeacherId().toString());
|
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SYSTEM_SMS_PUSH_PAYMENT_CREATE, receivers1, null, 0,
|
|
|
|
- null, "SYSTEM", calenderPushDto.getMusicGroupName(), calenderPushDto.getPaymentValidStartDate(), calenderPushDto.getPaymentValidEndDate());
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 乐团报名到期,提醒教务老师创建缴费
|
|
|
|
- List<CalenderPushDto> calenderPushDtos = musicGroupPaymentCalenderDao.getMusicCalenderPushDto(configValue1, format);
|
|
|
|
- if (calenderPushDtos != null && calenderPushDtos.size() > 0) {
|
|
|
|
- calenderPushDtos.forEach(e -> {
|
|
|
|
- Map<Integer, String> receivers = new HashMap<>(1);
|
|
|
|
- receivers.put(e.getTeacherId(), e.getTeacherPhone());
|
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SYSTEM_SMS_PUSH_PAYMENT_CREATE, receivers, null, 0,
|
|
|
|
- null, null, e.getMusicGroupName(), e.getPaymentValidStartDate(), e.getPaymentValidEndDate());
|
|
|
|
- Map<Integer, String> receivers1 = new HashMap<>(1);
|
|
|
|
- receivers1.put(e.getTeacherId(), e.getTeacherId().toString());
|
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SYSTEM_SMS_PUSH_PAYMENT_CREATE, receivers1, null, 0,
|
|
|
|
- null, "SYSTEM", e.getMusicGroupName(), e.getPaymentValidStartDate(), e.getPaymentValidEndDate());
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<MusicGroupPaymentCalenderAuditDto> auditList(MusicGroupPaymentCalenderQueryInfo queryInfo) {
|
|
public PageInfo<MusicGroupPaymentCalenderAuditDto> auditList(MusicGroupPaymentCalenderQueryInfo queryInfo) {
|
|
@@ -954,6 +863,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
}
|
|
}
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
|
+
|
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS && musicGroup.getStatus() != MusicGroupStatusEnum.FEE_AUDIT) {
|
|
|
|
+ throw new BizException("当前乐团状态不支持此操作");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(calender.getStatus() != PaymentCalenderStatusEnum.AUDITING){
|
|
|
|
+ throw new BizException("缴费项目不是在审核中状态");
|
|
|
|
+ }
|
|
|
|
+
|
|
for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
|
|
//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
|
|
if (musicGroupPaymentCalender.getPayUserType() == SCHOOL) {
|
|
if (musicGroupPaymentCalender.getPayUserType() == SCHOOL) {
|
|
@@ -980,12 +898,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
}
|
|
}
|
|
if (calender.getPaymentType() == ADD_STUDENT || calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
|
|
if (calender.getPaymentType() == ADD_STUDENT || calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
|
|
// 所有缴费项目已完成排课才能创建下一个缴费项目
|
|
// 所有缴费项目已完成排课才能创建下一个缴费项目
|
|
- List<String> batchNoList = new ArrayList<>();
|
|
|
|
- batchNoList.add(batchNo);
|
|
|
|
- String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(calender.getMusicGroupId(), null, null, batchNoList);
|
|
|
|
- if (StringUtils.isNoneBlank(orignBatchNo)) {
|
|
|
|
- throw new BizException("{} 存在未排课的缴费项目,请先完成排课再操作", musicGroup.getName());
|
|
|
|
- }
|
|
|
|
|
|
+// List<String> batchNoList = new ArrayList<>();
|
|
|
|
+// batchNoList.add(batchNo);
|
|
|
|
+// String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(calender.getMusicGroupId(), null, null, batchNoList);
|
|
|
|
+// if (StringUtils.isNoneBlank(orignBatchNo)) {
|
|
|
|
+// throw new BizException("{} 存在未排课的缴费项目,请先完成排课再操作", musicGroup.getName());
|
|
|
|
+// }
|
|
List<Integer> userIds = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
|
|
List<Integer> userIds = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::valueOf).boxed().collect(Collectors.toList());
|
|
//获取欠费学员列表
|
|
//获取欠费学员列表
|
|
List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(calender.getMusicGroupId(), userIds,null);
|
|
List<Integer> noPaymentUserIds = musicGroupPaymentCalenderDetailDao.queryNoPaymentUserIds(calender.getMusicGroupId(), userIds,null);
|
|
@@ -1007,7 +925,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
//统计乐团还在审核中或者审核被拒的缴费
|
|
//统计乐团还在审核中或者审核被拒的缴费
|
|
int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(), calender.getId());
|
|
int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(), calender.getId());
|
|
if (count == 0) {
|
|
if (count == 0) {
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
|
|
|
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
|
|
musicGroup.setUpdateTime(date);
|
|
musicGroup.setUpdateTime(date);
|
|
musicGroupDao.update(musicGroup);
|
|
musicGroupDao.update(musicGroup);
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
@@ -1015,7 +933,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
throw new BizException("请重新登录");
|
|
throw new BizException("请重新登录");
|
|
}
|
|
}
|
|
//记录操作日志
|
|
//记录操作日志
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
|
|
|
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 预报名)", sysUser.getId(), ""));
|
|
|
|
+ this.createPreImGroup(musicGroup);
|
|
}
|
|
}
|
|
} else if (calender.getPaymentType() == ADD_STUDENT) {
|
|
} else if (calender.getPaymentType() == ADD_STUDENT) {
|
|
// 学生加到班级
|
|
// 学生加到班级
|
|
@@ -1024,11 +943,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
|
|
classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
|
|
musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo), musicGroup);
|
|
musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo), musicGroup);
|
|
}
|
|
}
|
|
-// MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
|
-// if (musicGroupStudentClassAdjust != null) {
|
|
|
|
-// 如果是合班缴费
|
|
|
|
-// autoClassGroupAdjust(musicGroupStudentClassAdjust);
|
|
|
|
-// }
|
|
|
|
} else if (calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
|
|
} else if (calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
|
|
List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo);
|
|
List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo);
|
|
//将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
|
|
//将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
|
|
@@ -1059,6 +973,38 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void createPreImGroup(MusicGroup musicGroup){
|
|
|
|
+ // 创建群
|
|
|
|
+ imGroupService.create(musicGroup.getId(), null, "乐团预报名", null,
|
|
|
|
+ musicGroup.getName(), musicGroup.getName(), null, GroupType.MUSIC.getCode(), ImGroup.GroupTypeEnum.PARENT_MEETING);
|
|
|
|
+
|
|
|
|
+ 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.getDirectorUserId() != null) {
|
|
|
|
+ userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
|
|
|
|
+ }
|
|
|
|
+ if (musicGroup.getTransactionTeacherId() != null) {
|
|
|
|
+ userRoleMap.put(musicGroup.getTransactionTeacherId(), "衔接老师");
|
|
|
|
+ }
|
|
|
|
+ // 添加成员
|
|
|
|
+ imGroupMemberService.join(musicGroup.getId(), userRoleMap);
|
|
|
|
+ //缴费老师推送消息
|
|
|
|
+ sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), null,
|
|
|
|
+ null, musicGroup.getEducationalTeacherId(), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_ADJUST_SUCCESS, musicGroup.getName());
|
|
|
|
+ Map<Integer, String> map = new HashMap<>(1);
|
|
|
|
+ map.put(musicGroup.getEducationalTeacherId(), musicGroup.getEducationalTeacherId().toString());
|
|
|
|
+ if (map != null && map.size() > 0) {
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_ADJUST_SUCCESS,
|
|
|
|
+ map, null, 0, null, "SYSTEM", musicGroup.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void auditRefuse(String batchNs, String auditMemo) {
|
|
public void auditRefuse(String batchNs, String auditMemo) {
|
|
@@ -1068,27 +1014,44 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
}
|
|
}
|
|
String[] split = batchNs.split(",");
|
|
String[] split = batchNs.split(",");
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
|
+
|
|
|
|
+ List<String> musicGroupIdList = new ArrayList<String>();
|
|
|
|
+
|
|
for (String batchNo : split) {
|
|
for (String batchNo : split) {
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
if (musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0) {
|
|
if (musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0) {
|
|
throw new BizException("缴费项目不存在");
|
|
throw new BizException("缴费项目不存在");
|
|
}
|
|
}
|
|
for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
|
|
|
|
+
|
|
|
|
+ if(musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING){
|
|
|
|
+ throw new BizException("缴费项目不是在审核中状态");
|
|
|
|
+ }
|
|
|
|
+
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
}
|
|
}
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
|
|
|
|
+
|
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS && musicGroup.getStatus() != MusicGroupStatusEnum.FEE_AUDIT) {
|
|
|
|
+ throw new BizException("当前乐团状态不支持此操作");
|
|
|
|
+ }
|
|
//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
if (calender.getPaymentType() == MUSIC_APPLY) {
|
|
if (calender.getPaymentType() == MUSIC_APPLY) {
|
|
- MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
|
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
|
|
|
|
- musicGroup.setUpdateTime(date);
|
|
|
|
- musicGroupDao.update(musicGroup);
|
|
|
|
- //记录操作日志
|
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
|
|
|
|
|
|
+ if (!musicGroupIdList.contains(calender.getMusicGroupId())) {
|
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT_FAILED);
|
|
|
|
+ musicGroup.setUpdateTime(date);
|
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
|
+ // 记录操作日志
|
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
|
|
|
|
+
|
|
|
|
+ musicGroupIdList.add(calender.getMusicGroupId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1134,11 +1097,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
if (e.getPaymentType() == MUSIC_APPLY) {
|
|
if (e.getPaymentType() == MUSIC_APPLY) {
|
|
//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
MusicGroup musicGroup = musicGroupDao.get(e.getMusicGroupId());
|
|
MusicGroup musicGroup = musicGroupDao.get(e.getMusicGroupId());
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
|
|
|
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.DRAFT);
|
|
musicGroup.setUpdateTime(date);
|
|
musicGroup.setUpdateTime(date);
|
|
musicGroupDao.update(musicGroup);
|
|
musicGroupDao.update(musicGroup);
|
|
//记录操作日志
|
|
//记录操作日志
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目撤回(费用审核中 -> 撤回)", sysUser.getId(), ""));
|
|
|
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目撤回(费用审核中 -> 草稿)", sysUser.getId(), ""));
|
|
}
|
|
}
|
|
e.setStatus(DRAFT);
|
|
e.setStatus(DRAFT);
|
|
});
|
|
});
|
|
@@ -1182,6 +1145,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public HttpResponseResult<ModelMap> merge1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
|
|
public HttpResponseResult<ModelMap> merge1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
|
|
|
|
+
|
|
|
|
+ Long calenderId = musicGroupPaymentBaseCalender.getCalenderId();
|
|
|
|
+
|
|
|
|
+ MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
|
|
|
|
+ if(musicGroupPaymentCalender == null){
|
|
|
|
+ throw new BizException("缴费项目[{}]查询失败", calenderId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.DRAFT && musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.REJECT){
|
|
|
|
+ throw new BizException("当前缴费项目状态不支持修改");
|
|
|
|
+ }
|
|
|
|
+
|
|
del(musicGroupPaymentBaseCalender.getCalenderId());
|
|
del(musicGroupPaymentBaseCalender.getCalenderId());
|
|
return create1(musicGroupPaymentBaseCalender);
|
|
return create1(musicGroupPaymentBaseCalender);
|
|
}
|
|
}
|
|
@@ -1321,6 +1296,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
if (musicGroupPaymentCalenderDetailList != null && musicGroupPaymentCalenderDetailList.size() > 0) {
|
|
if (musicGroupPaymentCalenderDetailList != null && musicGroupPaymentCalenderDetailList.size() > 0) {
|
|
throw new BizException("操作失败:缴费项目中已存在学员");
|
|
throw new BizException("操作失败:缴费项目中已存在学员");
|
|
}
|
|
}
|
|
|
|
+ //如果是学校缴费,删除缴费周期
|
|
|
|
+ musicGroupCalenderRefundPeriodService.deleteByCalenderId(id);
|
|
MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(calender.getBatchNo());
|
|
MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(calender.getBatchNo());
|
|
if (!Objects.isNull(adjust)) {
|
|
if (!Objects.isNull(adjust)) {
|
|
// throw new BizException("操作失败:班级调整的缴费项目不支持");
|
|
// throw new BizException("操作失败:班级调整的缴费项目不支持");
|