|
@@ -1,53 +1,40 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.util.*;
|
|
|
-import java.util.Map.Entry;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+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.dto.SimpleUserDto;
|
|
|
-import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
|
|
|
-import com.ym.mec.common.page.PageInfo;
|
|
|
-import com.ym.mec.common.page.QueryInfo;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
-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.MusicGroupStudentFeeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
-import com.ym.mec.biz.dal.dto.CalenderPushDto;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
-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.PaymentCalenderStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
|
import com.ym.mec.biz.service.SysMessageService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.IdGeneratorService;
|
|
|
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;
|
|
|
|
|
|
@Service
|
|
|
public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
|
|
@@ -71,6 +58,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
@Autowired
|
|
|
private MusicGroupDao musicGroupDao;
|
|
|
@Autowired
|
|
|
+ private MusicGroupBuildLogDao musicGroupBuildLogDao;
|
|
|
+ @Autowired
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
@Autowired
|
|
|
private SysMessageService sysMessageService;
|
|
@@ -146,9 +135,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
//如果是报名,需要修改乐团状态
|
|
|
- if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_COURSE) {
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
|
|
|
+ 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);
|
|
|
}
|
|
|
}
|
|
@@ -275,7 +269,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
//如果是报名,需要修改乐团状态
|
|
|
- if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_COURSE) {
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
|
|
|
musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
|
|
|
musicGroup.setUpdateTime(date);
|
|
|
musicGroupDao.update(musicGroup);
|
|
@@ -404,7 +398,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
operatorIds.removeAll(Collections.singleton(null));
|
|
|
Map<Integer, String> realNameMap = getMap("sys_user", "id_", "real_name_", operatorIds, Integer.class, String.class);
|
|
|
dataList.forEach(e->{
|
|
|
- e.setOperatorName(organNameMap.get(e.getOrganId()));
|
|
|
+ e.setOrganName(organNameMap.get(e.getOrganId()));
|
|
|
e.setOperatorName(realNameMap.get(e.getOperator()));
|
|
|
});
|
|
|
}
|
|
@@ -440,11 +434,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
|
|
|
}
|
|
|
//如果是报名,需要修改乐团状态
|
|
|
- if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_COURSE) {
|
|
|
+ if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.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);
|
|
@@ -463,7 +464,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
|
|
|
public boolean autoUpdateMusicGroupPaymentCalenderStatus() {
|
|
|
// 获取当天创建且未缴费的数据,并推送
|
|
|
List<MusicGroupPaymentCalenderDetail> details = musicGroupPaymentCalenderDetailDao.queryNoPaymentCanPushList();
|
|
@@ -521,15 +522,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
mgpcd.setUpdateTime(date);
|
|
|
updateMusicGroupPaymentCalenderDetailList.add(mgpcd);
|
|
|
|
|
|
- if (mgpc.getIsGiveMusicNetwork()) {
|
|
|
- // 更新fee表,且加1
|
|
|
- musicGroupStudentFee = feeMap.get(mgpcd.getUserId());
|
|
|
- if (musicGroupStudentFee != null) {
|
|
|
- musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
- musicGroupStudentFee.setUpdateTime(date);
|
|
|
+ // 更新fee表,且加1
|
|
|
+ musicGroupStudentFee = feeMap.get(mgpcd.getUserId());
|
|
|
+ if (musicGroupStudentFee != null) {
|
|
|
+ musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
+ musicGroupStudentFee.setUpdateTime(date);
|
|
|
+ if(mgpc.getIsGiveMusicNetwork()){
|
|
|
musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getContinuousAbsenteeismTimes() + 1);
|
|
|
- updateMusicGroupStudentFeeList.add(musicGroupStudentFee);
|
|
|
}
|
|
|
+ updateMusicGroupStudentFeeList.add(musicGroupStudentFee);
|
|
|
}
|
|
|
}
|
|
|
}
|