|  | @@ -29,8 +29,11 @@ import com.ym.mec.im.entity.GroupMember;
 | 
	
		
			
				|  |  |  import com.ym.mec.im.entity.GroupModel;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | +import org.redisson.api.RBucket;
 | 
	
		
			
				|  |  | +import org.redisson.api.RedissonClient;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.dao.DuplicateKeyException;
 | 
	
		
			
				|  |  | +import org.springframework.data.redis.core.RedisTemplate;
 | 
	
		
			
				|  |  |  import org.springframework.security.authentication.LockedException;
 | 
	
		
			
				|  |  |  import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
	
		
			
				|  | @@ -42,6 +45,7 @@ import java.util.*;
 | 
	
		
			
				|  |  |  import java.util.concurrent.CompletableFuture;
 | 
	
		
			
				|  |  |  import java.util.concurrent.ExecutorService;
 | 
	
		
			
				|  |  |  import java.util.concurrent.Executors;
 | 
	
		
			
				|  |  | +import java.util.concurrent.TimeUnit;
 | 
	
		
			
				|  |  |  import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  @Service
 | 
	
	
		
			
				|  | @@ -79,6 +83,8 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 | 
	
		
			
				|  |  |      private SysEmployeePositionDao employeePositionDao;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SysUserTenantService sysUserTenantService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private RedissonClient redissonClient;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public BaseDAO<Integer, Employee> getDAO() {
 | 
	
	
		
			
				|  | @@ -95,6 +101,10 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      @Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  |      public void add(Employee employee) {
 | 
	
		
			
				|  |  | +        RBucket<String> bucket = redissonClient.getBucket("add_employee_lock" + employee.getPhone());
 | 
	
		
			
				|  |  | +        if (!bucket.trySet(employee.getPhone(), 1l, TimeUnit.SECONDS)) {
 | 
	
		
			
				|  |  | +            throw new BizException("请勿重复提交");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          SysUser user = teacherDao.getUserWithPhone(employee.getPhone());
 | 
	
		
			
				|  |  |          Integer tenantId = employee.getTenantId();
 | 
	
		
			
				|  |  |          if (user != null && user.getId() != null) {
 |