|
|
@@ -1,32 +1,5 @@
|
|
|
package com.goafanti.customer.controller;
|
|
|
|
|
|
-import java.io.IOException;
|
|
|
-import java.io.OutputStream;
|
|
|
-import java.lang.reflect.InvocationTargetException;
|
|
|
-import java.text.DateFormat;
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Calendar;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Set;
|
|
|
-import java.util.TreeSet;
|
|
|
-import javax.annotation.Resource;
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
-import com.goafanti.common.utils.*;
|
|
|
-import com.goafanti.core.mybatis.page.Pagination;
|
|
|
-import com.goafanti.customer.bo.*;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.goafanti.admin.service.AdminService;
|
|
|
@@ -41,8 +14,29 @@ import com.goafanti.common.error.BusinessException;
|
|
|
import com.goafanti.common.model.Attachment;
|
|
|
import com.goafanti.common.model.OrganizationContactBook;
|
|
|
import com.goafanti.common.model.User;
|
|
|
+import com.goafanti.common.utils.*;
|
|
|
+import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.customer.bo.*;
|
|
|
import com.goafanti.customer.service.CustomerService;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.validation.BindingResult;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.OutputStream;
|
|
|
+import java.lang.reflect.InvocationTargetException;
|
|
|
+import java.text.DateFormat;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/api/admin/customer")
|
|
|
@@ -922,13 +916,20 @@ public class AdminCustomerApiController extends BaseApiController{
|
|
|
return res;
|
|
|
}
|
|
|
//默认为私有转交,4为签单转交
|
|
|
- if (operatorType==null) {
|
|
|
- operatorType=AFTConstants.USER_TRANSFER_TO_OTHER;
|
|
|
- }
|
|
|
- if ((operatorType ==AFTConstants.USER_TRANSFER_TO_OTHER||operatorType ==AFTConstants.USER_RECEIVE)
|
|
|
- && customerService.checkMax(uid,aid)) {
|
|
|
- res.getError().add(buildError("","对方私有客户已达最大限制"));
|
|
|
- return res;
|
|
|
+ if (operatorType==null) operatorType=AFTConstants.USER_TRANSFER_TO_OTHER;
|
|
|
+ //转交,对方不是客服营销员才需要判断最大限制
|
|
|
+ if (operatorType ==AFTConstants.USER_TRANSFER_TO_OTHER&&(!customerService.checkAid(aid,Integer.valueOf(AFTConstants.CUSTOMER_SERVICE_SALESMAN)))){
|
|
|
+ if (customerService.checkMax(uid,aid)){
|
|
|
+ res.getError().add(buildError("","对方私有客户已达最大限制"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //领取,当前人不是客服营销员才需要判断最大现在
|
|
|
+ if (operatorType ==AFTConstants.USER_TRANSFER_TO_OTHER&&(!TokenManager.hasRole(AFTConstants.CUSTOMER_SERVICE_SALESMAN))){
|
|
|
+ if (customerService.checkMax(uid,aid)){
|
|
|
+ res.getError().add(buildError("","对方私有客户已达最大限制"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|
|
|
if(data==null)data=0;
|
|
|
res.setData(customerService.updateByOperatorType(uid, aid, oldAid, operatorType, data));
|