From 822e2bc06f9e95f357867d457c004e7bb1f67db8 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 26 八月 2019 16:27:15 +0800
Subject: [PATCH] 签到通知

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java |   49 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
index 692f57f..0316022 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -21,11 +21,14 @@
 import com.yeshi.fanli.exception.ThreeSaleException;
 import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
+import com.yeshi.fanli.service.inter.hongbao.ThreeSaleExtraInfoSerivce;
 import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
+import com.yeshi.fanli.service.inter.integral.IntegralGetService;
 import com.yeshi.fanli.service.inter.msg.MsgInviteDetailService;
 import com.yeshi.fanli.service.inter.msg.UserInviteMsgNotificationService;
 import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
 import com.yeshi.fanli.service.inter.user.UserActiveLogService;
+import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
 import com.yeshi.fanli.service.inter.user.UserInfoService;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
@@ -61,6 +64,17 @@
 	
 	@Resource
 	private UserActiveLogService userActiveLogService;
+	
+	@Resource
+	private UserInfoExtraService userInfoExtraService;
+	
+	@Resource
+	private ThreeSaleExtraInfoSerivce threeSaleExtraInfoSerivce;
+	
+	@Resource
+	private IntegralGetService  integralGetService;
+	
+	
 	
 	@Resource(name = "taskExecutor")
 	private TaskExecutor executor;
@@ -340,7 +354,7 @@
 	public List<ThreeSale> listbyIdAndBossId(Long id, Long uid, Integer expire) {
 		return threeSaleMapper.listbyIdAndBossId(id, uid, expire);
 	}
-
+	
 	@Override
 	public JSONObject getMyFirstTeam(long start, int count, Long uid, Integer state) {
 
@@ -480,7 +494,8 @@
 
 		return result;
 	}
-
+	
+	
 	@Override
 	public List<ThreeSale> listByWorkerId(Long workerId) {
 		return threeSaleMapper.listByWorkerId(workerId);
@@ -493,7 +508,7 @@
 
 	@Override
 	@Transactional
-	public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter, String platform, String version) throws ThreeSaleException {
+	public void bindRelationshipByInviteCode(UserInfo invitee, UserInfo inviter) throws ThreeSaleException {
 
 		if (invitee == null || inviter == null) 
 			throw new ThreeSaleException(1, "鐢ㄦ埛淇℃伅涓虹┖");
@@ -503,6 +518,8 @@
 
 		if (threeSale != null) {
 			// 鏈夋晥鍏崇郴--鐢熸晥
+			threeSale.setBoss(inviter);
+			threeSale.setWorker(invitee);
 			threeSale.setState(true);
 			threeSale.setExpire(ThreeSale.EXPIRE_NORMAL);
 			threeSale.setSucceedTime(java.lang.System.currentTimeMillis());
@@ -540,8 +557,9 @@
 		executor.execute(new Runnable() {
 			@Override
 			public void run() {
+				
+				UserActiveLog activeLog  = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
 				try {
-					UserActiveLog activeLog  = userActiveLogService.getUserLatestActiveInfo(inviter.getId());
 					if (activeLog != null  && !StringUtil.isNullOrEmpty(activeLog.getVersionCode()) ) {
 						String versionCode = activeLog.getVersionCode();
 						String channel = activeLog.getChannel();
@@ -570,6 +588,9 @@
 				} catch (Exception e) {
 					LogHelper.errorDetailInfo(e);
 				}
+				
+				// 閭�璇烽噾甯�
+				integralGetService.addInviteLevelOne(inviter.getId(), invitee.getId());
 			}
 		});
 		
@@ -578,7 +599,7 @@
 
 	@Override
 	@Transactional
-	public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld, String platform, String version) throws ThreeSaleException {
+	public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException {
 
 		if (invitee == null || (inviterId == null && threeSaleOld == null))
 			throw new ThreeSaleException(1, "鐢ㄦ埛淇℃伅涓虹┖");
@@ -621,6 +642,7 @@
 		
 		UserInfo boss = userInfoService.selectByPKey(threeSale.getBoss().getId());
 		threeSale.setBoss(boss);
+		threeSale.setWorker(invitee);
 		
 		// 娣诲姞鍒伴槦鍒�
 		ThreeSaleCMQManager.getInstance().addThreeSaleMsg(threeSale);
@@ -687,5 +709,22 @@
 	public ThreeSale selectByWorkerId(Long workerId) {
 		return threeSaleMapper.selectSuccessByWorkerId(workerId);
 	}
+	
+	
+	@Override
+	public List<ThreeSale> getSuccessByDate(Long bossId, Long minTime, Long maxTime){
+		return threeSaleMapper.getSuccessByDate(bossId, minTime, maxTime);
+	}
+	
+	
+	@Override
+	public List<ThreeSale> listFirstTeam(long start, int count, Long uid, Integer state) {
+		return threeSaleMapper.listFirstTeam(start, count, uid, state);
+	}
+	
+	@Override
+	public List<ThreeSale> listSecondTeam(long start, int count, Long uid, Integer state) {
+		return threeSaleMapper.listSecondTeam(start, count, uid, state);
+	}
 
 }

--
Gitblit v1.8.0