|
@@ -14,11 +14,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fs.ad.enums.AdUploadType;
|
|
import com.fs.ad.enums.AdUploadType;
|
|
|
import com.fs.ad.service.IAdHtmlClickLogService;
|
|
import com.fs.ad.service.IAdHtmlClickLogService;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.exception.ServiceException;
|
|
import com.fs.common.exception.ServiceException;
|
|
|
import com.fs.common.utils.CloudHostUtils;
|
|
import com.fs.common.utils.CloudHostUtils;
|
|
|
import com.fs.common.utils.PubFun;
|
|
import com.fs.common.utils.PubFun;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
|
|
+import com.fs.company.domain.CompanyUser;
|
|
|
|
|
+import com.fs.company.mapper.CompanyUserMapper;
|
|
|
import com.fs.company.service.ICompanyConfigService;
|
|
import com.fs.company.service.ICompanyConfigService;
|
|
|
import com.fs.config.cloud.CloudHostProper;
|
|
import com.fs.config.cloud.CloudHostProper;
|
|
|
import com.fs.course.domain.FsCourseSop;
|
|
import com.fs.course.domain.FsCourseSop;
|
|
@@ -37,6 +40,7 @@ import com.fs.his.domain.FsUser;
|
|
|
import com.fs.his.mapper.FsUserMapper;
|
|
import com.fs.his.mapper.FsUserMapper;
|
|
|
import com.fs.his.utils.PhoneUtil;
|
|
import com.fs.his.utils.PhoneUtil;
|
|
|
import com.fs.qw.domain.*;
|
|
import com.fs.qw.domain.*;
|
|
|
|
|
+import com.fs.qw.dto.SalesAppDownloadStatDTO;
|
|
|
import com.fs.qw.mapper.*;
|
|
import com.fs.qw.mapper.*;
|
|
|
import com.fs.qw.param.*;
|
|
import com.fs.qw.param.*;
|
|
|
import com.fs.qw.param.newparam.ExternalContactPageListParam;
|
|
import com.fs.qw.param.newparam.ExternalContactPageListParam;
|
|
@@ -71,6 +75,8 @@ import com.fs.sop.service.ISopUserLogsService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.system.service.ISysDictTypeService;
|
|
import com.fs.system.service.ISysDictTypeService;
|
|
|
import com.fs.voice.utils.StringUtil;
|
|
import com.fs.voice.utils.StringUtil;
|
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -220,6 +226,8 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
private QwExternalContactTransferCompanyAuditUserMapper companyAuditUserMapper;
|
|
private QwExternalContactTransferCompanyAuditUserMapper companyAuditUserMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CloudHostProper cloudHostProper;
|
|
private CloudHostProper cloudHostProper;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CompanyUserMapper companyUserMapper;
|
|
|
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(getClass());
|
|
Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
|
@@ -6024,6 +6032,74 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
return qwExternalContactMapper.batchUpdateQwExternalContactMandatoryRegistration( batchList);
|
|
return qwExternalContactMapper.batchUpdateQwExternalContactMandatoryRegistration( batchList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public TableDataInfo getSalesAppDownloadStats(AppDownloadParam param) {
|
|
|
|
|
+
|
|
|
|
|
+ // 分页查询销售列表
|
|
|
|
|
+ PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
|
|
+ List<CompanyUser> sales = companyUserMapper.getSalesByCompanyId(param);
|
|
|
|
|
+
|
|
|
|
|
+ List<Long> userIds = sales.stream().map(CompanyUser::getUserId).collect(Collectors.toList());
|
|
|
|
|
+ if (userIds.isEmpty()) {
|
|
|
|
|
+ return new TableDataInfo(Collections.emptyList(), 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<SalesAppDownloadStatDTO> statDTOs = new ArrayList<>();
|
|
|
|
|
+ for (Long userId : userIds) {
|
|
|
|
|
+ List<Long> longs = qwUserMapper.selectIdByCompanyUserId(userId);
|
|
|
|
|
+ param.setCompanyUserId(userId);
|
|
|
|
|
+ param.setQwUserIds(longs);
|
|
|
|
|
+ SalesAppDownloadStatDTO salesAppDownloadStats = companyUserMapper.getSalesAppDownloadStats(param);
|
|
|
|
|
+ statDTOs.add(salesAppDownloadStats);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// param.setCompanyUserIds(userIds);
|
|
|
|
|
+
|
|
|
|
|
+ // 查询统计数据 不分页
|
|
|
|
|
+ PageHelper.clearPage();
|
|
|
|
|
+ //List<SalesAppDownloadStatDTO> statDTOs = companyUserMapper.getSalesAppDownloadStats(param);
|
|
|
|
|
+
|
|
|
|
|
+ // total 取销售列表总数
|
|
|
|
|
+ Long total = ((Page<?>) sales).getTotal(); // PageHelper 返回的 Page 对象保存 total
|
|
|
|
|
+
|
|
|
|
|
+ return new TableDataInfo(statDTOs, Integer.parseInt(total.toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<SalesAppDownloadStatDTO> exportSalesAppDownloadStats(AppDownloadParam param) {
|
|
|
|
|
+
|
|
|
|
|
+ // 获取当前企业所有销售(不分页)
|
|
|
|
|
+ List<CompanyUser> sales = companyUserMapper.getSalesByCompanyId(param);
|
|
|
|
|
+ List<Long> userIds = sales.stream().map(CompanyUser::getUserId).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ if (userIds.isEmpty()) {
|
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ List<SalesAppDownloadStatDTO> statDTOs = new ArrayList<>();
|
|
|
|
|
+ for (Long userId : userIds) {
|
|
|
|
|
+ List<Long> longs = qwUserMapper.selectIdByCompanyUserId(userId);
|
|
|
|
|
+ param.setCompanyUserId(userId);
|
|
|
|
|
+ param.setQwUserIds(longs);
|
|
|
|
|
+ SalesAppDownloadStatDTO salesAppDownloadStats = companyUserMapper.getSalesAppDownloadStats(param);
|
|
|
|
|
+ statDTOs.add(salesAppDownloadStats);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// param.setCompanyUserIds(userIds);
|
|
|
|
|
+
|
|
|
|
|
+ // 查询统计数据 不分页
|
|
|
|
|
+ PageHelper.clearPage();
|
|
|
|
|
+ //List<SalesAppDownloadStatDTO> statDTOs = companyUserMapper.getSalesAppDownloadStats(param);
|
|
|
|
|
+ statDTOs.forEach(s -> {
|
|
|
|
|
+ if (s.getTotalCustomers() == null || s.getTotalCustomers() == 0) {
|
|
|
|
|
+ s.setDownloadRate(0.00);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ double rate = s.getDownloadCount() * 100.0 / s.getTotalCustomers();
|
|
|
|
|
+ s.setDownloadRate(Double.parseDouble(String.format("%.2f", rate)));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return statDTOs;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public R getRepeat(RepeatParam param) {
|
|
public R getRepeat(RepeatParam param) {
|
|
|
List<QwExternalContact> list = qwExternalContactMapper.selectList(new QueryWrapper<QwExternalContact>().eq("external_user_id", param.getExternalUserId()));
|
|
List<QwExternalContact> list = qwExternalContactMapper.selectList(new QueryWrapper<QwExternalContact>().eq("external_user_id", param.getExternalUserId()));
|