|
@@ -728,7 +728,7 @@ public class SysAdminSetController {
|
|
@Transactional
|
|
@Transactional
|
|
@OperationLogDetail(operationType = OperationTypeEnum.SAVE)
|
|
@OperationLogDetail(operationType = OperationTypeEnum.SAVE)
|
|
public Result sysadminFontSave(@ApiParam(value = "学校ID", required = true) @RequestParam Long schoolId,
|
|
public Result sysadminFontSave(@ApiParam(value = "学校ID", required = true) @RequestParam Long schoolId,
|
|
- @ApiParam(value = "附件ID", required = true) @RequestParam Long attachmentId) {
|
|
|
|
|
|
+ @ApiParam(value = "附件ID", required = true) @RequestParam String attachmentId) {
|
|
BasicAttachment basicAttachment = basicAttachmentService.getById(attachmentId);
|
|
BasicAttachment basicAttachment = basicAttachmentService.getById(attachmentId);
|
|
Objects.requireNonNull(basicAttachment, "未找到附件信息");
|
|
Objects.requireNonNull(basicAttachment, "未找到附件信息");
|
|
|
|
|
|
@@ -764,18 +764,18 @@ public class SysAdminSetController {
|
|
@RequestMapping(value = "/font/update", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/font/update", method = RequestMethod.POST)
|
|
@Transactional
|
|
@Transactional
|
|
public Result sysadminFontUpdate(@ApiParam(value = "学校ID", required = true) @RequestParam Long schoolId,
|
|
public Result sysadminFontUpdate(@ApiParam(value = "学校ID", required = true) @RequestParam Long schoolId,
|
|
- @ApiParam(value = "附件ID", required = true) @RequestParam Long attachmentId) {
|
|
|
|
|
|
+ @ApiParam(value = "附件ID", required = true) @RequestParam String attachmentId) {
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SCHOOL_FONT_TEMPLATE);
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SCHOOL_FONT_TEMPLATE);
|
|
Objects.requireNonNull(sysConfig, "未找到字体信息");
|
|
Objects.requireNonNull(sysConfig, "未找到字体信息");
|
|
|
|
|
|
List<SetFontDto> setFontDtoList = GsonUtil.fromJson(sysConfig.getConfigValue(), new TypeToken<List<SetFontDto>>() {
|
|
List<SetFontDto> setFontDtoList = GsonUtil.fromJson(sysConfig.getConfigValue(), new TypeToken<List<SetFontDto>>() {
|
|
}.getType());
|
|
}.getType());
|
|
setFontDtoList.stream().map(s -> {
|
|
setFontDtoList.stream().map(s -> {
|
|
- if (s.getAttachmentId().longValue() == attachmentId.longValue() && attachmentId.longValue() == -1L && s.getChoose()) {
|
|
|
|
|
|
+ if (Objects.equals(s.getAttachmentId(), attachmentId) && Objects.equals(attachmentId, "-1") && s.getChoose()) {
|
|
throw ExceptionResultEnum.ERROR.exception("系统默认字体已被选择");
|
|
throw ExceptionResultEnum.ERROR.exception("系统默认字体已被选择");
|
|
- } else if (s.getAttachmentId().longValue() == attachmentId.longValue() && s.getChoose()) {
|
|
|
|
|
|
+ } else if (Objects.equals(s.getAttachmentId(), attachmentId) && s.getChoose()) {
|
|
throw ExceptionResultEnum.ERROR.exception("当前字体已被选择");
|
|
throw ExceptionResultEnum.ERROR.exception("当前字体已被选择");
|
|
- } else if (s.getAttachmentId().longValue() == attachmentId.longValue()) {
|
|
|
|
|
|
+ } else if (Objects.equals(s.getAttachmentId(), attachmentId)) {
|
|
s.setChoose(true);
|
|
s.setChoose(true);
|
|
} else {
|
|
} else {
|
|
s.setChoose(false);
|
|
s.setChoose(false);
|
|
@@ -798,16 +798,16 @@ public class SysAdminSetController {
|
|
@RequestMapping(value = "/font/delete", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/font/delete", method = RequestMethod.POST)
|
|
@Transactional
|
|
@Transactional
|
|
public Result sysadminFontDelete(@ApiParam(value = "学校ID", required = true) @RequestParam Long schoolId,
|
|
public Result sysadminFontDelete(@ApiParam(value = "学校ID", required = true) @RequestParam Long schoolId,
|
|
- @ApiParam(value = "附件ID", required = true) @RequestParam Long attachmentId) {
|
|
|
|
|
|
+ @ApiParam(value = "附件ID", required = true) @RequestParam String attachmentId) {
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SCHOOL_FONT_TEMPLATE);
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(schoolId, SystemConstant.SCHOOL_FONT_TEMPLATE);
|
|
Objects.requireNonNull(sysConfig, "未找到字体信息");
|
|
Objects.requireNonNull(sysConfig, "未找到字体信息");
|
|
- if (attachmentId.longValue() == -1L) {
|
|
|
|
|
|
+ if (Objects.equals(attachmentId, "-1")) {
|
|
throw ExceptionResultEnum.ERROR.exception("系统默认字体无法删除");
|
|
throw ExceptionResultEnum.ERROR.exception("系统默认字体无法删除");
|
|
}
|
|
}
|
|
|
|
|
|
List<SetFontDto> setFontDtoList = GsonUtil.fromJson(sysConfig.getConfigValue(), new TypeToken<List<SetFontDto>>() {
|
|
List<SetFontDto> setFontDtoList = GsonUtil.fromJson(sysConfig.getConfigValue(), new TypeToken<List<SetFontDto>>() {
|
|
}.getType());
|
|
}.getType());
|
|
- List<SetFontDto> setFontDtoDelList = setFontDtoList.stream().filter(s -> s.getAttachmentId().longValue() == attachmentId.longValue()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<SetFontDto> setFontDtoDelList = setFontDtoList.stream().filter(s -> Objects.equals(s.getAttachmentId(), attachmentId)).collect(Collectors.toList());
|
|
if (CollectionUtils.isEmpty(setFontDtoDelList)) {
|
|
if (CollectionUtils.isEmpty(setFontDtoDelList)) {
|
|
throw ExceptionResultEnum.ERROR.exception("未找到字体");
|
|
throw ExceptionResultEnum.ERROR.exception("未找到字体");
|
|
} else {
|
|
} else {
|