Browse Source

定时修改

anderx 1 year ago
parent
commit
397cd68a94

+ 2 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -155,6 +155,8 @@ public class AFTConstants {
 
 	public static final Integer	USER_SHARE_PUBLIC					= 1;
 
+	public static final Integer	USER_SHARE_SIGN					= 2;
+
 	public static final Integer	USER_STATUS_NORMAL					= 0;
 
 	public static final Integer	USER_STATUS_CANCEL					= 1;

+ 4 - 5
src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml

@@ -379,14 +379,12 @@
   <select id="selectWaitReleaseCustomer" resultType="com.goafanti.customer.bo.LockingReleaseBo">
 	select
 		t0.id, t0.uid, t0.aid, DATE_FORMAT(t0.lock_time , '%Y-%m-%d') lockTime,u.new_channel newChannel,
-		t1.last_follow_time lastFollowTime,u.nickname userName ,um.channel_type channelType,u.share_type shareType
+		um.last_follow_time lastFollowTime,u.nickname userName ,um.channel_type channelType,u.share_type shareType
 	from
 		(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
-	left join
-		(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
-	on t0.uid = t1.uid left join user u on t0.uid=u.id  left join user_mid um on t0.uid=um.uid
+	 left join user u on t0.uid=u.id  left join user_mid um on t0.uid=um.uid
 	where u.channel=0
-	 and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t0.lock_time))>30
+	 and datediff(now(),if(t0.lock_time &lt; um.last_follow_time,um.last_follow_time,t0.lock_time))>30
   </select>
 
   <select id="selectWaitReleaseBusiness"  resultType="com.goafanti.customer.bo.LockingReleaseBo">
@@ -447,6 +445,7 @@
       where u.share_type in(0,2) and  u.channel=0 and u.new_channel=0
         and u.aid =#{aid}
         and datediff(now(),if (um.last_follow_time >u.transfer_time,um.last_follow_time,u.transfer_time)) &gt; 15
+        and datediff(now(),if (um.last_follow_time >u.transfer_time,um.last_follow_time,u.transfer_time)) &lt; 30
 	UNION
       SELECT u.id uid,u.aid,u.nickname name, u.channel ,u.share_type type,u.new_channel newChannel
       from `user` u left join user_mid um on u.id =um.uid

+ 2 - 2
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -62,7 +62,7 @@ public class ReleaseUserTask {
 	 * 每天凌晨一点
 	 *
 	 */
-	@Scheduled(cron = "0 04 14  * * ?")
+	@Scheduled(cron = "0 11 10  * * ?")
 //	@RequestMapping("/open/test")
 //	@Scheduled(cron = "0 0 1  * * ?")
 	public void startTask() {
@@ -233,7 +233,7 @@ public class ReleaseUserTask {
 			if (userList != null && !userList.isEmpty()) {
 				for (User u : userList) {
 					if (StringUtils.isNotBlank(u.getId())) {
-						// 获取30天释放
+						// 获取30天释放 释放以锁定表与user_mid最后跟进取时间
 						List<LockingReleaseBo>  userTmpList = customerService.selectWaitReleaseCustomer(u.getId());
 						customerService.pushReleaseLog(userTmpList, 0);
 						addUserNotice(userTmpList);

+ 6 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1392,8 +1392,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		List<User> newList=new ArrayList<>();
 		//领取
 		if (AFTConstants.USER_RECEIVE.equals(operatorType)) {
+			User use = userMapper.selectByPrimaryKey(uid);
 			user.setAid(TokenManager.getAdminId());
-			user.setShareType(AFTConstants.USER_SHARE_PRIVATE);
+			if (use.getSignBills()==0){
+				user.setShareType(AFTConstants.USER_SHARE_PRIVATE);
+			}else if (use.getSignBills()==1){
+				user.setShareType(AFTConstants.USER_SHARE_SIGN);
+			}
 			user.setInformationMaintainer(TokenManager.getAdminId());
 			user.setSource(2);// 客户来源设置为领取
 			flag = addUserLock(uid, TokenManager.getAdminId(), now, uList); // 指定用户锁定客户