|
@@ -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) {
|