|
|
@@ -125,6 +125,7 @@ public class ReleaseUserTask {
|
|
|
if (StringUtils.isNotBlank(u.getId())) {
|
|
|
// 获取30天释放
|
|
|
userTmpList = customerService.selectWaitReleaseCustomer(u.getId(), 0);
|
|
|
+ customerService.pushReleaseLog(userTmpList, 0);
|
|
|
// 获取270天释放
|
|
|
if(!u.getId().equals("734092ad-6564-4021-b7ab-aab5af3a1537")){
|
|
|
userTmpList2 = customerService.selectWaitReleaseCustomer(u.getId(), 1);
|
|
|
@@ -132,7 +133,6 @@ public class ReleaseUserTask {
|
|
|
}
|
|
|
addUserNotice(userTmpList,userTmpList2);
|
|
|
//
|
|
|
- customerService.pushReleaseLog(userTmpList, 0);
|
|
|
if (userTmpList != null && !userTmpList.isEmpty())
|
|
|
lockUserList.addAll(userTmpList);
|
|
|
if (userTmpList2 != null && !userTmpList2.isEmpty())
|
|
|
@@ -153,40 +153,7 @@ public class ReleaseUserTask {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 获取超过90天客户,判断是否回收过,未回收则回收,已回收则释放为公共客户
|
|
|
- List<userDaysBo> userChannelList =null;
|
|
|
- List<userDaysBo> count =new ArrayList<userDaysBo>();
|
|
|
- if (userList != null && !userList.isEmpty()) {
|
|
|
- for (User u : userList) {
|
|
|
- userChannelList=customerService.selectChannelUserDays(u.getId());
|
|
|
- if (userChannelList!=null) {
|
|
|
- count.addAll(userChannelList);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- List<userDaysBo> hsList=new ArrayList<>();
|
|
|
- List<userDaysBo> sfList=new ArrayList<>();
|
|
|
- if (count != null && count.size() > 0) {
|
|
|
- for (int i = 0; i < count.size(); i++) {
|
|
|
- //回收
|
|
|
- if (count.get(i).getRecovery()==0) {
|
|
|
- hsList.add(count.get(i));
|
|
|
- }else {
|
|
|
- sfList.add(count.get(i));
|
|
|
- }
|
|
|
- if (pointsDataLimit == (hsList.size()+sfList.size()) || i == count.size() - 1) {
|
|
|
- if(!hsList.isEmpty())userService.pushReleaseUserChannel(hsList,0);
|
|
|
- if(!sfList.isEmpty())userService.pushReleaseUserChannel(sfList,1);
|
|
|
- addChannelNotice(hsList,sfList);
|
|
|
- hsList.clear();
|
|
|
- sfList.clear();
|
|
|
- Thread.sleep(2000);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- List<LockingReleaseBo> lockList = customerService.selectPendinglockUserList();
|
|
|
- if (lockList.size() > 0)
|
|
|
- customerService.updateReleaseLock(releaseTime);
|
|
|
+ pushChannel(releaseTime, userList);
|
|
|
} catch (Exception e) {
|
|
|
Notice n = new Notice(UUID.randomUUID().toString(), new Date(), 0, "1",
|
|
|
NoticeStatus.TASK_PATENT_ERROR.getCode(), "==============客户释放失败================",null);
|
|
|
@@ -198,6 +165,42 @@ public class ReleaseUserTask {
|
|
|
}
|
|
|
LoggerUtils.debug(getClass(), "==============客户释放完成============");
|
|
|
}
|
|
|
+ private void pushChannel(Date releaseTime, List<User> userList) throws InterruptedException {
|
|
|
+ // 获取超过90天客户,判断是否回收过,未回收则回收,已回收则释放为公共客户
|
|
|
+ List<userDaysBo> userChannelList =null;
|
|
|
+ List<userDaysBo> count =new ArrayList<userDaysBo>();
|
|
|
+ if (userList != null && !userList.isEmpty()) {
|
|
|
+ for (User u : userList) {
|
|
|
+ userChannelList=customerService.selectChannelUserDays(u.getId());
|
|
|
+ if (userChannelList!=null) {
|
|
|
+ count.addAll(userChannelList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<userDaysBo> hsList=new ArrayList<>();
|
|
|
+ List<userDaysBo> sfList=new ArrayList<>();
|
|
|
+ if (count != null && count.size() > 0) {
|
|
|
+ for (int i = 0; i < count.size(); i++) {
|
|
|
+ //回收
|
|
|
+ if (count.get(i).getRecovery()==0) {
|
|
|
+ hsList.add(count.get(i));
|
|
|
+ }else {
|
|
|
+ sfList.add(count.get(i));
|
|
|
+ }
|
|
|
+ if (pointsDataLimit == (hsList.size()+sfList.size()) || i == count.size() - 1) {
|
|
|
+ if(!hsList.isEmpty())userService.pushReleaseUserChannel(hsList,0);
|
|
|
+ if(!sfList.isEmpty())userService.pushReleaseUserChannel(sfList,1);
|
|
|
+ addChannelNotice(hsList,sfList);
|
|
|
+ hsList.clear();
|
|
|
+ sfList.clear();
|
|
|
+ Thread.sleep(2000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<LockingReleaseBo> lockList = customerService.selectPendinglockUserList();
|
|
|
+ if (lockList.size() > 0)
|
|
|
+ customerService.updateReleaseLock(releaseTime);
|
|
|
+ }
|
|
|
|
|
|
public void addNotice(Notice n ) {
|
|
|
n.setType(NoticeTypes.getType(n.getNoticeType()));
|