| | |
| | | import com.google.gson.stream.JsonReader;
|
| | | import com.google.gson.stream.JsonWriter;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.taobao.ShareHotGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | | import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
|
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
|
| | | <<<<<<< HEAD |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.goods.MoneyInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | ======= |
| | | import com.yeshi.fanli.vo.goods.taobao.TLJBuyHongBaoVO;
|
| | | >>>>>>> refs/remotes/origin/master |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
|
| | |
| | | @Resource
|
| | | private ShareHotGoodsService shareHotGoodsService;
|
| | |
|
| | | @Resource
|
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | /**
|
| | | * 获取淘礼金分享记录
|
| | |
| | | page = 1;
|
| | | }
|
| | |
|
| | | |
| | | int pageSize = Constant.PAGE_SIZE;
|
| | | List<UserTaoLiJinRecordVO> list = userTaoLiJinRecordService.getRecordByUid((page - 1) * pageSize, pageSize, uid);
|
| | | List<UserTaoLiJinRecordVO> list = userTaoLiJinRecordService.getRecordByUid((page - 1) * pageSize, pageSize,
|
| | | uid);
|
| | | if (list == null) {
|
| | | list = new ArrayList<UserTaoLiJinRecordVO>();
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 统计淘礼金
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | } else {
|
| | | tlj = new BigDecimal(0);
|
| | | }
|
| | | |
| | |
|
| | | // 今日分享个数
|
| | | long countShare = userTaoLiJinRecordService.countTodayNum(uid);
|
| | |
| | | data.put("thisMonthUse", thisMonthUse.setScale(2).toString().replaceAll("-", ""));
|
| | | data.put("lastMonthUse", lastMonthUse.setScale(2).toString().replaceAll("-", ""));
|
| | |
|
| | | |
| | | // IOS 分享个数
|
| | | ClientTextStyleVO textVo1 = new ClientTextStyleVO();
|
| | | textVo1.setContent("今日创建分享");
|
| | |
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 获取淘礼金明细详情
|
| | |
| | | }
|
| | | });
|
| | |
|
| | | |
| | | |
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 红包领取详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | // 登录用户
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 分享爆款商品-限于淘礼金
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | listHot = new ArrayList<ShareHotGoods>();
|
| | | }
|
| | |
|
| | | |
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
| | | isNewUser = false;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | | for (ShareHotGoods hotGoods : listHot) {
|
| | |
| | | continue;
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null);
|
| | | TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(),
|
| | | null);
|
| | | // 去掉标签
|
| | | extra.setLabels(null);
|
| | |
|
| | |
| | | data.put("list", array);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 分享爆款商品-限于淘礼金
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getBuyGoods", method = RequestMethod.POST)
|
| | | public void getBuyGoods(AcceptData acceptData, int page, PrintWriter out) {
|
| | |
|
| | | String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | List<TLJBuyGoods> listHot = tljBuyGoodsService.listByDay(day);
|
| | | if (listHot == null) {
|
| | | listHot = new ArrayList<TLJBuyGoods>();
|
| | | }
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
|
| | | for (TLJBuyGoods hotGoods : listHot) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | // 计算推广红包
|
| | | BigDecimal spreadMoney = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, proportion);
|
| | |
|
| | | // 推广红包 不能小于1
|
| | | if (spreadMoney.compareTo(new BigDecimal(1.0)) < 0) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(),
|
| | | null);
|
| | | // 去掉标签
|
| | | extra.setLabels(null);
|
| | |
|
| | | String hongBao = spreadMoney.toString();
|
| | | TLJBuyHongBaoVO vo = new TLJBuyHongBaoVO();
|
| | | vo.setLeft(hotGoods.getLeftHongBaoCount());
|
| | | vo.setMoney(hongBao);
|
| | | vo.setTagName("付款立减 ¥" + hongBao);
|
| | | vo.setTip("");
|
| | | vo.setTotal(hotGoods.getTotalHongBaoCount());
|
| | | extra.setTljBuyHongBao(vo);
|
| | | // 显示类型
|
| | | extra.setMoneyType(2);
|
| | | extra.setSpreadMoney("付款立减 ¥" + spreadMoney);
|
| | |
|
| | | array.add(gson.toJson(extra));
|
| | | }
|
| | |
|
| | | if (page > 1)
|
| | | array.clear();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | if (page == 1) {
|
| | | try {
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCard("zigoulijian_banner");
|
| | | if (bannerList != null && bannerList.size() > 0)
|
| | | data.put("topPicture", bannerList.get(0).getSrc());
|
| | | else
|
| | | data.put("topPicture", "");
|
| | | } catch (SwiperPictureException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | data.put("ruleUrl", configService.get("zigoulijian_rule"));
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | }
|