期刊修改编号校验

main
JH 10 months ago
parent 5eedcb245d
commit 49a1f6b88a

@ -360,11 +360,11 @@ public class CMSJournalService {
* @return * @return
*/ */
public Result update(String id, String token, JournalAddModel param) { public Result update(String id, String token, JournalAddModel param) {
Journal oldJournal = journalDao.findById(id).get();
List<Journal> byJournalNo = journalDao.findByJournalNo(param.getJournalNo()); List<Journal> byJournalNo = journalDao.findByJournalNo(param.getJournalNo());
if (byJournalNo.size() > 0) { if (!oldJournal.getJournalNo().equals(param.getJournalNo()) && byJournalNo.size() > 0) {
return Result.failed("更新失败,期刊编号已存在"); return Result.failed("更新失败,期刊编号已存在");
} }
Journal oldJournal = journalDao.findById(id).get();
Journal journal = buildJournal(id, param, token); Journal journal = buildJournal(id, param, token);
String srcKey = null; String srcKey = null;
if (param.getImage().contains(Constants.TEMP_KEY_PREFIX)) { if (param.getImage().contains(Constants.TEMP_KEY_PREFIX)) {

Loading…
Cancel
Save