| | |
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
|
| | | import com.yeshi.fanli.service.manger.user.UserLevelManager;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.HongBaoUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.annotation.UserActive;
|
| | |
| | | return;
|
| | | }
|
| | | // 获取用户信息
|
| | | UserInfo user = userInfoService.getUserByLoginTypeAndOpenId(loginType, openid, appid);
|
| | | UserInfo user = userInfoService.getUserByLoginTypeAndOpenId(loginType, openid, SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | // 判断获取的用户信息是否为空,如果不为空就做的事就又多了
|
| | | if (user != null) {// 数据库中已经存在该用户
|
| | | outUserInfo(acceptData, out, remotIP, user, acceptData.getDevice());
|
| | |
| | | }
|
| | | form.setLastLoginIp(remotIP);
|
| | | form.setLastLoginTime(java.lang.System.currentTimeMillis());
|
| | | form.setSystem(system);
|
| | | requst.getSession().setAttribute("newUser", form);
|
| | | out.append(JsonUtil.loadTrueResult(2, form));
|
| | | return;
|
| | |
| | | if (Constant.NEWUSER.equals(create)) { // 创建
|
| | | UserInfo user;
|
| | | synchronized (UserInfo.class) {
|
| | | user = userInfoService.addUser(newUser, appid);
|
| | | user = userInfoService.addUser(newUser, SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | }
|
| | | if (user != null) {
|
| | |
|
| | |
| | | form.setTbName(form.getNickName());
|
| | | form.setTbPic(form.getPortrait());
|
| | | }
|
| | | form.setSystem(system);
|
| | | requst.getSession().setAttribute("mainUser", form);
|
| | | String openid = formLoginType == 1 ? form.getOpenid() : form.getWxUnionId();
|
| | | // 获取主账户用户信息
|
| | | UserInfo find = userInfoService.getUserByLoginTypeAndOpenId(formLoginType, openid, appid);
|
| | | UserInfo find = userInfoService.getUserByLoginTypeAndOpenId(formLoginType, openid, SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | if (find != null) {
|
| | | // 主账户不为空就进行绑定操作
|
| | | bind(find, newUser);
|
| | |
| | | }
|
| | | } else {// create=2 ,mainUser != null 创建并绑定!
|
| | | bind(mainUser, newUser);
|
| | | mainUser = userInfoService.addUser(mainUser, appid);
|
| | | mainUser = userInfoService.addUser(mainUser, SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | outUserInfo(acceptData, out, remotIP, mainUser, acceptData.getDevice());
|
| | | requst.getSession().removeAttribute("newUser");
|
| | | requst.getSession().removeAttribute("mainUser");
|
| | |
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | | form.setSystem(system);
|
| | | String appid = system.getAppid();
|
| | | UserInfo user = userInfoService.getUserByLoginTypeAndOpenId(1, form.getOpenid(), appid);
|
| | | UserInfo user = userInfoService.getUserByLoginTypeAndOpenId(1, form.getOpenid(), SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | if (user == null) {
|
| | | // 创建用户
|
| | | userInfoService.addUser(form, appid);
|
| | | user = userInfoService.getUserByLoginTypeAndOpenId(1, form.getOpenid(), appid);
|
| | | userInfoService.addUser(form, SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | user = userInfoService.getUserByLoginTypeAndOpenId(1, form.getOpenid(), SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | }
|
| | |
|
| | | // 返回用户信息
|
| | |
| | | int versionCode = Integer.parseInt(version);
|
| | | String platform = acceptData.getPlatform();
|
| | |
|
| | | AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, "1.5.0");
|
| | | AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, "1.5.0",acceptData.getSystem());
|
| | | if (versionInfo != null) {
|
| | | int versionCode150 = versionInfo.getVersionCode();
|
| | | if (versionCode >= versionCode150) {
|
| | |
| | |
|
| | | int showTiCheng = 1; // 不显示
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()))
|
| | | data.put("showTiCheng", false);
|
| | | else {
|
| | | data.put("showTiCheng", spreadImgCount + shareCount > 0);
|
| | |
| | | }
|
| | |
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform())
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion())))
|
| | | && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()),acceptData.getSystem()))
|
| | | 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(ConfigKeyEnum.teamList.getKey()));
|
| | | data.put("inviteList", configService.getValue(ConfigKeyEnum.teamList.getKey(),acceptData.getSystem()));
|
| | |
|
| | | // 界面状态
|
| | | UserSettingsVO mySettings = null;
|
| | |
| | | String.format("绑定微信:头像为 %s \n 昵称为 %s", weiXinUser.getHeadimgurl(), weiXinUser.getNickname()));
|
| | |
|
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | UserInfo userInfo = userInfoService.getUserByLoginTypeAndOpenId(loginType, wxUnionId, Constant.APPID);
|
| | | UserInfo userInfo = userInfoService.getUserByLoginTypeAndOpenId(loginType, wxUnionId, SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | if (userInfo != null) {
|
| | | out.print(JsonUtil.loadFalseResult("绑定失败,该微信账户已存在!"));
|
| | | return;
|
| | |
| | | } else { // 绑定淘宝
|
| | | LogHelper.test(String.format("绑定淘宝:头像为 %s \n 昵称为 %s", form.getPortrait(), form.getTbName()));
|
| | | UserInfo userInfo = userInfoService.getUserByLoginTypeAndOpenId(loginType, form.getOpenid(),
|
| | | Constant.APPID);
|
| | | SystemInfoUtil.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | if (userInfo != null) {
|
| | | out.print(JsonUtil.loadFalseResult("绑定失败,该淘宝账户已存在!"));
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * @param data
|
| | | * @param uid
|
| | | * 用户ID
|
| | | * @param type
|
| | | * 需要解绑的账户类型
|
| | | * @param uid 用户ID
|
| | | * @param type 需要解绑的账户类型
|
| | | */
|
| | | @RequestMapping("unBindUserInfo")
|
| | | public void unBindUserInfo(AcceptData data, long uid, int type, PrintWriter out) {
|
| | |
| | |
|
| | | data.put("error", "0");
|
| | | data.put("maxError", 1);
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现的最小金额
|
| | | String maxMoney = configService.get(EXTRACT_MAX_MONEY); // 单笔提现的最小金额
|
| | | String maxDayMoney = configService.get(ConfigKeyEnum.extractMoneyDay.getKey()); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get(ConfigKeyEnum.extractDayCount.getKey()));
|
| | | String minMoney = configService.getValue(EXTRACT_MIN_MONEY,acceptData.getSystem()); // 单笔提现的最小金额
|
| | | String maxMoney = configService.getValue(EXTRACT_MAX_MONEY,acceptData.getSystem()); // 单笔提现的最小金额
|
| | | String maxDayMoney = configService.getValue(ConfigKeyEnum.extractMoneyDay.getKey(),acceptData.getSystem()); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.getValue(ConfigKeyEnum.extractDayCount.getKey(),acceptData.getSystem()));
|
| | | ExtractRecord extractRecord = extractRecordService.getExtractRecordByUid(uid);
|
| | | boolean canExtract = true;
|
| | | String errorMsg = "";
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现的最小金额
|
| | | String maxDayMoney = configService.get(ConfigKeyEnum.extractMoneyDay.getKey()); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.get(ConfigKeyEnum.extractDayCount.getKey()));
|
| | | String minMoney = configService.getValue(EXTRACT_MIN_MONEY,acceptData.getSystem()); // 单笔提现的最小金额
|
| | | String maxDayMoney = configService.getValue(ConfigKeyEnum.extractMoneyDay.getKey(),acceptData.getSystem()); // 每日最大提现金额
|
| | | int maxDayCount = Integer.parseInt(configService.getValue(ConfigKeyEnum.extractDayCount.getKey(),acceptData.getSystem()));
|
| | | ExtractRecord extractRecord = extractRecordService.getExtractRecordByUid(uid);
|
| | | boolean canExtract = true;
|
| | | String errorMsg = "";
|
| | |
| | | * 添加用户提现账号
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param account
|
| | | * 账号
|
| | | * @param name
|
| | | * 真实名字
|
| | | * @param type
|
| | | * 账号类型:1.支付宝 2.微信
|
| | | * @param uid 用户id
|
| | | * @param account 账号
|
| | | * @param name 真实名字
|
| | | * @param type 账号类型:1.支付宝 2.微信
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "addbindingaccount", method = RequestMethod.POST)
|
| | |
| | | * 删除用户提现账号
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * 用户id
|
| | | * @param type
|
| | | * 账号类型
|
| | | * @param uid 用户id
|
| | | * @param type 账号类型
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deletebindingaccount", method = RequestMethod.POST)
|
| | |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param money
|
| | | * @param vcode
|
| | | * 手机验证码
|
| | | * @param vcode 手机验证码
|
| | | * @param request
|
| | | * @param type
|
| | | * @param out
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String minMoney = configService.get(EXTRACT_MIN_MONEY); // 单笔提现最小金额
|
| | | String minMoney = configService.getValue(EXTRACT_MIN_MONEY,acceptData.getSystem()); // 单笔提现最小金额
|
| | |
|
| | | if (money.compareTo(new BigDecimal("0.1")) < 0) { // 转帐到支付宝的最小金额
|
| | | out.print(JsonUtil.loadFalseResult("单笔提现金额需要大于:" + 0.1 + "元"));
|
| | |
| | | out.print(JsonUtil.loadFalseResult("单笔提现金额需要大于:" + minMoney + "元"));
|
| | | return;
|
| | | }
|
| | | String maxMoney = configService.get(EXTRACT_MAX_MONEY); // 单笔提现最大金额
|
| | | String maxMoney = configService.getValue(EXTRACT_MAX_MONEY,acceptData.getSystem()); // 单笔提现最大金额
|
| | | if (new BigDecimal(maxMoney).compareTo(money) < 0) { // 后台设置的单笔转账的最大金额
|
| | | out.print(JsonUtil.loadFalseResult("单笔提现金额多为:" + maxMoney + "元"));
|
| | | return;
|
| | |
| | | }
|
| | |
|
| | | long[] targetUids = new long[] { 3L, 4L ,5L};
|
| | | Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey());
|
| | | Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey(),acceptData.getSystem());
|
| | | String[] sts = config.getValue().split(",");
|
| | | String account = sts[0];
|
| | | String pwd = sts[1];
|
| | |
| | | * 用户队员列表查询 1.4.1
|
| | | *
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param page
|
| | | * @param uid
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMyTeam", method = RequestMethod.POST)
|
| | |
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | String helpLink = configService.get(ConfigKeyEnum.teamHelpUrl.getKey());
|
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(),acceptData.getSystem());
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | |
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem()));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | |
| | | * 用户队员列表查询 1.5.3查询有效队员
|
| | | *
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMyTeamNew", method = RequestMethod.POST)
|
| | |
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime));
|
| | | }
|
| | |
|
| | | String helpLink = configService.get(ConfigKeyEnum.teamHelpUrl.getKey());
|
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(),acceptData.getSystem());
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | |
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem()));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | |
| | | * 用户队员统计 1.4.1
|
| | | *
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countMyTeam", method = RequestMethod.POST)
|
| | |
| | |
|
| | | JSONObject resultData = new JSONObject();
|
| | |
|
| | | String helpLink = configService.get(ConfigKeyEnum.teamHelpUrl.getKey());
|
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(),acceptData.getSystem());
|
| | | if (helpLink == null) {
|
| | | helpLink = "";
|
| | | }
|
| | |
| | | hasCode = true; // 已有邀请码
|
| | | } else {
|
| | | // 邀请激活链接
|
| | | resultData.put("activationlink", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem()));
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | |
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param inviteId
|
| | | * 邀请id
|
| | | * @param nickname
|
| | | * @param inviteId 邀请id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "setextrainfo", method = RequestMethod.POST)
|
| | |
| | | if (inviteCode == null || inviteCode.trim().length() == 0) {
|
| | | // 无邀请码
|
| | | inviteData.put("content", "邀请激活");
|
| | | inviteData.put("link", configService.get(ConfigKeyEnum.inviteActivationUrl.getKey()));
|
| | | inviteData.put("link", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem()));
|
| | | } else {
|
| | | // 已有邀请码
|
| | | inviteData.put("content", "邀请码");
|
| | | inviteData.put("link", configService.get(ConfigKeyEnum.inviteActivationSuccessUrl.getKey()));
|
| | | inviteData.put("link", configService.getValue(ConfigKeyEnum.inviteActivationSuccessUrl.getKey(),acceptData.getSystem()));
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | * 获取用户信息
|
| | | *
|
| | | * @param acceptData
|
| | | * @param form
|
| | | * @param requst
|
| | | * @param out
|
| | | */
|
| | |
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | data.put("fansCountLink", configService.get(ConfigKeyEnum.teamStatisticsLink.getKey()));
|
| | | data.put("fansCountLink", configService.getValue(ConfigKeyEnum.teamStatisticsLink.getKey(),acceptData.getSystem()));
|
| | | // 会员动作
|
| | | // 查询是否为超级会员,是的话返回超会管理链接
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(uid);
|
| | |
| | | * 用户更换头像
|
| | | *
|
| | | * @param acceptData
|
| | | * @param fileList
|
| | | * @param uid
|
| | | * @param request
|
| | | * @param out
|