|
@@ -358,11 +358,8 @@ public class OrderService {
|
|
|
public void setNumber() {
|
|
public void setNumber() {
|
|
|
for (Collection collection : collectionRepo.findAll()) {
|
|
for (Collection collection : collectionRepo.findAll()) {
|
|
|
if (collection.getSource() != CollectionSource.OFFICIAL) continue;
|
|
if (collection.getSource() != CollectionSource.OFFICIAL) continue;
|
|
|
- String key = "collectionNumber::" + collection.getId();
|
|
|
|
|
- redisTemplate.opsForValue().set(key, 0);
|
|
|
|
|
for (Asset asset : assetRepo.findByCollectionId(collection.getId())) {
|
|
for (Asset asset : assetRepo.findByCollectionId(collection.getId())) {
|
|
|
- redisTemplate.opsForValue().increment(key);
|
|
|
|
|
- asset.setNumber((Integer) redisTemplate.opsForValue().get(key));
|
|
|
|
|
|
|
+ asset.setNumber(collectionService.getNextNumber(collection.getId()));
|
|
|
assetRepo.save(asset);
|
|
assetRepo.save(asset);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|