|
@@ -12,12 +12,15 @@ import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.FeeType;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.page.MusicCalenderQueryInfo;
|
|
|
import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
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.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;
|
|
@@ -92,7 +95,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
|
|
|
if (musicGroupPaymentCalender.getPaymentStatus() == PaymentStatusEnum.OPEN) {
|
|
|
if (musicGroupStudentFeeList != null && musicGroupStudentFeeList.size() > 0) {
|
|
|
- Set<Integer> studentIds = musicGroupStudentFeeList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
+ Set<Integer> studentIds = new HashSet<Integer>();
|
|
|
MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
|
|
|
// 创建缴费明细
|
|
|
for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {
|
|
@@ -104,6 +107,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
} else {
|
|
|
musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
|
|
|
+ studentIds.add(mgsf.getUserId());
|
|
|
}
|
|
|
musicGroupPaymentCalenderDetail.setUpdateTime(date);
|
|
|
musicGroupPaymentCalenderDetail.setUserId(mgsf.getUserId());
|
|
@@ -182,7 +186,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
|
|
|
// 学生状态更新进行中
|
|
|
List<MusicGroupStudentFee> musicGroupStudentFeeList = musicGroupStudentFeeDao.queryByMusicGroupId(mgpc.getMusicGroupId());
|
|
|
- Set<Integer> studentIds = musicGroupStudentFeeList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
+ Set<Integer> studentIds = new HashSet<Integer>();
|
|
|
// 创建缴费明细
|
|
|
for (MusicGroupStudentFee mgsf : musicGroupStudentFeeList) {
|
|
|
musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
|
|
@@ -193,6 +197,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
|
|
|
} else {
|
|
|
musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
|
|
|
+ studentIds.add(mgsf.getUserId());
|
|
|
}
|
|
|
musicGroupPaymentCalenderDetail.setUpdateTime(date);
|
|
|
musicGroupPaymentCalenderDetail.setUserId(mgsf.getUserId());
|
|
@@ -336,10 +341,33 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
@Override
|
|
|
public Object getDetail(Long id) {
|
|
|
MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(id);
|
|
|
+ Set<Long> set = new HashSet<>();
|
|
|
+ set.add(id);
|
|
|
+ Map<Long,Long> expectNumMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.countExpectNum(set));
|
|
|
+ Map<Long,Long> actualNumMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.countActualNum(set));
|
|
|
+ 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);
|
|
|
Map<String, Object> result = new HashMap<>(2);
|
|
|
result.put("calender", calender);
|
|
|
result.put("sumActualAmount", sumActualAmount);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object queryDetailPage(MusicCalenderQueryInfo queryInfo) {
|
|
|
+ PageInfo<MusicGroupPaymentCalender> pageInfo = queryPage(queryInfo);
|
|
|
+ List<MusicGroupPaymentCalender> rows = pageInfo.getRows();
|
|
|
+ if(rows.size() == 0){
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+ Set<Long> collect = rows.stream().map(e -> e.getId()).collect(Collectors.toSet());
|
|
|
+ Map<Long,Long> expectNumMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.countExpectNum(collect));
|
|
|
+ Map<Long,Long> actualNumMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.countActualNum(collect));
|
|
|
+ rows.forEach(e->{
|
|
|
+ e.setActualNum(actualNumMap.get(e.getId())==null?0:actualNumMap.get(e.getId()).intValue());
|
|
|
+ e.setExpectNum(expectNumMap.get(e.getId())==null?0:expectNumMap.get(e.getId()).intValue());
|
|
|
+ });
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|