| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.yeshi.fanli.entity.SystemFunction; |
| | | import com.yeshi.fanli.entity.SystemPIDInfo; |
| | | import com.yeshi.fanli.entity.bus.user.*; |
| | | import com.yeshi.fanli.exception.user.*; |
| | | import com.yeshi.fanli.service.inter.pdd.PDDAuthService; |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; |
| | | import com.yeshi.fanli.service.manger.PIDManager; |
| | | import com.yeshi.fanli.util.*; |
| | | import com.yeshi.fanli.util.GsonUtil; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO; |
| | | import com.yeshi.fanli.entity.AppVersionInfo; |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage; |
| | | import com.yeshi.fanli.entity.bus.user.BindRemind; |
| | | 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.LostOrder; |
| | | import com.yeshi.fanli.entity.bus.user.PreviewInfo.PreviewEnum; |
| | | 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.UserInfoExtra; |
| | | import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum; |
| | | import com.yeshi.fanli.entity.bus.user.vip.GiveVIPApplyInfo; |
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; |
| | |
| | | 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.BindingAccountException; |
| | | import com.yeshi.fanli.exception.user.UserCustomSettingsException; |
| | | import com.yeshi.fanli.exception.user.UserInfoException; |
| | | 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.common.JumpDetailV2Service; |
| | |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | @Resource |
| | | private BindingAccountService bindingAccountService; |
| | | |
| | | @Resource |
| | |
| | | @Resource |
| | | private BusinessSystemService businessSystemService; |
| | | |
| | | @Resource |
| | | private ShamUserService shamUserService; |
| | | |
| | | @Resource |
| | | private ThreeSaleSerivce threeSaleSerivce; |
| | |
| | | @Resource |
| | | private HongBaoManageService hongBaoManageService; |
| | | |
| | | @Resource |
| | | private UserAccountService loginService; |
| | | |
| | | @Resource |
| | | private RedisManager redisManager; |
| | |
| | | @Resource |
| | | private AppVersionService appVersionService; |
| | | |
| | | @Resource |
| | | private HongBaoV2CountService hongBaoV2CountService; |
| | | |
| | | @Resource |
| | | private AccountMessageService accountMessageService; |
| | |
| | | |
| | | @Resource |
| | | private BindRemindService bindRemindService; |
| | | |
| | | @Resource |
| | | private RedPackBalanceService redPackBalanceService; |
| | | |
| | | @Resource |
| | | private UserRankService userRankService; |
| | | |
| | | @Resource |
| | | private UserVIPInfoService userVIPInfoService; |
| | |
| | | |
| | | @Resource |
| | | private PreviewInfoService previewInfoService; |
| | | |
| | | @Resource |
| | | private PDDAuthService pddAuthService; |
| | | |
| | | @Resource |
| | | private PIDManager pidManager; |
| | | |
| | | @Resource |
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService; |
| | | |
| | | private static final String EXTRACT_MIN_MONEY = ConfigKeyEnum.extractMoneyMin.getKey(); |
| | | private static final String EXTRACT_MAX_MONEY = ConfigKeyEnum.extractMoneyMAX.getKey(); |
| | |
| | | } |
| | | // 不是用ID的登陆的事就多了 |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(),acceptData.getSystem()); |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | | if (system == null) { |
| | | out.print(JsonUtil.loadFalseResult("系统不存在")); |
| | | return; |
| | |
| | | } |
| | | // 不是用ID的登陆的事就多了 |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(),acceptData.getSystem()); |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | | if (system == null) { |
| | | out.print(JsonUtil.loadFalseResult("系统不存在")); |
| | | return; |
| | |
| | | int versionCode = Integer.parseInt(version); |
| | | String platform = acceptData.getPlatform(); |
| | | |
| | | AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, "1.5.0",acceptData.getSystem()); |
| | | 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()),acceptData.getSystem())) |
| | | && 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()),acceptData.getSystem())) |
| | | && 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.getValue(ConfigKeyEnum.teamList.getKey(),acceptData.getSystem())); |
| | | data.put("inviteList", configService.getValue(ConfigKeyEnum.teamList.getKey(), acceptData.getSystem())); |
| | | |
| | | // 界面状态 |
| | | UserSettingsVO mySettings = null; |
| | |
| | | |
| | | data.put("error", "0"); |
| | | data.put("maxError", 1); |
| | | 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())); |
| | | 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.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())); |
| | | 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 = ""; |
| | |
| | | } |
| | | |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(),acceptData.getSystem()); |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | | if (system == null) { |
| | | LogHelper.userInfo("提现时,不存在该系统"); |
| | | out.print(JsonUtil.loadFalseResult("系统不存在")); |
| | | return; |
| | | } |
| | | |
| | | String minMoney = configService.getValue(EXTRACT_MIN_MONEY,acceptData.getSystem()); // 单笔提现最小金额 |
| | | 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.getValue(EXTRACT_MAX_MONEY,acceptData.getSystem()); // 单笔提现最大金额 |
| | | 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(),acceptData.getSystem()); |
| | | Config config = configService.getConfig(ConfigKeyEnum.extractCodeEmailFrom.getKey(), acceptData.getSystem()); |
| | | String[] sts = config.getValue().split(","); |
| | | String account = sts[0]; |
| | | String pwd = sts[1]; |
| | |
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime)); |
| | | } |
| | | |
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(),acceptData.getSystem()); |
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(), acceptData.getSystem()); |
| | | if (helpLink == null) { |
| | | helpLink = ""; |
| | | } |
| | |
| | | hasCode = true; // 已有邀请码 |
| | | } else { |
| | | // 邀请激活链接 |
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem())); |
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(), acceptData.getSystem())); |
| | | } |
| | | resultData.put("hasCode", hasCode); |
| | | |
| | |
| | | bossData.put("inviteTime", "邀请时间: " + sdf.format(inviteTime)); |
| | | } |
| | | |
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(),acceptData.getSystem()); |
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(), acceptData.getSystem()); |
| | | if (helpLink == null) { |
| | | helpLink = ""; |
| | | } |
| | |
| | | hasCode = true; // 已有邀请码 |
| | | } else { |
| | | // 邀请激活链接 |
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem())); |
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(), acceptData.getSystem())); |
| | | } |
| | | resultData.put("hasCode", hasCode); |
| | | |
| | |
| | | |
| | | JSONObject resultData = new JSONObject(); |
| | | |
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(),acceptData.getSystem()); |
| | | String helpLink = configService.getValue(ConfigKeyEnum.teamHelpUrl.getKey(), acceptData.getSystem()); |
| | | if (helpLink == null) { |
| | | helpLink = ""; |
| | | } |
| | |
| | | hasCode = true; // 已有邀请码 |
| | | } else { |
| | | // 邀请激活链接 |
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem())); |
| | | resultData.put("activationlink", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(), acceptData.getSystem())); |
| | | } |
| | | resultData.put("hasCode", hasCode); |
| | | |
| | |
| | | if (inviteCode == null || inviteCode.trim().length() == 0) { |
| | | // 无邀请码 |
| | | inviteData.put("content", "邀请激活"); |
| | | inviteData.put("link", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(),acceptData.getSystem())); |
| | | inviteData.put("link", configService.getValue(ConfigKeyEnum.inviteActivationUrl.getKey(), acceptData.getSystem())); |
| | | } else { |
| | | // 已有邀请码 |
| | | inviteData.put("content", "邀请码"); |
| | | inviteData.put("link", configService.getValue(ConfigKeyEnum.inviteActivationSuccessUrl.getKey(),acceptData.getSystem())); |
| | | inviteData.put("link", configService.getValue(ConfigKeyEnum.inviteActivationSuccessUrl.getKey(), acceptData.getSystem())); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | |
| | | public void getuserinfoNew(AcceptData acceptData, Long uid, HttpServletRequest requst, PrintWriter out) { |
| | | try { |
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), |
| | | acceptData.getPackages(),acceptData.getSystem()); |
| | | acceptData.getPackages(), acceptData.getSystem()); |
| | | if (system == null) { |
| | | out.print(JsonUtil.loadFalseResult("系统不存在")); |
| | | return; |
| | |
| | | userActiveLog.setDeviceType(acceptData.getDeviceType()); |
| | | userActiveLog.setDevice(acceptData.getDevice()); |
| | | userActiveLogService.addUserActiveLog(userActiveLog); |
| | | //是否绑定淘宝 |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid); |
| | | if (taoBaoInfo != null) |
| | | if (!StringUtil.isNullOrEmpty(taoBaoInfo.getSpecialId()) && taoBaoInfo.getSpecialValid() != null && taoBaoInfo.getSpecialValid()) { |
| | | if (!StringUtil.isNullOrEmpty(taoBaoInfo.getRelationId()) && taoBaoInfo.getRelationValid() != null && taoBaoInfo.getRelationValid()) { |
| | | userInfo.setTbName(taoBaoInfo.getTaoBaoNickName()); |
| | | userInfo.setOpenid(taoBaoInfo.getTaoBaoUid() + ""); |
| | | } |
| | | } |
| | | |
| | | |
| | | // 处理用户信息 |
| | | outUserInfoHandle(userInfo); |
| | |
| | | data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息 |
| | | data.put("vipLink", userVipConfigService.getValueByKey("vip_link"));// 超级会员升级链接 |
| | | |
| | | if(SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.bindPhone)) { |
| | | if (SystemInfoUtil.hasFunctions(acceptData.getSystem(), SystemFunction.bindPhone)) { |
| | | // 2.0.1之后绑定手机号 |
| | | if (VersionUtil.greaterThan_2_0_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | boolean bindPhone = false; |
| | |
| | | } |
| | | |
| | | if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | data.put("fansCountLink", configService.getValue(ConfigKeyEnum.teamStatisticsLink.getKey(),acceptData.getSystem())); |
| | | data.put("fansCountLink", configService.getValue(ConfigKeyEnum.teamStatisticsLink.getKey(), acceptData.getSystem())); |
| | | // 会员动作 |
| | | // 查询是否为超级会员,是的话返回超会管理链接 |
| | | UserLevelEnum level = userLevelManager.getUserLevel(uid); |
| | |
| | | vipAction.put("jumpDetail", |
| | | jumpDetailV2Service.getByTypeCache("web", |
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2, |
| | | Integer.parseInt(acceptData.getVersion()))); |
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem())); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", userVipConfigService.getValueByKey("vip_manager_link")); |
| | | vipAction.put("params", params); |
| | |
| | | vipAction.put("jumpDetail", |
| | | jumpDetailV2Service.getByTypeCache("web", |
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2, |
| | | Integer.parseInt(acceptData.getVersion()))); |
| | | Integer.parseInt(acceptData.getVersion()),acceptData.getSystem())); |
| | | JSONObject params = new JSONObject(); |
| | | params.put("url", link.replace("[ID]", list.get(0).getId())); |
| | | vipAction.put("params", params); |
| | |
| | | } |
| | | |
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo)); |
| | | //拼多多是否绑定 |
| | | if (VersionUtil.greaterThan_2_1_5(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | boolean pddBuyBind = PinDuoDuoApiUtil.isAuth(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.fanli), pddAuthService.getFanliCustomParams(uid)); |
| | | boolean pddShareBind = PinDuoDuoApiUtil.isAuth(pidManager.getPidCache(acceptData.getSystem(), Constant.SOURCE_TYPE_PDD, SystemPIDInfo.PidType.share), pddAuthService.getFanliCustomParams(uid)); |
| | | data.put("pddBuyBind", pddBuyBind); |
| | | data.put("pddShareBind", pddShareBind); |
| | | } |
| | | |
| | | |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | |