Browse Source

定时任务修改

anderx 3 years ago
parent
commit
524a44c49f

+ 9 - 10
src/main/java/com/goafanti/admin/controller/AdminOrgBaiscInfoApiController.java

@@ -38,7 +38,7 @@ import com.goafanti.user.service.OrganizationIdentityService;
 @Controller
 @RequestMapping(value = "/api/admin/basic")
 public class AdminOrgBaiscInfoApiController extends CertifyApiController {
-	
+
 	@Resource
 	private NatureOwnershipService		natureOwnershipService;
 	@Resource
@@ -46,7 +46,7 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 
 	/**
 	 * 企业基本信息保存
-	 * 
+	 *
 	 * @param info
 	 * @param bindingResult
 	 * @return
@@ -108,7 +108,7 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 
 	/**
 	 * 企业基本信息入口
-	 * 
+	 *
 	 * @param uid
 	 * @return
 	 */
@@ -124,14 +124,14 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 		return res;
 	}
 
-	
-	
 
-	
+
+
+
 
 	/**
 	 * 自然人股权列表
-	 * 
+	 *
 	 * @param uid
 	 * @return
 	 */
@@ -149,7 +149,7 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 
 	/**
 	 * 删除自然人股权
-	 * 
+	 *
 	 * @param ids
 	 * @return
 	 */
@@ -166,7 +166,7 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 
 	/**
 	 * 自然人股权保存修改
-	 * 
+	 *
 	 * @param data
 	 * @return
 	 */
@@ -198,5 +198,4 @@ public class AdminOrgBaiscInfoApiController extends CertifyApiController {
 		}
 		return res;
 	}
-
 }

+ 6 - 6
src/main/java/com/goafanti/common/dao/UserLockReleaseMapper.java

@@ -87,15 +87,15 @@ public interface UserLockReleaseMapper {
 	 * @return
 	 */
 	int updateUserLock(@Param("uid")String uid,@Param("aid")String aid,@Param("oldStatus")Integer oldStatus,@Param("newStatus")Integer newStatus);
-	
+
 	int updateUsersLock(@Param("uList")List<String> uList,@Param("aid")String aid,@Param("oldStatus")Integer oldStatus,@Param("newStatus")Integer newStatus);
-	
+
 	int updateUserTypeLock(@Param("uid")String uid,@Param("aid")String aid,@Param("type")Integer type,
 			@Param("newStatus")Integer newStatus,@Param("date") Date date);
 	void updateUserTypeLockList(@Param("list")List<String> list, @Param("aid")String aid,@Param("type")Integer type,
 			@Param("newStatus")Integer newStatus,@Param("date") Date date);
-	
-	List<LockingReleaseBo> selectWaitReleaseCustomer(@Param("aid")String aid, @Param("type")Integer type);
+
+	List<LockingReleaseBo> selectWaitReleaseCustomer(@Param("aid")String aid);
 
 	List<LockingReleaseBo> selectWaitReleaseBusiness(String aid);
 
@@ -113,7 +113,7 @@ public interface UserLockReleaseMapper {
 
 	List<LockingReleaseBo> checkUserProject(@Param("uid")String uid, @Param("pid")String pid, @Param("aid")String aid);
 
-	List<userDaysBo> selectUserDays(@Param("aid")String aid, @Param("x")Integer x, @Param("y")Integer y);
+	List<userDaysBo> selectUserDays(@Param("aid")String aid,  @Param("y")Integer y);
 
 
 
@@ -140,4 +140,4 @@ public interface UserLockReleaseMapper {
 	List<userDaysBo> selectChannelNotFollow(@Param("days")Integer days, @Param("aid")String aid);
 
 
-}
+}

+ 3 - 18
src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml

@@ -386,13 +386,8 @@
 		(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
-	where u.channel=0
-	<if test="type==0">
+	where u.channel=0 and u.new_channel
 	 and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t0.lock_time))>30
-	</if>
-	<if test="type==1">
-	 and datediff(now(),t0.lock_time)>270
-	</if>
   </select>
 
   <select id="selectWaitReleaseBusiness"  resultType="com.goafanti.customer.bo.LockingReleaseBo">
@@ -448,24 +443,14 @@
   </select>
 
   <select id="selectUserDays" resultType="com.goafanti.common.bo.userDaysBo">
-  select  t0.uid, t0.aid, u.nickname name ,u.channel ,1 type,u.new_channel newChannel
+    select  t0.uid, t0.aid, u.nickname name ,u.channel ,0 type,u.new_channel newChannel
 	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
