Commit eb85b4c6 by guojx

Merge branch 'feature-2023-01-目标配置' into 'developer'

目标跟进:接口公用参数调整

See merge request !927
parents 47392f2f 82087dd3
......@@ -151,9 +151,12 @@ public class TargetController {
@ResponseBody
public RestResponse getTargetAnalysisStoreDetail(QueryDataStatisticsCommonQO qo, PageQo pageQo,
String sortField, String sortType, @RequestParam(defaultValue = "1") Integer type) {
List<String> keyList = TargetAnalysisUtils.map.get(type.toString());
JSONObject jsonObject = getCommon(qo, type <= 3 ? false : true);
if (StringUtils.isNotBlank(sortField)) {
jsonObject.put("orderByField", sortField + " " + sortType);
} else {
jsonObject.put("orderByField", keyList.get(3) + " desc ");
}
Map<String, Object> res = DataTargetHttpUtils.http(DataTargetHttpUtils.getParam(pageQo, jsonObject).toJSONString(),
type <=3 ? (qo.getTimeType() == 1 ? "data_mbr_target_store_detail_year" : "data_mbr_target_store_detail_month") : (qo.getTimeType() == 1 ?
......@@ -166,7 +169,6 @@ public class TargetController {
}
JSONObject totalJson = (JSONObject) totalRes.getResult();
JSONObject total = new JSONObject();
List<String> keyList = TargetAnalysisUtils.map.get(type.toString());
for (String key : keyList) {
total.put(key, totalJson.get(key));
}
......@@ -230,13 +232,11 @@ public class TargetController {
JSONObject jsonObject = new JSONObject();
jsonObject.put("entId", qo.getEnterpriseId());
jsonObject.put("enterpriseId", qo.getEnterpriseId());
if (qo.getTimeType() == 1) {
jsonObject.put("year", qo.getTime());
jsonObject.put("yearDate", qo.getTime());
} else {
jsonObject.put("month", qo.getTime());
jsonObject.put("monthDate", qo.getTime());
}
jsonObject.put("year", qo.getTime());
jsonObject.put("yearDate", qo.getTime());
jsonObject.put("month", qo.getTime());
jsonObject.put("monthDate", qo.getTime());
jsonObject.put("storeId", getStoreIdList(qo).stream().collect(Collectors.joining(",")));
return jsonObject;
}
......
......@@ -131,6 +131,9 @@ public class DataTargetHttpUtils {
head.put("Content-Type", "application/json");
head.put("API-TOKEN", token);
Map<String, Object> res = HttpClient.getWinxinResByJson(url, jsonParam, head);
if (!isSuccess(res)) {
throw new TargetException((String) res.get("errorInfo"));
}
LOGGER.info("调用接口{},返回结果:{}", url, res);
return res;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment