jinlin
2024-10-09 f76e09f832e71b29c7b7771c1d0aaa5858f9a20f
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
@@ -182,6 +182,9 @@
        JSONObject jsonObject = new JSONObject(templetStr);
        JSONArray jsonArray = jsonObject.getJSONArray("cells");
        JSONObject jsonObject3 = new JSONObject(templetStr);
        JSONArray jsonArray3 = jsonObject3.getJSONArray("cells");
        this.getPetsInfo();
        double x1 = 0;
        double x2 = 0;
@@ -237,12 +240,13 @@
                jsonArray.add(lineJson);
            }
            lineArray.add(statusDtoList);
            JSONObject textJson = new JSONObject(templetsStrMap.get("text"));
            JsonUtils2.setJsonValueByPath(textJson, "id".split("/"), UUIDUtil.generateId().toString());
            JsonUtils2.setJsonValueByPath(textJson, "attrs/label/textWrap/text".split("/"), dto.getName());
            JsonUtils2.setJsonValueByPath(textJson, "position/x".split("/"), 20);
            JsonUtils2.setJsonValueByPath(textJson, "position/y".split("/"), y - 15);
            jsonArray.add(textJson);
            jsonArray3.add(textJson);
        }
        //阶段模型及刻度
@@ -385,12 +389,12 @@
        for (int i = 0; i < smallStatusDtoList.size(); i++) {
            for (TimeDiagramStatusDto status : smallStatusDtoList.get(i)) {
                JSONObject lineJson = new JSONObject(templetsStrMap2.get(status.getStatus()));
                setlineXy(lineJson, status.getX1(), y, status.getX2(), y, "");
                setlineXy(lineJson, status.getX1(), y, status.getX2()+5, y, "");
                JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus());
                JsonUtils2.setJsonValueByPath(lineJson, "id".split("/"), UUIDUtil.generateId().toString());
                jsonArray2.add(lineJson);
            }
            y = y + 20;
            y = y + 10;
        }
        //图例
@@ -402,11 +406,12 @@
            JSONObject f = templetsMap.get(s);
            x1 = x1 + spaceWitdth;
            x2 = x2 + spaceWitdth;
            setlineXy(f, x1, y, x2, y, null);
            setlineXy(f, x1, y+10, x2, y+10, null);
            jsonArray2.add(f);
        }
        timeDiagramDto.setDiagramJson(jsonObject.toString());
        timeDiagramDto.setSmallDiagramJson(jsonObject2.toString());
        timeDiagramDto.setTextDiagramJson(jsonObject3.toString());
        return timeDiagramDto;
    }