| | |
| | | } |
| | | } |
| | | AxisBean inqty = new AxisBean(); |
| | | inqty.setName("入库数量"); |
| | | inqty.setName("入库托盘数"); |
| | | Integer[] array1 = new Integer[data1.size()]; |
| | | inqty.setData(data1.toArray(array1)); |
| | | list.add(inqty); |
| | | AxisBean outqty = new AxisBean(); |
| | | outqty.setName("出库数量"); |
| | | outqty.setName("出库TU"); |
| | | Integer[] array2 = new Integer[data2.size()]; |
| | | outqty.setData(data2.toArray(array2)); |
| | | list.add(outqty); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 近24小时入出库折线(横轴小时),与按日 {@link #locIoLineCharts()} 数据口径不同,供电视机「作业效率」使用 |
| | | * 入出库按小时折线:横轴为「当前整点起向前共 12 小时」滚动窗口,与库表 ymd(yyyy-MM-dd HH)对齐 |
| | | */ |
| | | @GetMapping("/line/charts/hourly") |
| | | public R locIoLineChartsHourly() { |
| | |
| | | ArrayList<Integer> data2 = new ArrayList<>(); |
| | | List<String> categories = new ArrayList<>(); |
| | | |
| | | final int n = 12; |
| | | SimpleDateFormat sfKey = new SimpleDateFormat("yyyy-MM-dd HH"); |
| | | SimpleDateFormat sfLabel = new SimpleDateFormat("HH:00"); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | calendar.add(Calendar.HOUR_OF_DAY, -23); |
| | | calendar.add(Calendar.HOUR_OF_DAY, -(n - 1)); |
| | | |
| | | for (int i = 0; i < 24; i++) { |
| | | for (int i = 0; i < n; i++) { |
| | | String key = sfKey.format(calendar.getTime()); |
| | | categories.add(sfLabel.format(calendar.getTime())); |
| | | categories.add(String.valueOf(calendar.get(Calendar.HOUR_OF_DAY))); |
| | | |
| | | int inV = 0; |
| | | int outV = 0; |
| | |
| | | } |
| | | |
| | | AxisBean inqty = new AxisBean(); |
| | | inqty.setName("入库数量"); |
| | | inqty.setName("入库托盘数"); |
| | | Integer[] array1 = new Integer[data1.size()]; |
| | | inqty.setData(data1.toArray(array1)); |
| | | list.add(inqty); |
| | | |
| | | AxisBean outqty = new AxisBean(); |
| | | outqty.setName("出库数量"); |
| | | outqty.setName("出库TU"); |
| | | Integer[] array2 = new Integer[data2.size()]; |
| | | outqty.setData(data2.toArray(array2)); |
| | | list.add(outqty); |