@@ -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);
|
||||
}
|
||||
|
||||
@@ -43,8 +43,11 @@ public class MenuBarServiceImpl implements IMenuBarService {
|
||||
|
||||
@Override
|
||||
public List<MenuBar> findMenuBarById(Integer userId) {
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(userId)
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(userId);
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
List<MenuBar> list = getMenuBarList(userCurrentRole.getSchId());
|
||||
List<MenuBar> result = list.stream().filter(MenuBar::getIsShow).collect(Collectors.toList());
|
||||
result = result.stream().sorted(Comparator.comparing(MenuBar::getOrderNum, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
|
||||
|
||||
@@ -42,8 +42,11 @@ public class StatsBarServiceImpl implements IStatsBarService {
|
||||
|
||||
@Override
|
||||
public List<StatsBar> findStatsBarById(Integer userId) {
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(userId)
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(userId);
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
List<StatsBar> list = getStatsBarList(userCurrentRole.getSchId());
|
||||
List<StatsBar> result = list.stream().filter(StatsBar::getIsShow).collect(Collectors.toList());
|
||||
result = result.stream().sorted(Comparator.comparing(StatsBar::getOrderNum, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
|
||||
|
||||
@@ -42,8 +42,11 @@ public class TeacherCopilotServiceImpl implements ITeacherCopilotService {
|
||||
|
||||
@Override
|
||||
public List<TeacherCopilot> findById(Integer userId) {
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleService.findById(userId)
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> userCurrentRoleOpt = userCurrentRoleService.findById(userId);
|
||||
if (!userCurrentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole userCurrentRole = userCurrentRoleOpt.get();
|
||||
List<TeacherCopilot> list = getList(userCurrentRole.getSchId());
|
||||
List<TeacherCopilot> result = list.stream().filter(TeacherCopilot::getIsShow).collect(Collectors.toList());
|
||||
result = result.stream().sorted(Comparator.comparing(TeacherCopilot::getOrderNum, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
|
||||
|
||||
@@ -44,8 +44,11 @@ public class UserSettingsServiceImpl implements IUserSettingsService {
|
||||
|
||||
@Override
|
||||
public List<Wallpaper> findWallList(Integer userId) {
|
||||
UserCurrentRole currentRole = userCurrentRoleService.findById(userId)
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(userId);
|
||||
if (!currentRoleOpt.isPresent()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
UserCurrentRole currentRole = currentRoleOpt.get();
|
||||
List<Wallpaper> resultList = new ArrayList<>();
|
||||
List<Wallpaper> baseList = wallpaperRepository.findBySchIdAndType(0, 0);
|
||||
List<Wallpaper> schList = wallpaperRepository.findBySchIdAndType(currentRole.getSchId(), 1);
|
||||
@@ -80,8 +83,11 @@ public class UserSettingsServiceImpl implements IUserSettingsService {
|
||||
|
||||
@Override
|
||||
public Optional<UserSettings> findUserSettings(Integer userId) {
|
||||
UserCurrentRole currentRole = userCurrentRoleService.findById(userId)
|
||||
.orElseThrow(() -> new BizException(ErrorCode.INTERNAL_SERVER_ERROR));
|
||||
Optional<UserCurrentRole> currentRoleOpt = userCurrentRoleService.findById(userId);
|
||||
if (!currentRoleOpt.isPresent()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
UserCurrentRole currentRole = currentRoleOpt.get();
|
||||
return userSettingsRepository.findByUserIdAndSchIdAndRoleId(currentRole.getUserId(), currentRole.getSchId(), currentRole.getRoleId());
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ yh:
|
||||
enabled: true
|
||||
sso:
|
||||
# CAS 单点登录(浏览器 SSO 重定向 / ticket 校验)
|
||||
server-url-prefix: https://sso.yunhaixingtong.com/cas/
|
||||
server-url-prefix: http://sso.yunhaixingtong.com/cas/
|
||||
# 本地 context-path=/、端口 8070;prod 由 Nacos 的 yh.sso.client-host-url 覆盖
|
||||
client-host-url: http://localhost:8070
|
||||
allow-headers: all
|
||||
@@ -58,7 +58,7 @@ yh:
|
||||
# yh-openapi 开放接口客户端(前缀必须是 yh.open,OpenApiProperties 绑定;base-host + base-path 拼出
|
||||
# 完整跨仓基址,openapi 客户端再拼 /oapi/** 端点;app-key/app-secret 同时驱动应用间签名)
|
||||
enabled: true
|
||||
base-host: http://localhost:8060
|
||||
base-host: http://base.yunhaixingtong.com
|
||||
base-path: /userbase
|
||||
app-key: 100001
|
||||
app-secret: ec4e860206374c80938719fff8e14a86
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" >
|
||||
<g clip-path="url(#clip0_1309_6469)">
|
||||
<path d="M23.6935 22.1975H0.29991C0.13436 22.1975 0 22.0631 0 21.8976V21.2977C0 21.1322 0.13436 20.9978 0.29991 20.9978H2.39934V10.2002C2.39934 9.53796 2.93619 9.00052 3.599 9.00052H8.39769V6.60177C8.39769 5.93893 8.93455 5.40209 9.59737 5.40209H14.3961V3.00215C14.3961 2.33993 14.9329 1.80249 15.5957 1.80249H20.3944C21.0566 1.80249 21.5941 2.33993 21.5941 3.00215V20.9978H23.6935C23.8591 20.9978 23.9934 21.1322 23.9934 21.2977V21.8976C23.9934 22.0631 23.8591 22.1975 23.6935 22.1975ZM8.39769 10.2002H3.599V20.9978H8.39769V10.2002ZM14.3961 6.60118H9.59737V20.9978H14.3961V6.60118ZM20.3944 3.00277H15.5957V20.9978H20.3944V3.00277Z" />
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1309_6469">
|
||||
<rect width="24" height="24"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 886 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M24.0476 21.4494H16.86V23.3254L18.288 24.8248V25.2H9.7102V24.8248L11.141 23.3268V21.4508H3.9506C3.8009 21.4525 3.65233 21.4246 3.51342 21.3687C3.37451 21.3129 3.24798 21.2302 3.14108 21.1254C3.03418 21.0206 2.94901 20.8957 2.89045 20.7579C2.83189 20.6201 2.80108 20.4721 2.7998 20.3224V5.32561C2.7998 4.70401 3.315 4.20001 3.9506 4.20001H24.0476C24.6846 4.20001 25.1998 4.70401 25.1998 5.32561V20.3252C25.198 20.4747 25.1667 20.6223 25.1078 20.7597C25.0489 20.8971 24.9636 21.0216 24.8566 21.126C24.7496 21.2304 24.6231 21.3127 24.4843 21.3682C24.3454 21.4236 24.1971 21.4513 24.0476 21.4494ZM23.664 5.69941H4.3342V17.1836H23.664V5.70081V5.69941Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 752 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M24.0476 21.4494H16.86V23.3254L18.288 24.8248V25.2H9.7102V24.8248L11.141 23.3268V21.4508H3.9506C3.8009 21.4525 3.65233 21.4246 3.51342 21.3687C3.37451 21.3129 3.24798 21.2302 3.14108 21.1254C3.03418 21.0206 2.94901 20.8957 2.89045 20.7579C2.83189 20.6201 2.80108 20.4721 2.7998 20.3224V5.32561C2.7998 4.70401 3.315 4.20001 3.9506 4.20001H24.0476C24.6846 4.20001 25.1998 4.70401 25.1998 5.32561V20.3252C25.198 20.4747 25.1667 20.6223 25.1078 20.7597C25.0489 20.8971 24.9636 21.0216 24.8566 21.126C24.7496 21.2304 24.6231 21.3127 24.4843 21.3682C24.3454 21.4236 24.1971 21.4513 24.0476 21.4494ZM23.664 5.69941H4.3342V17.1836H23.664V5.70081V5.69941Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 752 B |
@@ -0,0 +1,10 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" >
|
||||
<g clip-path="url(#clip0_1309_6469)">
|
||||
<path d="M23.6935 22.1975H0.29991C0.13436 22.1975 0 22.0631 0 21.8976V21.2977C0 21.1322 0.13436 20.9978 0.29991 20.9978H2.39934V10.2002C2.39934 9.53796 2.93619 9.00052 3.599 9.00052H8.39769V6.60177C8.39769 5.93893 8.93455 5.40209 9.59737 5.40209H14.3961V3.00215C14.3961 2.33993 14.9329 1.80249 15.5957 1.80249H20.3944C21.0566 1.80249 21.5941 2.33993 21.5941 3.00215V20.9978H23.6935C23.8591 20.9978 23.9934 21.1322 23.9934 21.2977V21.8976C23.9934 22.0631 23.8591 22.1975 23.6935 22.1975ZM8.39769 10.2002H3.599V20.9978H8.39769V10.2002ZM14.3961 6.60118H9.59737V20.9978H14.3961V6.60118ZM20.3944 3.00277H15.5957V20.9978H20.3944V3.00277Z" />
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1309_6469">
|
||||
<rect width="24" height="24"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 886 B |
Binary file not shown.
|
After Width: | Height: | Size: 445 KiB |
Reference in New Issue
Block a user