|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fjhx.account.entity.account.po.AccountPayment;
|
|
|
import com.fjhx.account.entity.account.po.AccountRequestFundsDetail;
|
|
|
import com.fjhx.account.entity.account.po.AccountRunningWater;
|
|
|
+import com.fjhx.account.entity.account.vo.AccountRequestFundsDetailVo;
|
|
|
import com.fjhx.account.entity.tax.po.TaxRefundDetails;
|
|
|
import com.fjhx.account.service.account.AccountPaymentService;
|
|
|
import com.fjhx.account.service.account.AccountRequestFundsDetailService;
|
|
@@ -317,6 +318,21 @@ public class SaleStatementServiceImpl implements SaleStatementService {
|
|
|
}).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
p.setPurchaseAmount(purchaseAmount);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 其他收入金额
|
|
|
+ */
|
|
|
+ List<AccountRequestFundsDetailVo> accountRequestFundsDetailVos = accountRequestFundsDetailService.getListByContractId(p.getContractId());
|
|
|
+ if (CollectionUtils.isNotEmpty(accountRequestFundsDetailVos)) {
|
|
|
+ BigDecimal otherExpenses = accountRequestFundsDetailVos.stream().map(acc -> {
|
|
|
+ //获取汇率
|
|
|
+ BigDecimal rate = assignCurrencyRatesMap.getOrDefault(acc.getCurrency(), BigDecimal.ONE);
|
|
|
+ // 获取认领金额
|
|
|
+ BigDecimal money = acc.getAmount();
|
|
|
+ // 返回兑人民币后金额
|
|
|
+ return rate.multiply(money);
|
|
|
+ }).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ p.setOtherExpenses(otherExpenses);
|
|
|
+ }
|
|
|
} else {//取数据汇率
|
|
|
/**
|
|
|
* 处理到账金额
|
|
@@ -367,27 +383,23 @@ public class SaleStatementServiceImpl implements SaleStatementService {
|
|
|
}).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
p.setPurchaseAmount(purchaseAmount);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 其他收入金额
|
|
|
+ */
|
|
|
+ List<AccountRequestFundsDetailVo> accountRequestFundsDetailVos = accountRequestFundsDetailService.getListByContractId(p.getContractId());
|
|
|
+ if (CollectionUtils.isNotEmpty(accountRequestFundsDetailVos)) {
|
|
|
+ BigDecimal otherExpenses = accountRequestFundsDetailVos.stream().map(acc -> {
|
|
|
+ //获取汇率
|
|
|
+ BigDecimal rate = acc.getRate() == null ? BigDecimal.ZERO : acc.getRate();
|
|
|
+ // 获取认领金额
|
|
|
+ BigDecimal money = acc.getAmount();
|
|
|
+ // 返回兑人民币后金额
|
|
|
+ return rate.multiply(money);
|
|
|
+ }).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ p.setOtherExpenses(otherExpenses);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- //获取已经付款金额赋值到其他支出
|
|
|
- List<Long> arfIds = accountRequestFundsDetailService.listObject(AccountRequestFundsDetail::getAccountRequestFundsId, q -> q
|
|
|
- .eq(AccountRequestFundsDetail::getContractId, p.getContractId())
|
|
|
- );
|
|
|
- arfIds.add(null);
|
|
|
- List<Long> apIds = accountPaymentService.listObject(AccountPayment::getId, q -> q
|
|
|
- .in(AccountPayment::getBusinessId, arfIds)
|
|
|
- .eq(AccountPayment::getStatus, 10)
|
|
|
- );
|
|
|
- apIds.add(null);
|
|
|
- List<AccountRunningWater> accountRunningWaterList = accountRunningWaterService.list(q -> q.
|
|
|
- in(AccountRunningWater::getBusinessId, apIds)
|
|
|
- );
|
|
|
- BigDecimal amount = accountRunningWaterList.stream().map(arw -> {
|
|
|
- return arw.getAmount().multiply(arw.getRate());
|
|
|
- }).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- p.setOtherExpenses(p.getOtherExpenses().add(amount));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|