|
@@ -3,15 +3,13 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.huifu.adapay.model.payment.Payment;
|
|
|
import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
|
import com.ym.mec.biz.dal.dto.PageInfoOrder;
|
|
|
import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
|
|
|
import com.ym.mec.biz.dal.entity.Goods;
|
|
|
import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
|
|
|
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
-import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
@@ -53,6 +51,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
private SporadicChargeInfoService sporadicChargeInfoService;
|
|
|
@Autowired
|
|
|
private PracticeGroupService practiceGroupService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserCashAccountDao sysUserCashAccountDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, StudentPaymentOrder> getDAO() {
|
|
@@ -285,17 +285,27 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<StudentPaymentOrder> dataList = new ArrayList<>();
|
|
|
int count = this.findCount(params);
|
|
|
- StudentPaymentOrder orderMoneyAmount = studentPaymentOrderDao.getOrderMoneyAmount(params);
|
|
|
- if(orderMoneyAmount != null){
|
|
|
- BigDecimal totalExpectAmount = orderMoneyAmount.getExpectAmount() !=null? orderMoneyAmount.getExpectAmount():BigDecimal.ZERO;
|
|
|
- BigDecimal totalActualAmount = orderMoneyAmount.getActualAmount() !=null? orderMoneyAmount.getActualAmount():BigDecimal.ZERO;
|
|
|
- pageInfo.setTotalExpectAmount(totalExpectAmount);
|
|
|
- pageInfo.setTotalActualAmount(totalActualAmount);
|
|
|
- }
|
|
|
+ BigDecimal totalUserBalance = sysUserCashAccountDao.getTotalUserBalance();
|
|
|
+ pageInfo.setTotalUserBalance(totalUserBalance);
|
|
|
if (count > 0) {
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = studentPaymentOrderDao.queryPageOrder(params);
|
|
|
+
|
|
|
+ StudentPaymentOrder orderMoneyAmount = studentPaymentOrderDao.getOrderMoneyAmount(params);
|
|
|
+ BigDecimal totalExpectAmount = orderMoneyAmount.getExpectAmount() != null ? orderMoneyAmount.getExpectAmount() : BigDecimal.ZERO;
|
|
|
+ BigDecimal totalActualAmount = orderMoneyAmount.getActualAmount() != null ? orderMoneyAmount.getActualAmount() : BigDecimal.ZERO;
|
|
|
+ BigDecimal totalBalancePaymentAmount = orderMoneyAmount.getBalancePaymentAmount() != null ? orderMoneyAmount.getBalancePaymentAmount() : BigDecimal.ZERO;
|
|
|
+
|
|
|
+ params.put("chargeType", SporadicChargeTypeEnum.RECHARGE);
|
|
|
+ BigDecimal totalChargeAmount = studentPaymentOrderDao.getChargeAmount(params);
|
|
|
+ totalChargeAmount = totalChargeAmount != null ? totalChargeAmount : BigDecimal.ZERO;
|
|
|
+ BigDecimal totalAdvanceAmount = totalChargeAmount.subtract(totalBalancePaymentAmount);
|
|
|
+
|
|
|
+ pageInfo.setTotalAdvanceAmount(totalAdvanceAmount);
|
|
|
+ pageInfo.setTotalExpectAmount(totalExpectAmount);
|
|
|
+ pageInfo.setTotalActualAmount(totalActualAmount);
|
|
|
+ pageInfo.setTotalRevenueAmount(totalActualAmount.subtract(totalAdvanceAmount));
|
|
|
}
|
|
|
pageInfo.setRows(dataList);
|
|
|
return pageInfo;
|