|
@@ -412,21 +412,54 @@ public class ByteDanceVideoReportDailyServiceImpl extends ServiceImpl<ByteDanceV
|
|
return pageInfo;
|
|
return pageInfo;
|
|
}
|
|
}
|
|
|
|
|
|
- public List<ByteDanceVideoReportDaily> videoInfoListDetail(String startDate, String endDate, String signature){
|
|
|
|
|
|
+ public List<ByteDanceVideoReportDaily> videoInfoListDetail(String startDate, String endDate, String signature, Long[] accountIds){
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String userId = sysUser.getId();
|
|
String userId = sysUser.getId();
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = byteDanceVideoReportDailyMapper.getRoleCodeByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
String companyId = byteDanceVideoReportDailyMapper.getCompanyIdByUserId(userId);
|
|
|
|
|
|
- List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature, roleCode);
|
|
|
|
|
|
+ //List<ByteDanceVideoReportDaily> mList = byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature, roleCode);
|
|
|
|
+ List<ByteDanceVideoReportDaily> mList =new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<Long> accountIdsList = null;
|
|
|
|
+ if(accountIds != null && accountIds.length != 0){
|
|
|
|
+ accountIdsList = Arrays.asList(accountIds);
|
|
|
|
+ }
|
|
|
|
+ //admin能看所有视频
|
|
|
|
+ if(roleCode.equals("admin")){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetail(companyId, startDate, endDate, signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("touTiaoOperationManager") || roleCode.equals("operator") || roleCode.equals("operationAssistant")) {
|
|
|
|
+ if (accountIdsList != null && accountIdsList.size() != 0){
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailOperator(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else{
|
|
|
|
+ accountIdsList= byteDanceVideoReportDailyMapper.getAccountIdsByOperatorIdAndMediaId(1,userId);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailOperator(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }
|
|
|
|
+ }else if(roleCode.equals("shot")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("plan")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("plane")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("clip")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }else if(roleCode.equals("designTeamLeader")){
|
|
|
|
+ accountIdsList = byteDanceVideoReportDailyMapper.getAccountIds(companyId, signature);
|
|
|
|
+ mList = byteDanceVideoReportDailyMapper.videoInfoListDetailDesign(companyId, startDate,endDate,signature, accountIdsList);
|
|
|
|
+ }
|
|
|
|
+
|
|
//计算环比
|
|
//计算环比
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
for(ByteDanceVideoReportDaily m:mList){
|
|
- Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
- String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
- String endMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-1));
|
|
|
|
- List<Long> accountIdsList = new ArrayList<>();
|
|
|
|
- accountIdsList.add(m.getAccountId());
|
|
|
|
- BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(startMonthDate,endMonthDate,m.getSignature(),accountIdsList);
|
|
|
|
|
|
+ //Integer datediff = DateUtils.dateDiff(startDate, endDate);
|
|
|
|
+ //String startMonthDate = DateUtils.formatDate(DateUtils.addDay(startDate,-(datediff + 1) ) );
|
|
|
|
+ String beforeDate = DateUtils.formatDate(DateUtils.addDay(m.getStatDatetime(),-1));
|
|
|
|
+ //List<Long> accountIdsList = new ArrayList<>();
|
|
|
|
+ //accountIdsList.add(m.getAccountId());
|
|
|
|
+ BigDecimal costBefore = byteDanceVideoReportDailyMapper.getVideoReportDailyByDateAndSignature(beforeDate,beforeDate,m.getSignature(),accountIdsList);
|
|
|
|
|
|
BigDecimal huanbi =BigDecimal.ZERO;
|
|
BigDecimal huanbi =BigDecimal.ZERO;
|
|
if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|
|
if(costBefore != null && costBefore.compareTo(BigDecimal.ZERO)>0){
|