|
@@ -24,7 +24,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
-import com.alibaba.druid.sql.parser.Token;
|
|
|
|
|
import com.goafanti.common.bo.Error;
|
|
import com.goafanti.common.bo.Error;
|
|
|
import com.goafanti.common.bo.userDaysBo;
|
|
import com.goafanti.common.bo.userDaysBo;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
@@ -32,6 +31,7 @@ import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.dao.AdminMapper;
|
|
import com.goafanti.common.dao.AdminMapper;
|
|
|
import com.goafanti.common.dao.BusinessGlossoryMapper;
|
|
import com.goafanti.common.dao.BusinessGlossoryMapper;
|
|
|
import com.goafanti.common.dao.BusinessProjectMapper;
|
|
import com.goafanti.common.dao.BusinessProjectMapper;
|
|
|
|
|
+import com.goafanti.common.dao.NoticeMapper;
|
|
|
import com.goafanti.common.dao.OrganizationAnnualReportMapper;
|
|
import com.goafanti.common.dao.OrganizationAnnualReportMapper;
|
|
|
import com.goafanti.common.dao.OrganizationApplicationInfoMapper;
|
|
import com.goafanti.common.dao.OrganizationApplicationInfoMapper;
|
|
|
import com.goafanti.common.dao.OrganizationBusinessScopeMapper;
|
|
import com.goafanti.common.dao.OrganizationBusinessScopeMapper;
|
|
@@ -51,11 +51,13 @@ import com.goafanti.common.enums.ChannelStatus;
|
|
|
import com.goafanti.common.enums.CustomerStatusFiled;
|
|
import com.goafanti.common.enums.CustomerStatusFiled;
|
|
|
import com.goafanti.common.enums.DeleteStatus;
|
|
import com.goafanti.common.enums.DeleteStatus;
|
|
|
import com.goafanti.common.enums.IdentityProcess;
|
|
import com.goafanti.common.enums.IdentityProcess;
|
|
|
|
|
+import com.goafanti.common.enums.NoticeStatus;
|
|
|
import com.goafanti.common.enums.UserLevel;
|
|
import com.goafanti.common.enums.UserLevel;
|
|
|
import com.goafanti.common.enums.UserLockReleaseStatus;
|
|
import com.goafanti.common.enums.UserLockReleaseStatus;
|
|
|
import com.goafanti.common.enums.UserType;
|
|
import com.goafanti.common.enums.UserType;
|
|
|
import com.goafanti.common.error.BusinessException;
|
|
import com.goafanti.common.error.BusinessException;
|
|
|
import com.goafanti.common.model.Admin;
|
|
import com.goafanti.common.model.Admin;
|
|
|
|
|
+import com.goafanti.common.model.Notice;
|
|
|
import com.goafanti.common.model.OrganizationApplicationInfo;
|
|
import com.goafanti.common.model.OrganizationApplicationInfo;
|
|
|
import com.goafanti.common.model.OrganizationBusinessScope;
|
|
import com.goafanti.common.model.OrganizationBusinessScope;
|
|
|
import com.goafanti.common.model.OrganizationContactBook;
|
|
import com.goafanti.common.model.OrganizationContactBook;
|
|
@@ -124,6 +126,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
@Resource
|
|
@Resource
|
|
|
private AdminMapper adminMapper;
|
|
private AdminMapper adminMapper;
|
|
|
@Resource
|
|
@Resource
|
|
|
|
|
+ private NoticeMapper noticeMapper;
|
|
|
|
|
+ @Resource
|
|
|
private OrganizationApplicationInfoMapper organizationApplicationInfoMapper;
|
|
private OrganizationApplicationInfoMapper organizationApplicationInfoMapper;
|
|
|
@Resource
|
|
@Resource
|
|
|
private OrganizationAnnualReportMapper organizationAnnualReportMapper;
|
|
private OrganizationAnnualReportMapper organizationAnnualReportMapper;
|
|
@@ -791,16 +795,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
private void followProject(String uid, int x) {
|
|
private void followProject(String uid, int x) {
|
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
String aid = TokenManager.getAdminId();
|
|
String aid = TokenManager.getAdminId();
|
|
|
- if(x==0) {
|
|
|
|
|
- if (userLockReleaseMapper.updateUserMid(uid,aid,date,null)<1) {
|
|
|
|
|
- userLockReleaseMapper.insertUserMid(uid,aid,date,null);
|
|
|
|
|
|
|
+ if (x == 0) {
|
|
|
|
|
+ if (userLockReleaseMapper.updateUserMid(uid, aid, date, null) < 1) {
|
|
|
|
|
+ userLockReleaseMapper.insertUserMid(uid, aid, date, null);
|
|
|
}
|
|
}
|
|
|
- }else {
|
|
|
|
|
- if (userLockReleaseMapper.updateUserMid(uid,aid,date,date)<1) {
|
|
|
|
|
- userLockReleaseMapper.insertUserMid(uid,aid,date,date);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (userLockReleaseMapper.updateUserMid(uid, aid, date, date) < 1) {
|
|
|
|
|
+ userLockReleaseMapper.insertUserMid(uid, aid, date, date);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings("unused")
|
|
@SuppressWarnings("unused")
|
|
@@ -2035,6 +2039,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
newList.add(list.get(i));
|
|
newList.add(list.get(i));
|
|
|
if (50 == newList.size() || i == list.size() - 1) {
|
|
if (50 == newList.size() || i == list.size() - 1) {
|
|
|
if (newList.size() > 0) {
|
|
if (newList.size() > 0) {
|
|
|
|
|
+ // 处理日志
|
|
|
List<UserTransferLog> list3 = new ArrayList<UserTransferLog>();
|
|
List<UserTransferLog> list3 = new ArrayList<UserTransferLog>();
|
|
|
for (LockingReleaseBo lrb : newList) {
|
|
for (LockingReleaseBo lrb : newList) {
|
|
|
UserTransferLog utl = new UserTransferLog();
|
|
UserTransferLog utl = new UserTransferLog();
|
|
@@ -2048,13 +2053,29 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
list3.add(utl);
|
|
list3.add(utl);
|
|
|
}
|
|
}
|
|
|
userTransferLogMapper.insertList(list3);
|
|
userTransferLogMapper.insertList(list3);
|
|
|
|
|
+ // 处理通知
|
|
|
|
|
+ List<Notice> ln = new ArrayList<>();
|
|
|
|
|
+ for (LockingReleaseBo lrb : newList) {
|
|
|
|
|
+ String str = null;
|
|
|
|
|
+ Integer code = null;
|
|
|
|
|
+ if (type == 0) {
|
|
|
|
|
+ str = String.format("您的%s客户【%s】30天未跟进已释放!", "私有", lrb.getUserName());
|
|
|
|
|
+ code = NoticeStatus.CUSTOMER_LOSE30.getCode();
|
|
|
|
|
+ } else if (type == 1) {
|
|
|
|
|
+ str = String.format("您的%s客户【%s】270天未签单已释放!", "私有", lrb.getUserName());
|
|
|
|
|
+ code = NoticeStatus.CUSTOMER_LOSE270.getCode();
|
|
|
|
|
+ }
|
|
|
|
|
+ ln.add(new Notice(UUID.randomUUID().toString(), new Date(), 0, lrb.getAid(), code, str,
|
|
|
|
|
+ lrb.getUid()));
|
|
|
|
|
+ }
|
|
|
|
|
+ noticeMapper.insertBatch(ln);
|
|
|
}
|
|
}
|
|
|
- newList.clear();
|
|
|
|
|
- Thread.sleep(2000);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ newList.clear();
|
|
|
|
|
+ Thread.sleep(2000);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -2073,15 +2094,12 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
params.put("startTime", in.getStartTime());
|
|
params.put("startTime", in.getStartTime());
|
|
|
if (StringUtils.isNotBlank(in.getEndTime()))
|
|
if (StringUtils.isNotBlank(in.getEndTime()))
|
|
|
params.put("endTime", in.getEndTime() + " 23:59:59");
|
|
params.put("endTime", in.getEndTime() + " 23:59:59");
|
|
|
- if (TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR)||TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
|
|
-
|
|
|
|
|
- }else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)) {
|
|
|
|
|
|
|
+ if (TokenManager.hasRole(AFTConstants.SALESMAN_DIRECTOR) || TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
|
|
+
|
|
|
|
|
+ } else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)) {
|
|
|
params.put("maid", TokenManager.getAdminId());
|
|
params.put("maid", TokenManager.getAdminId());
|
|
|
- }else {
|
|
|
|
|
- params.put("aid", in.getAid()==null?TokenManager.getAdminId():in.getAid());
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ params.put("aid", in.getAid() == null ? TokenManager.getAdminId() : in.getAid());
|
|
|
return findPage("selectChannelCustomerList", "selectChannelCustomerCount", params, in.getPageNo(),
|
|
return findPage("selectChannelCustomerList", "selectChannelCustomerCount", params, in.getPageNo(),
|
|
|
in.getPageSize());
|
|
in.getPageSize());
|
|
|
|
|
|
|
@@ -2090,8 +2108,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
@Override
|
|
@Override
|
|
|
public Object pushChannelDeliver(List<String> uids, String receiveId, String remarks, Integer type) {
|
|
public Object pushChannelDeliver(List<String> uids, String receiveId, String remarks, Integer type) {
|
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
- Integer i=userMapper.updatechannelCustomerDeliver(uids, receiveId);
|
|
|
|
|
- Integer status=null;
|
|
|
|
|
|
|
+ Integer i = userMapper.updatechannelCustomerDeliver(uids, receiveId);
|
|
|
|
|
+ Integer status = null;
|
|
|
if (i > 0) {
|
|
if (i > 0) {
|
|
|
List<UserTransferLog> l = new ArrayList<UserTransferLog>();
|
|
List<UserTransferLog> l = new ArrayList<UserTransferLog>();
|
|
|
for (String string : uids) {
|
|
for (String string : uids) {
|
|
@@ -2113,22 +2131,22 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
}
|
|
}
|
|
|
userTransferLogMapper.insertList(l);
|
|
userTransferLogMapper.insertList(l);
|
|
|
}
|
|
}
|
|
|
- if (type!=2) {
|
|
|
|
|
- userLockReleaseMapper.insertChannelList(uids,receiveId);
|
|
|
|
|
- String role=userMapper.checkRoleMax(receiveId);
|
|
|
|
|
|
|
+ if (type != 2) {
|
|
|
|
|
+ userLockReleaseMapper.insertChannelList(uids, receiveId);
|
|
|
|
|
+ String role = userMapper.checkRoleMax(receiveId);
|
|
|
if (role.equals(AFTConstants.SALESMAN_MANAGER)) {
|
|
if (role.equals(AFTConstants.SALESMAN_MANAGER)) {
|
|
|
- status=ChannelStatus.YFPJL.getCode();
|
|
|
|
|
- }else {
|
|
|
|
|
- status=ChannelStatus.YFPYXY.getCode();
|
|
|
|
|
|
|
+ status = ChannelStatus.YFPJL.getCode();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ status = ChannelStatus.YFPYXY.getCode();
|
|
|
}
|
|
}
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
userLockReleaseMapper.updateChannelList(uids);
|
|
userLockReleaseMapper.updateChannelList(uids);
|
|
|
- status=ChannelStatus.HT.getCode();
|
|
|
|
|
|
|
+ status = ChannelStatus.HT.getCode();
|
|
|
}
|
|
}
|
|
|
- if(type==0) {
|
|
|
|
|
- userChannelMapper.updateByuids(uids, type, date,receiveId,status);
|
|
|
|
|
- }else {
|
|
|
|
|
- userChannelMapper.updateByuids(uids, type, date,null,status);
|
|
|
|
|
|
|
+ if (type == 0) {
|
|
|
|
|
+ userChannelMapper.updateByuids(uids, type, date, receiveId, status);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ userChannelMapper.updateByuids(uids, type, date, null, status);
|
|
|
}
|
|
}
|
|
|
organizationContactBookMapper.updateByUids(uids, receiveId);
|
|
organizationContactBookMapper.updateByUids(uids, receiveId);
|
|
|
return 1;
|
|
return 1;
|
|
@@ -2166,10 +2184,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<userDaysBo> selectChannelNotFollow(){
|
|
|
|
|
- Integer days = 15;
|
|
|
|
|
- return userLockReleaseMapper.selectChannelNotFollow(days);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public List<userDaysBo> selectChannelNotFollow() {
|
|
|
|
|
+ Integer days = 15;
|
|
|
|
|
+ return userLockReleaseMapper.selectChannelNotFollow(days);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Object listChannelCounts(InputChannelCounts in) {
|
|
public Object listChannelCounts(InputChannelCounts in) {
|