Commit d125f46a by guojx

销售数据接口拆分优化

parent 7e5b41e0
...@@ -333,12 +333,9 @@ public class DataController { ...@@ -333,12 +333,9 @@ public class DataController {
@RequestMapping(value = "get-clerk-sales-data") @RequestMapping(value = "get-clerk-sales-data")
@ResponseBody @ResponseBody
public RestResponse getClerkSalesData(@RequestBody ClerkDataDateSelectQO qo) { public RestResponse getClerkSalesData(@RequestBody ClerkDataDateSelectQO qo) {
HandleQO handleQO = EntityUtil.changeEntityNew(HandleQO.class, qo);
handleQO.setApolloKey(qo.getApolloKeyByType());
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo.getApiParam()); JSONObject jsonObject = (JSONObject) JSONObject.toJSON(qo.getApiParam());
jsonObject.put("clerkId", qo.getClerkId()); jsonObject.put("clerkId", qo.getClerkId());
handleQO.setParams(jsonObject.toJSONString()); return handle(getHandel(qo, qo.getApolloKeyByType(), jsonObject.toJSONString()));
return handle(handleQO);
} }
/** /**
...@@ -350,10 +347,8 @@ public class DataController { ...@@ -350,10 +347,8 @@ public class DataController {
@RequestMapping(value = "get-clerk-group-data") @RequestMapping(value = "get-clerk-group-data")
@ResponseBody @ResponseBody
public RestResponse getClerkGroupData(@RequestBody ClerkGroupDataQO qo) { public RestResponse getClerkGroupData(@RequestBody ClerkGroupDataQO qo) {
HandleQO handleQO = EntityUtil.changeEntityNew(HandleQO.class, qo); return handle(getHandel(qo, "data_sales_perf_anal_cont_clerk_group",
handleQO.setApolloKey("data_sales_perf_anal_cont_clerk_group"); JSONObject.toJSONString(qo.getApiParam())));
handleQO.setParams(JSONObject.toJSONString(qo.getApiParam()));
return handle(handleQO);
} }
/** /**
...@@ -365,10 +360,8 @@ public class DataController { ...@@ -365,10 +360,8 @@ public class DataController {
@RequestMapping(value = "get-real-time-sales-data") @RequestMapping(value = "get-real-time-sales-data")
@ResponseBody @ResponseBody
public RestResponse getRelaTimeSalesData(@RequestBody StoreRealTimeSalesQO qo) { public RestResponse getRelaTimeSalesData(@RequestBody StoreRealTimeSalesQO qo) {
HandleQO handleQO = EntityUtil.changeEntityNew(HandleQO.class, qo); return handle(getHandel(qo, "data_sales_perf_real_time_overview",
handleQO.setApolloKey("data_sales_perf_real_time_overview"); JSONObject.toJSONString(qo.getApiParam())));
handleQO.setParams(JSONObject.toJSONString(qo.getApiParam()));
return handle(handleQO);
} }
/** /**
...@@ -379,10 +372,15 @@ public class DataController { ...@@ -379,10 +372,15 @@ public class DataController {
@RequestMapping(value = "get-store-sales-data") @RequestMapping(value = "get-store-sales-data")
@ResponseBody @ResponseBody
public RestResponse getStoreSales(@RequestBody StoreSalesDataQO qo) { public RestResponse getStoreSales(@RequestBody StoreSalesDataQO qo) {
HandleQO handleQO = EntityUtil.changeEntityNew(HandleQO.class, qo); return handle(getHandel(qo, qo.getApolloKeyByType(),
handleQO.setApolloKey(qo.getApolloKeyByType()); JSONObject.toJSONString(qo.getApiParam())));
handleQO.setParams(JSONObject.toJSONString(qo.getApiParam())); }
return handle(handleQO);
private static HandleQO getHandel(CommonQO commonQO, String apolloKey, String params) {
HandleQO handleQO = EntityUtil.changeEntityNew(HandleQO.class, commonQO);
handleQO.setApolloKey(apolloKey);
handleQO.setParams(params);
return handleQO;
} }
/** /**
......
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