|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.utils; | 
|---|
|  |  |  | import com.core.common.SnowflakeIdWorker; | 
|---|
|  |  |  | import com.core.common.SpringUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public class MultiLockerOptimizerUtils { | 
|---|
|  |  |  | 
|---|
|  |  |  | static class Locker { | 
|---|
|  |  |  | int id; | 
|---|
|  |  |  | double remainingSpace; | 
|---|
|  |  |  | long bindingTags; | 
|---|
|  |  |  | Map<String, Integer> contents; | 
|---|
|  |  |  | Set<String> itemTypes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Locker(int id) { | 
|---|
|  |  |  | this.id = id; | 
|---|
|  |  |  | this.remainingSpace = 1.0; | 
|---|
|  |  |  | this.contents = new HashMap<>(); | 
|---|
|  |  |  | this.itemTypes = new HashSet<>(); | 
|---|
|  |  |  | SnowflakeIdWorker snowflakeIdWorker = SpringUtils.getBean(SnowflakeIdWorker.class); | 
|---|
|  |  |  | //            this.bindingTags = System.currentTimeMillis(); | 
|---|
|  |  |  | this.bindingTags = snowflakeIdWorker.nextId(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 尝试放入物品 | 
|---|