| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | import com.zy.asrs.domain.param.ShuttleOperatorParam; |
| | | import com.zy.asrs.domain.vo.*; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasShuttleService; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.Utils; |
| | |
| | | public class ShuttleController { |
| | | |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private BasShuttleService basShuttleService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | |
| | | private ShuttleAction shuttleAction; |
| | | @Autowired |
| | | private NavigateMapUtils navigateMapUtils; |
| | | @Autowired |
| | | private DeviceConfigService deviceConfigService; |
| | | |
| | | @PostMapping("/table/shuttle/state") |
| | | @ManagerAuth(memo = "四向穿梭车信息表") |
| | | public R shuttleStateTable(){ |
| | | ArrayList<JSONObject> list = new ArrayList<>(); |
| | | for (ShuttleSlave slave : slaveProperties.getShuttle()) { |
| | | |
| | | List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Shuttle))); |
| | | for (DeviceConfig deviceConfig : shuttleList) { |
| | | // 表格行 |
| | | JSONObject baseObj = new JSONObject(); |
| | | baseObj.put("shuttleNo", slave.getId()); |
| | | baseObj.put("shuttleNo", deviceConfig.getDeviceNo()); |
| | | list.add(baseObj); |
| | | // 获取四向穿梭车信息 |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, deviceConfig.getDeviceNo()); |
| | | if (shuttleThread == null) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | Integer chargeLine = basShuttleService.selectById(slave.getId()).getChargeLine(); |
| | | Integer chargeLine = basShuttleService.selectById(deviceConfig.getDeviceNo()).getChargeLine(); |
| | | String lowerPower = "N"; |
| | | if (chargeLine != null && shuttleProtocol.getBatteryPower() != null) { |
| | | lowerPower = Integer.parseInt(shuttleProtocol.getBatteryPower()) <= chargeLine ? "Y" : "N"; |
| | |
| | | @ManagerAuth(memo = "四向穿梭车数据表") |
| | | public R steMsgTable(){ |
| | | List<ShuttleMsgTableVo> list = new ArrayList<>(); |
| | | for (ShuttleSlave slave : slaveProperties.getShuttle()) { |
| | | |
| | | List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Shuttle))); |
| | | for (DeviceConfig deviceConfig : shuttleList) { |
| | | // 表格行 |
| | | ShuttleMsgTableVo vo = new ShuttleMsgTableVo(); |
| | | vo.setShuttleNo(slave.getId()); // 四向穿梭车号 |
| | | vo.setShuttleNo(deviceConfig.getDeviceNo()); // 四向穿梭车号 |
| | | list.add(vo); |
| | | // 获取穿梭车信息 |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId()); |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, deviceConfig.getDeviceNo()); |
| | | if (shuttleThread == null) { |
| | | continue; |
| | | } |
| | |
| | | vo.setLocNo(shuttleProtocol.getLocNo());//四向穿梭车当前库位号 |
| | | vo.setLev(shuttleProtocol.getLocNo() == null ? 0 : Utils.getLev(shuttleProtocol.getLocNo()));//四向穿梭车当前层高 |
| | | |
| | | BasShuttle basShuttle = basShuttleService.selectById(slave.getId()); |
| | | BasShuttle basShuttle = basShuttleService.selectById(deviceConfig.getDeviceNo()); |
| | | if (basShuttle != null) { |
| | | vo.setChargeLine(basShuttle.getChargeLine());//充电阈值 |
| | | } |