| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.monitor.BusinessEmergent110Service;
|
| | | import com.yeshi.fanli.service.inter.monitor.MonitorService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private TLJBuyGoodsService tljBuyGoodsService;
|
| | | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | | |
| | |
|
| | | private void doTaoLiJinBuy(Long uid, Long auctionId, PrintWriter out) {
|
| | | private void doTaoLiJinBuy(AcceptData acceptData, Long uid, Long auctionId, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | TaoBaoLink taoBaoLink;
|
| | | try {
|
| | |
| | | data.put("type", 1);
|
| | | data.put("link", link);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | |
| | | // 1.6.5 自购立减添加 金币
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | integralGetService.addTaoLiJinBuy(uid, auctionId);
|
| | | |
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | if ("taolijin_buy".equalsIgnoreCase(source)) {
|
| | | doTaoLiJinBuy(uid, auctionId, out);
|
| | | doTaoLiJinBuy(acceptData, uid, auctionId, out);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | data.put("link", link);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | // 获得金币
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | integralGetService.addCouponRebate(uid);
|
| | | |
| | | } catch (Exception e) {
|
| | |
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | history.setGoodsId(goodsId);
|
| | | recommendGoodsDeleteHistoryService.addRecommendGoodsDeleteHistory(history);
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | |
| | | // 获得金币
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | integralGetService.addCloseRecommendGoods(uid);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, false);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | |
|
| | | data.put("shareMoney", "¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId, Constant.SOURCE_TYPE_TAOBAO, true);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | userShareGoodsRecordService.takeEffectShareRecord(shareId);
|
| | | userShareGoodsRecordService.takeEffectShareRecord(acceptData, shareId);
|
| | | } catch (UserShareGoodsRecordException eu) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(eu);
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "页码不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | List<CodePublishRecord> list = codePublishRecordService.listValid((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE);
|
| | | if (list == null) {
|
| | | list = new ArrayList<CodePublishRecord>();
|
| | | }
|
| | |
|
| | | List<CodePublishRecord> list = codePublishRecordService.listValid((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE);
|
| | | if (list == null) {
|
| | | list = new ArrayList<CodePublishRecord>();
|
| | | long count = codePublishRecordService.countValid();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", getGson().toJson(list));
|
| | | data.put("helpLink", configService.get("publish_list_help_link"));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "获取失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = codePublishRecordService.countValid();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", getGson().toJson(list));
|
| | | data.put("helpLink", configService.get("publish_list_help_link"));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo userInfo = userInfoService.selectByPKey(uid);
|
| | | if (userInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户信息不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | ThreeSale threeSale = threeSaleSerivce.selectByPrimaryKey(inviteId);
|
| | | if (threeSale == null) {
|
| | | out.print(JsonUtil.loadFalseResult("关系id不存在"));
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo userInfo = userInfoService.selectByPKey(remindId);
|
| | | if (userInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("被提醒人信息不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | Long bossId = null;
|
| | | Long workerId = null;
|
| | | String title = "队员提醒消息";
|
| | | String content = "";
|
| | | if (remindBoss) {
|
| | | // 提示队长
|
| | | bossId = remindId;
|
| | | workerId = uid;
|
| | | content = "你的邀请人"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
|
| | | content = "你的一级队员"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
|
| | | } else {
|
| | | // 提示队员
|
| | | bossId = uid;
|
| | | workerId = remindId;
|
| | | } content = "你的一级队员"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
|
| | | |
| | | content = "你的邀请人"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
|
| | | }
|
| | |
|
| | | try {
|
| | | List<String> listIOS = new ArrayList<String>();
|
| | |
| | | newInfo.setUpdateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.updateByPrimaryKeySelective(newInfo);
|
| | | } else {
|
| | | newInfo.setBoss(new UserInfo(bossId));
|
| | | newInfo.setWorker(new UserInfo(workerId));
|
| | | newInfo.setCreateTime(new Date());
|
| | | newInfo.setUpdateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.insertSelective(newInfo);
|
| | |
| | | // 分享id
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_TAOBAO);
|
| | | Constant.SOURCE_TYPE_TAOBAO, false);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, auctionId,
|
| | | Constant.SOURCE_TYPE_TAOBAO);
|
| | | Constant.SOURCE_TYPE_TAOBAO, true);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | shareInfo.setShareMoney("¥" + shareMoney.toString());
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_JD);
|
| | | Constant.SOURCE_TYPE_JD, false);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | |
|
| | | try {
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsDetail(uid, goodsId,
|
| | | Constant.SOURCE_TYPE_PDD);
|
| | | Constant.SOURCE_TYPE_PDD, false);
|
| | | shareInfo.setShareId(shareRecord.getRedisKey());
|
| | | } catch (Exception e) {
|
| | | try {
|
| | |
| | | return;
|
| | | }
|
| | | try {
|
| | | String tips = UserSystemCouponService.giveCoupon(uid, id);
|
| | | out.print(JsonUtil.loadTrueResult(tips));
|
| | | UserSystemCouponVO vo = UserSystemCouponService.giveCoupon(uid, id);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("result", JsonUtil.getApiCommonGson().toJson(vo));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserSystemCouponException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | }
|
| | |
| | | private Integer goodsType;
|
| | | private List<CommonGoods> listGoods;
|
| | | private List<Long> listId;
|
| | | // 是否创建淘礼金
|
| | | private boolean isTaolijin;
|
| | | |
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | |
| | | this.listGoods = listGoods;
|
| | | }
|
| | |
|
| | | public boolean isTaolijin() {
|
| | | return isTaolijin;
|
| | | }
|
| | |
|
| | | public void setTaolijin(boolean isTaolijin) {
|
| | | this.isTaolijin = isTaolijin;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public enum TaskUniqueKeyEnum {
|
| | | dailySign1("第1天签到"), dailySign2("第2天签到"),dailySign3("第3天签到"),dailySign4("第4天签到"), dailySign5("第5天签到"),
|
| | | dailySign6("第6天签到"), dailySign7("第7天签到"), recommendSearch("完成搜索"), taoLiJinBuy("点击立减"),
|
| | | inviteLevelOne("直接邀请"),inviteLevelTwo("间接邀请"), buyReduce("自购立减"), shareSingleGoods("分享单个商品"), |
| | | shareMultipleGoods("分享多个商品"), shareInvite("邀请素材"), shareTLJGoods("爆款商品") , |
| | | giveRebateCoupon("返利奖励券"), giveFreeCoupon("赠送免单券"),giveTaoLiJin("赠送推广红包"),inShop("浏览店铺"),
|
| | | inShopLevelOne("一级队员浏览店铺"),inShopLevelTwo("二级队员浏览店铺"),scanPush("浏览推荐记录"),scanGoods("浏览商品详情页"),
|
| | | scanSearchResult("浏览搜索结果页"),scanHomeBanner("浏览横幅专题"),scanSpecial("浏览首页专题"),scanTBCart("浏览购物车页"),
|
| | | closeRecommendGoods("关闭推荐商品"),couponRebate("点击领券返利"),couponRebateLevelOne("浏览购物车页"),couponRebateLevelTwo("浏览购物车页"),
|
| | | rebateOrder("完成返利订单"),inviteOrderLevelOne("一级队员邀请订单"),inviteOrderLevelTwo("二级队员邀请订单"),shareOrder("分享订单"),
|
| | | bindWeiXin("微信授权"),bindPhone("绑定手机"),bindTaoBao("淘宝授权"), setWeiXinNum("添加微信号"),setGender("首次设置性别"),
|
| | | setPortrait("首次修改头像"), setNickname("修改昵称"),bindAlipay("绑定支付宝"),inviteActivate("激活邀请");
|
| | | |
| | | private final String desc;
|
| | |
|
| | | private TaskUniqueKeyEnum(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Column(name = "it_id")
|
| | | private Long id;
|
| | |
| | | <select id="getRecordByUidAndCouponId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_system_coupon_give_record |
| | | WHERE cgr_state = 0 AND cgr_give_uid = #{uid} AND cgr_coupon_id = #{couponId} |
| | | ORDER BY cgr_end_time desc |
| | | ORDER BY cgr_give_time desc |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | |
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
|
| | | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | |
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | |
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | |
| | | UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
|
| | | try {
|
| | | UserActiveLog activeLog = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
|
| | | if (activeLog != null && !StringUtil.isNullOrEmpty(activeLog.getVersionCode()) ) {
|
| | | String versionCode = activeLog.getVersionCode();
|
| | | String channel = activeLog.getChannel();
|
| | |
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | if (activeLog != null && !StringUtil.isNullOrEmpty(activeLog.getVersionCode()) ) {
|
| | | String versionCode = activeLog.getVersionCode();
|
| | | String channel = activeLog.getChannel();
|
| | | |
| | | boolean result = false;
|
| | | if (!StringUtil.isNullOrEmpty(channel) && "appstore".equalsIgnoreCase(channel)) {
|
| | | result = VersionUtil.greaterThan_1_6_5("ios", versionCode);
|
| | | } else {
|
| | | result = VersionUtil.greaterThan_1_6_5("android", versionCode);
|
| | | }
|
| | | |
| | | if (result) {
|
| | | // 邀请金币
|
| | | integralGetService.addInviteLevelOne(inviter.getId(), invitee.getId());
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | |
| | | return listValid;
|
| | | }
|
| | |
|
| | | for (CodePublishRecord codePublishRecord: listValid) {
|
| | | for (int i = 0; i < listValid.size(); i ++) {
|
| | | CodePublishRecord codePublishRecord = listValid.get(i);
|
| | | String inviteCode = codePublishRecord.getInviteCode();
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | listValid.remove(i);
|
| | | i--;
|
| | | continue;
|
| | | }
|
| | | |
| | | String index = inviteCode.substring(0, 1);
|
| | | String end = inviteCode.substring(inviteCode.length()-2, inviteCode.length()-1);
|
| | | codePublishRecord.setInviteCode("TA的邀请码:" + index + "****" + end);
|
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask.TaskUniqueKeyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
|
| | | import com.yeshi.fanli.exception.integral.IntegralGetException;
|
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
|
| | |
| | |
|
| | | @Resource
|
| | | private IntegralTaskRecordService integralTaskRecordService;
|
| | | |
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
| | | record.setUid(uid);
|
| | |
|
| | | try {
|
| | | return integralTaskRecordService.addRecord(record);
|
| | | IntegralTaskRecord addRecord = integralTaskRecordService.addRecord(record);
|
| | | if (TaskUniqueKeyEnum.inShop == TaskUniqueKeyEnum.valueOf(event)) {
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss != null) |
| | | addInShopLevelOne(boss.getId()); // 下级浏览店铺
|
| | | }
|
| | | return addRecord;
|
| | | } catch (IntegralTaskRecordException e) {
|
| | | throw new IntegralGetException(3, "添加记录失败");
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | // switch (event) {
|
| | | // case "recommendSearch":
|
| | |
| | | // TODO Auto-generated method stub
|
| | |
|
| | | }
|
| | | |
| | | @Async()
|
| | | private void addInShopLevelOne(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inShopLevelOne.name(), null);
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss != null) |
| | | addInShopLevelTwo(boss.getId()); // 二级队员
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Async()
|
| | | private void addInShopLevelTwo(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inShopLevelTwo.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void addScanPushHistory(Long uid) throws IntegralGetException {
|
| | |
| | |
|
| | | }
|
| | |
|
| | | @Async()
|
| | | @Override
|
| | | public void addTaoLiJinBuy(Long uid, Long goodsId) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.taoLiJinBuy.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Async()
|
| | | @Override
|
| | | public void addInviteLevelOne(Long uid, Long workerId) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelOne.name(), null);
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss != null)
|
| | | addInviteLevelTwo(boss.getId());
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 间接邀请
|
| | | * @param uid
|
| | | */
|
| | | @Async()
|
| | | private void addInviteLevelTwo(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inviteLevelTwo.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addShareSingleGoods(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.shareSingleGoods.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addShareMultipleGoods(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.shareMultipleGoods.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addShareTLJGoods(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.shareTLJGoods.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addGiveRebateCoupon(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.giveRebateCoupon.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addGiveFreeCoupon(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.giveFreeCoupon.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addGiveTaoLiJin(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.giveTaoLiJin.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addCloseRecommendGoods(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.closeRecommendGoods.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addCouponRebate(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.couponRebate.name(), null);
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss != null)
|
| | | addCouponRebateLevelOne(boss.getId());
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 一级队员领券返利
|
| | | * @param uid
|
| | | */
|
| | | @Async()
|
| | | private void addCouponRebateLevelOne(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.couponRebateLevelOne.name(), null);
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss != null)
|
| | | addCouponRebateLevelTwo(boss.getId()); // 二级队员
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 二级队员领券返利
|
| | | * @param uid
|
| | | */
|
| | | @Async()
|
| | | private void addCouponRebateLevelTwo(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.couponRebateLevelTwo.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addRebateOrder(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.rebateOrder.name(), null);
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss != null)
|
| | | addInviteOrderLevelOne(boss.getId());
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 一级队员邀请订单
|
| | | * @param uid
|
| | | */
|
| | | @Async()
|
| | | private void addInviteOrderLevelOne(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelOne.name(), null);
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss != null)
|
| | | addInviteOrderLevelTwo(boss.getId());
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 二级队员邀请订单
|
| | | * @param uid
|
| | | */
|
| | | @Async()
|
| | | private void addInviteOrderLevelTwo(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inviteOrderLevelTwo.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addShareOrder(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.shareOrder.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addBindWeiXin(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.bindWeiXin.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addBindPhone(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.bindPhone.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addBindTaoBao(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.bindTaoBao.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addSetWeiXinNum(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.setWeiXinNum.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addSetGender(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.setGender.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addSetPortrait(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.setPortrait.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addSetNickname(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.setNickname.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addBindAlipay(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.bindAlipay.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Async()
|
| | | @Override
|
| | | public void addInviteActivate(Long uid) {
|
| | | try {
|
| | | addEventStatistic(uid, TaskUniqueKeyEnum.inviteActivate.name(), null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | String before = format.format(listDays.get(i));
|
| | | if (before.startsWith("0"))
|
| | | before = before.substring(1, before.length());
|
| | | |
| | | SignDateVO signDateVO = new SignDateVO();
|
| | | signDateVO.setDate(before);
|
| | | signDateVO.setLightUp(true);
|
| | | listSign.add(signDateVO);
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass.UniqueKeyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
|
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | |
| | | if (integralTask == null)
|
| | | return false;
|
| | |
|
| | | int num = 0;
|
| | | FrequencyEnum frequency = integralTask.getFrequency();
|
| | | if (frequency == FrequencyEnum.everyday) {
|
| | | num = integralTaskRecordMapper.countByTaskIdTodayNum(uid, taskId, TimeUtil.getWholeTime(record.getCreateTime().getTime()));
|
| | | } else if (frequency == FrequencyEnum.onlyOne) {
|
| | | num = 1;
|
| | | }
|
| | |
|
| | | if (num <= 0)
|
| | | num = 1;
|
| | |
|
| | | String title = taskClass.getName() + "-" + integralTask.getName() + "-" + num + "次";
|
| | |
|
| | | // 加入明细
|
| | | IntegralDetail detail = new IntegralDetail();
|
| | | if (UniqueKeyEnum.dailySign == taskClass.getUniqueKey()) {
|
| | | detail.setTitle(taskClass.getName() + "-" + integralTask.getName());
|
| | | } else {
|
| | | int num = 0;
|
| | | FrequencyEnum frequency = integralTask.getFrequency();
|
| | | if (frequency == FrequencyEnum.everyday) {
|
| | | num = integralTaskRecordMapper.countByTaskIdTodayNum(uid, taskId, TimeUtil.getWholeTime(record.getCreateTime().getTime()));
|
| | | } else if (frequency == FrequencyEnum.onlyOne) {
|
| | | num = 1;
|
| | | }
|
| | | |
| | | if (num <= 0)
|
| | | num = 1;
|
| | | String title = taskClass.getName() + "-" + integralTask.getName() + "-" + num + "次";
|
| | | detail.setTitle(title);
|
| | | }
|
| | | |
| | | detail.setUid(uid);
|
| | | detail.setTitle(title);
|
| | | detail.setMoney(record.getGoldCoin());
|
| | | detail.setCreateTime(record.getCreateTime());
|
| | | integralDetailService.insertSelective(detail);
|
| | |
| | |
|
| | | BigDecimal total = new BigDecimal(0);
|
| | | for (UserTaoLiJinOrigin userTaoLiJinOrigin : list) {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | String time = sd.format(userTaoLiJinOrigin.getCreateTime());
|
| | |
|
| | | BigDecimal moneySurplus = userTaoLiJinOrigin.getMoneySurplus();
|
| | |
| | | public void run() {
|
| | | // 退回消息
|
| | | String beiZhu = "请到我的-推广红包查看";
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_TLJ);
|
| | | msgOther.setTitle("赠送推广红包退回");
|
| | |
| | | // 使用成功消息
|
| | | try {
|
| | | String beizhu = "未被领取或领取后未使用部分退回";
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | String time = sd.format(new Date());
|
| | | MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
|
| | | content.setState("红包扣除");
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon;
|
| | | import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
|
| | | import com.yeshi.fanli.exception.tlj.UserTaoLiJinOriginException;
|
| | | import com.yeshi.fanli.exception.user.TokenRecordException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.SystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinGiveRecordService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserOtherMsgNotificationService userOtherMsgNotificationService;
|
| | | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | | @Resource
|
| | | private SystemCouponService systemCouponService;
|
| | | |
| | |
|
| | | @Override
|
| | | public void insertSelective(TokenRecord record) {
|
| | |
| | | || userCoupon.getState() != UserSystemCoupon.STATE_IN_USE)
|
| | | throw new TokenRecordException(1, "该券不存在或非赠送");
|
| | |
|
| | | |
| | | |
| | | try {
|
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCoupon.name(),
|
| | | UserSystemCoupon.SOURCE_GIVE);
|
| | | UserSystemCoupon.SOURCE_GIVE, null);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new TokenRecordException(1, "领取失败");
|
| | |
| | | updateGiveRecord.setState(UserSystemCouponGiveRecord.STATE_RECEIVE);
|
| | | userSystemCouponGiveRecordService.updateByPrimaryKeySelective(updateGiveRecord);
|
| | |
|
| | | integralGetService.addGiveFreeCoupon(giveUid);
|
| | | |
| | | msg = "领取成功[免单券]成功,请到[我的-福利中心]中查看";
|
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | |
| | | || userCoupon.getState() != UserSystemCoupon.STATE_IN_USE)
|
| | | throw new TokenRecordException(1, "该券不存在或非赠送");
|
| | |
|
| | | SystemCoupon systemCoupon = userCoupon.getSystemCoupon();
|
| | | if (systemCoupon == null)
|
| | | throw new TokenRecordException(1, "该券不存在");
|
| | | |
| | | systemCoupon = systemCouponService.selectByPrimaryKey(systemCoupon.getId());
|
| | | if (systemCoupon == null)
|
| | | throw new TokenRecordException(1, "该券不存在");
|
| | | |
| | | BigDecimal percent = null;
|
| | | String amount = systemCoupon.getAmount();
|
| | | if (!StringUtil.isNullOrEmpty(amount)) |
| | | percent = new BigDecimal(amount);
|
| | | |
| | | try {
|
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCoupon.name(),
|
| | | UserSystemCoupon.SOURCE_GIVE);
|
| | | userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(),
|
| | | UserSystemCoupon.SOURCE_GIVE, percent);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new TokenRecordException(1, "领取失败");
|
| | |
| | | updateGiveRecord.setState(UserSystemCouponGiveRecord.STATE_RECEIVE);
|
| | | userSystemCouponGiveRecordService.updateByPrimaryKeySelective(updateGiveRecord);
|
| | |
|
| | | integralGetService.addGiveRebateCoupon(giveUid);
|
| | | |
| | | msg = "领取成功[返利奖励券]成功,请到[我的-福利中心]中查看";
|
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | |
| | | updateRecord.setState(UserTaoLiJinGiveRecord.STATE_RECEIVE);
|
| | | userTaoLiJinGiveRecordService.updateByPrimaryKeySelective(updateRecord);
|
| | |
|
| | | integralGetService.addGiveTaoLiJin(giveUid);
|
| | | |
| | | msg = "领取成功[推广红包]成功,请到[我的-推广红包]中查看";
|
| | |
|
| | | // 消息 + 队员
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | boolean addTeam = addInviteTeam(uid, giveUid, userInfoExtra);
|
| | | String beiZhu = "无";
|
| | | if (addTeam)
|
| | |
| | | prize = "NoPrize";
|
| | | } else {
|
| | | try {
|
| | | userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES);
|
| | | userSystemCouponService.insertUserCoupon(uid, prize, UserSystemCoupon.SOURCE_NEWBIES, null);
|
| | | } catch (UserSystemCouponException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.share.UserShareGoodsRecordMapper;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserGoodsStorageService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsGroupService;
|
| | |
| | | import com.yeshi.fanli.util.ImageUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserGoodsStorageService userGoodsStorageService;
|
| | | |
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public int insert(UserShareGoodsRecord record) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType) throws UserShareGoodsRecordException {
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException {
|
| | | if (auctionId == null || uid == null || uid <= 0) {
|
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确");
|
| | | }
|
| | |
| | | recordDTO.setUid(uid);
|
| | | recordDTO.setAuctionId(auctionId);
|
| | | recordDTO.setGoodsType(goodsType);
|
| | | recordDTO.setTaolijin(isTaolijin);
|
| | | recordDTO.setSource(ShareSourceTypeEnum.goodsDetail);
|
| | |
|
| | | // 分享id
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void takeEffectShareRecord(String shareKey) throws UserShareGoodsRecordException {
|
| | | public void takeEffectShareRecord(AcceptData acceptData, String shareKey) throws UserShareGoodsRecordException {
|
| | | if (StringUtil.isNullOrEmpty(shareKey)) {
|
| | | throw new UserShareGoodsRecordException(1, "传递参数不正确");
|
| | | }
|
| | |
| | | throw new UserShareGoodsRecordException(1, "分享信息不存在");
|
| | | }
|
| | |
|
| | | Long uid = recordDTO.getUid();
|
| | | boolean taolijin = recordDTO.isTaolijin();
|
| | | boolean singleGoods = true;
|
| | | Long shareId = recordDTO.getShareId();
|
| | | ShareSourceTypeEnum source = recordDTO.getSource();
|
| | | if (ShareSourceTypeEnum.goodsDetail.equals(source)) {
|
| | |
| | | shareRecord.setUpdateTime(new Date());
|
| | | updateByPrimaryKeySelective(shareRecord);
|
| | |
|
| | | List<CommonGoods> listGoods = recordDTO.getListGoods();
|
| | | if (listGoods != null && listGoods.size() > 1) |
| | | singleGoods = false;
|
| | | |
| | | // 保存商品信息
|
| | | multipleGoodsShareRecord(shareId, recordDTO.getListGoods());
|
| | |
|
| | | } else if (ShareSourceTypeEnum.storage.equals(source)) {
|
| | | // 分享库分享
|
| | | singleGoods = false;
|
| | | |
| | | UserShareGoodsRecord shareRecord = new UserShareGoodsRecord();
|
| | | shareRecord.setId(shareId);
|
| | | shareRecord.setShareState(1);
|
| | |
| | |
|
| | | // 清理缓存
|
| | | redisManager.removeCommonString(shareKey);
|
| | | |
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | if (singleGoods) {
|
| | | if (taolijin) {
|
| | | integralGetService.addShareTLJGoods(uid);
|
| | | } else {
|
| | | integralGetService.addShareSingleGoods(uid);
|
| | | }
|
| | | } else {
|
| | | integralGetService.addShareMultipleGoods(uid);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void insertUserCoupon(Long uid, String couponType, String source)
|
| | | public void insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent)
|
| | | throws UserSystemCouponException, Exception {
|
| | |
|
| | | if (couponType == null || uid == null) {
|
| | |
| | | coupon = systemCouponService.getCouponByType(couponType);
|
| | | } else if (couponType.equals(CouponTypeEnum.rebatePercentCoupon.name())) {
|
| | | // 随机奖励券
|
| | | randomRewardCoupon(1, uid, source);
|
| | | return;
|
| | | if (percent == null || percent.compareTo(new BigDecimal(0)) > 0) {
|
| | | randomRewardCoupon(1, uid, source);
|
| | | return;
|
| | | } else {
|
| | | coupon = systemCouponService.getCouponByTypeAndPercent(couponType, percent);
|
| | | }
|
| | | }
|
| | |
|
| | | if (coupon == null) {
|
| | |
| | | }
|
| | | } else if (UserSystemCoupon.STATE_IN_USE == state && give) {
|
| | | userCouponVO.setCouponEffect("赠送中");
|
| | | userCouponVO.setCouponRule(systemCoupon.getRemark());
|
| | | String tips = null;
|
| | | if (CouponTypeEnum.freeCouponGive == type) {
|
| | | userCouponVO.setState(UserSystemCoupon.STATE_GIVE_IN);
|
| | |
| | | tips = tips.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
|
| | | userCouponVO.setGiveTips(tips);
|
| | | }
|
| | |
|
| | | Date endTimeGive = record.getEndTime();
|
| | |
| | | remainDays.put("fontColor", "#F14242");
|
| | | userCouponVO.setRemainDays(remainDays);
|
| | | }
|
| | | }
|
| | | } else {
|
| | | tips = "";
|
| | | }
|
| | | userCouponVO.setGiveTips(tips);
|
| | | } else if (UserSystemCoupon.STATE_END_USE == state) {
|
| | | if (give && CouponTypeEnum.freeCouponGive == type) {
|
| | | } |
| | | } |
| | | |
| | | } else if (give && UserSystemCoupon.STATE_END_USE == state) {
|
| | | userCouponVO.setCouponRule(systemCoupon.getRemark());
|
| | | if (CouponTypeEnum.freeCouponGive == type) {
|
| | | userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END);
|
| | | }
|
| | |
|
| | | if (give && CouponTypeEnum.rebatePercentCoupon == type) {
|
| | | if (CouponTypeEnum.rebatePercentCoupon == type) {
|
| | | userCouponVO.setState(UserSystemCoupon.STATE_GIVE_END);
|
| | | }
|
| | | }else if (give && UserSystemCoupon.STATE_OVERDUE == state) {
|
| | | userCouponVO.setCouponRule(systemCoupon.getRemark());
|
| | | }
|
| | | userCouponVO.setJumpBtn(jumpBtn);
|
| | | }
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public String giveCoupon(Long uid, Long id) throws UserSystemCouponException {
|
| | | public UserSystemCouponVO giveCoupon(Long uid, Long id) throws UserSystemCouponException {
|
| | | UserSystemCoupon userSystemCoupon = userSystemCouponMapper.selectByPrimaryKey(id);
|
| | | if (userSystemCoupon == null)
|
| | | throw new UserSystemCouponException(1, "该券已不存在");
|
| | |
| | | throw new UserSystemCouponException(1, "该券已失效");
|
| | |
|
| | | Integer state = userSystemCoupon.getState();
|
| | | if (state == UserSystemCoupon.STATE_OVERDUE) |
| | | throw new UserSystemCouponException(1, "该券已过期");
|
| | | |
| | | if (state == UserSystemCoupon.STATE_END_USE) |
| | | throw new UserSystemCouponException(1, "该券使用/赠送成功");
|
| | | if (state != UserSystemCoupon.STATE_CAN_USE) |
| | | throw new UserSystemCouponException(1, "该券已被使用或赠送");
|
| | |
|
| | | CouponTypeEnum type = systemCoupon.getType();
|
| | | if (type != CouponTypeEnum.freeCouponGive && type != CouponTypeEnum.rebatePercentCoupon )
|
| | |
| | | tips = tips.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | tips = tips.replace("{口令}", tokenRecord.getToken()).replace("{下载链接}", configService.get("app_down_link"));
|
| | | return tips;
|
| | | |
| | | return createUserCouponVOo(userSystemCoupon, systemCoupon, record, tips);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | tips = tips.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | tips = tips.replace("{口令}", token).replace("{下载链接}", configService.get("app_down_link"));
|
| | | return tips;
|
| | | |
| | | return createUserCouponVOo(userSystemCoupon, systemCoupon, giveRecord, tips);
|
| | | }
|
| | | |
| | | |
| | | private UserSystemCouponVO createUserCouponVOo(UserSystemCoupon userSystemCoupon, SystemCoupon systemCoupon, |
| | | UserSystemCouponGiveRecord record, String tips) {
|
| | | UserSystemCouponVO userCouponVO = new UserSystemCouponVO();
|
| | | userCouponVO.setId(userSystemCoupon.getId());
|
| | | userCouponVO.setUid(userSystemCoupon.getUid());
|
| | | userCouponVO.setSource("来源:" + userSystemCoupon.getSource());
|
| | | userCouponVO.setCouponName(systemCoupon.getName());
|
| | | userCouponVO.setCouponEffect("赠送中");
|
| | | userCouponVO.setState(UserSystemCoupon.STATE_GIVE_IN);
|
| | | userCouponVO.setCouponRule(systemCoupon.getRemark());
|
| | | userCouponVO.setCouponRuleLink(systemCoupon.getRuleLink());
|
| | | userCouponVO.setCouponPicture(systemCoupon.getPicture());
|
| | | userCouponVO.setGiveTips(tips);
|
| | | |
| | | String couponTerm = "有效期:";
|
| | | Date startTime = userCouponVO.getStartTime();
|
| | | Date endTime = userCouponVO.getEndTime();
|
| | | if (endTime != null && startTime != null) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | couponTerm = couponTerm + sdf.format(startTime) + "-" + sdf.format(endTime);
|
| | | }
|
| | | userCouponVO.setCouponTerm(couponTerm);
|
| | | |
| | | Map<String, Object> remainDays = new HashMap<String, Object>();
|
| | | |
| | | try {
|
| | | remainDays.put("content", "剩余" + DateUtil.dateDiff2(new Date(), record.getGiveTime()) + "过期");
|
| | | } catch (Exception e) {
|
| | | }
|
| | | remainDays.put("fontColor", "#F14242");
|
| | | userCouponVO.setRemainDays(remainDays);
|
| | | |
| | | return userCouponVO;
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | // 退回消息
|
| | | String beiZhu = "请到我的-福利中心查看";
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | | MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
|
| | | msgOther.setType(MsgOtherGiveContentDTO.TYEP_COUPON);
|
| | | msgOther.setTitle("赠送" + systemCoupon.getName() + "退回");
|
| | |
| | | */
|
| | | public void addScanTaoBaoCart(Long uid);
|
| | |
|
| | | /**
|
| | | * 自购立减
|
| | | * @param uid
|
| | | */
|
| | | public void addTaoLiJinBuy(Long uid, Long goodsId);
|
| | |
|
| | | /**
|
| | | * 直接邀请
|
| | | * @param uid
|
| | | * @param goodsId
|
| | | */
|
| | | public void addInviteLevelOne(Long uid, Long workerId);
|
| | |
|
| | |
|
| | | /**
|
| | | * 单个商品分享
|
| | | * @param uid
|
| | | */
|
| | | public void addShareSingleGoods(Long uid);
|
| | |
|
| | | /**
|
| | | * 多个商品分享
|
| | | * @param uid
|
| | | */
|
| | | public void addShareMultipleGoods(Long uid);
|
| | |
|
| | | /**
|
| | | * 分享爆款商品
|
| | | * @param uid
|
| | | */
|
| | | public void addShareTLJGoods(Long uid);
|
| | |
|
| | | /**
|
| | | * 赠送奖励券
|
| | | * @param uid
|
| | | */
|
| | | public void addGiveRebateCoupon(Long uid);
|
| | |
|
| | | /**
|
| | | * 赠送免单券
|
| | | * @param uid
|
| | | */
|
| | | public void addGiveFreeCoupon(Long uid);
|
| | |
|
| | | /**
|
| | | * 赠送推广红包
|
| | | * @param uid
|
| | | */
|
| | | public void addGiveTaoLiJin(Long uid);
|
| | |
|
| | | /**
|
| | | * 关闭 不喜欢商品
|
| | | * @param uid
|
| | | */
|
| | | public void addCloseRecommendGoods(Long uid);
|
| | |
|
| | | /**
|
| | | * 领券返利
|
| | | * @param uid
|
| | | */
|
| | | public void addCouponRebate(Long uid);
|
| | |
|
| | | /**
|
| | | * 返利订单
|
| | | * @param uid
|
| | | */
|
| | | public void addRebateOrder(Long uid);
|
| | |
|
| | | /**
|
| | | * 分享订单
|
| | | * @param uid
|
| | | */
|
| | | public void addShareOrder(Long uid);
|
| | |
|
| | | /**
|
| | | * 微信授权
|
| | | * @param uid
|
| | | */
|
| | | public void addBindWeiXin(Long uid);
|
| | |
|
| | | /**
|
| | | * 绑定手机
|
| | | * @param uid
|
| | | */
|
| | | public void addBindPhone(Long uid);
|
| | |
|
| | | /**
|
| | | * 淘宝授权
|
| | | * @param uid
|
| | | */
|
| | | public void addBindTaoBao(Long uid);
|
| | |
|
| | | /**
|
| | | * 添加微信号
|
| | | * @param uid
|
| | | */
|
| | | public void addSetWeiXinNum(Long uid);
|
| | |
|
| | | /**
|
| | | * 设置性别
|
| | | * @param uid
|
| | | */
|
| | | public void addSetGender(Long uid);
|
| | |
|
| | | /**
|
| | | * 修改头像
|
| | | * @param uid
|
| | | */
|
| | | public void addSetPortrait(Long uid);
|
| | |
|
| | | /**
|
| | | * 修改昵称
|
| | | * @param uid
|
| | | */
|
| | | public void addSetNickname(Long uid);
|
| | |
|
| | | /**
|
| | | * 绑定支付宝
|
| | | * @param uid
|
| | | */
|
| | | public void addBindAlipay(Long uid);
|
| | |
|
| | | /**
|
| | | * 激活邀请
|
| | | * @param uid
|
| | | */
|
| | | public void addInviteActivate(Long uid);
|
| | |
|
| | | }
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsGroup;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | |
| | | * @param shareId
|
| | | * @throws UserShareGoodsRecordException
|
| | | */
|
| | | public void takeEffectShareRecord(String shareKey) throws UserShareGoodsRecordException;
|
| | | public void takeEffectShareRecord(AcceptData acceptData, String shareKey) throws UserShareGoodsRecordException;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws UserShareGoodsRecordException
|
| | | */
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType) throws UserShareGoodsRecordException;
|
| | | public ShareGoodsRecordDTO addRecordGoodsDetail(Long uid, Long auctionId, Integer goodsType, boolean isTaolijin) throws UserShareGoodsRecordException;
|
| | |
|
| | | /**
|
| | | * 选品库商品分享
|
| | |
| | | * @throws UserSystemCouponException
|
| | | * @throws Exception
|
| | | */
|
| | | public void insertUserCoupon(Long uid, String couponType, String source) throws UserSystemCouponException, Exception;
|
| | | public void insertUserCoupon(Long uid, String couponType, String source, BigDecimal percent) throws UserSystemCouponException, Exception;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws UserSystemCouponException
|
| | | */
|
| | | public String giveCoupon(Long uid, Long id) throws UserSystemCouponException;
|
| | | public UserSystemCouponVO giveCoupon(Long uid, Long id) throws UserSystemCouponException;
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | if (dto.getLeftDay() != null) {
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getLeftDay() + "", COLOR_HIGHLIGHT_CONTENT));
|
| | | contentList.add(new ClientTextStyleVO("天", COLOR_CONTENT));
|
| | | |
| | | if (msg.getType() == MsgTypeOtherTypeEnum.couponMianDan) {
|
| | | contentList.add(new ClientTextStyleVO("天(未使用将会过期)", COLOR_CONTENT));
|
| | | } else {
|
| | | contentList.add(new ClientTextStyleVO("天", COLOR_CONTENT));
|
| | | }
|
| | | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("剩余天数", COLOR_TITLE), contentList));
|
| | | }
|
| | |
|