|
@@ -160,7 +160,8 @@ public class OrderService {
|
|
|
|
|
|
|
|
public Page<Order> all(PageQuery pageQuery) {
|
|
public Page<Order> all(PageQuery pageQuery) {
|
|
|
|
|
|
|
|
- Page<Order> all = orderRepo.findAll(JpaUtils.toSpecification(pageQuery, Order.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
|
|
|
|
+ Page<Order> all = orderRepo
|
|
|
|
|
+ .findAll(JpaUtils.toSpecification(pageQuery, Order.class), JpaUtils.toPageRequest(pageQuery));
|
|
|
List<Order> content = all.getContent();
|
|
List<Order> content = all.getContent();
|
|
|
content.forEach(order -> {
|
|
content.forEach(order -> {
|
|
|
Long userId = orderRepo.selectUserId(order.getAssetId());
|
|
Long userId = orderRepo.selectUserId(order.getAssetId());
|
|
@@ -366,8 +367,8 @@ public class OrderService {
|
|
|
.contactName(Optional.ofNullable(userAddress).map(UserAddress::getName).orElse(null))
|
|
.contactName(Optional.ofNullable(userAddress).map(UserAddress::getName).orElse(null))
|
|
|
.contactPhone(Optional.ofNullable(userAddress).map(UserAddress::getPhone).orElse(null))
|
|
.contactPhone(Optional.ofNullable(userAddress).map(UserAddress::getPhone).orElse(null))
|
|
|
.address(Optional.ofNullable(userAddress).map(u ->
|
|
.address(Optional.ofNullable(userAddress).map(u ->
|
|
|
- u.getProvinceName() + " " + u.getCityName() + " " + u.getDistrictName() + " " + u
|
|
|
|
|
- .getAddress())
|
|
|
|
|
|
|
+ u.getProvinceName() + " " + u.getCityName() + " " + u.getDistrictName() + " " + u
|
|
|
|
|
+ .getAddress())
|
|
|
.orElse(null))
|
|
.orElse(null))
|
|
|
.status(OrderStatus.NOT_PAID)
|
|
.status(OrderStatus.NOT_PAID)
|
|
|
.assetId(collection.getAssetId())
|
|
.assetId(collection.getAssetId())
|
|
@@ -396,7 +397,9 @@ public class OrderService {
|
|
|
// collectionRepo.setOnShelf(collectionId, false);
|
|
// collectionRepo.setOnShelf(collectionId, false);
|
|
|
collectionRepo.setInPaying(collectionId, true);
|
|
collectionRepo.setInPaying(collectionId, true);
|
|
|
//拥有指定藏品降税
|
|
//拥有指定藏品降税
|
|
|
- order.setRoyalties(assetService.getRoyalties(minter.getId(), collection.getRoyalties(), userId));
|
|
|
|
|
|
|
+ Long sellerId = asset.getOwnerId();
|
|
|
|
|
+ order.setRoyalties(assetService.getRoyalties(minter.getId(), collection.getRoyalties(), sellerId));
|
|
|
|
|
+ order.setServiceCharge(assetService.getServicecharge(collection.getServiceCharge(), sellerId));
|
|
|
}
|
|
}
|
|
|
order = orderRepo.save(order);
|
|
order = orderRepo.save(order);
|
|
|
if (order.getTotalPrice().compareTo(BigDecimal.ZERO) == 0) {
|
|
if (order.getTotalPrice().compareTo(BigDecimal.ZERO) == 0) {
|
|
@@ -675,7 +678,8 @@ public class OrderService {
|
|
|
userRepo.updateVipPurchase(order.getUserId(), 1);
|
|
userRepo.updateVipPurchase(order.getUserId(), 1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- Collection winCollection = collectionRepo.findById(winItem.getCollectionId()).orElseThrow(new BusinessException("藏品不存在"));
|
|
|
|
|
|
|
+ Collection winCollection = collectionRepo.findById(winItem.getCollectionId())
|
|
|
|
|
+ .orElseThrow(new BusinessException("藏品不存在"));
|
|
|
assetService.createAsset(winItem, user, order.getId(), order.getPrice(), "出售",
|
|
assetService.createAsset(winItem, user, order.getId(), order.getPrice(), "出售",
|
|
|
winItem.getTotal() > 1 ? collectionService.getNextNumber(winItem.getCollectionId()) : null,
|
|
winItem.getTotal() > 1 ? collectionService.getNextNumber(winItem.getCollectionId()) : null,
|
|
|
winCollection.getHoldDays(), false);
|
|
winCollection.getHoldDays(), false);
|
|
@@ -1086,7 +1090,8 @@ public class OrderService {
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
list.parallelStream().forEach(o -> {
|
|
list.parallelStream().forEach(o -> {
|
|
|
log.info("refundGas {}", o.getId());
|
|
log.info("refundGas {}", o.getId());
|
|
|
- userBalanceService.modifyBalance(o.getUserId(), new BigDecimal(1), BalanceType.REFUND, null, false, null);
|
|
|
|
|
|
|
+ userBalanceService
|
|
|
|
|
+ .modifyBalance(o.getUserId(), new BigDecimal(1), BalanceType.REFUND, null, false, null);
|
|
|
});
|
|
});
|
|
|
}).get();
|
|
}).get();
|
|
|
}
|
|
}
|