Merge remote-tracking branch 'origin/div' into div
Conflicts:
fanli/src/main/java/com/yeshi/fanli/service/impl/dynamic/GoodsEvaluateServiceImpl.java
订单加入urank属性
| | |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.count.DailyCountMomentsService; |
| | | import com.yeshi.fanli.service.inter.dynamic.ArticleOfficialService; |
| | | import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService; |
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService; |
| | |
| | | |
| | | @Resource |
| | | private ShareGoodsService shareGoodsService; |
| | | |
| | | @Resource |
| | | private DailyCountMomentsService dailyCountMomentsService; |
| | | |
| | | |
| | | // @Resource |
| | | // private DailyCountMomentsService dailyCountMomentsService; |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | | |
| | | |
| | | private final static long TYPE_REXIAO = 1;// 热销 |
| | | private final static long TYPE_TUIJIAN = 2;// 推荐 |
| | |
| | | return new JsonPrimitive(""); |
| | | } else { |
| | | // 保留2位小数 |
| | | return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value)+""); |
| | | return new JsonPrimitive(MoneyBigDecimalUtil.getWithNoZera(value) + ""); |
| | | } |
| | | } |
| | | }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() { |
| | |
| | | if (imgInfo.getGoodsVO() != null) |
| | | if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue() |
| | | && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl()); |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl()); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | |
| | | } else if (type == 2 || type == 3) { |
| | | for (ImgInfo imgInfo : imgs) { |
| | | if (imgInfo.getGoodsVO() != null) { |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, imgInfo.getUrl() ); |
| | | String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode, |
| | | imgInfo.getUrl()); |
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) { |
| | | list.add(jumpLink); |
| | | } |
| | |
| | | else if (imgInfo.getType() == ImgEnum.activity) |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getActivityPic())) { |
| | | list.add(imgInfo.getActivityPic()); |
| | | }else if(!StringUtil.isNullOrEmpty(imgInfo.getUrl())){ |
| | | } else if (!StringUtil.isNullOrEmpty(imgInfo.getUrl())) { |
| | | list.add(imgInfo.getUrl()); |
| | | } |
| | | } |
| | |
| | | if (type == 3) { |
| | | shareCount++; |
| | | goodsEvaluateService.addShareNum(id); |
| | | |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addShareClick(); |
| | | // TODO |
| | | // dailyCountMomentsService.addShareClick(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, String mainPic) { |
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode, |
| | | String mainPic) { |
| | | String jumpLink = null; |
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoLink taoBaoLink = null; |
| | |
| | | } |
| | | |
| | | String newText = text; // 非通用券需要验证 |
| | | if (comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon) { |
| | | if ((comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon) |
| | | || goodsEvaluate.getType() == EvaluateEnum.activity) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // 替换价格 |
| | | if (goodsEvaluate.getType() == EvaluateEnum.single) { |
| | | GoodsDetailVO goods = goodsEvaluate.getGoods(); |
| | | newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) +""); |
| | | newText = newText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + ""); |
| | | if (!goods.isHasCoupon()) { |
| | | newText = newText.replace("领券抢购", "抢购"); |
| | | newText = newText.replace("【券后价】[券后价]元", ""); |
| | | } else { |
| | | newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice())+""); |
| | | newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + ""); |
| | | } |
| | | newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | |
| | | |
| | | executor.execute(new Runnable() { |
| | | @Override |
| | | public void run() { // 添加每日统计 |
| | | dailyCountMomentsService.addCopyComment(); |
| | | // TODO |
| | | // dailyCountMomentsService.addCopyComment(); |
| | | } |
| | | }); |
| | | } |
| | |
| | | @Table("yeshi_ec_msg_other")
|
| | | public class MsgOtherDetail {
|
| | | public enum MsgTypeOtherTypeEnum {
|
| | | couponMianDan("免单券"),
|
| | | couponWelfareMianDan("福利免单券"),
|
| | | freeCouponBuy("自购免单券"),
|
| | | freeCouponGive("赠送免单券"),
|
| | | couponReward("奖励券"),
|
| | | taoLiJin("推广红包"),
|
| | | taoLiJinExchange("推广红包兑换金币"),
|
| | | give("赠送"),
|
| | | exchange("金币兑换"),
|
| | | couponActivate("免单券激活"),
|
| | | firstOrderReward("粉丝首单奖励邀请人金币"),
|
| | | systemGive("系统赠送"),
|
| | | passVIPApply("超级会员"),
|
| | | rejectVIPApply("超级会员"),
|
| | | teamVIPCallBoss ("温馨提醒"),
|
| | | teamSplitCallBoss ("邀请脱离"),
|
| | | vipUpgradeReward("vip升级奖励");
|
| | | couponMianDan("免单券",""),
|
| | | couponWelfareMianDan("福利免单券",""),
|
| | | freeCouponBuy("自购免单券",""),
|
| | | freeCouponGive("赠送免单券",""),
|
| | | couponReward("奖励券",""),
|
| | | taoLiJin("推广红包",""),
|
| | | taoLiJinExchange("推广红包兑换金币",""),
|
| | | give("赠送",""),
|
| | | exchange("金币兑换",""),
|
| | | couponActivate("免单券激活",""),
|
| | | firstOrderReward("粉丝首单奖励邀请人金币",""),
|
| | | systemGive("系统赠送",""),
|
| | | passVIPApply("超级会员",""),
|
| | | rejectVIPApply("超级会员",""),
|
| | | teamVIPCallBoss ("温馨提醒",""),
|
| | | teamSplitCallBoss ("邀请脱离",""),
|
| | | vipUpgradeReward("系统赠送","http://img.flqapp.com/resource/msg/icon_msg_vip.png");
|
| | |
|
| | | private final String desc;
|
| | | private final String icon;
|
| | |
|
| | | private MsgTypeOtherTypeEnum(String desc) {
|
| | | private MsgTypeOtherTypeEnum(String desc, String icon) {
|
| | | this.desc = desc;
|
| | | this.icon = icon;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | |
| | | public String getIcon() {
|
| | | return icon;
|
| | | }
|
| | | }
|
| | |
|
| | | @Column(name = "mo_id")
|
| | |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo; |
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum; |
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum; |
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture; |
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo; |
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum; |
| | | import com.yeshi.fanli.entity.dynamic.SimpleGoods; |
| | |
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2; |
| | | import com.yeshi.fanli.exception.dynamic.ActivityUserException; |
| | | import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException; |
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException; |
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | | import com.yeshi.fanli.service.inter.activity.ActivityUserService; |
| | |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 按照发布显示时间段起始时间为准。 |
| | | goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime()); |
| | | |
| | | // 按照发布显示时间段起始时间为准。 |
| | | goodsEvaluate.setPublishTime(goodsEvaluate.getStartTime()); |
| | | |
| | | |
| | | List<CommentInfo> comments = evaluateNew.getComments(); |
| | | if (comments != null && comments.size() > 0) { |
| | | EvaluateEnum typeEnum = evaluateNew.getType(); |
| | |
| | | detail.setCreateTime(new Date());
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJin) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.give) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.exchange) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.couponActivate) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.firstOrderReward) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }else if (detail.getType() == MsgTypeOtherTypeEnum.systemGive) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.taoLiJinExchange) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | } else if (detail.getType() == MsgTypeOtherTypeEnum.passVIPApply |
| | | || detail.getType() == MsgTypeOtherTypeEnum.rejectVIPApply |
| | | || detail.getType() == MsgTypeOtherTypeEnum.teamVIPCallBoss
|
| | | || detail.getType() == MsgTypeOtherTypeEnum.teamSplitCallBoss) {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }else if (detail.getType() == MsgTypeOtherTypeEnum.vipUpgradeReward) {
|
| | | } else {
|
| | | msgOtherDetailMapper.insertSelective(detail);
|
| | | userMsgReadStateService.addOtherMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOtherCouponContentDTOFactory;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgOtherDetailFactory;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | |
|
| | | @Service
|
| | | public class UserOtherMsgNotificationServiceImpl implements UserOtherMsgNotificationService {
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public void vipUpgradeReward(Long uid, String beiZhu, MsgOtherSystemGiveDTO dto) {
|
| | | public void createMsgOtherDetail(Long uid, List<CommonMsgItemVO> listMsg, MsgTypeOtherTypeEnum type) {
|
| | | try {
|
| | | if (listMsg == null || listMsg.size() == 0) {
|
| | | return;
|
| | | }
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | | detail.setBeiZhu(beiZhu);
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setRead(false);
|
| | | detail.setType(type);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setContent(new Gson().toJson(dto));
|
| | | detail.setType(MsgTypeOtherTypeEnum.vipUpgradeReward);
|
| | | detail.setContent(new Gson().toJson(listMsg));
|
| | | detail.setCreateTime(new Date());
|
| | | msgOtherDetailService.addMsgOtherDetail(detail);
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | | import com.yeshi.fanli.entity.goods.CommonGoods; |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.entity.jd.JDOrder; |
| | |
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService; |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService; |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService; |
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | |
| | | |
| | | @Resource |
| | | private UserInfoService userInfoService; |
| | | |
| | | |
| | | @Resource |
| | | private UserInviteService userInviteService; |
| | | |
| | | @Resource |
| | | private UserLevelManager userLevelManager; |
| | | |
| | | @Resource(name = "producer") |
| | | private Producer orderProducer; |
| | |
| | | } |
| | | Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList); |
| | | |
| | | |
| | | // 设置是否为vip订单 |
| | | for (CommonOrderVO order : listOrder) { |
| | | if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI |
| | |
| | | totalSettlement = commonOrder.getTotalPayment(); |
| | | } |
| | | commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement); |
| | | |
| | | |
| | | // 邀请订单信息保护 |
| | | if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType |
| | |
| | | if (oldCommonOrder == null)// 新增 |
| | | { |
| | | commonOrder.setCreateTime(new Date()); |
| | | UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(), |
| | | commonOrder.getThirdCreateTime()); |
| | | // 查询是否为vip |
| | | boolean isVIP = userVIPInfoService.isVIP(commonOrder.getUserInfo().getId()); |
| | | if (isVIP) |
| | | commonOrder.setUrank(100);// VIP订单 |
| | | if (userLevel != null) |
| | | commonOrder.setUrank(userLevel.getOrderRank());// VIP订单 |
| | | else { |
| | | UserInfo user = userInfoService.selectAvailableByPrimaryKey(commonOrder.getUserInfo().getId()); |
| | | if (user != null) |
| | |
| | | return commonOrderMapper.countSearchOrderByUid(uid, list); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<CommonOrder> getMinSettleTimeAndUid() { |
| | | return commonOrderMapper.getMinSettleTimeAndUid(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<CommonOrderVO> searchOrderByUid(AcceptData acceptData, int page, int size, Long uid, List<ESOrder> list) |
| | | throws Exception { |
| | |
| | | } else if (CommonOrderGoodsVO.TYPE_TMALL.equalsIgnoreCase(shopType)) { |
| | | order.setOrderType(2); |
| | | } |
| | | |
| | | |
| | | Integer goodsType = commonGoodsVO.getGoodsType(); |
| | | if (goodsType != null & goodsType == Constant.SOURCE_TYPE_ELME) { |
| | | order.setOrderType(Constant.SOURCE_TYPE_ELME); // 饿了么订单 |
| | |
| | | order.getListOrderGoods().add(commonGoodsVO); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // 订单类型 |
| | | if (sourceType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | Integer orderType = order.getOrderType(); |
| | |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | order.setOrderType(4); |
| | | } |
| | | |
| | | |
| | | Date thirdCreateTime = order.getThirdCreateTime(); |
| | | if (thirdCreateTime != null) { |
| | |
| | | if (settleTime != null) { |
| | | order.setReceiveTime("收货时间:" + format.format(settleTime)); |
| | | } |
| | | |
| | | |
| | | /* 订单状态 转换处理 */ |
| | | String orderStateContent = ""; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // 2.1显示返利说明连接> 未失效-自购-分享 |
| | | // 2.1显示返利说明连接> 未失效-自购-分享 |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | if (CommonOrder.STATE_SX != orderState && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME) |
| | | && ((HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) || HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) ) { |
| | | if (CommonOrder.STATE_SX != orderState |
| | | && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME) |
| | | && ((HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) |
| | | || HongBaoV2.TYPE_SHARE_GOODS == hongBaoType)) { |
| | | String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey()); |
| | | order.setRebateLink(rebateLink + "?orderNo=" + orderNo +"&sourceType=" + sourceType); |
| | | order.setRebateLink(rebateLink + "?orderNo=" + orderNo + "&sourceType=" + sourceType); |
| | | } |
| | | } |
| | | |
| | | |
| | | BigDecimal hongBao = order.getHongBao(); |
| | | if (hongBao == null) { |
| | | hongBao = new BigDecimal(0); |
| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | |
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgAccountDetail.MsgTypeAccountTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | @Service
|
| | | public class UserVIPInfoServiceImpl implements UserVIPInfoService {
|
| | |
| | | }
|
| | |
|
| | | // 消息
|
| | | MsgOtherSystemGiveDTO dto = new MsgOtherSystemGiveDTO();
|
| | | dto.setName("系统赠送 ");
|
| | | dto.setReason("恭喜你!成功升级为超级会员");
|
| | | dto.setDesc("获得赠送免单券" + num +"张");
|
| | | userOtherMsgNotificationService.vipUpgradeReward(uid, "详情查看,对应会员权益", dto);
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("状 态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!成功升级为超级会员", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("奖 励", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("获得赠送免单券" + num +"张", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备 注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("详情查看,对应会员权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | userOtherMsgNotificationService.createMsgOtherDetail(uid, listMsg, MsgTypeOtherTypeEnum.vipUpgradeReward);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | throw new UserVIPInfoException(1, "券赠送失败");
|
| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserVIPPreInfoMapper;
|
| | | import com.yeshi.fanli.dto.msg.MsgAccountVipDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherSystemGiveDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
|
| | |
|
| | | @Service
|
| | | public class UserVIPPreInfoServiceImpl implements UserVIPPreInfoService {
|
| | |
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private boolean oneProcess(Long uid, long countZiGou, long countShare, long firstTeam, long secondTeam) {
|
| | | UserVIPPreInfo oldInfo = userVIPPreInfoMapper.selectByUidAndProcess(uid, UserVIPPreInfo.PROCESS_1);
|
| | | if (oldInfo != null) {
|
| | | return true;
|
| | | }
|
| | | |
| | | boolean process = false;
|
| | | String msg = "";
|
| | |
|
| | |
| | | userInfoExtraService.addGoldCoinByUid(uid, Integer.parseInt(goldcoin));
|
| | |
|
| | | // 消息
|
| | | MsgOtherSystemGiveDTO dto = new MsgOtherSystemGiveDTO();
|
| | | dto.setName("系统赠送 ");
|
| | | dto.setReason("恭喜你!成功升级为普通会员");
|
| | | dto.setDesc("获得金币" + goldcoinNum+"枚");
|
| | | userOtherMsgNotificationService.vipUpgradeReward(uid, "详情查看,对应会员权益", dto);
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("状 态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!成功升级为普通会员", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("奖 励", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("获得金币" + goldcoinNum+"枚", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备 注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("详情查看,对应会员权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | userOtherMsgNotificationService.createMsgOtherDetail(uid, listMsg, MsgTypeOtherTypeEnum.vipUpgradeReward);
|
| | | }
|
| | |
|
| | | // 是否存在下级脱离期限 -更新不脱离
|
| | |
| | | boolean process = false;
|
| | | String msg = "";
|
| | |
|
| | | long limitZiGou = 0;
|
| | | String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
|
| | | if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | limitZiGou = Long.parseLong(zigou);
|
| | | }
|
| | | long limitZiGou = 10;
|
| | | // String zigou = userVipConfigService.getValueByKey("vip_pre_7_zigou_order_count");
|
| | | // if (!StringUtil.isNullOrEmpty(zigou)) {
|
| | | // limitZiGou = Long.parseLong(zigou);
|
| | | // }
|
| | |
|
| | | long limitShare = 0;
|
| | | String share = userVipConfigService.getValueByKey("vip_pre_7_share_order_count");
|
| | |
| | | UserSystemCoupon.SOURCE_SYSTEM_PUSH, percent, false);
|
| | | }
|
| | |
|
| | | // 消息
|
| | | MsgOtherSystemGiveDTO dto = new MsgOtherSystemGiveDTO();
|
| | | dto.setName("系统赠送 ");
|
| | | dto.setReason("恭喜你!成功升级为高级会员");
|
| | | dto.setDesc("获得返利奖励券" + num +"张");
|
| | | userOtherMsgNotificationService.vipUpgradeReward(uid, "详情查看,对应会员权益", dto);
|
| | | List<CommonMsgItemVO> listMsg = new ArrayList<>();
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("状 态", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("恭喜你!成功升级为高级会员", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("奖 励", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("获得返利奖励券" + num +"张", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("备 注", ClientTextStyleVO.COLOR_TITLE),
|
| | | new ClientTextStyleVO("详情查看,对应会员权益", ClientTextStyleVO.COLOR_CONTENT)));
|
| | | userOtherMsgNotificationService.createMsgOtherDetail(uid, listMsg, MsgTypeOtherTypeEnum.vipUpgradeReward);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | |
| | | package com.yeshi.fanli.service.inter.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO;
|
| | |
| | | import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
|
| | |
|
| | | /**
|
| | | * 用户订单消息通知
|
| | |
| | | */
|
| | | public void teamSplitCallBoss(Long uid, String beiZhu, MsgOtherVIPDTO dto);
|
| | |
|
| | |
|
| | | /**
|
| | | * vip升级奖励
|
| | | * 创建消息明细
|
| | | * @param uid
|
| | | * @param beiZhu
|
| | | * @param dto
|
| | | * @param type
|
| | | * @param listMsg
|
| | | */
|
| | | public void vipUpgradeReward(Long uid, String beiZhu, MsgOtherSystemGiveDTO dto);
|
| | | public void createMsgOtherDetail(Long uid, List<CommonMsgItemVO> listMsg, MsgTypeOtherTypeEnum type);
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.CommonOrderGoods;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserVIPInfoService userVIPInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserLevelManager userLevelManager;
|
| | |
|
| | | /**
|
| | | * 添加红包信息
|
| | |
| | | UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
|
| | | if (user == null)
|
| | | throw new UserAccountException(1001, "用户不存在/被封禁");
|
| | | if (isVIP) {
|
| | | hongBao.setUrank(HongBaoV2.RANK_VIP);// VIP的等级设置为100
|
| | | } else {
|
| | | UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
|
| | | commonOrder.getThirdCreateTime());
|
| | | if (userLevel != null)
|
| | | hongBao.setUrank(userLevel.getOrderRank());
|
| | | else {
|
| | | hongBao.setUrank(user.getRank());
|
| | | }
|
| | | hongBao.setOrderType(commonOrder.getSourceType());
|
| | |
| | | UserInfo user = userInfoService.getUserById(commonOrder.getUserInfo().getId());
|
| | | if (user == null)
|
| | | throw new UserAccountException(1001, "用户不存在/被封禁");
|
| | | if (isVip)
|
| | | hongBao.setUrank(HongBaoV2.RANK_VIP);
|
| | | UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
|
| | | commonOrder.getThirdCreateTime());
|
| | | if (userLevel != null)
|
| | | hongBao.setUrank(userLevel.getOrderRank());
|
| | | else
|
| | | hongBao.setUrank(user.getRank());
|
| | | hongBao.setUserInfo(user);
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.msg.MsgAccountVipDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
|
| | | import com.yeshi.fanli.dto.msg.MsgOtherCouponActivateDTO;
|
| | |
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | | return null;
|
| | |
|
| | | MsgOtherSystemGiveDTO dto = new Gson().fromJson(msg.getContent(), MsgOtherSystemGiveDTO.class);
|
| | | if (dto == null)
|
| | | return null;
|
| | |
|
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getReason(), COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("状 态", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(dto.getDesc() + "", COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("奖 励", COLOR_TITLE), contentList));
|
| | |
|
| | | contentList = new ArrayList<>();
|
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | | Gson gson = new Gson();
|
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_vip.png");
|
| | | userMsgVO.setTitle(dto.getName());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | | userMsgVO.setContentItems(items);
|
| | | return userMsgVO;
|
| | |
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | public class ClientTextStyleVO implements Serializable{
|
| | | |
| | | public final static String COLOR_TITLE = "#888888";
|
| | | public final static String COLOR_CONTENT = "#000000";
|
| | | public final static String COLOR_HIGHLIGHT_CONTENT = "#E5005C";
|
| | | |
| | | /**
|
| | | *
|
| | | */
|
New file |
| | |
| | | package com.yeshi.fanli.vo.msg;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | public class CommonMsgItemVOFactory {
|
| | |
|
| | | public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content) {
|
| | | List<ClientTextStyleVO> list = new ArrayList<>();
|
| | | list.add(content);
|
| | |
|
| | | CommonMsgItemVO itemVO = new CommonMsgItemVO();
|
| | | itemVO.setTitle(title);
|
| | | itemVO.setContent(list);
|
| | | return itemVO;
|
| | | }
|
| | |
|
| | | public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content, boolean click) {
|
| | | List<ClientTextStyleVO> list = new ArrayList<>();
|
| | | list.add(content);
|
| | |
|
| | | CommonMsgItemVO itemVO = new CommonMsgItemVO();
|
| | | itemVO.setTitle(title);
|
| | | itemVO.setContent(list);
|
| | | itemVO.setClick(click);
|
| | | return itemVO;
|
| | | }
|
| | |
|
| | | public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content1,
|
| | | ClientTextStyleVO content2) {
|
| | | List<ClientTextStyleVO> list = new ArrayList<>();
|
| | | list.add(content1);
|
| | | list.add(content2);
|
| | |
|
| | | CommonMsgItemVO itemVO = new CommonMsgItemVO();
|
| | | itemVO.setTitle(title);
|
| | | itemVO.setContent(list);
|
| | | return itemVO;
|
| | | }
|
| | |
|
| | | public static CommonMsgItemVO createMsgItemVO(ClientTextStyleVO title, ClientTextStyleVO content1,
|
| | | ClientTextStyleVO content2, boolean click) {
|
| | | List<ClientTextStyleVO> list = new ArrayList<>();
|
| | | list.add(content1);
|
| | | list.add(content2);
|
| | |
|
| | | CommonMsgItemVO itemVO = new CommonMsgItemVO();
|
| | | itemVO.setTitle(title);
|
| | | itemVO.setContent(list);
|
| | | itemVO.setClick(click);
|
| | | return itemVO;
|
| | | }
|
| | | }
|
| | |
| | | mongo.dbname=flq-wxmp
|
| | | mongo.port=27016
|
| | | mongo.dbname=flq
|
| | | mongo.port=27017
|
| | | #开发环境
|
| | | #mongo.host=192.168.1.253
|
| | | #mongo.username=admin
|
| | | #mongo.password=123456
|
| | | mongo.host=192.168.1.253
|
| | | mongo.username=admin
|
| | | mongo.password=123456
|
| | |
|
| | | mongo.host=193.112.35.168
|
| | | mongo.username=yeshi
|
| | | mongo.password=Yeshi2016@
|
| | | #mongo.host=193.112.35.168
|
| | | #mongo.username=yeshi
|
| | | #mongo.password=Yeshi2016@
|
| | |
|
| | | mongo.connectionsPerHost=8
|
| | | mongo.threadsAllowedToBlockForConnectionMultiplier=4
|
| | | mongo.connectTimeout=10000
|
| | | mongo.maxWaitTime=1500
|
| | | mongo.maxWaitTime=15000
|
| | | mongo.autoConnectRetry=true
|
| | | mongo.socketKeepAlive=true
|
| | | mongo.socketTimeout=1500
|
| | | mongo.socketTimeout=15000
|
| | | mongo.slaveOk=true
|
| | | mongo.writeNumber=1
|
| | | mongo.riteTimeout=0
|
| | |
| | | #redis.addr=192.168.1.253
|
| | | #redis.port=6379 |
| | | #redis.auth=123456
|
| | | redis.addr=193.112.34.40
|
| | | redis.port=6379
|
| | | redis.auth=weikou2014
|
| | | redis.addr=192.168.1.253
|
| | | redis.port=6379 |
| | | redis.auth=123456
|
| | | #redis.addr=193.112.34.40
|
| | | #redis.port=6379
|
| | | #redis.auth=weikou2014
|
| | | redis.max_total=1024 |
| | | redis.max_idle=200
|
| | | redis.max_wait=10000
|
| | |
| | | </bean>
|
| | |
|
| | |
|
| | | <!-- 产生有效队员 -->
|
| | | <bean id="inviteValidTeamMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.user.InviteValidTeamMessageListener"></bean>
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="inviteValidTeamConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">${rocketmq.AccessKey}</prop>
|
| | | <prop key="SecretKey">${rocketmq.SecretKey}</prop>
|
| | | <prop key="GROUP_ID">GID_INVITE_VALID_TEAM</prop>
|
| | | <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
|
| | | <prop key="ConsumeThreadNums">50</prop>
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 订单收货 -->
|
| | | <entry value-ref="inviteValidTeamMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_ORDER" />
|
| | | <property name="expression" value="orderConfirm" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | |
|
| | |
|
| | | </beans> |
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | ColumnParseUtil.parseColumn(OrderTeamReward.class,
|
| | | "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/order/OrderTeamRewardMapper.xml");
|
| | | |
| | | ColumnParseUtil.parseColumn(InviteOrderSubsidy.class,
|
| | | "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/order/InviteOrderSubsidyMapper.xml");
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Test
|
| | | public void test2() {
|
| | | String[] marks = new String[] { "\\(-\\)"};
|
| | | // String result = TaoKeApiUtil.officialActivityConvert("19507100253",
|
| | | // "1584519810786", "20211660");
|
| | | // System.out.println(result);
|
| | |
|
| | | List<String> textList = TaoBaoUtil.getTokenListFromText("復製这条(VzUl1fzQWMT)进入【Tao宝】即可抢购", Arrays.asList(marks));
|
| | | // TaoKeApiUtil.getQuanInfo(579875678934L,
|
| | | // "91b8984019e24fe1b1e3d6bd15479785");
|
| | | String result = TaoKeApiUtil.getActivityInfo("1583739244161", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT,
|
| | | "511374878");
|
| | | System.out.println(result);
|
| | |
|
| | | System.out.println(textList);
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑外卖红包", result);
|
| | | |
| | | System.out.println(token);
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | |
| | |
|
| | | @Test
|
| | | public void test13(){
|
| | | public void test13() {
|
| | | TaoKeApiUtil.specialConvertCoupon(579875678934L, new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
|
| | | try {
|
| | | TaoKeApiUtil.getSimpleGoodsInfo(573867930843L);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Test
|
| | | public void test14() {
|
| | | TaoKeApiUtil.getCouponListByItemId(614089154947L);
|
| | | }
|
| | |
|
| | | }
|