|
|
@@ -49,6 +49,8 @@ public class OrderServiceTest extends ApplicationTests {
|
|
|
private CollectionService collectionService;
|
|
|
@Autowired
|
|
|
private BlindBoxItemRepo blindBoxItemRepo;
|
|
|
+ @Autowired
|
|
|
+ private SandPayService sandPayService;
|
|
|
|
|
|
@Test
|
|
|
public void create() {
|
|
|
@@ -186,21 +188,21 @@ public class OrderServiceTest extends ApplicationTests {
|
|
|
orderRepo.findByCollectionId(8012L).stream()
|
|
|
.filter(o -> o.getStatus() == OrderStatus.FINISH || o.getStatus() == OrderStatus.PROCESSING)
|
|
|
.parallel().forEach(order -> {
|
|
|
- List<Asset> assets = assetRepo.findByOrderId(order.getId());
|
|
|
- if (assets.size() > 1) {
|
|
|
- assets.sort(Comparator.comparing(BaseEntity::getCreatedAt));
|
|
|
- for (int i = 1; i < assets.size(); i++) {
|
|
|
- assetRepo.delete(assets.get(i));
|
|
|
- tokenHistoryRepo.deleteByTokenId(assets.get(i).getTokenId());
|
|
|
- if (assets.get(i).getPublicCollectionId() != null) {
|
|
|
- collectionRepo.findById(assets.get(i).getPublicCollectionId()).ifPresent(c -> {
|
|
|
- collectionRepo.delete(c);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- ids.add(order.getId());
|
|
|
+ List<Asset> assets = assetRepo.findByOrderId(order.getId());
|
|
|
+ if (assets.size() > 1) {
|
|
|
+ assets.sort(Comparator.comparing(BaseEntity::getCreatedAt));
|
|
|
+ for (int i = 1; i < assets.size(); i++) {
|
|
|
+ assetRepo.delete(assets.get(i));
|
|
|
+ tokenHistoryRepo.deleteByTokenId(assets.get(i).getTokenId());
|
|
|
+ if (assets.get(i).getPublicCollectionId() != null) {
|
|
|
+ collectionRepo.findById(assets.get(i).getPublicCollectionId()).ifPresent(c -> {
|
|
|
+ collectionRepo.delete(c);
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ ids.add(order.getId());
|
|
|
+ }
|
|
|
+ });
|
|
|
System.out.println(ids);
|
|
|
}
|
|
|
|
|
|
@@ -260,5 +262,9 @@ public class OrderServiceTest extends ApplicationTests {
|
|
|
Arrays.asList(OrderStatus.FINISH, OrderStatus.NOT_PAID, OrderStatus.PROCESSING)));
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void test3() {
|
|
|
+ sandPayService.payOrder(989544769111719936L);
|
|
|
+ }
|
|
|
|
|
|
}
|