|
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -72,26 +73,191 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
}
|
|
|
|
|
|
//视频按天列表
|
|
|
- public List<ByteDanceVideoReportDaily> videoInfoListDaily(String startDate, String endDate, String signature, BigDecimal cost){
|
|
|
+ public PageInfo<ByteDanceVideoReportDaily> videoInfoListDaily(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String userId = sysUser.getId();
|
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
- List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
+ List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
+ //admin能看所有视频
|
|
|
+ if(roleCode.equals("admin")){
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
|
+ }else{
|
|
|
+ List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("shot")){
|
|
|
+ //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plan")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plane")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("clip")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("designTeamLeader")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- return mList;
|
|
|
+ PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
|
+ return pageInfo;
|
|
|
}
|
|
|
|
|
|
|
|
|
//视频报表月列表
|
|
|
- public List<ByteDanceVideoReportDaily> videoInfoListMonth(String startDate, String endDate, String signature, BigDecimal cost){
|
|
|
+ public PageInfo<ByteDanceVideoReportDaily> videoInfoListMonth(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String userId = sysUser.getId();
|
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
- List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
+ List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
+ //admin能看所有视频
|
|
|
+ if(roleCode.equals("admin")){
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
|
+ }else{
|
|
|
+ List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("shot")){
|
|
|
+ //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plan")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plane")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("clip")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("designTeamLeader")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//计算环比
|
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
@@ -114,22 +280,103 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
m.setHuanbi(huanbi);
|
|
|
}
|
|
|
|
|
|
- return mList;
|
|
|
+ PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
|
+ return pageInfo;
|
|
|
}
|
|
|
|
|
|
|
|
|
//视频总报表列表
|
|
|
- public PageInfo<ByteDanceVideoReportDaily> videoInfoListTotal(String startDate, String endDate, String signature, BigDecimal cost){
|
|
|
+ public PageInfo<ByteDanceVideoReportDaily> videoInfoListTotal(String startDate, String endDate, String signature, BigDecimal cost , Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String userId = sysUser.getId();
|
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
- PageHelper.startPage(0,10);
|
|
|
- List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
- PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
|
-
|
|
|
+ List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
+ //admin能看所有视频
|
|
|
+ if(roleCode.equals("admin")){
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
|
+ }else{
|
|
|
+ List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("shot")){
|
|
|
+ //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plan")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plane")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("clip")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("designTeamLeader")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(mList);
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
@@ -145,51 +392,100 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
return mList;
|
|
|
}
|
|
|
|
|
|
- //视频报表月列表
|
|
|
+ //视频报表周列表
|
|
|
public PageInfo<ByteDanceVideoReportDaily> videoInfoListWeek(String startDate, String endDate, String signature, BigDecimal cost, Integer pageNo, Integer pageSize, Long[] projectIds, Long[] accountIds){
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
String userId = sysUser.getId();
|
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
- //QueryWrapper<ByteDanceVideoReportDaily> wrapper = new QueryWrapper<>();
|
|
|
- //wrapper.eq("stat_datetime",startDate);
|
|
|
- //byteDanceVideoReportDailyMapper.delete(wrapper);
|
|
|
List<ByteDanceVideoReportDaily> mList = new ArrayList<>();
|
|
|
//PageHelper.startPage(pageNo,pageSize);
|
|
|
- PageHelper.startPage(0,10);
|
|
|
- mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
- //PageInfo<ByteDanceVideoReportDaily> pageInfo =
|
|
|
-
|
|
|
- //PageInfo<ByteDanceVideoReportDaily> pageInfo = new PageInfo<>(dailyList);
|
|
|
- //result.put("data", pageInfo);
|
|
|
+ //mList = byteDanceVideoReportDailyMapper.videoInfoListWeek(startDate, endDate, roleCode, userId, signature, companyId, cost);
|
|
|
|
|
|
//admin能看所有视频
|
|
|
- if(roleCode == "admin"){
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }else if(roleCode == "touTiaoOperationManager" || roleCode == "operator" || roleCode == "operationAssistant") {
|
|
|
-
|
|
|
-
|
|
|
- }else if(roleCode == "shot"){
|
|
|
-
|
|
|
-
|
|
|
- }else if(roleCode == "plan"){
|
|
|
-
|
|
|
-
|
|
|
- }else if(roleCode == "plane"){
|
|
|
-
|
|
|
-
|
|
|
- }else if(roleCode == "clip"){
|
|
|
-
|
|
|
-
|
|
|
- }else if(roleCode == "designTeamLeader"){
|
|
|
-
|
|
|
-
|
|
|
+ if(roleCode.equals("admin")){
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, accountIdsList, signature, cost);
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupAdmin(startDate, endDate, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
|
+ if (accountIds != null && accountIds.length != 0){
|
|
|
+ List<Long> accountIdsList = Arrays.asList(accountIds);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accountIdsList,signature,cost);
|
|
|
+ }else{
|
|
|
+ List<Long> accoutnIds= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupOperator(startDate,endDate,accoutnIds,signature,cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("shot")){
|
|
|
+ //设计师传入projectIds,根据projectIds解析出accountIdsList
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupShot(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plan")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlan(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("plane")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupPlaneAndPlaneLeader(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("clip")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupClip(startDate, endDate, companyId, userId, null, signature, cost);
|
|
|
+ }
|
|
|
+ }else if(roleCode.equals("designTeamLeader")){
|
|
|
+ if (projectIds != null && projectIds.length != 0){
|
|
|
+ List<Long> projectIdsList = Arrays.asList(projectIds);
|
|
|
+ List<Long> accountIdsList = byteDanceVideoReportDailyMapper.getAccountIdByprojectIds(projectIdsList);
|
|
|
+ if(accountIdsList.size() != 0){
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, accountIdsList, signature, cost);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ PageHelper.startPage(pageNo,pageSize);
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListGroupdesignTeamLeader(startDate, endDate, companyId, null, signature, cost);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//计算环比
|
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
|
String startWeekDate = DateUtils.formatDate(DateUtils.addDay(DateUtils.getDate(startDate),-1));
|
|
@@ -250,6 +546,7 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
|
|
|
|
public void accountVideoMap(){
|
|
|
List<AccountVideoDTO> accountVideoDTOList = byteDanceVideoReportDailyMapper.accountVideoMap();
|
|
|
+ byteDanceVideoReportDailyMapper.replaceIntoAccountVideoMapBatch(accountVideoDTOList);
|
|
|
}
|
|
|
|
|
|
}
|