From 84344f16a7f783cd32731764010a75a0af268384 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 08 四月 2026 11:32:37 +0800
Subject: [PATCH] feat:同步烜曌工贸(gongchunyi-26/4/3)
---
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
index 58810c9..7195785 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -1,8 +1,6 @@
package com.ruoyi.basic.service.impl;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.date.LocalDateTimeUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -24,7 +22,6 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.sales.mapper.SalesLedgerMapper;
import com.ruoyi.sales.pojo.SalesLedger;
import lombok.AllArgsConstructor;
@@ -35,7 +32,6 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
-import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
@@ -134,12 +130,12 @@
// 2. 鏋勫缓鏌ヨ鏉′欢锛堝寮虹┖鍊煎畨鍏級
LambdaQueryWrapper<Customer> queryWrapper = new LambdaQueryWrapper<>();
String customerName = customer.getCustomerName();
- String customerType = customer.getCustomerType();
+ Integer customerType = customer.getCustomerType();
if (StringUtils.isNotBlank(customerName)) {
queryWrapper.like(Customer::getCustomerName, customerName);
}
- if (StringUtils.isNotBlank(customerType)) {
- queryWrapper.like(Customer::getCustomerType, customerType);
+ if (customerType != null) {
+ queryWrapper.eq(Customer::getCustomerType, customerType);
}
// 3. 鎵ц鍒嗛〉鏌ヨ锛堜繚鐣欏垎椤靛厓鏁版嵁锛�
@@ -150,10 +146,17 @@
.filter(Objects::nonNull) // 杩囨护绌哄璞★紙閬垮厤鍚庣画鎿嶄綔NPE锛�
.peek(c -> {
// 瀹夊叏鑾峰彇瀛楁锛岄伩鍏峮ull鍊兼嫾鎺�
- String address = StringUtils.defaultString(c.getCompanyAddress(), "");
- String phone = StringUtils.defaultString(c.getCompanyPhone(), "");
- c.setAddressPhone(address + "(" + phone + ")");
-
+ String address = StringUtils.defaultString(c.getCompanyAddress(), "").trim();
+ String phone = StringUtils.defaultString(c.getCompanyPhone(), "").trim();
+ if (StringUtils.isNotEmpty(address) && StringUtils.isNotEmpty(phone)) {
+ c.setAddressPhone(address + "(" + phone + ")");
+ } else if (StringUtils.isNotEmpty(address)) {
+ c.setAddressPhone(address);
+ } else if (StringUtils.isNotEmpty(phone)) {
+ c.setAddressPhone(phone);
+ } else {
+ c.setAddressPhone("");
+ }
// 鏌ヨ鏈�鏂扮殑璺熻繘璁板綍
CustomerFollowUp followUp = customerFollowUpService.getOne(
new LambdaQueryWrapper<CustomerFollowUp>()
@@ -263,7 +266,7 @@
@Override
public List<Map<String, Object>> customerList(Customer customer) {
LambdaQueryWrapper<Customer> queryWrapper = Wrappers.lambdaQuery();
- queryWrapper.select(Customer::getId, Customer::getCustomerName, Customer::getTaxpayerIdentificationNumber);
+ queryWrapper.select(Customer::getId, Customer::getCustomerName, Customer::getTaxpayerIdentificationNumber, Customer::getCustomerType);
// 鑾峰彇鍘熷鏌ヨ缁撴灉
List<Map<String, Object>> result = customerMapper.selectMaps(queryWrapper);
--
Gitblit v1.9.3