|
@@ -98,12 +98,13 @@ public class DocumentsPdfServiceImpl extends ServiceImpl<DocumentsPdfMapper, Doc
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void add(DocumentsPdfDto documentsPdfDto) {
|
|
|
- DocumentsPdf documentsPdf = this.getOne(Wrappers.<DocumentsPdf>query().lambda().eq(DocumentsPdf::getDocumentId,documentsPdfDto.getDocumentId()));
|
|
|
- if(ObjectUtil.isEmpty(documentsPdf)){
|
|
|
+ public synchronized void add(DocumentsPdfDto documentsPdfDto) {
|
|
|
+ DocumentsPdf documentsPdf = this.getOne(q -> q.eq(DocumentsPdf::getDocumentId, documentsPdfDto.getDocumentId()));
|
|
|
+ if (ObjectUtil.isEmpty(documentsPdf)) {
|
|
|
this.save(documentsPdfDto);
|
|
|
- }else{
|
|
|
- this.update(documentsPdfDto,Wrappers.<DocumentsPdf>query().lambda().eq(DocumentsPdf::getDocumentId,documentsPdfDto.getDocumentId()));
|
|
|
+ } else {
|
|
|
+ documentsPdfDto.setId(documentsPdf.getId());
|
|
|
+ this.updateById(documentsPdfDto);
|
|
|
}
|
|
|
}
|
|
|
|