From a0c9adb1e44f502c0473e9aafb7545981173b130 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期三, 25 三月 2026 13:19:32 +0800
Subject: [PATCH] refactor(customer): 注释Excel导出相关字段及优化批量导入逻辑
---
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 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 b7cb426..3c8327a 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -1,6 +1,8 @@
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;
@@ -27,16 +29,16 @@
import com.ruoyi.sales.pojo.SalesLedger;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.aop.framework.AopContext;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.util.*;
import java.util.stream.Collectors;
@@ -163,7 +165,11 @@
if (followUp != null) {
c.setFollowUpLevel(followUp.getFollowUpLevel());
- c.setFollowUpTime(followUp.getFollowUpTime());
+ c.setFollowUpTime(
+ Date.from(
+ followUp.getFollowUpTime().atZone(ZoneId.systemDefault()).toInstant()
+ )
+ );
}
})
.collect(Collectors.toList());
@@ -186,6 +192,11 @@
LoginUser loginUser = SecurityUtils.getLoginUser();
Long tenantId = loginUser.getTenantId();
customer.setTenantId(tenantId);
+ customer.setTaxpayerIdentificationNumber("");
+ customer.setCompanyAddress("");
+ customer.setCompanyPhone("");
+ customer.setMaintainer("");
+ customer.setMaintenanceTime(new Date());
return customerMapper.insert(customer);
}
@@ -246,7 +257,11 @@
if (CollectionUtils.isEmpty(userList)) {
return AjaxResult.warn("妯℃澘閿欒鎴栧鍏ユ暟鎹负绌�");
}
- this.saveOrUpdateBatch(userList);
+ ICustomerService proxy = (ICustomerService) AopContext.currentProxy();
+ for (Customer customer : userList) {
+ proxy.insertCustomer(customer);
+ }
+// this.saveOrUpdateBatch(userList);
return AjaxResult.success(true);
} catch (Exception e) {
e.printStackTrace();
--
Gitblit v1.9.3