|
|
@@ -16,7 +16,6 @@ import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
|
-import com.goafanti.admin.bo.NoticeBo;
|
|
|
import com.goafanti.common.bo.EmailBo;
|
|
|
import com.goafanti.common.bo.userDaysBo;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
@@ -65,37 +64,39 @@ public class ReleaseUserTask {
|
|
|
private void pushUserDays() throws InterruptedException {
|
|
|
LoggerUtils.debug(getClass(), "==============客户提醒开始============");
|
|
|
List<User> userList = userService.selectUserByRoleName("营销员", "营销经理");
|
|
|
- List<userDaysBo> count = new ArrayList<>();
|
|
|
List<userDaysBo> userTmpList = null;
|
|
|
+ List<Notice> ln = new ArrayList<>();
|
|
|
for (User u : userList) {
|
|
|
if (StringUtils.isNotBlank(u.getId())) {
|
|
|
- userTmpList = customerService.selectUserDays(u.getId());
|
|
|
+ userTmpList = customerService.selectReleaseUserDays(u.getId());
|
|
|
}
|
|
|
- if (!userTmpList.isEmpty())
|
|
|
- count.addAll(userTmpList);
|
|
|
- }
|
|
|
- List<Notice> ln = new ArrayList<>();
|
|
|
- for (userDaysBo ub : count) {
|
|
|
- String str=null;
|
|
|
- if (ub.getChannel() == 0) {
|
|
|
- str = String.format("您的%s客户【%s】剩余天数不足十五天,请及时跟进或者限时签单!", "私有", ub.getName());
|
|
|
- }else {
|
|
|
- str = String.format("您的%s客户【%s】剩余天数不足十五天,请及时跟进或者限时签单!", "渠道", ub.getName());
|
|
|
+ for (userDaysBo ub : userTmpList) {
|
|
|
+ String str=null;
|
|
|
+ if (ub.getChannel() == 0) {
|
|
|
+ str = String.format("您的%s客户【%s】剩余天数不足十五天,请及时跟进或者限时签单!", "私有", ub.getName());
|
|
|
+ }else {
|
|
|
+ str = String.format("您的%s客户【%s】剩余天数不足十五天,请及时跟进或者限时签单!", "渠道", ub.getName());
|
|
|
+ }
|
|
|
+ ln.add(new Notice(UUID.randomUUID().toString(), new Date(), 0, ub.getAid(),
|
|
|
+ NoticeStatus.CUSTOMER_LOSE_REMINDER.getCode(), str,ub.getUid()));
|
|
|
}
|
|
|
- ln.add(new Notice(UUID.randomUUID().toString(), new Date(), 0, ub.getAid(),
|
|
|
- NoticeStatus.CUSTOMER_LOSE_REMINDER.getCode(), str,ub.getUid()));
|
|
|
}
|
|
|
//查询15天未跟进
|
|
|
- List<userDaysBo> userChannelList = customerService.selectChannelNotFollow();
|
|
|
- for (userDaysBo ub : userChannelList) {
|
|
|
- String str=null;
|
|
|
- if (ub.getChannel() == 0) {
|
|
|
- str = String.format("您的%s客户【%s】已经十五天未跟进,请及时跟进或者限时签单!", "私有", ub.getName());
|
|
|
- }else {
|
|
|
- str = String.format("您的%s客户【%s】已经十五天未跟进,请及时跟进或者限时签单!", "渠道", ub.getName());
|
|
|
+ List<userDaysBo> userChannelList = new ArrayList<userDaysBo>();
|
|
|
+ for (User u : userList) {
|
|
|
+ if (StringUtils.isNotBlank(u.getId())) {
|
|
|
+ userChannelList = customerService.selectChannelNotFollow(u.getId());
|
|
|
+ }
|
|
|
+ for (userDaysBo ub : userChannelList) {
|
|
|
+ String str=null;
|
|
|
+ if (ub.getChannel() == 0) {
|
|
|
+ str = String.format("您的%s客户【%s】已经十五天未跟进,请及时跟进或者限时签单!", "私有", ub.getName());
|
|
|
+ }else {
|
|
|
+ str = String.format("您的%s客户【%s】已经十五天未跟进,请及时跟进或者限时签单!", "渠道", ub.getName());
|
|
|
+ }
|
|
|
+ ln.add(new Notice(UUID.randomUUID().toString(), new Date(), 0, ub.getAid(),
|
|
|
+ NoticeStatus.CUSTOMER_PRIVATE_REMINDER.getCode(), str,ub.getUid()));
|
|
|
}
|
|
|
- ln.add(new Notice(UUID.randomUUID().toString(), new Date(), 0, ub.getAid(),
|
|
|
- NoticeStatus.CUSTOMER_PRIVATE_REMINDER.getCode(), str,ub.getUid()));
|
|
|
}
|
|
|
List<Notice> newList = new ArrayList<>();
|
|
|
if (ln != null && ln.size() > 0) {
|
|
|
@@ -124,7 +125,6 @@ public class ReleaseUserTask {
|
|
|
List<LockingReleaseBo> lockUserList = new ArrayList<LockingReleaseBo>();
|
|
|
List<LockingReleaseBo> userTmpList = null;
|
|
|
List<LockingReleaseBo> userTmpList2 = null;
|
|
|
- List<Notice> ln = new ArrayList<>();
|
|
|
if (userList != null && !userList.isEmpty()) {
|
|
|
for (User u : userList) {
|
|
|
if (StringUtils.isNotBlank(u.getId())) {
|
|
|
@@ -132,6 +132,7 @@ public class ReleaseUserTask {
|
|
|
userTmpList = customerService.selectWaitReleaseCustomer(u.getId(), 0);
|
|
|
// 获取270天释放
|
|
|
userTmpList2 = customerService.selectWaitReleaseCustomer(u.getId(), 1);
|
|
|
+ //
|
|
|
customerService.pushReleaseLog(userTmpList, 0);
|
|
|
customerService.pushReleaseLog(userTmpList2, 1);
|
|
|
if (userTmpList != null && !userTmpList.isEmpty())
|
|
|
@@ -155,18 +156,27 @@ public class ReleaseUserTask {
|
|
|
}
|
|
|
}
|
|
|
// 获取超过90天客户,判断是否回收过,未回收则回收,已回收则释放为公共客户
|
|
|
- List<userDaysBo> userChannelList = customerService.selectChannelUserDays();
|
|
|
+ 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 (userChannelList != null && userChannelList.size() > 0) {
|
|
|
- for (int i = 0; i < userChannelList.size(); i++) {
|
|
|
+ if (count != null && count.size() > 0) {
|
|
|
+ for (int i = 0; i < count.size(); i++) {
|
|
|
//回收
|
|
|
- if (userChannelList.get(i).getRecovery()==0) {
|
|
|
- hsList.add(userChannelList.get(i));
|
|
|
+ if (count.get(i).getRecovery()==0) {
|
|
|
+ hsList.add(count.get(i));
|
|
|
}else {
|
|
|
- sfList.add(userChannelList.get(i));
|
|
|
+ sfList.add(count.get(i));
|
|
|
}
|
|
|
- if (pointsDataLimit == (hsList.size()+sfList.size()) || i == userChannelList.size() - 1) {
|
|
|
+ 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);
|