@@ -30,16 +30,22 @@ public class MenuBarController {
|
||||
|
||||
@GetMapping("getMenuBarSchList")
|
||||
public List<MenuBar> getMenuBarSchList(BoaUser authUserWithDept) {
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new com.yunhai.platform.apistd.BizException(com.yunhai.platform.utils.exception.ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
return menuBarService.getMenuBarList(userCurrentRole.getSchId());
|
||||
}
|
||||
|
||||
@GetMapping("getMenuBarList")
|
||||
public List<Map> getMenuBarList(BoaUser authUserWithDept) {
|
||||
List<Map> result = new ArrayList<>();
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new com.yunhai.platform.apistd.BizException(com.yunhai.platform.utils.exception.ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return result;
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
Integer roleId = userCurrentRole.getRoleId();
|
||||
if (roleId == 7 || roleId == 2) roleId = 2;
|
||||
Boolean isSuperAdmin = authUserWithDept.getType() == 1;
|
||||
|
||||
@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -24,10 +26,12 @@ public class SocketController {
|
||||
private String websocketUrl;
|
||||
|
||||
@GetMapping("getMsgAddress")
|
||||
public String getMsgAddress(BoaUser authUserWithDept) {
|
||||
public Map<String, String> getMsgAddress(BoaUser authUserWithDept) {
|
||||
Integer uid = authUserWithDept.getId();
|
||||
UUID uuid = UUID.randomUUID();
|
||||
MapCacheUtil.getInstance().add(uuid.toString(), uid.toString(), 20 * 1000L);
|
||||
return this.websocketUrl + "/" + uuid.toString();
|
||||
Map<String, String> result = new HashMap<>();
|
||||
result.put("url", this.websocketUrl + "/" + uuid.toString());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,16 +30,22 @@ public class StatsBarController {
|
||||
|
||||
@GetMapping("getStatsBarSchList")
|
||||
public List<StatsBar> getStatsBarSchList(BoaUser authUserWithDept) {
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new com.yunhai.platform.apistd.BizException(com.yunhai.platform.utils.exception.ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
return statsBarService.getStatsBarList(userCurrentRole.getSchId());
|
||||
}
|
||||
|
||||
@GetMapping("getStatsBarList")
|
||||
public List<Map> getStatsBarList(BoaUser authUserWithDept) {
|
||||
List<Map> result = new ArrayList<>();
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new com.yunhai.platform.apistd.BizException(com.yunhai.platform.utils.exception.ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return result;
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
Integer roleId = userCurrentRole.getRoleId();
|
||||
if (roleId == 7 || roleId == 2) roleId = 2;
|
||||
Boolean isSuperAdmin = authUserWithDept.getType() == 1;
|
||||
|
||||
@@ -30,16 +30,22 @@ public class TeacherCopilotController {
|
||||
|
||||
@GetMapping("TeacherCopilot/getSchList")
|
||||
public List<TeacherCopilot> getList(BoaUser authUserWithDept) {
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new com.yunhai.platform.apistd.BizException(com.yunhai.platform.utils.exception.ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
return teacherCopilotService.getList(userCurrentRole.getSchId());
|
||||
}
|
||||
|
||||
@GetMapping("TeacherCopilot/getUserList")
|
||||
public List<TeacherCopilot.Dto> getUserList(BoaUser authUserWithDept) {
|
||||
List<TeacherCopilot.Dto> result = new ArrayList<>();
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new com.yunhai.platform.apistd.BizException(com.yunhai.platform.utils.exception.ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return result;
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
Integer roleId = userCurrentRole.getRoleId();
|
||||
if (roleId == 7 || roleId == 2) roleId = 2;
|
||||
Boolean isSuperAdmin = authUserWithDept.getType() == 1;
|
||||
|
||||
@@ -81,8 +81,10 @@ public class UserSettingsController {
|
||||
}
|
||||
|
||||
@PostMapping(value = "iconUpload", produces = "application/json")
|
||||
public String iconUpload(BoaUser authUserWithDept, @RequestParam("file") MultipartFile file) {
|
||||
return this.upload(file, "icon");
|
||||
public Map<String, String> iconUpload(BoaUser authUserWithDept, @RequestParam("file") MultipartFile file) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
result.put("url", this.upload(file, "icon"));
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostMapping(value = "deleteWallById", produces = "application/json")
|
||||
@@ -127,16 +129,15 @@ public class UserSettingsController {
|
||||
|
||||
@GetMapping(value = "getUserSettings")
|
||||
public UserSettings getUserSettings(BoaUser authUserWithDept) {
|
||||
UserCurrentRole currentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Integer schId = currentRole.getSchId();
|
||||
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
Integer schId = currentRoleOpt.isPresent() ? currentRoleOpt.get().getSchId() : null;
|
||||
UserSettings model = new UserSettings();
|
||||
Optional<UserSettings> optional = userSettingsService.findUserSettings(authUserWithDept.getId());
|
||||
// TODO 待确认:bschBaseOpenApi.getPcGrzxPage —— 新框架 YschBaseOpenApi 是否有此方法待确认
|
||||
// List<BoaApp> appPageList = bschBaseOpenApi.getPcGrzxPage(authUserWithDept.getId(), schId);
|
||||
List<BoaApp> appPageList = Collections.emptyList();
|
||||
if (optional.isPresent()) model = optional.get();
|
||||
if (model.getWallpaperUrl() == null || model.getWallpaperUrl().isEmpty()) {
|
||||
if ((model.getWallpaperUrl() == null || model.getWallpaperUrl().isEmpty()) && schId != null) {
|
||||
List<String> schList = getSchSettingsWallpaper(schId);
|
||||
if (schList.size() > 0) model.setWallpaperUrl(schList.get(0));
|
||||
}
|
||||
@@ -155,8 +156,11 @@ public class UserSettingsController {
|
||||
|
||||
@GetMapping(value = "getUserDesktopAppList")
|
||||
public List<Map> getUserDesktopAppList(BoaUser authUserWithDept) {
|
||||
UserCurrentRole currentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!currentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole currentRole = currentRoleOpt.get();
|
||||
Optional<UserSettings> optional = userSettingsService.findUserSettings(authUserWithDept.getId());
|
||||
Integer schId = currentRole.getSchId(), userId = currentRole.getUserId();
|
||||
UserSettings model = new UserSettings();
|
||||
@@ -246,16 +250,21 @@ public class UserSettingsController {
|
||||
|
||||
@GetMapping(value = "getLightAppList", produces = "application/json")
|
||||
public List<LightApp> getLightAppList(BoaUser authUserWithDept) {
|
||||
UserCurrentRole currentRole = userCurrentRoleService.findById(authUserWithDept.getId())
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Integer schId, userId = null;
|
||||
if (authUserWithDept.getType() == 1) {
|
||||
schId = 0;
|
||||
} else if (currentRole.getRoleId() == 7 || currentRole.getRoleId() == 2) {
|
||||
schId = currentRole.getSchId();
|
||||
} else {
|
||||
schId = currentRole.getSchId();
|
||||
userId = currentRole.getUserId();
|
||||
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(authUserWithDept.getId());
|
||||
if (!currentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole currentRole = currentRoleOpt.get();
|
||||
if (currentRole.getRoleId() == 7 || currentRole.getRoleId() == 2) {
|
||||
schId = currentRole.getSchId();
|
||||
} else {
|
||||
schId = currentRole.getSchId();
|
||||
userId = currentRole.getUserId();
|
||||
}
|
||||
}
|
||||
return userSettingsService.findLightAppList(schId, userId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user