| 
					
				 | 
			
			
				@@ -1,114 +0,0 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-package com.fs.statis.service.impl; // 假设Service实现类放在此包下 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.company.domain.CompanyUser; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.qw.mapper.QwUserMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.sop.domain.SopUserLogs; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.statis.domain.FsStatisPeriodWatch; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.statis.domain.FsStatisSalerWatch; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.statis.dto.StatsWatchLogPageListDTO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.statis.mapper.FsStatisPeriodWatchMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.fs.statis.service.FsStatisPeriodWatchService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.time.LocalDate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.ArrayList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Collections; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * 训练营周期统计数据服务实现类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-@Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-public class FsStatisPeriodWatchServiceImpl implements FsStatisPeriodWatchService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private final FsStatisPeriodWatchMapper fsStatisPeriodWatchMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    private final QwUserMapper qwUserMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * 通过构造函数注入Mapper 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @param fsStatisPeriodWatchMapper 训练营周期统计数据Mapper 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public FsStatisPeriodWatchServiceImpl(FsStatisPeriodWatchMapper fsStatisPeriodWatchMapper, QwUserMapper qwUserMapper) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.fsStatisPeriodWatchMapper = fsStatisPeriodWatchMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.qwUserMapper = qwUserMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * {@inheritDoc} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public FsStatisPeriodWatch findById(Integer id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStatisPeriodWatchMapper.selectById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * {@inheritDoc} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Transactional // 标记此方法需要事务管理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int create(FsStatisPeriodWatch fsStatisPeriodWatch) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 在这里可以添加业务逻辑,例如参数校验等 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStatisPeriodWatchMapper.insert(fsStatisPeriodWatch); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * {@inheritDoc} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Transactional // 标记此方法需要事务管理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int updateById(FsStatisPeriodWatch fsStatisPeriodWatch) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 在这里可以添加业务逻辑,例如检查记录是否存在,或在更新前进行特定校验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 注意:Mapper中的updateById是动态SQL,只更新非null字段 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStatisPeriodWatchMapper.updateById(fsStatisPeriodWatch); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * {@inheritDoc} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Transactional // 标记此方法需要事务管理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int deleteById(Integer id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // 在这里可以添加业务逻辑,例如检查关联数据等 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStatisPeriodWatchMapper.deleteById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * {@inheritDoc} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public List<FsStatisPeriodWatch> findAll() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStatisPeriodWatchMapper.selectAll(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public List<FsStatisPeriodWatch> queryList(StatsWatchLogPageListDTO param) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return fsStatisPeriodWatchMapper.queryList(param); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public void writeData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        LocalDate previousDay = LocalDate.now().minusDays(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        // 获取每个sop任务 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        List<SopUserLogs> list = fsStatisPeriodWatchMapper.selectRecords(previousDay); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        for (SopUserLogs logs : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            // 根据sop任务营期id 获取当前任务的企微id列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            String qwUserId = logs.getQwUserId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            // 转换企微id列表为对应的销售 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            Long companyUserId = qwUserMapper.selectCompanyIdByQwUserId(qwUserId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            FsStatisPeriodWatch fsStatisPeriodWatch = new FsStatisPeriodWatch(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            fsStatisPeriodWatch.setPeriodId(logs.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            fsStatisPeriodWatch.setDataDate(previousDay); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            // 获取当前的训练营人数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//            // for 获取 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-//        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 |