buhuazhen
7 天以前 a1f56d054684d1294d027ed9f8dfbea6cee654aa
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();