| | |
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendSpecialService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoCouponService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; |
| | | import com.yeshi.fanli.service.inter.homemodule.DeviceSexService; |
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService; |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SuperSpecialService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
|
| | | import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | | import com.yeshi.fanli.vo.user.UserSettingsVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | |
| | | @Resource
|
| | | private GoodsTaoLiJinRateService goodsTaoLiJinRateService;
|
| | | |
| | |
|
| | | @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;
|
| | |
| | |
|
| | | // 获取浏览记录
|
| | | @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 source, PrintWriter out) {
|
| | | if (page < 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "page不小于0"));
|
| | | return;
|
| | |
| | | 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, source);
|
| | | |
| | | long count = scanHistoryV2Service.getCountByDeviceOrUid(
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice());
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), source);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | JSONArray array = new JSONArray();
|
| | |
| | |
|
| | | 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) {
|
| | |
| | | try {
|
| | | // 获取设备定义性别
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
|
| | | |
| | |
|
| | | // 1、专题模块
|
| | | JSONObject root = specialService.listCacheSpecialToIndex(acceptData, deviceSex);
|
| | |
|
| | |
| | | if (uid == null) {
|
| | | data.put("collected", false);
|
| | | } else {
|
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id);
|
| | | CollectionGoodsV2 collectionGoods = collectionGoodsV2Service.findByUidAndAuctionId(uid, id);
|
| | | data.put("collected", collectionGoods != null ? true : false);
|
| | | }
|
| | |
|
| | |
| | | redisManager.saveCommonTaoToken(tb.getAuctionId(), token);
|
| | | }
|
| | | }
|
| | | // 测试
|
| | | if (!Constant.IS_TEST)
|
| | | if (!VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | tb.setCouponLinkTaoToken(token);
|
| | |
|
| | | // 服务端转链
|
| | |
| | | + tb.getCouponEffectiveEndTime().replace("-", "."));
|
| | | // 券的口令
|
| | |
|
| | | // 测试
|
| | | 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);
|
| | |
|
| | |
| | | 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(),
|
| | |
| | | } 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) {
|
| | | if (isNewUser) {
|
| | | // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
|
| | | long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
|
| | | if (countRecord > 0) {
|
| | | isNewUser = false;
|
| | | }
|
| | | }
|
| | |
|
| | | SpreadHongBao spreadHongBao = new SpreadHongBao();
|
| | | if (isNewUser) {
|
| | | spreadHongBao.setMoney("1");
|
| | | } else {
|
| | | spreadHongBao.setMoney(spreadMoney.toString());
|
| | |
|
| | | moneyType = 2;
|
| | | fanliValid = false;
|
| | | ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO();
|
| | |
| | | textStyleVO3.setContent(",好友");
|
| | | textStyleVO3.setColor("#666666");
|
| | | ClientTextStyleVO textStyleVO4 = new ClientTextStyleVO();
|
| | | textStyleVO4.setContent("领红包");
|
| | | 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);
|
| | | } |
| | | |
| | | BigDecimal spreadMoney = goodsTaoLiJinRateService.getGoodsSpreadMoney(goods);
|
| | | // 推广红包 不能小于1
|
| | | if (spreadMoney.compareTo(new BigDecimal(1)) < 0) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
|
| | | return;
|
| | | }
|
| | | SpreadHongBao spreadHongBao = new SpreadHongBao();
|
| | | spreadHongBao.setMoney(spreadMoney.toString());
|
| | | 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)
|
| | | // &&
|
| | |
| | | public void run() {
|
| | | // 添加浏览记录
|
| | | try {
|
| | | scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(),goodsInfo);
|
| | | scanHistoryV2Service.addScanHistory(uid, acceptData.getDevice(), goodsInfo);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | List<Special> list = new ArrayList<Special>();
|
| | | // 专题活动
|
| | | String specialCard = "special_activities";
|
| | |
|
| | | List<Special> listSpecial = specialService.listPageBySystemAndCard(0, Integer.MAX_VALUE, specialCard,
|
| | | system.getId());
|
| | |
|
| | | if (listSpecial == null) {
|
| | | listSpecial = new ArrayList<Special>();
|
| | | if (listSpecial != null) {
|
| | | list.addAll(listSpecial);
|
| | | }
|
| | | |
| | | for (Special special: 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 (uid != null) {
|
| | | special.setElastic(userTaoLiJinOriginService.hasRankHongBao(uid));
|
| | | if (name.equals("账户等级特权")) {
|
| | | if (!VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | list.remove(i);
|
| | | i--;
|
| | | } else {
|
| | | if (uid != null) {
|
| | | special.setElastic(userTaoLiJinOriginService.hasRankHongBao(uid));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("special", JsonUtil.getApiCommonGson().toJson(listSpecial));
|
| | | root.put("special", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | |
|
| | | } catch (Exception e) {
|