From 28cf328a098334b51a3e9d2d56f983fb8c862211 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期六, 23 五月 2020 09:54:38 +0800
Subject: [PATCH] 足迹、收藏订单兼容新需求

---
 fanli/src/main/java/com/yeshi/fanli/job/order/OrderTeamDividentsJob.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/job/order/OrderTeamDividentsJob.java b/fanli/src/main/java/com/yeshi/fanli/job/order/OrderTeamDividentsJob.java
index f5bdd29..8bc02bb 100644
--- a/fanli/src/main/java/com/yeshi/fanli/job/order/OrderTeamDividentsJob.java
+++ b/fanli/src/main/java/com/yeshi/fanli/job/order/OrderTeamDividentsJob.java
@@ -13,10 +13,11 @@
 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.TeamDividentsSourceOrderUserMapService;
 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.StringUtil;
 import com.yeshi.fanli.util.TimeUtil;
 import com.yeshi.fanli.util.cmq.order.TeamOrderCMQManager;
 
@@ -27,8 +28,9 @@
 	@Resource
 	private TeamDividentsManager teamDividentsManager;
 
+
 	@Resource
-	private TeamDividentsSourceOrderService teamDividentsSourceOrderService;
+	private TeamDividentsSourceOrderUserMapService teamDividentsSourceOrderUserMapService;
 
 	@Resource
 	private TeamDividentsSourceUserService teamDividentsSourceUserService;
@@ -47,15 +49,20 @@
 	@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);
+		long count = teamDividentsSourceOrderUserMapService.countCanSendSourceUidByPreSendTime(preSendTime);
 		int pageSize = 500;
 		int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
 		for (int i = 0; i < totalPage; i++) {
-			List<Long> list = teamDividentsSourceOrderService.listCanSendUidByPreSendTime(preSendTime, i + 1, pageSize);
+			List<Long> list = teamDividentsSourceOrderUserMapService.listCanSendSourceUidByPreSendTime(preSendTime,
+					i + 1, pageSize);
 			for (Long uid : list) {
-				teamDividentsManager.startDividents(uid);
+				teamDividentsManager.startDividents(uid, preSendTime);
 			}
 		}
 		startAddDividentsRecord(preSendTime);
@@ -85,6 +92,10 @@
 	@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<>();
@@ -95,7 +106,7 @@
 		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));
 			}

--
Gitblit v1.8.0