| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.HashSet;
|
| | |
| | | import com.yeshi.fanli.dto.HongBao;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.order.body.TeamRewardPreRecieveMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.money.TeamRewardDebt;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderMoneySettleService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.manger.money.TeamEincomeManager;
|
| | | import com.yeshi.fanli.service.manger.order.TeamRewardManager;
|
| | | import com.yeshi.fanli.service.manger.order.TeamSubsidyManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.cmq.HongBaoRecieveCMQManager;
|
| | |
| | | @Resource
|
| | | private TeamRewardManager teamRewardManager;
|
| | |
|
| | | @Resource
|
| | | private TeamSubsidyManager teamSubsidyManager;
|
| | |
|
| | | // 下级被封禁,红包失效
|
| | | private void invalidHongBaoForbidden(Long id) {
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void inviteSettleTB(Long uid) throws OrderMoneySettleException {
|
| | | public void inviteSettleTB(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_TAOBAO;
|
| | | List<Integer> types = new ArrayList<>();
|
| | |
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | i * 1000, 1000);
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 邀请赚到账事务消息
|
| | | OrderMoneyRecievedMQMsg mqMsg = new OrderMoneyRecievedMQMsg(OrderMoneyRecievedMQMsg.TYPE_INVITE, uid,
|
| | | sourceType, null, null, new Date(), 0);
|
| | | String taskKey = getTaskKey(uid);
|
| | |
|
| | | TeamRewardPreRecieveMQMsg mqMsg = new TeamRewardPreRecieveMQMsg(taskKey, uid, sourceType, maxPregetTime,
|
| | | new Date());
|
| | |
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | | String taskKey = getTaskKey(uid);
|
| | |
|
| | | msg.setKey(taskKey);
|
| | | // 添加事务消息
|
| | | try {
|
| | |
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | fanliInvite(hongBaoList, uid, Constant.SOURCE_TYPE_TAOBAO, taskKey);
|
| | | fanliInvite(hongBaoList, uid, Constant.SOURCE_TYPE_TAOBAO, taskKey, maxPregetTime);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | | return TransactionStatus.CommitTransaction;
|
| | | }
|
| | | }, null);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.mqError(e.getMessage(), msg.getTopic(), msg.getTag(), new Gson().toJson(mqMsg));
|
| | | }
|
| | | System.out.println(new Gson().toJson(mqMsg));
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void inviteSettleJD(Long uid) throws OrderMoneySettleException {
|
| | | public void inviteSettleJD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_JD;
|
| | | List<Integer> types = new ArrayList<>();
|
| | |
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | i * 1000, 1000);
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 邀请赚到账事务消息
|
| | | OrderMoneyRecievedMQMsg mqMsg = new OrderMoneyRecievedMQMsg(OrderMoneyRecievedMQMsg.TYPE_INVITE, uid,
|
| | | sourceType, null, null, new Date(), 0);
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | |
|
| | | String taskKey = getTaskKey(uid);
|
| | | TeamRewardPreRecieveMQMsg mqMsg = new TeamRewardPreRecieveMQMsg(taskKey, uid, sourceType, maxPregetTime,
|
| | | new Date());
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | | msg.setKey(taskKey);
|
| | | // 添加事务消息
|
| | | try {
|
| | |
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | fanliInvite(hongBaoList, uid, sourceType, taskKey);
|
| | | fanliInvite(hongBaoList, uid, sourceType, taskKey, maxPregetTime);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return TransactionStatus.RollbackTransaction;
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void inviteSettlePDD(Long uid) throws OrderMoneySettleException {
|
| | | public void inviteSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | // 查询UID的一二级邀请赚
|
| | | int sourceType = Constant.SOURCE_TYPE_PDD;
|
| | | List<Integer> types = new ArrayList<>();
|
| | |
| | | types.add(HongBaoV2.TYPE_ERJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | types.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | i * 1000, 1000);
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 邀请赚到账事务消息
|
| | | OrderMoneyRecievedMQMsg mqMsg = new OrderMoneyRecievedMQMsg(OrderMoneyRecievedMQMsg.TYPE_INVITE, uid,
|
| | | sourceType, null, null, new Date(), 0);
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | | String taskKey = getTaskKey(uid);
|
| | | TeamRewardPreRecieveMQMsg mqMsg = new TeamRewardPreRecieveMQMsg(taskKey, uid, sourceType, maxPregetTime,
|
| | | new Date());
|
| | | Message msg = MQMsgBodyFactory.create(MQTopicName.TOPIC_ORDER, OrderTopicTagEnum.teamRewardPreRecieved, mqMsg);
|
| | | msg.setKey(taskKey);
|
| | | // 添加事务消息
|
| | | try {
|
| | |
| | | @Override
|
| | | public TransactionStatus execute(Message arg0, Object arg1) {
|
| | | try {
|
| | | fanliInvite(hongBaoList, uid, sourceType, taskKey);
|
| | | fanliInvite(hongBaoList, uid, sourceType, taskKey, maxPregetTime);
|
| | | } catch (Exception e) {
|
| | | return TransactionStatus.RollbackTransaction;
|
| | | }
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleTB(Long uid) throws OrderMoneySettleException {
|
| | | public void shareSettleTB(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | |
|
| | | // 查询UID的分享赚订单
|
| | | types.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | i * 1000, 1000);
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleJD(Long uid) throws OrderMoneySettleException {
|
| | | public void shareSettleJD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | |
|
| | | // 查询UID的分享赚订单
|
| | | types.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | i * 1000, 1000);
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettlePDD(Long uid) throws OrderMoneySettleException {
|
| | | public void shareSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | |
|
| | | // 查询UID的分享赚订单
|
| | | types.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType);
|
| | | long count = hongBaoV2Mapper.countCanBalanceHongBaoByTypeAndUid(types, uid, sourceType, maxPregetTime);
|
| | | List<HongBaoV2> hongBaoList = new ArrayList<>();
|
| | | // 1000条数据为1页
|
| | | int page = (int) (count % 1000 == 0 ? count / 1000 : count / 1000 + 1);
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<HongBaoV2> tempHongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByTypeAndUid(types, uid, sourceType,
|
| | | i * 1000, 1000);
|
| | | maxPregetTime, i * 1000, 1000);
|
| | | if (tempHongBaoList != null && tempHongBaoList.size() > 0)
|
| | | hongBaoList.addAll(tempHongBaoList);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Transactional
|
| | | private void fanliInvite(List<HongBaoV2> hongBaoList, Long uid, int sourceType, String key)
|
| | | private void fanliInvite(List<HongBaoV2> hongBaoList, Long uid, int sourceType, String key, Date maxPreGetTime)
|
| | | throws TeamEincomeRecordException, ParamsException, TeamRewardDebtException {
|
| | | List<Long> hbIdList = new ArrayList<>();
|
| | | BigDecimal invitemoney = new BigDecimal(0);
|
| | |
| | |
|
| | | // 邀请赚到账
|
| | | if (invitemoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | Calendar ca = Calendar.getInstance();
|
| | | Date date = new Date(TimeUtil.convertToTimeTemp(
|
| | | ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1) + "-25", "yyyy-M-dd"));
|
| | | // 获取当前的月份
|
| | | teamRewardManager.addToEincome(uid, date, invitemoney, sourceType);
|
| | | teamRewardManager.addToEincome(uid, maxPreGetTime, invitemoney, sourceType);
|
| | | }
|
| | |
|
| | | hongBaoV2SettleTempService.addTemp(hbIdList, key);
|
| | |
| | | // 所有的返利到账红包ID
|
| | | for (Long hongBaoId : hbIdList) {
|
| | | try {
|
| | | HongBaoRecieveCMQManager.getInstance().addHongBaoRecieveMsg(hongBaoId);
|
| | | if (Constant.ENABLE_MQ)
|
| | | HongBaoRecieveCMQManager.getInstance().addHongBaoRecieveMsg(hongBaoId);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | | List<Long> hbIdList = new ArrayList<>();
|
| | | Set<String> drawBackOrders = new HashSet<String>();
|
| | | List<Long> recieveHongBaoIds = new ArrayList<>();
|
| | | int shareGoodsCount = 0;
|
| | | Set<String> shareOrders = new HashSet<>();
|
| | |
|
| | | for (HongBaoV2 hongBao : hongBaoList) {
|
| | |
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByHongBaoId(hongBao.getId());
|
| | | if (hongBaoOrder != null) {
|
| | | balanceTime = hongBaoOrder.getCommonOrder().getSettleTime();
|
| | | shareGoodsCount += hongBaoOrder.getCommonOrder().getCount();
|
| | | }
|
| | | shareOrders.add(hongBaoOrder.getCommonOrder().getOrderNo());
|
| | | if (balanceTime != null
|
| | |
| | | if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | // 添加新版详情记录
|
| | | try {
|
| | | // 计算本月的有效订单,失效订单,维权订单
|
| | | Calendar ca = Calendar.getInstance();
|
| | |
|
| | | Date maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | ca.add(Calendar.MONTH, -1);
|
| | |
|
| | | Date minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS,
|
| | | minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO);
|
| | | long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ,
|
| | | minDate, maxDate, Constant.SOURCE_TYPE_TAOBAO);
|
| | |
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, Constant.SOURCE_TYPE_TAOBAO,
|
| | | (int) validCount, (int) weiQuanCount, sharemoney, new Date());
|
| | | sharemoney, new Date());
|
| | | // 添加资金
|
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail);
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.shareOrderReceived(uid, Constant.SOURCE_TYPE_TAOBAO, shareOrders.size(),
|
| | | shareGoodsCount, sharemoney, userInfoMapper.selectAvailableByPrimaryKey(uid).getMyHongBao(), null,
|
| | | null);
|
| | | userMoneyMsgNotificationService.shareOrderReceived(uid, Constant.SOURCE_TYPE_TAOBAO, sharemoney,
|
| | | userInfoMapper.selectAvailableByPrimaryKey(uid).getMyHongBao(), new Date());
|
| | |
|
| | | for (String orderId : drawBackOrders)
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanShare(orderId);
|
| | |
| | | // 所有的返利到账红包ID
|
| | | for (Long hongBaoId : recieveHongBaoIds) {
|
| | | try {
|
| | | HongBaoRecieveCMQManager.getInstance().addHongBaoRecieveMsg(hongBaoId);
|
| | | if (Constant.ENABLE_MQ)
|
| | | HongBaoRecieveCMQManager.getInstance().addHongBaoRecieveMsg(hongBaoId);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | | BigDecimal sharemoney = new BigDecimal(0);
|
| | | List<Long> hbIdList = new ArrayList<>();
|
| | | List<Long> recieveHongBaoIds = new ArrayList<>();
|
| | | int shareGoodsCount = 0;
|
| | | Set<String> shareOrders = new HashSet<>();
|
| | |
|
| | | for (HongBaoV2 hongBao : hongBaoList) {
|
| | |
| | | hbIdList.add(hongBao.getId());
|
| | | // 2018-08-05 过后的订单才处理维权
|
| | | HongBaoOrder hongBaoOrder = hongBaoOrderMapper.selectByHongBaoId(hongBao.getId());
|
| | | if (hongBaoOrder != null) {
|
| | | shareGoodsCount += hongBaoOrder.getCommonOrder().getCount();
|
| | | }
|
| | | shareOrders.add(hongBaoOrder.getCommonOrder().getOrderNo());
|
| | | }
|
| | | }
|
| | |
| | | if (sharemoney.compareTo(new BigDecimal(0)) > 0) {
|
| | | // 添加新版详情记录
|
| | | try {
|
| | | // 计算本月的有效订单,失效订单,维权订单
|
| | | Calendar ca = Calendar.getInstance();
|
| | |
|
| | | Date maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | ca.add(Calendar.MONTH, -1);
|
| | |
|
| | | Date minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(ca.get(Calendar.YEAR) + "-" + (ca.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | long validCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_JS,
|
| | | minDate, maxDate, sourceType);
|
| | | long weiQuanCount = hongBaoV2Mapper.countShareOrderCountByUidAndSettleTime(uid, CommonOrder.STATE_WQ,
|
| | | minDate, maxDate, sourceType);
|
| | |
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, (int) validCount,
|
| | | (int) weiQuanCount, sharemoney, new Date());
|
| | | UserMoneyDetail userMoneyDetail = UserMoneyDetailFactory.createShare(uid, sourceType, sharemoney,
|
| | | new Date());
|
| | | // 添加资金
|
| | | userMoneyService.addUserMoney(uid, sharemoney, userMoneyDetail);
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 新版通知
|
| | | userMoneyMsgNotificationService.shareOrderReceived(uid, Constant.SOURCE_TYPE_TAOBAO, shareOrders.size(),
|
| | | shareGoodsCount, sharemoney, userInfoMapper.selectAvailableByPrimaryKey(uid).getMyHongBao(), null,
|
| | | null);
|
| | | userMoneyMsgNotificationService.shareOrderReceived(uid, sourceType, sharemoney,
|
| | | userInfoMapper.selectAvailableByPrimaryKey(uid).getMyHongBao(), new Date());
|
| | | }
|
| | |
|
| | | hongBaoV2SettleTempService.addTemp(recieveHongBaoIds, key);
|
| | |
| | | // 所有的返利到账红包ID
|
| | | for (Long hongBaoId : recieveHongBaoIds) {
|
| | | try {
|
| | | HongBaoRecieveCMQManager.getInstance().addHongBaoRecieveMsg(hongBaoId);
|
| | | if (Constant.ENABLE_MQ)
|
| | | HongBaoRecieveCMQManager.getInstance().addHongBaoRecieveMsg(hongBaoId);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请补贴结算
|
| | | * |
| | | * @param orderId
|
| | | * @param sourceType
|
| | | * @throws ParamsException |
| | | * @throws TeamEincomeRecordException |
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void inviteSubsidySettle(Long uid, String taskKey)
|
| | | throws OrderMoneySettleException, TeamEincomeRecordException, ParamsException {
|
| | | teamSubsidyManager.addToTeamEincome(uid, taskKey);
|
| | | }
|
| | |
|
| | | private String getTaskKey(Long uid) {
|
| | | return uid + "-" + UUID.randomUUID().toString();
|