xiongzhu před 4 roky
rodič
revize
b91cce7431

+ 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("此藏品不属于你");