Browse Source

Merge branch 'dev'

xiongzhu 4 years ago
parent
commit
8593671ba4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main/java/com/izouma/nineth/service/AssetService.java

+ 1 - 1
src/main/java/com/izouma/nineth/service/AssetService.java

@@ -142,7 +142,7 @@ public class AssetService {
         assetRepo.save(asset);
         assetRepo.save(asset);
     }
     }
 
 
-    public void consignment(Long id, BigDecimal price) {
+    public synchronized void consignment(Long id, BigDecimal price) {
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         Asset asset = assetRepo.findById(id).orElseThrow(new BusinessException("无记录"));
         if (!asset.getUserId().equals(SecurityUtils.getAuthenticatedUser().getId())) {
         if (!asset.getUserId().equals(SecurityUtils.getAuthenticatedUser().getId())) {
             throw new BusinessException("此藏品不属于你");
             throw new BusinessException("此藏品不属于你");