forked from liweijie/education
教研室账号校验改为用角色校验
This commit is contained in:
@@ -17,4 +17,13 @@ public interface JYSDLBMapper extends BaseMapper<JYSDLB> {
|
|||||||
+ "WHERE LOWER(TRIM(a.\"账号\")) = LOWER(TRIM(#{username})) "
|
+ "WHERE LOWER(TRIM(a.\"账号\")) = LOWER(TRIM(#{username})) "
|
||||||
+ "OR LOWER(TRIM(a.\"统一账号\")) = LOWER(TRIM(#{username}))")
|
+ "OR LOWER(TRIM(a.\"统一账号\")) = LOWER(TRIM(#{username}))")
|
||||||
String selectResearchOfficeIdByAccount(@Param("username") String username);
|
String selectResearchOfficeIdByAccount(@Param("username") String username);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按登录用户所属部门(SYS_USER.DEPT_ID = 教研室表.部门编号)解析教研室。
|
||||||
|
* 用于持有教研室角色的系统账号(旧账号体系的教研室登录表未绑定时兜底)。
|
||||||
|
*/
|
||||||
|
@Select("SELECT TRIM(b.\"教研室代号\") FROM \"教研室表\" b "
|
||||||
|
+ "JOIN SYS_USER u ON u.DEPT_ID = b.\"部门编号\" "
|
||||||
|
+ "WHERE LOWER(TRIM(u.USER_NAME)) = LOWER(TRIM(#{username})) AND ROWNUM = 1")
|
||||||
|
String selectResearchOfficeIdByUserDept(@Param("username") String username);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -257,7 +257,7 @@ public class TeachingMaterialServiceImpl implements TeachingMaterialService {
|
|||||||
public void downloadTemplate(HttpServletResponse response) {
|
public void downloadTemplate(HttpServletResponse response) {
|
||||||
try {
|
try {
|
||||||
// 从resources/template目录读取模板文件
|
// 从resources/template目录读取模板文件
|
||||||
ClassPathResource resource = new ClassPathResource("template/教材管理.xls");
|
ClassPathResource resource = new ClassPathResource("file/教材管理.xls");
|
||||||
InputStream is = resource.getInputStream();
|
InputStream is = resource.getInputStream();
|
||||||
|
|
||||||
// 设置响应头
|
// 设置响应头
|
||||||
|
|||||||
@@ -103,7 +103,12 @@ public class JwglRoleHelper {
|
|||||||
if (StringUtils.isEmpty(username) || jysdlbMapper == null) {
|
if (StringUtils.isEmpty(username) || jysdlbMapper == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return jysdlbMapper.selectResearchOfficeIdByAccount(username);
|
String officeId = jysdlbMapper.selectResearchOfficeIdByAccount(username);
|
||||||
|
// 教研室角色账号按所属部门解析教研室;普通教员不得走此通道
|
||||||
|
if (StringUtils.isEmpty(officeId) && hasRoleKey(ROLE_RESEARCH_OFFICE)) {
|
||||||
|
officeId = jysdlbMapper.selectResearchOfficeIdByUserDept(username);
|
||||||
|
}
|
||||||
|
return officeId;
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user