-	where u.channel=0
-	and  datediff(now(),t0.lock_time)> #{x}
-	UNION
-	select  t0.uid, t0.aid, u.nickname name ,u.channel ,0 type,u.new_channel newChannel
-	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
-	where u.channel=0
+	where u.channel=0 and u.new_channel=0
 	and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t0.lock_time)) &gt; 15
 	UNION
 	  select  t0.uid, t0.aid, u.nickname name ,u.channel ,0 type,u.new_channel newChannel

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

@@ -123,22 +123,14 @@ public class ReleaseUserTask {
 			if (userList != null && !userList.isEmpty()) {
 				for (User u : userList) {
 					List<LockingReleaseBo> userTmpList = new ArrayList<LockingReleaseBo>();
-					List<LockingReleaseBo> userTmpList2 = new ArrayList<LockingReleaseBo>();
+
 					if (StringUtils.isNotBlank(u.getId())) {
 						// 获取30天释放
-						userTmpList = customerService.selectWaitReleaseCustomer(u.getId(), 0);
+						userTmpList = customerService.selectWaitReleaseCustomer(u.getId());
 						customerService.pushReleaseLog(userTmpList, 0);
-						// 获取270天释放
-						if(!u.getId().equals("734092ad-6564-4021-b7ab-aab5af3a1537")){
-							userTmpList2 = customerService.selectWaitReleaseCustomer(u.getId(), 1);
-							customerService.pushReleaseLog(userTmpList2, 1);
-						}
-						addUserNotice(userTmpList,userTmpList2);
-						//
+						addUserNotice(userTmpList);
 						if (userTmpList != null && !userTmpList.isEmpty())
 							lockUserList.addAll(userTmpList);
-						if (userTmpList2 != null && !userTmpList2.isEmpty())
-							lockUserList.addAll(userTmpList2);
 					}
 				}
 			}
@@ -232,7 +224,7 @@ public class ReleaseUserTask {
 	}
 
 
-	private void addUserNotice(List<LockingReleaseBo> userTmpList, List<LockingReleaseBo> userTmpList2) {
+	private void addUserNotice(List<LockingReleaseBo> userTmpList) {
 		List<Notice> nl=new ArrayList<Notice>();
 		if (!userTmpList.isEmpty()) {
 			for (LockingReleaseBo u : userTmpList) {
@@ -245,14 +237,7 @@ public class ReleaseUserTask {
 						u.getUid()));
 			}
 		}
-		if (!userTmpList2.isEmpty()) {
-			for (LockingReleaseBo u : userTmpList2) {
-				nl.add(new Notice(UUID.randomUUID().toString(), new Date(), 0, u.getAid(),
-						NoticeStatus.CUSTOMER_LOSE270.getCode(),
-						String.format("您的%s客户【%s】已经270天未签单,已经自动释放!", "私有", u.getUserName()),
-						u.getUid()));
-			}
-		}
+
 		if(!nl.isEmpty())addNoticeBatch(nl);
 	}
 

+ 1 - 2
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -429,10 +429,9 @@ public interface CustomerService {
 	/**
 	 * 查询需要释放的客户
 	 * @param uid 客户Id
-	 * @param type   0 未跟进  1未签单
 	 * @return
 	 */
-	List<LockingReleaseBo> selectWaitReleaseCustomer(String uid, Integer type);
+	List<LockingReleaseBo> selectWaitReleaseCustomer(String uid);
 
 	List<LockingReleaseBo> selectWaitReleaseBusiness(String uid);
 

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

@@ -1853,8 +1853,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	}
 
 	@Override
-	public List<LockingReleaseBo> selectWaitReleaseCustomer(String uid, Integer type) {
-		return userLockReleaseMapper.selectWaitReleaseCustomer(uid, type);
+	public List<LockingReleaseBo> selectWaitReleaseCustomer(String uid) {
+		return userLockReleaseMapper.selectWaitReleaseCustomer(uid);
 	}
 
 	/**
@@ -2099,10 +2099,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 	@Override
 	public List<userDaysBo> selectReleaseUserDays(String id) {
-		Integer x = 270, y = USER_CHANNEL_DAYS;
-		x = x - USER_REMIND_DAYS;
+		//渠道
+		Integer y = USER_CHANNEL_DAYS;
 		y = y - USER_REMIND_DAYS;
-		List<userDaysBo> list = userLockReleaseMapper.selectUserDays(id, x, y);
+		List<userDaysBo> list = userLockReleaseMapper.selectUserDays(id,  y);
 		return list;
 	}