1
This commit is contained in:
parent
6c1623254d
commit
c77c1ab04f
@ -37,4 +37,11 @@ public interface ICusTimeAxisService extends IService<CusTimeAxis>
|
||||
* @param cusTimeAxis TODO
|
||||
**/
|
||||
void saveNewTimeAxis(CusTimeAxis cusTimeAxis);
|
||||
|
||||
/**
|
||||
* 创建客户时间轴记录--批量
|
||||
* @author vinjor-M
|
||||
* @date 12:57 2025/11/18
|
||||
**/
|
||||
void saveNewTimeAxisBatch(List<CusTimeAxis> cusTimeAxisList);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.ruoyi.cus.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.cus.domain.*;
|
||||
import com.ruoyi.cus.dto.CusBankImportDTO;
|
||||
@ -43,6 +44,8 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
private ICusMainSeasService cusMainSeasService;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private ICusTimeAxisService cusTimeAxisService;
|
||||
|
||||
/**
|
||||
* 导入客户及联系人信息
|
||||
@ -142,6 +145,7 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
List<CusManager> cusManagerList = new ArrayList<>();
|
||||
List<CusContacts> cusContactsList = new ArrayList<>();
|
||||
List<CusBank> cusBankList = new ArrayList<>();
|
||||
List<CusTimeAxis> cusTimeAxisList = new ArrayList<>();
|
||||
// 遍历每个客户的联系人列表,只保存一次客户信息,但保存所有联系人
|
||||
for (Map.Entry<String, List<CusImportDTO>> entry : customerGroupMap.entrySet()) {
|
||||
List<CusImportDTO> customerContacts = entry.getValue();
|
||||
@ -202,6 +206,14 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
managementInfo.setCreateTime(new Date());
|
||||
cusManagerList.add(managementInfo);
|
||||
|
||||
//客户时间轴信息
|
||||
CusTimeAxis cusTimeAxis = new CusTimeAxis();
|
||||
cusTimeAxis.setBusiMaxCatg("客户");
|
||||
String content = "新增";
|
||||
cusTimeAxis.setBusiCatg(content);
|
||||
cusTimeAxis.setContent(content+"客户信息(导入)");
|
||||
cusTimeAxis.setCusId(customerId);
|
||||
cusTimeAxisList.add(cusTimeAxis);
|
||||
// 提取客户的所有联系人信息 CusContacts
|
||||
for (CusImportDTO contact : customerContacts) {
|
||||
CusContacts customerContact = new CusContacts();
|
||||
@ -239,7 +251,6 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
cusBankList.add(bankInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 批量保存客户主表信息
|
||||
@ -262,7 +273,10 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
if (!cusBankList.isEmpty()) {
|
||||
cusBankService.saveOrUpdateByAccount(cusBankList);
|
||||
}
|
||||
|
||||
//批量保存时间轴信息
|
||||
if(!cusBankList.isEmpty()){
|
||||
cusTimeAxisService.saveNewTimeAxisBatch(cusTimeAxisList);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 数据处理
|
||||
@ -292,6 +306,7 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
List<CusManager> cusManagerList = new ArrayList<>();
|
||||
List<CusContacts> cusContactsList = new ArrayList<>();
|
||||
List<CusBank> cusBankList = new ArrayList<>();
|
||||
List<CusTimeAxis> cusTimeAxisList = new ArrayList<>();
|
||||
// 遍历每个客户的联系人列表,只保存一次客户信息,但保存所有联系人
|
||||
for (Map.Entry<String, List<CusImportDTO>> entry : customerGroupMap.entrySet()) {
|
||||
List<CusImportDTO> customerContacts = entry.getValue();
|
||||
@ -352,6 +367,14 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
managementInfo.setCreateTime(new Date());
|
||||
cusManagerList.add(managementInfo);
|
||||
|
||||
//客户时间轴信息
|
||||
CusTimeAxis cusTimeAxis = new CusTimeAxis();
|
||||
cusTimeAxis.setBusiMaxCatg("客户");
|
||||
String content = "新增";
|
||||
cusTimeAxis.setBusiCatg(content);
|
||||
cusTimeAxis.setContent(content+"客户信息(导入)");
|
||||
cusTimeAxis.setCusId(customerId);
|
||||
cusTimeAxisList.add(cusTimeAxis);
|
||||
// 提取客户的所有联系人信息 CusContacts
|
||||
for (CusImportDTO contact : customerContacts) {
|
||||
CusContacts customerContact = new CusContacts();
|
||||
@ -412,7 +435,10 @@ public class CusImportServiceImpl implements ICusImportService {
|
||||
if (!cusBankList.isEmpty()) {
|
||||
cusBankService.saveOrUpdateByAccount(cusBankList);
|
||||
}
|
||||
|
||||
//批量保存时间轴信息
|
||||
if(!cusBankList.isEmpty()){
|
||||
cusTimeAxisService.saveNewTimeAxisBatch(cusTimeAxisList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -88,4 +88,22 @@ public class CusTimeAxisServiceImpl extends ServiceImpl<CusTimeAxisMapper,CusTim
|
||||
cusTimeAxis.setCreateTime(new Date());
|
||||
this.save(cusTimeAxis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建客户时间轴记录--批量
|
||||
*
|
||||
* @param cusTimeAxisList TODO
|
||||
* @author vinjor-M
|
||||
* @date 12:57 2025/11/18
|
||||
**/
|
||||
@Override
|
||||
public void saveNewTimeAxisBatch(List<CusTimeAxis> cusTimeAxisList) {
|
||||
LoginUser securityUser = SecurityUtils.getLoginUser();
|
||||
cusTimeAxisList.forEach(item->{
|
||||
item.setUserId(securityUser.getUserId());
|
||||
item.setUserName(securityUser.getUser().getNickName());
|
||||
item.setCreateTime(new Date());
|
||||
});
|
||||
this.saveBatch(cusTimeAxisList);
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ public class CodeGenerator {
|
||||
/**
|
||||
* 每日最大序号(3位最大为999)
|
||||
*/
|
||||
private static final long MAX_SEQ = 999L;
|
||||
private static final long MAX_SEQ = 9999L;
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
@ -54,7 +54,7 @@ public class CodeGenerator {
|
||||
|
||||
// 4. 校验序号是否超出最大值
|
||||
if (seq == null || seq > MAX_SEQ) {
|
||||
throw new RuntimeException("今日客户编码已达上限(999个),请明日再试");
|
||||
throw new RuntimeException("今日客户编码已达上限(9999个),请明日再试");
|
||||
}
|
||||
|
||||
// 5. 序号补零(不足3位前面补0)
|
||||
|
||||
@ -504,7 +504,9 @@ export default {
|
||||
updateUser(dataObj).then((resp) => {
|
||||
if(resp.code==200){
|
||||
this.$message.success("操作成功");
|
||||
this.$refs.companyInfo.handleQuery();
|
||||
setTimeout(()=>{
|
||||
that.closeAndBack()
|
||||
},500)
|
||||
}else{
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user