|
@@ -55,6 +55,18 @@ public class NoveltyCompareLiteratureService extends ServiceImpl<NoveltyCompareL
|
|
|
return noveltyCompareLiteratureMapper.queryCompareFile(vo);
|
|
|
}
|
|
|
|
|
|
+ public Integer addCompareFile(AddCompareFileDTO vo) {
|
|
|
+ Integer compareLitertureId = vo.getCompareLitertureId();
|
|
|
+ NoveltyCompareLiterature literature = noveltyCompareLiteratureMapper.selectOne(new LambdaQueryWrapper<NoveltyCompareLiterature>()
|
|
|
+ .eq(NoveltyCompareLiterature::getCompareLitertureId, compareLitertureId));
|
|
|
+ if (ObjectUtils.isEmpty(literature)) {
|
|
|
+ literature = new NoveltyCompareLiterature();
|
|
|
+ BeanUtils.copyProperties(vo, literature);
|
|
|
+ literature.insert();
|
|
|
+ }
|
|
|
+ return literature.getId();
|
|
|
+ }
|
|
|
+
|
|
|
public Integer editCompareFile(AddCompareFileDTO vo) {
|
|
|
NoveltyCompareLiterature literature = noveltyCompareLiteratureMapper.selectById(vo.getCompareFileId());
|
|
|
BeanUtils.copyProperties(vo, literature);
|