소스 검색

adq对接

yumeng 1 주 전
부모
커밋
8ce8507622

+ 17 - 2
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/mapper/xml/MaterialStareMapper.xml

@@ -3207,7 +3207,14 @@
         SELECT
         project_id
         FROM
-        ${tableName}
+        <choose>
+            <when test="tableName != null and tableName != ''">
+                ${tableName}
+            </when>
+            <otherwise>
+                application.bytedance_advertiser_report_daily_dw
+            </otherwise>
+        </choose>
         WHERE cost > 0
         <if test="startDate != null and startDate != '' ">
             and stat_datetime &gt;= #{startDate}
@@ -3233,7 +3240,15 @@
         SELECT
         project_id
         FROM
-        ${tableName} d
+        <choose>
+            <when test="tableName != null and tableName != ''">
+                ${tableName}
+            </when>
+            <otherwise>
+                application.kuaishou_account_report_daily_dw
+            </otherwise>
+        </choose>
+        d
         WHERE charge > 0
         <if test="startDate != null and startDate != '' ">
             and stat_date &gt;= #{startDate}

+ 18 - 18
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/MaterialStareServiceImpl.java

@@ -1827,6 +1827,24 @@ public class MaterialStareServiceImpl implements MaterialStareService {
         parameterMap.put("userIds", operatorUserIds);
         parameterMap.put("startEqually", DateUtils.getDateInteger(DateUtils.addDayParse(String.valueOf(DateUtils.getDateInteger(startTime)), -7)));
         parameterMap.put("endEqually", DateUtils.getDateInteger(DateUtils.addDayParse(String.valueOf(DateUtils.getDateInteger(endTime)), -7)));
+        if (mediaType.equals("1")) {
+            if (startDate == now || entDate == now) {
+                parameterMap.put("tableName", "application.bytedance_advertiser_report_hourly_dw");
+                parameterMap.put("hour", DateUtils.getNowHour());
+            } else {
+                parameterMap.put("tableName", "application.bytedance_advertiser_report_daily_dw");
+                parameterMap.remove("hour");
+            }
+        }
+        if (mediaType.equals("2")) {
+            if (startDate == now || entDate == now) {
+                parameterMap.put("tableName", "application.kuaishou_account_report_hourly_dw");
+                parameterMap.put("hour", DateUtils.getNowHour());
+            } else {
+                parameterMap.put("tableName", "application.kuaishou_account_report_daily_dw");
+                parameterMap.remove("hour");
+            }
+        }
 
         //头条
         if (mediaType.equals("1")) {
@@ -1836,12 +1854,6 @@ public class MaterialStareServiceImpl implements MaterialStareService {
             }
             parameterMap.put("projectIds", projectIds);
             PageHelper.startPage(pageNum, pageSize);
-            if (startDate == now || entDate == now) {
-                parameterMap.put("tableName", "application.bytedance_advertiser_report_hourly_dw");
-                parameterMap.put("hour", DateUtils.getNowHour());
-            } else {
-                parameterMap.put("tableName", "application.bytedance_advertiser_report_daily_dw");
-            }
             listOperate = materialStareMapper.getBytedanceOperateProjectInfoNew(parameterMap);
         }
         //快手
@@ -1851,18 +1863,6 @@ public class MaterialStareServiceImpl implements MaterialStareService {
                 return listOperate;
             }
             parameterMap.put("projectIds", projectIds);
-            if (startDate == now || entDate == now) {
-                parameterMap.put("tableName", "application.kuaishou_account_report_hourly_dw");
-                parameterMap.put("hour", DateUtils.getNowHour());
-                   /* //查询 当天有效 上新计划 上新组
-                    JSONObject newEffect = materialStareMapper.getKuaiShouAccountNowBaseByUserId(null, projectIds.get(0)+"", null, now, now);
-                    int newUnitNumNow = 0;
-                    int trustUnitNum = 0;
-                    newUnitNumNow = Check.isNull(newEffect) ? 0 : newEffect.getInteger("newUnitNum");//组
-                    trustUnitNum = Check.isNull(newEffect) ? 0 : newEffect.getInteger("trustUnitNum");//智能托管*/
-            } else {
-                parameterMap.put("tableName", "application.kuaishou_account_report_daily_dw");
-            }
             PageHelper.startPage(pageNum, pageSize);
             listOperate = materialStareMapper.getKuaiShouOperateProjectInfoNew(parameterMap);
             for (KuaiShouOperateProjectVo vo : listOperate) {