|
|
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -51,6 +52,7 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
|
|
|
@Autowired
|
|
|
private DownfileService downfileService;
|
|
|
+
|
|
|
/*
|
|
|
* @fast
|
|
|
* 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
|
|
|
@@ -58,7 +60,7 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
*/
|
|
|
@PostMapping("/getWorkEmployeeList")
|
|
|
public Object getWorkEmployeeList(@Valid @RequestBody WorkEmployeeHandle workEmployee, @AuthUser User authUser,
|
|
|
- BindingResult bindingResult,HttpServletRequest request) {
|
|
|
+ BindingResult bindingResult, HttpServletRequest request) {
|
|
|
|
|
|
XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
|
|
|
|
|
|
@@ -71,20 +73,27 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 客服列表查询接口
|
|
|
+ * @param authUser
|
|
|
+ * @param handle
|
|
|
+ * @param bindingResult
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@PostMapping("/list")
|
|
|
- @ResponseBody
|
|
|
- public Object getList(
|
|
|
- @AuthUser User authUser,
|
|
|
- @Valid @RequestBody PostWorkEmployee handle, BindingResult bindingResult) {
|
|
|
+ public Object getList(@AuthUser User authUser, @Valid @RequestBody PostWorkEmployee handle, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
-
|
|
|
- List<Integer> corpIds = userCorpService.getAuthUserCorpIds(authUser.getId().toString());
|
|
|
+ List<Integer> corpIds = new ArrayList<Integer>();
|
|
|
+ if(authUser.getIsSuperAdmin() == 1){
|
|
|
+ corpIds = userCorpService.getAllCorpIds();
|
|
|
+ }else{
|
|
|
+ corpIds = userCorpService.getAuthUserCorpIds(authUser.getId().toString());
|
|
|
+ }
|
|
|
if (corpIds.size() <= 0) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, UserCorpService.USER_MSG);
|
|
|
}
|
|
|
-
|
|
|
handle.setAuthCorpIds(corpIds);
|
|
|
Map<String, Object> resMap = workEmployeeService.getPageList(handle);//所有
|
|
|
|
|
|
@@ -95,15 +104,16 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
|
|
|
/**
|
|
|
* 设置客服标签
|
|
|
+ *
|
|
|
* @param setTagHandle
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/setTag")
|
|
|
- public Object setTag(@RequestBody SetWorkEmployeeTagHandle setTagHandle){
|
|
|
- if(setTagHandle.getEmployeeIds().size() <= 0){
|
|
|
+ public Object setTag(@RequestBody SetWorkEmployeeTagHandle setTagHandle) {
|
|
|
+ if (setTagHandle.getEmployeeIds().size() <= 0) {
|
|
|
return AjaxResult.error("employeeIds null");
|
|
|
}
|
|
|
- workEmployeeService.setTag(setTagHandle.getTagId(),setTagHandle.getEmployeeIds());
|
|
|
+ workEmployeeService.setTag(setTagHandle.getTagId(), setTagHandle.getEmployeeIds());
|
|
|
return AjaxResult.success(Constants.SUCCESS);
|
|
|
}
|
|
|
|
|
|
@@ -118,7 +128,7 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
}
|
|
|
|
|
|
List<Integer> corpIds = userCorpService.getAuthUserCorpIds(authUser.getId().toString());
|
|
|
- if(corpIds.size() <=0){
|
|
|
+ if (corpIds.size() <= 0) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, UserCorpService.USER_MSG);
|
|
|
}
|
|
|
|
|
|
@@ -140,7 +150,7 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
realJob.setJobName(JobWorkEmployeeJobRedis.TASK_NAME);
|
|
|
realJob.setDownFile(downObj);
|
|
|
|
|
|
- redisUtil.leftPush(JobRedis.QUEUE_KEY,realJob);
|
|
|
+ redisUtil.leftPush(JobRedis.QUEUE_KEY, realJob);
|
|
|
|
|
|
return AjaxResult.success("正在异步生成请稍后");
|
|
|
}
|