|
@@ -986,28 +986,16 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, materialName, code, startDate, endDate, userId, projectIds, ascription, clipId, shotId, planId, leaderName, offlineFlag, syncKuaishou, syncBytedance, materialInnovate);
|
|
|
List<MaterialInfo> setList = new ArrayList<>();
|
|
|
PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
|
|
|
+ List<String> md5List = new ArrayList<>();
|
|
|
if (!dailyList.isEmpty()) {
|
|
|
for (MaterialInfo info : dailyList) {
|
|
|
MaterialInfo materialInfo = materialInfoMapper.selectById(info.getId());
|
|
|
+ md5List.add(materialInfo.getCode());
|
|
|
materialInfo.setSlogansCount(info.getSlogansCount());
|
|
|
materialInfo.setOfflineFlag(info.getOfflineFlag());
|
|
|
materialInfo.setConfirmTime(info.getConfirmTime());
|
|
|
//素材名称为空 则使用素材id 同步失败
|
|
|
materialInfo.setMaterialName(Check.isNull(materialInfo.getMaterialName()) ? materialInfo.getId() : materialInfo.getMaterialName());
|
|
|
- //统计快手总消耗数据
|
|
|
- JSONObject kuaishous = materialParameterMapper.getMaterialTotalCharge(info.getCode());
|
|
|
- if (!Check.isNull(kuaishous)) {
|
|
|
- materialInfo.setCost(kuaishous.getBigDecimal("charges"));
|
|
|
- } else {
|
|
|
- materialInfo.setCost(new BigDecimal(0));
|
|
|
- }
|
|
|
- //统计抖音总消耗数据
|
|
|
- JSONObject bytedances = materialParameterMapper.getByteDanceMaterialTotalCharge(info.getCode());
|
|
|
- if (!Check.isNull(bytedances)) {
|
|
|
- materialInfo.setBytedanceCost(bytedances.getBigDecimal("charges"));
|
|
|
- } else {
|
|
|
- materialInfo.setBytedanceCost(new BigDecimal(0));
|
|
|
- }
|
|
|
Project project = projectService.getById(info.getProjectId());
|
|
|
if (!Check.isNull(project)) {
|
|
|
materialInfo.setMediaId(project.getMediaId());
|
|
@@ -1021,6 +1009,42 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
setList.add(materialInfo);
|
|
|
}
|
|
|
}
|
|
|
+ List<JSONObject> kuaiShouCostList = materialParameterMapper.getKuaiShouVideoCostList(md5List);
|
|
|
+ List<JSONObject> bytedanceCostList = materialParameterMapper.getBytedanceVideoCostList(md5List);
|
|
|
+
|
|
|
+ Map<String,BigDecimal> kuaishouMap = new HashMap<>();
|
|
|
+ for (int i = 0; i < kuaiShouCostList.size(); i++) {
|
|
|
+ JSONObject jsonObject = kuaiShouCostList.get(i);
|
|
|
+ kuaishouMap.put(jsonObject.getString("signature"),jsonObject.getBigDecimal("charges"));
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String,BigDecimal> bytedanceMap = new HashMap<>();
|
|
|
+ for (int i = 0; i < bytedanceCostList.size(); i++) {
|
|
|
+ JSONObject jsonObject = bytedanceCostList.get(i);
|
|
|
+ bytedanceMap.put(jsonObject.getString("signature"),jsonObject.getBigDecimal("charges"));
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i <setList.size() ; i++) {
|
|
|
+ MaterialInfo materialInfo = setList.get(i);
|
|
|
+ if(!Check.isNullMap(kuaishouMap)){
|
|
|
+ if (!Check.isNull(kuaishouMap.get(materialInfo.getCode()))) {
|
|
|
+ materialInfo.setCost(kuaishouMap.get(materialInfo.getCode()));
|
|
|
+ } else {
|
|
|
+ materialInfo.setCost(new BigDecimal(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!Check.isNullMap(bytedanceMap)){
|
|
|
+ if (!Check.isNull(bytedanceMap.get(materialInfo.getCode()))) {
|
|
|
+ materialInfo.setBytedanceCost(bytedanceMap.get(materialInfo.getCode()));
|
|
|
+ } else {
|
|
|
+ materialInfo.setBytedanceCost(new BigDecimal(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
pageInfo.setList(setList);
|
|
|
result.put("data", pageInfo);
|
|
|
ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|