yujian
2019-03-27 cdcbed9af813b2a02cdc01eefa24db8bec6b51a9
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java
@@ -32,7 +32,6 @@
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.config.InviteGetMoneyService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
@@ -40,7 +39,6 @@
import com.yeshi.fanli.service.inter.order.OrderService;
import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
import com.yeshi.fanli.service.inter.user.AccountMessageService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ExtractService;
import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
@@ -49,6 +47,7 @@
import com.yeshi.fanli.service.inter.user.TBPidService;
import com.yeshi.fanli.service.inter.user.UserAccountService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserMoneyService;
import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.util.Constant;
@@ -77,7 +76,6 @@
   @Resource
   private OrderService orderService;
   @Resource
   private HongBaoV2Service hongBaoV2Service;
@@ -103,9 +101,6 @@
   private LostOrderService lostOrderService;
   @Resource
   private AccountMessageService accountMessageService;
   @Resource
   private HongBaoManageService hongBaoManageService;
   @Resource
@@ -113,9 +108,6 @@
   @Resource
   private RedisManager redisManager;
   @Resource
   private InviteGetMoneyService inviteGetMoneyService;
   @Resource
   private TBPidService tbPidService;
@@ -134,9 +126,12 @@
   @Resource
   private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
   @Resource
   private UserSystemCouponService userSystemCouponService;
   @Resource
   private UserMoneyService userMoneyService;
   private static final String PASSWORD_MAX_ERROR = "password_max_error";
   private static final String EXTRACT_MIN_MONEY = "extract_min_money";
@@ -159,7 +154,8 @@
   public void login(AcceptData acceptData, String code, String vcode, String phone, boolean wxinstall,
         String tbOpenid, String tbNickName, String tbPortrait, String tbSession, int loginType, Boolean first,
         HttpSession session, HttpServletRequest request, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -220,8 +216,8 @@
         root.put("type", result.getType());
         root.put("data", data);
         out.print(JsonUtil.loadTrueResult(root));
         final UserInfo uuser =  result.getUser();
         final UserInfo uuser = result.getUser();
         ThreadUtil.run(new Runnable() {
            public void run() {
               try {
@@ -238,7 +234,7 @@
               }
            }
         });
      } catch (UserAccountException e) {
         try {
            LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
@@ -247,7 +243,7 @@
         }
         out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
      }
   }
   /**
@@ -265,7 +261,8 @@
   @RequestMapping(value = "register")
   public void register(AcceptData acceptData, String tbOpenid, String tbNickName, String tbPortrait, String vcode,
         String phone, HttpServletRequest request, HttpSession session, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -325,7 +322,8 @@
    */
   @RequestMapping(value = "connect")
   public void connect(AcceptData acceptData, long mainUid, long lessUid, HttpSession session, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -358,7 +356,8 @@
    */
   @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 = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -422,7 +421,8 @@
    */
   @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 = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -485,7 +485,8 @@
    */
   @RequestMapping(value = "unBindPhone")
   public void unBindPhone(AcceptData acceptData, Long uid, String phone, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -521,7 +522,8 @@
   @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 = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -583,7 +585,8 @@
    */
   @RequestMapping(value = "unBindTaoBao")
   public void unBindTaoBao(AcceptData acceptData, Long uid, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -607,7 +610,8 @@
    */
   @RequestMapping(value = "changeWX")
   public void changeWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -654,7 +658,8 @@
    */
   @RequestMapping(value = "getphone")
   public void getPhone(AcceptData acceptData, Long uid, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -674,7 +679,8 @@
   @RequestMapping(value = "verifyvcodeforbind")
   public void verifyVcodeForbind(AcceptData acceptData, Long uid, String vcode, PrintWriter out) {
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
      BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -719,7 +725,8 @@
    */
   @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 = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -774,7 +781,8 @@
   @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 = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -864,7 +872,8 @@
   @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 = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
            acceptData.getPackages());
      if (system == null) {
         out.print(JsonUtil.loadFalseResult("系统不存在"));
         return;
@@ -984,16 +993,16 @@
         out.print(JsonUtil.loadFalseResult(2, "用户不存在"));
         return;
      }
      BigDecimal moneyToday = inviteGetMoneyService.getMoneyToday(uid + "");
      BigDecimal moneyToday = userMoneyService.getMoneyToday(uid);
      if (moneyToday == null) {
         moneyToday = new BigDecimal(0);
      }
      BigDecimal moneyMonth = inviteGetMoneyService.getMoneyMonth(uid + "");
      BigDecimal moneyMonth = userMoneyService.getMoneyMonth(uid);
      if (moneyMonth == null) {
         moneyMonth = new BigDecimal(0);
      }
      BigDecimal moneyLastMonth = inviteGetMoneyService.getMoneyLastMonth(uid + "");
      BigDecimal moneyLastMonth = userMoneyService.getMoneyLastMonth(uid);
      BigDecimal unOpenmoney = hongBaoV2Service.getUnRecievedFanLiMoney(uid);
      BigDecimal totalFanMoney = hongBaoV2Service.getTotalFanLiMoney(uid);
      JSONObject data = new JSONObject();
@@ -1062,15 +1071,8 @@
         } else {
            tbPid = tbPidService.getTBPid(Long.parseLong(uid), PidUser.TYPE_FANLI_IOS);
            if (tbPid != null) {
               String siteId = tbPid.getPid().split("_")[2];
               String adzoneId = tbPid.getPid().split("_")[3];
               TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(siteId);
               clientTBPid = new ClientTBPid(config.getAppKey(), tbPid.getPid(), siteId, adzoneId);
            } else {
               clientTBPid = tbPidService.getIOSDefault();
            }
            clientTBPid = tbPidService.getIOSDefault();
         }
      } else {