| | |
| | | package com.yeshi.fanli.controller.client.v1;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpSession;
|
| | |
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.encrypt.DESUtil;
|
| | |
|
| | | import com.alipay.api.AlipayApiException;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.*;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.LoginResult;
|
| | | import com.yeshi.fanli.entity.bus.user.SMSHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | |
| | | import com.yeshi.fanli.exception.user.AlipayAccountException;
|
| | | import com.yeshi.fanli.exception.user.AlipayTransferException;
|
| | | import com.yeshi.fanli.exception.user.UserAccountException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | | import com.yeshi.fanli.service.inter.push.*;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoDeleteRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.*;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.encrypt.DESUtil;
|
| | | import org.yeshi.utils.entity.ProxyIP;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpSession;
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | /**
|
| | | * 账户系统
|
| | | *
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v1/user")
|
| | |
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
| | | @Resource
|
| | | private BindingAccountService bindingAccountService;
|
| | |
|
| | | @Resource
|
| | | private ExtractService extractService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
| | | @Resource
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private ShamUserService shamUserService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountService userAccountService;
|
| | |
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyService userMoneyService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarUserService homeNavbarUserService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoDeleteRecordService userInfoDeleteRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoModifyRecordService userInfoModifyRecordService;
|
| | |
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | |
|
| | | private BusinessSystem getSystem(AcceptData acceptData) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages(), acceptData.getSystem());
|
| | | return system;
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * @param acceptData
|
| | | * @param code
|
| | | * @param vcode
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system =getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "getuid")
|
| | | public void getUid(AcceptData acceptData, String code, String tbOpenid, String phone, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "bindPhone")
|
| | | public void bindPhone(AcceptData acceptData, Long uid, String vcode, String phone, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "unBindPhone")
|
| | | public void unBindPhone(AcceptData acceptData, Long uid, String phone, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | * @param tbOpenid
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @param tbSession
|
| | | * -淘宝授权session
|
| | | * @param tbSession -淘宝授权session
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "bindTaoBao")
|
| | | public void bindTaoBao(AcceptData acceptData, Long uid, String tbOpenid, String tbNickName, String tbPortrait,
|
| | | String tbSession, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "unBindTaoBao")
|
| | | public void unBindTaoBao(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "changeWX")
|
| | | public void changeWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "getphone")
|
| | | public void getPhone(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | |
|
| | | @RequestMapping(value = "verifyvcodeforbind")
|
| | | public void verifyVcodeForbind(AcceptData acceptData, Long uid, String vcode, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | * @param acceptData
|
| | | * @param uid-用户ID
|
| | | * @param name-支付宝实名名称
|
| | | * @param account
|
| | | * -支付宝账号
|
| | | * @param account -支付宝账号
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "bindalipay")
|
| | | public void bindAlipay(AcceptData acceptData, Long uid, String name, String account, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | @RequestMapping(value = "bindalipaywithverify")
|
| | | public void bindAlipayWithVerify(AcceptData acceptData, Long uid, String name, String account, PrintWriter out) {
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | @RequestMapping(value = "bindalipaywithverifynew")
|
| | | public void bindAlipayWithVerifyNew(AcceptData acceptData, Long uid, String name, String account, PrintWriter out) {
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | * 退出登录
|
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * -用户ID
|
| | | * @param uid -用户ID
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "logout")
|
| | |
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param code
|
| | | * @param loginType
|
| | | * 登录方式: 1-手机登录 2-微信登录
|
| | | * @param loginType 登录方式: 1-手机登录 2-微信登录
|
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | UserInfo userInfo = null;
|
| | | // 手机登录
|
| | | if (loginType == 1) {
|
| | | userInfo = userAccountService.loginPhone(new ProxyIP(request.getRemoteHost(),request.getRemotePort()), acceptData, loginType, vcode, phone, system.getAppid());
|
| | | userInfo = userAccountService.loginPhone(new ProxyIP(request.getRemoteHost(), request.getRemotePort()), loginType, vcode, phone, system);
|
| | | }
|
| | |
|
| | | // 微信登录
|
| | | if (loginType == 2) {
|
| | | userInfo = userAccountService.loginWinXin(new ProxyIP(request.getRemoteHost(),request.getRemotePort()), acceptData, loginType, code, system.getAppid());
|
| | | userInfo = userAccountService.loginWeiXin(new ProxyIP(request.getRemoteHost(), request.getRemotePort()), loginType, code, system);
|
| | | }
|
| | |
|
| | | if (userInfo == null) {
|
| | |
| | | @RequestMapping(value = "bindPhoneNew")
|
| | | public void bindPhoneNew(AcceptData acceptData, Long uid, String vcode, String phone, PrintWriter out) {
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | */
|
| | | @RequestMapping(value = "bindWeiXin")
|
| | | public void bindWeiXin(AcceptData acceptData, Long uid, String code, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | BusinessSystem system = getSystem(acceptData);
|
| | |
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|