| | |
| | | inviteSettle(uid, sourceType, maxPregetTime); |
| | | } |
| | | |
| | | @Override |
| | | public void inviteSettleDY(Long uid, Date maxPregetTime) throws OrderMoneySettleException { |
| | | // 查询UID的一二级邀请赚 |
| | | int sourceType = Constant.SOURCE_TYPE_DY; |
| | | inviteSettle(uid, sourceType, maxPregetTime); |
| | | } |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | @Override |
| | | public TransactionStatus execute(Message arg0, Object arg1) { |
| | | try { |
| | | fanLiShareTB(hongBaoList, uid, taskKey); |
| | | fanLiShareTB(hongBaoList, uid, taskKey,maxPregetTime); |
| | | } catch (TaoBaoWeiQuanException e) { |
| | | return TransactionStatus.RollbackTransaction; |
| | | } |
| | |
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() { |
| | | @Override |
| | | public TransactionStatus execute(Message arg0, Object arg1) { |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey); |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey,maxPregetTime); |
| | | return TransactionStatus.CommitTransaction; |
| | | } |
| | | }, null); |
| | |
| | | @Override |
| | | public void shareSettleSuning(Long uid, Date maxPregetTime) throws OrderMoneySettleException { |
| | | shareSettle(Constant.SOURCE_TYPE_SUNING, uid, maxPregetTime); |
| | | } |
| | | |
| | | @Override |
| | | public void shareSettleDY(Long uid, Date maxPregetTime) throws OrderMoneySettleException { |
| | | shareSettle(Constant.SOURCE_TYPE_DY, uid, maxPregetTime); |
| | | } |
| | | |
| | | private void shareSettle(int sourceType, Long uid, Date maxPregetTime) throws OrderMoneySettleException { |
| | |
| | | orderTransactionProducer.send(msg, new LocalTransactionExecuter() { |
| | | @Override |
| | | public TransactionStatus execute(Message arg0, Object arg1) { |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey); |
| | | fanLiShareOther(hongBaoList, uid, sourceType, taskKey,maxPregetTime); |
| | | return TransactionStatus.CommitTransaction; |
| | | } |
| | | }, null); |
| | |
| | | Map<Long, Integer> userGoodsCount = new HashMap<>(); |
| | | for (CommonOrder co : orderList) { |
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByCommonOrderId(co.getId()); |
| | | if (hongBaoOrder == null) { |
| | | continue; |
| | | } |
| | | hongBaoList.add(hongBaoOrder.getHongBaoV2()); |
| | | Long uid = co.getUserInfo().getId(); |
| | | if (userGoodsCount.get(uid) == null) |
| | |
| | | * @param uid |
| | | * @throws TaoBaoWeiQuanException |
| | | */ |
| | | private void fanLiShareTB(List<HongBaoV2> hongBaoList, Long uid, String key) throws TaoBaoWeiQuanException { |
| | | private void fanLiShareTB(List<HongBaoV2> hongBaoList, Long uid, String key,Date recieveMonth) throws TaoBaoWeiQuanException { |
| | | BigDecimal sharemoney = new BigDecimal(0); |
| | | List<Long> hbIdList = new ArrayList<>(); |
| | | Set<String> drawBackOrders = new HashSet<String>(); |
| | |
| | | // 添加新版详情记录 |
| | | try { |
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, Constant.SOURCE_TYPE_TAOBAO, |
| | | sharemoney, new Date()); |
| | | sharemoney,recieveMonth); |
| | | // 添加资金 |
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail); |
| | | |
| | |
| | | * @param uid |
| | | * @param sourceType |
| | | */ |
| | | private void fanLiShareOther(List<HongBaoV2> hongBaoList, Long uid, int sourceType, String key) { |
| | | private void fanLiShareOther(List<HongBaoV2> hongBaoList, Long uid, int sourceType, String key,Date recieveMonth) { |
| | | BigDecimal sharemoney = new BigDecimal(0); |
| | | List<Long> hbIdList = new ArrayList<>(); |
| | | List<Long> recieveHongBaoIds = new ArrayList<>(); |
| | |
| | | // 添加新版详情记录 |
| | | try { |
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, sharemoney, |
| | | new Date()); |
| | | recieveMonth); |
| | | // 添加资金 |
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail); |
| | | |