@@ -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