|
@@ -31,6 +31,7 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
return dailyAccountMapper.selectCost(accountId, startDate, endDate);
|
|
return dailyAccountMapper.selectCost(accountId, startDate, endDate);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //获取快手参与的项目的信息
|
|
@Override
|
|
@Override
|
|
public PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ){
|
|
public PageInfo<ProjectAccountDTO> getKuaishouProjectInfo(String startDate, String endDate, List<Long> projectList, Integer pageSize, Integer pageNum, String sort ){
|
|
List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
|
|
List<ProjectAccountDTO> projectAccountDTOList = new ArrayList<>();
|
|
@@ -154,26 +155,83 @@ public class KuaishouReportDailyAccountServiceImpl extends ServiceImpl<KuaishouR
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouAccountInfoByProjectId(Long projectId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
+ String userId = sysUser.getId();
|
|
|
|
+ String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
+
|
|
|
|
+ List<Long> accountIds = null;
|
|
|
|
+ if(projectId == null){
|
|
|
|
+ if("admin".equals(roleCode)){
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
|
|
|
|
+ }else {
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
- return new PageInfo<>(dailyAccountMapper.getKuaishouAccountInfoByProjectId(startDate, endDate, projectId));
|
|
|
|
|
|
+ return new PageInfo<>(dailyAccountMapper.getKuaishouAccountInfoByProjectId(startDate, endDate, projectId, accountIds));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCampaignInfoByAccountId(Long accountId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
+ String userId = sysUser.getId();
|
|
|
|
+ String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
+
|
|
|
|
+ List<Long> accountIds = null;
|
|
|
|
+ if(accountId == null){
|
|
|
|
+ if("admin".equals(roleCode)){
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
|
|
|
|
+ }else {
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
- return new PageInfo<>(dailyAccountMapper.getKuaishouCampaignInfoByAccountId(startDate, endDate, accountId));
|
|
|
|
|
|
+ return new PageInfo<>(dailyAccountMapper.getKuaishouCampaignInfoByAccountId(startDate, endDate, accountId,accountIds));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouUnitInfoByCampaignId(Long campaignId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
|
|
+
|
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
+ String userId = sysUser.getId();
|
|
|
|
+ String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
+
|
|
|
|
+ List<Long> accountIds = null;
|
|
|
|
+ if(campaignId == null){
|
|
|
|
+ if("admin".equals(roleCode)){
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
|
|
|
|
+ }else {
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
- return new PageInfo<>(dailyAccountMapper.getKuaishouUnitInfoByCampaignId(startDate, endDate, campaignId));
|
|
|
|
|
|
+ return new PageInfo<>(dailyAccountMapper.getKuaishouUnitInfoByCampaignId(startDate, endDate, campaignId,accountIds));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
public PageInfo<KuaishouReportDailyAccountDTO> getKuaishouCreativeInfoByUnitId(Long unitId, String startDate, String endDate, Integer pageSize, Integer pageNum){
|
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ //String userId = "e9ca23d68d884d4ebb19d07889727dae";
|
|
|
|
+ String userId = sysUser.getId();
|
|
|
|
+ String roleCode = dailyAccountMapper.getRoleCodeByUserId(userId);
|
|
|
|
+
|
|
|
|
+ List<Long> accountIds = null;
|
|
|
|
+ if(unitId == null){
|
|
|
|
+ if("admin".equals(roleCode)){
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIdsByAdmin();
|
|
|
|
+ }else {
|
|
|
|
+ accountIds = dailyAccountMapper.getUserProjectAccountIds(userId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
- List<KuaishouReportDailyAccountDTO> kuaishouCreativeInfoList = dailyAccountMapper.getKuaishouCreativeInfoByUnitId(startDate, endDate, unitId);
|
|
|
|
|
|
+ List<KuaishouReportDailyAccountDTO> kuaishouCreativeInfoList = dailyAccountMapper.getKuaishouCreativeInfoByUnitId(startDate, endDate, unitId,accountIds);
|
|
//for(KuaishouReportDailyAccountDTO creativeInfo:kuaishouCreativeInfoList){
|
|
//for(KuaishouReportDailyAccountDTO creativeInfo:kuaishouCreativeInfoList){
|
|
// KuaishouVideoInfoDTO videoInfo = dailyAccountMapper.getVideoUrl(creativeInfo.getPhotoId());
|
|
// KuaishouVideoInfoDTO videoInfo = dailyAccountMapper.getVideoUrl(creativeInfo.getPhotoId());
|
|
// creativeInfo.setUrl(videoInfo.getUrl());
|
|
// creativeInfo.setUrl(videoInfo.getUrl());
|