| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 获取堆垛机数据 |
| | | ArrayList<CrnProtocol> crnProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> crnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig device : crnList) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, device.getDeviceNo()); |
| | |
| | | |
| | | // 获取RGV数据 |
| | | ArrayList<RgvProtocol> rgvProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> rgvList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig device : rgvList) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, device.getDeviceNo()); |
| | |
| | | |
| | | // 获取双工位堆垛机数据 |
| | | ArrayList<DualCrnProtocol> dualCrnProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.DualCrn))); |
| | | for (DeviceConfig device : dualCrnList) { |
| | | DualCrnThread dualCrnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, device.getDeviceNo()); |
| | |
| | | |
| | | // 获取输送站点数据 |
| | | ArrayList<StationProtocol> stationProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> stationList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> stationList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig device : stationList) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, device.getDeviceNo()); |
| | |
| | | public R getStationStatus(@RequestBody GetStationStatusParam param) { |
| | | // 获取输送站点数据 |
| | | List<StationProtocol> stationProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp)) |
| | | ); |
| | | for (DeviceConfig device : devpList) { |
| | |
| | | @OpenApiLog(memo = "获取全部库位信息") |
| | | public R getAllLocInformation(@RequestBody GetAllLocInformationParam param) { |
| | | List<HashMap<String, Object>> list = new ArrayList<>(); |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LocMast> wrapper = new QueryWrapper<>(); |
| | | |
| | | if (!Cools.isEmpty(param.getRow())) { |
| | | wrapper.eq("row1", param.getRow()); |
| | |
| | | wrapper.eq("lev1", param.getLev()); |
| | | } |
| | | |
| | | List<LocMast> locMasts = locMastService.selectList(wrapper); |
| | | List<LocMast> locMasts = locMastService.list(wrapper); |
| | | if (locMasts.isEmpty()) { |
| | | return R.ok().add(list); |
| | | } |
| | |
| | | @PostMapping("/queryTask") |
| | | @OpenApiLog(memo = "查询任务") |
| | | public R queryTask(@RequestBody QueryTaskParam param) { |
| | | EntityWrapper<WrkMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkMast> wrapper = new QueryWrapper<>(); |
| | | if (param.getTaskNo() != null) { |
| | | wrapper.eq("wms_wrk_no", param.getTaskNo()); |
| | | } |
| | |
| | | } |
| | | wrapper.eq("io_type", ioType.id); |
| | | } |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(wrapper); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(wrapper); |
| | | return R.ok().add(wrkMasts); |
| | | } |
| | | |
| | |
| | | if (mainProcessPlugin.contains("Fake")) { |
| | | map.put("running", false); |
| | | map.put("isFake", true); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (config != null) { |
| | | if (config.getValue().equals("Y")) { |
| | | map.put("running", true); |
| | |
| | | @PostMapping("/startFakeSystem") |
| | | @OpenApiLog(memo = "启动仿真模拟") |
| | | public R startFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (config != null) { |
| | | config.setValue("Y"); |
| | | configService.updateById(config); |
| | |
| | | @PostMapping("/stopFakeSystem") |
| | | @OpenApiLog(memo = "停止仿真模拟") |
| | | public R stopFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (config != null) { |
| | | config.setValue("N"); |
| | | configService.updateById(config); |