|
|
@@ -1,61 +1,18 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
|
|
|
-
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Map.Entry;
|
|
|
-import java.util.Set;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Isolation;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
|
|
|
-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.MusicGroupPaymentStudentCourseDetailDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
|
|
|
-import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
+import com.ym.mec.auth.api.entity.SysUserRole;
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.CalenderPushDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
-import com.ym.mec.biz.dal.entity.Organization;
|
|
|
-import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
|
@@ -72,6 +29,20 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Isolation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.*;
|
|
|
+import java.util.Map.Entry;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
|
|
|
|
|
|
@Service
|
|
|
public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
|
|
|
@@ -212,11 +183,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
|
|
|
- if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
|
|
|
- } else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
+ if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
- } else {
|
|
|
+ }else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
|
|
|
+ }else {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
}
|
|
|
|
|
|
@@ -277,6 +248,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ Set<Integer> roleIds = new HashSet<>(1);
|
|
|
+ roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
+ Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
+ sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(),musicGroup.getName());
|
|
|
}
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
|
@@ -290,6 +266,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
// 记录操作日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
|
|
|
+ Set<Integer> roleIds = new HashSet<>(1);
|
|
|
+ roleIds.add(SysUserRole.ADMINISTRATOR);
|
|
|
+ sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
|
|
|
}else{
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
|
|
|
// 记录操作日志
|
|
|
@@ -427,11 +406,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
|
|
|
- if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
|
|
|
- } else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
+ if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
- } else {
|
|
|
+ }else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
|
|
|
+ }else {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
}
|
|
|
|
|
|
@@ -493,19 +472,27 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ }else {
|
|
|
+ Set<Integer> roleIds = new HashSet<>(1);
|
|
|
+ roleIds.add(SysUserRole.ADMINISTRATOR);
|
|
|
+ Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
+ sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(),musicGroup.getName());
|
|
|
+ }
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),musicGroupPaymentCalender.getId());
|
|
|
if(countAuditReject == 0){
|
|
|
- if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT && musicGroup.getStatus() != MusicGroupStatusEnum.AUDIT_FAILED) {
|
|
|
throw new BizException("创建失败:缴费项目类型不匹配");
|
|
|
}
|
|
|
if(musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING){
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
// 记录操作日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 基础信息审核中)", sysUser.getId(), ""));
|
|
|
+ Set<Integer> roleIds = new HashSet<>(1);
|
|
|
+ roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
+ sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
|
|
|
}else{
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
|
|
|
// 记录操作日志
|
|
|
@@ -638,18 +625,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
|
|
|
if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
+ }else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
|
|
|
- } else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
|
|
|
- } else {
|
|
|
+ }else {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
}
|
|
|
musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
|
//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
|
-
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
int count = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),calenderId);
|
|
|
if(count == 0){
|
|
|
@@ -663,6 +649,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
//记录操作日志
|
|
|
musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(草稿 -> 审核中)", sysUser.getId(), ""));
|
|
|
+ Set<Integer> roleIds = new HashSet<>(1);
|
|
|
+ roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
+ sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
|
|
|
}
|
|
|
}
|
|
|
}
|