|
@@ -27,7 +27,6 @@ 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;
|
|
@@ -118,7 +117,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
|
|
|
musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
|
|
|
}
|
|
|
- int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPaymentValidStartDate(),
|
|
|
+ int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
|
|
|
musicGroupPaymentCalender.getPaymentValidEndDate(), null);
|
|
|
if (count > 0) {
|
|
|
throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
|
|
@@ -182,14 +181,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
- if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
|
|
|
- throw new BizException("创建失败:缴费项目类型不匹配");
|
|
|
+ int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),null);
|
|
|
+ if(countAuditReject == 0){
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
|
|
|
+ throw new BizException("创建失败:缴费项目类型不匹配");
|
|
|
+ }
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
+ musicGroup.setUpdateTime(date);
|
|
|
+ // 记录操作日志
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 审核中)", sysUser.getId(), ""));
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
}
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
- musicGroup.setUpdateTime(date);
|
|
|
- // 记录操作日志
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 审核中)", sysUser.getId(), ""));
|
|
|
- musicGroupDao.update(musicGroup);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -222,8 +224,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
calender.setActualNum(actualNumMap.get(id) == null ? 0 : actualNumMap.get(id).intValue());
|
|
|
calender.setExpectNum(expectNumMap.get(id) == null ? 0 : expectNumMap.get(id).intValue());
|
|
|
BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);
|
|
|
+ //收费标准名称
|
|
|
+ String name = musicGroupPaymentCalenderDao.getCalenderSettingsName(id);
|
|
|
+ List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(id);
|
|
|
Map<String, Object> result = new HashMap<>(2);
|
|
|
+ result.put("musicGroupPaymentCalenderCourseSettings", musicGroupPaymentCalenderCourseSettings);
|
|
|
result.put("calender", calender);
|
|
|
+ result.put("calenderSettingsName", name);
|
|
|
result.put("sumActualAmount", sumActualAmount);
|
|
|
return result;
|
|
|
}
|
|
@@ -259,7 +266,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
|
|
|
musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
|
|
|
}
|
|
|
- int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPaymentValidStartDate(),
|
|
|
+ int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(), musicGroupPaymentCalender.getPaymentValidStartDate(),
|
|
|
musicGroupPaymentCalender.getPaymentValidEndDate(), null);
|
|
|
if (count > 0) {
|
|
|
throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
|
|
@@ -323,15 +330,19 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
// 如果是报名,需要修改乐团状态
|
|
|
+
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
- if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
|
|
|
- throw new BizException("创建失败:缴费项目类型不匹配");
|
|
|
+ int countAuditReject = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),musicGroupPaymentCalender.getId());
|
|
|
+ if(countAuditReject == 0){
|
|
|
+ if (musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT) {
|
|
|
+ throw new BizException("创建失败:缴费项目类型不匹配");
|
|
|
+ }
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
+ musicGroup.setUpdateTime(date);
|
|
|
+ // 记录操作日志
|
|
|
+ musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 审核中)", sysUser.getId(), ""));
|
|
|
+ musicGroupDao.update(musicGroup);
|
|
|
}
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
- musicGroup.setUpdateTime(date);
|
|
|
- // 记录操作日志
|
|
|
- musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 审核中)", sysUser.getId(), ""));
|
|
|
- musicGroupDao.update(musicGroup);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -453,23 +464,26 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
} else {
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
}
|
|
|
- //如果是报名,需要修改乐团状态
|
|
|
- if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
|
|
|
- musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
- musicGroup.setUpdateTime(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(), ""));
|
|
|
-
|
|
|
- }
|
|
|
musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
|
+ //如果是报名,并且所有的报名都审核通过,需要修改乐团状态
|
|
|
+
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
|
|
|
+ int count = musicGroupPaymentCalenderDao.countAuditReject(musicGroupPaymentCalender.getMusicGroupId(),calenderId);
|
|
|
+ if(count == 0){
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
|
|
|
+ musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
+ musicGroup.setUpdateTime(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(), ""));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -477,7 +491,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
public void auditRefuse(Long calenderId,String auditMemo) {
|
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
|
|
|
Date date = new Date();
|
|
|
- musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
|
|
|
+ musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
|
|
|
musicGroupPaymentCalender.setUpdateTime(date);
|
|
|
musicGroupPaymentCalender.setAuditMemo(auditMemo);
|
|
|
musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
|
|
@@ -653,7 +667,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if (count > 0) {
|
|
|
throw new BizException("缴费时间存在冲突,请修改缴费开始日期");
|
|
|
}
|
|
|
- count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(calender.getMusicGroupId(), paymentCalender.getPaymentValidStartDate(),
|
|
|
+ count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(calender.getMusicGroupId(), paymentCalender.getPayUserType(), paymentCalender.getPaymentValidStartDate(),
|
|
|
paymentCalender.getPaymentValidEndDate(), paymentCalender.getId());
|
|
|
if (count > 0) {
|
|
|
throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
|