From a43578713b7afb69807268008bb7b2e0d922c8cb Mon Sep 17 00:00:00 2001 From: daihh Date: Tue, 3 Jan 2023 10:16:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BA=AB=E4=BB=BD=E5=88=87?= =?UTF-8?q?=E6=8D=A2=EF=BC=8C=E6=94=B9=E5=9B=9E=E5=88=B0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=BA=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/api/PortalConsoleApi.java | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java b/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java index 76db321b..6b62e18f 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/api/PortalConsoleApi.java @@ -15,7 +15,6 @@ import com.xboe.core.CurrentUser; import com.xboe.core.IAuthorizationToken; import com.xboe.core.JsonResponse; import com.xboe.core.api.ApiBaseController; -import com.xboe.data.dto.UserData; import com.xboe.data.outside.IOutSideDataService; import com.xboe.module.teacher.entity.Teacher; import com.xboe.module.teacher.service.ITeacherService; @@ -67,11 +66,11 @@ public class PortalConsoleApi extends ApiBaseController{ return error("账号错误,无此账号"); } - UserData userData = outsideDataService.getUserInfoByUserId(null); - if(userData==null) { - log.error("通过api获取用用户信息错误【"+getCurrent().getAccountId()+"】对应的用户"); - return error("未能获取当前用户信息"); - } +// UserData userData = outsideDataService.getUserInfoByUserId(null); +// if(userData==null) { +// log.error("通过api获取用用户信息错误【"+getCurrent().getAccountId()+"】对应的用户"); +// return error("未能获取当前用户信息"); +// } User user = userService.get(getCurrent().getAccountId()); Organization org = null; @@ -87,42 +86,42 @@ public class PortalConsoleApi extends ApiBaseController{ } } //检查是否是教师,并计算用户的类型,修改于220507 -// Teacher t = teacherService.get(account.getId()); -// int utype=1,ttype=0; -// //本地判断是否是管理员 -// if(user.getUserType()!=null && user.getUserType()==3) { -// utype=3; -// } -// //判断是否是老师 -// if(t!=null && (t.getDeleted()==null || !t.getDeleted())) { -// ttype=2; -// } -// if(utype==3) { -// if(ttype==2) { -// utype=5;//是管理员,又是教师 -// } -// }else { -// if(ttype==2) { -// utype=2; -// } -// } - - int utype=1;//仅仅是学员 - if(userData.getTeacher()) { - utype=2; + Teacher t = teacherService.get(account.getId()); + int utype=1,ttype=0; + //本地判断是否是管理员 + if(user.getUserType()!=null && user.getUserType()==3) { + utype=3; } - if(userData.getAdminType()>0) { - if(utype==2) { + //判断是否是老师 + if(t!=null && (t.getDeleted()==null || !t.getDeleted())) { + ttype=2; + } + if(utype==3) { + if(ttype==2) { utype=5;//是管理员,又是教师 - }else { - utype=3; + } + }else { + if(ttype==2) { + utype=2; } } +// int utype=1;//仅仅是学员 +// if(userData.getTeacher()) { +// utype=2; +// } +// if(userData.getAdminType()>0) { +// if(utype==2) { +// utype=5;//是管理员,又是教师 +// }else { +// utype=3; +// } +// } + map.put("aid",account.getId()); map.put("sysId",user.getSysId()); - map.put("adminType",userData.getAdminType());//管理员类型,1表默认管理员,2表非默认管理员,0表不是管理员 - //map.put("adminType",0); + //map.put("adminType",userData.getAdminType());//管理员类型,1表默认管理员,2表非默认管理员,0表不是管理员 + map.put("adminType",0); map.put("companyId",user.getCompanyId()); map.put("name",user.getName()); map.put("sex",user.getGender());