From 6fdcc0c26dd33e87a024a69ed635d9aedb59cad6 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 07 一月 2020 12:02:50 +0800 Subject: [PATCH] 订单搜索引擎增量更新 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java | 82 +++++++++++++++++++++++++++++------------ 1 files changed, 58 insertions(+), 24 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java index 313556b..d8147f1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/RedPackControllerV2.java @@ -52,6 +52,7 @@ import com.yeshi.fanli.util.TimeUtil; import com.yeshi.fanli.util.UserInviteUtil; import com.yeshi.fanli.vo.redpack.RedPackDetailVO; +import com.yeshi.fanli.vo.redpack.RedPackGiveVO; import com.yeshi.fanli.vo.redpack.RedPackWinInviteVO; import com.yeshi.fanli.vo.redpack.RedPackWinProgressVO; @@ -179,8 +180,9 @@ data.put("extractMax", redPackConfigService.getValueByKey("extract_money_max")); data.put("extractBanlenMin", redPackConfigService.getValueByKey("extract_banlen_min")); data.put("extractDesc", "娉細3涓伐浣滄棩鍐呭畬鎴愬鏍革紝绾㈠寘鎻愮幇鎴愬姛鍚庡皢浼氳繘鍏ュ埌浣欓銆�"); - + data.put("giveTotal", redPackGiveRecordService.countGiveList(uid)); data.put("useLink", redPackConfigService.getValueByKey("use_link")); + data.put("winLink", redPackConfigService.getValueByKey("invite_win_redpack_link")); data.put("todayWin", todayWin.setScale(2).toString()); data.put("yesterdayWin", yesterdayWin.setScale(2).toString()); @@ -297,6 +299,35 @@ } } + + @RequestMapping(value = "getGiveList", method = RequestMethod.POST) + public void getGiveList(AcceptData acceptData, Integer page, Long uid, PrintWriter out) { + if (uid == null || uid <= 0) { + out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�")); + return; + } + + if (page == null || page <= 0) + page = 1; + + try { + List<RedPackGiveVO> list = redPackGiveRecordService.getGiveList(page, Constant.PAGE_SIZE, uid); + + GsonBuilder gsonBuilder = new GsonBuilder(); + Gson gson = gsonBuilder.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy.MM.dd HH:mm").create(); + + JSONObject data = new JSONObject(); + data.put("list", gson.toJson(list)); + data.put("count", redPackGiveRecordService.countGiveList(uid)); + out.print(JsonUtil.loadTrueResult(data)); + } catch (Exception e) { + e.printStackTrace(); + out.print(JsonUtil.loadFalseResult(1, "鏌ヨ澶辫触")); + } + } + + + /** * 杞崲绾㈠寘涓虹湡瀹為噾閽� * @@ -416,29 +447,6 @@ } - /** - * 璇ョ敤鎴烽個璇疯繘搴� - * - * @param acceptData - * @param tid 涓嬬嚎UID - * @param out - */ - @RequestMapping(value = "getInviteProgress") - public void getInviteProgress(AcceptData acceptData, Long uid, Long tid, String callback, PrintWriter out) { - if (uid == null || uid <= 0 || tid == null || tid <= 0) { - JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "浼犻�掑弬鏁扮己澶�")); - return; - } - - JSONObject data = new JSONObject(); - data.put("list", redPackWinInviteService.getInviteProgressByWorkerId(uid, tid)); - data.put("num", threeSaleSerivce.getTeamOrderNumByWorkerId(tid)); - if (!StringUtil.isNullOrEmpty(callback)) { - out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data))); - } else { - out.print(JsonUtil.loadTrueResult(data)); - } - } /** * 璇ョ敤鎴烽個璇峰閲戞 @@ -470,6 +478,7 @@ continue; RedPackWinProgressVO progressVO = new RedPackWinProgressVO(); + progressVO.setUid(userInfo.getId()); progressVO.setName(userInfo.getNickName()); progressVO.setPortrait(userInfo.getPortrait()); progressVO.setMoney(win.getMoney().setScale(2).toString()); @@ -487,4 +496,29 @@ out.print(JsonUtil.loadTrueResult(data)); } } + + + /** + * 璇ョ敤鎴烽個璇疯繘搴� + * + * @param acceptData + * @param tid 涓嬬嚎UID + * @param out + */ + @RequestMapping(value = "getInviteProgress") + public void getInviteProgress(AcceptData acceptData, Long uid, Long tid, String callback, PrintWriter out) { + if (uid == null || uid <= 0 || tid == null || tid <= 0) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "浼犻�掑弬鏁扮己澶�")); + return; + } + + JSONObject data = new JSONObject(); + data.put("list", redPackWinInviteService.getInviteProgressByWorkerId(uid, tid)); + data.put("num", redPackWinInviteService.countTeamNumByTid(uid, tid)); + if (!StringUtil.isNullOrEmpty(callback)) { + out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data))); + } else { + out.print(JsonUtil.loadTrueResult(data)); + } + } } -- Gitblit v1.8.0