修改事务
This commit is contained in:
@@ -348,13 +348,14 @@ public class BookController {
|
|||||||
@RequestMapping("/getChapter")
|
@RequestMapping("/getChapter")
|
||||||
@Transactional
|
@Transactional
|
||||||
public R getChapter(@RequestParam("id") Integer id) {
|
public R getChapter(@RequestParam("id") Integer id) {
|
||||||
|
if (bookService.getWordSection(id)){
|
||||||
bookService.getWordSection(id);
|
|
||||||
BookEntity bookEntity = bookService.getBaseMapper().selectById(id);
|
BookEntity bookEntity = bookService.getBaseMapper().selectById(id);
|
||||||
bookEntity.setChapterStatus("2");
|
bookEntity.setChapterStatus("2");
|
||||||
bookService.updateById(bookEntity);
|
bookService.updateById(bookEntity);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
}else {
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -457,7 +457,6 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
|||||||
try{
|
try{
|
||||||
bookChapterService.remove(new LambdaQueryWrapper<BookChapterEntity>().eq(BookChapterEntity::getBookId,bookId));
|
bookChapterService.remove(new LambdaQueryWrapper<BookChapterEntity>().eq(BookChapterEntity::getBookId,bookId));
|
||||||
bookChapterContentService.remove(new LambdaQueryWrapper<BookChapterContentEntity>().eq(BookChapterContentEntity::getBookId,bookId));
|
bookChapterContentService.remove(new LambdaQueryWrapper<BookChapterContentEntity>().eq(BookChapterContentEntity::getBookId,bookId));
|
||||||
|
|
||||||
int topText = 22;
|
int topText = 22;
|
||||||
int secText = 16;
|
int secText = 16;
|
||||||
BookEntity bookEntity = this.getBaseMapper().selectById(bookId);
|
BookEntity bookEntity = this.getBaseMapper().selectById(bookId);
|
||||||
@@ -539,14 +538,14 @@ public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new NullPointerException();
|
return true;
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
//事务回滚
|
//事务回滚
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public String uploadFile(InputStream inputStream,String fileName) {
|
public String uploadFile(InputStream inputStream,String fileName) {
|
||||||
String endpoint = ConstantPropertiesUtils.END_POIND;
|
String endpoint = ConstantPropertiesUtils.END_POIND;
|
||||||
String accessKeyId = ConstantPropertiesUtils.ACCESS_KEY_ID;
|
String accessKeyId = ConstantPropertiesUtils.ACCESS_KEY_ID;
|
||||||
|
|||||||
Reference in New Issue
Block a user