Browse Source

骄阳新上计划、组

jiequan.bi 4 years ago
parent
commit
2cf20a0e45

+ 1 - 0
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -11,6 +11,7 @@ import cn.com.ctop.common.module.utils.PropertiesUtils;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.core.context.XxlJobHelper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;

+ 18 - 18
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewGroupReportCtrl.java

@@ -17,7 +17,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- *  Created by JQ.bi on 2020.11.6
+ * Created by JQ.bi on 2020.11.6
  */
 @Slf4j
 @RestController
@@ -38,30 +38,30 @@ public class KsNewGroupReportCtrl {
         Result<Map<String, Object>> resultBody = new Result<>();
         Map<String, Object> result = new HashMap<>();
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
-        String userId= requestBody.getString("userId");
+        String userId = requestBody.getString("userId");
         //TODO 没有维护快手事业部负责人角色,增加判断
-        if(userId.equals("6b4c821adc414dc8b7718ab63ccbfcaf")){
-            accountIds= newPlanReportService.getAccountIdsByMedia();
-        }else{
-            if(!userId.isEmpty()){
-                accountIds= newPlanReportService.getAccountIdsByUserId(userId);
+        if (userId.equals("b73c6a1cafb4469a8c0081acd50f703b") || userId.equals("228c45f913924639bf20c79ce5dadb16")) {
+            accountIds = newPlanReportService.getAccountIdsByMedia();
+        } else {
+            if (!userId.isEmpty()) {
+                accountIds = newPlanReportService.getAccountIdsByUserId(userId);
             }
-            if(accountIds.isEmpty()){
+            if (accountIds.isEmpty()) {
                 return resultBody;
             }
         }
 
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
-        String target= requestBody.getString("target");
-        String order= requestBody.getString("order");
+        String target = requestBody.getString("target");
+        String order = requestBody.getString("order");
         try {
             JSONObject sumData = newGroupReportService.getSumNewGroupBy(accountIds, startDate, endDate);
             List<JSONObject> chartData = newGroupReportService.getKsNewGroupGroupByStatDate(accountIds, startDate, endDate);
-            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate,target,order);
-            result.put("sumData",sumData);
-            result.put("chartData",chartData);
-            result.put("listData",listData);
+            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate, target, order);
+            result.put("sumData", sumData);
+            result.put("chartData", chartData);
+            result.put("listData", listData);
             resultBody.setResult(result);
             resultBody.setSuccess(true);
         } catch (Exception e) {
@@ -76,15 +76,15 @@ public class KsNewGroupReportCtrl {
         Result<List<JSONObject>> result = new Result<>();
 
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
-        if(accountIds.isEmpty()){
+        if (accountIds.isEmpty()) {
             return result;
         }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
-        String target= requestBody.getString("target");
-        String order= requestBody.getString("order");
+        String target = requestBody.getString("target");
+        String order = requestBody.getString("order");
         try {
-            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate,target,order);
+            List<JSONObject> listData = newGroupReportService.getKsNewGroupGroupByAccount(accountIds, startDate, endDate, target, order);
             result.setResult(listData);
             result.setSuccess(true);
         } catch (Exception e) {

+ 21 - 17
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/controller/KsNewPlanReportCtrl.java

@@ -16,7 +16,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- *  Created by JQ.bi on 2020.11.2
+ * Created by JQ.bi on 2020.11.2
  */
 @Slf4j
 @RestController
@@ -34,24 +34,28 @@ public class KsNewPlanReportCtrl {
         Result<Map<String, Object>> resultBody = new Result<>();
         Map<String, Object> result = new HashMap<>();
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
-        String userId= requestBody.getString("userId");
-        if(!userId.isEmpty()){
-            accountIds= newPlanReportService.getAccountIdsByUserId(userId);
-        }
-        if(accountIds.isEmpty()){
-            return resultBody;
+        String userId = requestBody.getString("userId");
+        if (userId.equals("b73c6a1cafb4469a8c0081acd50f703b") || userId.equals("228c45f913924639bf20c79ce5dadb16")) {
+            accountIds = newPlanReportService.getAccountIdsByMedia();
+        } else {
+            if (!userId.isEmpty()) {
+                accountIds = newPlanReportService.getAccountIdsByUserId(userId);
+            }
+            if (accountIds.isEmpty()) {
+                return resultBody;
+            }
         }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
-        String target= requestBody.getString("target");
-        String order= requestBody.getString("order");
+        String target = requestBody.getString("target");
+        String order = requestBody.getString("order");
         try {
             JSONObject sumData = newPlanReportService.getSumNewPlanBy(accountIds, startDate, endDate);
             List<JSONObject> chartData = newPlanReportService.getKsNewPlanGroupByStatDate(accountIds, startDate, endDate);
-            List<JSONObject> listData = newPlanReportService.getKsNewPlanGroupByAccount(accountIds, startDate, endDate,target,order);
-            result.put("sumData",sumData);
-            result.put("chartData",chartData);
-            result.put("listData",listData);
+            List<JSONObject> listData = newPlanReportService.getKsNewPlanGroupByAccount(accountIds, startDate, endDate, target, order);
+            result.put("sumData", sumData);
+            result.put("chartData", chartData);
+            result.put("listData", listData);
             resultBody.setResult(result);
             resultBody.setSuccess(true);
         } catch (Exception e) {
@@ -69,15 +73,15 @@ public class KsNewPlanReportCtrl {
         Result<List<JSONObject>> result = new Result<>();
 
         JSONArray accountIds = requestBody.getJSONArray("accountIds");
-        if(accountIds.isEmpty()){
+        if (accountIds.isEmpty()) {
             return result;
         }
         String startDate = requestBody.getString("startDate");
         String endDate = requestBody.getString("endDate");
-        String target= requestBody.getString("target");
-        String order= requestBody.getString("order");
+        String target = requestBody.getString("target");
+        String order = requestBody.getString("order");
         try {
-            List<JSONObject> listData = newPlanReportService.getKsNewPlanGroupByAccount(accountIds, startDate, endDate,target,order);
+            List<JSONObject> listData = newPlanReportService.getKsNewPlanGroupByAccount(accountIds, startDate, endDate, target, order);
             result.setResult(listData);
             result.setSuccess(true);
         } catch (Exception e) {