Browse Source

fix(修改获取用户id方式) 影响workroomcontroller workcontactemployeecontroller workemployeecontroller

gengyang 5 years ago
parent
commit
c10a38324f

+ 6 - 10
src/main/java/com/mokamrp/privates/controller/WorkContactEmployeeController.java

@@ -69,16 +69,14 @@ public class WorkContactEmployeeController extends BaseController<WorkContactEmp
     @ResponseBody
     public Object getList(
             @AuthUser User authUser,
-            @Valid @RequestBody GetWorkContactEmployeeHandle handle, BindingResult bindingResult,
-            HttpServletRequest request) {
+            @Valid @RequestBody GetWorkContactEmployeeHandle handle, BindingResult bindingResult) {
 
-        XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
 
         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);
@@ -88,22 +86,19 @@ public class WorkContactEmployeeController extends BaseController<WorkContactEmp
         Map<String, Object> resMap = WorkContactEmployeeService.getPageList(handle);//所有
 
         return AjaxResult.success(resMap);
-
     }
 
     @RequestMapping("/export")
     @ResponseBody
     public Object export(
             @AuthUser User authUser,
-            @Valid @RequestBody GetWorkContactEmployeeHandle handle, BindingResult bindingResult,
-            HttpServletRequest request) {
-        XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
+            @Valid @RequestBody GetWorkContactEmployeeHandle 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);
         }
@@ -112,8 +107,9 @@ public class WorkContactEmployeeController extends BaseController<WorkContactEmp
 
         Downfile downObj = new Downfile();
         downObj.setMsg(Downfile.DEFAULT_MSG);
-        downObj.setAuthId(authUser.getId());
+        downObj.setAuthId(Integer.parseInt(authUser.getId().toString()));
         downObj.setAuthName(authUser.getName());
+
         downObj.setTitle(Downfile.WORK_CONTACT_EMPLOYEE);
         downfileService.save(downObj);
 

+ 6 - 11
src/main/java/com/mokamrp/privates/controller/WorkEmployeeController.java

@@ -69,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);
     }
 
@@ -78,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);
         }
@@ -118,15 +115,13 @@ public class WorkEmployeeController extends BaseController<WorkEmployee> {
     @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);
         }

+ 3 - 7
src/main/java/com/mokamrp/privates/controller/WorkRoomController.java

@@ -61,16 +61,13 @@ public class WorkRoomController extends BaseController<WorkRoom> {
     @ResponseBody
     public Object getList(
             @AuthUser User authUser,
-            @Valid @RequestBody GetWorkRoomHandle handle, BindingResult bindingResult,
-            HttpServletRequest request) {
-
-        XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
+            @Valid @RequestBody GetWorkRoomHandle 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);
         }
@@ -88,12 +85,11 @@ public class WorkRoomController extends BaseController<WorkRoom> {
             @Valid @RequestBody GetWorkRoomHandle handle, BindingResult bindingResult,
             HttpServletRequest request) {
 
-        XxlSsoUser user = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
         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);
         }

+ 1 - 0
src/main/java/com/mokamrp/privates/entity/PostWorkEmployee.java

@@ -17,4 +17,5 @@ public class PostWorkEmployee {
     private Integer gender;
     private Integer groupId;
     private String mobile;
+    private Integer privateTagId;
 }