Browse Source

线索释放逻辑修改

anderx 1 year ago
parent
commit
758c0561cc

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

@@ -62,17 +62,17 @@ public class ReleaseUserTask {
 	 * 客户释放
 	 *
 	 */
-	@Scheduled(cron = "0 22 16  * * ?")
+//	@Scheduled(cron = "0 22 16  * * ?")
 //	@RequestMapping("/open/test")
-//	@Scheduled(cron = "0 0 1  * * ?")
+	@Scheduled(cron = "0 0 1  * * ?")
 	public void startTask() {
 		try {
 			List<User> userList = userService.selectUserByRoleName("营销员", "营销经理");
-//			pushUserDays(userList);
-//			Thread.sleep(2000);
-//			updateUser(userList);
-//			Thread.sleep(2000);
-//			pushRestrictProject(userList);
+			pushUserDays(userList);
+			Thread.sleep(2000);
+			updateUser(userList);
+			Thread.sleep(2000);
+			pushRestrictProject(userList);
 			Thread.sleep(2000);
 			pushReleaseClueUser(userList);
 		} catch (InterruptedException e) {

+ 3 - 3
src/main/java/com/goafanti/customer/service/impl/UserClueServiceImpl.java

@@ -62,11 +62,11 @@ public class UserClueServiceImpl extends BaseMybatisDao<UserMapper> implements U
 
     private Pagination<OutUserClueList> pushReleaseUser(Pagination<OutUserClueList> page) {
         List<OutUserClueList> list = (List<OutUserClueList>) page.getList();
-        LocalDateTime now=LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
+        LocalDateTime now = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
         LocalDateTime clueTime = null;
         for (OutUserClueList e : list) {
-            clueTime = e.getClueTransferTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDateTime();
-            clueTime = clueTime.plusDays(15).withHour(0).withMinute(0).withSecond(0);
+             clueTime=e.getClueTransferTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDateTime();
+            clueTime = clueTime.withHour(0).withMinute(0).withSecond(0).plusDays(15);
             long between = ChronoUnit.DAYS.between(now,clueTime);
             e.setDays((int) between);
         }