#
Junjie
18 小时以前 a17781479bd4acb36069472ac1a987df21c0cc05
#
2个文件已修改
31 ■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/WrkAnalysisServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/wrkAnalysis/wrkAnalysis.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WrkAnalysisServiceImpl.java
@@ -593,13 +593,26 @@
    }
    private List<Map<String, Object>> buildFaultDuration(List<WrkAnalysis> list) {
        Map<String, Long> durationMap = new LinkedHashMap<>();
        for (WrkAnalysis item : list) {
            addDeviceFaultDuration(durationMap, "单堆垛机", item.getCrnNo(), item.getCrnFaultDurationMs());
            addDeviceFaultDuration(durationMap, "双工位堆垛机", item.getDualCrnNo(), item.getDualCrnFaultDurationMs());
            addDeviceFaultDuration(durationMap, "RGV", item.getRgvNo(), item.getRgvFaultDurationMs());
        }
        List<Map<String, Object>> result = new ArrayList<>();
        result.add(slice("单堆垛机", list.stream().map(WrkAnalysis::getCrnFaultDurationMs).filter(Objects::nonNull).reduce(0L, Long::sum)));
        result.add(slice("双工位堆垛机", list.stream().map(WrkAnalysis::getDualCrnFaultDurationMs).filter(Objects::nonNull).reduce(0L, Long::sum)));
        result.add(slice("RGV", list.stream().map(WrkAnalysis::getRgvFaultDurationMs).filter(Objects::nonNull).reduce(0L, Long::sum)));
        durationMap.forEach((name, durationMs) -> result.add(slice(name, durationMs)));
        return result;
    }
    private void addDeviceFaultDuration(Map<String, Long> durationMap, String deviceLabel, Integer deviceNo, Long durationMs) {
        long value = defaultLong(durationMs);
        if (value <= 0L) {
            return;
        }
        String key = deviceNo == null ? deviceLabel : deviceLabel + deviceNo;
        durationMap.merge(key, value, Long::sum);
    }
    private List<Map<String, Object>> buildDetailRows(List<WrkAnalysis> list) {
        return list.stream().map(this::toDetailItem).collect(Collectors.toList());
    }
src/main/webapp/static/js/wrkAnalysis/wrkAnalysis.js
@@ -562,7 +562,7 @@
                        }
                    },
                    legend: { data: ["站点耗时", "堆垛机耗时", "总耗时"] },
                    grid: { left: 50, right: 20, top: 40, bottom: 70 },
                    grid: { left: 88, right: 20, top: 40, bottom: 70, containLabel: true },
                    xAxis: {
                        type: "category",
                        data: rows.map(function (item) { return String(item.wrkNo); }),
@@ -604,7 +604,7 @@
                        }
                    },
                    legend: { data: ["平均总耗时", "平均站点耗时", "平均堆垛机耗时"] },
                    grid: { left: 50, right: 20, top: 40, bottom: 70 },
                    grid: { left: 88, right: 20, top: 40, bottom: 70, containLabel: true },
                    xAxis: {
                        type: "category",
                        data: rows.map(function (item) { return item.bucketLabel; }),
@@ -661,10 +661,14 @@
                            return lines.join("<br>");
                        }
                    },
                    grid: { left: 50, right: 20, top: 20, bottom: 40 },
                    grid: { left: 88, right: 20, top: 20, bottom: 68, containLabel: true },
                    xAxis: {
                        type: "category",
                        data: rows.map(function (item) { return item.name; })
                        data: rows.map(function (item) { return item.name; }),
                        axisLabel: {
                            interval: 0,
                            rotate: rows.length > 6 ? 30 : 0
                        }
                    },
                    yAxis: {
                        type: "value",