|
@@ -86,10 +86,41 @@ public class FsStorePaymentScrmController extends BaseController
|
|
|
fsStorePayment.setCreateTimeList(fsStorePayment.getCreateTimeRange().split("--"));
|
|
fsStorePayment.setCreateTimeList(fsStorePayment.getCreateTimeRange().split("--"));
|
|
|
}
|
|
}
|
|
|
List<FsStorePaymentVO> list = fsStorePaymentService.selectFsStorePaymentListQuery(fsStorePayment);
|
|
List<FsStorePaymentVO> list = fsStorePaymentService.selectFsStorePaymentListQuery(fsStorePayment);
|
|
|
|
|
+
|
|
|
|
|
+ // 计算总支付金额和总退款金额
|
|
|
|
|
+ BigDecimal totalPaymentAmount = BigDecimal.ZERO;
|
|
|
|
|
+ BigDecimal totalRefundAmount = BigDecimal.ZERO;
|
|
|
|
|
+
|
|
|
for (FsStorePaymentVO vo : list){
|
|
for (FsStorePaymentVO vo : list){
|
|
|
vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
|
|
vo.setUserPhone(ParseUtils.parsePhone(vo.getUserPhone()));
|
|
|
|
|
+
|
|
|
|
|
+ // 状态为1(已支付)或-1(已退款)时,累加到总支付金额
|
|
|
|
|
+ if (vo.getStatus() != null && (vo.getStatus() == 1 || vo.getStatus() == -1)) {
|
|
|
|
|
+ if (vo.getPayMoney() != null) {
|
|
|
|
|
+ totalPaymentAmount = totalPaymentAmount.add(vo.getPayMoney());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 状态为-1(已退款)时,累加到总退款金额
|
|
|
|
|
+ // 根据规范,只统计退款审核状态为2(审核完成)的退款金额
|
|
|
|
|
+ if (vo.getStatus() != null && vo.getStatus() == -1) {
|
|
|
|
|
+ if (vo.getRefundAuditStatus() != null && vo.getRefundAuditStatus() == 2) {
|
|
|
|
|
+ if (vo.getRefundMoney() != null) {
|
|
|
|
|
+ totalRefundAmount = totalRefundAmount.add(vo.getRefundMoney());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- return getDataTable(list);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 记录查询条件和统计结果
|
|
|
|
|
+ logger.info("支付明细列表查询,查询条件:{},查询结果数量:{},总支付金额:{},总退款金额:{}",
|
|
|
|
|
+ fsStorePayment, list.size(), totalPaymentAmount, totalRefundAmount);
|
|
|
|
|
+
|
|
|
|
|
+ TableDataInfo dataTable = getDataTable(list);
|
|
|
|
|
+ dataTable.put("totalPaymentAmount", totalPaymentAmount);
|
|
|
|
|
+ dataTable.put("totalRefundAmount", totalRefundAmount);
|
|
|
|
|
+
|
|
|
|
|
+ return dataTable;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|