| | |
| | | package com.yeshi.fanli.controller.client;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.lang.reflect.InvocationTargetException;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.net.URLEncoder;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Date;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Controller;
|
| | |
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | 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.CollectionGoods;
|
| | | 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.HongBaoMessage;
|
| | | 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.ThreeSale;
|
| | | 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.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | 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.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.exception.user.UserCustomSettingsException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | 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.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.CollectionGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoMessageService;
|
| | | 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.AccountDetailsService;
|
| | | 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.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;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserActiveLogService;
|
| | | 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.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.WxDownService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.HongBaoUtil;
|
| | |
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.email.MailSenderUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.factory.HongBaoFactory;
|
| | | import com.yeshi.fanli.util.factory.OrderItemFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | | import com.yeshi.fanli.vo.user.UserSettingsVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v1/customer")
|
| | |
| | | private SystemService systemService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoMessageService hongBaoMessageService;
|
| | |
|
| | | @Resource
|
| | | private ShamUserService shamUserService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
|
| | |
|
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
| | | private OrderItemServcie orderItemServcie;
|
| | |
|
| | | @Resource
|
| | | private AccountDetailsService accountDetailsService;
|
| | |
|
| | | @Resource
|
| | | private AccountMessageService accountMessageService;
|
| | |
|
| | | @Resource
|
| | | private CollectionGoodsService collectionGoodsService;
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | |
|
| | | @Resource
|
| | | private CollectionGoodsV2Service collectionGoodsV2Service;
|
| | |
|
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoOrderService hongBaoOrderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | |
|
| | | @Resource
|
| | | private UserShareGoodsRecordService userShareGoodsRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserCustomSettingsService userCustomSettingsService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private AppVersionService appVersionService;
|
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | |
| | | BigDecimal fanliHB = user.getTotalHongBao();
|
| | | user.setTotalHongBao(fanliHB);
|
| | |
|
| | | UserInfo filterForClientUser = UserUtil.filterForClientUser(user);
|
| | |
|
| | | // 1.5.0 版本之后返回新的等级
|
| | | String version = acceptData.getVersion();
|
| | | if (version != null && version.trim().length() > 0) {
|
| | | int versionCode = Integer.parseInt(version);
|
| | | String platform = acceptData.getPlatform();
|
| | |
|
| | | AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, "1.5.0");
|
| | | if (versionInfo != null) {
|
| | | int versionCode150 = versionInfo.getVersionCode();
|
| | | if (versionCode >= versionCode150) {
|
| | | UserInfoExtraVO userInfoExtra = userInfoExtraService.getInfoExtraVOByUid(user.getId());
|
| | | if (userInfoExtra != null && userInfoExtra.getUserRank() != null) {
|
| | | String picture = userInfoExtra.getUserRank().getPicture();
|
| | | String icon = userInfoExtra.getUserRank().getIcon();
|
| | | filterForClientUser.setRankNamePicture(picture);
|
| | | filterForClientUser.setRankIcon(icon);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create()
|
| | | .toJson(UserUtil.filterForClientUser(user)));
|
| | | data.put("user",
|
| | | JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(filterForClientUser));
|
| | | data.put("first", 0);
|
| | | int spreadImgCount = spreadUserImgService.countUserSpreadImg(user.getId());
|
| | | long shareCount = userShareGoodsRecordService.countShareRecordByUid(user.getId());
|
| | |
|
| | | int showTiCheng = 1; // 不显示
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | | data.put("showTiCheng", false);
|
| | | else {
|
| | | data.put("showTiCheng", spreadImgCount + shareCount > 0);
|
| | | if (spreadImgCount + shareCount > 0) {
|
| | | showTiCheng = 0;
|
| | | }
|
| | | }
|
| | |
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | | data.put("inviteList", String.format("http://%s/%s/client/share/friends_new_online.html",
|
| | | Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
|
| | | else
|
| | | data.put("inviteList", configService.get("team_list"));
|
| | |
|
| | | // 界面状态
|
| | | UserSettingsVO mySettings = null;
|
| | | try {
|
| | | mySettings = userCustomSettingsService.getMySettings(user.getId());
|
| | | } catch (UserCustomSettingsException e) {
|
| | | mySettings = new UserSettingsVO();
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (mySettings.getCancelNotice() == null) {
|
| | | mySettings.setCancelNotice(0);
|
| | | }
|
| | | if (mySettings.getNoBonusCount() == null) {
|
| | | mySettings.setNoBonusCount(showTiCheng); // 根据showTiCheng来判断
|
| | | }
|
| | | if (mySettings.getNoNewsRedDot() == null) {
|
| | | mySettings.setNoNewsRedDot(0);
|
| | | }
|
| | | if (mySettings.getNoShareRecordAndStorage() == null) {
|
| | | mySettings.setNoShareRecordAndStorage(showTiCheng); // 根据showTiCheng来判断
|
| | | }
|
| | | if (mySettings.getNoInvitationBonus() == null) {
|
| | | mySettings.setNoInvitationBonus(0);
|
| | | }
|
| | |
|
| | | data.put("moduleState", mySettings);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | final UserInfo uuser = user;
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
| | | uuser.setLastLoginTime(java.lang.System.currentTimeMillis());
|
| | | userInfoService.updateLoginInfo(uuser);
|
| | | wxDownService.save(device);
|
| | | // 更新用户附加信息,老用户不存在的需要添加
|
| | | try {
|
| | | userInfoExtraService.updateUserRankByUid(uuser.getId());
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", user);
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | String maxError = "5";
|
| | | maxError = configService.get(PASSWORD_MAX_ERROR); // 当日输错密码最多次数
|
| | | PassWordErrorRecord record = passWordErrorRecordService.getRecord(uid);
|
| | | int max = Integer.parseInt(maxError);
|
| | | if (record.getCount() >= max) {
|
| | | data.put("error", "1"); // 达到最多限制
|
| | | } else {
|
| | | data.put("error", "0");
|
| | | }
|
| | | data.put("maxError", maxError);
|
| | |
|
| | | data.put("error", "0");
|
| | | data.put("maxError", 1);
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现的最小金额
|
| | | String maxMoney = configService.get(EXTRACT_MAX_MONEY); // 单笔提现的最大金额
|
| | | int maxDayCount = Integer.parseInt(configService.get("extract_count_day"));
|
| | |
| | | ExtractRecord extractRecord = extractRecordService.getExtractRecordByUid(uid);
|
| | | boolean canExtract = true;
|
| | | String errorMsg = "";
|
| | | if (extractRecord != null && extractRecord.getCount() + 1 >= maxDayCount) {
|
| | | if (extractRecord != null && extractRecord.getCount() + 1 > maxDayCount) {
|
| | | canExtract = false;
|
| | | errorMsg = String.format("每日最多提现%s次", maxDayCount + "");
|
| | | } else if (extractRecord != null
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("id", extract.getId());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
|
| | | @Override
|
| | | public void run() {
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("timeStamp", java.lang.System.currentTimeMillis());
|
| | | json.put("adminId", 4L);
|
| | | String sign = AESUtil.encrypt(json.toString(), Constant.ADMINH5_AESKEY);
|
| | | String url = "";
|
| | | try {
|
| | | url = String.format("%s?from=emailh5&sign=%s",
|
| | | Constant.systemCommonConfig.getExtractNotifyUrl(), URLEncoder.encode(sign, "UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | AdminUser adminUser = adminUserService.selectByPrimaryKey(4L);
|
| | | Config config = configService.getConfig("extract_code_email_from");
|
| | | String[] sts = config.getValue().split(",");
|
| | | String account = sts[0];
|
| | | String pwd = sts[1];
|
| | | String msg = "提现审核链接:" + url;
|
| | | boolean isS = MailSenderUtil.sendEmail(adminUser.getEmail(), account, pwd, "有新的提现审核", msg);
|
| | | }
|
| | | });
|
| | | return;
|
| | | } else if (etype == 1) {
|
| | | out.print(JsonUtil.loadFalseResult("已超过当日提现次数"));
|
| | |
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "] 打开红包[id=" + hid + "]成功!");
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getHongBaoMessages", method = RequestMethod.POST)
|
| | | public void getHongBaoMessages(AcceptData acceptData, PrintWriter out) {
|
| | | List<HongBaoMessage> list = shamUserService.getManyData();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", list);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping("findLostOrder")
|
| | | public void findLostOrder(AcceptData acceptData, LostOrder lostOrder, PrintWriter out) {
|
| | | boolean orderNum = true;
|
| | |
| | |
|
| | | @RequestMapping("findOrderItemList")
|
| | | public void findOrderItemList(AcceptData acceptData, long uid, int page, PrintWriter out) {
|
| | | List<OrderItem> list = orderItemServcie.findOrderItemList(uid, page);
|
| | | list.parallelStream().forEach(oi -> {
|
| | | oi.setDesc();
|
| | | });
|
| | | int count = orderItemServcie.getCount(uid);
|
| | | List<HongBaoOrder> list = hongBaoOrderService.listFanLiOrder(uid, page, Constant.PAGE_SIZE);
|
| | |
|
| | | List<OrderItem> orderList = new ArrayList<>();
|
| | | for (HongBaoOrder oi : list) {
|
| | | OrderItem orderItem = OrderItemFactory.create(oi);
|
| | | orderItem.setDesc();
|
| | | orderItem.setPicture(TbImgUtil.getTBSize220Img(orderItem.getPicture()));
|
| | | orderList.add(orderItem);
|
| | | }
|
| | | long count = hongBaoOrderService.countFanLiOrder(uid);
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().create();
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", gson.toJson(list));
|
| | | data.put("list", gson.toJson(orderList));
|
| | | data.put("count", count);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
| | | */
|
| | | @RequestMapping("getTiChengOrderList")
|
| | | public void getTiChengOrderList(AcceptData acceptData, long uid, int page, PrintWriter out) {
|
| | | List<HongBao> list = hongBaoService.getTiChengHongBaoList(uid, page);
|
| | | long count = hongBaoService.getTiChengHongBaoListCount(uid);
|
| | | List<HongBaoDTO> hongBaoDTOList = hongBaoV2Service.listJiangJinByUid(uid, page, Constant.PAGE_SIZE);
|
| | | List<HongBao> list = new ArrayList<>();
|
| | | if (hongBaoDTOList != null)
|
| | | for (HongBaoDTO dto : hongBaoDTOList) {
|
| | | list.add(HongBaoFactory.createHongBao(dto));
|
| | | }
|
| | | long count = hongBaoV2Service.countJiangJinByUid(uid);
|
| | | List<OrderItem> orderItemList = HongBaoUtil.convertToTiChengOrder(list);
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | JSONObject data = new JSONObject();
|
| | |
| | |
|
| | | @RequestMapping("collectionGoods")
|
| | | public void collectionGoods(AcceptData acceptData, long uid, long auctionId, int type, PrintWriter out) {
|
| | | CollectionGoods find = collectionGoodsService.findByUidAndAuctionId(uid, auctionId);
|
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, auctionId);
|
| | | if (type == 1) {
|
| | | if (find != null) {
|
| | | out.print(JsonUtil.loadFalseResult(""));
|
| | | return;
|
| | | }
|
| | | CollectionGoods cg = TaoBaoUtil.getCollectionGoods(auctionId, new UserInfo(uid));
|
| | | collectionGoodsService.save(cg);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | return;
|
| | | try {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | | collectionGoodsV2Service.addCollection(uid, taoBaoGoodsBrief);
|
| | | out.print(JsonUtil.loadTrueResult("收藏成功"));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "商品已下架"));
|
| | | } catch (CollectionGoodsException e1) {
|
| | | out.print(JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | }
|
| | | } else {
|
| | | if (find == null) {
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | return;
|
| | | } else {
|
| | | collectionGoodsService.delete(find);
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | return;
|
| | | try {
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, auctionId);
|
| | | out.print(JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | CollectionGoods find = collectionGoodsService.findByUidAndAuctionId(uid, auctionId);
|
| | | CollectionGoodsV2 find = collectionGoodsV2Service.findByUidAndAuctionId(uid, auctionId);
|
| | |
|
| | | if (find == null) {
|
| | | // 添加收藏
|
| | | CollectionGoods cg = TaoBaoUtil.getCollectionGoods(auctionId, new UserInfo(uid));
|
| | | collectionGoodsService.save(cg);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(1));
|
| | | try {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = redisManager.getTaoBaoGoodsBrief(auctionId);
|
| | | collectionGoodsV2Service.addCollection(uid, taoBaoGoodsBrief);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(1));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | JsonUtil.printMode(out, callback, (JsonUtil.loadFalseResult(1, "商品已下架")));
|
| | | } catch (CollectionGoodsException e1) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e1.getCode(), e1.getMsg()));
|
| | | }
|
| | | } else {
|
| | | // 取消收藏
|
| | | collectionGoodsService.delete(find);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(0));
|
| | | try {
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, auctionId);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("取消收藏成功"));
|
| | | } catch (CollectionGoodsException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @RequestMapping("collectionGoodsList")
|
| | | public void collectionGoodsList(AcceptData acceptData, long uid, int page, PrintWriter out) {
|
| | | List<CollectionGoods> coList = collectionGoodsService.findCollectionGoods(uid, page + 1);
|
| | | int count = collectionGoodsService.getCount(uid);
|
| | | JSONObject data = new JSONObject();
|
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | List<TaoBaoGoodsBriefExtra> list = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | coList.parallelStream().forEachOrdered(cg -> {
|
| | | TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.getTaoBaoGoodsBrief(cg);
|
| | | goodsBrief.setSalesCount(TaoBaoUtil.getSaleCount(goodsBrief.getBiz30day()));
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief, proportion,
|
| | | fcRate, "");
|
| | | taoBaoGoodsBriefExtra.setCreatetime(new Date(cg.getCreateTime()));
|
| | |
|
| | | list.add(taoBaoGoodsBriefExtra);
|
| | | });
|
| | | List<CollectionGoodsV2> collectionGoodsList = collectionGoodsV2Service.getCollectionGoodsList(uid, page + 1,
|
| | | Constant.PAGE_SIZE);
|
| | |
|
| | | List<TaoBaoGoodsBriefExtra> list = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | |
|
| | | long count = collectionGoodsV2Service.getCollectionGoodsCount(uid);
|
| | | JSONObject data = new JSONObject();
|
| | |
|
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = new ArrayList<TaoBaoGoodsBrief>();
|
| | | if (collectionGoodsList != null && collectionGoodsList.size() > 0) {
|
| | |
|
| | | BigDecimal proportion = hongBaoManageService.getFanLiRate();
|
| | |
|
| | | List<Long> listGid = new ArrayList<Long>();
|
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) {
|
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | | continue;
|
| | | }
|
| | | listGid.add(commonGoods.getGoodsId());
|
| | | }
|
| | |
|
| | | try {
|
| | | // API网络接口验证是否在售
|
| | | listTaoKeGoods = TaoKeApiUtil.getBatchGoodsInfo(listGid);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | for (CollectionGoodsV2 collectionGoodsV2 : collectionGoodsList) {
|
| | | CommonGoods commonGoods = collectionGoodsV2.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | int state = 1; // 默认停售
|
| | | Long goodsId = commonGoods.getGoodsId();
|
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) {
|
| | | Long auctionId = taoKeGoods.getAuctionId();
|
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) {
|
| | | state = 0; // 在售
|
| | | break;
|
| | | }
|
| | | }
|
| | | commonGoods.setState(state);
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.convert(commonGoods);
|
| | | goodsBrief.setSalesCount(TaoBaoUtil.getSaleCount(goodsBrief.getBiz30day()));
|
| | | TaoBaoGoodsBriefExtra taoBaoGoodsBriefExtra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(goodsBrief,
|
| | | proportion.toString(), "");
|
| | | taoBaoGoodsBriefExtra.setCreatetime(collectionGoodsV2.getCreateTime());
|
| | |
|
| | | list.add(taoBaoGoodsBriefExtra);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | GsonBuilder builder = new GsonBuilder().registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
| | | @Override
|
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
|
| | |
| | | } else {
|
| | | if (!StringUtil.isNullOrEmpty(ids)) {
|
| | | Arrays.asList(ids.split(",")).parallelStream().forEach(auctionIdStr -> {
|
| | | collectionGoodsService.delete(Long.parseLong(auctionIdStr), uid);
|
| | | try {
|
| | | collectionGoodsV2Service.cancelCollectionByAuctionId(uid, Long.parseLong(auctionIdStr));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | @RequestMapping("clearConllectionGoods")
|
| | | public void clearConllectionGoods(AcceptData acceptData, long uid, PrintWriter out) {
|
| | | collectionGoodsService.clear(uid);
|
| | | try {
|
| | | collectionGoodsV2Service.cancelCollectionByUid(uid);
|
| | | } catch (CollectionGoodsException e) {
|
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMessage()));
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("删除成功"));
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @RequestMapping("findAccountDetailsList")
|
| | | public void findAccountDetailsList(AcceptData acceptData, long uid, int page, PrintWriter out) {
|
| | | List<AccountDetails> list = accountDetailsService.findAccountDetailsList(uid, page);
|
| | | int count = accountDetailsService.getCount(uid);
|
| | | List<UserMoneyDetail> detailList = userMoneyDetailService.listByUidWithState(uid, page, Constant.PAGE_SIZE);
|
| | | List<AccountDetails> list = new ArrayList<>();
|
| | | for (UserMoneyDetail detail : detailList)
|
| | | list.add(AccountDetailsFactory.create(detail));
|
| | | long count = userMoneyDetailService.countByUidWithState(uid);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("list", GsonUtil.toJsonExpose(list));
|
| | | data.put("count", count);
|
| | |
| | | }
|
| | |
|
| | | @RequestMapping("findAccountDetailsListV2")
|
| | | public void findAccountDetailsListNew(AcceptData acceptData, long uid, int page, PrintWriter out) {
|
| | | List<AccountDetails> list = accountDetailsService.findAccountDetailsListWithState(uid, page);
|
| | | long count = accountDetailsService.getCountWithState(uid);
|
| | | public void findAccountDetailsListNew(AcceptData acceptData, Long uid, int page, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "UID为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<UserMoneyDetail> detailList = userMoneyDetailService.listByUidWithState(uid, page, Constant.PAGE_SIZE);
|
| | |
|
| | | List<AccountDetails> list = new ArrayList<>();
|
| | | for (UserMoneyDetail detail : detailList)
|
| | | list.add(AccountDetailsFactory.create(detail));
|
| | |
|
| | | long count = userMoneyDetailService.countByUidWithState(uid);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | | for (AccountDetails ad : list) {
|
| | |
| | | .loadTrueResult(String.format("%s?id=" + id, Constant.systemCommonConfig.getAppShareInfoUrl())));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 用户队员列表查询 1.4.1
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMyTeam")
|
| | | @RequestMapping(value = "getMyTeam", method = RequestMethod.POST)
|
| | | public void getMyTeam(AcceptData acceptData, long page, long uid, long type, PrintWriter out) {
|
| | | |
| | |
|
| | | 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);
|
| | | } else if (type == 3) {
|
| | | |
| | | }
|
| | |
|
| | | // 安卓系统返回所有数据
|
| | | 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) {
|
| | | resultData.put("nickName", boss.getNickName());
|
| | | resultData.put("portrait", boss.getPortrait());
|
| | | bossData.put("nickName", boss.getNickName());
|
| | | bossData.put("portrait", boss.getPortrait());
|
| | | }
|
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | Long createTime = threeSale.getCreateTime();
|
| | | Date inviteTime = new Date(createTime);
|
| | | resultData.put("inviteTime", "邀请时间:" + sdf.format(inviteTime));
|
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | 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);
|
| | | }
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 用户队员统计 1.4.1
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countMyTeam")
|
| | | @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 = 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;
|
| | | 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);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | | |
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | 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 resultData = new JSONObject();
|
| | | |
| | | resultData.put("firstTeam", firstTeam);
|
| | | resultData.put("firstTeamTotal", firstTeamTotal);
|
| | | resultData.put("secondTeam", secondTeam);
|
| | | resultData.put("secondTeamTotal", secondTeamTotal);
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 用户队员信息保存 1.4.1
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param inviteId
|
| | | * 邀请id
|
| | | * @param nickname
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setextrainfo", method = RequestMethod.POST)
|
| | | public void setExtraInfo(AcceptData acceptData, long uid, long inviteId, String memoName, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | List<ThreeSale> listThreeSale = threeSaleSerivce.listbyIdAndBossId(inviteId, uid, null);
|
| | | if (listThreeSale == null || listThreeSale.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("该记录不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo worker = listThreeSale.get(0).getWorker();
|
| | | if (worker == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该记录不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<ThreeSaleExtraInfo> list = threeSaleExtraInfoSerivce.listbyBossIdAndWorkerId(uid, worker.getId());
|
| | | if (list == null || list.size() == 0) {
|
| | |
|
| | | ThreeSaleExtraInfo extraInfo = new ThreeSaleExtraInfo();
|
| | | extraInfo.setWorker(worker);
|
| | | extraInfo.setNickname(memoName);
|
| | | extraInfo.setCreateTime(new Date());
|
| | | extraInfo.setUpdateTime(new Date());
|
| | |
|
| | | UserInfo boss = new UserInfo(uid);
|
| | | extraInfo.setBoss(boss);
|
| | |
|
| | | threeSaleExtraInfoSerivce.insert(extraInfo);
|
| | |
|
| | | } else {
|
| | | ThreeSaleExtraInfo extraInfo = list.get(0);
|
| | | extraInfo.setNickname(memoName);
|
| | | extraInfo.setUpdateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.updateByPrimaryKey(extraInfo);
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("保存失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除队员关系
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param inviteId
|
| | | * 邀请id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "removethreesale", method = RequestMethod.POST)
|
| | | public void removethreesale(AcceptData acceptData, long uid, long inviteId, PrintWriter out) {
|
| | | try {
|
| | | List<ThreeSale> listThreeSale = threeSaleSerivce.listbyIdAndBossId(inviteId, uid, 1);
|
| | | if (listThreeSale == null || listThreeSale.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("操作数据无效"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo worker = listThreeSale.get(0).getWorker();
|
| | | if (worker == null) {
|
| | | out.print(JsonUtil.loadFalseResult("操作数据无效"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 删除关系
|
| | | threeSaleSerivce.deleteByPrimaryKey(inviteId);
|
| | | // 删除备注
|
| | | threeSaleExtraInfoSerivce.deleteByBossIdAndWorkerId(uid, worker.getId());
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("删除成功"));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置界面开关状态
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param params
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setModuleState", method = RequestMethod.POST)
|
| | | public void setModuleState(AcceptData acceptData, Long uid, String params, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | if (params == null || params.trim().length() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("传递参数为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject json = JSONObject.fromObject(params);
|
| | | Iterator<String> iterator = json.keys();
|
| | | while (iterator.hasNext()) {
|
| | | String type = (String) iterator.next();
|
| | | int state = json.getInt(type);
|
| | | userCustomSettingsService.saveModuleState(uid, type, state);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult("设置成功"));
|
| | |
|
| | | } catch (UserCustomSettingsException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("设置失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取等级信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getRankInfo", method = RequestMethod.POST)
|
| | | public void getRankInfo(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | UserInfoExtraVO rankInfo = userInfoExtraService.getRankInfo(uid);
|
| | | GsonBuilder gsonBuilder = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder());
|
| | | gsonBuilder.excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy.MM.dd").create();
|
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | | resultData.put("rankInfo", gson.toJson(rankInfo));
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | |
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取等级信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getUserConfig", method = RequestMethod.POST)
|
| | | public void getUserConfig(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | String inviteCode = userInfoExtraService.getUserInviteCode(uid);
|
| | |
|
| | | JSONObject inviteData = new JSONObject();
|
| | | if (inviteCode == null || inviteCode.trim().length() == 0) {
|
| | | // 无邀请码
|
| | | inviteData.put("content", "邀请激活");
|
| | | inviteData.put("link", configService.get("invite_activation_url"));
|
| | | } else {
|
| | | // 已有邀请码
|
| | | inviteData.put("content", "邀请码");
|
| | | inviteData.put("link", configService.get("invite_activation_success_url"));
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("invite", inviteData);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|