Merge remote-tracking branch 'origin/div' into div
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user.vip;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.vip.UserLevelStatisticDTO;
|
| | |
|
| | | public interface UserLevelStatisticMapper {
|
| | |
|
| | | /**
|
| | | * 统计一级队员的情况
|
| | | * @Title: statisticFirstTeamLevelCount
|
| | | * @Description: |
| | | * @param uid
|
| | | * @return |
| | | * List<UserLevelStatisticDTO> 返回类型
|
| | | * @throws
|
| | | */
|
| | | List<UserLevelStatisticDTO> statisticFirstTeamLevelCount(Long uid);
|
| | | |
| | | |
| | | /**
|
| | | * 统计二级队员的情况
|
| | | * @Title: statisticSecondTeamLevelCount
|
| | | * @Description: |
| | | * @param uid
|
| | | * @return |
| | | * List<UserLevelStatisticDTO> 返回类型
|
| | | * @throws
|
| | | */
|
| | | List<UserLevelStatisticDTO> statisticSecondTeamLevelCount(Long uid);
|
| | |
|
| | | } |
| | |
| | |
|
| | | Map<String, Object> map = new HashMap<>();
|
| | | map.put("firstDaRen", 0);
|
| | | map.put("secondDaRen", 0);
|
| | | map.put("firstHighVIP", 0);
|
| | | map.put("secondHighVIP", 0);
|
| | | map.put("firstSuperVIP", 0);
|
| | | map.put("secondDaRen", 0);
|
| | | map.put("secondHighVIP", 0);
|
| | | map.put("secondSuperVIP", 0);
|
| | | BasicDBObject dbObject = new BasicDBObject(map);
|
| | | DBObject result = mongoTemplate.getCollection(collectionName).group(agg, query.getQueryObject(), dbObject, reduce);
|
| | |
| | | BasicDBObject object = mapResult.get(i + "");
|
| | |
|
| | | TeamDailyRecord record = new TeamDailyRecord();
|
| | | record.setFirstDaRen(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | record.setFirstHighVIP(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | record.setFirstSuperVIP(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | record.setSecondDaRen(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | record.setSecondHighVIP(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | record.setSecondSuperVIP(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | record.setFirstDaRen(new BigDecimal(object.get("firstDaRen").toString()).intValue());
|
| | | record.setFirstHighVIP(new BigDecimal(object.get("firstHighVIP").toString()).intValue());
|
| | | record.setFirstSuperVIP(new BigDecimal(object.get("firstSuperVIP").toString()).intValue());
|
| | | record.setSecondDaRen(new BigDecimal(object.get("secondDaRen").toString()).intValue());
|
| | | record.setSecondHighVIP(new BigDecimal(object.get("secondHighVIP").toString()).intValue());
|
| | | record.setSecondSuperVIP(new BigDecimal(object.get("secondSuperVIP").toString()).intValue());
|
| | | listDailyCount.add(record);
|
| | | }
|
| | | }
|
| | |
| | | userMoneyAdd(UserMoneyChangeMQMsg.class), // 用户资金增加
|
| | | taobaoBindSuccess(TaoBaoBindSuccessMQMsg.class),
|
| | | becomeValidUser(BeComeValidUserMQMsg.class), // 成为有效用户
|
| | | threeSaleSeparate(ThreeSaleSeparateMQMsg.class),// 邀请关系脱离
|
| | | userPhoneOpen(UserPhoneOpenMQMsg.class);// 电话号码公开情况变化
|
| | |
|
| | | private final Class<?> clazz;
|
| | |
| | | public class TaoBaoBindSuccessMQMsg extends BaseMQMsgBody {
|
| | | private Long uid;// 用户ID
|
| | | private Long fromUid;// 淘宝绑定的原用户ID
|
| | | private Long taoBaoUid;// 淘宝ID
|
| | | private String taoBaoUid;// 淘宝ID
|
| | | private Date createTime;// 发生时间
|
| | |
|
| | | public TaoBaoBindSuccessMQMsg(Long uid, Long fromUid, Long taoBaoUid, Date createTime) {
|
| | | public TaoBaoBindSuccessMQMsg(Long uid, Long fromUid, String taoBaoUid, Date createTime) {
|
| | | super();
|
| | | this.uid = uid;
|
| | | this.fromUid = fromUid;
|
| | |
| | | this.fromUid = fromUid;
|
| | | }
|
| | |
|
| | | public Long getTaoBaoUid() {
|
| | | public String getTaoBaoUid() {
|
| | | return taoBaoUid;
|
| | | }
|
| | |
|
| | | public void setTaoBaoUid(Long taoBaoUid) {
|
| | | public void setTaoBaoUid(String taoBaoUid) {
|
| | | this.taoBaoUid = taoBaoUid;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.vip;
|
| | |
|
| | | public class UserLevelStatisticDTO {
|
| | | private Integer level;// 等级
|
| | | private Integer num;// 数量
|
| | |
|
| | | public Integer getNum() {
|
| | | return num;
|
| | | }
|
| | |
|
| | | public void setNum(Integer num) {
|
| | | this.num = num;
|
| | | }
|
| | |
|
| | | public Integer getLevel() {
|
| | | return level;
|
| | | }
|
| | |
|
| | | public void setLevel(Integer level) {
|
| | | this.level = level;
|
| | | }
|
| | |
|
| | | }
|
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.user.vip.UserLevelStatisticMapper">
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.dto.vip.UserLevelStatisticDTO">
|
| | | <result column="level" property="level" jdbcType="INTEGER" />
|
| | | <result column="num" property="num" jdbcType="INTEGER" />
|
| | | </resultMap>
|
| | |
|
| | |
|
| | |
|
| | | <select id="statisticFirstTeamLevelCount" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | SELECT a.l as level,COUNT(*) as num FROM
|
| | |
|
| | | (
|
| | |
|
| | | SELECT MAX(v.`vpi_process`) AS l FROM yeshi_ec_threesale s LEFT JOIN
|
| | | `yeshi_ec_user_vip_pre_info` v ON s.`worker_id`=v.`vpi_uid` WHERE
|
| | | s.`boss_id`=389677 GROUP BY s.`worker_id`
|
| | | ) a GROUP BY l;
|
| | |
|
| | | </select>
|
| | |
|
| | | <select id="statisticSecondTeamLevelCount" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | |
|
| | |
|
| | | SELECT a.l as level,COUNT(*) as num FROM
|
| | |
|
| | | (
|
| | |
|
| | | SELECT MAX(v.`vpi_process`) AS l FROM yeshi_ec_threesale s LEFT JOIN
|
| | | yeshi_ec_threesale ss ON ss.`boss_id`=s.`worker_id` LEFT JOIN
|
| | | `yeshi_ec_user_vip_pre_info` v ON ss.`worker_id`=v.`vpi_uid` WHERE
|
| | | s.`boss_id`=389677 GROUP BY ss.`worker_id`
|
| | | ) a GROUP BY l
|
| | |
|
| | |
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | package com.yeshi.fanli.service.impl.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.share.ShareMapper;
|
| | | import com.yeshi.fanli.dto.money.UserMoneyChangeDTO;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserMoneyChangeMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.cmq.UserMoneyChangeCMQManager;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | | public class UserMoneyServiceImpl implements UserMoneyService {
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Override
|
| | | public BigDecimal getMoneyToday(Long uid) {
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | // 发送资金到账消息
|
| | |
|
| | | if (!Constant.IS_TEST) {
|
| | | UserMoneyChangeMQMsg msg = new UserMoneyChangeMQMsg(uid, money, new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userMoneyAdd, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | if (!Constant.IS_TEST)
|
| | | producer.send(message);
|
| | | } else {// 修改
|
| | | UserInfoUpdateMQMsg mqMsg = null;
|
| | |
|
| | | if (type == ModifyTypeEnum.portrait) {
|
| | | mqMsg = new UserInfoUpdateMQMsg(uid, UserInfoUpdateTypeEnum.portrait, value, new Date());
|
| | | } else if (type == ModifyTypeEnum.nickName)
|
| | | mqMsg = new UserInfoUpdateMQMsg(uid, UserInfoUpdateTypeEnum.nickName, value, new Date());
|
| | | else if (type == ModifyTypeEnum.setWeiXinNum)
|
| | | mqMsg = new UserInfoUpdateMQMsg(uid, UserInfoUpdateTypeEnum.wxId, value, new Date());
|
| | |
|
| | | if (mqMsg != null) {
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER,
|
| | | UserTopicTagEnum.userInfoUpdate,new UserInfoUpdateMQMsg(uid,
|
| | | UserInfoUpdateTypeEnum.portrait, value, new Date()));
|
| | | UserTopicTagEnum.userInfoUpdate, mqMsg);
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserInviteValidNumMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserInviteValidRecordMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.BeComeValidUserMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | | public class UserInviteValidNumServiceImpl implements UserInviteValidNumService {
|
| | |
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | |
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Override
|
| | | public UserInviteValidNum selectByPrimaryKey(Long id) {
|
| | | return userInviteValidNumMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 直接粉丝 +1
|
| | |
| | | userInviteValidRecordMapper.deleteByPrimaryKey(record.getId());
|
| | | }
|
| | |
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 间接粉丝 +1
|
| | | * @param uid
|
| | |
| | | addNumFirst(bossId);
|
| | | }
|
| | |
|
| | | // 发送成为有效粉丝的消息
|
| | | if (!Constant.IS_TEST) {
|
| | | BeComeValidUserMQMsg msg = new BeComeValidUserMQMsg(uid, new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.becomeValidUser,
|
| | | msg);
|
| | | producer.send(message);
|
| | | }
|
| | |
|
| | | // 是否上上级
|
| | | ThreeSale threeSaleSuper = threeSaleSerivce.getMyBoss(bossId);
|
| | | if (threeSaleSuper == null) {
|
| | |
| | | LogHelper.error(e);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void syncInfoAgain(Long workerId) {
|
| | |
| | | if (inviteValid != null) {
|
| | | UserInviteValidNum updateObj = new UserInviteValidNum();
|
| | | updateObj.setId(uid);
|
| | | updateObj.setNumFirst(countTeam1);;
|
| | | updateObj.setNumFirst(countTeam1);
|
| | | ;
|
| | | userInviteValidNumMapper.updateByPrimaryKeySelective(updateObj);
|
| | | } else {
|
| | | inviteValid = new UserInviteValidNum();
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserExtraTaoBaoInfoMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.TaoBaoBindSuccessMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserAccountBindingHistory;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | @Service
|
| | | public class UserExtraTaoBaoInfoServiceImpl implements UserExtraTaoBaoInfoService {
|
| | |
| | |
|
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | |
| | |
|
| | | // 清除之前的用户ID
|
| | | userExtraTaoBaoInfoMapper.clearUid(uid);
|
| | | Long fromUid = null;
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | // 新增
|
| | | taoBaoInfo.setCreateTime(new Date());
|
| | | userExtraTaoBaoInfoMapper.insertSelective(taoBaoInfo);
|
| | | } else {
|
| | | if (list.get(0).getUser() != null)
|
| | | fromUid = list.get(0).getUser().getId();
|
| | | // 取第一个替换uid 等信息
|
| | | taoBaoInfo.setId(list.get(0).getId());
|
| | | taoBaoInfo.setUpdateTime(new Date());
|
| | |
| | | else
|
| | | history.setFirst(true);
|
| | | userAccountBindingHistoryService.addUserAccountBindingHistory(history);
|
| | |
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.taobaoBindSuccess,
|
| | | new TaoBaoBindSuccessMQMsg(uid, fromUid, taoBaoUid, new Date()));
|
| | | producer.send(message);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.TeamUserLevelStatisticMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord;
|
| | | import com.yeshi.fanli.dao.mybatis.user.vip.UserLevelStatisticMapper;
|
| | | import com.yeshi.fanli.dto.vip.UserLevelStatisticDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamUserLevelStatistic;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
|
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | |
|
| | | @Service
|
| | | public class TeamUserLevelStatisticServiceImpl implements TeamUserLevelStatisticService {
|
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private UserLevelStatisticMapper userLevelStatisticMapper;
|
| | |
|
| | | @Override
|
| | | public TeamUserLevelStatistic selectByUid(Long uid) {
|
| | |
| | |
|
| | | @Override
|
| | | public void initData(Long uid) {
|
| | | int pageSize = 1000;
|
| | |
|
| | | // 直接粉丝统计
|
| | | List<UserLevelStatisticDTO> firstList = userLevelStatisticMapper.statisticFirstTeamLevelCount(uid);
|
| | | List<UserLevelStatisticDTO> secondList = userLevelStatisticMapper.statisticSecondTeamLevelCount(uid);
|
| | | int daRenFirstCount = 0;
|
| | | int highFirstCount = 0;
|
| | | int superFirstCount = 0;
|
| | | int tearcherFirstCount = 0;
|
| | | for (int i = 0; i < 100; i++) {
|
| | | List<ThreeSale> list = threeSaleSerivce.listFirstTeam(i * pageSize, pageSize, uid);
|
| | | if (list == null || list.size() == 0) {
|
| | | break;
|
| | | }
|
| | |
|
| | | for (ThreeSale ts : list) {
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorker().getId());
|
| | | for (UserLevelStatisticDTO dto : firstList) {
|
| | | UserLevelEnum level = UserLevelUtil.getByLevel(dto.getLevel());
|
| | | if (level == null)
|
| | | level = UserLevelEnum.daRen;
|
| | |
|
| | | if (level == UserLevelEnum.daRen || level == UserLevelEnum.normalVIP) {
|
| | | daRenFirstCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highFirstCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | superFirstCount++;
|
| | | } else if (level == UserLevelEnum.tearcher) {
|
| | | tearcherFirstCount++;
|
| | | }
|
| | | }
|
| | | daRenFirstCount += dto.getNum();
|
| | | } else if (level == UserLevelEnum.highVIP)
|
| | | highFirstCount += dto.getNum();
|
| | | else if (level == UserLevelEnum.superVIP)
|
| | | superFirstCount += dto.getNum();
|
| | | else if (level == UserLevelEnum.tearcher)
|
| | | tearcherFirstCount += dto.getNum();
|
| | | }
|
| | |
|
| | | // 间接粉丝统计
|
| | | int daRenSecondCount = 0;
|
| | | int highSecondCount = 0;
|
| | | int superSecondCount = 0;
|
| | | int tearcherSecondCount = 0;
|
| | | for (int i = 0; i < 100; i++) {
|
| | | List<ThreeSale> list = threeSaleSerivce.listSecondTeam(i * pageSize, pageSize, uid);
|
| | | if (list == null || list.size() == 0) {
|
| | | break;
|
| | | }
|
| | |
|
| | | for (ThreeSale ts : list) {
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorker().getId());
|
| | | for (UserLevelStatisticDTO dto : secondList) {
|
| | | UserLevelEnum level = UserLevelUtil.getByLevel(dto.getLevel());
|
| | | if (level == null)
|
| | | level = UserLevelEnum.daRen;
|
| | |
|
| | | if (level == UserLevelEnum.daRen || level == UserLevelEnum.normalVIP) {
|
| | | daRenSecondCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highSecondCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | superSecondCount++;
|
| | | } else if (level == UserLevelEnum.tearcher) {
|
| | | tearcherSecondCount++;
|
| | | }
|
| | | }
|
| | | daRenSecondCount += dto.getNum();
|
| | | } else if (level == UserLevelEnum.highVIP)
|
| | | highSecondCount += dto.getNum();
|
| | | else if (level == UserLevelEnum.superVIP)
|
| | | superSecondCount += dto.getNum();
|
| | | else if (level == UserLevelEnum.tearcher)
|
| | | tearcherSecondCount += dto.getNum();
|
| | | }
|
| | |
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(uid);
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (!Constant.IS_TEST) {
|
| | | UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.highVIP, UserLevelEnum.superVIP,
|
| | | new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @Resource
|
| | | private TeamUserLevelStatisticService teamUserLevelStatisticService;
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void addUserVIPPreInfo(UserVIPPreInfo info) throws UserVIPPreInfoException {
|
| | | if (info == null || info.getUid() == null || info.getProcess() == null || info.getSourceType() == null)
|
| | |
| | | throw new UserVIPPreInfoException(2, "进度已存在");
|
| | | if (info.getCreateTime() == null)
|
| | | info.setCreateTime(new Date());
|
| | |
|
| | | UserVIPPreInfo old = getLatestProcessInfo(info.getUid());
|
| | |
|
| | | userVIPPreInfoMapper.insertSelective(info);
|
| | | // 设置统计数据
|
| | | teamUserLevelStatisticService.setUserLevel(info.getUid(), UserLevelUtil.getByLevel(info.getProcess()));
|
| | |
|
| | | // 发送等级变化消息
|
| | | if (!Constant.IS_TEST) {
|
| | | UserLevelEnum oldLevel = null;
|
| | | if (old == null)
|
| | | oldLevel = UserLevelEnum.daRen;
|
| | | else {
|
| | | oldLevel = UserLevelUtil.getByLevel(old.getProcess());
|
| | | }
|
| | |
|
| | | if (oldLevel == UserLevelEnum.normalVIP)
|
| | | oldLevel = UserLevelEnum.daRen;
|
| | |
|
| | | UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(info.getUid(), oldLevel,
|
| | | UserLevelUtil.getByLevel(info.getProcess()), new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
|
| | | producer.send(message);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | LogHelper.error(e);
|
| | | }
|
| | |
|
| | | if (!Constant.IS_TEST) {
|
| | | UserLevelChangedMQMsg msg = new UserLevelChangedMQMsg(uid, UserLevelEnum.daRen, UserLevelEnum.highVIP,
|
| | | new Date());
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userLevelChanged, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | // 更新上级的粉丝数量
|
| | | teamFansInfoService.updateFansNum(mqMsg.getBossId());
|
| | | // 添加粉丝信息
|
| | | |
| | | teamFansInfoService.addFansInfo(mqMsg.getWorkerId(), mqMsg.getBossId(),mqMsg.getSuccessTime());
|
| | |
|
| | | threeSaleDetailService.addByWorkerUid(mqMsg.getWorkerId());
|
| | |
| | |
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.threeSaleSeparate.name())) {// 邀请关系脱离
|
| | | ThreeSaleSeparateMQMsg msg = new Gson().fromJson(new String(message.getBody()),
|
| | | ThreeSaleSeparateMQMsg.class);
|
| | |
|
| | | // 更新上两级邀请统计
|
| | | teamUserLevelStatisticService.initData(msg.getBossUid());
|
| | | UserInfo boss = threeSaleSerivce.getBoss(msg.getBossUid());
|
| | | if (boss != null) {
|
| | | teamUserLevelStatisticService.initData(boss.getId());
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
|
| | | } else if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) {
|
| | |
| | | mongo.dbname=flq
|
| | | mongo.port=27017
|
| | | mongo.port=27016
|
| | | #开发环境
|
| | | 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
|
| | |
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_USER" />
|
| | | <property name="expression" value="userLevelChanged||threeSaleSeparate" />
|
| | | <property name="expression" value="userLevelChanged" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | |
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_USER" />
|
| | | <!-- 用户活跃,用户信息更新,淘宝绑定成功,邀请成功,用户资金增加,成为有效用户,账号绑定 -->
|
| | | <!-- 用户活跃,用户信息更新,淘宝绑定成功,邀请成功,用户资金增加,成为有效用户,账号绑定 ,电话号码公开 -->
|
| | | <property name="expression"
|
| | | value="userActve||userInfoUpdate||taobaoBindSuccess||inviteSuccess||userMoneyAdd||becomeValidUser" />
|
| | | value="userActve||userInfoUpdate||taobaoBindSuccess||inviteSuccess||userMoneyAdd||becomeValidUser||userPhoneOpen" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|