| | |
| | | List<HongBaoV2> listCanBalanceHongBaoByType(@Param("type") int type, @Param("count") int count); |
| | | |
| | | /** |
| | | * 获取能够结算的分享赚和邀请赚的用户列表 |
| | | * 获取能够结算的红包的用户列表 |
| | | * |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<Long> listUidCanBanlanceShareAndInvite(int count); |
| | | List<Long> listUidCanBanlanceByTypeAndMaxTime(@Param("typeList") List<Integer> typeList, |
| | | @Param("maxTime") Date maxTime, @Param("start") long start, @Param("count") int count); |
| | | |
| | | long countUidCanBanlanceByTypeAndMaxTime(@Param("typeList") List<Integer> typeList, |
| | | @Param("maxTime") Date maxTime); |
| | | |
| | | /** |
| | | * 根据用户ID,类型获取能够结算的红包 |
| | |
| | | TeamEincomeRecord selectByPrimaryKeyForUpdate(Long id); |
| | | |
| | | List<TeamEincomeRecord> listByUidAndPreRecieveTimeAndState(@Param("uid") Long uid, |
| | | @Param("preRecieveTime") Date preRecieveTime, @Param("state") int state); |
| | | @Param("preRecieveTime") Date preRecieveTime, @Param("typeList") List<Integer> typeList, |
| | | @Param("state") int state); |
| | | |
| | | public List<Long> listCanRecieveUid(@Param("preRecieveTime") Date preRecieveTime, |
| | | @Param("typeList") List<Integer> typeList,@Param("start") long start,@Param("count")int count); |
| | | |
| | | public long countCanRecieveUid(@Param("preRecieveTime") Date preRecieveTime, |
| | | @Param("typeList") List<Integer> typeList); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dto.mq;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | public class UidDateDTO {
|
| | | private Long uid;
|
| | | private Date date;
|
| | |
|
| | | public UidDateDTO(Long uid, Date date) {
|
| | | super();
|
| | | this.uid = uid;
|
| | | this.date = date;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Date getDate() {
|
| | | return date;
|
| | | }
|
| | |
|
| | | public void setDate(Date date) {
|
| | | this.date = date;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.job.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | 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.TimeUtil;
|
| | |
|
| | | //分享赚到账
|
| | | @Component
|
| | | public class OrderShareIncomeJob {
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsManager teamDividentsManager;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceOrderService teamDividentsSourceOrderService;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService;
|
| | |
|
| | | @Resource
|
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | | public OrderShareIncomeJob() {
|
| | |
|
| | | }
|
| | |
|
| | | // 分享赚到账
|
| | | @XxlJob("startOrderShareIncomeHandler")
|
| | | public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"));
|
| | | orderProcessService.fanliShare(preSendTime);
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | 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.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.TimeUtil;
|
| | |
|
| | | //订单团队分红
|
| | |
| | | @Resource
|
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService;
|
| | |
|
| | | @Resource
|
| | | private TeamEincomeManager teamEincomeManager;
|
| | |
|
| | | @Resource
|
| | | private TeamEincomeRecordService teamEincomeRecordService;
|
| | |
|
| | | public OrderTeamDividentsJob() {
|
| | |
|
| | | }
|
| | |
|
| | | // 开始分红,每月25号执行
|
| | | @XxlJob("startOrderTeamDividents")
|
| | | public ReturnT<String> startDividents(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd");
|
| | | // 预分红
|
| | | @XxlJob("startPreOrderTeamDividentsHandler")
|
| | | public ReturnT<String> startPreDividents(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"));
|
| | |
|
| | | long count = teamDividentsSourceOrderService.countCanSendUidByPreSendTime(preSendTime);
|
| | |
| | | teamDividentsManager.startDividents(uid);
|
| | | }
|
| | | }
|
| | | startAddDividentsRecord(day);
|
| | | startAddDividentsRecord(preSendTime);
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | private void startAddDividentsRecord(String day) {
|
| | | private void startAddDividentsRecord(Date preSendTime) {
|
| | | String day = TimeUtil.getGernalTime(preSendTime.getTime(), "yyyy-MM-dd");
|
| | | if (!teamDividentsManager.isSourceUserComupteFinish(day))
|
| | | return;
|
| | | // 统计资金
|
| | |
| | | targetUidList.addAll(uidList);
|
| | | }
|
| | |
|
| | | // for (Long uid : targetUidList)
|
| | | // CMQManager.getInstance().addTeamDividentsMsg(new
|
| | | // UserDividentsDayDTO(uid, day));
|
| | | for (Long uid : targetUidList)
|
| | | CMQManager.getInstance().addTeamDividentsMsg(new UserDividentsDayDTO(uid, preSendTime));
|
| | | }
|
| | |
|
| | | @XxlJob("addTeamIncomeTOUserAccountHandler")
|
| | | public ReturnT<String> addTeamIncomeTOUserAccount(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | 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 * pageSize, pageSize);
|
| | | for (Long uid : list) {
|
| | |
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.job.order;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | 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.TimeUtil;
|
| | |
|
| | | //团队收益
|
| | | @Component
|
| | | public class OrderTeamIncomeJob {
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsManager teamDividentsManager;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceOrderService teamDividentsSourceOrderService;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService;
|
| | |
|
| | | @Resource
|
| | | private OrderProcessService orderProcessService;
|
| | |
|
| | | public OrderTeamIncomeJob() {
|
| | |
|
| | | }
|
| | |
|
| | | // 预分红
|
| | | @XxlJob("startPreOrderTeamIncomeHandler")
|
| | | public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception {
|
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25";
|
| | | Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"));
|
| | | orderProcessService.fanliPreInvaite(preSendTime);
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | orderProcessService.fanli();
|
| | | }
|
| | |
|
| | | // 每月25号9点执行返利
|
| | | // @Scheduled(cron = "0 0 9 25 * ? ")
|
| | | @XxlJob("fanliInvaiteAndShareHandler")
|
| | | public ReturnT<String> fanliInvaiteAndShareHandler(String param) throws Exception {
|
| | | if (StringUtil.isNullOrEmpty(param))
|
| | | orderProcessService.fanliInvaiteAndShare();
|
| | | else
|
| | | orderProcessService.fanliInvaiteAndShare(Long.parseLong(param));
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | // 维权订单处理-处理最近60天的
|
| | | // 30分钟一次
|
| | | @Scheduled(cron = "0 0/30 * * * ? ")
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="listUidCanBanlanceShareAndInvite" resultType="java.lang.Long"
|
| | | parameterType="java.lang.Integer">
|
| | |
|
| | | <select id="listUidCanBanlanceByTypeAndMaxTime" resultType="java.lang.Long">
|
| | | SELECT DISTINCT( h.`hb_uid`) FROM yeshi_ec_hongbao_v2 h
|
| | | WHERE
|
| | | (`hb_type`=6 OR
|
| | | `hb_type`=7 OR `hb_type`=20 OR `hb_type`=21 OR
|
| | | `hb_type`=22 ) AND
|
| | |
|
| | | <if test="typeList!=null">
|
| | | <foreach collection="typeList" item="type" open="(" close=") and "
|
| | | separator=" or ">
|
| | | hb_type=#{type}
|
| | | </foreach>
|
| | | </if>
|
| | | |
| | | `hb_version`=2 AND (hb_state=1 OR hb_state=2) AND
|
| | | hb_pre_get_time IS
|
| | | NOT NULL AND hb_pre_get_time>0 AND
|
| | | NOW()>=hb_pre_get_time limit #{0}
|
| | |
|
| | | #{maxTime}>=hb_pre_get_time limit
|
| | | #{start},#{count}
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countUidCanBanlanceByTypeAndMaxTime" resultType="java.lang.Long">
|
| | | SELECT count(DISTINCT( h.`hb_uid`)) FROM yeshi_ec_hongbao_v2 h
|
| | | WHERE
|
| | |
|
| | | <if test="typeList!=null">
|
| | | <foreach collection="typeList" item="type" open="(" close=") and "
|
| | | separator=" or ">
|
| | | hb_type=#{type}
|
| | | </foreach>
|
| | | </if>
|
| | |
|
| | | `hb_version`=2 AND (hb_state=1 OR hb_state=2) AND
|
| | | hb_pre_get_time IS
|
| | | NOT NULL AND hb_pre_get_time>0 AND
|
| | | #{maxTime}>=hb_pre_get_time
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | <select id="listCanBalanceHongBaoByTypeAndUid" resultMap="BaseResultMap">
|
| | |
| | | <if test="uid!=null">
|
| | | and hb_uid=#{uid}
|
| | | </if>
|
| | | |
| | |
|
| | | <if test="orderType!=null">
|
| | | and hb_order_type=#{orderType}
|
| | | </if>
|
| | |
| | | count(hb_id)
|
| | | from yeshi_ec_hongbao_v2 where hb_uid=#{uid} and
|
| | | `hb_version`=2
|
| | | |
| | |
|
| | | <if test="orderType!=null">
|
| | | and hb_order_type=#{orderType}
|
| | | </if>
|
| | |
| | | v.hb_id=#{id}
|
| | | </foreach>
|
| | | </select>
|
| | | |
| | | |
| | |
|
| | |
|
| | | <select id="listByOrderTradeId" resultMap="BaseDTOResultMap">
|
| | | SELECT v2.*,d.`co_settlement` AS settlement FROM `yeshi_ec_common_order` d
|
| | | SELECT
|
| | | v2.*,d.`co_settlement` AS settlement FROM `yeshi_ec_common_order` d
|
| | | LEFT JOIN `yeshi_ec_hongbao_order` ho ON ho.`ho_order_id` = d.`co_id`
|
| | | LEFT JOIN `yeshi_ec_hongbao_v2` v2 ON IF(v2.`hb_pid` IS NULL, v2.`hb_id`,v2.`hb_pid`) = ho.`ho_hongbao_id`
|
| | | WHERE d.`co_trade_id` = #{tradeId}
|
| | | LEFT JOIN `yeshi_ec_hongbao_v2` v2 ON IF(v2.`hb_pid` IS NULL,
|
| | | v2.`hb_id`,v2.`hb_pid`) = ho.`ho_hongbao_id`
|
| | | WHERE d.`co_trade_id` =
|
| | | #{tradeId}
|
| | | </select>
|
| | |
|
| | |
|
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_team_income where ti_uid = #{uid} and |
| | | ti_pre_recieve_time=#{preRecieveTime} and ti_state=#{state} |
| | | |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | ti_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="listCanRecieveUid" resultType="java.lang.Long"> |
| | | select |
| | | distinct(ti_uid) |
| | | from yeshi_ec_team_income where |
| | | ti_pre_recieve_time=#{preRecieveTime} |
| | | and ti_state=1 |
| | | |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | ti_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | |
| | | limit #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countCanRecieveUid" resultType="java.lang.Long"> |
| | | select |
| | | count( distinct(ti_uid)) |
| | | from yeshi_ec_team_income where |
| | | ti_pre_recieve_time=#{preRecieveTime} and ti_state=1 |
| | | |
| | | <if test="typeList!=null"> |
| | | <foreach collection="typeList" item="type" open=" and (" |
| | | separator=" or " close=")"> |
| | | ti_type=#{type} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | |
| | | package com.yeshi.fanli.service.impl.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TeamEincomeRecord> listCanRecieveRecord(Date preRecieveTime, Long uid) {
|
| | | public List<TeamEincomeRecord> listCanRecieveRecord(Date preRecieveTime, Long uid, List<Integer> typeList) {
|
| | |
|
| | | return teamEincomeRecordMapper.listByUidAndPreRecieveTimeAndState(uid, preRecieveTime,
|
| | | return teamEincomeRecordMapper.listByUidAndPreRecieveTimeAndState(uid, preRecieveTime, typeList,
|
| | | TeamEincomeRecord.STATE_NOT_RECIEVE);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public BigDecimal getEstimateDividents(Date preGetTime, Long uid) {
|
| | | List<Integer> typeList = new ArrayList<Integer>();
|
| | | List<TeamEincomeRecord> list = listCanRecieveRecord(preGetTime, uid, typeList);
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | if (list != null)
|
| | | for (TeamEincomeRecord record : list) {
|
| | | money = money.add(record.getMoney());
|
| | | }
|
| | | return money;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Long> listCanRecieveUid(Date preRecieveTime, List<Integer> typeList, int page, int pageSize) {
|
| | | return teamEincomeRecordMapper.listCanRecieveUid(preRecieveTime, typeList, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countCanRecieveUid(Date preRecieveTime, List<Integer> typeList) {
|
| | | return teamEincomeRecordMapper.countCanRecieveUid(preRecieveTime, typeList);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | |
|
| | | @Service
|
| | | public class InviteOrderSubsidyServiceImplV2 implements InviteOrderSubsidyService {
|
| | |
| | | return;
|
| | |
|
| | | int urank = firstOrder.getUrank();
|
| | | UserLevelEnum buyerUserLevel = null;
|
| | | for (UserLevelEnum level : UserLevelEnum.values())
|
| | | if (level.getOrderRank() == urank)
|
| | | buyerUserLevel = level;
|
| | |
|
| | | UserLevelEnum buyerUserLevel = UserLevelUtil.getByOrderRank(urank);
|
| | | if (buyerUserLevel == null)
|
| | | throw new InviteOrderSubsidyException(11, "用户等级为空");
|
| | |
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleTB(Long uid) throws OrderMoneySettleException {
|
| | | Date maxPregetTime = new Date();
|
| | | public void shareSettleTB(Long uid,Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettleJD(Long uid) throws OrderMoneySettleException {
|
| | | Date maxPregetTime = new Date();
|
| | | public void shareSettleJD(Long uid,Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void shareSettlePDD(Long uid) throws OrderMoneySettleException {
|
| | | Date maxPregetTime = new Date();
|
| | | public void shareSettlePDD(Long uid,Date maxPregetTime) throws OrderMoneySettleException {
|
| | | /**
|
| | | * 处理分享赚
|
| | | */
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.HongBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.mq.UidDateDTO;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void fanliInvaiteAndShare() {
|
| | | // 查出邀请赚与分享赚该返利的用户ID
|
| | | List<Long> inviteAndShareUids = hongBaoV2Mapper.listUidCanBanlanceShareAndInvite(1000);
|
| | | public void fanliPreInvaite(Date maxTime) {
|
| | | // 查出邀请赚的用户ID
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(HongBaoV2.TYPE_YIJI);
|
| | | typeList.add(HongBaoV2.TYPE_ERJI);
|
| | | typeList.add(HongBaoV2.TYPE_SHARE_YIJI);
|
| | | typeList.add(HongBaoV2.TYPE_SHARE_ERJI);
|
| | |
|
| | | long count = hongBaoV2Mapper.countUidCanBanlanceByTypeAndMaxTime(typeList, maxTime);
|
| | | int pageSize = 1000;
|
| | | int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | Set<Long> uidSets = new HashSet<>();
|
| | | if (inviteAndShareUids != null)
|
| | | for (Long uid : inviteAndShareUids) {
|
| | | if (userInfoMapper.selectAvailableByPrimaryKey(uid) != null)
|
| | | uidSets.add(uid);
|
| | | }
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<Long> inviteAndShareUids = hongBaoV2Mapper.listUidCanBanlanceByTypeAndMaxTime(typeList, maxTime,
|
| | | i * pageSize, pageSize);
|
| | | if (inviteAndShareUids != null)
|
| | | for (Long uid : inviteAndShareUids) {
|
| | | if (userInfoMapper.selectAvailableByPrimaryKey(uid) != null)
|
| | | uidSets.add(uid);
|
| | | }
|
| | | }
|
| | | // 根据用户ID
|
| | | Iterator<Long> its = uidSets.iterator();
|
| | | while (its.hasNext()) {
|
| | | Long uid = its.next();
|
| | | try {
|
| | | if (Constant.ENABLE_MQ)
|
| | | CMQManager.getInstance().addFanLiTiChengMsg(uid);
|
| | | CMQManager.getInstance().addFanLiTeamIncomeMsg(new UidDateDTO(uid, maxTime));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.error(e);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void fanliInvaiteAndShare(Long uid) throws TaoBaoWeiQuanException {
|
| | | // 邀请赚到账
|
| | | Date now = new Date();
|
| | | try {
|
| | | orderMoneySettleService.inviteSettleTB(uid, now);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | public void fanliShare(Date maxTime) {
|
| | | // 查出邀请赚的用户ID
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(HongBaoV2.TYPE_SHARE_GOODS);
|
| | |
|
| | | long count = hongBaoV2Mapper.countUidCanBanlanceByTypeAndMaxTime(typeList, maxTime);
|
| | | int pageSize = 1000;
|
| | | int page = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | Set<Long> uidSets = new HashSet<>();
|
| | | for (int i = 0; i < page; i++) {
|
| | | List<Long> inviteAndShareUids = hongBaoV2Mapper.listUidCanBanlanceByTypeAndMaxTime(typeList, maxTime,
|
| | | i * pageSize, pageSize);
|
| | | if (inviteAndShareUids != null)
|
| | | for (Long uid : inviteAndShareUids) {
|
| | | if (userInfoMapper.selectAvailableByPrimaryKey(uid) != null)
|
| | | uidSets.add(uid);
|
| | | }
|
| | | }
|
| | | // 根据用户ID
|
| | | Iterator<Long> its = uidSets.iterator();
|
| | | while (its.hasNext()) {
|
| | | Long uid = its.next();
|
| | | try {
|
| | | if (Constant.ENABLE_MQ)
|
| | | CMQManager.getInstance().addFanLiShareMsg(new UidDateDTO(uid, maxTime));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.error(e);
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.inviteSettleJD(uid, now);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | //
|
| | | try {
|
| | | orderMoneySettleService.inviteSettlePDD(uid, now);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 分享赚到账
|
| | | try {
|
| | | orderMoneySettleService.shareSettleTB(uid);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.shareSettleJD(uid);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | //
|
| | | try {
|
| | | orderMoneySettleService.shareSettlePDD(uid);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void fanliShare(Long uid, Date maxPreGetTime) {
|
| | | // 邀请赚到账
|
| | | try {
|
| | | orderMoneySettleService.shareSettleTB(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.shareSettleJD(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | orderMoneySettleService.shareSettlePDD(uid, maxPreGetTime);
|
| | | } catch (OrderMoneySettleException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void processShopingFanliOrderNew(String orderId, List<TaoBaoOrder> orderList)
|
| | |
| | | package com.yeshi.fanli.service.inter.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | */
|
| | | public void addTeamEincomeRecord(TeamEincomeRecord record) throws TeamEincomeRecordException, ParamsException;
|
| | |
|
| | | public List<TeamEincomeRecord> listCanRecieveRecord(Date preRecieveTime,Long uid);
|
| | | public List<TeamEincomeRecord> listCanRecieveRecord(Date preRecieveTime, Long uid, List<Integer> typeList);
|
| | |
|
| | | /**
|
| | | * 获取可以结算的用户ID
|
| | | * @Title: listCanRecieveUid
|
| | | * @Description: |
| | | * @param preRecieveTime
|
| | | * @param typeList
|
| | | * @return |
| | | * List<Long> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public List<Long> listCanRecieveUid(Date preRecieveTime, List<Integer> typeList,int page,int pageSize);
|
| | |
|
| | | public long countCanRecieveUid(Date preRecieveTime, List<Integer> typeList);
|
| | |
|
| | |
|
| | | public TeamEincomeRecord selectByPrimaryKeyForUpdate(Long id);
|
| | | |
| | | |
| | |
|
| | | public void setRecieved(Long id);
|
| | |
|
| | | /**
|
| | | * 获取预估分红
|
| | | * @Title: getEstimateDividents
|
| | | * @Description: |
| | | * @param preGetTime
|
| | | * @return |
| | | * BigDecimal 返回类型
|
| | | * @throws
|
| | | */
|
| | | public BigDecimal getEstimateDividents(Date preGetTime, Long uid);
|
| | |
|
| | | }
|
| | |
| | | *
|
| | | * @param uid
|
| | | */
|
| | | public void inviteSettleTB(Long uid,Date maxPregetTime) throws OrderMoneySettleException;
|
| | | public void inviteSettleTB(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | public void inviteSettleJD(Long uid,Date maxPregetTime) throws OrderMoneySettleException;
|
| | | public void inviteSettleJD(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | public void inviteSettlePDD(Long uid,Date maxPregetTime) throws OrderMoneySettleException;
|
| | | public void inviteSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | /**
|
| | | * 分享赚结算
|
| | | *
|
| | | * @param uid
|
| | | */
|
| | | public void shareSettleTB(Long uid) throws OrderMoneySettleException;
|
| | | public void shareSettleTB(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | public void shareSettleJD(Long uid) throws OrderMoneySettleException;
|
| | | public void shareSettleJD(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | public void shareSettlePDD(Long uid) throws OrderMoneySettleException;
|
| | | public void shareSettlePDD(Long uid, Date maxPregetTime) throws OrderMoneySettleException;
|
| | |
|
| | | /**
|
| | | * 自购结算
|
| | |
| | | * @param taskKey
|
| | | * @throws OrderMoneySettleException
|
| | | */
|
| | | public void inviteSubsidySettle(Long uid, String taskKey,Date maxPreGetTime)
|
| | | public void inviteSubsidySettle(Long uid, String taskKey, Date maxPreGetTime)
|
| | | throws OrderMoneySettleException, TeamEincomeRecordException, ParamsException;
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void fanli(HongBaoV2 hongBao) throws TaoBaoWeiQuanException;
|
| | |
|
| | | /**
|
| | | * 邀请赚返利
|
| | | * |
| | | * @param hongBao
|
| | | * type=1且有子红包的主红包
|
| | | * |
| | | */
|
| | | public void fanliInvaiteAndShare();
|
| | | |
| | | public void fanliPreInvaite(Date maxTime);
|
| | | |
| | | public void fanliShare(Date maxTime);
|
| | |
|
| | | /**
|
| | | * 结算团队收益
|
| | | * 结算团队奖金+补贴
|
| | | * @Title: fanliInvaite
|
| | | * @Description:
|
| | | * @param maxPreGetTime
|
| | |
| | | */
|
| | |
|
| | | public void fanliPreInvaite(Long uid, Date maxPreGetTime);
|
| | |
|
| | | /**
|
| | | * 分享赚与邀请赚返利
|
| | | */
|
| | | public void fanliInvaiteAndShare(Long uid) throws TaoBaoWeiQuanException;
|
| | |
|
| | | |
| | | |
| | | public void fanliShare(Long uid, Date maxPreGetTime);
|
| | | |
| | | /**
|
| | | * 订单维权
|
| | | *
|
| | |
| | | package com.yeshi.fanli.service.manger.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | |
|
| | | /**
|
| | | * @throws UserMoneyDetailException
|
| | | * 到账到用户余额
|
| | | * 团队收益 到账到用户余额
|
| | | * @Title: addTOUserAccount
|
| | | * @Description:
|
| | | * @param day
|
| | |
| | | * @throws
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void addTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
|
| | | public void addTeamIncomeTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
|
| | |
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_SUBSIDY);
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_REWARD);
|
| | |
|
| | | Date now = new Date();
|
| | | List<TeamEincomeRecord> list = teamEincomeRecordService.listCanRecieveRecord(preSendTime, uid);
|
| | | List<TeamEincomeRecord> list = teamEincomeRecordService.listCanRecieveRecord(preSendTime, uid, typeList);
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | for (TeamEincomeRecord record : list) {
|
| | | record = teamEincomeRecordService.selectByPrimaryKeyForUpdate(record.getId());
|
| | |
| | | userMoneyMsgNotificationService.teamReceive(uid, money, balance, now);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void addTeamDividentsTOUserAccount(Date preSendTime, Long uid) throws UserMoneyDetailException {
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(TeamEincomeRecord.TYPE_TEAM_DIVIDENTS);
|
| | | Date now = new Date();
|
| | | List<TeamEincomeRecord> list = teamEincomeRecordService.listCanRecieveRecord(preSendTime, uid, typeList);
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | for (TeamEincomeRecord record : list) {
|
| | | record = teamEincomeRecordService.selectByPrimaryKeyForUpdate(record.getId());
|
| | | money = money.add(record.getMoney());
|
| | | teamEincomeRecordService.setRecieved(record.getId());
|
| | | }
|
| | |
|
| | | UserMoneyDetail detail = UserMoneyDetailFactory.createTeamDividents(uid, money, preSendTime);
|
| | |
|
| | | userMoneyService.addUserMoney(uid, money, detail);
|
| | | // 发送消息
|
| | | BigDecimal balance = userMoneyService.getBalance(uid);
|
| | | userMoneyMsgNotificationService.teamReceive(uid, money, balance, now);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | teamDividentsSourceUser.setTargetUid(uid);
|
| | | teamDividentsSourceUserService.addTeamDividentsSourceUser(teamDividentsSourceUser);
|
| | | }
|
| | | // if (1 / 0 > 0)
|
| | | // return;
|
| | | }
|
| | |
|
| | | // 计算平均分红
|
| | |
| | |
|
| | | // 有分红才显示资金明细
|
| | | if (money.compareTo(new BigDecimal(0)) > 0) {
|
| | |
|
| | | teamEincomeManager.addTeamDividents(uid, preSendTime, money);
|
| | | }
|
| | | }
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | 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;
|
| | |
| | | // 返利队列
|
| | | public static String FANLI_ORDER_NEW = "fanli-order-new";
|
| | |
|
| | | // 提成订单
|
| | | public static String FANLI_TICHENG_ORDER = "fanli-ticheng-order";
|
| | | // 团队收益
|
| | | public static String FANLI_TEAM_INCOME_ORDER = "fanli-team-income-order";
|
| | |
|
| | | // 团队奖励到账
|
| | | public static String FANLI_ORDER_TEAM_REWARD = "fanli-order-team-reward";
|
| | | // 分享订单收益
|
| | | public static String FANLI_SHARE_ORDER = "fanli-team-income-order";
|
| | |
|
| | | // 维权订单
|
| | | public static String ORDER_WEIQUAN = "weiquan-order";
|
| | |
| | | PUSH_IOS = "test-" + PUSH_IOS;
|
| | | FANLI_ORDER = "test-" + FANLI_ORDER;
|
| | | FANLI_ORDER_NEW = "test-" + FANLI_ORDER_NEW;
|
| | | FANLI_TICHENG_ORDER = "test-" + FANLI_TICHENG_ORDER;
|
| | | FANLI_ORDER_TEAM_REWARD = "test-" + FANLI_ORDER_TEAM_REWARD;
|
| | | 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;
|
| | | }
|
| | |
|
| | | QUEUENAME_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
| | |
| | | PUSH_IOS += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_ORDER_NEW += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_TICHENG_ORDER += "-" + Constant.systemCommonConfig.getProjectName();
|
| | | FANLI_ORDER_TEAM_REWARD += "-" + 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);
|
| | | // 最大消息为1M
|
| | |
| | | cmqUtil.createQueue(PUSH_IOS);
|
| | | cmqUtil.createQueue(FANLI_ORDER);
|
| | | cmqUtil.createQueue(FANLI_ORDER_NEW);
|
| | | cmqUtil.createQueue(FANLI_TICHENG_ORDER);
|
| | | cmqUtil.createQueue(FANLI_ORDER_TEAM_REWARD);
|
| | | 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);
|
| | | }
|
| | |
|
| | | public static CMQManager getInstance() {
|
| | |
| | | cmqUtil.deleteMsg(FANLI_ORDER_NEW, receiptHandle);
|
| | | }
|
| | |
|
| | | // 提成返利
|
| | | public void addFanLiTiChengMsg(Long uid) {
|
| | | cmqUtil.sendMsg(FANLI_TICHENG_ORDER, uid + "");
|
| | | // 团队收益
|
| | | public void addFanLiTeamIncomeMsg(UidDateDTO dto) {
|
| | | cmqUtil.sendMsg(FANLI_TEAM_INCOME_ORDER, new Gson().toJson(dto) + "");
|
| | | }
|
| | |
|
| | | public Map<String, Long> consumeFanLiTiChengMsg(int count) {
|
| | | List<Message> list = cmqUtil.recieveMsg(count, FANLI_TICHENG_ORDER);
|
| | | Map<String, Long> map = new HashMap<>();
|
| | | 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, Long.parseLong(result));
|
| | | map.put(msg.receiptHandle, dto);
|
| | | }
|
| | | }
|
| | | return map;
|
| | | }
|
| | |
|
| | | public void deleteFanLiTiChengMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(FANLI_TICHENG_ORDER, receiptHandle);
|
| | | public void deleteTeamIncomeMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(FANLI_TEAM_INCOME_ORDER, receiptHandle);
|
| | | }
|
| | |
|
| | | // 分享订单收益
|
| | | public void addFanLiShareMsg(UidDateDTO dto) {
|
| | | cmqUtil.sendMsg(FANLI_SHARE_ORDER, new Gson().toJson(dto));
|
| | | }
|
| | |
|
| | | public Map<String, UidDateDTO> consumeFanLiShareMsg(int count) {
|
| | | List<Message> list = cmqUtil.recieveMsg(count, FANLI_SHARE_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 deleteFanLiShareMsg(String receiptHandle) {
|
| | | cmqUtil.deleteMsg(FANLI_SHARE_ORDER, receiptHandle);
|
| | | }
|
| | |
|
| | | // 维权订单
|
| | |
| | | "4c7b166fecb6d9f53837e993f2214673", "", "");
|
| | |
|
| | | // 新的规则生效时间
|
| | | public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-18", "yyyy-MM-dd");
|
| | | public static final long NEW_ORDER_FANLI_RULE_TIME = TimeUtil.convertToTimeTemp("2020-04-14", "yyyy-MM-dd");
|
| | |
|
| | | // 新人抽奖-最大次数
|
| | | public static final int MAX_COUNT_LOTTERY_NEWBIES = 5;
|
| | |
| | |
|
| | | 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;
|
| | |
| | | doTaoBaoOrders();// 处理淘宝订单
|
| | | doTaoBaoNewOrders();// 处理淘宝订单(刚刚产生的)
|
| | | doOrderFanLiNew();// 新版返利
|
| | | doOrderTiChengFanLi();// 处理订单提成返利
|
| | | doOrderTeamIncomeFanLi();// 处理订单提成返利
|
| | | doOrderShareFanLi();
|
| | | doWeiQuanOrder();// 处理维权订单
|
| | | doPushIOS();// 处理发送IOS消息
|
| | | doUserMoneyDebtJob();// 债务偿还
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 处理淘宝提成订单返利
|
| | | * 处理团队订单返利
|
| | | */
|
| | | public void doOrderTiChengFanLi() {
|
| | | public void doOrderTeamIncomeFanLi() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | try {
|
| | |
|
| | | Map<String, Long> map = CMQManager.getInstance().consumeFanLiTiChengMsg(16);
|
| | | Map<String, UidDateDTO> map = CMQManager.getInstance().consumeFanLiTeamIncomeMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String handler = its.next();
|
| | | try {
|
| | | orderProcessService.fanliInvaiteAndShare(map.get(handler));
|
| | | CMQManager.getInstance().deleteFanLiTiChengMsg(handler);
|
| | | } catch (TaoBaoWeiQuanException e) {
|
| | | UidDateDTO dto = map.get(handler);
|
| | | orderProcessService.fanliPreInvaite(dto.getUid(), dto.getDate());
|
| | | CMQManager.getInstance().deleteTeamIncomeMsg(handler);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | LogHelper.errorDetailInfo(e, map.get(handler).toString(), "");
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | /**
|
| | | * 处理分享订单返利
|
| | | */
|
| | | public void doOrderShareFanLi() {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | while (true) {
|
| | | try {
|
| | | Map<String, UidDateDTO> map = CMQManager.getInstance().consumeFanLiShareMsg(16);
|
| | | if (map != null) {
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String handler = its.next();
|
| | | try {
|
| | | UidDateDTO dto = map.get(handler);
|
| | | orderProcessService.fanliShare(dto.getUid(), dto.getDate());
|
| | | CMQManager.getInstance().deleteFanLiShareMsg(handler);
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, map.get(handler).toString(), "");
|