Merge remote-tracking branch 'origin/div' into div
1个文件已添加
17个文件已修改
4 文件已重命名
1个文件已删除
| | |
| | | List<InviteOrderSubsidy> listByOrderNoAndType(@Param("orderNo") String orderNo, @Param("type") Integer type);
|
| | |
|
| | | List<InviteOrderSubsidy> listByOrderNoAndTypeAndUid(@Param("orderNo") String orderNo, @Param("type") Integer type,
|
| | | Long uid);
|
| | | @Param("uid") Long uid);
|
| | |
|
| | | InviteOrderSubsidy selectByPrimaryKeyForUpdate(Long id);
|
| | |
|
| | |
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class TeamEincomeRecordException extends BaseException {
|
| | | |
| | |
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class TeamDividentsRecordException extends BaseException {
|
| | | |
| | | public final static int CODE_EXIST=1;
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | |
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.dto.order.dividents.UserDividentsDayDTO;
|
| | | import com.yeshi.fanli.dto.mq.UidDateDTO;
|
| | | import com.yeshi.fanli.entity.money.TeamEincomeRecord;
|
| | | import com.yeshi.fanli.service.inter.money.TeamEincomeRecordService;
|
| | | import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceUserService;
|
| | | import com.yeshi.fanli.service.manger.money.TeamEincomeManager;
|
| | | import com.yeshi.fanli.service.manger.order.TeamDividentsManager;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.cmq.order.TeamOrderCMQManager;
|
| | |
|
| | | //订单团队分红
|
| | | @Component
|
| | |
| | | @XxlJob("startPreOrderTeamDividentsHandler")
|
| | | public ReturnT<String> startPreDividents(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | if (!StringUtil.isNullOrEmpty(param)) {
|
| | | day = param;
|
| | | }
|
| | |
|
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"));
|
| | |
|
| | | long count = teamDividentsSourceOrderService.countCanSendUidByPreSendTime(preSendTime);
|
| | |
| | | for (int i = 0; i < totalPage; i++) {
|
| | | List<Long> list = teamDividentsSourceOrderService.listCanSendUidByPreSendTime(preSendTime, i + 1, pageSize);
|
| | | for (Long uid : list) {
|
| | | teamDividentsManager.startDividents(uid);
|
| | | teamDividentsManager.startDividents(uid, preSendTime);
|
| | | }
|
| | | }
|
| | | startAddDividentsRecord(preSendTime);
|
| | |
| | | }
|
| | |
|
| | | for (Long uid : targetUidList)
|
| | | CMQManager.getInstance().addTeamDividentsMsg(new UserDividentsDayDTO(uid, preSendTime));
|
| | | TeamOrderCMQManager.getInstance().addTeamDividentsPreMsg(new UidDateDTO(uid, preSendTime));
|
| | | }
|
| | |
|
| | | @XxlJob("addTeamIncomeTOUserAccountHandler")
|
| | | @XxlJob("addTeamDividentsTOUserAccountHandler")
|
| | | public ReturnT<String> addTeamIncomeTOUserAccount(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | if (!StringUtil.isNullOrEmpty(param)) {
|
| | | day = param;
|
| | | }
|
| | |
|
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"));
|
| | |
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_REWARD);
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_DIVIDENTS);
|
| | |
|
| | | long count = teamEincomeRecordService.countCanRecieveUid(preSendTime, typeList);
|
| | |
|
| | | int pageSize = 500;
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | for (int i = 0; i < totalPage; i++) {
|
| | | List<Long> list = teamEincomeRecordService.listCanRecieveUid(preSendTime, typeList, i * pageSize, pageSize);
|
| | | List<Long> list = teamEincomeRecordService.listCanRecieveUid(preSendTime, typeList, i +1, pageSize);
|
| | | for (Long uid : list) {
|
| | |
|
| | | TeamOrderCMQManager.getInstance().addTeamDividentsMsg(new UidDateDTO(uid, preSendTime));
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | |
| | | package com.yeshi.fanli.job.order;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.dto.mq.UidDateDTO;
|
| | | import com.yeshi.fanli.entity.money.TeamEincomeRecord;
|
| | | import com.yeshi.fanli.service.inter.money.TeamEincomeRecordService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceUserService;
|
| | | import com.yeshi.fanli.service.manger.order.TeamDividentsManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.cmq.order.TeamOrderCMQManager;
|
| | |
|
| | | //团队收益
|
| | | @Component
|
| | |
| | | @Resource
|
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | | @Resource
|
| | | private TeamEincomeRecordService teamEincomeRecordService;
|
| | |
|
| | | public OrderTeamIncomeJob() {
|
| | |
|
| | | }
|
| | |
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | @XxlJob("addTeamIncomeTOUserAccountHandler")
|
| | | public ReturnT<String> addTeamIncomeTOUserAccount(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | if (!StringUtil.isNullOrEmpty(param))
|
| | | day = param;
|
| | |
|
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"));
|
| | |
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_REWARD);
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
|
| | |
|
| | | long count = teamEincomeRecordService.countCanRecieveUid(preSendTime, typeList);
|
| | |
|
| | | int pageSize = 500;
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | for (int i = 0; i < totalPage; i++) {
|
| | | List<Long> list = teamEincomeRecordService.listCanRecieveUid(preSendTime, typeList, i + 1, pageSize);
|
| | | for (Long uid : list) {
|
| | | TeamOrderCMQManager.getInstance().addFanLiTeamIncomeMsg(new UidDateDTO(uid, preSendTime));
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.cmq.JDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.JDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | |
|
| | | //从淘宝爬去订单更新
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.cmq.PDDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.PDDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
|
| | | //从淘宝爬去订单更新
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/service/impl/order/InviteOrderSubsidyServiceImplV2.java |
| | |
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | |
|
| | | @Service
|
| | | public class InviteOrderSubsidyServiceImplV2 implements InviteOrderSubsidyService {
|
| | | public class InviteOrderSubsidyServiceImpl implements InviteOrderSubsidyService {
|
| | | @Resource
|
| | | private InviteOrderSubsidyMapper inviteOrderSubsidyMapper;
|
| | |
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleTB(Long uid,Date maxPregetTime) throws OrderMoneySettleException {
|
| | | public void shareSettleTB(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleJD(Long uid,Date maxPregetTime) throws OrderMoneySettleException {
|
| | | public void shareSettleJD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettlePDD(Long uid,Date maxPregetTime) throws OrderMoneySettleException {
|
| | | public void shareSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | | 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
|
| | |
| | | }
|
| | |
|
| | | // 新版通知
|
| | | 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());
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 新版通知
|
| | | 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);
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.cmq.PlaceOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.PlaceOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.TeamOrderCMQManager;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
| | | public void fanli(HongBaoV2 hb1) throws TaoBaoWeiQuanException {
|
| | | // 查询最新的红包数据
|
| | | hb1 = hongBaoV2Mapper.selectByPrimaryKeyForUpdate(hb1.getId());
|
| | |
|
| | | if (hb1 == null || hb1.getState() != HongBaoV2.STATE_KELINGQU || hb1.getPreGetTime() == null
|
| | | || hb1.getPreGetTime().getTime() > System.currentTimeMillis())
|
| | | return;
|
| | |
|
| | | // 正常用户才能到账
|
| | | UserInfo mainUser = userInfoMapper.selectAvailableByPrimaryKey(hb1.getUserInfo().getId());
|
| | | if (mainUser == null || mainUser.getState() != UserInfo.STATE_NORMAL) {
|
| | |
| | | Long uid = its.next();
|
| | | try {
|
| | | if (Constant.ENABLE_MQ)
|
| | | CMQManager.getInstance().addFanLiTeamIncomeMsg(new UidDateDTO(uid, maxTime));
|
| | | TeamOrderCMQManager.getInstance().addFanLiTeamIncomePreMsg(new UidDateDTO(uid, maxTime));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.error(e);
|
| | |
| | | TeamDividentsRecord old = teamDividentsRecordMapper.selectByUidAndDayForUpdate(record.getUid(),
|
| | | record.getDay());
|
| | | if (old != null)
|
| | | throw new TeamDividentsRecordException(1, "记录已存在");
|
| | | throw new TeamDividentsRecordException(TeamDividentsRecordException.CODE_EXIST, "记录已存在");
|
| | | // 加入记录
|
| | |
|
| | | if (record.getCreateTime() == null)
|
| | |
| | | userMoneyService.addUserMoney(uid, money, detail);
|
| | | // 发送消息
|
| | | BigDecimal balance = userMoneyService.getBalance(uid);
|
| | | userMoneyMsgNotificationService.teamReceive(uid, money, balance, now);
|
| | | userMoneyMsgNotificationService.teamDividend(uid, money, balance, now);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | // 是否可以分红
|
| | | private boolean isCanDividents(TeamUserLevelStatistic tus) {
|
| | | if (Constant.IS_TEST)
|
| | | if (Constant.IS_TEST && tus.getLevel() != UserLevelEnum.daRen && tus.getLevel() != UserLevelEnum.normalVIP)
|
| | | return true;
|
| | |
|
| | | if (tus != null && (tus.getLevel() == UserLevelEnum.highVIP || tus.getLevel() == UserLevelEnum.superVIP
|
| | |
| | | import com.qcloud.cmq.Message;
|
| | | import com.yeshi.fanli.dto.HongBao;
|
| | | import com.yeshi.fanli.dto.mq.UidDateDTO;
|
| | | import com.yeshi.fanli.dto.order.dividents.UserDividentsDayDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayTransferResultInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | |
| | | // 返利队列
|
| | | public static String FANLI_ORDER_NEW = "fanli-order-new";
|
| | |
|
| | | // 团队收益
|
| | | public static String FANLI_TEAM_INCOME_ORDER = "fanli-team-income-order";
|
| | |
|
| | |
|
| | | // 分享订单收益
|
| | | public static String FANLI_SHARE_ORDER = "fanli-team-income-order";
|
| | | public static String FANLI_SHARE_ORDER = "fanli-share-order";
|
| | |
|
| | | // 维权订单
|
| | | public static String ORDER_WEIQUAN = "weiquan-order";
|
| | |
| | | public static String GOODS_UPDATE = "goods_update_queue";
|
| | | // 重要数据更新
|
| | | public static String IMPORTANT_GOODS_UPDATE = "imp_goods_update_queue";
|
| | | // 团队分红
|
| | | public static String TEAM_DIVIDENTS = "team_dividents";
|
| | |
|
| | | static {
|
| | |
|
| | |
| | | PUSH_IOS = "test-" + PUSH_IOS;
|
| | | FANLI_ORDER = "test-" + FANLI_ORDER;
|
| | | FANLI_ORDER_NEW = "test-" + FANLI_ORDER_NEW;
|
| | | FANLI_TEAM_INCOME_ORDER = "test-" + FANLI_TEAM_INCOME_ORDER;
|
| | | |
| | | ORDER_WEIQUAN = "test-" + ORDER_WEIQUAN;
|
| | | IMPORTANT_GOODS_UPDATE = "test-" + IMPORTANT_GOODS_UPDATE;
|
| | | TEAM_DIVIDENTS = "test-" + TEAM_DIVIDENTS;
|
| | | FANLI_SHARE_ORDER = "test-" + FANLI_SHARE_ORDER;
|
| | | }
|
| | |
|
| | |
| | | PUSH_IOS += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_ORDER_NEW += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_TEAM_INCOME_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | ORDER_WEIQUAN += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | IMPORTANT_GOODS_UPDATE += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | TEAM_DIVIDENTS += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_SHARE_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
| | |
|
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey);
|
| | |
| | | cmqUtil.createQueue(PUSH_IOS);
|
| | | cmqUtil.createQueue(FANLI_ORDER);
|
| | | cmqUtil.createQueue(FANLI_ORDER_NEW);
|
| | | cmqUtil.createQueue(FANLI_TEAM_INCOME_ORDER);
|
| | | |
| | | cmqUtil.createQueue(ORDER_WEIQUAN);
|
| | | cmqUtil.createQueue(GOODS_UPDATE);
|
| | | cmqUtil.createQueue(IMPORTANT_GOODS_UPDATE);
|
| | | cmqUtil.createQueue(TEAM_DIVIDENTS);
|
| | |
|
| | | cmqUtil.createQueue(FANLI_SHARE_ORDER);
|
| | | }
|
| | |
|
| | |
| | | cmqUtil.deleteMsg(FANLI_ORDER_NEW, receiptHandle);
|
| | | }
|
| | |
|
| | | // 团队收益
|
| | | public void addFanLiTeamIncomeMsg(UidDateDTO dto) {
|
| | | cmqUtil.sendMsg(FANLI_TEAM_INCOME_ORDER, new Gson().toJson(dto) + "");
|
| | | }
|
| | |
|
| | | public Map<String, UidDateDTO> consumeFanLiTeamIncomeMsg(int count) {
|
| | | List<Message> list = cmqUtil.recieveMsg(count, FANLI_TEAM_INCOME_ORDER);
|
| | | Map<String, UidDateDTO> map = new HashMap<>();
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | UidDateDTO dto = new Gson().fromJson(result, UidDateDTO.class);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | map.put(msg.receiptHandle, dto);
|
| | | }
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteTeamIncomeMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(FANLI_TEAM_INCOME_ORDER, receiptHandle);
|
| | | }
|
| | | |
| | |
|
| | | // 分享订单收益
|
| | | public void addFanLiShareMsg(UidDateDTO dto) {
|
| | |
| | | */
|
| | | public void deleteTBImpGoodsUpdateMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(IMPORTANT_GOODS_UPDATE, receiptHandle);
|
| | | }
|
| | |
|
| | | // 团队分红
|
| | | public void addTeamDividentsMsg(UserDividentsDayDTO dto) {
|
| | | cmqUtil.sendMsg(TEAM_DIVIDENTS, new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | public Map<String, UserDividentsDayDTO> consumeTeamDividentsMsg(int count) {
|
| | | Gson gson = new Gson();
|
| | | List<Message> list = cmqUtil.recieveMsg(count, TEAM_DIVIDENTS);
|
| | | Map<String, UserDividentsDayDTO> map = new HashMap<>();
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | map.put(msg.receiptHandle, gson.fromJson(result, UserDividentsDayDTO.class));
|
| | | }
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteTeamDividentsMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(TEAM_DIVIDENTS, receiptHandle);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.ad.DouYinDeviceActiveQueueDTO;
|
| | | import com.yeshi.fanli.dto.money.UserMoneyChangeDTO;
|
| | | import com.yeshi.fanli.dto.mq.UidDateDTO;
|
| | | import com.yeshi.fanli.dto.order.dividents.UserDividentsDayDTO;
|
| | | import com.yeshi.fanli.entity.ad.DouYinClickEvent;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayTransferResultInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | | import com.yeshi.fanli.exception.order.TaoBaoWeiQuanException;
|
| | | import com.yeshi.fanli.exception.order.dividents.TeamDividentsRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.ad.DouYinClickEventService;
|
| | | import com.yeshi.fanli.service.inter.lable.BoutiqueAutoRuleService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.manger.money.TeamEincomeManager;
|
| | | import com.yeshi.fanli.service.manger.order.TeamDividentsManager;
|
| | | import com.yeshi.fanli.util.ad.DouYinAdUtil;
|
| | | import com.yeshi.fanli.util.cmq.DouYinDeviceActiveCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.HongBaoRecieveCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.JDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.PDDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.PlaceOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.UserMoneyChangeCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.JDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.PDDOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.PlaceOrderCMQManager;
|
| | | import com.yeshi.fanli.util.cmq.order.TeamOrderCMQManager;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | /**
|
| | |
| | | @Resource
|
| | | private TeamDividentsManager teamDividentsManager;
|
| | |
|
| | | @Resource
|
| | | private TeamEincomeManager teamEincomeManager;
|
| | |
|
| | | private static boolean isInited = false;
|
| | |
|
| | | public void onApplicationEvent(ContextRefreshedEvent arg0) {
|
| | |
| | | doTaoBaoOrders();// 处理淘宝订单
|
| | | doTaoBaoNewOrders();// 处理淘宝订单(刚刚产生的)
|
| | | doOrderFanLiNew();// 新版返利
|
| | | doOrderTeamIncomeFanLi();// 处理订单提成返利
|
| | |
|
| | | doOrderShareFanLi();
|
| | | doWeiQuanOrder();// 处理维权订单
|
| | | doPushIOS();// 处理发送IOS消息
|
| | |
| | | doHongBaoRecieveIntegralGetJob();// 返利到账,金币增加
|
| | | // doPlaceOrderIntegralJob();// 下单赠送金币任务
|
| | | // doDouYinDeviceActiveJob();// 抖音设备激活广告监测
|
| | | doOrderTeamIncomePreFanLi();// 处理订单提成返利
|
| | | doDividentsPreJob();
|
| | |
|
| | | doOrderTeamIncomeFanLi();
|
| | | doDividentsJob();
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /**
|
| | | * 处理团队订单返利
|
| | | */
|
| | | public void doOrderTeamIncomeFanLi() {
|
| | | public void doOrderTeamIncomePreFanLi() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | try {
|
| | | Map<String, UidDateDTO> map = CMQManager.getInstance().consumeFanLiTeamIncomeMsg(16);
|
| | | Map<String, UidDateDTO> map = TeamOrderCMQManager.getInstance()
|
| | | .consumeFanLiTeamIncomePreMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | |
| | | try {
|
| | | UidDateDTO dto = map.get(handler);
|
| | | orderProcessService.fanliPreInvaite(dto.getUid(), dto.getDate());
|
| | | CMQManager.getInstance().deleteTeamIncomeMsg(handler);
|
| | | TeamOrderCMQManager.getInstance().deleteTeamIncomePreMsg(handler);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, map.get(handler).toString(), "");
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 处理团队订单返利
|
| | | */
|
| | | public void doOrderTeamIncomeFanLi() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | try {
|
| | | Map<String, UidDateDTO> map = TeamOrderCMQManager.getInstance().consumeFanLiTeamIncomeMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String handler = its.next();
|
| | | try {
|
| | | UidDateDTO dto = map.get(handler);
|
| | | teamEincomeManager.addTeamIncomeTOUserAccount(dto.getDate(), dto.getUid());
|
| | | TeamOrderCMQManager.getInstance().deleteTeamIncomeMsg(handler);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, map.get(handler).toString(), "");
|
| | |
| | | }
|
| | |
|
| | | // 分红
|
| | | public void doDividentsPreJob() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | Map<String, UidDateDTO> map = TeamOrderCMQManager.getInstance().consumeTeamDividentsPreMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | UidDateDTO dto = map.get(key);
|
| | | try {
|
| | | teamDividentsManager.addToTeamEincome(dto.getUid(), dto.getDate());
|
| | | TeamOrderCMQManager.getInstance().deleteTeamDividentsPreMsg(key);
|
| | | } catch (TeamDividentsRecordException e1) {
|
| | | if (e1.getCode() == TeamDividentsRecordException.CODE_EXIST) {
|
| | | TeamOrderCMQManager.getInstance().deleteTeamDividentsPreMsg(key);
|
| | | } else {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e1);
|
| | | } catch (Exception e2) {
|
| | | e2.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | } finally {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | // 分红
|
| | | public void doDividentsJob() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | Map<String, UserDividentsDayDTO> map = CMQManager.getInstance().consumeTeamDividentsMsg(16);
|
| | | Map<String, UidDateDTO> map = TeamOrderCMQManager.getInstance().consumeTeamDividentsMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | UserDividentsDayDTO dto = map.get(key);
|
| | | UidDateDTO dto = map.get(key);
|
| | | try {
|
| | | teamDividentsManager.addToTeamEincome(dto.getUid(), dto.getPreGetTime());
|
| | | teamEincomeManager.addTeamDividentsTOUserAccount(dto.getDate(), dto.getUid());
|
| | | TeamOrderCMQManager.getInstance().deleteTeamDividentsMsg(key);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/util/cmq/JDOrderCMQManager.java |
| | |
| | | package com.yeshi.fanli.util.cmq;
|
| | | package com.yeshi.fanli.util.cmq.order;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/util/cmq/PDDOrderCMQManager.java |
| | |
| | | package com.yeshi.fanli.util.cmq;
|
| | | package com.yeshi.fanli.util.cmq.order;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
File was renamed from fanli/src/main/java/com/yeshi/fanli/util/cmq/PlaceOrderCMQManager.java |
| | |
| | | package com.yeshi.fanli.util.cmq;
|
| | | package com.yeshi.fanli.util.cmq.order;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
New file |
| | |
| | | package com.yeshi.fanli.util.cmq.order;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.yeshi.utils.CMQUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.qcloud.cmq.Message;
|
| | | import com.yeshi.fanli.dto.mq.UidDateDTO;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public class TeamOrderCMQManager {
|
| | |
|
| | | private static String secretId = "AKIDTlpgJhLjOozvd6QI2XnpfGbgV4NQJk25";
|
| | | private static String secretKey = "xhCSUHo55oHUQ6XicFcmfIgspX0EEzWo";
|
| | | private static TeamOrderCMQManager jdOrderCMQManager;
|
| | | private static CMQUtil cmqUtil;
|
| | |
|
| | | // 团队分红
|
| | | public static String TEAM_DIVIDENTS_PRE = "team_dividents_pre";
|
| | | // 团队收益
|
| | | public static String FANLI_TEAM_INCOME_ORDER_PRE = "fanli-team-income-order-pre";
|
| | |
|
| | | // 团队分红
|
| | | public static String TEAM_DIVIDENTS = "team_dividents";
|
| | | // 团队收益
|
| | | public static String FANLI_TEAM_INCOME_ORDER = "fanli-team-income-order";
|
| | |
|
| | | static {
|
| | | cmqUtil = CMQUtil.getInstance(secretId, secretKey);
|
| | | if (Constant.IS_TEST) {
|
| | | TEAM_DIVIDENTS_PRE = "test-" + TEAM_DIVIDENTS_PRE;
|
| | | FANLI_TEAM_INCOME_ORDER_PRE = "test-" + FANLI_TEAM_INCOME_ORDER_PRE;
|
| | | TEAM_DIVIDENTS = "test-" + TEAM_DIVIDENTS;
|
| | | FANLI_TEAM_INCOME_ORDER = "test-" + FANLI_TEAM_INCOME_ORDER;
|
| | | }
|
| | |
|
| | | TEAM_DIVIDENTS_PRE += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_TEAM_INCOME_ORDER_PRE += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | TEAM_DIVIDENTS += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_TEAM_INCOME_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | cmqUtil.createQueue(TEAM_DIVIDENTS_PRE);
|
| | | cmqUtil.createQueue(FANLI_TEAM_INCOME_ORDER_PRE);
|
| | | cmqUtil.createQueue(TEAM_DIVIDENTS);
|
| | | cmqUtil.createQueue(FANLI_TEAM_INCOME_ORDER);
|
| | | }
|
| | |
|
| | | public static TeamOrderCMQManager getInstance() {
|
| | | if (jdOrderCMQManager == null)
|
| | | jdOrderCMQManager = new TeamOrderCMQManager();
|
| | | return jdOrderCMQManager;
|
| | | }
|
| | |
|
| | | // 团队分红预到账
|
| | | public void addTeamDividentsPreMsg(UidDateDTO dto) {
|
| | | cmqUtil.sendMsg(TEAM_DIVIDENTS_PRE, new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | public Map<String, UidDateDTO> consumeTeamDividentsPreMsg(int count) {
|
| | | Gson gson = new Gson();
|
| | | List<Message> list = cmqUtil.recieveMsg(count, TEAM_DIVIDENTS_PRE);
|
| | | Map<String, UidDateDTO> map = new HashMap<>();
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | map.put(msg.receiptHandle, gson.fromJson(result, UidDateDTO.class));
|
| | | }
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteTeamDividentsPreMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(TEAM_DIVIDENTS_PRE, receiptHandle);
|
| | | }
|
| | |
|
| | | // 团队收益预到账
|
| | | public void addFanLiTeamIncomePreMsg(UidDateDTO dto) {
|
| | | cmqUtil.sendMsg(FANLI_TEAM_INCOME_ORDER_PRE, new Gson().toJson(dto) + "");
|
| | | }
|
| | |
|
| | | public Map<String, UidDateDTO> consumeFanLiTeamIncomePreMsg(int count) {
|
| | | List<Message> list = cmqUtil.recieveMsg(count, FANLI_TEAM_INCOME_ORDER_PRE);
|
| | | Map<String, UidDateDTO> map = new HashMap<>();
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | UidDateDTO dto = new Gson().fromJson(result, UidDateDTO.class);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | map.put(msg.receiptHandle, dto);
|
| | | }
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteTeamIncomePreMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(FANLI_TEAM_INCOME_ORDER_PRE, receiptHandle);
|
| | | }
|
| | |
|
| | | // 团队分红到账
|
| | | public void addTeamDividentsMsg(UidDateDTO dto) {
|
| | | cmqUtil.sendMsg(TEAM_DIVIDENTS, new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | public Map<String, UidDateDTO> consumeTeamDividentsMsg(int count) {
|
| | | Gson gson = new Gson();
|
| | | List<Message> list = cmqUtil.recieveMsg(count, TEAM_DIVIDENTS);
|
| | | Map<String, UidDateDTO> map = new HashMap<>();
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | map.put(msg.receiptHandle, gson.fromJson(result, UidDateDTO.class));
|
| | | }
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteTeamDividentsMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(TEAM_DIVIDENTS, receiptHandle);
|
| | | }
|
| | |
|
| | | // 团队收益到账
|
| | | public void addFanLiTeamIncomeMsg(UidDateDTO dto) {
|
| | | cmqUtil.sendMsg(FANLI_TEAM_INCOME_ORDER, new Gson().toJson(dto) + "");
|
| | | }
|
| | |
|
| | | public Map<String, UidDateDTO> consumeFanLiTeamIncomeMsg(int count) {
|
| | | List<Message> list = cmqUtil.recieveMsg(count, FANLI_TEAM_INCOME_ORDER);
|
| | | Map<String, UidDateDTO> map = new HashMap<>();
|
| | | if (list != null)
|
| | | for (Message msg : list) {
|
| | | String result = msg.msgBody;
|
| | | UidDateDTO dto = new Gson().fromJson(result, UidDateDTO.class);
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | map.put(msg.receiptHandle, dto);
|
| | | }
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteTeamIncomeMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(FANLI_TEAM_INCOME_ORDER, receiptHandle);
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.order.OrderMoneySettleService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponRecordService;
|
| | | 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.rocketmq.MQTopicName;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
|
| | | // 团队奖励开始时间
|
| | | private static final long TEAM_REWARD_START_TIME = TimeUtil.convertToTimeTemp("2019-04-15", "yyyy-MM-dd");
|
| | |
|
| | | |
| | | public InviteOrderSubsidyMessageListener() {
|
| | |
|
| | | }
|
| | |
| | | if (dto != null) {
|
| | | // 查询出订单创建时间
|
| | | Date orderTime = commonOrderService.getThirdCreateTime(dto.getOrderId(), dto.getType());
|
| | | if (orderTime.getTime() >= TEAM_REWARD_START_TIME) {
|
| | | if (orderTime.getTime() >= Constant.NEW_ORDER_FANLI_RULE_TIME) {
|
| | | try {
|
| | | teamSubsidyManager.addOrUpdateOrder(dto.getOrderId(), dto.getType());
|
| | | return Action.CommitMessage;
|
| | |
| | | } catch (ParamsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | return Action.ReconsumeLater;
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
| | | } else if (dto.getType() == OrderMoneyRecievedMQMsg.TYPE_SHARE) {// 分享到账
|
| | | // 会员升级-分享订单数量验证
|
| | | userVIPPreInfoService.upgradeVipByShareOrder(dto.getUid());
|
| | | } |
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(OrderTopicTagEnum.orderConfirm.name())) {
|
| | | OrderConfirmMQMsg dto = new Gson().fromJson(new String(message.getBody()),OrderConfirmMQMsg.class);
|
| | | if (dto != null) {
|
| | | // 会员等级升级-粉丝数量验证
|
| | | userVIPPreInfoService.upgradeVipByTeamNum(dto.getSourceUid());
|
| | | userInviteValidNumService.addValidTeamNum(dto.getSourceUid(), dto.getSettleMent(), dto.getPlaceOrderTime());
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | <bean id="inviteOrderSubsidyMsgListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.order.InviteOrderSubsidyMessageListener"></bean> <!--Listener 配置 -->
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="orderTransactionConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | <bean id="inviteOrderSubsidyConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">${rocketmq.AccessKey}</prop>
|
| | | <prop key="SecretKey">${rocketmq.SecretKey}</prop>
|
| | | <prop key="GROUP_ID">GID_ORDER</prop>
|
| | | <prop key="GROUP_ID">GID_INVITE_ORDER_SUBSIDY</prop>
|
| | | <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
|
| | | <!--将消费者线程数固定为 50 个 <prop key="ConsumeThreadNums">50</prop> -->
|
| | | </props>
|
| | |
| | | </property>
|
| | | </bean>
|
| | |
|
| | |
|
| | | <!-- 产生有效队员 -->
|
| | | <bean id="inviteValidTeamMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.user.InviteValidTeamMessageListener"></bean>
|
| | | <!-- Group ID 订阅同一个 Topic,可以创建多个 ConsumerBean -->
|
| | | <bean id="inviteValidTeamConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">${rocketmq.AccessKey}</prop>
|
| | | <prop key="SecretKey">${rocketmq.SecretKey}</prop>
|
| | | <prop key="GROUP_ID">GID_INVITE_VALID_TEAM</prop>
|
| | | <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
|
| | | <prop key="ConsumeThreadNums">50</prop>
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <!-- 订单收货 -->
|
| | | <entry value-ref="inviteValidTeamMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_ORDER" />
|
| | | <property name="expression" value="orderConfirm" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | | <!--团队分红消息订阅 -->
|
| | | <bean id="orderDividentsMessageListener"
|