| | |
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dto.HongBao;
|
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | import com.yeshi.fanli.dto.money.AccountDetails;
|
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountDetails;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.MoneyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.OrderItem;
|
| | | import com.yeshi.fanli.entity.bus.user.PassWordErrorRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.SMSHistory;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | |
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.exception.BindingAccountException;
|
| | | import com.yeshi.fanli.exception.ObjectStateException;
|
| | | import com.yeshi.fanli.exception.goods.CollectionGoodsException;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderItemServcie;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.MoneyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.PassWordErrorRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | |
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoService hongBaoService;
|
| | |
|
| | | @Resource
|
| | | private MoneyRecordService moneyRecordService;
|
| | |
|
| | | @Resource
|
| | | private BindingAccountService bindingAccountService;
|
| | |
|
| | | @Resource
|
| | |
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private SystemService systemService;
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private ShamUserService shamUserService;
|
| | |
| | |
|
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
|
| | | @Resource
|
| | | private OrderItemServcie orderItemServcie;
|
| | |
|
| | | @Resource
|
| | | private AccountMessageService accountMessageService;
|
| | |
| | | @Resource
|
| | | private AppVersionService appVersionService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | | private static final String EXTRACT_MAX_MONEY = "extract_max_money";
|
| | |
| | | // }
|
| | | // });
|
| | | if (find != null) {
|
| | | if (find.getState() != UserInfo.STATE_NORMAL) {
|
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER,
|
| | | Constant.FORBIDDEN_USER_REASON_DESC));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 邀请关系生效
|
| | | threeSaleSerivce.effective(find);
|
| | | // 重新计算用户等级
|
| | |
| | | }
|
| | | }
|
| | | // 不是用ID的登陆的事就多了
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | }
|
| | | }
|
| | | // 不是用ID的登陆的事就多了
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | private void outUserInfo(AcceptData acceptData, PrintWriter out, String remotIP, UserInfo user, String device) {
|
| | | BigDecimal MyTotalMoney = hongBaoService.getMyTotalHongBaoByUid(user.getId());
|
| | | user.setTotalHongBao(MyTotalMoney);
|
| | | BigDecimal unOpenmoney = hongBaoService.getUnOpenHongBaoByUid(user.getId());
|
| | | BigDecimal canOpenMoney = hongBaoService.getCanOpenHongBaoByUid(user.getId());
|
| | | user.setTotalHongBao(new BigDecimal(0));
|
| | | BigDecimal unOpenmoney = new BigDecimal(0);
|
| | | BigDecimal canOpenMoney = new BigDecimal(0);
|
| | | user.setNoOpenHongBao(unOpenmoney);
|
| | | user.setCanOpenHongBao(canOpenMoney);
|
| | |
|
| | |
| | |
|
| | | data.put("moduleState", mySettings);
|
| | |
|
| | | int welfareCenterNews = 0;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(user.getId());
|
| | | if (userInfoExtra != null && userInfoExtra.getCouponNews() != null) {
|
| | | welfareCenterNews = userInfoExtra.getCouponNews();
|
| | | }
|
| | | data.put("welfareCenterNews", welfareCenterNews);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | final UserInfo uuser = user;
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | |
|
| | | try {
|
| | | // 获取邀请码:若无邀请码且存在有效的队员关系 则自动生成邀请码
|
| | | userInfoExtraService.getUserInviteCode(uuser.getId());
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | LogHelper.userInfo(GsonUtil.toJsonExpose(uuser));
|
| | | uuser.setLastLoginIp(remotIP);
|
| | | uuser.setLastLoginTime(java.lang.System.currentTimeMillis());
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 获取提现记录
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param page
|
| | | * 页数(从0开始)
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getmoneyrecord", method = RequestMethod.POST)
|
| | | public void getMoneyRecord(AcceptData acceptData, long uid, int page, PrintWriter out) {
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | if (page < 0) {
|
| | | page = 0;
|
| | | }
|
| | |
|
| | | List<MoneyRecord> moneyRecordList = moneyRecordService.getMoneyRecord(uid, page);
|
| | | int count = moneyRecordService.getCount(uid);
|
| | | JSONObject data = new JSONObject();
|
| | | if (moneyRecordList == null || moneyRecordList.size() == 0) {
|
| | | data.put("count", 0);
|
| | | data.put("moneyRecordList", new ArrayList());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | data.put("count", count);
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | data.put("moneyRecordList", gson.toJson(moneyRecordList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取当前用户红包
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param out
|
| | | * @throws ObjectStateException
|
| | | */
|
| | | @RequestMapping(value = "gethongbao", method = RequestMethod.POST)
|
| | | public void getHongBao(AcceptData acceptData, long uid, PrintWriter out) {
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | JSONObject data = new JSONObject();
|
| | | if (user == null) {
|
| | | data.put("count", 0);
|
| | | data.put("hongBaoList", new ArrayList());
|
| | | data.put("error", "用户不存在");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | List<HongBaoExtra> hongBaoList = hongBaoService.getHongBao(uid);
|
| | |
|
| | | if (hongBaoList.size() == 0) {
|
| | | data.put("count", 0);
|
| | | data.put("hongBaoList", hongBaoList);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | data.put("count", hongBaoList.size());
|
| | | data.put("hongBaoList", GsonUtil.toJsonExpose(hongBaoList));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置提现密码
|
| | | * |
| | | * @param acceptData
|
| | | * @param payPassword
|
| | | * 提现密码(要经过md5加密)
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setpaypassword", method = RequestMethod.POST)
|
| | | public void setPayPassword(AcceptData acceptData, String payPassword, long uid, PrintWriter out) {
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | user.setPayPassword(payPassword);
|
| | | userInfoService.update(user);
|
| | | out.print(JsonUtil.loadTrueResult("设置成功"));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取用户提现账号
|
| | | *
|
| | | * @param acceptData
|
| | |
| | | }
|
| | |
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现的最小金额
|
| | | String maxMoney = configService.get(EXTRACT_MAX_MONEY); // 单笔提现的最大金额
|
| | | String maxDayMoney = configService.get("extract_money_day"); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get("extract_count_day"));
|
| | | ExtractRecord extractRecord = extractRecordService.getExtractRecordByUid(uid);
|
| | | boolean canExtract = true;
|
| | |
| | | canExtract = false;
|
| | | errorMsg = String.format("每日最多提现%s次", maxDayCount + "");
|
| | | } else if (extractRecord != null
|
| | | && extractRecord.getMoney().add(money).compareTo(new BigDecimal(maxMoney)) > 0) {
|
| | | && extractRecord.getMoney().add(money).compareTo(new BigDecimal(maxDayMoney)) > 0) {
|
| | | canExtract = false;
|
| | | errorMsg = String.format("每日最多提现%s元", maxMoney);
|
| | | errorMsg = String.format("每日最多提现%s元", maxDayMoney);
|
| | | } else if (new BigDecimal(minMoney).compareTo(money) > 0) {
|
| | | canExtract = false;
|
| | | errorMsg = String.format("每次最低提现%s元", minMoney);
|
| | |
| | | out.print(JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | LogHelper.userInfo("提现时,不存在该系统");
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | |
| | | HttpServletRequest request, int type, PrintWriter out) {
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | | if (user == null) {
|
| | | user = userInfoService.getUserByIdWithMybatis(uid);
|
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
|
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
|
| | | return;
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | LogHelper.userInfo("提现时,不存在该系统");
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "openhongbao")
|
| | | public void openHongBao(AcceptData acceptData, long hid, HttpServletRequest request, PrintWriter out) {
|
| | | String ip = IPUtil.getRemotIP(request);
|
| | | HongBaoExtra hbx = hongBaoService.open(hid, ip);
|
| | | if (hbx == null) {
|
| | | out.print(JsonUtil.loadFalseResult("红包异常"));
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "] 打开红包[id=" + hid + "]失败!");
|
| | | return;
|
| | | }
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("hongBao", GsonUtil.toJsonExpose(hbx));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "] 打开红包[id=" + hid + "]成功!");
|
| | | }
|
| | |
|
| | | @RequestMapping("findLostOrder")
|
| | | public void findLostOrder(AcceptData acceptData, LostOrder lostOrder, PrintWriter out) {
|
| | | boolean orderNum = true;
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", gson.toJson(orderItemList));
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping("getOrderItem")
|
| | | public void getOrderItem(AcceptData acceptData, long id, PrintWriter out) {
|
| | | OrderItem orderItem = orderItemServcie.getOne(id);
|
| | | if (orderItem == null) {
|
| | | out.print(JsonUtil.loadFalseResult("不存在该订单"));
|
| | | return;
|
| | | }
|
| | | orderItem.setDesc();
|
| | | JSONObject data = new JSONObject();
|
| | | GsonBuilder gsonBuilder = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder());
|
| | | Gson gson = gsonBuilder.excludeFieldsWithoutExposeAnnotation().create();
|
| | | data.put("orderItem", gson.toJson(orderItem));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | @RequestMapping(value = "getMyTeam", method = RequestMethod.POST)
|
| | | public void getMyTeam(AcceptData acceptData, long page, long uid, long type, PrintWriter out) {
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | | try {
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | | if (type == 1) {
|
| | | resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
|
| | | } else if (type == 2) {
|
| | | resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
|
| | | JSONObject resultData = new JSONObject();
|
| | | if (type == 1) {
|
| | | resultData = threeSaleSerivce.getMyFirstTeam((page - 1) * pageSize, pageSize, uid);
|
| | | } else if (type == 2) {
|
| | | resultData = threeSaleSerivce.getMySecondTeam((page - 1) * pageSize, pageSize, uid);
|
| | | }
|
| | |
|
| | | // 安卓系统返回所有数据
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
|
| | |
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
|
| | | long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
|
| | |
|
| | | JSONObject bossData = null;
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null) {
|
| | | bossData = new JSONObject();
|
| | | UserInfo boss = threeSale.getBoss();
|
| | | if (boss != null) {
|
| | | bossData.put("nickName", boss.getNickName());
|
| | | bossData.put("portrait", boss.getPortrait());
|
| | | }
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | Long createTime = threeSale.getCreateTime();
|
| | | Date inviteTime = new Date(createTime);
|
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | String helpLink = configService.get("team_help_url");
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | |
|
| | | boolean hasCode = false;
|
| | | String inviteCode = userInfoExtraService.getUserInviteCode(uid);
|
| | | if (inviteCode != null && inviteCode.trim().length() > 0) {
|
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get("invite_activation_url"));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | | resultData.put("helpLink", helpLink);
|
| | | resultData.put("firstTeam", firstTeam);
|
| | | resultData.put("firstTeamTotal", firstTeamTotal);
|
| | | resultData.put("secondTeam", secondTeam);
|
| | | resultData.put("secondTeamTotal", secondTeamTotal);
|
| | | resultData.put("boss", bossData);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 安卓系统返回所有数据
|
| | | String platform = acceptData.getPlatform();
|
| | | if ("android".equalsIgnoreCase(platform)) {
|
| | | }
|
| | |
|
| | | /**
|
| | | * 用户队员统计 1.4.1
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
|
| | | public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
|
| | | try {
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
|
| | |
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
|
| | | long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
|
| | |
|
| | | JSONObject bossData = null;
|
| | | JSONObject bossData = new JSONObject();
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null) {
|
| | | bossData = new JSONObject();
|
| | | UserInfo boss = threeSale.getBoss();
|
| | | if (boss != null) {
|
| | | bossData.put("nickName", boss.getNickName());
|
| | |
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | |
|
| | | String helpLink = configService.get("team_help_url");
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | |
| | | resultData.put("secondTeam", secondTeam);
|
| | | resultData.put("secondTeamTotal", secondTeamTotal);
|
| | | resultData.put("boss", bossData);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 用户队员统计 1.4.1
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
|
| | | public void countMyTeam(AcceptData acceptData, long uid, PrintWriter out) {
|
| | |
|
| | | long firstTeam = threeSaleSerivce.countFirstTeam(uid, 1);
|
| | | long firstTeamTotal = threeSaleSerivce.countFirstTeam(uid, null);
|
| | |
|
| | | long secondTeam = threeSaleSerivce.countSecondTeam(uid, 1);
|
| | | long secondTeamTotal = threeSaleSerivce.countSecondTeam(uid, null);
|
| | | JSONObject bossData = new JSONObject();
|
| | | ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
|
| | | if (threeSale != null) {
|
| | | UserInfo boss = threeSale.getBoss();
|
| | | if (boss != null) {
|
| | | bossData.put("nickName", boss.getNickName());
|
| | | bossData.put("portrait", boss.getPortrait());
|
| | | }
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | Long createTime = threeSale.getCreateTime();
|
| | | Date inviteTime = new Date(createTime);
|
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | |
|
| | | String helpLink = configService.get("team_help_url");
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | | resultData.put("helpLink", helpLink);
|
| | | resultData.put("firstTeam", firstTeam);
|
| | | resultData.put("firstTeamTotal", firstTeamTotal);
|
| | | resultData.put("secondTeam", secondTeam);
|
| | | resultData.put("secondTeamTotal", secondTeamTotal);
|
| | | resultData.put("boss", bossData);
|
| | | |
| | | |
| | | boolean hasCode = false;
|
| | | try {
|
| | | boolean hasCode = false;
|
| | | String inviteCode = userInfoExtraService.getUserInviteCode(uid);
|
| | | if (inviteCode != null && inviteCode.trim().length() > 0) {
|
| | | hasCode = true; // 已有邀请码
|
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get("invite_activation_url"));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | |
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | | }
|
| | |
|
| | | /**
|