|
@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.modules.bytedance.common.utils.Check;
|
|
import org.jeecg.modules.bytedance.common.utils.Check;
|
|
import org.jeecg.modules.bytedance.report.entity.BytedanceReportMaterialDaily;
|
|
import org.jeecg.modules.bytedance.report.entity.BytedanceReportMaterialDaily;
|
|
import org.jeecg.modules.bytedance.report.entity.vo.ReportCostVo;
|
|
import org.jeecg.modules.bytedance.report.entity.vo.ReportCostVo;
|
|
@@ -15,6 +16,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -35,12 +38,19 @@ public class BytedanceReportMaterialDailyServiceImpl extends ServiceImpl<Bytedan
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
List<Map<String, Object>> dailyReportList = bytedanceReportMaterialDailyMapper.selectMaterialDailyReportByAccountId(accountId, startTime, endTime);
|
|
List<Map<String, Object>> dailyReportList = bytedanceReportMaterialDailyMapper.selectMaterialDailyReportByAccountId(accountId, startTime, endTime);
|
|
|
|
|
|
|
|
+ Date maxStatDatetime = null;
|
|
|
|
|
|
for (Map<String, Object> dailyReportMap: dailyReportList) {
|
|
for (Map<String, Object> dailyReportMap: dailyReportList) {
|
|
if(dailyReportMap == null || dailyReportMap.isEmpty()){
|
|
if(dailyReportMap == null || dailyReportMap.isEmpty()){
|
|
return Result.error("头条视频日报数据为空。");
|
|
return Result.error("头条视频日报数据为空。");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if(Check.isNull(maxStatDatetime) || maxStatDatetime.before(DateUtils.str2Date(dailyReportMap.get("statDatetime").toString(),new SimpleDateFormat("yyyy-MM-dd")))){
|
|
|
|
+ maxStatDatetime = DateUtils.str2Date(dailyReportMap.get("statDatetime").toString(),new SimpleDateFormat("yyyy-MM-dd"));
|
|
|
|
+ }
|
|
|
|
+
|
|
if(dailyReportMap.get("count") == null){
|
|
if(dailyReportMap.get("count") == null){
|
|
dailyReportMap.put("count",0);
|
|
dailyReportMap.put("count",0);
|
|
}
|
|
}
|
|
@@ -77,6 +87,13 @@ public class BytedanceReportMaterialDailyServiceImpl extends ServiceImpl<Bytedan
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ for (Map<String, Object> dailyReportMap: dailyReportList) {
|
|
|
|
+ if(!Check.isNull(maxStatDatetime)){
|
|
|
|
+ dailyReportMap.put("statDatetime",maxStatDatetime);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(dailyReportList);
|
|
PageInfo<Map<String, Object>> pageInfo = new PageInfo<Map<String, Object>>(dailyReportList);
|
|
|
|
|
|
return Result.successMsg("数据加载成功。",pageInfo);
|
|
return Result.successMsg("数据加载成功。",pageInfo);
|