| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.user.UserNotificationService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyService userMoneyService;
|
| | |
|
| | | public List<BindingAccount> getBindingAccountByUid(long uid) {
|
| | | return bindingAccountMapper.selectByUid(uid);
|
| | |
| | | // 需要转账验证
|
| | | BigDecimal money = new BigDecimal("0.1");
|
| | | transferAlipayWithVerify(account, name);
|
| | | // 扣款
|
| | | userInfoMapper.subHongBaoByUid(uid, money);
|
| | |
|
| | | // 转账成功
|
| | | // 插入转账成功表
|
| | | AlipayAccountValidNormalHistory history = new AlipayAccountValidNormalHistory();
|
| | |
| | | history.setName(name);
|
| | | history.setUid(uid);
|
| | | alipayAccountValidNormalHistoryMapper.insertSelective(history);
|
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | // 新版资金
|
| | | try {
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createExtractAccountValid(history, money);
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | userMoneyDetail = UserMoneyDetailFactory.createExtractAccountValid(history, money);
|
| | | } catch (UserMoneyDetailException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | // 扣款
|
| | | userMoneyService.subUserMoney(uid, money, userMoneyDetail);
|
| | |
|
| | | userNotificationService.alipayAccountValidRight(uid, money, account);
|
| | |
|
| | |
| | | UserAccountBindingHistory.TYPE_PHONE);
|
| | | // 手机号更换绑定的7天内不能提现
|
| | | if (history != null && !history.getFirst()
|
| | | && (System.currentTimeMillis() - history.getCreateTime().getTime()) > 1000 * 60 * 60 * 24 * 7L) {
|
| | | && (System.currentTimeMillis() - history.getCreateTime().getTime()) < 1000 * 60 * 60 * 24 * 7L) {
|
| | | throw new AlipayAccountException(111, "修改手机号7天内不允许修改支付宝账号");
|
| | | }
|
| | | }
|