| | |
| | | import com.zy.acs.manager.common.domain.BaseParam; |
| | | import com.zy.acs.manager.common.domain.PageParam; |
| | | import com.zy.acs.manager.common.domain.PageResult; |
| | | import com.zy.acs.manager.core.cache.CoreCache; |
| | | import com.zy.acs.manager.core.domain.VehicleDto; |
| | | import com.zy.acs.manager.manager.controller.result.AgvResult; |
| | | import com.zy.acs.manager.manager.entity.Agv; |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public int getBackpackRemainingCapacity(Long agvId) { |
| | | int usedSlots = 0; |
| | | Integer backpackCache = CoreCache.AGV_BACKPACK_CACHE.get(agvId); |
| | | if (null != backpackCache) { |
| | | usedSlots = taskService.findTransportTasksCountByAgv(agvId); |
| | | } |
| | | |
| | | AgvModel agvModel = agvModelService.getByAgvId(agvId); |
| | | return Math.max(agvModel.getBackpack() - usedSlots, 0); // if less than zero, then return zero |
| | | } |
| | | |
| | | } |