| | |
| | | |
| | | @Value("${mainProcessPlugin}") |
| | | private String mainProcessPlugin; |
| | | @Value("${app.version:1.0.0}") |
| | | private String appVersion; |
| | | @Value("${app.version-type:stable}") |
| | | private String appVersionType; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private DeviceConfigService deviceConfigService; |
| | | |
| | | //移库任务 |
| | | // 移库任务 |
| | | @PostMapping("/createLocMoveTask") |
| | | @OpenApiLog(memo = "移库任务") |
| | | public R createLocMoveTask(@RequestBody CreateLocMoveTaskParam param) { |
| | |
| | | return R.error("生成移库任务失败"); |
| | | } |
| | | |
| | | //入库任务 |
| | | // 入库任务 |
| | | @PostMapping("/createInTask") |
| | | @OpenApiLog(memo = "入库任务") |
| | | public R createInTask(@RequestBody CreateInTaskParam param) { |
| | |
| | | return R.error("生成入库任务失败"); |
| | | } |
| | | |
| | | //出库任务 |
| | | // 出库任务 |
| | | @PostMapping("/createOutTask") |
| | | @OpenApiLog(memo = "出库任务") |
| | | public R createOutTask(@RequestBody CreateOutTaskParam param) { |
| | |
| | | return R.error("生成出库任务失败"); |
| | | } |
| | | |
| | | //批量出库任务 |
| | | // 批量出库任务 |
| | | @PostMapping("/createOutTaskBatch") |
| | | @OpenApiLog(memo = "批量出库任务") |
| | | @Transactional |
| | |
| | | } |
| | | |
| | | @RequestMapping("/deviceStatus") |
| | | // @OpenApiLog(memo = "获取设备状态") |
| | | // @OpenApiLog(memo = "获取设备状态") |
| | | public R getDeviceStatus() { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | //获取堆垛机数据 |
| | | // 获取堆垛机数据 |
| | | ArrayList<CrnProtocol> crnProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | |
| | | crnProtocols.add(crnProtocol); |
| | | } |
| | | |
| | | //获取RGV数据 |
| | | // 获取RGV数据 |
| | | ArrayList<RgvProtocol> rgvProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | |
| | | @OpenApiLog(memo = "查询任务") |
| | | public R queryTask(@RequestBody QueryTaskParam param) { |
| | | EntityWrapper<WrkMast> wrapper = new EntityWrapper<>(); |
| | | if(param.getTaskNo() != null) { |
| | | if (param.getTaskNo() != null) { |
| | | wrapper.eq("wms_wrk_no", param.getTaskNo()); |
| | | } |
| | | |
| | | if(param.getTaskType() != null) { |
| | | if (param.getTaskType() != null) { |
| | | WrkIoType ioType = WrkIoType.get(param.getTaskType()); |
| | | if(ioType == null) { |
| | | if (ioType == null) { |
| | | return R.error("任务类型不存在"); |
| | | } |
| | | wrapper.eq("io_type", ioType.id); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getSystemVersion") |
| | | public R getSystemVersion() { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("version", appVersion); |
| | | map.put("versionType", appVersionType); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | @GetMapping("/getFakeSystemRunStatus") |
| | | public R getFakeSystemRunStatus() { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if(mainProcessPlugin.contains("Fake")) { |
| | | if (mainProcessPlugin.contains("Fake")) { |
| | | map.put("running", false); |
| | | map.put("isFake", true); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | if(config != null) { |
| | | if(config.getValue().equals("Y")) { |
| | | if (config != null) { |
| | | if (config.getValue().equals("Y")) { |
| | | map.put("running", true); |
| | | } |
| | | } |
| | |
| | | @OpenApiLog(memo = "启动仿真模拟") |
| | | public R startFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | if(config != null) { |
| | | if (config != null) { |
| | | config.setValue("Y"); |
| | | configService.updateById(config); |
| | | } |
| | |
| | | @OpenApiLog(memo = "停止仿真模拟") |
| | | public R stopFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | if(config != null) { |
| | | if (config != null) { |
| | | config.setValue("N"); |
| | | configService.updateById(config); |
| | | } |