From aad0554cc7f18a6ec05e2e5e646b5e501d41617d Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期三, 10 七月 2019 17:13:49 +0800 Subject: [PATCH] 冲突文件 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java | 122 ++++++++++++++++++++++------------------ 1 files changed, 68 insertions(+), 54 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java index f3f359c..c579457 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java @@ -239,27 +239,24 @@ @Resource private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService; - + @Resource private UserMoneyExtraService userMoneyExtraService; - + @Resource private UserTaoLiJinOriginService userTaoLiJinOriginService; - + @Resource private ConfigTaoLiJinService configTaoLiJinService; - + @Resource private DeviceTaoLiJinRecordService deviceTaoLiJinRecordService; - + @Resource private DeviceSexService deviceSexService; - + @Resource private UserTaoLiJinRecordService userTaoLiJinRecordService; - - - @Resource private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService; @@ -658,7 +655,7 @@ taoBaoGoodsBriefExtra.setAuctionUrl(tb.getAuctionUrl()); if (uid != null && !"".equals(uid.trim())) { CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid), - Long.parseLong(id)); + Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO); data.put("collection", collectionGoods != null ? true : false); } @@ -918,7 +915,7 @@ // 鍒ゆ柇鏀惰棌 if (!StringUtil.isNullOrEmpty(uid)) { CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(Long.parseLong(uid), - Long.parseLong(id)); + Long.parseLong(id), Constant.SOURCE_TYPE_TAOBAO); data.put("collected", collectionGoods != null ? true : false); } else data.put("collected", false); @@ -1184,7 +1181,7 @@ // 鑾峰彇娴忚璁板綍 @RequestMapping(value = "getscanhistory", method = RequestMethod.POST) - public void getScanHistory(AcceptData acceptData, String uid, int page, PrintWriter out) { + public void getScanHistory(AcceptData acceptData, String uid, int page, Integer goodsType, PrintWriter out) { if (page < 0) { out.print(JsonUtil.loadFalseResult(1, "page涓嶅皬浜�0")); return; @@ -1196,10 +1193,13 @@ out.print(JsonUtil.loadFalseResult(1, "涓嶅瓨鍦ㄨ绯荤粺")); return; } + List<ScanHistoryV2> list = scanHistoryV2Service.getScanHistoryByDeviceOrUid( - StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), page, 20); + StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), page, 20, goodsType); + long count = scanHistoryV2Service.getCountByDeviceOrUid( - StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice()); + StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), goodsType); + JSONObject data = new JSONObject(); data.put("count", count); JSONArray array = new JSONArray(); @@ -1235,10 +1235,10 @@ } @RequestMapping(value = "deletescanhistory", method = RequestMethod.POST) - public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids, PrintWriter out) { + public void deleteScanHistory(AcceptData acceptData, String type, String uid, String ids, + Integer goodsType, PrintWriter out) { BusinessSystem sys = businessSystemService.getBusinessSystem(acceptData.getPlatform(), acceptData.getPackages()); - if (sys == null) { out.print(JsonUtil.loadFalseResult(1, "绯荤粺涓嶅瓨鍦�")); return; @@ -1249,11 +1249,11 @@ for (String auctionIdStr : idStr) { scanHistoryV2Service.deleteByAuctionIdAndDeviceOrUid( StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), - Long.parseLong(auctionIdStr)); + Long.parseLong(auctionIdStr), goodsType); } } else { scanHistoryV2Service.deleteByDeviceOrUid(StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), - acceptData.getDevice()); + acceptData.getDevice(), goodsType); } out.print(JsonUtil.loadTrueResult("")); @@ -1347,6 +1347,13 @@ List<TaoBaoGoodsBrief> gList = recommendGoodsDeleteHistoryService .filterGoods(acceptData.getDevice(), result.getTaoBaoGoodsBriefs()); + + // filter + try { + gList = daTaoKeGoodsDetailService.filterTaoBaoGoods(gList); + } catch (Exception e) { + } + // 璁惧鎺ㄨ崘 if (gList != null) for (TaoBaoGoodsBrief goods : gList) { @@ -1625,7 +1632,7 @@ try { // 鑾峰彇璁惧瀹氫箟鎬у埆 int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice()); - + // 1銆佷笓棰樻ā鍧� JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex); @@ -2015,7 +2022,7 @@ if (uid == null) { data.put("collected", false); } else { - CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id); + CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id, Constant.SOURCE_TYPE_TAOBAO); data.put("collected", collectionGoods != null ? true : false); } @@ -2061,8 +2068,7 @@ redisManager.saveCommonTaoToken(tb.getAuctionId(), token); } } - // 娴嬭瘯 - if (!Constant.IS_TEST) + if (!VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) tb.setCouponLinkTaoToken(token); // 鏈嶅姟绔浆閾� @@ -2080,8 +2086,9 @@ + tb.getCouponEffectiveEndTime().replace("-", ".")); // 鍒哥殑鍙d护 - // 娴嬭瘯 - if (!Constant.IS_TEST) + if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) + couponInfo.put("couponToken", ""); + else couponInfo.put("couponToken", token); goodsJson.put("couponInfo", couponInfo); @@ -2154,7 +2161,7 @@ // 鏄惁鍔犲叆閫夊搧搴擄細 0鏈姞鍏� 1 宸插姞鍏� boolean storageState = false; if (uid != null) { - storageState = userGoodsStorageService.isExistStorage(uid, id); + storageState = userGoodsStorageService.isExistStorage(uid, id, Constant.SOURCE_TYPE_TAOBAO); } data.put("storageState", storageState); @@ -2164,7 +2171,6 @@ data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id); String noRebateHelpLink = null; - // 鍟嗗搧閾炬帴 String h5Url = String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(), @@ -2174,24 +2180,24 @@ } catch (Exception e) { data.put("h5Url", h5Url); } - + // 鏄惁鏈夎繑鍒� boolean fanliValid = true; - //璧勯噾绫诲瀷 1-杩� 2-濂� + // 璧勯噾绫诲瀷 1-杩� 2-濂� int moneyType = 1; - + // 鎺ㄥ箍绾㈠寘 if (from != null && from.equals("taolijin")) { // 璁$畻鎺ㄥ箍绾㈠寘 String warningRate = configTaoLiJinService.getValueByKey("warning_value"); BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods); - + // 鎺ㄥ箍绾㈠寘 涓嶈兘灏忎簬1 if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) { out.print(JsonUtil.loadFalseResult(2, "鍟嗗搧涓嶅瓨鍦�")); return; } - + // 鏄惁涓烘柊鐢ㄦ埛 boolean isNewUser = userInfoExtraService.isNewUser(uid); if (isNewUser) { @@ -2201,13 +2207,13 @@ isNewUser = false; } } - + SpreadHongBao spreadHongBao = new SpreadHongBao(); if (isNewUser) { spreadHongBao.setMoney("1"); } else { spreadHongBao.setMoney(spreadMoney.toString()); - + moneyType = 2; fanliValid = false; ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO(); @@ -2222,40 +2228,49 @@ ClientTextStyleVO textStyleVO4 = new ClientTextStyleVO(); textStyleVO4.setContent("棰嗙孩鍖咃紒"); textStyleVO4.setColor("#F14242"); - + List<ClientTextStyleVO> listText = new ArrayList<ClientTextStyleVO>(); listText.add(textStyleVO1); listText.add(textStyleVO2); listText.add(textStyleVO3); listText.add(textStyleVO4); - + data.put("listTip", listText); - } - spreadHongBao.setTip("褰撴棩棰嗗彇锛屼袱澶╁唴浣跨敤锛岃繃鏃舵棤鏁�"); + } + spreadHongBao.setTip("褰撴棩棰嗗彇锛屽綋鏃ュ唴浣跨敤锛岃繃鏈熷け鏁堛��"); goodsJson.put("spreadHongBao", spreadHongBao); - + // 鐢ㄦ埛鍓╀綑鍙互娣樼ぜ閲戦獙璇� UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid); - if (userMoneyExtra == null || userMoneyExtra.getTlj() == null) { - data.put("userHongbao", new BigDecimal(0).setScale(2)); + if (userMoneyExtra == null || userMoneyExtra.getTlj() == null) { + data.put("userHongbao", new BigDecimal(0).setScale(2).toString()); } else { - data.put("userHongbao", userMoneyExtra.getTlj().setScale(2)); + data.put("userHongbao", userMoneyExtra.getTlj().setScale(2).toString()); } - + noRebateHelpLink = configTaoLiJinService.getValueByKey("share_goods_help_link"); + + if (Constant.IS_TEST) { + fanliValid = true; + goodsJson.put("shareValid", false); + JSONObject tljNum = new JSONObject(); + tljNum.put("percent", "80"); + tljNum.put("num", "8825"); + goodsJson.put("tljNum", tljNum); + } + } - + goodsJson.put("moneyType", moneyType); goodsJson.put("fanliValid", fanliValid); data.put("goods", goodsJson); - + if (!StringUtil.isNullOrEmpty(noRebateHelpLink)) { data.put("noRebateHelpLink", noRebateHelpLink); } else { data.put("noRebateHelpLink", configService.get("no_rebate_help_link")); } - - + // 鍙栨秷鍒嗕韩娲诲姩 // if (!StringUtil.isNullOrEmpty(uid) // && @@ -2281,7 +2296,7 @@ public void run() { // 娣诲姞娴忚璁板綍 try { - scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(),goodsInfo); + scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(), goodsInfo); } catch (Exception e) { e.printStackTrace(); } @@ -2479,7 +2494,7 @@ } try { - + List<Special> list = new ArrayList<Special>(); // 涓撻娲诲姩 String specialCard = "special_activities"; @@ -2490,24 +2505,23 @@ if (listSpecial != null) { list.addAll(listSpecial); } - + for (int i = 0; i < list.size(); i++) { Special special = list.get(i); - + JumpDetailV2 jumpDetail = special.getJumpDetail(); if (jumpDetail != null) { jumpDetail.setNeedLogin(special.isJumpLogin()); special.setJumpDetail(jumpDetail); } - - + String name = special.getName(); if (StringUtil.isNullOrEmpty(name)) { continue; } - + // 鏄惁闇�瑕佸脊鍑烘 - if (name.equals("璐︽埛绛夌骇鐗规潈")) { + if (name.equals("璐︽埛绛夌骇鐗规潈")) { if (!VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) { list.remove(i); i--; -- Gitblit v1.8.0