|
@@ -11,7 +11,6 @@ import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupStudentFeeService;
|
|
|
import com.ym.mec.biz.service.SysMessageService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
@@ -27,7 +26,7 @@ import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
|
|
|
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PROCESSING;
|
|
|
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
|
|
|
|
|
|
@Service
|
|
|
public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail> implements MusicGroupPaymentCalenderDetailService {
|
|
@@ -54,20 +53,27 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
if(expectAmount == null || StringUtils.isEmpty(ids)){
|
|
|
throw new BizException("参数校验失败");
|
|
|
}
|
|
|
- String[] split = ids.split(",");
|
|
|
//获取缴费列表
|
|
|
List<MusicGroupPaymentCalenderDetail> calenderDetails = musicGroupPaymentCalenderDetailDao.queryListByIds(ids);
|
|
|
if(calenderDetails.size() == 0){
|
|
|
throw new BizException("缴费记录不存在");
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
+ int compare = expectAmount.compareTo(BigDecimal.ZERO);
|
|
|
calenderDetails.forEach(e->{
|
|
|
if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
|
|
|
throw new BizException("修改失败,缴费状态不匹配");
|
|
|
}
|
|
|
+ if(compare == 1){
|
|
|
+ e.setPaymentStatus(PAID_COMPLETED);
|
|
|
+ }
|
|
|
e.setUpdateTime(date);
|
|
|
e.setExpectAmount(expectAmount);
|
|
|
});
|
|
|
+ //如果是设置为0元
|
|
|
+ if(compare == 1){
|
|
|
+ musicGroupStudentFeeDao.setPaidCompleted(calenderDetails);
|
|
|
+ }
|
|
|
musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
|
|
|
}
|
|
|
|
|
@@ -151,16 +157,17 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
Date date = new Date();
|
|
|
MusicGroupStudentFee studentFee = musicGroupStudentFeeDao.findByUser(userId, calender.getMusicGroupId());
|
|
|
//修改预计人数
|
|
|
- calender.setExpectNum(calender.getExpectNum());
|
|
|
+// calender.setExpectNum(calender.getExpectNum());
|
|
|
calender.setUpdateTime(date);
|
|
|
-
|
|
|
//生成详情
|
|
|
MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
|
|
|
musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(calender.getId());
|
|
|
musicGroupPaymentCalenderDetail.setCreateTime(date);
|
|
|
musicGroupPaymentCalenderDetail.setExpectAmount(studentFee.getCourseFee());
|
|
|
if (studentFee.getCourseFee().doubleValue() == 0) {
|
|
|
- musicGroupPaymentCalenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
|
|
|
+ studentFee.setPaymentStatus(PAID_COMPLETED);
|
|
|
+ studentFee.setUpdateTime(date);
|
|
|
+ musicGroupPaymentCalenderDetail.setPaymentStatus(PAID_COMPLETED);
|
|
|
} else {
|
|
|
musicGroupPaymentCalenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.NON_PAYMENT);
|
|
|
}
|
|
@@ -168,5 +175,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
|
|
|
musicGroupPaymentCalenderDetail.setUserId(userId);
|
|
|
musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
|
|
|
musicGroupPaymentCalenderDao.update(calender);
|
|
|
+ musicGroupStudentFeeDao.update(studentFee);
|
|
|
}
|
|
|
}
|