From 554de444b87aab5f93cb1593a8095612cf9479a7 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期二, 09 六月 2020 17:34:30 +0800
Subject: [PATCH] 订单

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleDetailSerivceImpl.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleDetailSerivceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleDetailSerivceImpl.java
index 47469b4..920c142 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleDetailSerivceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/invite/ThreeSaleDetailSerivceImpl.java
@@ -34,8 +34,8 @@
 		detail.setId(id);
 		// 鏍规嵁涓婚敭鏌ヨ
 		ThreeSaleDetail old = threeSaleDetailDao.get(id);
-		if (old == null)
-			threeSaleDetailDao.save(detail);
+		// if (old == null)
+		threeSaleDetailDao.save(detail);
 	}
 
 	@Override
@@ -61,18 +61,22 @@
 	@Override
 	public void addByWorkerUid(Long workerUid) {
 		List<ThreeSale> list = threeSaleSerivce.getMyBossDeepList(workerUid, 100);
-		LogHelper.teamInfo(String.format("閭�璇疯缁嗕俊鎭�: 鐢ㄦ埛ID:%s  涓婄骇鏁伴噺:%s",workerUid+"",list.size()));
+		LogHelper.teamInfo(String.format("閭�璇疯缁嗕俊鎭�: 鐢ㄦ埛ID:%s  涓婄骇鏁伴噺:%s", workerUid + "", list.size()));
 		int level = 0;
+		long createTime = 0L;
+		if (list.size() > 0) {
+			if (list.get(0).getSucceedTime() != null)
+				createTime = list.get(0).getSucceedTime();
+			else
+				createTime = list.get(0).getCreateTime();
+		}
 		for (ThreeSale tts : list) {
 			level++;
 			ThreeSaleDetail detail = new ThreeSaleDetail();
 			detail.setBossUid(tts.getBoss().getId());
 			detail.setLevel(level);
 			detail.setWorkerUid(workerUid);
-			if (tts.getSucceedTime() != null)
-				detail.setCreateTime(new Date(tts.getSucceedTime()));
-			else
-				detail.setCreateTime(new Date(tts.getCreateTime()));
+			detail.setCreateTime(new Date(createTime));
 			try {
 				if (tts.getState())
 					addThreeSaleDetail(detail);

--
Gitblit v1.8.0