diff --git a/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java b/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java index 49903e8..58881e1 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java @@ -360,11 +360,11 @@ public class CMSJournalService { * @return */ public Result update(String id, String token, JournalAddModel param) { + Journal oldJournal = journalDao.findById(id).get(); List byJournalNo = journalDao.findByJournalNo(param.getJournalNo()); - if (byJournalNo.size() > 0) { + if (!oldJournal.getJournalNo().equals(param.getJournalNo()) && byJournalNo.size() > 0) { return Result.failed("更新失败,期刊编号已存在"); } - Journal oldJournal = journalDao.findById(id).get(); Journal journal = buildJournal(id, param, token); String srcKey = null; if (param.getImage().contains(Constants.TEMP_KEY_PREFIX)) {