|
@@ -26,6 +26,7 @@ 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 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.BeanUtils;
|
|
@@ -250,7 +251,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
|
|
|
BeanUtils.copyProperties(musicGroupPaymentBaseCalender,musicGroupPaymentCalender);
|
|
BeanUtils.copyProperties(musicGroupPaymentBaseCalender,musicGroupPaymentCalender);
|
|
|
//判断缴费项目类型
|
|
//判断缴费项目类型
|
|
|
- if (musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT) {
|
|
|
|
|
|
|
+ if (musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED || musicGroup.getStatus() == MusicGroupStatusEnum.FEE_AUDIT_FAILED) {
|
|
|
musicGroupPaymentCalender.setPaymentType(MUSIC_APPLY);
|
|
musicGroupPaymentCalender.setPaymentType(MUSIC_APPLY);
|
|
|
} else {
|
|
} else {
|
|
|
if (calenderAddStudent != null && calenderAddStudent.getStudentIds() != null) {
|
|
if (calenderAddStudent != null && calenderAddStudent.getStudentIds() != null) {
|
|
@@ -309,7 +310,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPayUserType() == SCHOOL) {
|
|
if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPayUserType() == SCHOOL) {
|
|
|
status = AUDITING;
|
|
status = AUDITING;
|
|
|
if(musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY){
|
|
if(musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY){
|
|
|
- status = DRAFT;
|
|
|
|
|
|
|
+ if(musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED){
|
|
|
|
|
+ status = DRAFT;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
//计算项目原现价
|
|
//计算项目原现价
|
|
@@ -853,6 +856,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) {
|
|
@@ -962,27 +974,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) {
|
|
|
|
|
-// 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 (calender.getPaymentType() == MUSIC_APPLY) {
|
|
|
|
|
+ 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);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1076,6 +1105,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);
|
|
|
}
|
|
}
|