Commit 77f2433e authored by hanfeng's avatar hanfeng

总业绩统计

parent 3b7de943
package com.xxfc.platform.order.biz;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.xxfc.platform.order.contant.enumerate.AccountTypeEnum;
......@@ -95,19 +96,41 @@ public class TotalPerformanceBiz {
return Lists.newArrayList();
}
//拆分明细
splitReturnOrderAmountList(returnOrderAmounts,queryCriteria);
return splitReturnOrderAmountList(returnOrderAmounts,queryCriteria);
}
//拆分明细
private List<ReturnOrderAmount> splitReturnOrderAmountList(List<ReturnOrderAmount> returnOrderAmounts, QueryCriteria queryCriteria) {
ArrayList<ReturnOrderAmount> arrayList = Lists.newArrayList();
//进行遍历拆分出压惊、订单和违章
for (ReturnOrderAmount returnOrderAmount : returnOrderAmounts) {
OrderAccountDetail accountDetailStr = returnOrderAmount.getAccountDetailStr();
if (AccountTypeEnum.OUT_RESIDUE_DEPOSIT.getCode().equals(returnOrderAmount.getAccountType())) {
//押金退还金额
BigDecimal depositAmount = accountDetailStr.getDepositAmount();
//订单退还
BigDecimal orderAmount = accountDetailStr.getOrderAmount();
//判断押金退还是否大于0
if ( depositAmount.compareTo(BigDecimal.ZERO)>0) {
ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount);
//判断是违章还是租车
if (AccountTypeEnum.OUT_RESIDUE_DEPOSIT.getCode().equals(returnOrderAmount.getAccountType())) {
returnOrderAmountClone.setRefundInstruction("违章押金");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount());
}else {
returnOrderAmountClone.setRefundInstruction("租车押金");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getDepositAmount());
}
arrayList.add(returnOrderAmountClone);
}
//判断订单退款是否大于0
if (orderAmount.compareTo(BigDecimal.ZERO)>0) {
ReturnOrderAmount returnOrderAmountClone = ObjectUtil.clone(returnOrderAmount);
returnOrderAmountClone.setRefundInstruction("订单退款");
returnOrderAmountClone.setRefundAmount(accountDetailStr.getOrderAmount());
}
}
return arrayList;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment