|
@ -110,6 +110,7 @@ public class ArchivesDictionaryImpl implements ArchivesDictionaryService { |
|
|
List<ArchivesDictionary> arc1 = archivesDictionaryRepository.querybyName(arc.getFieldName(), arc.getFieldCnName()); |
|
|
List<ArchivesDictionary> arc1 = archivesDictionaryRepository.querybyName(arc.getFieldName(), arc.getFieldCnName()); |
|
|
if (arc1.size() == 0) { |
|
|
if (arc1.size() == 0) { |
|
|
arc.setId(NanoIdUtils.randomNanoId()); |
|
|
arc.setId(NanoIdUtils.randomNanoId()); |
|
|
|
|
|
arc.setIsInput(true); |
|
|
archivesDictionaryRepository.save(arc); |
|
|
archivesDictionaryRepository.save(arc); |
|
|
} else { |
|
|
} else { |
|
|
throw new BaseException("字段名称不能重复"); |
|
|
throw new BaseException("字段名称不能重复"); |
|
@ -151,8 +152,8 @@ public class ArchivesDictionaryImpl implements ArchivesDictionaryService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<ArchivesDictionaryDTO> getIsDisPlayState(Boolean isDisPlayState) { |
|
|
|
|
|
List<ArchivesDictionary> list = archivesDictionaryRepository.findByIsDisplay(isDisPlayState); |
|
|
|
|
|
|
|
|
public List<ArchivesDictionaryDTO> getIsDisPlayState(Boolean isDisPlayState, String categoryId) { |
|
|
|
|
|
List<ArchivesDictionary> list = archivesDictionaryRepository.findByIsDisplayAndCategoryId(isDisPlayState, categoryId); |
|
|
List<ArchivesDictionaryDTO> list1 = new ArrayList<>(); |
|
|
List<ArchivesDictionaryDTO> list1 = new ArrayList<>(); |
|
|
list.forEach(item -> { |
|
|
list.forEach(item -> { |
|
|
ArchivesDictionaryDTO ar = archivesDictionaryMapper.toDto(item); |
|
|
ArchivesDictionaryDTO ar = archivesDictionaryMapper.toDto(item); |
|
@ -181,12 +182,12 @@ public class ArchivesDictionaryImpl implements ArchivesDictionaryService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void updateDisplaryOrder(Set<ArchivesDisplaySmallDTO> archivesDisplaySmallDTO) { |
|
|
public void updateDisplaryOrder(Set<ArchivesDisplaySmallDTO> archivesDisplaySmallDTO) { |
|
|
archivesDisplaySmallDTO.forEach(item->{ |
|
|
|
|
|
|
|
|
archivesDisplaySmallDTO.forEach(item -> { |
|
|
ArchivesDictionary archivesDictionary = archivesDictionaryRepository.findById(item.getId()).orElseGet(ArchivesDictionary::new); |
|
|
ArchivesDictionary archivesDictionary = archivesDictionaryRepository.findById(item.getId()).orElseGet(ArchivesDictionary::new); |
|
|
if (archivesDictionary!=null){ |
|
|
|
|
|
|
|
|
if (archivesDictionary != null) { |
|
|
archivesDictionary.setDisplayOrder(item.getDisplayOrder()); |
|
|
archivesDictionary.setDisplayOrder(item.getDisplayOrder()); |
|
|
archivesDictionaryRepository.save(archivesDictionary); |
|
|
archivesDictionaryRepository.save(archivesDictionary); |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
throw new BaseException("没有找到数据"); |
|
|
throw new BaseException("没有找到数据"); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -194,12 +195,25 @@ public class ArchivesDictionaryImpl implements ArchivesDictionaryService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void updateQueue(Set<ArchivesDisplaySmallDTO> archivesDisplaySmallDTO) { |
|
|
public void updateQueue(Set<ArchivesDisplaySmallDTO> archivesDisplaySmallDTO) { |
|
|
archivesDisplaySmallDTO.forEach(item->{ |
|
|
|
|
|
|
|
|
archivesDisplaySmallDTO.forEach(item -> { |
|
|
ArchivesDictionary archivesDictionary = archivesDictionaryRepository.findById(item.getId()).orElseGet(ArchivesDictionary::new); |
|
|
ArchivesDictionary archivesDictionary = archivesDictionaryRepository.findById(item.getId()).orElseGet(ArchivesDictionary::new); |
|
|
if (archivesDictionary!=null){ |
|
|
|
|
|
|
|
|
if (archivesDictionary != null) { |
|
|
archivesDictionary.setQueue(item.getQueue()); |
|
|
archivesDictionary.setQueue(item.getQueue()); |
|
|
archivesDictionaryRepository.save(archivesDictionary); |
|
|
archivesDictionaryRepository.save(archivesDictionary); |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
throw new BaseException("没有找到数据"); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void updateOrderBy(Set<ArchivesDisplaySmallDTO> archivesDisplaySmallDTOS) { |
|
|
|
|
|
archivesDisplaySmallDTOS.forEach(item -> { |
|
|
|
|
|
ArchivesDictionary archivesDictionary = archivesDictionaryRepository.findById(item.getId()).orElseGet(ArchivesDictionary::new); |
|
|
|
|
|
if (archivesDictionary != null) { |
|
|
|
|
|
archivesDictionary.setDisplayOrderBy(item.getDisplayOrderBy()); |
|
|
|
|
|
archivesDictionaryRepository.save(archivesDictionary); |
|
|
|
|
|
} else { |
|
|
throw new BaseException("没有找到数据"); |
|
|
throw new BaseException("没有找到数据"); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|