| | |
| | | billManagement.setCreateTime(DateUtils.getNowDate()); |
| | | billManagement.setBillName(billCreateVo.getBillName()); |
| | | billManagement.setCustomerName(billCreateVo.getCustomerName()); |
| | | billManagement.setCreateBy(SecurityUtils.getUsername()); |
| | | billManagement.setIsInternalSettlement(billCreateVo.getIsInternalSettlement()); |
| | | billManagement.setInternalSettlementUnit(billCreateVo.getInternalSettlementUnit()); |
| | | // 3. 根据账单类型设置币种和总金额 |
| | | if (billType == 0) { |
| | | // 人民币账单 |
| | | billManagement.setCurrency("CNY"); |
| | | billManagement.setCurrency("RMB"); |
| | | billManagement.setTotalAmount(statisticsVo.getTotalAmountRmb()); |
| | | } else if (billType == 1) { |
| | | // 港币账单 |
| | |
| | | } else { |
| | | throw new IllegalArgumentException("无效的账单类型:" + billType); |
| | | } |
| | | billManagement.setPendingAmount(billManagement.getTotalAmount()); |
| | | String noByKey = systemDataNoService.getNoByKey(SystemDataNoEnum.YSZD); |
| | | billManagement.setSystemNo(noByKey); |
| | | // 4. 保存主账单记录 |
| | |
| | | Map<String, BigDecimal> currencyAmountMap = new HashMap<>(); |
| | | for (ReceivableFeeDetail detail : detailList) { |
| | | String currency = detail.getCurrency(); |
| | | BigDecimal billingAmount = detail.getBillingAmount(); |
| | | BigDecimal billingAmount = detail.getActualAmount(); |
| | | |
| | | if (currency != null && billingAmount != null) { |
| | | currencyAmountMap.merge(currency, billingAmount, BigDecimal::add); |