| | |
| | | |
| | | @Test |
| | | void getDeviceDayCount() throws IOException { |
| | | DateTime oneWeekAgo = DateUtil.offsetDay(DateUtil.date(), -1); |
| | | String format = DateUtil.format(oneWeekAgo, "yyyy-MM-dd"); |
| | | try { |
| | | List<DevMachine> list = devMachineService.list(); |
| | | for (DevMachine s : list) { |
| | | numericalService.getDeviceDayCount(s.getDevNo(), format); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | // DateTime oneWeekAgo = DateUtil.offsetDay(DateUtil.date(), -1); |
| | | // String format = DateUtil.format(oneWeekAgo, "yyyy-MM-dd"); |
| | | // try { |
| | | // List<DevMachine> list = devMachineService.list(); |
| | | // for (DevMachine s : list) { |
| | | // numericalService.getDeviceDayCount(s.getDevNo(), format); |
| | | // } |
| | | // } catch (IOException e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // |
| | | //numericalService.getDeviceDayCount("862858070704174_1", "2025-04-22"); |
| | | } |
| | |
| | | |
| | | |
| | | // numericalService.getDeviceRealTimeDataBycl("866042075016340"); |
| | | List<DevMacBycl> list = devMacByclService.list(); |
| | | list.forEach(s -> { |
| | | try { |
| | | numericalService.getDeviceRealTimeDataBycl(s.getDevNo()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }); |
| | | // List<DevMachine> list = devMachineService.list(); |
| | | // list.forEach(s -> { |
| | | // try { |
| | | // numericalNoOrderService.getDeviceRealTimeData(s.getDevNo()); |
| | | // } catch (Exception e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // }); |
| | | } |
| | | |
| | | //deviceMetricsService.manualSynchronizationBycl(barcode) |
| | | @Test |
| | | public void get1() throws Exception { |
| | | NumbericalDto barcode = new NumbericalDto(); |
| | | barcode.setMachineNo("C05"); |
| | | barcode.setOrderId(7890268L); |
| | | deviceMetricsService.manualSynchronizationBycl(barcode); |
| | | } |
| | | |
| | | @Test |
| | | //@Test |
| | | public void SoDeviceList() { |
| | | try { |
| | | boolean b = numericalService.SoDeviceList(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 测试获取设备故障列表 |
| | | */ |
| | | @Test |
| | | public void testGetDeviceErrorList() throws Exception { |
| | | // 设置测试参数 |
| | | String uid = "864606067274372"; // 设备编号 |
| | | String startDate = "2024-01-01"; // 开始日期 |
| | | String endDate = "2024-12-31"; // 结束日期 |
| | | |
| | | try { |
| | | // 调用方法获取设备故障列表 |
| | | numericalNoOrderService.getDeviceErrorList(uid, startDate, endDate); |
| | | System.out.println("设备故障列表获取成功"); |
| | | } catch (Exception e) { |
| | | System.err.println("设备故障列表获取失败: " + e.getMessage()); |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 测试批量获取所有设备的故障列表 |
| | | */ |
| | | @Test |
| | | //@Test |
| | | public void testGetAllDeviceErrorList() throws Exception { |
| | | DateTime yesterday = DateUtil.yesterday(); |
| | | DateTime startDateTime = DateUtil.parse(DateUtil.format(yesterday, "yyyy-MM-dd") + " 07:30:00"); |