wangqifan 2 år sedan
förälder
incheckning
640f8071ad
1 ändrade filer med 5 tillägg och 2 borttagningar
  1. 5 2
      src/main/java/com/izouma/nineth/service/DomainOrderService.java

+ 5 - 2
src/main/java/com/izouma/nineth/service/DomainOrderService.java

@@ -319,6 +319,7 @@ public class DomainOrderService {
                         sold.put("canAsk", false);
                     } else {
                         sold.put("canAsk", true);
+                        sold.put("collectionId", asset.getPublicCollectionId());
                     }
                     sold.put("id", domainOrder.getId());
                     sold.put("domain", domainOrder.getDomainName().toLowerCase());
@@ -632,8 +633,10 @@ public class DomainOrderService {
 
     public void addHyperLink(Long collectionId, boolean openHyperLink, HyperLinkType hyperLinkType, String address) {
         // Collection collection = collectionRepo.findById(collectionId).orElseThrow(new BusinessException("没找到记录"));
-        Asset asset = assetRepo.findByIdAndStatus(collectionId, AssetStatus.NORMAL).orElseThrow(new BusinessException("没找到记录"));
-        DomainOrder domainOrder = domainOrderRepo.findById(asset.getCollectionId()).orElseThrow(new BusinessException("没找到记录"));
+        Asset asset = assetRepo.findByIdAndStatus(collectionId, AssetStatus.NORMAL)
+                               .orElseThrow(new BusinessException("没找到记录"));
+        DomainOrder domainOrder = domainOrderRepo.findById(asset.getCollectionId())
+                                                 .orElseThrow(new BusinessException("没找到记录"));
         domainOrder.setOpenHyperLink(openHyperLink);
         domainOrder.setHyperLinkType(hyperLinkType);
         domainOrder.setAddress(address);