| | |
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 删除消息
|
| | | * @param acceptData
|
| | | * @param type
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteMsg", method = RequestMethod.POST)
|
| | | public void deleteMsg(AcceptData acceptData, String type, Long id, Long uid, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(type) || id == null || uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不完整"));
|
| | | return;
|
| | | }
|
| | | |
| | | switch (type) {
|
| | | case MSG_TYPE_ORDER:
|
| | | MsgOrderDetail msgOrderDetail = msgOrderDetailService.selectByPrimaryKey(id);
|
| | | if (msgOrderDetail != null && msgOrderDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgOrderDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_MONEY:
|
| | | MsgMoneyDetail moneyDetail = msgMoneyDetailService.selectByPrimaryKey(id);
|
| | | if (moneyDetail != null && moneyDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgMoneyDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_ACCOUNT:
|
| | | MsgAccountDetail accountDetail = msgAccountDetailService.selectByPrimaryKey(id);
|
| | | if (accountDetail != null && accountDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgAccountDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_INVITE:
|
| | | MsgInviteDetail inviteDetail = msgInviteDetailService.selectByPrimaryKey(id);
|
| | | if (inviteDetail != null && inviteDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgInviteDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_OTHER:
|
| | | MsgOtherDetail otherDetail = msgOtherDetailService.selectByPrimaryKey(id);
|
| | | if (otherDetail != null && otherDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgOtherDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
|
| | | import com.yeshi.fanli.dto.vip.UserVIPLevel;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | |
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsgTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleFocusInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamLevelDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamUserLevelStatistic;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TearcherInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleFocusInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamDailyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamLevelDailyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TearcherService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleFocusInfoService threeSaleFocusInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserCustomSettingsService userCustomSettingsService;
|
| | |
|
| | | @Resource
|
| | | private TearcherService tearcherService;
|
| | |
|
| | | @Resource
|
| | | private TeamUserLevelStatisticService teamUserLevelStatisticService;
|
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | | @Resource
|
| | | private TeamLevelDailyRecordService teamLevelDailyRecordService;
|
| | | |
| | | @Resource
|
| | | private TeamDailyRecordService teamDailyRecordService;
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 邀请码验证
|
| | | *
|
| | |
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0)
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5("activeWX:" + weiXinUser.getUnionid()));
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey,
|
| | | StringUtil.Md5("activeWX:" + weiXinUser.getUnionid()));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
|
| | |
|
| | | // 邀请关系用户信息
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param key
|
| | | * 验证返回的key
|
| | | * @param key 验证返回的key
|
| | | * @param out
|
| | | */
|
| | | @RequestSerializableByKey(key = "'activeInviteWX-'+#uid")
|
| | |
| | | out.print(JsonUtil.loadFalseResult("粉丝类型不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<Long> listId = new ArrayList<Long>();
|
| | | |
| | | |
| | | |
| | | |
| | | long count = 0;
|
| | | List<ThreeSale> listTeam = null;
|
| | | if (type == 1) {
|
| | | listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, listId);
|
| | | count = threeSaleSerivce.countFirstTeam(uid, listId);
|
| | | listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | count = threeSaleSerivce.countFirstTeam(uid);
|
| | | } else if (type == 2) {
|
| | | listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid, listId);
|
| | | count = threeSaleSerivce.countSecondTeam(uid, listId);
|
| | | listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | count = threeSaleSerivce.countSecondTeam(uid);
|
| | | }
|
| | |
|
| | | // 数据加工
|
| | | JSONArray array = null;
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | array = organizeTeamNew(listTeam, uid, type, true);
|
| | | array = organizeTeamNew(acceptData, listTeam, uid, type, true);
|
| | | } else {
|
| | | boolean needVIPInfo = false;
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | needVIPInfo = true;
|
| | | array = organizeTeam(listTeam, uid, type,needVIPInfo);
|
| | | }
|
| | | |
| | |
|
| | | JSONObject result = new JSONObject();
|
| | | result.put("count", count);
|
| | |
| | | return resultArray;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 加工数据
|
| | | * |
| | | * @param count
|
| | | * @param list
|
| | | * @param uid
|
| | |
| | | * @param wxtip 是需要微信提示
|
| | | * @return
|
| | | */
|
| | | private JSONArray organizeTeamNew(List<ThreeSale> list, Long uid, int type, boolean wxtip) {
|
| | | private JSONArray organizeTeamNew(AcceptData acceptData, List<ThreeSale> list, Long uid, int type, boolean wxtip) {
|
| | | JSONArray resultArray = new JSONArray();
|
| | | if (list == null || list.size() == 0) {
|
| | | return resultArray;
|
| | |
| | | }
|
| | | object.put("memoName", memoName);
|
| | |
|
| | | if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 添加微信信息
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
|
| | | object.put("weiXin", userInfoExtra.getWeiXin());
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | resultArray.add(object);
|
| | | }
|
| | | return resultArray;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查看下级的直接粉丝
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid 当前UId
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, tid);
|
| | | List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | | tid);
|
| | | long count = threeSaleSerivce.countFirstTeam(tid);
|
| | |
|
| | | JSONObject result = new JSONObject();
|
| | | result.put("count", count);
|
| | | result.put("list", organizeTeamNew(listTeam, tid, 1, false));
|
| | | result.put("list", organizeTeamNew(acceptData, listTeam, tid, 1, false));
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 用户队员统计- IOS
|
| | |
| | |
|
| | | /**
|
| | | * 获取用户信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
|
| | | out.print(JsonUtil.loadTrueResult(bossData));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 上级信息组织
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @RequestSerializableByKey(key = "'getInviteImgs-'+#uid")
|
| | | @RequestMapping(value = "/getInviteImgs", method = RequestMethod.POST)
|
| | | public void getInviteImgs(AcceptData acceptData, Long uid, Integer page, PrintWriter out, HttpServletRequest request) {
|
| | | public void getInviteImgs(AcceptData acceptData, Long uid, Integer page, PrintWriter out,
|
| | | HttpServletRequest request) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | |
| | | system.setId(4L);
|
| | | system.setPlatform(1);
|
| | | system.setCreatetime(java.lang.System.currentTimeMillis());
|
| | | SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, "inviteRules");
|
| | | SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
|
| | | "inviteRules");
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", spreadImgService.countAll());
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 用户队员列表查询
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMyTeamV2", method = RequestMethod.POST)
|
| | | public void getMyTeamV2(AcceptData acceptData, int page, long uid, int type, ThreeSaleFocusDTO focus,
|
| | | PrintWriter out) {
|
| | | if (type != 1 && type != 2) {
|
| | | out.print(JsonUtil.loadFalseResult("粉丝类型不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long firstTeam = 0;
|
| | | long countSecond = 0;
|
| | | List<ThreeSale> listTeam = null;
|
| | | if (!existScreen(focus)) { // 普通查询
|
| | | if (type == 1) {
|
| | | listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | } else if (type == 2) {
|
| | | listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | }
|
| | | firstTeam = threeSaleSerivce.countFirstTeam(uid);
|
| | | countSecond = threeSaleSerivce.countSecondTeam(uid);
|
| | | } else { // 筛选条件
|
| | | List<Long> listId = null;
|
| | | List<ThreeSaleFocusInfo> listfocus = threeSaleFocusInfoService.query((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, type, uid, focus);
|
| | | if (listfocus != null && listfocus.size() > 0) {
|
| | | listId = new ArrayList<Long>();
|
| | | for (ThreeSaleFocusInfo focusInfo : listfocus) {
|
| | | listId.add(focusInfo.getWorkerId());
|
| | | }
|
| | | }
|
| | | |
| | | if (listId != null && listId.size() > 0) {
|
| | | if (type == 1) {
|
| | | listTeam = threeSaleSerivce.listFirstTeam(0, Constant.PAGE_SIZE, uid, listId);
|
| | | } else if (type == 2) {
|
| | | listTeam = threeSaleSerivce.listSecondTeam(0, Constant.PAGE_SIZE, uid, listId);
|
| | | }
|
| | | }
|
| | | firstTeam = threeSaleFocusInfoService.count(1, uid, focus);
|
| | | countSecond = threeSaleFocusInfoService.count(2, uid, focus);
|
| | | }
|
| | | JSONArray array = organizeTeamNew(acceptData, listTeam, uid, type, true);
|
| | | |
| | | long count = (type == 1) ? firstTeam : countSecond;
|
| | | |
| | | JSONObject result = new JSONObject();
|
| | | result.put("firstTeam", firstTeam);
|
| | | result.put("secondTeam", countSecond);
|
| | | result.put("count", count);
|
| | | result.put("list", array);
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | }
|
| | | |
| | | /**
|
| | | * 验证是否存在筛选条件
|
| | | * @param focus
|
| | | * @return
|
| | | */
|
| | | private boolean existScreen(ThreeSaleFocusDTO focus) {
|
| | | if (focus.getStateValid() != null || focus.getTaobaoBind() != null || focus.getWeixinBind() != null
|
| | | || focus.getMinFansNum() != null || focus.getMinFansNum() != null
|
| | | || focus.getMinActiveTime() != null || focus.getMaxActiveTime() != null
|
| | | || focus.getMinIncome() != null || focus.getMaxIncome() != null || !StringUtil.isNullOrEmpty(focus.getKey()))
|
| | | return true;
|
| | | |
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 用户队员统计
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countMyTeamV2", method = RequestMethod.POST)
|
| | | public void countMyTeamV2(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | JSONObject bossObject = new JSONObject();
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
|
| | | if (threeSale == null) {
|
| | | bossObject.put("exist", false);
|
| | | bossObject.put("desc", "恭喜你!板栗快省优质用户;\r\n\r\n你并没有邀请人,但你的邀请能力默认是开启的;\r\n你拥有独特的无邀请人激活码。");
|
| | | } else {
|
| | | // 上级基本信息
|
| | | Long bossId = threeSale.getBoss().getId();
|
| | | UserInfo userInfo = userInfoService.selectByPKey(bossId);
|
| | | boolean phoneCopy = true;
|
| | | String phone = userInfo.getPhone();
|
| | | if (StringUtil.isNullOrEmpty(phone)) {
|
| | | phone = "";
|
| | | } else {
|
| | | if (!userCustomSettingsService.validateDisplayPhoneByUid(bossId)) {
|
| | | phoneCopy = false;
|
| | | phone = phone.substring(0, 7) + "****";
|
| | | }
|
| | | }
|
| | |
|
| | | // 微信号
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(bossId);
|
| | | if (extra != null) {
|
| | | bossObject.put("weixin", StringUtil.isNullOrEmpty(extra.getWeiXin()) ? "" : extra.getWeiXin());
|
| | | }
|
| | |
|
| | | // 当前等级
|
| | | UserLevelEnum level = null;
|
| | | UserVIPLevel vipLevel = userInviteService.getVIPLevelByUid(bossId);
|
| | | if (vipLevel != null && vipLevel.getLevel() != null) {
|
| | | level = UserLevelUtil.getByLevel(vipLevel.getLevel());
|
| | | }
|
| | | if (level == null) {
|
| | | level = UserLevelEnum.daRen;
|
| | | }
|
| | | level = UserLevelUtil.getShowLevel(level);
|
| | |
|
| | | bossObject.put("exist", true);
|
| | | bossObject.put("nickName", userInfo.getNickName());
|
| | | bossObject.put("portrait", userInfo.getPortrait());
|
| | | bossObject.put("phone", phone);
|
| | | bossObject.put("phoneCopy", phoneCopy);
|
| | | bossObject.put("level", level.name());
|
| | | }
|
| | |
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("boss", bossObject);
|
| | |
|
| | | TearcherInfo tearcherInfo = tearcherService.selectByUid(uid);
|
| | | if (tearcherInfo != null) {
|
| | | JSONObject tearcherObject = new JSONObject();
|
| | | tearcherObject.put("nickName", tearcherInfo.getNickName());
|
| | | tearcherObject.put("portrait", tearcherInfo.getPortrait());
|
| | | tearcherObject.put("phone", tearcherInfo.getPhone());
|
| | | tearcherObject.put("weixin", tearcherInfo.getWxID());
|
| | | tearcherObject.put("level", UserLevelEnum.tearcher);
|
| | |
|
| | | json.put("tearcher", tearcherInfo);
|
| | | }
|
| | |
|
| | | JSONObject daren = new JSONObject();
|
| | | JSONObject highVIP = new JSONObject();
|
| | | JSONObject superVIP = new JSONObject();
|
| | |
|
| | | TeamUserLevelStatistic statistic = teamUserLevelStatisticService.selectByUid(uid);
|
| | | if (statistic == null) {
|
| | | daren.put("total", 0);
|
| | | highVIP.put("total", 0);
|
| | | superVIP.put("total", 0);
|
| | | } else {
|
| | | int totalDaren = statistic.getDaRenFirstCount() + statistic.getDaRenSecondCount()
|
| | | + statistic.getNormalFirstCount() + statistic.getNormalSecondCount();
|
| | | daren.put("total", totalDaren);
|
| | | highVIP.put("total", statistic.getHighFirstCount() + statistic.getHighSecondCount());
|
| | | superVIP.put("total", statistic.getSuperFirstCount() + statistic.getSuperSecondCount());
|
| | | }
|
| | | // 统计达人
|
| | | long darenToday = threeSaleSerivce.countFirstTeamByDate(uid, 1) + threeSaleSerivce.countSecondTeamByDate(uid, 1);
|
| | | long darenMonth = threeSaleSerivce.countFirstTeamByDate(uid, 2) + threeSaleSerivce.countSecondTeamByDate(uid, 2);
|
| | | daren.put("today", darenToday);
|
| | | daren.put("month", darenMonth);
|
| | |
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
| | | String today = sd.format(new Date());
|
| | | // 当月1号
|
| | | Calendar calendar1 = Calendar.getInstance();
|
| | | calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
| | | Date minTime = sd.parse(sd.format(calendar1.getTime()));
|
| | |
|
| | | int highVIPToday = 0;
|
| | | int highVIPMonth = 0;
|
| | | List<TeamLevelDailyRecord> list = teamLevelDailyRecordService.getbyUidAndType(uid, UserLevelEnum.highVIP, minTime);
|
| | | if (list == null || list.size() > 0) {
|
| | | for (TeamLevelDailyRecord record: list) {
|
| | | if (today.equals(sd.format(record.getUpdateTime()))) {
|
| | | highVIPToday = record.getFirstCount() + record.getSecondCount();
|
| | | }
|
| | | highVIPMonth = highVIPMonth + record.getFirstCount() + record.getSecondCount();
|
| | | }
|
| | | }
|
| | | highVIP.put("today", highVIPToday);
|
| | | highVIP.put("month", highVIPMonth);
|
| | | |
| | | |
| | | int superVIPToday = 0;
|
| | | int superVIPMonth = 0;
|
| | | List<TeamLevelDailyRecord> listSuper = teamLevelDailyRecordService.getbyUidAndType(uid, UserLevelEnum.superVIP, minTime);
|
| | | if (listSuper == null || listSuper.size() > 0) {
|
| | | for (TeamLevelDailyRecord record: listSuper) {
|
| | | if (today.equals(sd.format(record.getUpdateTime()))) {
|
| | | superVIPToday = record.getFirstCount() + record.getSecondCount();
|
| | | }
|
| | | superVIPMonth = superVIPMonth + record.getFirstCount() + record.getSecondCount();
|
| | | }
|
| | | }
|
| | | superVIP.put("today", superVIPToday);
|
| | | superVIP.put("month", superVIPMonth);
|
| | | |
| | | json.put("daren", daren);
|
| | | json.put("highVIP", highVIP);
|
| | | json.put("superVIP", superVIP);
|
| | | out.print(JsonUtil.loadTrueResult(json));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取粉丝信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param workerId
|
| | |
| | | Long succeedTime = threeSale.getSucceedTime();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | String phone = user.getPhone();
|
| | | boolean phoneCopy = true;
|
| | | if (StringUtil.isNullOrEmpty(phone)) {
|
| | | phone = "";
|
| | | } else {
|
| | | if (!userCustomSettingsService.validateDisplayPhoneByUid(workerId)) {
|
| | | phoneCopy = false;
|
| | | phone = phone.substring(0, 7) + "****";
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("nickName", user.getNickName());
|
| | | data.put("phone", user.getPhone());
|
| | | data.put("phone", phone);
|
| | | data.put("phoneCopy", phoneCopy);
|
| | | data.put("joinTime", TimeUtil.formatDate(succeedTime == null? threeSale.getCreateTime() : succeedTime));
|
| | |
|
| | | ThreeSaleExtraInfo saleExtraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, workerId);
|
| | |
| | | data.put("taobao", false);
|
| | | }
|
| | |
|
| | | String levelName = null;
|
| | | UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(workerId);
|
| | | if (userVIPPreInfo != null) {
|
| | | Integer process = userVIPPreInfo.getProcess();
|
| | | if (process == UserVIPPreInfo.PROCESS_1) {
|
| | | levelName = "快省达人";
|
| | | } else if (process == UserVIPPreInfo.PROCESS_2) {
|
| | | levelName = "高级会员";
|
| | | } else if (process == UserVIPPreInfo.PROCESS_3) {
|
| | | levelName = "超级会员";
|
| | | } else if (process == UserVIPPreInfo.PROCESS_4) {
|
| | | levelName = "资深导师";
|
| | | }
|
| | |
|
| | | Integer sourceType = userVIPPreInfo.getSourceType();
|
| | | if (sourceType != null) {
|
| | | if (sourceType == UserVIPPreInfo.SOURCE_TYPE_ORDER) {
|
| | | levelName += "(自购分享型)";
|
| | | } else {
|
| | | levelName += "(邀请团队型)";
|
| | | }
|
| | | }
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(levelName)) {
|
| | | levelName = "快省达人";
|
| | | }
|
| | | data.put("level", levelName);
|
| | |
|
| | | long indirectNum = 0;
|
| | | long directNum = threeSaleSerivce.countFirstTeam(workerId);
|
| | | if (directNum > 0) {
|
| | |
| | | }
|
| | | data.put("directNum", directNum);
|
| | | data.put("indirectNum", indirectNum);
|
| | | |
| | |
|
| | | long countTB = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_TAOBAO, 60);
|
| | | long countJD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_JD, 60);
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取粉丝信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param workerId
|
| | |
| | | if (uid == null || workerId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户id缺失"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int type = 1;
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(workerId);
|
| | | if (threeSale == null) {
|
| | | type = 2;
|
| | | }
|
| | |
|
| | | ThreeSaleExtraInfo saleExtraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, workerId);
|
| | |
| | | saleExtraInfo.setBoss(new UserInfo(uid));
|
| | | saleExtraInfo.setWorker(new UserInfo(workerId));
|
| | | saleExtraInfo.setTags(tags);
|
| | | saleExtraInfo.setType(type);
|
| | | saleExtraInfo.setCreateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.insertSelective(saleExtraInfo);
|
| | | }
|
| | |
|
| | | threeSaleFocusInfoService.updateTags(workerId, type, tags);
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 用户队员统计-h5
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countTeamH5", method = RequestMethod.POST)
|
| | | public void countTeamH5(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | Date now = new Date();
|
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM");
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | // 今日
|
| | | String todayStr = sdf.format(now);
|
| | | // 昨日
|
| | | Date reduceDay = DateUtil.reduceDay(1, now);
|
| | | // 本月
|
| | | String monthStr = sdf1.format(now);
|
| | | |
| | | TeamDailyRecord todayRecord = new TeamDailyRecord(0,0,0);
|
| | | TeamDailyRecord yesterdayRecord = new TeamDailyRecord(0,0,0);
|
| | | TeamDailyRecord monthRecord = new TeamDailyRecord(0,0,0);
|
| | | TeamDailyRecord totalityRecord = new TeamDailyRecord(0,0,0);
|
| | | |
| | | List<TeamDailyRecord> list = teamDailyRecordService.getbyUid(uid);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (TeamDailyRecord record: list) {
|
| | | Date statisticDay = record.getStatisticDay();
|
| | | if (todayStr.equals(sdf.format(statisticDay))) {
|
| | | todayRecord = record;
|
| | | }
|
| | | |
| | | if (reduceDay.equals(sdf.format(statisticDay))) {
|
| | | yesterdayRecord = record;
|
| | | }
|
| | | |
| | | if (monthStr.equals(sdf1.format(statisticDay))) {
|
| | | monthRecord.setFirstCount(monthRecord.getFirstCount() + record.getFirstCount());
|
| | | monthRecord.setSecondCount(monthRecord.getSecondCount() + record.getSecondCount());
|
| | | monthRecord.setSecondBeyond(monthRecord.getSecondBeyond() + record.getSecondBeyond());
|
| | | }
|
| | | |
| | | totalityRecord.setFirstCount(totalityRecord.getFirstCount() + record.getFirstCount());
|
| | | totalityRecord.setSecondCount(totalityRecord.getSecondCount() + record.getSecondCount());
|
| | | totalityRecord.setSecondBeyond(totalityRecord.getSecondBeyond() + record.getSecondBeyond());
|
| | | }
|
| | | } |
| | | |
| | | |
| | | JSONObject today = new JSONObject();
|
| | | today.put("direct", todayRecord.getFirstCount());
|
| | | today.put("indirect", todayRecord.getSecondCount());
|
| | | today.put("beyond", todayRecord.getSecondBeyond());
|
| | | |
| | | JSONObject yesterday = new JSONObject();
|
| | | yesterday.put("direct", yesterdayRecord.getFirstCount());
|
| | | yesterday.put("indirect", yesterdayRecord.getSecondCount());
|
| | | yesterday.put("beyond", yesterdayRecord.getSecondBeyond());
|
| | | |
| | | JSONObject month = new JSONObject();
|
| | | month.put("direct", monthRecord.getFirstCount());
|
| | | month.put("indirect", monthRecord.getSecondCount());
|
| | | month.put("beyond", monthRecord.getSecondBeyond());
|
| | | |
| | | JSONObject totality = new JSONObject();
|
| | | totality.put("direct", totalityRecord.getFirstCount());
|
| | | totality.put("indirect", totalityRecord.getSecondCount());
|
| | | totality.put("beyond", totalityRecord.getSecondBeyond());
|
| | | |
| | | |
| | | JSONObject json = new JSONObject();
|
| | | json.put("today", today);
|
| | | json.put("yesterday", yesterday);
|
| | | json.put("month", month);
|
| | | json.put("totality", totality);
|
| | | out.print(JsonUtil.loadTrueResult(json));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | Long countOrderByTypeAndDate(@Param("orderType") Integer orderType, @Param("preDay") String preDay);
|
| | |
|
| | |
|
| | | /**
|
| | | * 统计近日到账收入金额
|
| | | * @param uid
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | BigDecimal sumMoneyArrivalByUidAndNearDay(@Param("uid") Long uid, @Param("day") int day);
|
| | |
|
| | | } |
| | |
| | | long countSecondTeam(@Param("uid") Long uid, @Param("listId")List<Long> listId);
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 统计一级队员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countFirstTeamByDate(@Param("uid") Long uid, @Param("dayType")int dayType);
|
| | | |
| | | /**
|
| | | * 统计二级队员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countSecondTeamByDate(@Param("uid") Long uid, @Param("dayType")int dayType);
|
| | | |
| | | /**
|
| | | * 根据id、uid查询
|
| | | *
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleFocusInfo;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Repository
|
| | | public class ThreeSaleFocusInfoDao {
|
| | |
|
| | | @Resource
|
| | | private MongoTemplate mongoTemplate;
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void save(ThreeSaleFocusInfo record) {
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | | mongoTemplate.save(record);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 更新标签
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void updateMemoName(Long workerId, int type, String memoName) {
|
| | | if (memoName == null) {
|
| | | memoName = "";
|
| | | }
|
| | | |
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | |
| | | Update update = null;
|
| | | if (type == 1) {
|
| | | update = Update.update("memoName", memoName);
|
| | | } else {
|
| | | update = Update.update("memoNameSup", memoName);
|
| | | }
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新标签
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void updateTags(Long workerId, int type, String tags) {
|
| | | if (tags == null) {
|
| | | tags = "";
|
| | | }
|
| | | |
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | |
| | | Update update = null;
|
| | | if (type == 1) {
|
| | | update = Update.update("tags", tags);
|
| | | } else {
|
| | | update = Update.update("tagsSup", tags);
|
| | | }
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | | |
| | | /**
|
| | | * 更新昵称
|
| | | * @param workerId
|
| | | * @param nickName
|
| | | */
|
| | | public void updateNickName(Long workerId, String nickName) {
|
| | | if (nickName == null) {
|
| | | nickName = "";
|
| | | }
|
| | | |
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("nickName", nickName);
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 更新是否有效粉丝
|
| | | * @param workerId
|
| | | * @param stateValid
|
| | | */
|
| | | public void updateStateValid(Long workerId, boolean stateValid) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("stateValid", stateValid);
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | | |
| | | /**
|
| | | * 更新淘宝绑定
|
| | | * @param workerId
|
| | | * @param taobaoBind
|
| | | */
|
| | | public void updateTaobaoBind(Long workerId, boolean taobaoBind) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("taobaoBind", taobaoBind);
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | | |
| | | /**
|
| | | * 更新微信绑定
|
| | | * @param workerId
|
| | | * @param weixinBind
|
| | | */
|
| | | public void updateWeixinBind(Long workerId, boolean weixinBind) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("weixinBind", weixinBind);
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新活跃时间
|
| | | * @param workerId
|
| | | * @param activeTime
|
| | | */
|
| | | public void updateActiveTime(Long workerId, Date activeTime) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("activeTime", activeTime);
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新粉丝数量
|
| | | * @param workerId
|
| | | * @param fansNum
|
| | | */
|
| | | public void updateFansNum(Long workerId, int fansNum) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("fansNum", fansNum);
|
| | | mongoTemplate.updateFirst(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 更新收入
|
| | | * @param workerId
|
| | | * @param income
|
| | | */
|
| | | public void updateIncome(Long workerId, BigDecimal income) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("income", income).set("incomeTime", new Date());
|
| | | mongoTemplate.updateMulti(query, update, ThreeSaleFocusInfo.class);
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 统计
|
| | | * @return
|
| | | */
|
| | | public ThreeSaleFocusInfo getbyWorkerId(Long workerId) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | return mongoTemplate.findOne(query, ThreeSaleFocusInfo.class);
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询
|
| | | * |
| | | * @return
|
| | | */
|
| | | public List<ThreeSaleFocusInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
| | | Query query = createQuery(type, uid, focusDTO);
|
| | | query.skip(start).limit(count);
|
| | | query.with(new Sort(Sort.Direction.DESC,"weight"));
|
| | | return mongoTemplate.find(query, ThreeSaleFocusInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计
|
| | | * @return
|
| | | */
|
| | | public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
| | | Query query = createQuery(type, uid, focusDTO);
|
| | | return mongoTemplate.count(query, ThreeSaleFocusInfo.class);
|
| | | }
|
| | |
|
| | | |
| | | private Query createQuery(int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
| | | Query query = new Query();
|
| | | if (type == 1) {
|
| | | query.addCriteria(Criteria.where("bossId").is(uid));
|
| | | } else {
|
| | | query.addCriteria(Criteria.where("bossSuperId").is(uid));
|
| | | }
|
| | | |
| | | if (focusDTO == null) {
|
| | | return query;
|
| | | }
|
| | | |
| | | if (focusDTO.getStateValid() != null)
|
| | | query.addCriteria(Criteria.where("stateValid").is(focusDTO.getStateValid()));
|
| | | |
| | | if (focusDTO.getTaobaoBind() != null)
|
| | | query.addCriteria(Criteria.where("taobaoBind").is(focusDTO.getTaobaoBind()));
|
| | | |
| | | if (focusDTO.getWeixinBind() != null)
|
| | | query.addCriteria(Criteria.where("weixinBind").is(focusDTO.getWeixinBind()));
|
| | | |
| | | if (focusDTO.getMinFansNum() != null)
|
| | | query.addCriteria(Criteria.where("fansNum").lte(focusDTO.getMinFansNum()));
|
| | | |
| | | if (focusDTO.getMinFansNum() != null)
|
| | | query.addCriteria(Criteria.where("fansNum").gte(focusDTO.getMinFansNum()));
|
| | | |
| | | if (focusDTO.getMinActiveTime() != null)
|
| | | query.addCriteria(Criteria.where("activeTime").lte(focusDTO.getMinActiveTime()));
|
| | | |
| | | if (focusDTO.getMaxActiveTime() != null)
|
| | | query.addCriteria(Criteria.where("activeTime").gte(focusDTO.getMaxActiveTime()));
|
| | | |
| | | if (focusDTO.getMinIncome() != null)
|
| | | query.addCriteria(Criteria.where("income").lte(focusDTO.getMinIncome()));
|
| | | |
| | | if (focusDTO.getMaxIncome() != null)
|
| | | query.addCriteria(Criteria.where("income").gte(focusDTO.getMaxIncome()));
|
| | | |
| | | |
| | | if (!StringUtil.isNullOrEmpty(focusDTO.getKey())) {
|
| | | if (type == 1) {
|
| | | query.addCriteria(new Criteria().orOperator(
|
| | | Criteria.where("nickName").regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE)),
|
| | | new Criteria().andOperator(Criteria.where("memoName").regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE))),
|
| | | new Criteria().andOperator(Criteria.where("tags").regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE)))
|
| | | ));
|
| | | } else {
|
| | | query.addCriteria(new Criteria().orOperator(
|
| | | Criteria.where("nickName").regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE)),
|
| | | new Criteria().andOperator(Criteria.where("memoNameSup").regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE))),
|
| | | new Criteria().andOperator(Criteria.where("tagsSup").regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE)))
|
| | | ));
|
| | | }
|
| | | }
|
| | | return query;
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | |
|
| | | @Repository
|
| | | public class TeamDailyRecordDao {
|
| | |
|
| | | @Resource
|
| | | private MongoTemplate mongoTemplate;
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void save(TeamDailyRecord record) {
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | | mongoTemplate.save(record);
|
| | | }
|
| | | |
| | | /**
|
| | | * 根据id查询数据
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public TeamDailyRecord getById(String id) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(id));
|
| | | return mongoTemplate.findOne(query, TeamDailyRecord.class);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | return mongoTemplate.find(query, TeamDailyRecord.class);
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid, Date minTime) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | query.addCriteria(Criteria.where("statisticDay").lte(minTime));
|
| | | return mongoTemplate.find(query, TeamDailyRecord.class);
|
| | | }
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamLevelDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
|
| | | @Repository
|
| | | public class TeamLevelDailyRecordDao {
|
| | |
|
| | | @Resource
|
| | | private MongoTemplate mongoTemplate;
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void save(TeamLevelDailyRecord record) {
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | | mongoTemplate.save(record);
|
| | | }
|
| | | |
| | | /**
|
| | | * 根据id查询数据
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public TeamLevelDailyRecord getById(String id) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(id));
|
| | | return mongoTemplate.findOne(query, TeamLevelDailyRecord.class);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询
|
| | | * @return
|
| | | */
|
| | | public List<TeamLevelDailyRecord> getbyUidAndType(Long uid, UserLevelEnum level, Date minTime) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | query.addCriteria(Criteria.where("level").is(level.name()));
|
| | | query.addCriteria(Criteria.where("updateTime").lte(minTime));
|
| | | return mongoTemplate.find(query, TeamLevelDailyRecord.class);
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | public class ThreeSaleFocusDTO {
|
| | | private String key;
|
| | | private Boolean stateValid;
|
| | | private Boolean taobaoBind;
|
| | | private Boolean weixinBind;
|
| | | private Integer minFansNum;
|
| | | private Integer maxFansNum;
|
| | | private Date minActiveTime;
|
| | | private Date maxActiveTime;
|
| | | private BigDecimal minIncome;
|
| | | private BigDecimal maxIncome;
|
| | |
|
| | |
|
| | | public String getKey() {
|
| | | return key;
|
| | | }
|
| | |
|
| | | public void setKey(String key) {
|
| | | this.key = key;
|
| | | }
|
| | |
|
| | | public Boolean getStateValid() {
|
| | | return stateValid;
|
| | | }
|
| | |
|
| | | public void setStateValid(Boolean stateValid) {
|
| | | this.stateValid = stateValid;
|
| | | }
|
| | |
|
| | | public Boolean getTaobaoBind() {
|
| | | return taobaoBind;
|
| | | }
|
| | |
|
| | | public void setTaobaoBind(Boolean taobaoBind) {
|
| | | this.taobaoBind = taobaoBind;
|
| | | }
|
| | |
|
| | | public Boolean getWeixinBind() {
|
| | | return weixinBind;
|
| | | }
|
| | |
|
| | | public void setWeixinBind(Boolean weixinBind) {
|
| | | this.weixinBind = weixinBind;
|
| | | }
|
| | |
|
| | | public Integer getMinFansNum() {
|
| | | return minFansNum;
|
| | | }
|
| | |
|
| | | public void setMinFansNum(Integer minFansNum) {
|
| | | this.minFansNum = minFansNum;
|
| | | }
|
| | |
|
| | | public Integer getMaxFansNum() {
|
| | | return maxFansNum;
|
| | | }
|
| | |
|
| | | public void setMaxFansNum(Integer maxFansNum) {
|
| | | this.maxFansNum = maxFansNum;
|
| | | }
|
| | |
|
| | | public Date getMinActiveTime() {
|
| | | return minActiveTime;
|
| | | }
|
| | |
|
| | | public void setMinActiveTime(Date minActiveTime) {
|
| | | this.minActiveTime = minActiveTime;
|
| | | }
|
| | |
|
| | | public Date getMaxActiveTime() {
|
| | | return maxActiveTime;
|
| | | }
|
| | |
|
| | | public void setMaxActiveTime(Date maxActiveTime) {
|
| | | this.maxActiveTime = maxActiveTime;
|
| | | }
|
| | |
|
| | | public BigDecimal getMinIncome() {
|
| | | return minIncome;
|
| | | }
|
| | |
|
| | | public void setMinIncome(BigDecimal minIncome) {
|
| | | this.minIncome = minIncome;
|
| | | }
|
| | |
|
| | | public BigDecimal getMaxIncome() {
|
| | | return maxIncome;
|
| | | }
|
| | |
|
| | | public void setMaxIncome(BigDecimal maxIncome) {
|
| | | this.maxIncome = maxIncome;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | @Document(collection = "three_sale_focus_info")
|
| | | public class ThreeSaleFocusInfo {
|
| | |
|
| | | @Id
|
| | | @Field("id")
|
| | | private String id;
|
| | |
|
| | | @Field("bossId")
|
| | | private Long bossId; // 上级id
|
| | |
|
| | | @Field("bossSuperId")
|
| | | private Long bossSuperId; // 上上级id
|
| | |
|
| | | @Field("workerId")
|
| | | private Long workerId; // 下级id
|
| | |
|
| | | @Field("nickName")
|
| | | private String nickName; // 昵称
|
| | |
|
| | | @Field("stateValid")
|
| | | private Boolean stateValid; // 有效粉丝
|
| | |
|
| | | @Field("taobaoBind")
|
| | | private Boolean taobaoBind; // 绑定淘宝
|
| | |
|
| | | @Field("weixinBind")
|
| | | private Boolean weixinBind; // 绑定微信
|
| | |
|
| | | @Field("activeTime")
|
| | | private Date activeTime; // 活跃时间
|
| | |
|
| | | @Field("fansNum")
|
| | | private Integer fansNum; // 粉丝数量
|
| | |
|
| | | @Field("income")
|
| | | private BigDecimal income; // 账户收入
|
| | |
|
| | | @Field("incomeTime")
|
| | | private Date incomeTime; // 账户收入统计时间
|
| | |
|
| | | @Field("joinTime")
|
| | | private Date joinTime; // 邀请成功时间
|
| | |
|
| | | @Field("memoName")
|
| | | private String memoName; // 直接上级备注名
|
| | |
|
| | | @Field("tags")
|
| | | private String tags; // 直接上级标签
|
| | |
|
| | | @Field("memoNameSup")
|
| | | private String memoNameSup; // 间接上级备注名
|
| | |
|
| | | @Field("tagsSup")
|
| | | private String tagsSup; // 间接上级标签
|
| | |
|
| | | @Field("updateTime")
|
| | | private Date updateTime; // 更新时间
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getBossId() {
|
| | | return bossId;
|
| | | }
|
| | |
|
| | | public void setBossId(Long bossId) {
|
| | | this.bossId = bossId;
|
| | | }
|
| | |
|
| | | public Long getBossSuperId() {
|
| | | return bossSuperId;
|
| | | }
|
| | |
|
| | | public void setBossSuperId(Long bossSuperId) {
|
| | | this.bossSuperId = bossSuperId;
|
| | | }
|
| | |
|
| | | public Long getWorkerId() {
|
| | | return workerId;
|
| | | }
|
| | |
|
| | | public void setWorkerId(Long workerId) {
|
| | | this.workerId = workerId;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getMemoName() {
|
| | | return memoName;
|
| | | }
|
| | |
|
| | | public void setMemoName(String memoName) {
|
| | | this.memoName = memoName;
|
| | | }
|
| | |
|
| | | public String getTags() {
|
| | | return tags;
|
| | | }
|
| | |
|
| | | public void setTags(String tags) {
|
| | | this.tags = tags;
|
| | | }
|
| | |
|
| | | public Boolean getStateValid() {
|
| | | return stateValid;
|
| | | }
|
| | |
|
| | | public void setStateValid(Boolean stateValid) {
|
| | | this.stateValid = stateValid;
|
| | | }
|
| | |
|
| | | public Boolean getTaobaoBind() {
|
| | | return taobaoBind;
|
| | | }
|
| | |
|
| | | public void setTaobaoBind(Boolean taobaoBind) {
|
| | | this.taobaoBind = taobaoBind;
|
| | | }
|
| | |
|
| | | public Boolean getWeixinBind() {
|
| | | return weixinBind;
|
| | | }
|
| | |
|
| | | public void setWeixinBind(Boolean weixinBind) {
|
| | | this.weixinBind = weixinBind;
|
| | | }
|
| | |
|
| | | public Date getActiveTime() {
|
| | | return activeTime;
|
| | | }
|
| | |
|
| | | public void setActiveTime(Date activeTime) {
|
| | | this.activeTime = activeTime;
|
| | | }
|
| | |
|
| | | public Integer getFansNum() {
|
| | | return fansNum;
|
| | | }
|
| | |
|
| | | public void setFansNum(Integer fansNum) {
|
| | | this.fansNum = fansNum;
|
| | | }
|
| | |
|
| | | public BigDecimal getIncome() {
|
| | | return income;
|
| | | }
|
| | |
|
| | | public void setIncome(BigDecimal income) {
|
| | | this.income = income;
|
| | | }
|
| | |
|
| | | public Date getIncomeTime() {
|
| | | return incomeTime;
|
| | | }
|
| | |
|
| | | public void setIncomeTime(Date incomeTime) {
|
| | | this.incomeTime = incomeTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Date getJoinTime() {
|
| | | return joinTime;
|
| | | }
|
| | |
|
| | | public void setJoinTime(Date joinTime) {
|
| | | this.joinTime = joinTime;
|
| | | }
|
| | |
|
| | | public String getMemoNameSup() {
|
| | | return memoNameSup;
|
| | | }
|
| | |
|
| | | public void setMemoNameSup(String memoNameSup) {
|
| | | this.memoNameSup = memoNameSup;
|
| | | }
|
| | |
|
| | | public String getTagsSup() {
|
| | | return tagsSup;
|
| | | }
|
| | |
|
| | | public void setTagsSup(String tagsSup) {
|
| | | this.tagsSup = tagsSup;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.index.Indexed;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 用户粉丝统计记录-每日
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "team_daily_record")
|
| | | public class TeamDailyRecord {
|
| | |
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | @Indexed
|
| | | private Long uid;
|
| | | @Field
|
| | | private Integer firstCount; // 一级
|
| | | @Field
|
| | | private Integer secondCount; // 二级
|
| | | @Field
|
| | | private Integer secondBeyond; // 二级以外
|
| | | @Field
|
| | | private Date statisticDay; // 统计日期: 年-月-日
|
| | | @Field
|
| | | private Date updateTime;
|
| | |
|
| | | public TeamDailyRecord() {}
|
| | | |
| | | public TeamDailyRecord(Integer firstCount, Integer secondCount, Integer secondBeyond) {
|
| | | this.firstCount = firstCount;
|
| | | this.secondCount = secondCount;
|
| | | this.secondBeyond = secondBeyond;
|
| | | }
|
| | | |
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Integer getFirstCount() {
|
| | | return firstCount;
|
| | | }
|
| | |
|
| | | public void setFirstCount(Integer firstCount) {
|
| | | this.firstCount = firstCount;
|
| | | }
|
| | |
|
| | | public Integer getSecondCount() {
|
| | | return secondCount;
|
| | | }
|
| | |
|
| | | public void setSecondCount(Integer secondCount) {
|
| | | this.secondCount = secondCount;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Integer getSecondBeyond() {
|
| | | return secondBeyond;
|
| | | }
|
| | |
|
| | | public void setSecondBeyond(Integer secondBeyond) {
|
| | | this.secondBeyond = secondBeyond;
|
| | | }
|
| | |
|
| | | public Date getStatisticDay() {
|
| | | return statisticDay;
|
| | | }
|
| | |
|
| | | public void setStatisticDay(Date statisticDay) {
|
| | | this.statisticDay = statisticDay;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.index.Indexed;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 用户等级统计记录-每日
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "team_level_daily_record")
|
| | | public class TeamLevelDailyRecord {
|
| | |
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | @Indexed
|
| | | private Long uid;
|
| | | @Indexed
|
| | | @Field
|
| | | private UserLevelEnum level; // 统计的等级
|
| | | @Field
|
| | | private Integer firstCount; // 一级
|
| | | @Field
|
| | | private Integer secondCount; // 二级
|
| | | @Field
|
| | | private Integer secondBeyond; // 二级以外
|
| | | @Field
|
| | | private Date statisticDay; // 统计日期: 年-月-日
|
| | | @Field
|
| | | private Date updateTime;
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public UserLevelEnum getLevel() {
|
| | | return level;
|
| | | }
|
| | |
|
| | | public void setLevel(UserLevelEnum level) {
|
| | | this.level = level;
|
| | | }
|
| | |
|
| | | public Integer getFirstCount() {
|
| | | return firstCount;
|
| | | }
|
| | |
|
| | | public void setFirstCount(Integer firstCount) {
|
| | | this.firstCount = firstCount;
|
| | | }
|
| | |
|
| | | public Integer getSecondCount() {
|
| | | return secondCount;
|
| | | }
|
| | |
|
| | | public void setSecondCount(Integer secondCount) {
|
| | | this.secondCount = secondCount;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Integer getSecondBeyond() {
|
| | | return secondBeyond;
|
| | | }
|
| | |
|
| | | public void setSecondBeyond(Integer secondBeyond) {
|
| | | this.secondBeyond = secondBeyond;
|
| | | }
|
| | |
|
| | | public Date getStatisticDay() {
|
| | | return statisticDay;
|
| | | }
|
| | |
|
| | | public void setStatisticDay(Date statisticDay) {
|
| | | this.statisticDay = statisticDay;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 导师信息
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | |
| | | @Field
|
| | | private Integer type;
|
| | | @Field
|
| | | private String nickName;// 昵称
|
| | | @Field
|
| | | private String portrait;// 头像
|
| | | @Field
|
| | | private String wxID;// 微信号
|
| | | @Field
|
| | | private String phone;// 手机号
|
| | |
|
| | | public TearcherInfo(String id) {
|
| | | super();
|
| | |
| | | public TearcherInfo() {
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | |
| | | this.wxID = wxID;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getPortrait() {
|
| | | return portrait;
|
| | | }
|
| | |
|
| | | public void setPortrait(String portrait) {
|
| | | this.portrait = portrait;
|
| | | }
|
| | |
|
| | | public String getPhone() {
|
| | | return phone;
|
| | | }
|
| | |
|
| | | public void setPhone(String phone) {
|
| | | this.phone = phone;
|
| | | }
|
| | | }
|
| | |
| | | )A
|
| | | </select>
|
| | |
|
| | | |
| | | <select id="countFirstTeamByDate" resultType="java.lang.Long">
|
| | | SELECT IFNULL(count(id),0) FROM `yeshi_ec_threesale`
|
| | | WHERE `boss_id` = #{uid} |
| | | <if test="dayType == 1"> <!-- 今日 -->
|
| | | AND TO_DAYS(FROM_UNIXTIME(createTime/1000)) = TO_DAYS(NOW()) |
| | | </if>
|
| | | <if test="dayType == 2"> <!-- 本月 -->
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(createTime/1000),'%Y%m') = DATE_FORMAT( CURDATE(),'%Y%m') |
| | | </if>
|
| | | </select>
|
| | | |
| | | <select id="countSecondTeamByDate" resultType="java.lang.Long">
|
| | | SELECT COUNT(A.id) FROM (
|
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
|
| | | WHERE tf.`boss_id` = #{uid}
|
| | | <if test="dayType == 1"> <!-- 今日 -->
|
| | | AND TO_DAYS(FROM_UNIXTIME(ts.createTime/1000)) = TO_DAYS(NOW()) |
| | | </if>
|
| | | <if test="dayType == 2"> <!-- 本月 -->
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(ts.createTime/1000),'%Y%m') = DATE_FORMAT( CURDATE(),'%Y%m') |
| | | </if>
|
| | | )A
|
| | | </select>
|
| | | |
| | | |
| | | |
| | | <select id="getMyBoss" resultMap="AllResultMap">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)A
|
| | | </select>
|
| | |
|
| | | |
| | | <select id="sumMoneyArrivalByUidAndNearDay" resultType="BigDecimal">
|
| | | SELECT SUM(v2.`hb_money`) FROM yeshi_ec_hongbao_v2 v2
|
| | | WHERE v2.`hb_uid` = #{uid} AND v2.`hb_state` = 3
|
| | | AND DATE_SUB(CURDATE(), INTERVAL #{day} DAY) <![CDATA[<=]]> DATE(v2.`hb_get_time`) |
| | | </select>
|
| | | |
| | | </mapper>
|
| | |
| | | startTime, endTime, listSource);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public BigDecimal sumMoneyArrivalByUidAndNearDay(Long uid, int day) {
|
| | | return hongBaoV2CountMapper.sumMoneyArrivalByUidAndNearDay(uid, day);
|
| | | }
|
| | | }
|
| | |
| | | msgMoneyDetailMapper.setMsgReadByUid(uid);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public MsgMoneyDetail selectByPrimaryKey(Long id) {
|
| | | return msgMoneyDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgMoneyDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_MONEY);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void deleteByPidAndType(Long rid, String type) {
|
| | | MsgExtra msgExtra = msgExtraMapper.getByRidAndType(rid, type);
|
| | | if (msgExtra == null) {
|
| | | return;
|
| | | }
|
| | | msgExtraMapper.deleteByPrimaryKey(msgExtra.getId());
|
| | | }
|
| | | |
| | | }
|
| | |
| | | msgOtherDetailMapper.setMsgReadByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public MsgOtherDetail selectByPrimaryKey(Long id) {
|
| | | return msgOtherDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgOtherDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_OTHER);
|
| | | }
|
| | | }
|
| | |
| | | return msgOrderDetailMapper.listByOrderId(orderId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public MsgOrderDetail selectByPrimaryKey(Long id) {
|
| | | return msgOrderDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgOrderDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_ORDER);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public List<UserCustomSettings> listByUidListAndTypeAndState(List<Long> uidList, String type, Integer state) {
|
| | | return userCustomSettingsMapper.listByUidListAndTypeAndState(uidList, type, state);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public boolean validateDisplayPhoneByUid(Long uid) {
|
| | | UserCustomSettings settings = userCustomSettingsMapper.getSettingsByUidAndType(uid,
|
| | | UserSettingTypeEnum.noDisplayPhoneNum.name());
|
| | | if (settings != null && settings.getState() != null && settings.getState() == 1) {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | userMsgReadStateService.addInviteMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public MsgInviteDetail selectByPrimaryKey(Long id) {
|
| | | return msgInviteDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgInviteDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_INVITE);
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.invite; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.user.ThreeSaleFocusInfoDao; |
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO; |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleFocusInfo; |
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleFocusInfoService; |
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce; |
| | | |
| | | @Service |
| | | public class ThreeSaleFocusInfoServiceImpl implements ThreeSaleFocusInfoService { |
| | | |
| | | @Resource |
| | | private ThreeSaleFocusInfoDao threeSaleFocusInfoDao; |
| | | |
| | | @Resource |
| | | private ThreeSaleSerivce threeSaleSerivce; |
| | | |
| | | @Override |
| | | public void save(ThreeSaleFocusInfo record) { |
| | | threeSaleFocusInfoDao.save(record); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateMemoName(Long workerId, int type, String memoName) { |
| | | threeSaleFocusInfoDao.updateMemoName(workerId, type, memoName); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTags(Long workerId, int type, String tags) { |
| | | threeSaleFocusInfoDao.updateTags(workerId, type, tags); |
| | | } |
| | | |
| | | @Override |
| | | public void updateNickName(Long workerId, String nickName) { |
| | | threeSaleFocusInfoDao.updateNickName(workerId, nickName); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateStateValid(Long workerId, boolean stateValid) { |
| | | threeSaleFocusInfoDao.updateStateValid(workerId, stateValid); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaobaoBind(Long workerId, boolean taobaoBind) { |
| | | threeSaleFocusInfoDao.updateTaobaoBind(workerId, taobaoBind); |
| | | } |
| | | |
| | | @Override |
| | | public void updateWeixinBind(Long workerId, boolean weixinBind) { |
| | | threeSaleFocusInfoDao.updateWeixinBind(workerId, weixinBind); |
| | | } |
| | | |
| | | @Override |
| | | public void updateActiveTime(Long workerId, Date activeTime) { |
| | | threeSaleFocusInfoDao.updateActiveTime(workerId, activeTime); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFansNum(Long workerId) { |
| | | long firstTeam = threeSaleSerivce.countFirstTeam(workerId); |
| | | long secondTeam = threeSaleSerivce.countSecondTeam(workerId); |
| | | int fansNum = (int) (firstTeam + secondTeam); |
| | | threeSaleFocusInfoDao.updateFansNum(workerId, fansNum); |
| | | } |
| | | |
| | | @Override |
| | | public void updateIncome(Long workerId, BigDecimal income) { |
| | | threeSaleFocusInfoDao.updateIncome(workerId, income); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ThreeSaleFocusInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO) { |
| | | return threeSaleFocusInfoDao.query(start, count, type, uid, focusDTO); |
| | | } |
| | | |
| | | @Override |
| | | public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO) { |
| | | return threeSaleFocusInfoDao.count(type, uid, focusDTO); |
| | | } |
| | | |
| | | @Override |
| | | public ThreeSaleFocusInfo getbyWorkerId(Long workerId) { |
| | | return threeSaleFocusInfoDao.getbyWorkerId(workerId); |
| | | } |
| | | } |
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public long countFirstTeamByDate(Long uid, int dayType) {
|
| | | return threeSaleMapper.countFirstTeamByDate(uid, dayType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeamByDate(Long uid, int dayType) {
|
| | | return threeSaleMapper.countSecondTeamByDate(uid, dayType);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public ThreeSale selectLatestByWorkerIdAndState(Long workerId, int state) {
|
| | | return threeSaleMapper.selectLatestByWorkerIdAndState(workerId, state);
|
| | | }
|
| | |
| | |
|
| | | userMsgReadStateService.addAccountMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public MsgAccountDetail selectByPrimaryKey(Long id) {
|
| | | return msgAccountDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgAccountDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.vip.TeamDailyRecordDao;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamDailyRecordService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | @Service
|
| | | public class TeamDailyRecordServiceImpl implements TeamDailyRecordService {
|
| | |
|
| | | @Resource
|
| | | private TeamDailyRecordDao TeamDailyRecordDao;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | |
|
| | | @Override
|
| | | public void addDailyRecord(Long uid) {
|
| | | // 重新统计队员等级数量
|
| | | recountRecord(uid);
|
| | |
|
| | | // 统计上级队员数量
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
|
| | | if (threeSale != null) {
|
| | | recountRecord(threeSale.getBoss().getId());
|
| | | }
|
| | | }
|
| | |
|
| | | private void recountRecord(Long uid) {
|
| | | try {
|
| | | // 直接粉丝
|
| | | int firstCount = (int) threeSaleSerivce.countFirstTeamByDate(uid, 1);
|
| | | // 间接粉丝
|
| | | int secondCount = (int) threeSaleSerivce.countSecondTeamByDate(uid, 1);
|
| | |
|
| | | int secondBeyond = 0;
|
| | | |
| | | // 每天只记录一次统计
|
| | | String time = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | String id = StringUtil.Md5(uid + "#" + time);
|
| | | TeamDailyRecord record = TeamDailyRecordDao.getById(id);
|
| | | if (record == null) {
|
| | | record = new TeamDailyRecord();
|
| | | } else if (record.getSecondCount() != null) {
|
| | | secondBeyond = record.getSecondCount();
|
| | | }
|
| | |
|
| | | record.setId(id);
|
| | | record.setUid(uid);
|
| | | record.setFirstCount(firstCount);
|
| | | record.setSecondCount(secondCount);
|
| | | record.setSecondBeyond(secondBeyond);
|
| | | record.setStatisticDay(TimeUtil.parse(time));
|
| | | record.setUpdateTime(new Date());
|
| | | TeamDailyRecordDao.save(record);
|
| | | } catch (Exception e) {
|
| | | e.getSuppressed();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TeamDailyRecord> getbyUid(Long uid) {
|
| | | return TeamDailyRecordDao.getbyUid(uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<TeamDailyRecord> getbyUid(Long uid, Date minTime) {
|
| | | return TeamDailyRecordDao.getbyUid(uid, minTime);
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.vip.TeamLevelDailyRecordDao;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamLevelDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamLevelDailyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | @Service
|
| | | public class TeamLevelDailyRecordServiceImpl implements TeamLevelDailyRecordService {
|
| | |
|
| | | @Resource
|
| | | private TeamLevelDailyRecordDao teamLevelDailyRecordDao;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private UserLevelManager userLevelManager;
|
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | | |
| | | @Override
|
| | | public List<TeamLevelDailyRecord> getbyUidAndType(Long uid, UserLevelEnum level, Date minTime) {
|
| | | return teamLevelDailyRecordDao.getbyUidAndType(uid, level, minTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void addStatisticByUid(Long uid) {
|
| | | // 重新统计队员等级数量
|
| | | initData(uid);
|
| | | |
| | | // 统计上级队员数量
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
|
| | | if (threeSale != null) {
|
| | | initData(threeSale.getBoss().getId());
|
| | | }
|
| | | }
|
| | |
|
| | | private void initData(Long uid) {
|
| | | int pageSize = 1000;
|
| | | Date date = new Date();
|
| | | String countDay = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | |
| | | // 直接粉丝统计
|
| | | 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) {
|
| | | Long succeedTime = ts.getSucceedTime();
|
| | | if (succeedTime == null) {
|
| | | succeedTime = ts.getCreateTime();
|
| | | }
|
| | | |
| | | // 当日生产邀请关系
|
| | | if (countDay.equals(TimeUtil.getGernalTime(succeedTime))) {
|
| | | daRenFirstCount++;
|
| | | continue;
|
| | | }
|
| | | |
| | | |
| | | UserVIPPreInfo info = userVIPPreInfoService.getProcessInfo(uid, date);
|
| | | // 是否当日升级
|
| | | if (info != null && countDay.equals(TimeUtil.getGernalTime(info.getCreateTime().getTime())) ) {
|
| | | for (UserLevelEnum level : UserLevelEnum.values()) {
|
| | | if (level.getLevel() == info.getProcess()) {
|
| | | if (level == UserLevelEnum.highVIP) {
|
| | | highFirstCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | superFirstCount++;
|
| | | } else if (level == UserLevelEnum.tearcher) {
|
| | | tearcherFirstCount++;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 间接粉丝
|
| | | 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) {
|
| | | Long succeedTime = ts.getSucceedTime();
|
| | | if (succeedTime == null) {
|
| | | succeedTime = ts.getCreateTime();
|
| | | }
|
| | | |
| | | // 当日生产邀请关系
|
| | | if (countDay.equals(TimeUtil.getGernalTime(succeedTime))) {
|
| | | daRenFirstCount++;
|
| | | continue;
|
| | | }
|
| | | |
| | | UserVIPPreInfo info = userVIPPreInfoService.getProcessInfo(uid, date);
|
| | | // 是否当日升级
|
| | | if (info != null && countDay.equals(TimeUtil.getGernalTime(info.getCreateTime().getTime())) ) {
|
| | | for (UserLevelEnum level : UserLevelEnum.values()) {
|
| | | if (level.getLevel() == info.getProcess()) {
|
| | | if (level == UserLevelEnum.highVIP) {
|
| | | highSecondCount++;
|
| | | } else if (level == UserLevelEnum.superVIP) {
|
| | | superSecondCount++;
|
| | | } else if (level == UserLevelEnum.tearcher) {
|
| | | tearcherSecondCount++;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | save(uid, UserLevelEnum.daRen, daRenFirstCount, daRenSecondCount);
|
| | | save(uid, UserLevelEnum.highVIP, highFirstCount, highSecondCount);
|
| | | save(uid, UserLevelEnum.superVIP, superFirstCount, superSecondCount);
|
| | | save(uid, UserLevelEnum.tearcher, tearcherFirstCount, tearcherSecondCount);
|
| | | }
|
| | | |
| | | |
| | | private void save(Long uid, UserLevelEnum level, int firstCount, int secondCount) {
|
| | | try {
|
| | | int secondBeyond = 0;
|
| | | // 每天只记录一次统计
|
| | | String time = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | String id = StringUtil.Md5(uid + level.name() + time);
|
| | | TeamLevelDailyRecord record = teamLevelDailyRecordDao.getById(id);
|
| | | if (record == null) {
|
| | | record = new TeamLevelDailyRecord();
|
| | | } else if (record.getSecondCount() != null) {
|
| | | secondBeyond = record.getSecondCount();
|
| | | }
|
| | | |
| | | record.setId(id);
|
| | | record.setUid(uid);
|
| | | record.setLevel(level);
|
| | | record.setFirstCount(firstCount);
|
| | | record.setSecondCount(secondCount);
|
| | | record.setStatisticDay(TimeUtil.parse(time));
|
| | | record.setUpdateTime(new Date());
|
| | | record.setSecondBeyond(secondBeyond);
|
| | | teamLevelDailyRecordDao.save(record);
|
| | | } catch (Exception e) {
|
| | | e.getSuppressed();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | for (UserInviteValidRecord ts : list) {
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | if (level == UserLevelEnum.daRen || level == UserLevelEnum.normalVIP) {
|
| | | daRenFirstCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highFirstCount++;
|
| | |
| | |
|
| | | for (UserInviteValidRecord ts : list) {
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | if (level == UserLevelEnum.daRen || level == UserLevelEnum.normalVIP) {
|
| | | daRenSecondCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highSecondCount++;
|
| | |
| | |
|
| | |
|
| | | public BigDecimal geBonusByuid(Long uid, Integer dateType, Integer hbType, Integer moneyState); |
| | |
|
| | | /**
|
| | | * 统计近日到账收入金额
|
| | | * @param uid
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumMoneyArrivalByUidAndNearDay(Long uid, int day); |
| | |
|
| | | }
|
| | |
| | | * @param uid
|
| | | */
|
| | | public void readMsgByUid(Long uid);
|
| | |
|
| | | public MsgMoneyDetail selectByPrimaryKey(Long id);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | | }
|
| | |
| | |
|
| | | public void addMsgExtra(long rid, String content, String type);
|
| | |
|
| | | /**
|
| | | * 根据上级id类型删除
|
| | | * @param rid
|
| | | * @param type
|
| | | */
|
| | | public void deleteByPidAndType(Long rid, String type);
|
| | |
|
| | | }
|
| | |
| | | * @param uid
|
| | | */
|
| | | public void readMsgByUid(Long uid);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | public MsgOtherDetail selectByPrimaryKey(Long id);
|
| | | }
|
| | |
| | | * @param uid
|
| | | */
|
| | | public void readMsgByUid(Long uid);
|
| | |
|
| | | public MsgOrderDetail selectByPrimaryKey(Long id);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | | }
|
| | |
| | | */
|
| | | public List<UserCustomSettings> listByUidListAndTypeAndState(List<Long> uidList, String type, Integer state);
|
| | |
|
| | | /**
|
| | | * 是否对外显示手机号
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean validateDisplayPhoneByUid(Long uid);
|
| | |
|
| | | }
|
| | |
| | | public void deleteByThreeSale(ThreeSale sale);
|
| | |
|
| | | public void insertSelective(MsgInviteDetail detail);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | public MsgInviteDetail selectByPrimaryKey(Long id);
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.invite;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleFocusInfo;
|
| | |
|
| | | public interface ThreeSaleFocusInfoService {
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param type
|
| | | * @param uid
|
| | | * @param focusDTO
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSaleFocusInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO);
|
| | |
|
| | | public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO);
|
| | |
|
| | | /**
|
| | | * 根据下级id查询
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | public ThreeSaleFocusInfo getbyWorkerId(Long workerId);
|
| | |
|
| | | public void updateMemoName(Long workerId, int type, String memoName);
|
| | |
|
| | | public void updateTags(Long workerId, int type, String tags);
|
| | |
|
| | | public void updateNickName(Long workerId, String nickName);
|
| | |
|
| | | public void updateStateValid(Long workerId, boolean stateValid);
|
| | |
|
| | | public void updateTaobaoBind(Long workerId, boolean taobaoBind);
|
| | |
|
| | | public void updateWeixinBind(Long workerId, boolean weixinBind);
|
| | |
|
| | | public void updateActiveTime(Long workerId, Date activeTime);
|
| | |
|
| | | public void updateFansNum(Long workerId);
|
| | |
|
| | | public void updateIncome(Long workerId, BigDecimal income);
|
| | |
|
| | | /**
|
| | | * 添加
|
| | | * @param record
|
| | | */
|
| | | public void save(ThreeSaleFocusInfo record);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public Long getTopBoss(Long uid);
|
| | |
|
| | | /**
|
| | | * 根日期类型进行统计直接
|
| | | */
|
| | | public long countFirstTeamByDate(Long uid, int dayType);
|
| | |
|
| | | /**
|
| | | * 根日期类型进行统计间接
|
| | | * @param uid
|
| | | * @param dayType
|
| | | * @return
|
| | | */
|
| | | public long countSecondTeamByDate(Long uid, int dayType);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void addMsgVIP(Long uid, String title, String beiZhu, MsgAccountVipDTO dto);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | public MsgAccountDetail selectByPrimaryKey(Long id);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | |
|
| | | public interface TeamDailyRecordService {
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 初始化统计粉丝等级数量
|
| | | * @param uid
|
| | | */
|
| | | public void addDailyRecord(Long uid);
|
| | |
|
| | | /**
|
| | | * 查询所有
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid);
|
| | | |
| | | /**
|
| | | * 查询数据
|
| | | * @param uid
|
| | | * @param level
|
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid, Date minTime);
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamLevelDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
|
| | | public interface TeamLevelDailyRecordService {
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询数据
|
| | | * @param uid
|
| | | * @param level
|
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | public List<TeamLevelDailyRecord> getbyUidAndType(Long uid, UserLevelEnum level, Date minTime);
|
| | |
|
| | | /**
|
| | | * 初始化统计粉丝等级数量
|
| | | * @param uid
|
| | | */
|
| | | public void addStatisticByUid(Long uid);
|
| | | |
| | |
|
| | | }
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public static boolean greaterThan_2_1_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 57))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 80)))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | | |
| | | public static boolean smallerThan_1_5_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 44)))
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | }
|
| | |
|
| | |
|
| | | UserMsgVO vo = new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_order.png", "订单消息",
|
| | | UserMsgVO vo = new UserMsgVO(msg.getId(), "http://img.flqapp.com/resource/msg/icon_msg_order.png", "订单消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), null);
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.found) {
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getMsgType().getIcon());
|
| | | userMsgVO.setTitle(msg.getMsgType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现",
|
| | | |
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.extractValid) {
|
| | | BindingAccount ba = new BindingAccount();
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现账号验证",
|
| | | return new UserMsgVO(msg.getId(), "http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现账号验证",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.fanli) {
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.fanliElme) {
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.invite || msg.getMsgType() == MsgTypeMoneyTypeEnum.share) {
|
| | |
| | | String date = ca.get(Calendar.YEAR) + "年" + (ca.get(Calendar.MONTH) + 1) + "月";
|
| | |
|
| | | if (msg.getMsgType() == MsgTypeMoneyTypeEnum.share)
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | date + msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | else
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | date + msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_fanli.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_fanli.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.shareWeiQuan) {
|
| | | contentList = new ArrayList<>();
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.inviteWeiQuan) {
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.orderReward) {// 奖励订单
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_order_reward.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_order_reward.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.systemEqualize) {// 系统补偿
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.extractAutoWX) { // 微信自动提现
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) { // 额外补贴
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.orderTeamReward) { // 团队奖励
|
| | | contentList = new ArrayList<>();
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_team_reward.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_team_reward.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackReceiveOff) { // 红包成功领取
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff) { // 红包被成功领取
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveBack) { // 红包未被领取退回
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_give.png",
|
| | | MsgTypeMoneyTypeEnum.redPackGiveBack.getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass) { // 红包提现成功
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现拒绝
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackForbid) { // 红包封禁消息
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackForbidRemove) { // 红包封禁解除消息
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackDeduct) { // 红包扣除消息
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackOneStageReward
|
| | | || msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackTwoStageReward
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", "红包提醒",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", "红包提醒",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseSuccess) { // 红包使用成功
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseFail) { // 红包使用失败
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | | return null;
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu() + "",
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getMsgType().getIcon());
|
| | | userMsgVO.setTitle(msg.getMsgType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(), "http://img.flqapp.com/resource/msg/icon_msg_invite.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msgType == MsgTypeInviteTypeEnum.inviteSucceed) {
|
| | | if (msg.getInviteUser() == null || msg.getInviteUser().getWorker() == null)
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite.png", "邀请提醒 ",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite.png", "邀请提醒 ",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_vip.png");
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_notify.png");
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_invite_break.png");
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | return userMsgVO;
|
| | | }
|
| | |
|
| | | return new UserMsgVO(icon, msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),icon, msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.user;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Action;
|
| | | import com.aliyun.openservices.ons.api.ConsumeContext;
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.BeComeValidUserMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.TaoBaoBindSuccessMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg.UserInfoUpdateTypeEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInviteMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserMoneyChangeMQMsg;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleFocusInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamLevelDailyRecordService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 用户粉丝消息
|
| | |
| | | */
|
| | | @Component
|
| | | public class UserTeamMessageListener implements MessageListener {
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleFocusInfoService threeSaleFocusInfoService;
|
| | | |
| | | @Resource
|
| | | private TeamLevelDailyRecordService teamLevelDailyRecordService;
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
| | |
|
| | | if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(UserTopicTagEnum.userActve.name())) {// 用户活跃
|
| | | // TODO 更改用户活跃时间
|
| | |
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserActiveMQMsg userActiveMQMsg = new Gson().fromJson(json.toString(),UserActiveMQMsg.class);
|
| | | if (userActiveMQMsg != null) {
|
| | | // 更改用户活跃时间
|
| | | threeSaleFocusInfoService.updateActiveTime(userActiveMQMsg.getUid(), userActiveMQMsg.getCreateTime());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userInfoUpdate.name())) {// 用户信息更新
|
| | |
|
| | | // TODO 更改微信号绑定
|
| | |
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserInfoUpdateMQMsg mqMsg = new Gson().fromJson(json.toString(),UserInfoUpdateMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | if (UserInfoUpdateTypeEnum.nickName == mqMsg.getType()) { // 更改昵称
|
| | | threeSaleFocusInfoService.updateNickName(mqMsg.getUid(), mqMsg.getValue());
|
| | | } else if (UserInfoUpdateTypeEnum.wxId == mqMsg.getType()) { // 微信号绑定
|
| | | threeSaleFocusInfoService.updateWeixinBind(mqMsg.getUid(), true);
|
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.taobaoBindSuccess.name())) {// 淘宝绑定成功
|
| | |
|
| | | // TODO 更改淘宝绑定状态与原用户淘宝绑定状态
|
| | |
|
| | | // 更改淘宝绑定状态与原用户淘宝绑定状态
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | TaoBaoBindSuccessMQMsg mqMsg = new Gson().fromJson(json.toString(),TaoBaoBindSuccessMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | // 更新淘宝绑定
|
| | | threeSaleFocusInfoService.updateWeixinBind(mqMsg.getUid(), true);
|
| | | Long fromUid = mqMsg.getFromUid();
|
| | | if (fromUid != null) { // 淘宝被解绑
|
| | | threeSaleFocusInfoService.updateWeixinBind(fromUid, false);
|
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.inviteSuccess.name())) {// 邀请成功
|
| | | // 更新粉丝数量
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserInviteMQMsg mqMsg = new Gson().fromJson(json.toString(),UserInviteMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | threeSaleFocusInfoService.updateFansNum(mqMsg.getBossId());
|
| | |
|
| | | // TODO 更新粉丝数量
|
| | |
|
| | | // 重新统计粉丝等级数量
|
| | | teamLevelDailyRecordService.addStatisticByUid(mqMsg.getBossId());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userMoneyAdd.name())) {// 资金到账
|
| | |
|
| | | // TODO 更新近60天到账
|
| | |
|
| | | // 更新近60天到账
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserMoneyChangeMQMsg mqMsg = new Gson().fromJson(json.toString(),UserMoneyChangeMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | threeSaleFocusInfoService.updateIncome(mqMsg.getUid(), mqMsg.getChangeMoney());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.becomeValidUser.name())) {// 成为有效用户
|
| | |
|
| | | // TODO 有效用户标识
|
| | | // 有效用户标识
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | BeComeValidUserMQMsg mqMsg = new Gson().fromJson(json.toString(),BeComeValidUserMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | // 更新成为有效粉丝
|
| | | threeSaleFocusInfoService.updateStateValid(mqMsg.getUid(), true);
|
| | | }
|
| | | }
|
| | | }
|
| | | return Action.CommitMessage;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamLevelDailyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | | |
| | | @Resource
|
| | | private TeamLevelDailyRecordService teamLevelDailyRecordService;
|
| | | |
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
| | | if (boss != null) {
|
| | | teamUserLevelStatisticService.initData(boss.getId());
|
| | | }
|
| | | |
| | | // 重新统计粉丝等级数量
|
| | | teamLevelDailyRecordService.addStatisticByUid(boss.getId());
|
| | | }
|
| | | return Action.CommitMessage;
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.threeSaleSeparate.name())) {// 邀请关系脱离
|
| | |
| | | private List<CommonMsgItemVO> contentItems;
|
| | | private JumpDetailV2 jumpDetail;// 跳转详情
|
| | | private String params;// 跳转参数
|
| | | private Long id;
|
| | |
|
| | | public JumpDetailV2 getJumpDetail() {
|
| | | return jumpDetail;
|
| | |
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public UserMsgVO(String icon, String title, Date time, List<CommonMsgItemVO> contentItems) {
|
| | | public UserMsgVO(Long id, String icon, String title, Date time, List<CommonMsgItemVO> contentItems) {
|
| | | this.id = id;
|
| | | this.icon = icon;
|
| | | this.title = title;
|
| | | this.time = time;
|
| | |
| | | public void setType(String type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | | }
|