From 277e9a57417df1a594c65edda1c6a7b3985aa2bc Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期四, 07 五月 2026 11:21:01 +0800
Subject: [PATCH] 空指针
---
src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
index 147682f..2bcb92b 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesQuotationServiceImpl.java
@@ -4,12 +4,15 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.approve.pojo.ApproveProcess;
import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl;
-import com.ruoyi.approve.vo.ApproveGetAndUpdateVo;
-import com.ruoyi.approve.vo.ApproveProcessVO;
+import com.ruoyi.approve.bean.vo.ApproveGetAndUpdateVo;
+import com.ruoyi.approve.bean.vo.ApproveProcessVO;
+import com.ruoyi.basic.dto.CustomerPrivatePoolDto;
+import com.ruoyi.basic.mapper.CustomerPrivatePoolMapper;
import com.ruoyi.common.utils.OrderUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
@@ -39,6 +42,8 @@
private final SalesQuotationProductService salesQuotationProductService;
private final ApproveProcessServiceImpl approveProcessService;
+ private final CustomerPrivatePoolMapper customerPrivatePoolMapper;
+
@Override
public IPage<SalesQuotationDto> listPage(Page page, SalesQuotationDto salesQuotationDto) {
IPage<SalesQuotationDto> salesQuotationDtoIPage = salesQuotationMapper.listPage(page, salesQuotationDto);
@@ -56,7 +61,11 @@
public boolean add(SalesQuotationDto salesQuotationDto) {
LoginUser loginUser = SecurityUtils.getLoginUser();
SalesQuotation salesQuotation = new SalesQuotation();
- BeanUtils.copyProperties(salesQuotationDto, salesQuotation);
+ CustomerPrivatePoolDto customerPrivatePoolDto = customerPrivatePoolMapper.selectInfo(Long.valueOf(salesQuotationDto.getCustomer()));
+ if (ObjectUtils.isNotEmpty(customerPrivatePoolDto)) {
+ BeanUtils.copyProperties(salesQuotationDto, salesQuotation);
+ salesQuotation.setCustomer(customerPrivatePoolDto.getCustomerName());
+ }
String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT","quotation_no");
salesQuotation.setQuotationNo(quotationNo);
salesQuotation.setStatus("寰呭鎵�");
@@ -84,7 +93,7 @@
approveProcessService.addApprove(approveProcessVO);
}catch (Exception e){
log.error("SalesQuotationServiceImpl error:{}", e);
- throw new RuntimeException("瀹℃壒澶辫触");
+ throw new RuntimeException("瀹℃壒澶辫触");
}
return true;
}
--
Gitblit v1.9.3