From 54825344a6968a28f624f041d33b6931e3dfa164 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 12 九月 2024 17:53:00 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
index fea0c6d..9233af7 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderInvoiceServiceImpl.java
@@ -255,6 +255,14 @@
 		query.setUserIds(userList.stream().map(TAppUser::getId).collect(Collectors.toList()));
 		PageInfo<TOrderInvoiceVO> pageInfo = new PageInfo<>(query.getPageCurr(),query.getPageSize());
 		List<TOrderInvoiceVO> list = this.baseMapper.pageList(query,pageInfo);
+		for (TOrderInvoiceVO tOrderInvoiceVO : list) {
+			List<Long> collect = orderInvoiceDetailService.lambdaQuery().eq(TOrderInvoiceDetail::getOrderInvoiceId, tOrderInvoiceVO.getId())
+					.eq(TOrderInvoiceDetail::getOrderType, 1).list().stream()
+					.map(TOrderInvoiceDetail::getOrderId).collect(Collectors.toList());
+			// 将其全部转化为String
+			tOrderInvoiceVO.setIds(collect.stream().map(String::valueOf).collect(Collectors.toList()));
+		}
+		// 查询这个开票的订单ids
 
 		List<Long> ids = list.stream().map(TOrderInvoiceVO::getId).collect(Collectors.toList());
 
@@ -265,9 +273,9 @@
 			e.setServiceTariff(orderInvoiceDetailList.get(0).getServiceTariff());
 			e.setElectricityTariff(orderInvoiceDetailList.get(0).getElectricityTariff());
 			e.setAddedServiceTariff(orderInvoiceDetailList.get(0).getAddedServiceTariff());
-			e.setAddedService(orderInvoiceDetailList.stream().map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get());
-			e.setElectrovalence(orderInvoiceDetailList.stream().map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get());
-			e.setServiceCharge(orderInvoiceDetailList.stream().map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get());
+			e.setAddedService(orderInvoiceDetailList.stream().filter(t->t.getAddedService()!=null).map(TOrderInvoiceDetail::getAddedService).reduce(BigDecimal::add).get());
+			e.setElectrovalence(orderInvoiceDetailList.stream().filter(t->t.getElectrovalence()!=null).map(TOrderInvoiceDetail::getElectrovalence).reduce(BigDecimal::add).get());
+			e.setServiceCharge(orderInvoiceDetailList.stream().filter(t->t.getServiceCharge()!=null).map(TOrderInvoiceDetail::getServiceCharge).reduce(BigDecimal::add).get());
 			e.setUserPhone(userList.stream().filter(m->m.getId().equals(Long.parseLong(e.getBillingUserId().toString()))).findFirst().get().getPhone());
 		});
 

--
Gitblit v1.7.1