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/wxmp/v1/InviteController.java | 91 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 87 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java index f6d1b28..358cbec 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/InviteController.java @@ -15,6 +15,7 @@ import org.yeshi.utils.DateUtil; import org.yeshi.utils.JsonUtil; +import com.yeshi.fanli.dto.WXMPAcceptData; import com.yeshi.fanli.entity.accept.AcceptData; import com.yeshi.fanli.entity.bus.user.ThreeSale; import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo; @@ -57,7 +58,7 @@ private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce; /** - * 绔欏唴淇℃彁閱掗槦鍛樻坊鍔犲井淇″彿 + * 涓撳睘閭�璇风爜鏉′欢 * * @param acceptData * @param uid @@ -65,15 +66,38 @@ * @param out */ @RequestMapping(value = "tailorCode") - public void tailorCode(AcceptData acceptData, String callback, Long uid, PrintWriter out) { + public void tailorCode(WXMPAcceptData acceptData, String callback, Long uid, PrintWriter out) { if (uid == null) { out.print(JsonUtil.loadFalseResult("鐢ㄦ埛id缂哄け")); return; } + JSONArray array1 = new JSONArray(); + array1.add("1.閭�璇风爜鍙府鍔╁ソ鍙嬫縺娲婚個璇峰姛鑳斤紱"); + array1.add("2.濂藉弸閫氳繃浣犵殑閭�璇风爜婵�娲婚個璇峰姛鑳藉悗锛屽皢鎴愪负浣犵殑鐩存帴绮変笣锛屾湭鏉ヤ骇鐢熺殑璁㈠崟浣犻兘鏈夊閲戯紱"); + array1.add("3.閭�璇风爜鍏锋湁鍞竴鎬с��"); + + JSONObject desc1 = new JSONObject(); + desc1.put("title", "閭�璇风爜鐨勪綔鐢�"); + desc1.put("content",array1); + + JSONArray array2 = new JSONArray(); + array2.add("1.浣犲彲浠ヨ嚜鐢辫缃�4~12浣嶇畝鍗曟槗璁扮殑閭�璇风爜锛�"); + array2.add("2.涓撳睘閭�璇风爜鏄浣犲拰浣犵殑鍥㈤槦灏婅吹韬唤鐨勫桨鏄俱��"); + + JSONObject desc2 = new JSONObject(); + desc2.put("title", "涓撳睘閭�璇风爜浼樺娍"); + desc2.put("content",array2); + + JSONArray array = new JSONArray(); + array.add(desc1); + array.add(desc2); + JSONObject data = new JSONObject(); + data.put("desc", array); data.put("num", threeSaleSerivce.countFirstTeam(uid, 1)); data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT); + out.print(JsonUtil.loadTrueResult(data)); } @@ -85,7 +109,7 @@ * @param out */ @RequestMapping(value = "countMyTeam", method = RequestMethod.POST) - public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) { + public void countMyTeam(WXMPAcceptData acceptData, long uid, PrintWriter out) { try { long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1); long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null); @@ -145,7 +169,7 @@ * @param out */ @RequestMapping(value = "listMyTeam", method = RequestMethod.POST) - public void listMyTeam(AcceptData acceptData, int page, long uid, int type, PrintWriter out) { + public void listMyTeam(WXMPAcceptData acceptData, int page, long uid, int type, PrintWriter out) { if (type != 1 && type != 2) { out.print(JsonUtil.loadFalseResult("绮変笣绫诲瀷涓嶆纭�")); return; @@ -311,4 +335,63 @@ result.put("list", resultArray); return result; } + + /** + * 鑾峰彇鐢ㄦ埛淇℃伅 + * @param acceptData + * @param uid + * @param out + */ + @RequestMapping(value = "getBossInfo", method = RequestMethod.POST) + public void getBossInfo(AcceptData acceptData, Long uid, PrintWriter out) { + if (uid == null || uid <= 0) { + out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�")); + return; + } + JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid)); + out.print(JsonUtil.loadTrueResult(bossData)); + } + + /** + * 涓婄骇淇℃伅缁勭粐 + * + * @param acceptData + * @param uid + * @param threeSale + * @return + */ + private JSONObject getBossInfo(long uid, ThreeSale threeSale) { + JSONObject bossData = new JSONObject(); + if (threeSale != null && threeSale.getBoss() != null) { + UserInfo boss = threeSale.getBoss(); + bossData.put("hasBoss", true); + bossData.put("inviteId", threeSale.getId()); + bossData.put("nickName", boss.getNickName()); + bossData.put("portrait", boss.getPortrait()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); + Long createTime = threeSale.getCreateTime(); + Date inviteTime = new Date(createTime); + + UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(boss.getId()); + if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) { + bossData.put("weiXin", userInfoExtra.getWeiXin()); + bossData.put("weiXinState", 3); + bossData.put("weiXinTip", "娣诲姞TA鐨勫井淇★紝浣犲彲鍚慣A瀛︿範濡備綍閫氳繃鏉挎牀蹇渷璧氶挶銆�"); + } else { + if (!threeSaleExtraInfoSerivce.isRemindBoss(boss.getId(), uid)) { + bossData.put("weiXinState", 1); + bossData.put("weiXinTip", "鐐瑰嚮鎻愰啋TA锛岀郴缁熶細鍙戦�佷竴灏佺珯鍐呬俊锛屾彁閱掑叾娣诲姞寰俊鍙枫��"); + } else { + bossData.put("weiXinState", 2); + bossData.put("weiXinTip", "绯荤粺宸插彂閫佹彁閱掞紝閭�璇蜂汉娣诲姞寰俊鍚庝綘鍙鍒讹紝濡傚鏂硅繜杩熶笉娣诲姞锛屼綘鍙仈绯讳汉宸ュ鏈嶅姹傚府鍔�"); + } + } + bossData.put("inviteTime", "浣犱簬 " + sdf.format(inviteTime) + "鎺ュ彈浜員A鐨勯個璇�"); + } else { + bossData.put("hasBoss", false); + bossData.put("helpLink", configService.get("invite_code_hlep_link")); + bossData.put("weiXinTip", "鎭枩浣狅紝鎴戜滑鐨勪紭璐ㄧ敤鎴凤紱\r\n浣犲苟娌℃湁閭�璇蜂汉锛屼絾浣犵殑閭�璇锋縺娲诲姛鑳芥槸琚粯璁ゅ紑鍚殑锛沑r\n浣犳嫢鏈夌嫭鐗圭殑鏃犻個璇蜂汉婵�娲荤爜銆�"); + } + return bossData; + } } -- Gitblit v1.8.0