|
@@ -658,7 +658,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum")+trustUnitNum);//智能托管
|
|
|
*/
|
|
|
//查询 有效 上新计划 上新组
|
|
|
- JSONObject newEffect = materialStareMapper.getBytedanceAccountBaseByUserId(null,projectInfo.getProjectId(),null,now,now);
|
|
|
+ JSONObject newEffect = materialStareMapper.getBytedanceAccountBaseByUserId(null,projectInfo.getProjectId(),null,startDate,entDate);
|
|
|
projectInfo.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
|
|
|
projectInfo.setNewVideoNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newVideoNum"));//上新
|
|
|
projectInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
|
|
@@ -688,9 +688,6 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
}
|
|
|
projectInfo.setEquallyRate(equallyRate);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
//快手
|
|
|
if (mediaType.equals("2")){
|
|
@@ -762,8 +759,6 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
PageInfo<KuaiShouOperateProjectVo> pageInfo = new PageInfo<>(listOperate);
|
|
|
return Result.successMsg("运营项目列表数据查询成功。",pageInfo);
|
|
|
}catch (Exception e){
|
|
@@ -774,9 +769,11 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
|
|
|
|
|
|
|
|
|
- public List<KuaiShouOperateProjectVo> exportKuaiShouOperateProjectInfo(String startTime, String endTime, String userId) {
|
|
|
+ public List<KuaiShouOperateProjectVo> exportKuaiShouOperateProjectInfo(String mediaType,String startTime, String endTime, String userId) {
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("0.00%");
|
|
|
long now = Long.valueOf(DateUtils.getDateInteger(DateUtils.getDate("yyyy-MM-dd")));
|
|
|
+ List<KuaiShouOperateProjectVo> listOperate = new ArrayList<>();
|
|
|
+
|
|
|
try {
|
|
|
//查询当前人员所有下级
|
|
|
Set<String> operatorUserIds = getAffiliateId(userId);
|
|
@@ -798,72 +795,149 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
endEqually = DateUtils.getDateInteger(DateUtils.addDayParse(String.valueOf(DateUtils.getDateInteger(endTime)), -7));
|
|
|
}
|
|
|
|
|
|
- //查询运营数据-项目维度
|
|
|
- List<KuaiShouOperateProjectVo> listOperate = materialStareMapper.getKuaiShouOperateProjectInfo(startDate,entDate,null,operatorUserIds);
|
|
|
- for (KuaiShouOperateProjectVo projectInfo : listOperate) {
|
|
|
- String projectId = projectInfo.getProjectId();
|
|
|
+ //头条
|
|
|
+ if (mediaType.equals("1")){
|
|
|
+ //查询运营数据-项目维度
|
|
|
+ listOperate = materialStareMapper.getBytedanceOperateProjectInfo(startDate,entDate,null,operatorUserIds);
|
|
|
+ for (KuaiShouOperateProjectVo projectInfo : listOperate) {
|
|
|
+ String projectId = projectInfo.getProjectId();
|
|
|
+ //环比 = (当前 - 上阶段 ) / 上阶段
|
|
|
+ String yearOnYear = "0";
|
|
|
+ //当天
|
|
|
+ int newUnitNumNow = 0;
|
|
|
+ int trustUnitNum = 0;
|
|
|
+ if (startDate == now || entDate == now){
|
|
|
|
|
|
- //环比 = (当前 - 上阶段 ) / 上阶段
|
|
|
- String yearOnYear = "0";
|
|
|
+ //查询当天数据
|
|
|
|
|
|
- //当天
|
|
|
- int newUnitNumNow = 0;
|
|
|
- int trustUnitNum = 0;
|
|
|
- if (startDate == now || entDate == now){
|
|
|
- //查询 当天有效 上新计划 上新组
|
|
|
- JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(null,projectInfo.getProjectId(),null,now,now);
|
|
|
- newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum");//组
|
|
|
- trustUnitNum = Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum");//智能托管
|
|
|
|
|
|
- //时报 消费
|
|
|
- //环比 = (当前 - 上阶段 ) / 上阶段
|
|
|
- int hour = DateUtils.getNowHour();
|
|
|
- List<KuaiShouOperateProjectVo> projectYearOnYearInfoNow = materialStareMapper.getKuaiShouOperateProjectInfoHour(startDate,entDate,hour,projectId,operatorUserIds);
|
|
|
- List<KuaiShouOperateProjectVo> projectYearOnYearInfoLast = materialStareMapper.getKuaiShouOperateProjectInfoHour(lastTimeStart,lastTimeEnd,hour,projectId,operatorUserIds);
|
|
|
- if (!Check.isNull(projectYearOnYearInfoNow) && !Check.isNull(projectYearOnYearInfoLast)){
|
|
|
- Double yearOnYearD = (projectYearOnYearInfoNow.get(0).getTotalCost() - projectYearOnYearInfoLast.get(0).getTotalCost()) / projectYearOnYearInfoNow.get(0).getTotalCost();
|
|
|
- yearOnYear = decimalFormat.format(yearOnYearD);
|
|
|
+ //时报 消费
|
|
|
+ //环比 = (当前 - 上阶段 ) / 上阶段
|
|
|
+ int hour = DateUtils.getNowHour();
|
|
|
+ List<KuaiShouOperateProjectVo> projectYearOnYearInfoNow = materialStareMapper.getBytedanceOperateProjectInfoHour(startDate,entDate,hour,projectId,operatorUserIds);
|
|
|
+ List<KuaiShouOperateProjectVo> projectYearOnYearInfoLast = materialStareMapper.getBytedanceOperateProjectInfoHour(lastTimeStart,lastTimeEnd,hour,projectId,operatorUserIds);
|
|
|
+ if (!Check.isNull(projectYearOnYearInfoNow) && !Check.isNull(projectYearOnYearInfoLast)){
|
|
|
+ Double yearOnYearD = (projectYearOnYearInfoNow.get(0).getTotalCost() - projectYearOnYearInfoLast.get(0).getTotalCost()) / projectYearOnYearInfoNow.get(0).getTotalCost();
|
|
|
+ yearOnYear = decimalFormat.format(yearOnYearD);
|
|
|
+ }
|
|
|
+ projectInfo.setYearOnYear(yearOnYear);
|
|
|
+ }else {
|
|
|
+ //环比 日报
|
|
|
+ List<KuaiShouOperateProjectVo> projectYearOnYearInfo = materialStareMapper.getBytedanceOperateProjectInfo(lastTimeStart,lastTimeEnd,projectId,operatorUserIds);
|
|
|
+ if (!Check.isNull(projectYearOnYearInfo)){
|
|
|
+ Double yearOnYearD = (projectInfo.getTotalCost() - projectYearOnYearInfo.get(0).getTotalCost()) / projectYearOnYearInfo.get(0).getTotalCost();
|
|
|
+ yearOnYear = decimalFormat.format(yearOnYearD);
|
|
|
+ }
|
|
|
+ projectInfo.setYearOnYear(yearOnYear);
|
|
|
}
|
|
|
- projectInfo.setYearOnYear(yearOnYear);
|
|
|
- }else {
|
|
|
- //环比 日报
|
|
|
- List<KuaiShouOperateProjectVo> projectYearOnYearInfo = materialStareMapper.getKuaiShouOperateProjectInfo(lastTimeStart,lastTimeEnd,projectId,operatorUserIds);
|
|
|
- if (!Check.isNull(projectYearOnYearInfo)){
|
|
|
- Double yearOnYearD = (projectInfo.getTotalCost() - projectYearOnYearInfo.get(0).getTotalCost()) / projectYearOnYearInfo.get(0).getTotalCost();
|
|
|
- yearOnYear = decimalFormat.format(yearOnYearD);
|
|
|
+
|
|
|
+ //查询 有效 上新视频 爆款视频
|
|
|
+ /* JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(null,projectInfo.getProjectId(),null,startDate,entDate);
|
|
|
+ projectInfo.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
|
|
|
+ projectInfo.setNewVideoNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newVideoNum"));//上新
|
|
|
+ projectInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
|
|
|
+ projectInfo.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum")+newUnitNumNow);//基建数
|
|
|
+ projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum")+trustUnitNum);//智能托管
|
|
|
+*/
|
|
|
+ //查询 有效 上新计划 上新组
|
|
|
+ JSONObject newEffect = materialStareMapper.getBytedanceAccountBaseByUserId(null,projectInfo.getProjectId(),null,startDate,entDate);
|
|
|
+ projectInfo.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
|
|
|
+ projectInfo.setNewVideoNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newVideoNum"));//上新
|
|
|
+ projectInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
|
|
|
+ projectInfo.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum"));//基建数
|
|
|
+ projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum"));//智能托管
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+
|
|
|
+ //查看 上传到助手、媒体的素材数量 分版位花费
|
|
|
+ List<JSONObject> materailUpload = materialStareMapper.getKuaiShouMaterailUploadType(projectInfo.getProjectId(),startDate,entDate);
|
|
|
+ projectInfo.setAdspNum(Check.isNull(materailUpload) ? 0L : JSONObject.parseObject(materailUpload.get(0)+"").getLong("num"));//上传到助手
|
|
|
+ projectInfo.setMediaNum(Check.isNull(materailUpload) ? 0L : JSONObject.parseObject(materailUpload.get(1)+"").getLong("num"));//上传到媒体
|
|
|
+ //分版位
|
|
|
+ List<JSONObject> adSceneDate = materialStareMapper.getKuaiShouAdSceneData(projectInfo.getProjectId(),startDate,entDate);
|
|
|
+ projectInfo.setAdSceneDate(adSceneDate);
|
|
|
+*/
|
|
|
+
|
|
|
+ //同比 日期超过 7 天 则不显示
|
|
|
+ String equallyRate = "-";
|
|
|
+ if (daysBetween <= 7){
|
|
|
+ List<KuaiShouOperateProjectVo> projectEquallyInfo = materialStareMapper.getBytedanceOperateProjectInfo(startEqually,endEqually,projectId,operatorUserIds);
|
|
|
+ if (!Check.isNull(projectEquallyInfo)){
|
|
|
+ Double equallyRateD = (projectInfo.getTotalCost() - projectEquallyInfo.get(0).getTotalCost()) / projectEquallyInfo.get(0).getTotalCost();
|
|
|
+ equallyRate = decimalFormat.format(equallyRateD);
|
|
|
+ }
|
|
|
}
|
|
|
- projectInfo.setYearOnYear(yearOnYear);
|
|
|
+ projectInfo.setEquallyRate(equallyRate);
|
|
|
}
|
|
|
+ }
|
|
|
+ //快手
|
|
|
+ if (mediaType.equals("2")){
|
|
|
+ //查询运营数据-项目维度
|
|
|
+ listOperate = materialStareMapper.getKuaiShouOperateProjectInfo(startDate,entDate,null,operatorUserIds);
|
|
|
+ for (KuaiShouOperateProjectVo projectInfo : listOperate) {
|
|
|
+ String projectId = projectInfo.getProjectId();
|
|
|
+ //环比 = (当前 - 上阶段 ) / 上阶段
|
|
|
+ String yearOnYear = "0";
|
|
|
+ //当天
|
|
|
+ int newUnitNumNow = 0;
|
|
|
+ int trustUnitNum = 0;
|
|
|
+ if (startDate == now || entDate == now){
|
|
|
+ //查询 当天有效 上新计划 上新组
|
|
|
+ JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(null,projectInfo.getProjectId(),null,now,now);
|
|
|
+ newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum");//组
|
|
|
+ trustUnitNum = Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum");//智能托管
|
|
|
|
|
|
- //查询 有效 上新视频 爆款视频
|
|
|
- JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(null,projectInfo.getProjectId(),null,startDate,entDate);
|
|
|
- projectInfo.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
|
|
|
- projectInfo.setNewVideoNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newVideoNum"));//上新
|
|
|
- projectInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
|
|
|
+ //时报 消费
|
|
|
+ //环比 = (当前 - 上阶段 ) / 上阶段
|
|
|
+ int hour = DateUtils.getNowHour();
|
|
|
+ List<KuaiShouOperateProjectVo> projectYearOnYearInfoNow = materialStareMapper.getKuaiShouOperateProjectInfoHour(startDate,entDate,hour,projectId,operatorUserIds);
|
|
|
+ List<KuaiShouOperateProjectVo> projectYearOnYearInfoLast = materialStareMapper.getKuaiShouOperateProjectInfoHour(lastTimeStart,lastTimeEnd,hour,projectId,operatorUserIds);
|
|
|
+ if (!Check.isNull(projectYearOnYearInfoNow) && !Check.isNull(projectYearOnYearInfoLast)){
|
|
|
+ Double yearOnYearD = (projectYearOnYearInfoNow.get(0).getTotalCost() - projectYearOnYearInfoLast.get(0).getTotalCost()) / projectYearOnYearInfoNow.get(0).getTotalCost();
|
|
|
+ yearOnYear = decimalFormat.format(yearOnYearD);
|
|
|
+ }
|
|
|
+ projectInfo.setYearOnYear(yearOnYear);
|
|
|
+ }else {
|
|
|
+ //环比 日报
|
|
|
+ List<KuaiShouOperateProjectVo> projectYearOnYearInfo = materialStareMapper.getKuaiShouOperateProjectInfo(lastTimeStart,lastTimeEnd,projectId,operatorUserIds);
|
|
|
+ if (!Check.isNull(projectYearOnYearInfo)){
|
|
|
+ Double yearOnYearD = (projectInfo.getTotalCost() - projectYearOnYearInfo.get(0).getTotalCost()) / projectYearOnYearInfo.get(0).getTotalCost();
|
|
|
+ yearOnYear = decimalFormat.format(yearOnYearD);
|
|
|
+ }
|
|
|
+ projectInfo.setYearOnYear(yearOnYear);
|
|
|
+ }
|
|
|
|
|
|
- projectInfo.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum")+newUnitNumNow);//基建数
|
|
|
- projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum")+trustUnitNum);//智能托管
|
|
|
+ //查询 有效 上新视频 爆款视频
|
|
|
+ JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(null,projectInfo.getProjectId(),null,startDate,entDate);
|
|
|
+ projectInfo.setNewEffectNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newEffectNum"));//有效
|
|
|
+ projectInfo.setNewVideoNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newVideoNum"));//上新
|
|
|
+ projectInfo.setNewHotNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newHotNum"));//爆款
|
|
|
|
|
|
- //查看 上传到助手、媒体的素材数量 分版位花费
|
|
|
- List<JSONObject> materailUpload = materialStareMapper.getKuaiShouMaterailUploadType(projectInfo.getProjectId(),startDate,entDate);
|
|
|
+ projectInfo.setNewUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum")+newUnitNumNow);//基建数
|
|
|
+ projectInfo.setTrustUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum")+trustUnitNum);//智能托管
|
|
|
|
|
|
- projectInfo.setAdspNum(Check.isNull(materailUpload) ? 0L : JSONObject.parseObject(materailUpload.get(0)+"").getLong("num"));//上传到助手
|
|
|
- projectInfo.setMediaNum(Check.isNull(materailUpload) ? 0L : JSONObject.parseObject(materailUpload.get(1)+"").getLong("num"));//上传到媒体
|
|
|
+ //查看 上传到助手、媒体的素材数量 分版位花费
|
|
|
+ List<JSONObject> materailUpload = materialStareMapper.getKuaiShouMaterailUploadType(projectInfo.getProjectId(),startDate,entDate);
|
|
|
|
|
|
- //分版位
|
|
|
- List<JSONObject> adSceneDate = materialStareMapper.getKuaiShouAdSceneData(projectInfo.getProjectId(),startDate,entDate);
|
|
|
- projectInfo.setAdSceneDate(adSceneDate);
|
|
|
+ projectInfo.setAdspNum(Check.isNull(materailUpload) ? 0L : JSONObject.parseObject(materailUpload.get(0)+"").getLong("num"));//上传到助手
|
|
|
+ projectInfo.setMediaNum(Check.isNull(materailUpload) ? 0L : JSONObject.parseObject(materailUpload.get(1)+"").getLong("num"));//上传到媒体
|
|
|
|
|
|
- //同比 日期超过 7 天 则不显示
|
|
|
- String equallyRate = "-";
|
|
|
- if (daysBetween <= 7){
|
|
|
- List<KuaiShouOperateProjectVo> projectEquallyInfo = materialStareMapper.getKuaiShouOperateProjectInfo(startEqually,endEqually,projectId,operatorUserIds);
|
|
|
- if (!Check.isNull(projectEquallyInfo)){
|
|
|
- Double equallyRateD = (projectInfo.getTotalCost() - projectEquallyInfo.get(0).getTotalCost()) / projectEquallyInfo.get(0).getTotalCost();
|
|
|
- equallyRate = decimalFormat.format(equallyRateD);
|
|
|
+ //分版位
|
|
|
+ List<JSONObject> adSceneDate = materialStareMapper.getKuaiShouAdSceneData(projectInfo.getProjectId(),startDate,entDate);
|
|
|
+ projectInfo.setAdSceneDate(adSceneDate);
|
|
|
+
|
|
|
+ //同比 日期超过 7 天 则不显示
|
|
|
+ String equallyRate = "-";
|
|
|
+ if (daysBetween <= 7){
|
|
|
+ List<KuaiShouOperateProjectVo> projectEquallyInfo = materialStareMapper.getKuaiShouOperateProjectInfo(startEqually,endEqually,projectId,operatorUserIds);
|
|
|
+ if (!Check.isNull(projectEquallyInfo)){
|
|
|
+ Double equallyRateD = (projectInfo.getTotalCost() - projectEquallyInfo.get(0).getTotalCost()) / projectEquallyInfo.get(0).getTotalCost();
|
|
|
+ equallyRate = decimalFormat.format(equallyRateD);
|
|
|
+ }
|
|
|
}
|
|
|
+ projectInfo.setEquallyRate(equallyRate);
|
|
|
}
|
|
|
- projectInfo.setEquallyRate(equallyRate);
|
|
|
}
|
|
|
|
|
|
return listOperate;
|
|
@@ -1340,7 +1414,6 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
//下级员工
|
|
|
Set<String> operatorUserIds = getAffiliateId(groupVo.getUserId());
|
|
|
//有消耗的账户
|
|
|
-
|
|
|
if (mediaType.equals("1")){
|
|
|
operatorUserIds = materialStareMapper.getBytedanceAllOperators(null,DateUtils.getDateInteger(startTime).longValue(),DateUtils.getDateInteger(endTime).longValue(),operatorUserIds);
|
|
|
|
|
@@ -1371,7 +1444,7 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
}else {
|
|
|
if (daysBetween <= 1){
|
|
|
//时报
|
|
|
- listOperate= materialStareMapper.getKuaiShouOperateInfoHourly(startDate,entDate,operatorUserIds);
|
|
|
+ listOperate= materialStareMapper.getBytedanceOperateInfoHourly(startDate,entDate,operatorUserIds);
|
|
|
}else {
|
|
|
|
|
|
listOperate = materialStareMapper.getKuaiShouOperateInfo(startDate,entDate,operatorUserIds);
|
|
@@ -1504,7 +1577,12 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
//下级员工
|
|
|
Set<String> operatorUserIds = getAffiliateId(groupVo.getUserId());
|
|
|
//有消耗的账户
|
|
|
- operatorUserIds = materialStareMapper.getKuaiShouAllOperators(null,DateUtils.getDateInteger(startTime).longValue(),DateUtils.getDateInteger(endTime).longValue(),operatorUserIds);
|
|
|
+ if (mediaType.equals("1")){
|
|
|
+ operatorUserIds = materialStareMapper.getBytedanceAllOperators(null,DateUtils.getDateInteger(startTime).longValue(),DateUtils.getDateInteger(endTime).longValue(),operatorUserIds);
|
|
|
+ }else {
|
|
|
+ operatorUserIds = materialStareMapper.getKuaiShouAllOperators(null,DateUtils.getDateInteger(startTime).longValue(),DateUtils.getDateInteger(endTime).longValue(),operatorUserIds);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
if (Check.isNull(operatorUserIds) || operatorUserIds.size() < 1){
|
|
|
continue;
|
|
@@ -1517,12 +1595,22 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
//查询账户数据
|
|
|
List<KuaiShouOperateVo> listOperate= new ArrayList<>();
|
|
|
|
|
|
- if (daysBetween <= 1){
|
|
|
- //时报
|
|
|
- listOperate= materialStareMapper.getKuaiShouOperateInfoHourly(startDate,entDate,operatorUserIds);
|
|
|
+ if (mediaType.equals("1")){
|
|
|
+ if (daysBetween <= 1){
|
|
|
+ //时报
|
|
|
+ listOperate= materialStareMapper.getBytedanceOperateInfoHourly(startDate,entDate,operatorUserIds);
|
|
|
+ }else {
|
|
|
+
|
|
|
+ listOperate = materialStareMapper.getBytedanceOperateInfo(startDate,entDate,operatorUserIds);
|
|
|
+ }
|
|
|
}else {
|
|
|
+ if (daysBetween <= 1){
|
|
|
+ //时报
|
|
|
+ listOperate= materialStareMapper.getBytedanceOperateInfoHourly(startDate,entDate,operatorUserIds);
|
|
|
+ }else {
|
|
|
|
|
|
- listOperate = materialStareMapper.getKuaiShouOperateInfo(startDate,entDate,operatorUserIds);
|
|
|
+ listOperate = materialStareMapper.getKuaiShouOperateInfo(startDate,entDate,operatorUserIds);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//总花费
|
|
@@ -1545,8 +1633,14 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
//平均账户消耗 总花费/账户数量
|
|
|
Double aveAccount = accountNum.intValue() == 0 ? 0 : totalCost/accountNum;
|
|
|
groupVo.setAverageAccountCost(new BigDecimal(aveAccount).setScale(3,BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
+
|
|
|
//环比 = (当前 - 上阶段 ) / 上阶段
|
|
|
- List<KuaiShouOperateVo> yearOnYearInfo = materialStareMapper.getKuaiShouOperateInfo(lastTimeStart,lastTimeEnd,operatorUserIds);
|
|
|
+ List<KuaiShouOperateVo> yearOnYearInfo = new ArrayList<>();
|
|
|
+ if (mediaType.equals("1")){
|
|
|
+ yearOnYearInfo = materialStareMapper.getBytedanceOperateInfo(lastTimeStart,lastTimeEnd,operatorUserIds);
|
|
|
+ }else {
|
|
|
+ yearOnYearInfo = materialStareMapper.getKuaiShouOperateInfo(lastTimeStart,lastTimeEnd,operatorUserIds);
|
|
|
+ }
|
|
|
String yearOnYear = "0";
|
|
|
if (!Check.isNull(yearOnYearInfo)){
|
|
|
Double lastTotalCost = Check.isNull(yearOnYearInfo) ? 0 : yearOnYearInfo.stream().mapToDouble(KuaiShouOperateVo::getTotalCost).sum();
|
|
@@ -1559,16 +1653,28 @@ public class MaterialStareServiceImpl implements MaterialStareService {
|
|
|
//当天
|
|
|
int newUnitNumNow = 0;
|
|
|
if (startDate == nowDate || entDate == nowDate){
|
|
|
- //查询 当天有效 上新计划 上新组
|
|
|
- JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(operatorUserIds,null,null,nowDate,nowDate);
|
|
|
+ JSONObject newEffect = new JSONObject();
|
|
|
+ if (mediaType.equals("1")){
|
|
|
+ //查询 当天有效 上新计划 上新组
|
|
|
+ newEffect = materialStareMapper.getBytedanceAccountBaseByUserId(operatorUserIds,null,null,nowDate,nowDate);
|
|
|
+ }else {
|
|
|
+ //查询 当天有效 上新计划 上新组
|
|
|
+ newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(operatorUserIds,null,null,nowDate,nowDate);
|
|
|
+ }
|
|
|
newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum");//组
|
|
|
}
|
|
|
|
|
|
- //查询 历史上新组
|
|
|
- JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(operatorUserIds,null,null,startDate,entDate);
|
|
|
+ if (mediaType.equals("1")){
|
|
|
+ }else {
|
|
|
+ //查询 历史上新组
|
|
|
+ JSONObject newEffect = materialStareMapper.getKuaiShouAccountBaseByUserId(operatorUserIds,null,null,startDate,entDate);
|
|
|
+ newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum")+newUnitNumNow;
|
|
|
+ }
|
|
|
+
|
|
|
//基建数量
|
|
|
- groupVo.setUnitNum(Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum")+newUnitNumNow);//组
|
|
|
+ groupVo.setUnitNum(newUnitNumNow);//组
|
|
|
}
|
|
|
+
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("运营组数据详情", "运营组数据"), KuaiShouOperateGroupVo.class, operationManagerList);
|
|
|
response.setCharacterEncoding("UTF-8");
|
|
|
response.setHeader("content-Type", "application/vnd.ms-excel");
|