Przeglądaj źródła

客户领取BUG修复,客户释放逻辑修改

anderx 2 lat temu
rodzic
commit
9ea36bd421

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

@@ -19,8 +19,8 @@ import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.service.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
@@ -29,8 +29,8 @@ import java.util.List;
 import java.util.UUID;
 
 
-//@Component
-@RestController
+@Component
+//@RestController
 public class ReleaseUserTask {
 	@Resource
 	private CustomerService customerService;
@@ -55,12 +55,12 @@ public class ReleaseUserTask {
 	 * @throws InterruptedException
 	 */
 //	@Scheduled(cron = "0 52 10  * * ?")
-//	@Scheduled(cron = "0 0 1  * * ?")
-	@RequestMapping("/open/test")
+//	@RequestMapping("/open/test")
+	@Scheduled(cron = "0 0 1  * * ?")
 	public void startTask() {
 		try {
 			List<User> userList = userService.selectUserByRoleName("营销员", "营销经理");
-//			pushUserDays(userList);
+			pushUserDays(userList);
 			Thread.sleep(2000);
 			updateUser(userList);
 			Thread.sleep(2000);
@@ -131,7 +131,6 @@ public class ReleaseUserTask {
 				}
 			}
 			List<LockingReleaseBo> newList = new ArrayList<LockingReleaseBo>();
-			List<LockingReleaseBo> aidList=new ArrayList<>();
 			if (lockUserList != null && lockUserList.size() > 0) {
 				for (int i = 0; i < lockUserList.size(); i++) {
 					newList.add(lockUserList.get(i));
@@ -142,27 +141,11 @@ public class ReleaseUserTask {
 						newList.clear();
 						Thread.sleep(2000);
 					}
-					//设置释放客户修改客户数
-					if (aidList.isEmpty()){
-						aidList.add(lockUserList.get(i));
-					}else {
-						for (LockingReleaseBo e : aidList) {
-							boolean flag= true;
-							if (e.getAid().equals(lockUserList.get(i).getAid())&&
-									e.getLockTime().getTime()==lockUserList.get(i).getLockTime().getTime()){
-								flag= false;
-								break;
-							}
-							if (flag){
-								aidList.add(lockUserList.get(i));
-							}
-						}
-					}
 
 				}
 			}
 			//处理每个人重复的天数
-			pushSalesmanCount(aidList);
+			pushSalesmanCount(lockUserList);
 			pushChannel(releaseTime, userList);
 		} catch (Exception e) {
 			Notice n = new Notice(UUID.randomUUID().toString(), new Date(), 0, "1",