This commit is contained in:
daihh
2022-12-30 15:16:17 +08:00
parent a5eb00d4ee
commit 56403057df
3 changed files with 40 additions and 35 deletions

View File

@@ -389,6 +389,8 @@ public class CourseManageApi extends ApiBaseController{
return badRequest("请选择资源归属"); return badRequest("请选择资源归属");
} }
//如果是默认管理员,就直接发布,不经过审核
if(dto.getAuditUser()==null) { if(dto.getAuditUser()==null) {
return badRequest("HRBP审核信息错误"); return badRequest("HRBP审核信息错误");
} }

View File

@@ -57,6 +57,11 @@ public class CourseFullDto {
*/ */
private CourseAuditUser auditUser; private CourseAuditUser auditUser;
/**
* 管理员类型
*/
private Integer adminType;
/** /**
* 生成课程的目录树 * 生成课程的目录树
* @return * @return

View File

@@ -67,11 +67,11 @@ public class PortalConsoleApi extends ApiBaseController{
return error("账号错误,无此账号"); return error("账号错误,无此账号");
} }
// UserData userData = outsideDataService.getUserInfoByUserId(null); UserData userData = outsideDataService.getUserInfoByUserId(null);
// if(userData==null) { if(userData==null) {
// log.error("通过api获取用用户信息错误【"+getCurrent().getAccountId()+"】对应的用户"); log.error("通过api获取用用户信息错误【"+getCurrent().getAccountId()+"】对应的用户");
// return error("未能获取当前用户信息"); return error("未能获取当前用户信息");
// } }
User user = userService.get(getCurrent().getAccountId()); User user = userService.get(getCurrent().getAccountId());
Organization org = null; Organization org = null;
@@ -87,44 +87,42 @@ public class PortalConsoleApi extends ApiBaseController{
} }
} }
//检查是否是教师,并计算用户的类型,修改于220507 //检查是否是教师,并计算用户的类型,修改于220507
Teacher t = teacherService.get(account.getId()); // Teacher t = teacherService.get(account.getId());
int utype=1,ttype=0; // int utype=1,ttype=0;
//本地判断是否是管理员 // //本地判断是否是管理员
if(user.getUserType()!=null && user.getUserType()==3) { // 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;
// }
// if(userData.getAdminType()>0) {
// if(utype==2) {
// utype=5;//是管理员,又是教师
// }else {
// utype=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;
}
if(userData.getAdminType()>0) {
if(utype==2) {
utype=5;//是管理员,又是教师
}else {
utype=3;
}
}
map.put("aid",account.getId()); map.put("aid",account.getId());
map.put("sysId",user.getSysId()); map.put("sysId",user.getSysId());
//map.put("adminType",userData.getAdminType());//管理员类型1表默认管理员2表非默认管理员0表不是管理员 map.put("adminType",userData.getAdminType());//管理员类型1表默认管理员2表非默认管理员0表不是管理员
map.put("adminType",0); //map.put("adminType",0);
map.put("companyId",user.getCompanyId()); map.put("companyId",user.getCompanyId());
map.put("name",user.getName()); map.put("name",user.getName());
map.put("sex",user.getGender()); map.put("sex",user.getGender());