| | |
| | | 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
|
| | |
| | | private TeamDividentsManager teamDividentsManager;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceOrderService teamDividentsSourceOrderService;
|
| | |
|
| | | @Resource
|
| | | private TeamDividentsSourceUserService teamDividentsSourceUserService;
|
| | |
|
| | | @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;
|
| | | }
|
| | |
|
| | | }
|