| | |
| | | import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | return bindingAccountMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public void validAlipayAccount(Long uid, String account, String name)
|
| | | throws AlipayTransferException, AlipayApiException, AlipayAccountException {
|
| | |
| | | "该支付宝账号已被其他账号绑定,请更换其他的支付宝账号来绑定");
|
| | | }
|
| | |
|
| | | // TODO 做频率验证-每月验证一次
|
| | | AlipayAccountValidNormalHistory latest = alipayAccountValidNormalHistoryMapper.selectLatestByUid(uid);
|
| | | if (latest != null) {
|
| | | Calendar caLatest = Calendar.getInstance();
|
| | |
| | | if (userInfo.getMyHongBao().compareTo(money) >= 0) {
|
| | | // 扣款
|
| | | userMoneyService.subUserMoney(uid, money, userMoneyDetail);
|
| | | userMoneyMsgNotificationService.alipayAccountValid(history);
|
| | | userMoneyMsgNotificationService.alipayAccountValid(history,"1个月",latest!=null);
|
| | | } else {// 余额不足,暂时不扣款,加入借贷关系
|
| | | UserMoneyDebt debt = new UserMoneyDebt();
|
| | | debt.setCreateTime(new Date());
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | @Override
|
| | | public BindingAccount changeAlipayBindingWithVerify(Long uid, String name, String account)
|
| | | throws AlipayTransferException, AlipayApiException, AlipayAccountException {
|
| | |
| | | // 手机号更换绑定的7天内不能提现
|
| | | if (history != null && !history.getFirst()
|
| | | && (System.currentTimeMillis() - history.getCreateTime().getTime()) < 1000 * 60 * 60 * 24 * 7L) {
|
| | | throw new AlipayAccountException(111, "修改手机号7天内不允许修改支付宝账号");
|
| | | throw new AlipayAccountException(111, "修改手机号后,7天内无法更换提现账号");
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | AlipayAccountValidNormalHistory latest = alipayAccountValidNormalHistoryMapper.selectLatestByUid(uid);
|
| | | if (latest != null) {
|
| | | Calendar caLatest = Calendar.getInstance();
|
| | | caLatest.setTimeInMillis(latest.getCreateTime().getTime());
|
| | | Calendar nowLatest = Calendar.getInstance();
|
| | | if (caLatest.get(Calendar.MONTH) == nowLatest.get(Calendar.MONTH))// 上次更改和现在是同一个月
|
| | | if (TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM")
|
| | | .equalsIgnoreCase(TimeUtil.getGernalTime(latest.getCreateTime().getTime(), "yyyy-MM")))// 上次更改和现在是同一年同一个月
|
| | | throw new BindingAccountException(2, "每月仅可修改1次提现账号,请下月再试吧。");
|
| | | }
|
| | | return true;
|