| | |
| | | resultList = new ArrayList<Object>();
|
| | | }
|
| | | channelData.put("name", channel);
|
| | | channelData.put("infos", resultList);
|
| | | channelData.put("data_list", resultList);
|
| | | array.add(channelData);
|
| | | }
|
| | |
|
| | |
| | | resultList = new ArrayList<Object>();
|
| | | }
|
| | | channelData.put("name", channel);
|
| | | channelData.put("infos", resultList);
|
| | | channelData.put("data_list", resultList);
|
| | | array.add(channelData);
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 当周产生3单的新增用户概率 |
| | | * @param callback
|
| | | * @param channelArray 渠道名称
|
| | | * @param startTime |
| | | * @param endTime
|
| | | * @param orderNum 订单数量
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getWeekProportion")
|
| | | public void getWeekProportion(String callback, String channelArray, String startTime, String endTime, |
| | | Integer orderNum, PrintWriter out) {
|
| | | |
| | | if (StringUtil.isNullOrEmpty(startTime) || StringUtil.isNullOrEmpty(endTime)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择正确时间区间"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | |
|
| | | if (orderNum == null ) {
|
| | | orderNum = 0;
|
| | | }
|
| | | |
| | |
|
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {}.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | | channelList = new ArrayList<String>();
|
| | | channelList.add("all");
|
| | | }
|
| | | |
| | | JSONArray array = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | | JSONObject channelData = new JSONObject();
|
| | |
|
| | | |
| | | List<Map<String, Object>> resultList = userActiveLogService.countOneWeekUserInfo(channel, |
| | | startTime, endTime, orderNum);
|
| | |
|
| | | if (resultList == null) {
|
| | | resultList = new ArrayList<Map<String, Object>>();
|
| | | }
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | | }
|
| | | |
| | | channelData.put("name", channel);
|
| | | channelData.put("data_list", resultList);
|
| | | array.add(channelData);
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", array);
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | |
| | | resultList = new ArrayList<Object>();
|
| | | }
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "数量");
|
| | | innerList.put("data_list", resultList);
|
| | | |
| | | JSONArray outList = new JSONArray();
|
| | | outList.add(innerList);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("result_list", resultList);
|
| | | data.put("result_list", outList);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|