|  | @@ -1,6 +1,11 @@
 | 
	
		
			
				|  |  |  package com.fs.statis.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
	
		
			
				|  |  | +import com.fs.common.utils.StringUtils;
 | 
	
		
			
				|  |  | +import com.fs.company.cache.ICompanyUserCacheService;
 | 
	
		
			
				|  |  | +import com.fs.company.domain.CompanyDept;
 | 
	
		
			
				|  |  |  import com.fs.company.domain.CompanyUser;
 | 
	
		
			
				|  |  | +import com.fs.company.mapper.CompanyDeptMapper;
 | 
	
		
			
				|  |  |  import com.fs.company.mapper.CompanyUserMapper;
 | 
	
		
			
				|  |  |  import com.fs.course.domain.FsUserCoursePeriod;
 | 
	
		
			
				|  |  |  import com.fs.course.mapper.FsUserCoursePeriodMapper;
 | 
	
	
		
			
				|  | @@ -44,9 +49,13 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private final SopUserLogsMapper sopUserLogsMapper;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    private final CompanyDeptMapper companyDeptMapper;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private final ICompanyUserCacheService companyUserCacheService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    public FsStatisSalerWatchServiceImpl(FsStatisSalerWatchMapper fsStatisSalerWatchMapper, CompanyUserMapper companyUserMapper, QwUserMapper qwUserMapper, QwSopLogsMapper qwSopLogsMapper, FsUserCoursePeriodMapper fsUserCoursePeriodMapper, QwSopMapper qwSopMapper, SopUserLogsMapper sopUserLogsMapper) {
 | 
	
		
			
				|  |  | +    public FsStatisSalerWatchServiceImpl(FsStatisSalerWatchMapper fsStatisSalerWatchMapper, CompanyUserMapper companyUserMapper, QwUserMapper qwUserMapper, QwSopLogsMapper qwSopLogsMapper, FsUserCoursePeriodMapper fsUserCoursePeriodMapper, QwSopMapper qwSopMapper, SopUserLogsMapper sopUserLogsMapper, CompanyDeptMapper companyDeptMapper, ICompanyUserCacheService companyUserCacheService) {
 | 
	
		
			
				|  |  |          this.fsStatisSalerWatchMapper = fsStatisSalerWatchMapper;
 | 
	
		
			
				|  |  |          this.companyUserMapper = companyUserMapper;
 | 
	
		
			
				|  |  |          this.qwUserMapper = qwUserMapper;
 | 
	
	
		
			
				|  | @@ -54,6 +63,8 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
 | 
	
		
			
				|  |  |          this.fsUserCoursePeriodMapper = fsUserCoursePeriodMapper;
 | 
	
		
			
				|  |  |          this.qwSopMapper = qwSopMapper;
 | 
	
		
			
				|  |  |          this.sopUserLogsMapper = sopUserLogsMapper;
 | 
	
		
			
				|  |  | +        this.companyDeptMapper = companyDeptMapper;
 | 
	
		
			
				|  |  | +        this.companyUserCacheService = companyUserCacheService;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
	
		
			
				|  | @@ -117,7 +128,22 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param) {
 | 
	
		
			
				|  |  | -        return fsStatisSalerWatchMapper.queryList(param);
 | 
	
		
			
				|  |  | +        List<FsStatisSalerWatch> fsStatisSalerWatches = fsStatisSalerWatchMapper.queryList(param);
 | 
	
		
			
				|  |  | +        for (FsStatisSalerWatch item : fsStatisSalerWatches) {
 | 
	
		
			
				|  |  | +            if(item.getDeptId() != null) {
 | 
	
		
			
				|  |  | +                CompanyDept companyDept = companyDeptMapper.selectCompanyDeptById(item.getDeptId());
 | 
	
		
			
				|  |  | +                if(ObjectUtils.isNotNull(companyDept)) {
 | 
	
		
			
				|  |  | +                    item.setDeptName(companyDept.getDeptName());
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if(item.getCompanyUserId() != null) {
 | 
	
		
			
				|  |  | +                String companyUserName = companyUserCacheService.selectCompanyUserNameUserById(item.getCompanyUserId());
 | 
	
		
			
				|  |  | +                if(StringUtils.isNotEmpty(companyUserName)){
 | 
	
		
			
				|  |  | +                    item.setCompanyUserName(companyUserName);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return fsStatisSalerWatches;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
	
		
			
				|  | @@ -135,10 +161,14 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
 | 
	
		
			
				|  |  |                  log.info("销售{} 对应公司id {} 为空!",companyUser.getUserId(),companyUser.getCompanyId());
 | 
	
		
			
				|  |  |                  continue;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            // 找到销售关联的企微账号
 | 
	
		
			
				|  |  | +            // 找到销售关联的 企微账号
 | 
	
		
			
				|  |  |              List<String> qwUserIdList = qwUserMapper.findQwUserIdListByCompanyUserId(companyUser.getUserId());
 | 
	
		
			
				|  |  | +            if(CollectionUtils.isEmpty(qwUserIdList)){
 | 
	
		
			
				|  |  | +                log.info("当前销售 {} 没有关联企微账号!",companyUser.getUserId());
 | 
	
		
			
				|  |  | +                continue;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            // 确定当前销售对应的sop执行记录
 | 
	
		
			
				|  |  | +            // 确定当前销售对应的sop任务的执行记录
 | 
	
		
			
				|  |  |              List<String> periodList = sopUserLogsMapper.selectSopUserLogsByQwUserIds(qwUserIdList);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              for (String periodId : periodList) {
 |