|
@@ -2,7 +2,6 @@ package cn.com.ctop.kuaishou.modules.report.service.impl;
|
|
|
|
|
|
import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
|
|
import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccount;
|
|
import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
|
|
import cn.com.ctop.kuaishou.modules.report.entity.KuaishouReportDailyAccountDTO;
|
|
-import cn.com.ctop.kuaishou.modules.report.entity.KuaishouVideoInfoDTO;
|
|
|
|
import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
|
|
import cn.com.ctop.kuaishou.modules.report.entity.ProjectAccountDTO;
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
|
|
import cn.com.ctop.kuaishou.modules.report.mapper.KuaishouReportDailyAccountMapper;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAccountService;
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouReportDailyAccountService;
|
|
@@ -11,12 +10,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
-import org.apache.shiro.mgt.SecurityManager;
|
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -34,11 +31,8 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
//获取快手参与的项目的信息
|
|
//获取快手参与的项目的信息
|
|
@Override
|
|
@Override
|
|
public PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ,Integer yn){
|
|
public PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ,Integer yn){
|
|
- List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
|
|
|
|
-
|
|
|
|
if(projectList==null || projectList.size()==0){
|
|
if(projectList==null || projectList.size()==0){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- //String userId = "a6abfea0f27843bf8595a234410afb04";
|
|
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
|
|
@@ -59,11 +53,8 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort,Integer yn ){
|
|
public PageInfo<ProjectAccountDTO> getKuaishouSaleProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort,Integer yn ){
|
|
- List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
|
|
|
|
-
|
|
|
|
if(projectList==null || projectList.size()==0){
|
|
if(projectList==null || projectList.size()==0){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
|
|
@@ -85,7 +76,6 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouSaleAccountInfoByProjectId(List<Long> projectList, Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouSaleAccountInfoByProjectId(List<Long> projectList, Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
|
|
@@ -106,14 +96,8 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, List<Long> projectList, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, List<Long> projectList, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
-
|
|
|
|
- //List<Long> mediaIds = new ArrayList<>();
|
|
|
|
- //mediaIds.add(2L);
|
|
|
|
- //mediaIds.add(4L);
|
|
|
|
-
|
|
|
|
List<Long> accountIds = null;
|
|
List<Long> accountIds = null;
|
|
if(projectId==null && projectList==null){
|
|
if(projectId==null && projectList==null){
|
|
if("admin".equals(roleCode)){
|
|
if("admin".equals(roleCode)){
|
|
@@ -124,13 +108,15 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
}
|
|
}
|
|
|
|
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
|
|
+ if(null == projectList||projectList.isEmpty()){
|
|
|
|
+ projectList = null;
|
|
|
|
+ }
|
|
return new PageInfo<>(dailyAccountMapper.getKuaishouAccountInfoByProjectId(projectId, startDate, endDate, projectList, accountIds, yn));
|
|
return new PageInfo<>(dailyAccountMapper.getKuaishouAccountInfoByProjectId(projectId, startDate, endDate, projectList, accountIds, yn));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(List<Long> projectList, Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(List<Long> projectList, Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
|
|
@@ -142,16 +128,16 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
|
|
accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if(null == projectList||projectList.isEmpty()){
|
|
|
|
+ projectList = null;
|
|
|
|
+ }
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
return new PageInfo<>(dailyAccountMapper.getKuaishouCampaignInfoByAccountId(projectList, startDate, endDate, accountId,accountIds,yn));
|
|
return new PageInfo<>(dailyAccountMapper.getKuaishouCampaignInfoByAccountId(projectList, startDate, endDate, accountId,accountIds,yn));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(List<Long> projectList, Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(List<Long> projectList, Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
-
|
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
|
|
@@ -163,7 +149,9 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
|
|
accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if(null == projectList||projectList.isEmpty()){
|
|
|
|
+ projectList = null;
|
|
|
|
+ }
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
return new PageInfo<>(dailyAccountMapper.getKuaishouUnitInfoByCampaignId(projectList, startDate, endDate, campaignId,accountIds, yn));
|
|
return new PageInfo<>(dailyAccountMapper.getKuaishouUnitInfoByCampaignId(projectList, startDate, endDate, campaignId,accountIds, yn));
|
|
}
|
|
}
|
|
@@ -171,7 +159,6 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(List<Long> projectList, Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(List<Long> projectList, Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum, Integer yn){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
- //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
|
|
@@ -183,14 +170,11 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
|
|
accountIds = dailyAccountMapper.getUserProjectAccountIds(userId,1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if(null == projectList||projectList.isEmpty()){
|
|
|
|
+ projectList = null;
|
|
|
|
+ }
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
List<KuaishouReportDailyAccountDTO> kuaishouCreativeInfoList = dailyAccountMapper.getKuaishouCreativeInfoByUnitId(projectList, startDate, endDate, unitId,accountIds, yn);
|
|
List<KuaishouReportDailyAccountDTO> kuaishouCreativeInfoList = dailyAccountMapper.getKuaishouCreativeInfoByUnitId(projectList, startDate, endDate, unitId,accountIds, yn);
|
|
- //for(KuaishouReportDailyAccountDTO creativeInfo:kuaishouCreativeInfoList){
|
|
|
|
- // KuaishouVideoInfoDTO videoInfo = dailyAccountMapper.getVideoUrl(creativeInfo.getPhotoId());
|
|
|
|
- // creativeInfo.setUrl(videoInfo.getUrl());
|
|
|
|
- // creativeInfo.setCoverUrl(videoInfo.getCoverUrl());
|
|
|
|
- //}
|
|
|
|
return new PageInfo<>(kuaishouCreativeInfoList);
|
|
return new PageInfo<>(kuaishouCreativeInfoList);
|
|
}
|
|
}
|
|
|
|
|