|
|
@@ -1,6 +1,13 @@
|
|
|
package com.mokamrp.privates.controller;
|
|
|
|
|
|
+import com.mokamrp.privates.constant.Constants;
|
|
|
import com.mokamrp.privates.constant.HttpStatus;
|
|
|
+import com.mokamrp.privates.entity.PostWorkEmployee;
|
|
|
+import com.mokamrp.privates.entity.SetWorkEmployeeTagHandle;
|
|
|
+import com.mokamrp.privates.entity.WorkEmployeeHandle;
|
|
|
+import com.mokamrp.privates.help.AjaxResult;
|
|
|
+import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
+import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.entity.*;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
@@ -62,8 +69,8 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
return AjaxResult.error(HttpStatus.LOGIN_ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
|
|
|
- List<Integer> userCorpIds = userCorpService.getAuthUserCorpIds(user.getUserid());
|
|
|
- Object res = workEmployeeService.selectWorkEmployeeList(user.getUserid(), workEmployee);
|
|
|
+ List<Integer> userCorpIds = userCorpService.getAuthUserCorpIds(authUser.getId().toString());
|
|
|
+ Object res = workEmployeeService.selectWorkEmployeeList(authUser.getId().toString(), workEmployee);
|
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
|
|
|
|
@@ -71,16 +78,13 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
@ResponseBody
|
|
|
public Object getList(
|
|
|
@AuthUser User authUser,
|
|
|
- @Valid @RequestBody PostWorkEmployee handle, BindingResult bindingResult,
|
|
|
- HttpServletRequest request) {
|
|
|
-
|
|
|
- XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
|
|
|
+ @Valid @RequestBody PostWorkEmployee handle, BindingResult bindingResult) {
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
|
|
|
- List<Integer> corpIds = userCorpService.getAuthUserCorpIds(user.getUserid());
|
|
|
+ List<Integer> corpIds = userCorpService.getAuthUserCorpIds(authUser.getId().toString());
|
|
|
if (corpIds.size() <= 0) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, UserCorpService.USER_MSG);
|
|
|
}
|
|
|
@@ -92,19 +96,32 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置客服标签
|
|
|
+ * @param setTagHandle
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/setTag")
|
|
|
+ public Object setTag(@RequestBody SetWorkEmployeeTagHandle setTagHandle){
|
|
|
+ if(setTagHandle.getEmployeeIds().size() <= 0){
|
|
|
+ return AjaxResult.error("employeeIds null");
|
|
|
+ }
|
|
|
+ workEmployeeService.setTag(setTagHandle.getTagId(),setTagHandle.getEmployeeIds());
|
|
|
+ return AjaxResult.success(Constants.SUCCESS);
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping("/export")
|
|
|
@ResponseBody
|
|
|
public Object export(
|
|
|
@AuthUser User authUser,
|
|
|
- @Valid @RequestBody PostWorkEmployee handle, BindingResult bindingResult,
|
|
|
- HttpServletRequest request) {
|
|
|
- XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
|
|
|
+ @Valid @RequestBody PostWorkEmployee handle, BindingResult bindingResult) {
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
|
|
|
- List<Integer> corpIds = userCorpService.getAuthUserCorpIds(user.getUserid());
|
|
|
+ List<Integer> corpIds = userCorpService.getAuthUserCorpIds(authUser.getId().toString());
|
|
|
if(corpIds.size() <=0){
|
|
|
return AjaxResult.error(HttpStatus.ERROR, UserCorpService.USER_MSG);
|
|
|
}
|