4个文件已删除
1 文件已重命名
16个文件已修改
13个文件已添加
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.FloatADService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgDeviceReadStateService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackWinNewUserService;
|
| | | import com.yeshi.fanli.service.inter.redpack.UserTaoLiJinNewbiesService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | |
| | | private UserActiveLogService userActiveLogService;
|
| | |
|
| | | @Resource
|
| | | private RedPackWinNewUserService redPackWinNewUserService;
|
| | | private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService;
|
| | |
|
| | | /**
|
| | | * s 首页配置信息
|
| | |
| | | for (int i = 0; i < listAD.size(); i++) {
|
| | | FloatAD floatAD = listAD.get(i);
|
| | | FloatADTypeEnum typeEnum = floatAD.getTypeEnum();
|
| | | if (typeEnum == FloatADTypeEnum.newUserRedPack && !redPackWinNewUserService.verifyHasReward(uid, acceptData.getDevice())) {
|
| | | if (typeEnum == FloatADTypeEnum.newUserRedPack && !userTaoLiJinNewbiesService.verifyHasReward(uid, acceptData.getDevice())) {
|
| | | listAD.remove(i);
|
| | | i--;
|
| | | continue;
|
| | |
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.text.ParseException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass;
|
| | |
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | |
| | | import com.yeshi.fanli.service.inter.jd.JDGoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyExtraService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.redpack.UserTaoLiJinNewbiesService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | 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.UserGoodsStorageService;
|
| | |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
|
| | | 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.goods.CouponInfoVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailExtraVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
| | | import com.yeshi.fanli.vo.goods.ShareVO;
|
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.tlj.NewUserHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | private UserGoodsStorageService userGoodsStorageService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | |
|
| | | @Resource
|
| | | private ConfigTaoLiJinService configTaoLiJinService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinRecordService userTaoLiJinRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
| | |
|
| | | @Resource
|
| | | private JDGoodsClassService jdGoodsClassService;
|
| | | |
| | | @Resource
|
| | | private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
|
| | | |
| | | @Resource
|
| | | private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService;
|
| | |
|
| | | /**
|
| | | * 淘宝商品详情
|
| | |
| | | } catch (Exception e) {
|
| | | extraVO.setH5Url(h5Url);
|
| | | }
|
| | |
|
| | | |
| | | String tips = null;
|
| | | String helpLink = null;
|
| | | boolean fanliValid = true;
|
| | | boolean shareValid = true;
|
| | | int moneyType = 1;
|
| | |
|
| | | // 推广红包
|
| | | if (from != null && from.equals("taolijin")) {
|
| | | // 计算推广红包
|
| | | String warningRate = configTaoLiJinService.getValueByKey("warning_value", new Date());
|
| | | BigDecimal spreadMoney = TaoLiJinUtil.getSpreadMoney(warningRate, goods);
|
| | |
|
| | | // 推广红包 不能小于1
|
| | | if (spreadMoney.compareTo(new BigDecimal(1.1)) < 0) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 取消新用户自购
|
| | | boolean isNewUser = false;// userInfoExtraService.isNewUser(uid);
|
| | | if (isNewUser) {
|
| | | // 判定为老用户: 新人只要使用了新人红包,也就是那1块钱,那么,他看到的分享爆款中的商品-就只能分享。
|
| | | long countRecord = userTaoLiJinRecordService.countRecordByUid(uid);
|
| | | if (countRecord > 0) {
|
| | | isNewUser = false;
|
| | | }
|
| | | }
|
| | |
|
| | | SpreadHongBao spreadHongBao = new SpreadHongBao();
|
| | | if (isNewUser) {
|
| | | spreadHongBao.setMoney("1");
|
| | | } else {
|
| | | moneyType = 2;
|
| | | fanliValid = false;
|
| | | spreadHongBao.setMoney(spreadMoney.toString());
|
| | |
|
| | | ClientTextStyleVO textStyleVO1 = new ClientTextStyleVO();
|
| | | textStyleVO1.setContent("分享");
|
| | | textStyleVO1.setColor("#666666");
|
| | | ClientTextStyleVO textStyleVO2 = new ClientTextStyleVO();
|
| | | textStyleVO2.setContent("赚奖金");
|
| | | textStyleVO2.setColor("#F14242");
|
| | | ClientTextStyleVO textStyleVO3 = new ClientTextStyleVO();
|
| | | textStyleVO3.setContent(",好友");
|
| | | textStyleVO3.setColor("#666666");
|
| | | 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);
|
| | | extraVO.setTip(listText);
|
| | | }
|
| | |
|
| | | spreadHongBao.setName("推广红包 ");
|
| | | spreadHongBao.setTip("当日领取,当日内使用,过期失效");
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | otherInfo.setSpreadHongBao(spreadHongBao);
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | |
|
| | | // 1.6.5后改为福利价
|
| | | if (com.yeshi.fanli.util.VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | if (goodsDetail.getCouponPrice() != null
|
| | | && goodsDetail.getCouponPrice().compareTo(new BigDecimal(0)) > 0)
|
| | | goodsDetail.setCouponPrice(goodsDetail.getCouponPrice().subtract(spreadMoney));
|
| | | else
|
| | | goodsDetail.setZkPrice(goodsDetail.getZkPrice().subtract(spreadMoney));
|
| | | }
|
| | |
|
| | | goodsDetail.getMoneyInfo().setFanliMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods,
|
| | | hongBaoManageService.getTLJShareRate(System.currentTimeMillis())));
|
| | | goodsDetail.getMoneyInfo().setShareMoney(TaoBaoUtil.getGoodsHongBaoInfo(goods,
|
| | | hongBaoManageService.getTLJShareRate(System.currentTimeMillis())));
|
| | |
|
| | | // 用户淘礼金
|
| | | UserMoneyExtra userMoneyExtra = userMoneyExtraService.selectByPrimaryKey(uid);
|
| | | if (userMoneyExtra == null || userMoneyExtra.getTlj() == null) {
|
| | | extraVO.setUserTLJ(new BigDecimal(0).setScale(2).toString());
|
| | | } else {
|
| | | extraVO.setUserTLJ(userMoneyExtra.getTlj().setScale(2).toString());
|
| | | }
|
| | | helpLink = configTaoLiJinService.getValueByKey("share_goods_help_link", new Date());
|
| | |
|
| | | } else if (from != null && from.equals("taolijin_buy")) {
|
| | | if (from != null && from.equals("taolijin_buy")) {
|
| | | // 查询分享库
|
| | | TLJBuyGoods buyGoods = tljBuyGoodsService.selectByAuctionIdAndDay(id,
|
| | | TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | |
| | | else
|
| | | goodsDetail.setZkPrice(goodsDetail.getZkPrice().subtract(tljHongBao));
|
| | | }
|
| | | } else if (from != null && from.equals("taolijin_free_buy")) {
|
| | | TLJFreeBuyGoods freeGoods = tljFreeBuyGoodsService.selectByAuctionIdAndDay(id, TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | if (freeGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "免单商品已下架"));
|
| | | return;
|
| | | }
|
| | |
|
| | | fanliValid = true;
|
| | | shareValid = false;
|
| | | BigDecimal couponPrice = goodsDetail.getCouponPrice();
|
| | | if (couponPrice == null) |
| | | couponPrice = goodsDetail.getZkPrice();
|
| | | |
| | | NewUserHongBao newUserHongBao = new NewUserHongBao();
|
| | | newUserHongBao.setMoney(couponPrice.setScale(2).toString());
|
| | | newUserHongBao.setName("新人红包 ");
|
| | | newUserHongBao.setTip("当日领取,当日内使用,过期失效");
|
| | | newUserHongBao.setLeft(1);
|
| | | newUserHongBao.setTotal(1);
|
| | |
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | otherInfo.setReduceHongBao(newUserHongBao);
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | | |
| | | tips = "你不是“新用户”无法使用新人红包0元购买。";
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null && userInfoExtra.getFirstLoginTime() != null) {
|
| | | try {
|
| | | int days = DateUtil.daysBetween2(userInfoExtra.getFirstLoginTime(), new Date());
|
| | | if (days < Constant.TLJ_NEW_USER_DEFINE){
|
| | | UserTaoLiJinNewbies winDetail = userTaoLiJinNewbiesService.selectByPrimaryKey(uid);
|
| | | if (winDetail == null || winDetail.getEndTime().getTime() < java.lang.System.currentTimeMillis()
|
| | | || winDetail.getMoney().compareTo(couponPrice) < 0) {
|
| | | tips = "新人红包不足,请换个商品再试或继续领取到足额新人红包。";
|
| | | } else {
|
| | | tips = null;
|
| | | }
|
| | | } |
| | | } catch (ParseException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | } else {// 普通购买
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | RewardCouponVO rewardCoupon = new RewardCouponVO();
|
| | |
| | | }
|
| | | extraVO.setFanliValid(fanliValid);
|
| | | extraVO.setShareValid(shareValid);
|
| | | extraVO.setTips(tips);
|
| | |
|
| | | MoneyInfoVO goodsMoney = goodsDetail.getMoneyInfo();
|
| | | if (goodsMoney != null) {
|
| | |
| | | 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.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.redpack.RedPackForbidService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackWinInviteService;
|
| | | import com.yeshi.fanli.service.inter.redpack.RedPackWinNewUserService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | |
| | | 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.RedPackWinDetailVO;
|
| | | import com.yeshi.fanli.vo.redpack.RedPackWinInviteVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedPackWinInviteService redPackWinInviteService;
|
| | |
|
| | | @Resource
|
| | | private RedPackWinNewUserService redPackWinNewUserService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新人红包详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getWinDetail", method = RequestMethod.POST)
|
| | | public void getWinDetail(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | RedPackWinDetailVO winDetail = redPackWinNewUserService.receiveReward(uid);
|
| | | if (winDetail == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光"));
|
| | | return;
|
| | | }
|
| | | winDetail.setLogo(Constant.systemCommonConfig.getDefaultPortrait());
|
| | | winDetail.setLogoLight(Constant.systemCommonConfig.getDefaultPortrait());
|
| | |
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", redPackConfigService.getValueByKey("goods_shop_link_h5"));
|
| | | winDetail.setParams(params.toString());
|
| | | winDetail.setJumpDetail(jumpDetailV2Service.getByTypeCache("web",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion())));
|
| | | winDetail.setTips(redPackConfigService.getValueByKey("new_user_win_tips"));
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("redpack_win_detail_banner");
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("detail", JsonUtil.getApiCommonGson().toJson(winDetail));
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光啦"));
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
|
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.taobao.ShareHotGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | |
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
|
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.redpack.UserTaoLiJinNewbiesService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | |
| | | import com.yeshi.fanli.vo.goods.OtherInfo;
|
| | | import com.yeshi.fanli.vo.goods.taobao.TLJBuyHongBaoVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.redpack.TaoLiJinWinDetailVO;
|
| | | import com.yeshi.fanli.vo.tlj.ReduceHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.SpreadHongBao;
|
| | | import com.yeshi.fanli.vo.tlj.TaoLiJinDetailVO;
|
| | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | | |
| | | @Resource
|
| | | private UserTaoLiJinNewbiesService userTaoLiJinNewbiesService;
|
| | | |
| | | @Resource
|
| | | private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
|
| | | |
| | |
|
| | | /**
|
| | | * 获取淘礼金分享记录
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "抱歉,推广红包相关功能已下线!"));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 新人红包详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getWinDetail", method = RequestMethod.POST)
|
| | | public void getWinDetail(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | TaoLiJinWinDetailVO winDetail = userTaoLiJinNewbiesService.receiveReward(uid);
|
| | | if (winDetail == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 2、顶部轮播图
|
| | | List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("redpack_win_detail_banner");
|
| | | List<SwiperPicture> topPicList = new ArrayList<>();
|
| | | if (oldtopPicList != null && oldtopPicList.size() > 0)
|
| | | topPicList.addAll(oldtopPicList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("detail", JsonUtil.getApiCommonGson().toJson(winDetail));
|
| | | data.put("banner", JsonUtil.getApiCommonGson().toJson(topPicList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "红包已被抢光啦"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 新人免单列表
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "gerFreeList", method = RequestMethod.POST)
|
| | | public void gerFreeList(AcceptData acceptData, int page, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | List<TLJFreeBuyGoods> listFree = tljFreeBuyGoodsService.listByDay(day);
|
| | | if (listFree == null) {
|
| | | // TODO
|
| | | listFree = new ArrayList<TLJFreeBuyGoods>();
|
| | | }
|
| | | |
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, fanLiRate, Constant.MAX_REWARD_RATE);
|
| | | for (TLJFreeBuyGoods freeGoods : listFree) {
|
| | | TaoBaoGoodsBrief goods = freeGoods.getGoods();
|
| | | if (goods == null)
|
| | | continue;
|
| | | |
| | | // 计算券后价 1<= n <= 2
|
| | | BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
|
| | | if (couplePrice.compareTo(new BigDecimal(1.0)) < 0 && couplePrice.compareTo(new BigDecimal(2.0)) > 0)
|
| | | continue;
|
| | | |
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | | |
| | | // 专属标签
|
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
|
| | | labels.add(new ClientTextStyleVO("新人专属", "#FE0014"));
|
| | | labels.add(new ClientTextStyleVO("实付0元", "#FF9600"));
|
| | | detailVO.setLabels(labels);
|
| | | array.add(gson.toJson(detailVO));
|
| | | }
|
| | |
|
| | | if (page > 1)
|
| | | array.clear();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", array.size());
|
| | | data.put("list", array);
|
| | | if (page == 1) {
|
| | | List<SwiperPicture> bannerList = swiperPictureService.getByBannerCard("free_buy_banner");
|
| | | if (bannerList != null && bannerList.size() > 0) {
|
| | | data.put("topPicture", bannerList.get(0).getSrc());
|
| | | } else {
|
| | | data.put("topPicture", "");
|
| | | }
|
| | | |
| | | String state = "已过期";
|
| | | BigDecimal balance = new BigDecimal(0);
|
| | | UserTaoLiJinNewbies winDetail = userTaoLiJinNewbiesService.selectByPrimaryKey(uid);
|
| | | if (winDetail != null) {
|
| | | balance = winDetail.getMoney() ;
|
| | | if (winDetail.getEndTime().getTime() > java.lang.System.currentTimeMillis()) {
|
| | | try {
|
| | | String remaining = DateUtil.dateDiff2(new Date(), winDetail.getEndTime());
|
| | | if (!remaining.equals("0分"))
|
| | | state = "剩" + remaining + "过期";
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | data.put("state", state);
|
| | | data.put("balance","新人红包:" + balance.setScale(2) + "元");
|
| | | data.put("ruleUrl", configTaoLiJinService.getValueByKey("new_user_free_buy_list_rule"));
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | // 筛选结果顶部统计
|
| | | String validMoney = "0.00";
|
| | | String invalidMoney = "0.00";
|
| | | if (dateType != null) {
|
| | | BigDecimal predictMoney = hongBaoV2CountService.getRewardMoneyByDate(uid, dateType, orderType, 1);
|
| | | if (page == 1) {
|
| | | BigDecimal predictMoney = hongBaoV2CountService.getRewardMoneyByToSearch(uid, dateType, orderType, 1,
|
| | | orderNo, goodsType, startTime, endTime);
|
| | | if (predictMoney != null)
|
| | | validMoney = predictMoney.setScale(2, BigDecimal.ROUND_DOWN).toString();
|
| | |
|
| | | BigDecimal postSaleMoney = hongBaoV2CountService.getRewardMoneyByDate(uid, dateType, orderType, 2);
|
| | | BigDecimal postSaleMoney = hongBaoV2CountService.getRewardMoneyByToSearch(uid, dateType, orderType, 2,
|
| | | orderNo, goodsType, startTime, endTime);
|
| | | if (postSaleMoney != null)
|
| | | invalidMoney = postSaleMoney.setScale(2, BigDecimal.ROUND_DOWN).toString();
|
| | |
|
| | |
| | | data.put("count", count);
|
| | | data.put("result_list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | data.put("helpUrl", configService.get("order_list_help"));
|
| | | data.put("validMoney", "¥" + validMoney);
|
| | | data.put("invalidMoney", "¥" + invalidMoney);
|
| | | data.put("validMoney", "¥ " + validMoney);
|
| | | data.put("invalidMoney", "¥ " + invalidMoney);
|
| | | data.put("findOrderHelpUrl", orderFindUrl);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (CommonOrderException e) {
|
| | |
| | | show = hongBaoV2CountService.getHongBaoCount(uid, null) > 0;
|
| | | }
|
| | |
|
| | | BigDecimal selfMoney = hongBaoV2CountService.getRewardMoneyByDate(uid, dateType, 1, null);
|
| | | BigDecimal shareMoney = hongBaoV2CountService.getRewardMoneyByDate(uid, dateType, 2, null);
|
| | | BigDecimal inviteMoney = hongBaoV2CountService.getRewardMoneyByDate(uid, dateType, 3, null);
|
| | | BigDecimal selfMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 1);
|
| | | BigDecimal shareMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 2);
|
| | | BigDecimal inviteMoney = hongBaoV2CountService.getRewardMoneyToCount(uid, dateType, 3);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("show", show);
|
New file |
| | |
| | | package com.yeshi.fanli.controller.web;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/web/v1/tljFreeBuyGoods")
|
| | | public class TLJFreeBuyGoodsController {
|
| | |
|
| | | @Resource
|
| | | private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | /**
|
| | | * 拉取备选商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param kw
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "listPreGoods", method = RequestMethod.GET)
|
| | | public void listPreGoods(String callback, AcceptData acceptData, String kw, Integer page, PrintWriter out) {
|
| | | List<TaoBaoGoodsBrief> list = tljFreeBuyGoodsService.listPreGoods(kw, page);
|
| | | JSONArray array = new JSONArray();
|
| | | Gson gson = new Gson();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | for (TaoBaoGoodsBrief goods : list) {
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, fanLiRate.toString(), null)));
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(array)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置免单商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param ids
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setFreeGoods", method = RequestMethod.GET)
|
| | | public void setShareGoods(String callback, AcceptData acceptData, String ids, String day, PrintWriter out) {
|
| | | // 大淘客数据,更新
|
| | | JSONArray array = JSONArray.fromObject(ids);
|
| | | if (StringUtil.isNullOrEmpty(day)) {
|
| | | day = TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L, "yyyy-MM-dd");
|
| | | }
|
| | | int count = 0;
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | // 获取商品详情
|
| | | TaoBaoGoodsBrief goods = null;
|
| | | try {
|
| | | goods = TaoKeApiUtil.searchGoodsDetail(array.optLong(i));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | if (goods != null && goods.getCouponAmount() != null
|
| | | && goods.getCouponAmount().compareTo(new BigDecimal(0)) > 0) {
|
| | | // 券后价 1-2元
|
| | | BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
|
| | | if (couplePrice.compareTo(new BigDecimal(1.0)) >= 0 && couplePrice.compareTo(new BigDecimal(2.0)) <= 0) {
|
| | | count++;
|
| | | tljFreeBuyGoodsService.addGoods(new TLJFreeBuyGoods(day, goods));
|
| | | }
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("设置成功:" + count)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取已经选择的商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param day
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "listSelectedGoods", method = RequestMethod.GET)
|
| | | public void listSelectedGoods(String callback, AcceptData acceptData, String day, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(day)) {
|
| | | day = TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L, "yyyy-MM-dd");
|
| | | }
|
| | |
|
| | | // 最多10个商品
|
| | | List<TLJFreeBuyGoods> listGoods = tljFreeBuyGoodsService.listByDay(day, 10);
|
| | | |
| | | JSONArray array = new JSONArray();
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | |
| | | for (TLJFreeBuyGoods sh : listGoods) {
|
| | | TaoBaoGoodsBriefExtra item = TaoBaoUtil.getTaoBaoGoodsBriefExtra(sh.getGoods(), fanLiRate.toString(), null);
|
| | | if (!StringUtil.isNullOrEmpty(item.getPictUrlWhite()))
|
| | | item.setPictUrl(item.getPictUrlWhite());
|
| | | item.setAuctionUrl(sh.getId());
|
| | | array.add(item);
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(array)));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除选择的商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param ids
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteSelectedGoods", method = RequestMethod.GET)
|
| | | public void deleteSelectedGoods(String callback, AcceptData acceptData, String ids, PrintWriter out) {
|
| | | JSONArray array = JSONArray.fromObject(ids);
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | String id = array.optString(i);
|
| | | tljFreeBuyGoodsService.deleteById(id);
|
| | | }
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult("")));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @return |
| | | */ |
| | | BigDecimal getRewardMoneyByDate(@Param("uid") Long uid, @Param("day")Integer dateType, |
| | | @Param("type") Integer hbType, @Param("orderState") Integer orderState); |
| | | |
| | | |
| | | @Param("type") Integer hbType, @Param("orderState") Integer orderState, |
| | | @Param("orderNo") String orderNo, @Param("source") Integer source, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.tlj; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies; |
| | | |
| | | public interface UserTaoLiJinNewbiesMapper extends BaseMapper<UserTaoLiJinNewbies> { |
| | | |
| | | /** |
| | | * 减掉用户红包金额 |
| | | * @param id |
| | | * @param money |
| | | */ |
| | | void subMoney(@Param("id") long id, @Param("money") BigDecimal money); |
| | | |
| | | |
| | | /** |
| | | * 增加用户红包金额 |
| | | * @param id |
| | | * @param money |
| | | */ |
| | | void addMoney(@Param("id") long id, @Param("money") BigDecimal money); |
| | | |
| | | |
| | | /** |
| | | * 查询用于更新余额-锁定 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | UserTaoLiJinNewbies selectForUpdate(long id); |
| | | |
| | | |
| | | /** |
| | | * 重置红包 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | void resetMoney(long id); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.taobao;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | |
|
| | | @Repository
|
| | | public class TLJFreeBuyGoodsDao extends MongodbBaseDao<TLJFreeBuyGoods> {
|
| | |
|
| | | public List<TLJFreeBuyGoods> listByDay(String day, int page, int pageSize) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("day").is(day);
|
| | | query.addCriteria(ca);
|
| | | query.limit(pageSize);
|
| | | query.skip((page - 1) * pageSize).with(new Sort(Sort.Direction.DESC, "updateTime"));
|
| | | return mongoTemplate.find(query, TLJFreeBuyGoods.class);
|
| | | }
|
| | |
|
| | | public long countByDay(String day) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("day").is(day);
|
| | | query.addCriteria(ca);
|
| | | return mongoTemplate.count(query, TLJFreeBuyGoods.class);
|
| | | }
|
| | |
|
| | |
|
| | | public List<TLJFreeBuyGoods> listByGoodsId(Long auctionid) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionid);
|
| | | query.addCriteria(ca);
|
| | | return mongoTemplate.find(query, TLJFreeBuyGoods.class);
|
| | | }
|
| | | |
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(Long auctionId, String day) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionId).and("day").is(day);
|
| | | query.addCriteria(ca);
|
| | | return mongoTemplate.findOne(query, TLJFreeBuyGoods.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 根据商品ID删除
|
| | | * |
| | | * @param auctionId
|
| | | */
|
| | | public void deleteByGoodsId(Long auctionId) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionId);
|
| | | query.addCriteria(ca);
|
| | | mongoTemplate.findAndRemove(query, TLJFreeBuyGoods.class);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.tlj;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 淘礼金-新人相关
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_taolijin_newbies")
|
| | | public class UserTaoLiJinNewbies{
|
| | | // 用户id
|
| | | @Column(name = "wnu_id")
|
| | | private Long id;
|
| | | // 领取金额
|
| | | @Column(name = "wnu_money")
|
| | | private BigDecimal money;
|
| | | // 领取次数
|
| | | @Column(name = "wnu_num")
|
| | | private Integer num;
|
| | | |
| | | @Column(name = "wnu_end_time")
|
| | | private Date endTime;
|
| | | |
| | | @Column(name = "wnu_create_time")
|
| | | private Date createTime;
|
| | | |
| | | @Column(name = "wnu_update_time")
|
| | | private Date updateTime;
|
| | | |
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Integer getNum() {
|
| | | return num;
|
| | | }
|
| | |
|
| | | public void setNum(Integer num) {
|
| | | this.num = num;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Date getEndTime() {
|
| | | return endTime;
|
| | | }
|
| | |
|
| | | public void setEndTime(Date endTime) {
|
| | | this.endTime = endTime;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.taobao;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 新人免单商品
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "TLJFreeBuyGoods")
|
| | | public class TLJFreeBuyGoods {
|
| | |
|
| | | @Id
|
| | | private String id;
|
| | |
|
| | | @Field
|
| | | private TaoBaoGoodsBrief goods;
|
| | |
|
| | | @Field
|
| | | private String day; |
| | | |
| | | @Field
|
| | | private Integer weight;
|
| | | |
| | | @Field
|
| | | private Date updateTime;
|
| | |
|
| | | public TLJFreeBuyGoods() {}
|
| | | |
| | | |
| | | public TLJFreeBuyGoods(String day, TaoBaoGoodsBrief goods) {
|
| | | this.day = day;
|
| | | this.goods = goods;
|
| | | }
|
| | | |
| | | |
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public TaoBaoGoodsBrief getGoods() {
|
| | | return goods;
|
| | | }
|
| | |
|
| | | public void setGoods(TaoBaoGoodsBrief goods) {
|
| | | this.goods = goods;
|
| | | }
|
| | |
|
| | | public String getDay() {
|
| | | return day;
|
| | | }
|
| | |
|
| | | public void setDay(String day) {
|
| | | this.day = day;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Integer getWeight() {
|
| | | return weight;
|
| | | }
|
| | |
|
| | | public void setWeight(Integer weight) {
|
| | | this.weight = weight;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import java.util.Collections;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Random;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.taobao.ShareHotGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinGiveRecordService;
|
| | |
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | |
|
| | | @Resource
|
| | | private TLJFreeBuyGoodsService tljFreeBuyGoodsService;
|
| | | |
| | | /**
|
| | | * 每天凌晨过5分钟验证
|
| | | */
|
| | |
| | | addTLJBuyGoods(list, day);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 每天凌晨23点过1分开始爬取
|
| | | */
|
| | | @Scheduled(cron = "0 1 23 * * ? ")
|
| | | public void autoAddTLJFreeBuyGoods() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L, "yyyy-MM-dd");
|
| | | LogHelper.test("免单商品开始选品" + day);
|
| | | |
| | | // 是否已预选
|
| | | List<TLJFreeBuyGoods> listSelect = tljFreeBuyGoodsService.listByDay(day);
|
| | | if (listSelect != null && listSelect.size() > 0)
|
| | | return;
|
| | | |
| | | int count = 0;
|
| | | int maxCount = 10;
|
| | | for (int page = 1; page <= 10; page ++) {
|
| | | List<TaoBaoGoodsBrief> list = tljFreeBuyGoodsService.listPreGoods("", page);
|
| | | if (list == null || list.size() == 0)
|
| | | break;
|
| | | |
| | | while (list.size() > 0) {
|
| | | if (count >= maxCount)
|
| | | break;
|
| | | |
| | | Random random = new Random();
|
| | | int n = random.nextInt(list.size());
|
| | | TaoBaoGoodsBrief goods = list.get(n);
|
| | | if (goods.getCouponAmount() != null && goods.getCouponAmount().compareTo(new BigDecimal(0)) > 0) {
|
| | | BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
|
| | | if (couplePrice.compareTo(new BigDecimal(1.0)) >= 0 && couplePrice.compareTo(new BigDecimal(2.0)) <= 0) {
|
| | | tljFreeBuyGoodsService.addGoods(new TLJFreeBuyGoods(day, goods));
|
| | | count ++;
|
| | | }
|
| | | }
|
| | | list.remove(n);
|
| | | }
|
| | | |
| | | if (count >= maxCount)
|
| | | break;
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | |
| | | <if test="day == 4 and type == 1"> <!-- 上月产生自购 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), DATE_FORMAT(co.`co_third_create_time`, '%Y%m')) = 1 |
| | | </if> |
| | | |
| | | <if test="orderState == 1"> <!-- 有效订单: 整个订单有效 --> |
| | | AND <![CDATA[co.`co_state` <> 3]]> |
| | | AND (co.co_state_whole_order = 1 or co.co_state_whole_order = 2) |
| | |
| | | <if test="orderState == 2"> <!-- 维权订单 --> |
| | | AND co.co_state = 3 |
| | | </if> |
| | | |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | |
| | | <!-- 来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | |
| | | <!-- 时间段筛选 --> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinNewbiesMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies"> |
| | | <id column="wnu_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="wnu_money" property="money" jdbcType="DECIMAL"/> |
| | | <result column="wnu_num" property="num" jdbcType="INTEGER"/> |
| | | <result column="wnu_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="wnu_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="wnu_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">wnu_id,wnu_money,wnu_num,wnu_end_time,wnu_create_time,wnu_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_taolijin_new_user where wnu_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_taolijin_new_user where wnu_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_new_user (wnu_id,wnu_money,wnu_num,wnu_end_time,wnu_create_time,wnu_update_time) values (#{id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{num,jdbcType=INTEGER},#{endTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_taolijin_new_user |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">wnu_id,</if> |
| | | <if test="money != null">wnu_money,</if> |
| | | <if test="num != null">wnu_num,</if> |
| | | <if test="endTime != null">wnu_end_time,</if> |
| | | <if test="createTime != null">wnu_create_time,</if> |
| | | <if test="updateTime != null">wnu_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="num != null">#{num,jdbcType=INTEGER},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies">update yeshi_ec_user_taolijin_new_user set wnu_money = #{money,jdbcType=DECIMAL},wnu_num = #{num,jdbcType=INTEGER},wnu_end_time = #{endTime,jdbcType=TIMESTAMP},wnu_create_time = #{createTime,jdbcType=TIMESTAMP},wnu_update_time = #{updateTime,jdbcType=TIMESTAMP} where wnu_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies">update yeshi_ec_user_taolijin_new_user |
| | | <set> |
| | | <if test="money != null">wnu_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="num != null">wnu_num=#{num,jdbcType=INTEGER},</if> |
| | | <if test="endTime != null">wnu_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">wnu_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">wnu_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where wnu_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <update id="subMoney"> |
| | | update yeshi_ec_user_taolijin_new_user SET wnu_money = wnu_money - #{money,jdbcType=DECIMAL},wnu_update_time = NOW() |
| | | WHERE wnu_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <update id="addMoney"> |
| | | UPDATE yeshi_ec_user_taolijin_new_user SET wnu_money = wnu_money + #{money,jdbcType=DECIMAL}, wnu_num = wnu_num + 1,wnu_update_time = NOW() |
| | | WHERE wnu_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <update id="resetMoney"> |
| | | UPDATE yeshi_ec_user_taolijin_new_user SET wnu_money = 0,wnu_update_time = NOW() |
| | | WHERE wnu_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="selectForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_user_taolijin_new_user |
| | | WHERE wnu_id = #{id,jdbcType=BIGINT} FOR UPDATE |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getRewardMoneyByDate(Long uid, Integer dateType, Integer hbType, Integer orderState) {
|
| | | return hongBaoV2CountMapper.getRewardMoneyByDate(uid, dateType, hbType, orderState);
|
| | | public BigDecimal getRewardMoneyToCount(Long uid, Integer dateType, Integer hbType) {
|
| | | return hongBaoV2CountMapper.getRewardMoneyByDate(uid, dateType, hbType, null, null, null, null, null);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public BigDecimal getRewardMoneyByToSearch(Long uid, Integer dateType, Integer hbType, Integer orderState, String orderNo, Integer source, String startTime, String endTime) {
|
| | | return hongBaoV2CountMapper.getRewardMoneyByDate(uid, dateType, hbType, orderState, orderNo, source,
|
| | | startTime, endTime);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.taobao;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.cache.ehcache.EhCacheCacheManager;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.taobao.TLJFreeBuyGoodsDao;
|
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | @Service
|
| | | public class TLJFreeBuyGoodsServiceImpl implements TLJFreeBuyGoodsService {
|
| | | @Resource
|
| | | private TLJFreeBuyGoodsDao tljFreeBuyGoodsDao;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | | |
| | | @Resource
|
| | | private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | |
| | | @Resource
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | | |
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private EhCacheCacheManager ehCacheCacheManager;
|
| | | |
| | |
|
| | | @Override
|
| | | public void addGoods(TLJFreeBuyGoods goods) {
|
| | | if (goods == null || StringUtil.isNullOrEmpty(goods.getDay()) || goods.getGoods() == null)
|
| | | return;
|
| | | goods.setId(StringUtil.Md5(goods.getDay() + "#" + goods.getGoods().getAuctionId()));
|
| | | |
| | | if (goods.getWeight() == null)
|
| | | goods.setWeight(1);
|
| | | |
| | | if (goods.getUpdateTime() == null)
|
| | | goods.setUpdateTime(new Date());
|
| | | tljFreeBuyGoodsDao.save(goods);
|
| | | }
|
| | |
|
| | | |
| | | @Cacheable(value = "commonContentCache", key = "'tljFreeBuy-listByDay'+#day")
|
| | | @Override
|
| | | public List<TLJFreeBuyGoods> listByDay(String day) {
|
| | | List<TLJFreeBuyGoods> list = listByDay(day, 10);
|
| | | if (list != null)
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | // 过滤淘礼金大于10块钱的
|
| | | BigDecimal hongBao = TaoBaoUtil.getGoodsHongBaoMoney(list.get(i).getGoods(),
|
| | | TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
|
| | | if (hongBao.compareTo(new BigDecimal(10)) > 0) {
|
| | | list.remove(i--);
|
| | | }
|
| | | }
|
| | |
|
| | | List<TLJFreeBuyGoods> goodsList = new ArrayList<>();
|
| | | if (list != null && list.size() > 0)
|
| | | goodsList.addAll(list);
|
| | | |
| | | Collections.shuffle(goodsList);
|
| | | Comparator<TLJFreeBuyGoods> cm = new Comparator<TLJFreeBuyGoods>() {
|
| | | @Override
|
| | | public int compare(TLJFreeBuyGoods o1, TLJFreeBuyGoods o2) {
|
| | | return o1.getWeight() != null && o2.getWeight() != null ? o2.getWeight() - o1.getWeight() : 0;
|
| | | }
|
| | | };
|
| | | Collections.sort(goodsList, cm);
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<TLJFreeBuyGoods> listByDay(String day, int count) {
|
| | | List<TLJFreeBuyGoods> list = tljFreeBuyGoodsDao.listByDay(day, 1, count);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | if (list != null) {
|
| | | for (TLJFreeBuyGoods shg : list)
|
| | | goodsList.add(shg.getGoods());
|
| | | }
|
| | | // 过滤基本商品信息
|
| | | goodsList = taoBaoGoodsUpdateService.filterImportantTaoBaoGoods(goodsList);
|
| | | // 过滤下线商品
|
| | | goodsList = taoBaoGoodsBriefService.filterOffLineGoods(goodsList);
|
| | | // 添加大淘客信息
|
| | | goodsList = daTaoKeGoodsDetailService.filterTaoBaoGoods(goodsList);
|
| | | |
| | | Map<Long, TaoBaoGoodsBrief> goodsMap = new HashMap<>();
|
| | | if (goodsList != null)
|
| | | for (TaoBaoGoodsBrief g : goodsList)
|
| | | goodsMap.put(g.getAuctionId(), g);
|
| | |
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | if (goodsMap.get(list.get(j).getGoods().getAuctionId()) == null) {
|
| | | list.remove(j);
|
| | | j--;
|
| | | }
|
| | | }
|
| | |
|
| | | // 加入更新队列
|
| | | //
|
| | | try {
|
| | | for (TLJFreeBuyGoods tljGoods : list)
|
| | | if (tljGoods != null && tljGoods.getGoods() != null && tljGoods.getGoods().getAuctionId() != null)
|
| | | taoBaoGoodsUpdateService.addUpdateQueueAsync(tljGoods.getGoods().getAuctionId());
|
| | | } catch (Exception e) {
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void deleteById(String id) {
|
| | | tljFreeBuyGoodsDao.delete(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByGoodsId(Long auctionId) {
|
| | | tljFreeBuyGoodsDao.deleteByGoodsId(auctionId);
|
| | | // 清除列表缓存
|
| | | ehCacheCacheManager.getCache("commonContentCache")
|
| | | .evict("TLJFreeBuy-listByDay" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(Long auctionId, String day) {
|
| | | return tljFreeBuyGoodsDao.selectByAuctionIdAndDay(auctionId, day);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> listPreGoods(String key ,int page) {
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | // 大淘客筛选: 券后价 1-2区间 、综合排序
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.search(key, null, new BigDecimal(1), new BigDecimal(2), 1, page, 100, 0);
|
| | | if (result != null && result.getGoodsList() != null) {
|
| | | for (DaTaoKeDetailV2 v2 : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(v2));
|
| | | }
|
| | | return goodsList;
|
| | | }
|
| | |
|
| | |
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.service.impl.taobao;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.ehcache.EhCacheCacheManager;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.taobao.TLJFreeBuyGoodsDao;
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsUpdateService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | @Service
|
| | | public class TLJFreeBuyGoodsUpdateServiceImpl implements TLJFreeBuyGoodsUpdateService {
|
| | | @Resource
|
| | | private TLJFreeBuyGoodsDao tljFreeBuyGoodsDao;
|
| | |
|
| | | @Resource
|
| | | private EhCacheCacheManager ehCacheCacheManager;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | |
| | | @Override
|
| | | public void updateGoods(TaoBaoGoodsBrief goods) {
|
| | | if (goods == null)
|
| | | return;
|
| | |
|
| | | List<TLJFreeBuyGoods> list = tljFreeBuyGoodsDao.listByGoodsId(goods.getAuctionId());
|
| | | if (list != null) {
|
| | | // 计算券后价 1<= n <= 2
|
| | | BigDecimal couplePrice = TaoBaoUtil.getAfterUseCouplePrice(goods);
|
| | | if (couplePrice.compareTo(new BigDecimal(1.0)) < 0 && couplePrice.compareTo(new BigDecimal(2.0)) > 0) {
|
| | | for (TLJFreeBuyGoods tljGoods : list) {
|
| | | tljFreeBuyGoodsDao.delete(tljGoods.getId());
|
| | | }
|
| | | return;
|
| | | }
|
| | | |
| | | for (TLJFreeBuyGoods TLJBuyGoods : list) {
|
| | | if (goods.getCouponInfo() == null)
|
| | | goods.setCouponInfo("");
|
| | | if (goods.getCouponAmount() == null)
|
| | | goods.setCouponAmount(new BigDecimal(0));
|
| | |
|
| | | // 判断 券信息 价格信息 返利比例信息是否改变
|
| | | boolean change = false;
|
| | | if (goods.getZkPrice().compareTo(TLJBuyGoods.getGoods().getZkPrice()) != 0)
|
| | | change = true;
|
| | | if (goods.getCouponAmount().compareTo(TLJBuyGoods.getGoods().getCouponAmount()) != 0)
|
| | | change = true;
|
| | | if (!goods.getCouponInfo().equalsIgnoreCase(TLJBuyGoods.getGoods().getCouponInfo()))
|
| | | change = true;
|
| | | if (goods.getTkRate().compareTo(TLJBuyGoods.getGoods().getTkRate()) != 0)
|
| | | change = true;
|
| | |
|
| | | if (change) {
|
| | | // 清除列表缓存
|
| | | ehCacheCacheManager.getCache("commonContentCache").evict(
|
| | | "TLJFreeBuy-listByDay" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
|
| | | }
|
| | |
|
| | | // 更新券信息 ,价格信息,销量信息
|
| | | TLJBuyGoods.getGoods().setZkPrice(goods.getZkPrice());
|
| | | TLJBuyGoods.getGoods().setCouponAmount(goods.getCouponAmount());
|
| | | TLJBuyGoods.getGoods().setCouponInfo(goods.getCouponInfo());
|
| | | TLJBuyGoods.getGoods().setCouponEffectiveEndTime(goods.getCouponEffectiveEndTime());
|
| | | TLJBuyGoods.getGoods().setCouponEffectiveStartTime(goods.getCouponEffectiveStartTime());
|
| | | TLJBuyGoods.getGoods().setCouponLeftCount(goods.getCouponLeftCount());
|
| | | TLJBuyGoods.getGoods().setCouponStartFee(goods.getCouponStartFee());
|
| | | TLJBuyGoods.getGoods().setCouponTotalCount(goods.getCouponTotalCount());
|
| | | TLJBuyGoods.getGoods().setBiz30day(goods.getBiz30day());
|
| | | TLJBuyGoods.getGoods().setTkRate(goods.getTkRate());
|
| | | TLJBuyGoods.getGoods().setId(goods.getId());
|
| | | TLJBuyGoods.getGoods().setAuctionId(goods.getAuctionId());
|
| | | tljFreeBuyGoodsDao.save(TLJBuyGoods);
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJFreeBuyGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoGoodsUpdateDao taoBaoGoodsUpdateDao;
|
| | | |
| | | @Resource
|
| | | private TLJFreeBuyGoodsUpdateService tljFreeBuyGoodsUpdateService;
|
| | |
|
| | | @Override
|
| | | public void startUpdate() {
|
| | |
| | |
|
| | | // 更新自购立减库商品
|
| | | tljBuyGoodsUpdateService.updateGoods(goods);
|
| | | |
| | | // 更新新人免单库商品
|
| | | tljFreeBuyGoodsUpdateService.updateGoods(goods);
|
| | |
|
| | | // 总要商品更新
|
| | | updateImplTBGoods(goods);
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.tlj;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinNewbiesMapper;
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.redpack.UserTaoLiJinNewbiesService;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | | import com.yeshi.fanli.vo.redpack.TaoLiJinWinDetailVO;
|
| | |
|
| | | @Service
|
| | | public class UserTaoLiJinNewbiesServiceImpl implements UserTaoLiJinNewbiesService {
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinNewbiesMapper userTaoLiJinNewbiesMapper;
|
| | | |
| | | @Resource
|
| | | private ConfigTaoLiJinService configTaoLiJinService;
|
| | | |
| | | @Resource |
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | @Resource
|
| | | private UserMoneyMsgNotificationService userMoneyMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | | |
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | | |
| | | @Override
|
| | | public boolean verifyHasReward(Long uid, String device) {
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(device) && (uid == null || uid <= 0)) |
| | | return false;
|
| | | |
| | | if (uid == null || uid <= 0) {
|
| | | DeviceActive deviceActive = deviceActiveService.getFirstActiveInfo(device);
|
| | | if (deviceActive == null) |
| | | return true; // 新设备弹出
|
| | | |
| | | Date nowTime = new Date();
|
| | | Date createTime = deviceActive.getCreateTime();
|
| | | int days = DateUtil.daysBetween2(createTime, nowTime);
|
| | | if (days >= Constant.TLJ_NEW_USER_DAYS) {
|
| | | return false; // 已经超出设置天数
|
| | | }
|
| | | return true; // 未超过时间
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || userInfoExtra.getFirstLoginTime() == null) |
| | | return false;
|
| | | |
| | | Date nowTime = new Date();
|
| | | Date firstLoginTime = userInfoExtra.getFirstLoginTime();
|
| | | int days = DateUtil.daysBetween2(firstLoginTime, nowTime);
|
| | | if (days >= Constant.TLJ_NEW_USER_DAYS)
|
| | | return false; // 已经超出设置天数
|
| | | |
| | | UserTaoLiJinNewbies redPackWin = userTaoLiJinNewbiesMapper.selectByPrimaryKey(uid);
|
| | | if (redPackWin != null) {
|
| | | if (redPackWin.getMoney().compareTo(Constant.TLJ_NEW_USER_MONEY) >= 0)
|
| | | return false; // 已领取完
|
| | | |
| | | Date updateTime = redPackWin.getUpdateTime();
|
| | | int daysNum = DateUtil.daysBetween2(updateTime, nowTime);
|
| | | if (daysNum == 0) |
| | | return false; // 今日已领取
|
| | | |
| | | Integer num = redPackWin.getNum();
|
| | | if (num >= Constant.TLJ_NEW_USER_DAYS) |
| | | return false; // 领取次数超限
|
| | | }
|
| | | return true;
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | |
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public TaoLiJinWinDetailVO receiveReward(Long uid) throws Exception {
|
| | | if (uid == null || uid <= 0) |
| | | return null; // 未登录弹出
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null || userInfoExtra.getFirstLoginTime() == null) |
| | | return null;
|
| | | |
| | | Date nowTime = new Date();
|
| | | Date firstLoginTime = userInfoExtra.getFirstLoginTime();
|
| | | int days = DateUtil.daysBetween2(firstLoginTime, nowTime);
|
| | | if (days >= Constant.TLJ_NEW_USER_DAYS)
|
| | | return null; // 已经超出设置天数
|
| | | |
| | | UserTaoLiJinNewbies redPackWin = userTaoLiJinNewbiesMapper.selectForUpdate(uid);
|
| | | if (redPackWin != null) {
|
| | | if (redPackWin.getMoney().compareTo(Constant.TLJ_NEW_USER_MONEY) >= 0)
|
| | | return null; // 已领取完
|
| | | |
| | | Date updateTime = redPackWin.getUpdateTime();
|
| | | int daysNum = DateUtil.daysBetween2(updateTime, nowTime);
|
| | | if (daysNum == 0) |
| | | return null; // 今日已领取
|
| | | |
| | | Integer num = redPackWin.getNum();
|
| | | if (num >= Constant.TLJ_NEW_USER_DAYS) |
| | | return null; // 领取次数超限
|
| | | }
|
| | | |
| | | BigDecimal money = null;
|
| | | if (redPackWin == null) { // 第一次
|
| | | if (days == Constant.TLJ_NEW_USER_DAYS - 1) { // 最后一天
|
| | | money = Constant.TLJ_NEW_USER_MONEY;
|
| | | } else { // 计算随机奖励
|
| | | double randomNum = Constant.TLJ_NEW_USER_MIN + Math.random() * (Constant.TLJ_NEW_USER_MAX - Constant.TLJ_NEW_USER_MIN);
|
| | | randomNum = randomNum/100;
|
| | | BigDecimal rate = new BigDecimal(randomNum).setScale(2, BigDecimal.ROUND_DOWN);
|
| | | money = MoneyBigDecimalUtil.mul(Constant.TLJ_NEW_USER_MONEY,rate);
|
| | | }
|
| | | } else if (days == Constant.TLJ_NEW_USER_DAYS - 1) { // 最后一天
|
| | | money = MoneyBigDecimalUtil.sub(Constant.TLJ_NEW_USER_MONEY, redPackWin.getMoney());
|
| | | } else { // 计算剩余随机奖励 10%-25% |
| | | double randomNum = 10 + Math.random() * (20 - 10);
|
| | | BigDecimal rate = new BigDecimal(randomNum/100).setScale(2, BigDecimal.ROUND_DOWN);
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.sub(Constant.TLJ_NEW_USER_MONEY,redPackWin.getMoney()),rate);
|
| | | }
|
| | | money = money.setScale(2);
|
| | | |
| | | // 插入领取记录
|
| | | int num = 1;
|
| | | BigDecimal balance = null;
|
| | | if (redPackWin == null) {
|
| | | balance = money;
|
| | | |
| | | // 注册开始 有效期
|
| | | Date endDate = DateUtil.plusDayDate(Constant.TLJ_NEW_USER_LIMIT, firstLoginTime);
|
| | | |
| | | redPackWin = new UserTaoLiJinNewbies();
|
| | | redPackWin.setId(uid);
|
| | | redPackWin.setNum(1);
|
| | | redPackWin.setMoney(money);
|
| | | redPackWin.setEndTime(endDate);
|
| | | redPackWin.setCreateTime(nowTime);
|
| | | redPackWin.setUpdateTime(nowTime);
|
| | | userTaoLiJinNewbiesMapper.insertSelective(redPackWin);
|
| | | } else {
|
| | | userTaoLiJinNewbiesMapper.addMoney(uid, money);
|
| | | |
| | | num = redPackWin.getNum() + 1;
|
| | | balance = MoneyBigDecimalUtil.add(money, redPackWin.getMoney());
|
| | | }
|
| | | |
| | | Map<String,String> map = new HashMap<String,String>();
|
| | | map.put("url", configTaoLiJinService.getValueByKey("new_user_free_buy_list"));
|
| | | |
| | | TaoLiJinWinDetailVO winDetailVO = new TaoLiJinWinDetailVO();
|
| | | winDetailVO.setTitle("新人红包");
|
| | | winDetailVO.setBless("恭喜你!已领" + num + "/" + Constant.TLJ_NEW_USER_DAYS + "次");
|
| | | winDetailVO.setMoney(money.toString());
|
| | | winDetailVO.setDesc("已领取:" + balance + "元");
|
| | | winDetailVO.setTips(configTaoLiJinService.getValueByKey("new_user_win_tips"));
|
| | | winDetailVO.setParams(map.toString());
|
| | | winDetailVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | winDetailVO.setLogo(Constant.systemCommonConfig.getDefaultPortrait());
|
| | | winDetailVO.setLogoLight(Constant.systemCommonConfig.getDefaultPortrait());
|
| | | return winDetailVO;
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserTaoLiJinNewbies selectByPrimaryKey(Long uid) {
|
| | | return userTaoLiJinNewbiesMapper.selectByPrimaryKey(uid);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | * @param hbType
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getRewardMoneyByDate(Long uid, Integer dateType, Integer hbType, Integer orderState);
|
| | | public BigDecimal getRewardMoneyToCount(Long uid, Integer dateType, Integer hbType);
|
| | |
|
| | | /**
|
| | | * 统计红包个数
|
| | |
| | | * @param type 红包类型
|
| | | * @return
|
| | | */
|
| | | public long getHongBaoCount(Long uid, Integer type); |
| | | public long getHongBaoCount(Long uid, Integer type);
|
| | |
|
| | | /**
|
| | | * 筛选结果页顶部统计
|
| | | * @param uid
|
| | | * @param dateType
|
| | | * @param hbType
|
| | | * @param orderState
|
| | | * @param orderNo
|
| | | * @param source
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getRewardMoneyByToSearch(Long uid, Integer dateType, Integer hbType, Integer orderState, String orderNo,
|
| | | Integer source, String startTime, String endTime); |
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.redpack;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
|
| | | import com.yeshi.fanli.vo.redpack.TaoLiJinWinDetailVO;
|
| | |
|
| | | public interface UserTaoLiJinNewbiesService {
|
| | |
|
| | | /**
|
| | | * 领取红包 |
| | | * @param uid
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public TaoLiJinWinDetailVO receiveReward(Long uid) throws Exception;
|
| | |
|
| | | /**
|
| | | * 验证是否可领取红包
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean verifyHasReward(Long uid, String device);
|
| | |
|
| | | /**
|
| | | * 查询新人红包
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserTaoLiJinNewbies selectByPrimaryKey(Long uid);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.taobao;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
|
| | | /**
|
| | | * 红包免单商品
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface TLJFreeBuyGoodsService {
|
| | |
|
| | | /**
|
| | | * 添加自购立减商品
|
| | | * |
| | | * @param goods
|
| | | */
|
| | | public void addGoods(TLJFreeBuyGoods goods);
|
| | |
|
| | | /**
|
| | | * 根据日期查找
|
| | | * |
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public List<TLJFreeBuyGoods> listByDay(String day);
|
| | |
|
| | | /**
|
| | | * 根据appkey与日期查找
|
| | | * |
| | | * @param appKey
|
| | | * @param day
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | public List<TLJFreeBuyGoods> listByDay(String day, int count);
|
| | |
|
| | | /**
|
| | | * 根据主键删除
|
| | | * |
| | | * @param id
|
| | | */
|
| | | public void deleteById(String id);
|
| | |
|
| | |
|
| | | /**
|
| | | * 根据商品id删除
|
| | | * |
| | | * @param goodsId
|
| | | */
|
| | | public void deleteByGoodsId(Long goodsId);
|
| | | |
| | | /**
|
| | | * 根据商品ID和日期查询
|
| | | * |
| | | * @param auctionId
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public TLJFreeBuyGoods selectByAuctionIdAndDay(Long auctionId, String day);
|
| | |
|
| | | /**
|
| | | * 预选商品
|
| | | * @param page
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> listPreGoods(String key, int page);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.taobao;
|
| | |
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
|
| | | /**
|
| | | * 新人免单商品
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface TLJFreeBuyGoodsUpdateService {
|
| | |
|
| | | /**
|
| | | * 更新商品
|
| | | * |
| | | * @param goods
|
| | | */
|
| | | public void updateGoods(TaoBaoGoodsBrief goods);
|
| | | }
|
| | |
| | | public static final double THREE_STAGE_RANDOM_MAX = 2;
|
| | |
|
| | | // 新人奖励连续天数
|
| | | public static final long RED_PACK_NEW_USER_DAYS = 7;
|
| | | public static final long TLJ_NEW_USER_DAYS = 7;
|
| | | // 新人奖励最高
|
| | | public static final BigDecimal RED_PACK_NEW_USER_MONEY = new BigDecimal("2");
|
| | | public static final BigDecimal TLJ_NEW_USER_MONEY = new BigDecimal("2");
|
| | | // 新人奖励第一次随机最小
|
| | | public static final int RED_PACK_NEW_USER_MIN = 50;
|
| | | public static final int TLJ_NEW_USER_MIN = 50;
|
| | | // 新人奖励第一次随机最大
|
| | | public static final int RED_PACK_NEW_USER_MAX = 60;
|
| | | |
| | | public static final int TLJ_NEW_USER_MAX = 60;
|
| | | // 新人红包有效期10天
|
| | | public static final int TLJ_NEW_USER_LIMIT = 10;
|
| | | // 新人定义: 自完成注册起10天内;
|
| | | public static final int TLJ_NEW_USER_DEFINE = 10;
|
| | |
|
| | |
|
| | | public static WXGZConfig wxGZConfig;
|
| | |
| | | cids = cids.substring(0, cids.length() - 1);
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | params.put("cids", cids);
|
| | |
|
| | | |
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | key = "";
|
| | | params.put("keyWords", key);
|
| | | |
| | | if (sort != null)
|
| | | params.put("sort", sort + "");
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | |
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | | |
| | | |
| | | public static DaTaoKeGoodsResult search(String key, List<Integer> cidList, BigDecimal priceLowerLimit,
|
| | | BigDecimal priceUpperLimit, Integer couponPriceLowerLimit, int page, int pageSize, Integer sort) {
|
| | |
|
| | | TaoKeAppInfo app = getRandomApp();
|
| | | DaTaoKeGoodsResult daTaoKeGoodsResult = new DaTaoKeGoodsResult();
|
| | | Map<String, String> params = new TreeMap<>();
|
| | | params.put("version", "v2.1.0");
|
| | | params.put("appKey", app.getAppKey());
|
| | | params.put("pageSize", pageSize + "");
|
| | | params.put("pageId", page + "");
|
| | | if (priceLowerLimit != null)
|
| | | params.put("priceLowerLimit", priceLowerLimit + "");
|
| | | if (priceUpperLimit != null)
|
| | | params.put("priceUpperLimit", priceUpperLimit + "");
|
| | | |
| | | if (couponPriceLowerLimit != null)
|
| | | params.put("couponPriceLowerLimit", couponPriceLowerLimit + "");
|
| | | |
| | | String cids = "";
|
| | | if (cidList != null && cidList.size() > 0)
|
| | | for (Integer cid : cidList) {
|
| | | cids += cid + ",";
|
| | | }
|
| | |
|
| | | if (cids.endsWith(","))
|
| | | cids = cids.substring(0, cids.length() - 1);
|
| | | if (!StringUtil.isNullOrEmpty(cids))
|
| | | params.put("cids", cids);
|
| | | |
| | | if (StringUtil.isNullOrEmpty(key))
|
| | | key = "";
|
| | | params.put("keyWords", key);
|
| | | |
| | | if (sort != null)
|
| | | params.put("sort", sort + "");
|
| | | params.put("sign", getSign(params, app.getAppSecret()));
|
| | | String result = requestGet("https://openapi.dataoke.com/api/goods/get-dtk-search-goods", params);
|
| | |
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject dataJson = json.optJSONObject("data");
|
| | | if (dataJson != null) {
|
| | | JSONArray array = dataJson.optJSONArray("list");
|
| | | if (array != null) {
|
| | | List<DaTaoKeDetailV2> list = parseDaTaoKeDetailV2List(array);
|
| | | daTaoKeGoodsResult.setGoodsList(list);
|
| | | }
|
| | | daTaoKeGoodsResult.setPageId(dataJson.optString("pageId"));
|
| | | daTaoKeGoodsResult.setTotalCount(dataJson.optLong("totalNum"));
|
| | | }
|
| | | return daTaoKeGoodsResult;
|
| | | }
|
| | |
|
| | |
|
| | | private static String getSign(Map<String, String> map, String secretKey) {
|
| | | if (map.size() == 0) {
|
| | |
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | /**
|
| | | * 商品详情额外显示信息
|
| | |
| | | // 是否跳转原生APP
|
| | | @Expose
|
| | | private Boolean isNative;
|
| | |
|
| | | |
| | | // 弹出框提示语
|
| | | @Expose
|
| | | private String tips;
|
| | | |
| | | // 图文详情链接
|
| | | @Expose
|
| | | private String detailUrl;
|
| | | // 复制链接(右上角)
|
| | | @Expose
|
| | | private String h5Url;
|
| | | // 底部提示语
|
| | | @Expose
|
| | | private List<ClientTextStyleVO> tip;
|
| | |
|
| | | // 淘客参数
|
| | | @Expose
|
| | |
| | | this.h5Url = h5Url;
|
| | | }
|
| | |
|
| | | public List<ClientTextStyleVO> getTip() {
|
| | | return tip;
|
| | | }
|
| | |
|
| | | public void setTip(List<ClientTextStyleVO> tip) {
|
| | | this.tip = tip;
|
| | | }
|
| | |
|
| | | public String getUserTLJ() {
|
| | | return userTLJ;
|
| | | }
|
| | |
| | | public void setListCouponUser(List<ShamUser> listCouponUser) {
|
| | | this.listCouponUser = listCouponUser;
|
| | | }
|
| | |
|
| | | public String getTips() {
|
| | | return tips;
|
| | | }
|
| | |
|
| | | public void setTips(String tips) {
|
| | | this.tips = tips;
|
| | | }
|
| | | }
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/vo/redpack/RedPackWinDetailVO.java |
| | |
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class RedPackWinDetailVO {
|
| | | public class TaoLiJinWinDetailVO {
|
| | | @Expose
|
| | | private String title;
|
| | | @Expose
|
New file |
| | |
| | | package com.yeshi.fanli.vo.tlj;
|
| | |
|
| | | /**
|
| | | * 新人红包
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class NewUserHongBao extends ReduceHongBao {
|
| | |
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | }
|
| | |
| | | maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="1800"
|
| | | timeToLiveSeconds="1800" overflowToDisk="true"
|
| | | memoryStoreEvictionPolicy="LRU" />
|
| | | |
| | | <!-- 会员缓存 -->
|
| | | <cache name="vipconfigCache" maxElementsInMemory="1000"
|
| | | maxElementsOnDisk="10000" eternal="false" timeToIdleSeconds="1800"
|
| | | timeToLiveSeconds="1800" overflowToDisk="true"
|
| | | memoryStoreEvictionPolicy="LRU" />
|
| | |
|
| | | </ehcache>
|
| | |
| | | int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12;
|
| | | return Math.abs(month + result);
|
| | | }
|
| | | |
| | |
|
| | | public static Date getTodayStartTime() {
|
| | | Calendar todayStart = Calendar.getInstance();
|
| | | todayStart.set(Calendar.HOUR_OF_DAY,0);
|
| | | todayStart.set(Calendar.MINUTE,0);
|
| | | todayStart.set(Calendar.SECOND,0);
|
| | | todayStart.set(Calendar.MILLISECOND,0);
|
| | | return todayStart.getTime();
|
| | | }
|
| | | |
| | | public static Date getTodayEndTime() {
|
| | | Calendar todayEnd = Calendar.getInstance();
|
| | | todayEnd.set(Calendar.HOUR_OF_DAY,23);
|
| | | todayEnd.set(Calendar.MINUTE,59);
|
| | | todayEnd.set(Calendar.SECOND,59);
|
| | | todayEnd.set(Calendar.MILLISECOND,999);
|
| | | return todayEnd.getTime();
|
| | | }
|
| | | |
| | |
|
| | | public static void main(String[] args) throws ParseException {
|
| | | System.out.println(getMonthSpace("2012-02", "2012-02"));
|