| | |
| | | import com.yeshi.makemoney.app.service.inter.money.UserExtractMoneyLimitService; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserMoneyRecordService; |
| | | import com.yeshi.makemoney.app.service.inter.money.UserMoneyService; |
| | | import com.yeshi.makemoney.app.service.inter.msg.UserMsgNotifyService; |
| | | import com.yeshi.makemoney.app.service.inter.user.UserInfoService; |
| | | import com.yeshi.makemoney.app.service.query.money.ExtractQuery; |
| | | import com.yeshi.makemoney.app.utils.Constant; |
| | | import com.yeshi.makemoney.app.utils.factory.UserMoneyRecordFactory; |
| | | import com.yeshi.makemoney.app.utils.factory.msg.UserMsgFactory; |
| | | import com.yeshi.makemoney.app.utils.mq.CMQManager; |
| | | import com.yeshi.makemoney.app.utils.pay.AlipayUtil; |
| | | import org.slf4j.Logger; |
| | |
| | | |
| | | @Resource |
| | | private UserExtractMoneyLimitService userExtractMoneyLimitService; |
| | | |
| | | @Resource |
| | | private UserMsgNotifyService userMsgNotifyService; |
| | | |
| | | @Override |
| | | public List<Extract> list(ExtractQuery extractQuery, int page, int pageSize) { |
| | |
| | | @Override |
| | | public boolean canExtractLittleMoney(Long uid, int maxNewerCount, Date date) { |
| | | //判断新人 |
| | | long count = countByMaxMoney(uid,Constant.EXTRACT_LITTLE_MONEY_LIMIT, Arrays.asList(new Integer[]{Extract.STATE_NOT_PROCESS, Extract.STATE_PROCESSING, Extract.STATE_PASS}), null); |
| | | long count = countByMaxMoney(uid, Constant.EXTRACT_LITTLE_MONEY_LIMIT, Arrays.asList(new Integer[]{Extract.STATE_NOT_PROCESS, Extract.STATE_PROCESSING, Extract.STATE_PASS}), null); |
| | | if (maxNewerCount > count) { |
| | | return true; |
| | | } |
| | |
| | | updateExtract.setState(Extract.STATE_REJECT); |
| | | updateExtract.setReason(reason); |
| | | extractMapper.updateByPrimaryKeySelective(updateExtract); |
| | | //TODO 消息 |
| | | //添加消息通知 |
| | | try { |
| | | userMsgNotifyService.notify(UserMsgFactory.createExtractFail(extract.getUser().getId(), extract.getMoney(), reason)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | userMoneyRecordService.update(update); |
| | | } |
| | | } |
| | | // TODO 通知转账成功 |
| | | //添加消息通知 |
| | | try { |
| | | userMsgNotifyService.notify(UserMsgFactory.createExtractSuccess(extract.getUser().getId(), extract.getMoney())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 新版提现 |
| | | //TODO 通知转账被拒绝 |
| | | //添加消息通知 |
| | | try { |
| | | userMsgNotifyService.notify(UserMsgFactory.createExtractFail(extract.getUser().getId(), extract.getMoney(), null)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |