|  |  | 
 |  |  | import com.alibaba.fastjson.JSONObject; | 
 |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
 |  |  | import com.core.common.SpringUtils; | 
 |  |  | import com.zy.asrs.entity.DeviceConfig; | 
 |  |  | import com.zy.asrs.service.DeviceConfigService; | 
 |  |  | import com.zy.asrs.utils.Utils; | 
 |  |  | import com.zy.common.model.NavigateNode; | 
 |  |  | import com.zy.core.cache.SlaveConnection; | 
 |  |  | import com.zy.core.enums.SlaveType; | 
 |  |  | import com.zy.core.model.ForkLiftSlave; | 
 |  |  | import com.zy.core.model.protocol.ForkLiftStaProtocol; | 
 |  |  | import com.zy.core.properties.SlaveProperties; | 
 |  |  | import com.zy.core.thread.ForkLiftThread; | 
 |  |  | import com.zy.system.entity.Config; | 
 |  |  | import com.zy.system.service.ConfigService; | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     //获取提升机所绑定的输送线所有站点 | 
 |  |  |     public static List<Integer> getConveyorBindLiftAllStaNo(Integer liftNo) { | 
 |  |  |         List<Integer> list = new ArrayList<>(); | 
 |  |  |         ConfigService configService = SpringUtils.getBean(ConfigService.class); | 
 |  |  |         if (configService == null) { | 
 |  |  |             return list; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         Config conveyorLiftBindConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "conveyorLiftBind")); | 
 |  |  |         if(conveyorLiftBindConfig == null) { | 
 |  |  |             return list; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         List<JSONObject> val = JSON.parseArray(conveyorLiftBindConfig.getValue(), JSONObject.class); | 
 |  |  |         if (val.isEmpty()) { | 
 |  |  |             return list; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         for (JSONObject data : val) { | 
 |  |  |             if(data.getInteger("liftNo").equals(liftNo)) { | 
 |  |  |                 list.add(data.getInteger("staNo")); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     //获取提升机站点 | 
 |  |  |     public static ForkLiftStaProtocol getLiftStaByStaNo(Integer staNo) { | 
 |  |  |         SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); | 
 |  |  |         for (ForkLiftSlave liftSlave : slaveProperties.getForkLift()) { | 
 |  |  |             ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, liftSlave.getId()); | 
 |  |  |         DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class); | 
 |  |  |         List<DeviceConfig> forkliftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() | 
 |  |  |                 .eq("device_type", String.valueOf(SlaveType.ForkLift))); | 
 |  |  |         for (DeviceConfig device : forkliftList) { | 
 |  |  |             ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); | 
 |  |  |             if (forkLiftThread == null) { | 
 |  |  |                 return null; | 
 |  |  |             } |