|
@@ -2,6 +2,7 @@ package com.slibra.system.service.impl;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
import javax.validation.Validator;
|
|
|
|
|
@@ -13,6 +14,7 @@ import com.slibra.business.mapper.CAgentMapper;
|
|
|
import com.slibra.business.mapper.CAgentMonitorMapper;
|
|
|
import com.slibra.business.mapper.CHumanServiceMapMapper;
|
|
|
import com.slibra.business.mapper.CPhoneMapper;
|
|
|
+import com.slibra.common.utils.DateUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -349,8 +351,16 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
log.info("当前更新用户的时候,所携带的角色包含坐席的角色");
|
|
|
Long userId = user.getUserId();
|
|
|
//先去判断在坐席里面,是否已经关联过用户了,如果关联过了,就不需要再增加
|
|
|
- if(!CollectionUtils.isEmpty(this.cAgentMapper.selectCAgentList(CAgent.builder().userId(userId).build()))){
|
|
|
+ List<CAgent> cAgents = this.cAgentMapper.selectCAgentList(CAgent.builder().userId(userId).build());
|
|
|
+ if(!CollectionUtils.isEmpty(cAgents)){
|
|
|
log.info("用户ID{}已经绑定过坐席了,无需重复添加", userId);
|
|
|
+ //2025年01月07日09:33:45 新增逻辑:如果用户的昵称改了,那么对应坐席中的用户的昵称也要修改
|
|
|
+ CAgent cAgent = cAgents.get(0);
|
|
|
+ if(!Objects.isNull(cAgent)){
|
|
|
+ cAgent.setAgentName(user.getNickName());
|
|
|
+ cAgent.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ this.cAgentMapper.updateCAgent(cAgent);
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
//没有添加过 添加坐席和坐席监控,并在坐席里插入用户的ID、姓名、密码字段
|