This commit is contained in:
2026-08-13 16:53:39 +08:00
parent 5210ad34f3
commit ed48da0a78
27 changed files with 392 additions and 313 deletions
@@ -6,7 +6,6 @@ import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.SchBinSchsystem;
import com.yunhai.bschclassmanage.enums.UserRole;
import com.yunhai.bschclassmanage.enums.UserType;
import com.yunhai.bschclassmanage.model.tool.UserSysRole;
import com.yunhai.bschclassmanage.model.vo.AcademicStageSchsystemVO;
import com.yunhai.bschclassmanage.model.vo.SelectIntVO;
import com.yunhai.bschclassmanage.service.IComSchTreeService;
@@ -14,7 +13,6 @@ import com.yunhai.bschclassmanage.service.ISchBinSchsystemService;
import com.yunhai.bschclassmanage.utils.LogContextHolder;
import com.yunhai.bschclassmanage.utils.OtherUtil;
import com.yunhai.bschclassmanage.utils.UserContext;
import com.yunhai.platform.utils.model.BoaUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -37,11 +35,10 @@ public class SchsystemController {
* @return 学段分组后的学制列表
*/
@GetMapping("list")
public List<AcademicStageSchsystemVO> getAcademicStageSchsystemList(BoaUser authUserWithDept, UserSysRole curRole,
@RequestParam(required = false) Integer schId) {
public List<AcademicStageSchsystemVO> getAcademicStageSchsystemList(@RequestParam(required = false) Integer schId) {
int roleId = curRole.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(authUserWithDept.getType());
int roleId = UserContext.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType());
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
if (!isSuperAdmin && !isAreaAdmin) {
@@ -52,7 +49,7 @@ public class SchsystemController {
Integer targetSchId;
if (isAreaAdmin) {
// 区域管理员:强制使用自己所属的学校,忽略前端传入的schId
targetSchId = curRole.getSchId();
targetSchId = UserContext.getSchId();
if (targetSchId == null || targetSchId <= 0) {
throw new NullPointerException("当前学校管理员未关联有效的学校");
}
@@ -68,8 +65,8 @@ public class SchsystemController {
}
@GetMapping("getType")
public Integer getSchType(UserSysRole curRole) {
return schBinSchsystemService.getSchType(curRole.getSchId());
public Integer getSchType() {
return schBinSchsystemService.getSchType(UserContext.getSchId());
}
/**
@@ -78,14 +75,13 @@ public class SchsystemController {
*/
@PostMapping("save")
@OperationLog(module = "绑定学制")
public void saveSchBinSchsystem(BoaUser authUserWithDept, UserSysRole curRole,
@RequestParam(required = false) Integer schId,
public void saveSchBinSchsystem(@RequestParam(required = false) Integer schId,
@RequestParam("schsystemIds") String schsystemIdsStr) {
UserContext.UserInfo user= UserContext.getCurrentUserInfo();
UserContext.UserInfo user= UserContext.getCurrentUser();
// 2. 角色权限校验
int roleId = user.getRoleId();
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(authUserWithDept.getType());
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(UserContext.getType());
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
if (!isSuperAdmin && !isAreaAdmin) {
@@ -96,7 +92,7 @@ public class SchsystemController {
Integer targetSchId;
if (isAreaAdmin) {
// 区域管理员:强制使用自己所属的学校,忽略前端传入的schId
targetSchId = curRole.getSchId();
targetSchId = UserContext.getSchId();
if (targetSchId == null || targetSchId <= 0) {
throw new NullPointerException("当前学校管理员未关联有效的学校");
}
@@ -126,8 +122,8 @@ public class SchsystemController {
}
@GetMapping("select")
public List<SelectIntVO> selectSchBinSchsystem(UserSysRole curRole) {
return schBinSchsystemService.selectSchBinSchsystem(curRole.getSchId());
public List<SelectIntVO> selectSchBinSchsystem() {
return schBinSchsystemService.selectSchBinSchsystem(UserContext.getSchId());
}