<|start_filename|>vue-piflow-web/public/drawingBoard/my_js/process/initProcessGraph.js<|end_filename|>
// Extends EditorUi to update I/O action states based on availability of backend
var graphGlobal = null;
var thisEditor = null;
// var fullScreen = $('#fullScreen');
var drawingBoardType = "PROCESS"
var index = true
var nodeArr, xmlDate, parentsId, processType, processGroupId, parentProcessId, pID, appId, processState,
    getCheckpointParam, progress;


function initProcessCrumbs(parentAccessPath) {
    if (parentAccessPath) {
        switch (parentAccessPath) {
            case "flow":
                $("#web_processList_navigation").hide();
                $("#web_flowList_navigation").show();
                $("#grapheditor_home_navigation").show();
                break;
            case "flowProcess":
                $("#web_processList_navigation").hide();
                $("#web_groupTypeProcessList_navigation").show();
                break;
            case "processGroupList":
                $("#web_processList_navigation").hide();
                $("#web_processGroupList_navigation").show();
                $("#web_getProcessGroupById_navigation").show();
                break;
        }
    }
}

function initProcessDrawingBoardData(loadId, parentAccessPath, backFunc) {
    // $('#fullScreen').show();
    window.parent.postMessage(true);
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/drawingBoardData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            loadId: loadId,
            parentAccessPath: parentAccessPath
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            // window.location.href = (web_baseUrl + "/error/404");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                processId = dataMap.processId;
                processType = dataMap.processType;
                nodeArr = dataMap.nodeArr;
                xmlDate = dataMap.xmlDate;
                processGroupId = dataMap.processGroupId;
                parentsId = dataMap.processGroupId;
                appId = dataMap.appId;
                parentProcessId = dataMap.parentProcessId;
                pID = dataMap.pID;
                processState = dataMap.processState;
                progress = dataMap.percentage;
                getCheckpointParam = "'" + (dataMap.pID ? dataMap.pID : "") + "','" + (dataMap.parentProcessId ? dataMap.parentProcessId : "") + "', '" + (dataMap.processId ? dataMap.processId : "") + "'";
                top.document.getElementById('BreadcrumbProcess').style.display = 'block';
                top.document.getElementById('BreadcrumbProcessGroup').style.display = 'none';
                top.document.getElementById('BreadcrumbFlow').style.display = 'none';
                top.document.getElementById('BreadcrumbGroup').style.display = 'none';
                top.document.getElementById('BreadcrumbSchedule').style.display = 'none';
                var link = top.document.getElementById('ProcessParents');
                if (processGroupId !== 'null' && processGroupId !== undefined){
                    link.style.display = 'inline-block';
                    link.href='#/drawingBoard?src=/drawingBoard/page/processGroup/mxGraph/index.html?drawingBoardType=PROCESS&parentAccessPath=processGroupList&processType=PROCESS_GROUP&load='+processGroupId;
                }else {
                    link.style.display = 'none';
                }
            } else {
                //window.location.href = (web_baseUrl + "/error/404");
            }
            if (backFunc && $.isFunction(backFunc)) {
                backFunc(data);
            }
            // $('#fullScreen').hide();
            window.parent.postMessage(false);
        }
    });
}

function initProcessGraph() {
    Format.noEditing(true);
    $("#right-group-wrap")[0].style.display = "block";
    $("#precess-run")[0].style.display = "block";
    EditorUi.prototype.menubarHeight = 48;
    EditorUi.prototype.menubarShow = false;
    EditorUi.prototype.customToobar = true;

    var editorUiInit = EditorUi.prototype.init;
    EditorUi.prototype.init = function () {
        editorUiInit.apply(this, arguments);
        graphGlobal = this.editor.graph;
        thisEditor = this.editor;
        initMonitorIcon();
        this.actions.get('export').setEnabled(false);
        //Monitoring event
        graphGlobal.addListener(mxEvent.CLICK, function (sender, evt) {
            processMxEventClick(evt.properties.cell);
        });
        graphGlobal.addListener(mxEvent.SIZE, function (sender, evt) {
            changIconTranslate();
        });
        loadXml(xmlDate);
        graphGlobal.setCellsEditable(false);
        //graphGlobal.setCellsSelectable(false);
        graphGlobal.setConnectable(false);
        graphGlobal.setCellsMovable(false);
    };

    // Adds required resources (disables loading of fallback properties, this can only
    // be used if we know that all keys are defined in the language specific file)
    mxResources.loadDefaultBundle = false;
    var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
        mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);

    // Fixes possible asynchronous requests
    mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
        // Adds bundle text to resources
        mxResources.parse(xhr[0].getText());

        // Configures the default graph theme
        var themes = new Object();
        themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();

        // Main
        new EditorUi(new Editor(urlParams['chrome'] == '0', themes));
    }, function () {
        document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
    });
    ClickSlider();
}

//load xml file
function loadXml(loadStr, cells) {
    if (!loadStr) {
        return;
    }
    loadStr = replaceImageHead(loadStr, 'img');
    loadStr = replaceImageHead(loadStr, 'images');
    var xml = mxUtils.parseXml(loadStr);
    var node = xml.documentElement;
    var dec = new mxCodec(node.ownerDocument);
    dec.decode(node, graphGlobal.getModel());
    eraseRecord()
    if (cells) {
        var new_load_cells = graphGlobal.getModel().getCell(cells[0].id);
        graphGlobal.setSelectionCell(new_load_cells);
        flowMxEventClickFunc(new_load_cells, true);
    }
}

function replaceImageHead(str, end) {
    let loadDate = str;
    let regHead = '';
    switch (end) {
        case "img": {
            regHead = new RegExp(/style="image;html=1;labelBackgroundColor=#ffffff00;image=(\S*)\/img\//, "g");
            break;
        }
        case "images": {
            regHead = new RegExp(/style="image;html=1;labelBackgroundColor=#ffffff00;image=(\S*)\/images\//, "g");
            break;
        }
    }
    if (!regHead) {
        return "";
    }
    let reg_1 = loadDate.match(regHead);
    if (reg_1 && reg_1.length > 0) {
        let replaceArray = {};
        for (var i = 0; i < reg_1.length; i++) {
            let item = reg_1[i];
            let i_r = item.replace("style=\"image;html=1;labelBackgroundColor=#ffffff00;image=", "");
            if (replaceArray[i_r]) {
                continue;
            }
            replaceArray[i_r] = true;
        }
        for (var key in replaceArray) {
            if (key.indexOf("http") < 0) {
                key = "style=\"image;html=1;labelBackgroundColor=#ffffff00;image=" + key;
                let reg = new RegExp(key, "g")
                loadDate = loadDate.replace(reg, "style=\"image;html=1;labelBackgroundColor=#ffffff00;image=" + web_header_prefix + "/" + end + "/");
            } else {
                let reg = new RegExp(key, "g")
                loadDate = loadDate.replace(reg, web_header_prefix + "/" + end + "/");
            }
        }
    }
    return loadDate;
}

function processMxEventClick(cell) {
    $("#div_process_info_inc_load_id").hide();
    $("#div_process_path_inc_load_id").hide();
    $("#div_process_property_inc_load_id").hide();
    if (index) {
        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        $(".triggerSlider i").removeClass("fa fa-angle-left fa-2x ").toggleClass("fa fa-angle-right fa-2x");
        index = false
    }
    if (cell == undefined || cell && cell.style && (cell.style).indexOf("text\;") === 0) {
        //info
        queryProcessInfo(loadId);
    } else if (cell && cell.style && (cell.style).indexOf("image\;") === 0) {
        //stops
        queryProcessStopsProperty(loadId, cell.id);
    } else {
        //path
        queryProcessPathInfo(loadId, cell.id);
    }

}

function queryProcessInfo(processId) {
    $("#div_process_info_inc_load_id").show();
    $("#div_process_info_inc_id").show();
    $("#div_process_path_inc_id").hide();
    $("#div_process_property_inc_id").hide();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/queryProcessData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#process_info_inc_loading').hide();
            $('#process_info_inc_load_fail').show();
            alert("Request Failed");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            $('#process_info_inc_loading').hide();
            if (200 === dataMap.code) {
                // if (dataMap.processGroupId){
                //     processGroupId = dataMap.processGroupId;
                // }else {
                //     processGroupId = 'null';
                // }

                var processVo = dataMap.processVo;
                if (!processVo) {
                    $('#process_info_inc_no_data').show();
                } else {
                    //Process Basic Information
                    $("#span_processVo_id").text(processVo.id);
                    $("#span_processVo_name").text(processVo.name);
                    $("#span_processVo_description").text(processVo.description);
                    $("#span_processVo_crtDttmStr").text(processVo.crtDttmStr);
                    //Process Running Information
                    $("#processStartTimeShow").text(processVo.startTimeStr);
                    $("#processStopTimeShow").text(processVo.endTimeStr);
                    var processVo_state_text = (null !== processVo.state) ? processVo.state.stringValue : "INIT";
                    $("#processStateShow").text(processVo_state_text);
                    if (processVo.progress) {
                        $("#processProgressShow").text(processVo.progress + "%");
                    } else {
                        $("#processProgressShow").text("0.00%");
                    }


                    $('#process_info_inc_load_data').show();
                }
            } else {
                $('#process_info_inc_load_fail').show();
                //alert("Load Failed" + dataMap.errorMsg);
            }
            // $('#fullScreen').hide();
            window.parent.postMessage(false);
        }
    });
}

function queryProcessPathInfo(processId, pageId) {
    $("#div_process_path_inc_load_id").show();
    $("#div_process_info_inc_id").hide();
    $("#div_process_path_inc_id").show();
    $("#div_process_property_inc_id").hide();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/queryProcessPathData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processId,
            pageId: pageId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#process_path_inc_loading').hide();
            $('#process_path_inc_load_fail').show();
            alert("Request Failed");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            $('#process_path_inc_loading').hide();
            if (200 === dataMap.code) {
                var processPathVo = dataMap.processPathVo;
                if (!processPathVo) {
                    $('#process_path_inc_no_data').show();
                } else {
                    // Process Path Information
                    $("#span_processPathVo_from").text(processPathVo.from);
                    $("#span_processPathVo_outport").text(processPathVo.outport);
                    $("#span_processPathVo_inport").text(processPathVo.inport);
                    $("#span_processPathVo_to").text(processPathVo.to);

                    if (dataMap.runModeType && dataMap.runModeType.text === 'DEBUG') {
                        $("#div_view_flow_data").html('<input type="button" class="btn btn-primary" onclick="getDebugData(\'' + processPathVo.from + '\',\'' + processPathVo.outport + '\')" value="View Flow Data">');
                        $("#div_view_flow_data").show();
                    }

                    $('#process_path_inc_load_data').show();
                }
            } else {
                $('#process_path_inc_load_fail').show();
                //alert("Load Failed" + dataMap.errorMsg);
            }
            // $('#fullScreen').hide();
            window.parent.postMessage(false);
        }
    });
}

function queryProcessStopsProperty(processId, pageId) {
    $("#div_process_property_inc_load_id").show();
    $("#div_process_info_inc_id").hide();
    $("#div_process_path_inc_id").hide();
    $("#div_process_property_inc_id").show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/queryProcessStopData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processId,
            pageId: pageId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#process_property_inc_loading').hide();
            $('#process_property_inc_load_fail').show();
            alert("Request Failed");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            $('#process_property_inc_loading').hide();
            $("#div_processStopVo_processStopPropertyVo").html("");
            if (200 === dataMap.code) {
                var processStopVo = dataMap.processStopVo;
                if (!processStopVo) {
                    $('#process_property_inc_no_data').show();
                } else {

                    // Stop Basic Information
                    $("#stopNameShow").text(processStopVo.name);
                    $("#span_processStopVo_description").text(processStopVo.description);
                    $("#span_processStopVo_groups").text(processStopVo.groups);
                    $("#stopsBundleShow").text(processStopVo.bundel);
                    $("#span_processStopVo_owner").text(processStopVo.owner);
                    if ( processStopVo.visualizationType === '' ){
                        $("#process_info_inc_load_chart").css('display','none');
                    }else {
                        $("#process_info_inc_load_chart").css('display','block');
                        $("#process_info_inc_load_getChartBtn").attr('data', processStopVo.visualizationType);
                        $("#process_info_inc_load_getChartBtn").attr('name', processStopVo.name);
                    }


                    //Stop Property Information
                    var processStopPropertyVoList = processStopVo.processStopPropertyVoList;
                    if (processStopPropertyVoList) {
                        var processStopPropertyVoListHtml = '<span>';
                        processStopPropertyVoList.forEach(item => {
                            if (item) {
                                var processStopPropertyVo = '<span>' + item.displayName + ':</span><span class="open_action">' + item.customValue + '</span><br>';
                                processStopPropertyVoListHtml += processStopPropertyVo;
                            }
                        });
                        processStopPropertyVoListHtml += '</span>';
                        $("#div_processStopVo_processStopPropertyVo").append(processStopPropertyVoListHtml);
                        $("#div_processStopVo_processStopPropertyVoList").show();
                    }
                    //Stop Running Information
                    $("#stopStartTimeShow").text(processStopVo.startTimeStr);
                    $("#stopStopTimeShow").text(processStopVo.endTimeStr);
                    var processStopVo_state_text = (null !== processStopVo.state) ? processStopVo.state : "INIT";
                    $("#stopStateShow").text(processStopVo_state_text);

                    $('#process_property_inc_load_data').show();
                }
            } else {
                $('#process_property_inc_load_fail').show();
                //alert("Load Failed" + dataMap.errorMsg);
            }
            // $('#fullScreen').hide();
            window.parent.postMessage(false);
        }
    });
}

//Erase drawing board records
function eraseRecord() {
    thisEditor.lastSnapshot = new Date().getTime();
    thisEditor.undoManager.clear();
    thisEditor.ignoredChanges = 0;
    thisEditor.setModified(false);
}

function initMonitorIcon() {

    setTimeout(() => {
        console.log("svg_element")
        var svg_element = document.getElementsByClassName('geDiagramBackdrop geDiagramContainer')[0].getElementsByTagName("svg")[0];
        nodeArr.forEach(item => {
            var img_element_init = document.createElementNS("http://www.w3.org/2000/svg", "image");
            img_element_init.setAttribute("x", 0);
            img_element_init.setAttribute("y", 0);
            img_element_init.setAttribute("width", 20);
            img_element_init.setAttribute("height", 20);
            img_element_init.setAttribute("PiFlow_IMG", "IMG");
            img_element_init.href.baseVal = web_drawingBoard + "/img/Loading.gif";
            img_element_init.setAttribute("id", "stopLoadingShow" + item.pageId);

            var img_element_ok = document.createElementNS("http://www.w3.org/2000/svg", "image");
            img_element_ok.setAttribute("x", 0);
            img_element_ok.setAttribute("y", 0);
            img_element_ok.setAttribute("width", 20);
            img_element_ok.setAttribute("height", 20);
            img_element_ok.setAttribute("PiFlow_IMG", "IMG");
            img_element_ok.href.baseVal = web_drawingBoard + "/img/Ok.png";
            img_element_ok.setAttribute("id", "stopOkShow" + item.pageId);

            var img_element_fail = document.createElementNS("http://www.w3.org/2000/svg", "image");
            img_element_fail.setAttribute("x", 0);
            img_element_fail.setAttribute("y", 0);
            img_element_fail.setAttribute("width", 20);
            img_element_fail.setAttribute("height", 20);
            img_element_fail.setAttribute("PiFlow_IMG", "IMG");
            img_element_fail.href.baseVal = web_drawingBoard + "/img/Fail.png";
            img_element_fail.setAttribute("id", "stopFailShow" + item.pageId);
            img_element_init.style.display = "none";
            img_element_fail.style.display = "none";
            img_element_ok.style.display = "none";
            if (item.state) {
                if (item.state !== "INIT") {
                    //stopImgChange.attr('opacity', 1);
                    if (item.state && (item.state === "STARTED")) {
                        img_element_init.style.display = "block";
                        img_element_fail.style.display = "none";
                        img_element_ok.style.display = "none";
                    } else if (item.state && item.state === "COMPLETED") {
                        img_element_init.style.display = "none";
                        img_element_fail.style.display = "none";
                        img_element_ok.style.display = "block";
                    } else if (item.state && item.state === "FAILED") {
                        img_element_init.style.display = "none";
                        img_element_fail.style.display = "block";
                        img_element_ok.style.display = "none";
                    } else if (item.state && item.state === "KILLED") {
                        img_element_init.style.display = "none";
                        img_element_fail.style.display = "block";
                        img_element_ok.style.display = "none";
                    }
                }
            }

            if (svg_element && img_element_init && img_element_ok && img_element_fail) {
                var g_element = document.createElementNS("http://www.w3.org/2000/svg", "g");
                g_element.appendChild(img_element_init);
                g_element.appendChild(img_element_ok);
                g_element.appendChild(img_element_fail);
                svg_element.append(g_element);
            }
        });
        changIconTranslate();
    }, 300)
}

function changIconTranslate() {
    var iconPositionElementArr = document.querySelectorAll("div[style='display: inline-block; font-size: 1px; font-family: PiFlow; color: #FFFFFF; line-height: 1.2; pointer-events: all; white-space: nowrap; ']");
    if (iconPositionElementArr && iconPositionElementArr.length > 0) {
        var iconPositionArr = {};
        iconPositionElementArr.forEach(item => {
            var x_y_div = item.parentElement.parentElement.style;
            var x_Position = x_y_div['margin-left'].replace("px", "");
            var y_Position = x_y_div['padding-top'].replace("px", "");
            iconPositionArr['stopLoadingShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopFailShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopOkShow' + item.textContent] = {x: x_Position, y: y_Position};
        });
        var imgsArr = document.querySelectorAll("image[PiFlow_IMG='IMG']");
        imgsArr.forEach(item => {
            var iconPosition = iconPositionArr[item.id]
            if (iconPosition) {
                item.setAttribute("transform", "translate(" + iconPosition.x + "," + iconPosition.y + ")");
            }
        });
    }
}

window.onresize = function (e) {
    setTimeout(() => {
        changIconTranslate()
    }, 300);
}

function ClickSlider() {
    $(".triggerSlider").click(function () {
        var flag = ($(".triggerSlider i:first").hasClass("fa fa-angle-right fa-2x"));
        if (flag === false)
            $(".triggerSlider i").removeClass("fa fa-angle-left fa-2x ").toggleClass("fa fa-angle-right fa-2x");
        else
            $(".triggerSlider i").removeClass("fa fa-angle-right fa-2x").toggleClass("fa fa-angle-left fa-2x");

        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        $(this).toggleClass("triggerSlider-open");
        index = !index
    });
}

function getChart(e,softData,isSoft, ifTheFirst) {
    $("#process_info_inc_load_getChartBtn").attr('disabled',true);
    var window_width = $(window).width();//Get browser window width
    var window_height = $(window).height();//Get browser window width
    var open_window_width = (window_width > 300 ? window_width - 200 : window_width);
    var open_window_height = (window_height > 300 ? window_height - 150 : window_height);
    var logContent = '<div id="divPreId" style="height: 100%;width: 100%;">'
        + '<div id="preId" style="height: 100%;width: 100%; background-color: #f5f5f5;text-align: center;">'
        + '<div id="chartLine" style="width: 100%;height:90%;margin:0 auto; display: none"></div>'
        + '<div id="chartScatter" style="width: 100%;height:90%;margin:0 auto; display: none"></div>'
        + '<div id="chartBar" style="width: 100%;height:90%;margin:0 auto; display: none"></div>'
        + '<div id="chartPie" style="width: 100%;height:90%;margin:0 auto; display: none"></div>'
        // + '<div id="chartTable" style="width: 100%;height:90%;margin:0 auto; display: none;padding: 20px 20px 0 20px;">' +
        // '<table class="table table-striped table-bordered" id="statisticsTableMode" cellspacing="0" style="width: 100%"></table></div>'
        + '</div>'
        + '</div>';
    var parameter= {},type='', name='', ifFirst = true;
    if (softData){
        parameter = softData;
        type = softData.visualizationType;
        name = softData.stopName;
        ifFirst = ifTheFirst;
        if (parameter.isSoft){
            parameter.isSoft = false;
        }else
            parameter.isSoft = true;
    }else {
        type = e.getAttribute('data');
        name = e.getAttribute('name');
        parameter = {
            appId: appId,
            stopName: name,
            visualizationType: type,
            isSoft: true,
        }
    }
    // 可视化图表数据

    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request type post
        url: "/process/getVisualizationData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: parameter,
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $("#process_info_inc_load_getChartBtn").attr('disabled',false);
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            $("#process_info_inc_load_getChartBtn").attr('disabled',false);
            var dataMap = JSON.parse(data), visualizationData = {};
            visualizationData = JSON.parse(dataMap.visualizationData);
            if (type === 'TABLE'){
                // 判断页面是否加载完毕
                if(document.readyState === 'complete') {
                    window.parent['visualizationTable']({value: visualizationData.data});
                }
            }else {
                if (ifFirst){
                    layer.open({
                        type: 1,
                        title: '<span style="color: #269252;">View Charts</span>',
                        shadeClose: true,
                        closeBtn: 1,
                        shift: 7,
                        area: [open_window_width + 'px', open_window_height + 'px'], //Width height
                        skin: 'layui-layer-rim', //Add borders
                        // btn: ['stdout', 'stderr'], //button
                        btn1: function (index, layero) {
                            changeUrl(1);
                            return false;
                        },
                        btn2: function (index, layero) {
                            changeUrl(2);
                            return false;
                        },
                        content: logContent,
                        success: function (layero) {
                            layero.find('.layui-layer-btn').css('text-align', 'left');
                            var bleBtn0 = layero.find('.layui-layer-btn0');
                            var bleBtn1 = layero.find('.layui-layer-btn1');
                            bleBtn0.removeClass('layui-layer-btn0');
                            bleBtn1.removeClass('layui-layer-btn1');
                            bleBtn0.addClass('layui-layer-btn1');
                            bleBtn1.addClass('layui-layer-btn1');
                            switch (type){
                                case 'PIECHART':
                                    // 饼状图
                                    $('#chartPie').css('display','block');
                                    var newArr = [];
                                    for(var i=0;i<visualizationData.legend.length;i++){
                                        newArr.push(Number(visualizationData.legend[i]))
                                    }
                                    var chartPie = echarts.init(document.getElementById('chartPie'));
                                    var PieOption = {
                                        color: ['#726a95', '#709fb0', '#a0c1b8', '#f4ebc1', '#e4e4e4', '#ad6989', '#f9d89c', '#7fdbda', '#ba7967', '#e2979c', '#abc2e8'],
                                        // title: {
                                        //     text: '',
                                        //     subtext: '',
                                        //     left: 'center'
                                        // },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b} : {c} ({d}%)'
                                        },
                                        legend: {
                                            // orient: 'vertical',
                                            top: 10,
                                            left: 'center',
                                            data: newArr
                                        },
                                        toolbox: {
                                            right: '50',
                                            feature: {
                                                saveAsImage: {}
                                            }
                                        },
                                        series: [
                                            {
                                                name: '访问来源',
                                                type: 'pie',
                                                radius: '55%',
                                                center: ['50%', '60%'],
                                                selectedMode: 'single',
                                                data: visualizationData.series,
                                                emphasis: {
                                                    itemStyle: {
                                                        shadowBlur: 10,
                                                        shadowOffsetX: 0,
                                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                                    }
                                                }
                                            }
                                        ]
                                    };
                                    chartPie.setOption(PieOption,true);
                                    break;
                                case 'LINECHART':
                                    $('#chartLine').css('display','block');
                                    for (var i=0;i<visualizationData.series.length;i++){
                                        // visualizationData.series[i].areaStyle = {};
                                        visualizationData.series[i].smooth = true;
                                        for (var key in visualizationData.series[i]){
                                            if (key === 'stack'){
                                                visualizationData.series[i][key] = 'count';
                                            }
                                        }
                                    }
                                    // visualizationData.xAxis.data = visualizationData.xAxis.data.map(i => parseInt(i, 0));
                                    // 折线图
                                    var myChart = echarts.init(document.getElementById('chartLine'));
                                    var option = {
                                        title: {
                                            text: ''
                                        },
                                        color: ['#879DDA', '#9FE080', '#FDD963', '#F86C6C', '#ad6989', '#40B27D', '#FE9059', '#A76AC3'],
                                        tooltip: {
                                            trigger: 'axis',
                                            axisPointer: {
                                                type: 'cross',
                                                label: {
                                                    backgroundColor: '#6a7985'
                                                }
                                            }
                                        },
                                        legend: {
                                            data: visualizationData.legend
                                        },
                                        toolbox: {
                                            right: '50',
                                            feature: {
                                                show: false,

                                                saveAsImage: {},
                                                myTool1: {    //必须要my开头
                                                    show: true,
                                                    title: '排序',
                                                    iconStyle: {
                                                        borderColor: '#9f9f9f'
                                                    },
                                                    icon:'path://M623.14 848.54a24.71 24.71 0 0 1-8.9-1.64c-7.25-2.81-11.87-8.79-11.87-15.36V193.31c0-9.39 9.3-17 20.77-17s20.77 7.61 20.77 17v602.36l183.16-122.61c8.88-5.94 22-4.87 29.23 2.39s6 18-2.92 23.92L636.29 844.69a23.8 23.8 0 0 1-13.15 3.85zM400.86 847.68c-11.47 0-20.77-7.6-20.77-17V228.33L196.93 350.94c-8.88 5.94-22 4.87-29.23-2.39s-6-18 2.92-23.92l217.09-145.32a24.57 24.57 0 0 1 22.05-2.21c7.25 2.81 11.87 8.79 11.87 15.36v638.23c0 9.39-9.3 16.99-20.77 16.99z',
                                                    onclick: function (){
                                                        getChart('',parameter,true, false)
                                                    }
                                                }
                                            }
                                        },
                                        grid: {
                                            left: '6%',
                                            right: '6%',
                                            bottom: '3%',
                                            containLabel: true
                                        },
                                        xAxis: {
                                            type: 'category',
                                            boundaryGap: false,
                                            name: visualizationData.xAxis.type,
                                            data: visualizationData.xAxis.data
                                        },
                                        yAxis: {
                                            type: 'value'
                                        },
                                        series: visualizationData.series
                                    };
                                    myChart.setOption(option,true);
                                    break;
                                case 'HISTOGRAM':
                                    $('#chartBar').css('display','block');
                                    // 柱状图
                                    for (var i=0;i<visualizationData.series.length;i++){
                                        visualizationData.series[i].barGap = 0;
                                        for (var key in visualizationData.series[i]){
                                            if (key === 'stack'){
                                                visualizationData.series[i][key] = '';
                                            }
                                        }
                                    }
                                    // visualizationData.xAxis.data = visualizationData.xAxis.data.map(i => parseInt(i, 0));
                                    var chartBar = echarts.init(document.getElementById('chartBar'));
                                    var BarOption = {
                                        color: ['#116979', '#18b0b0', '#00bdaa', '#27496d'],
                                        tooltip: {
                                            trigger: 'axis',
                                            axisPointer: {
                                                type: 'shadow'
                                            }
                                        },
                                        legend: {
                                            data: visualizationData.legend
                                        },
                                        toolbox: {
                                            show: true,
                                            orient: 'vertical',
                                            // left: 'right',
                                            top: 'center',
                                            right: '50',
                                            feature: {
                                                show: false,
                                                mark: {show: true},
                                                dataView: {show: true, readOnly: false},
                                                magicType: {show: true, type: ['stack', 'tiled']},
                                                restore: {show: true},
                                                saveAsImage: {show: true},
                                                myTool1: {
                                                    show: true,
                                                    title: '排序',
                                                    iconStyle: {
                                                        borderColor: '#9f9f9f'
                                                    },
                                                    icon:'path://M623.14 848.54a24.71 24.71 0 0 1-8.9-1.64c-7.25-2.81-11.87-8.79-11.87-15.36V193.31c0-9.39 9.3-17 20.77-17s20.77 7.61 20.77 17v602.36l183.16-122.61c8.88-5.94 22-4.87 29.23 2.39s6 18-2.92 23.92L636.29 844.69a23.8 23.8 0 0 1-13.15 3.85zM400.86 847.68c-11.47 0-20.77-7.6-20.77-17V228.33L196.93 350.94c-8.88 5.94-22 4.87-29.23-2.39s-6-18 2.92-23.92l217.09-145.32a24.57 24.57 0 0 1 22.05-2.21c7.25 2.81 11.87 8.79 11.87 15.36v638.23c0 9.39-9.3 16.99-20.77 16.99z',
                                                    onclick: function (){
                                                        getChart('',parameter,true, false)
                                                    }
                                                }
                                            }
                                        },
                                        xAxis: [
                                            {
                                                type: 'category',
                                                axisTick: {show: false},
                                                name: visualizationData.xAxis.type,
                                                // axisLabel:{
                                                //     interval:0,
                                                //     rotate:45,
                                                //     margin:2,
                                                //     textStyle:{
                                                //         color:"#8f8f8f"
                                                //     }
                                                // },
                                                data: visualizationData.xAxis.data
                                            }
                                        ],

                                        yAxis: [
                                            {
                                                type: 'value'
                                            }
                                        ],
                                        series: visualizationData.series
                                    };
                                    chartBar.setOption(BarOption,true);
                                    break;
                                case 'SCATTERPLOT':
                                    $('#chartScatter').css('display','block');
                                    $('#preId').css('background','#404a59');

                                    // 散点图
                                    var chartScatter = echarts.init(document.getElementById('chartScatter'));
                                    var schema = visualizationData.schema;
                                    // var itemStyle = {
                                    //     opacity: 0.8,
                                    //     shadowBlur: 10,
                                    //     shadowOffsetX: 0,
                                    //     shadowOffsetY: 0,
                                    //     shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    // };
                                    var ScatterOption = {
                                        backgroundColor: '#404a59',
                                        color: [
                                            '#fe5d4e', '#43c2f7', '#ffa61b', '#64d290', '#cf27bd', '#707ad9'
                                        ],
                                        legend: {
                                            top: 10,
                                            data: visualizationData.legend,
                                            textStyle: {
                                                color: '#fff',
                                                fontSize: 16
                                            }
                                        },
                                        grid: {
                                            left: '10%',
                                            right: 150,
                                            top: '18%',
                                            bottom: '10%'
                                        },
                                        tooltip: {
                                            padding: 10,
                                            backgroundColor: '#222',
                                            borderColor: '#777',
                                            borderWidth: 1,
                                            formatter: function (obj) {
                                                var value = obj.value;
                                                return '<div style="border-bottom: 1px solid rgba(255,255,255,.3); font-size: 18px;padding-bottom: 7px;margin-bottom: 7px">'
                                                    + obj.seriesName + ' ' + value[0] + '日：'
                                                    + value[7]
                                                    + '</div>'
                                                    + schema[1].text + '：' + value[1] + '<br>'
                                                    + schema[2].text + '：' + value[2] + '<br>'
                                                    + schema[3].text + '：' + value[3] + '<br>'
                                                    + schema[4].text + '：' + value[4] + '<br>'
                                                    + schema[5].text + '：' + value[5] + '<br>'
                                                    + schema[6].text + '：' + value[6] + '<br>';
                                            }
                                        },
                                        xAxis: {
                                            type: 'value',
                                            name: '日期',
                                            nameGap: 16,
                                            nameTextStyle: {
                                                color: '#fff',
                                                fontSize: 14
                                            },
                                            max: 31,
                                            splitLine: {
                                                show: false
                                            },
                                            axisLine: {
                                                lineStyle: {
                                                    color: '#eee'
                                                }
                                            }
                                        },
                                        yAxis: {
                                            type: 'value',
                                            name: 'AQI指数',
                                            nameLocation: 'end',
                                            nameGap: 20,
                                            nameTextStyle: {
                                                color: '#fff',
                                                fontSize: 16
                                            },
                                            axisLine: {
                                                lineStyle: {
                                                    color: '#eee'
                                                }
                                            },
                                            splitLine: {
                                                show: false
                                            }
                                        },
                                        toolbox: {
                                            right: '50',
                                            feature: {
                                                saveAsImage: {
                                                    iconStyle:{
                                                        emphasis:{
                                                            color: '#ffffff',
                                                        },
                                                        normal: {
                                                            color: '#ffffff',
                                                            borderColor: '#ffffff',
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        visualMap: [
                                            {
                                                right: '50',
                                                top: '10%',
                                                dimension: 2,
                                                min: 0,
                                                max: 260,
                                                itemWidth: 30,
                                                itemHeight: 120,
                                                calculable: true,
                                                precision: 0.1,
                                                text: ['圆形大小：'],
                                                textGap: 30,
                                                textStyle: {
                                                    color: '#fff'
                                                },
                                                inRange: {
                                                    symbolSize: [10, 70]
                                                },
                                                outOfRange: {
                                                    symbolSize: [10, 70],
                                                    color: ['rgba(255,255,255,.2)']
                                                },
                                                controller: {
                                                    inRange: {
                                                        color: ['#fe5d4e']
                                                    },
                                                    outOfRange: {
                                                        color: ['#444']
                                                    }
                                                }
                                            },
                                            {
                                                right: '50',
                                                bottom: '2%',
                                                dimension: 6,
                                                min: 0,
                                                max: 50,
                                                itemHeight: 120,

                                                precision: 0.1,
                                                text: ['明暗：数据'],
                                                textGap: 30,
                                                textStyle: {
                                                    color: '#fff'
                                                },
                                                inRange: {
                                                    colorLightness: [1, 0.5]
                                                },
                                                outOfRange: {
                                                    color: ['rgba(255,255,255,.2)']
                                                },
                                                controller: {
                                                    inRange: {
                                                        color: ['#fe5d4e']
                                                    },
                                                    outOfRange: {
                                                        color: ['#444']
                                                    }
                                                }
                                            }
                                        ],
                                        series: visualizationData.series
                                    };
                                    chartScatter.setOption(ScatterOption,true);

                                    break;
                                case 'TABLE':
                                    // 表格
                                    // var dataColumns = [
                                    //     {title: 'idKey'}
                                    // ];
                                    //
                                    // visualizationData.schema.forEach((item)=>{
                                    //     dataColumns.push({title: item});
                                    //
                                    // })
                                    // var staData = [{"m4":"1112994.00","name":"面上项目"},{"m4":"216527.00","name":"重点项目"},{"m4":"158278.76","name":"重大项目"},{"m4":"75000.00","name":"优秀青年科学基金项目"},{"m4":"87399.96","name":"重大研究计划"},{"m4":"116920.00","name":"国家杰出青年科学基金"},{"m4":"36010.00","name":"创新研究群体项目"},{"m4":"97459.57","name":"国际(地区)合作与交流项目"},{"m4":"94494.78","name":"国家重大科研仪器研制项目"},{"m4":"238750.40","name":"联合基金项目"},{"m4":"435608.00","name":"青年科学基金项目"},{"m4":"110738.00","name":"地区科学基金项目"},{"m4":"77000.00","name":"科学中心项目"},{"m4":"4500.00","name":"数学天元基金项目"},{"m4":"47710.18","name":"专项项目"}];
                                    // $('#chartTable').css('display','block');
                                    // var dataSet = [];
                                    // var temp = [];
                                    // visualizationData.data.forEach((value,index)=>{ //数组循环
                                    //     temp.push(i + 1);
                                    //     for(var key in value){
                                    //         temp.push(value[key]);
                                    //     }
                                    //     dataSet.push(temp);
                                    //     temp = [];
                                    // })
                                    // $('#statisticsTableMode').DataTable({
                                    //     data: dataSet,
                                    //     columns: dataColumns,
                                    //     "paging": false,
                                    //     "destroy": true,
                                    //     "bAutoWidth": false,  // 禁止自适应宽度
                                    //     "order": [[0, "asc"]],
                                    //     "columnDefs": [
                                    //         { "visible": false, "targets": [0]}
                                    //     ],
                                    //     oLanguage: {
                                    //         "sLengthMenu": "每页显示 _MENU_ 条记录",
                                    //         "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                                    //         "sInfoEmpty": "没有数据",
                                    //         "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                                    //         "sZeroRecords": "没有检索到数据",
                                    //         "sSearch": "查询:",
                                    //         "oPaginate": {
                                    //             "sFirst": "首页",
                                    //             "sPrevious": "前一页",
                                    //             "sNext": "后一页",
                                    //             "sLast": "尾页"
                                    //         }
                                    //     },
                                    //     dom: 'lBfrtip',
                                    //     "buttons": [
                                    //         {
                                    //             extend: 'excelHtml5',
                                    //             text: "导出Excel",
                                    //             className: "btn-sm",
                                    //             customize: function ( xlsx ) {
                                    //                 var sheet = xlsx.xl.worksheets['sheet1.xml'];
                                    //                 // $('row c[r^="C"]', sheet).attr( 's', '2' );
                                    //                 $('c[r=A1] t', sheet).text('      金额单位：万元');
                                    //             }
                                    //         }
                                    //     ]
                                    // });
                                    break;
                                default:
                                    break;
                            }
                        }
                    });
                }else if (parameter.isSoft || parameter.isSoft===false){
                    switch (type){
                        case 'PIECHART':
                            // 饼状图
                            $('#chartPie').css('display','block');
                            var newArr = [];
                            for(var i=0;i<visualizationData.legend.length;i++){
                                newArr.push(Number(visualizationData.legend[i]))
                            }
                            var chartPie = echarts.init(document.getElementById('chartPie'));
                            var PieOption = {
                                color: ['#726a95', '#709fb0', '#a0c1b8', '#f4ebc1', '#e4e4e4', '#ad6989', '#f9d89c', '#7fdbda', '#ba7967', '#e2979c', '#abc2e8'],
                                // title: {
                                //     text: '',
                                //     subtext: '',
                                //     left: 'center'
                                // },
                                tooltip: {
                                    trigger: 'item',
                                    formatter: '{a} <br/>{b} : {c} ({d}%)'
                                },
                                legend: {
                                    // orient: 'vertical',
                                    top: 10,
                                    left: 'center',
                                    data: newArr
                                },
                                toolbox: {
                                    right: '50',
                                    feature: {
                                        saveAsImage: {}
                                    }
                                },
                                series: [
                                    {
                                        name: '访问来源',
                                        type: 'pie',
                                        radius: '55%',
                                        center: ['50%', '60%'],
                                        selectedMode: 'single',
                                        data: visualizationData.series,
                                        emphasis: {
                                            itemStyle: {
                                                shadowBlur: 10,
                                                shadowOffsetX: 0,
                                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                                            }
                                        }
                                    }
                                ]
                            };
                            chartPie.setOption(PieOption,true);
                            break;
                        case 'LINECHART':
                            $('#chartLine').css('display','block');
                            for (var i=0;i<visualizationData.series.length;i++){
                                // visualizationData.series[i].areaStyle = {};
                                visualizationData.series[i].smooth = true;
                                for (var key in visualizationData.series[i]){
                                    if (key === 'stack'){
                                        visualizationData.series[i][key] = 'count';
                                    }
                                }
                            }
                            // visualizationData.xAxis.data = visualizationData.xAxis.data.map(i => parseInt(i, 0));
                            // 折线图
                            var myChart = echarts.init(document.getElementById('chartLine'));
                            var option = {
                                title: {
                                    text: ''
                                },
                                color: ['#879DDA', '#9FE080', '#FDD963', '#F86C6C', '#ad6989', '#40B27D', '#FE9059', '#A76AC3'],
                                tooltip: {
                                    trigger: 'axis',
                                    axisPointer: {
                                        type: 'cross',
                                        label: {
                                            backgroundColor: '#6a7985'
                                        }
                                    }
                                },
                                legend: {
                                    data: visualizationData.legend
                                },
                                toolbox: {
                                    right: '50',
                                    feature: {
                                        show: false,
                                        saveAsImage: {},
                                        myTool1: {
                                            show: true,
                                            title: '排序',
                                            iconStyle: {
                                                borderColor: '#9f9f9f'
                                            },
                                            icon:'path://M623.14 848.54a24.71 24.71 0 0 1-8.9-1.64c-7.25-2.81-11.87-8.79-11.87-15.36V193.31c0-9.39 9.3-17 20.77-17s20.77 7.61 20.77 17v602.36l183.16-122.61c8.88-5.94 22-4.87 29.23 2.39s6 18-2.92 23.92L636.29 844.69a23.8 23.8 0 0 1-13.15 3.85zM400.86 847.68c-11.47 0-20.77-7.6-20.77-17V228.33L196.93 350.94c-8.88 5.94-22 4.87-29.23-2.39s-6-18 2.92-23.92l217.09-145.32a24.57 24.57 0 0 1 22.05-2.21c7.25 2.81 11.87 8.79 11.87 15.36v638.23c0 9.39-9.3 16.99-20.77 16.99z',
                                            onclick: function (){
                                                getChart('',parameter,false, false)
                                            }
                                        }
                                    }
                                },
                                grid: {
                                    left: '6%',
                                    right: '6%',
                                    bottom: '3%',
                                    containLabel: true
                                },
                                xAxis: {
                                    type: 'category',
                                    boundaryGap: false,
                                    name: visualizationData.xAxis.type,
                                    data: visualizationData.xAxis.data
                                },
                                yAxis: {
                                    type: 'value'
                                },
                                series: visualizationData.series
                            };
                            myChart.setOption(option,true);
                            break;
                        case 'HISTOGRAM':
                            $('#chartBar').css('display','block');
                            // 柱状图
                            for (var i=0;i<visualizationData.series.length;i++){
                                visualizationData.series[i].barGap = 0;
                                for (var key in visualizationData.series[i]){
                                    if (key === 'stack'){
                                        visualizationData.series[i][key] = '';
                                    }
                                }
                            }
                            // visualizationData.xAxis.data = visualizationData.xAxis.data.map(i => parseInt(i, 0));
                            var chartBar = echarts.init(document.getElementById('chartBar'));
                            var BarOption = {
                                color: ['#116979', '#18b0b0', '#00bdaa', '#27496d'],
                                tooltip: {
                                    trigger: 'axis',
                                    axisPointer: {
                                        type: 'shadow'
                                    }
                                },
                                legend: {
                                    data: visualizationData.legend
                                },
                                toolbox: {
                                    show: true,
                                    orient: 'vertical',
                                    // left: 'right',
                                    top: 'center',
                                    right: '50',
                                    feature: {
                                        show: false,
                                        mark: {show: true},
                                        dataView: {show: true, readOnly: false},
                                        magicType: {show: true, type: ['stack', 'tiled']},
                                        restore: {show: true},
                                        saveAsImage: {show: true},
                                        myTool1: {
                                            show: true,
                                            title: '排序',
                                            iconStyle: {
                                                borderColor: '#9f9f9f'
                                            },
                                            icon:'path://M623.14 848.54a24.71 24.71 0 0 1-8.9-1.64c-7.25-2.81-11.87-8.79-11.87-15.36V193.31c0-9.39 9.3-17 20.77-17s20.77 7.61 20.77 17v602.36l183.16-122.61c8.88-5.94 22-4.87 29.23 2.39s6 18-2.92 23.92L636.29 844.69a23.8 23.8 0 0 1-13.15 3.85zM400.86 847.68c-11.47 0-20.77-7.6-20.77-17V228.33L196.93 350.94c-8.88 5.94-22 4.87-29.23-2.39s-6-18 2.92-23.92l217.09-145.32a24.57 24.57 0 0 1 22.05-2.21c7.25 2.81 11.87 8.79 11.87 15.36v638.23c0 9.39-9.3 16.99-20.77 16.99z',
                                            onclick: function (){
                                                getChart('',parameter,false, false)
                                            }
                                        }
                                    }
                                },
                                xAxis: [
                                    {
                                        type: 'category',
                                        axisTick: {show: false},
                                        name: visualizationData.xAxis.type,
                                        // axisLabel:{
                                        //     interval:0,
                                        //     rotate:45,
                                        //     margin:2,
                                        //     textStyle:{
                                        //         color:"#8f8f8f"
                                        //     }
                                        // },
                                        data: visualizationData.xAxis.data
                                    }
                                ],

                                yAxis: [
                                    {
                                        type: 'value'
                                    }
                                ],
                                series: visualizationData.series
                            };
                            chartBar.setOption(BarOption,true);
                            break;
                        case 'SCATTERPLOT':
                            $('#chartScatter').css('display','block');
                            $('#preId').css('background','#404a59');

                            // 散点图
                            var chartScatter = echarts.init(document.getElementById('chartScatter'));
                            var schema = visualizationData.schema;
                            // var itemStyle = {
                            //     opacity: 0.8,
                            //     shadowBlur: 10,
                            //     shadowOffsetX: 0,
                            //     shadowOffsetY: 0,
                            //     shadowColor: 'rgba(0, 0, 0, 0.5)'
                            // };
                            var ScatterOption = {
                                backgroundColor: '#404a59',
                                color: [
                                    '#fe5d4e', '#43c2f7', '#ffa61b', '#64d290', '#cf27bd', '#707ad9'
                                ],
                                legend: {
                                    top: 10,
                                    data: visualizationData.legend,
                                    textStyle: {
                                        color: '#fff',
                                        fontSize: 16
                                    }
                                },
                                grid: {
                                    left: '10%',
                                    right: 150,
                                    top: '18%',
                                    bottom: '10%'
                                },
                                tooltip: {
                                    padding: 10,
                                    backgroundColor: '#222',
                                    borderColor: '#777',
                                    borderWidth: 1,
                                    formatter: function (obj) {
                                        var value = obj.value;
                                        return '<div style="border-bottom: 1px solid rgba(255,255,255,.3); font-size: 18px;padding-bottom: 7px;margin-bottom: 7px">'
                                            + obj.seriesName + ' ' + value[0] + '日：'
                                            + value[7]
                                            + '</div>'
                                            + schema[1].text + '：' + value[1] + '<br>'
                                            + schema[2].text + '：' + value[2] + '<br>'
                                            + schema[3].text + '：' + value[3] + '<br>'
                                            + schema[4].text + '：' + value[4] + '<br>'
                                            + schema[5].text + '：' + value[5] + '<br>'
                                            + schema[6].text + '：' + value[6] + '<br>';
                                    }
                                },
                                xAxis: {
                                    type: 'value',
                                    name: '日期',
                                    nameGap: 16,
                                    nameTextStyle: {
                                        color: '#fff',
                                        fontSize: 14
                                    },
                                    max: 31,
                                    splitLine: {
                                        show: false
                                    },
                                    axisLine: {
                                        lineStyle: {
                                            color: '#eee'
                                        }
                                    }
                                },
                                yAxis: {
                                    type: 'value',
                                    name: 'AQI指数',
                                    nameLocation: 'end',
                                    nameGap: 20,
                                    nameTextStyle: {
                                        color: '#fff',
                                        fontSize: 16
                                    },
                                    axisLine: {
                                        lineStyle: {
                                            color: '#eee'
                                        }
                                    },
                                    splitLine: {
                                        show: false
                                    }
                                },
                                toolbox: {
                                    right: '50',
                                    feature: {
                                        saveAsImage: {
                                            iconStyle:{
                                                emphasis:{
                                                    color: '#ffffff',
                                                },
                                                normal: {
                                                    color: '#ffffff',
                                                    borderColor: '#ffffff',
                                                }
                                            }
                                        }
                                    }
                                },
                                visualMap: [
                                    {
                                        right: '50',
                                        top: '10%',
                                        dimension: 2,
                                        min: 0,
                                        max: 260,
                                        itemWidth: 30,
                                        itemHeight: 120,
                                        calculable: true,
                                        precision: 0.1,
                                        text: ['圆形大小：'],
                                        textGap: 30,
                                        textStyle: {
                                            color: '#fff'
                                        },
                                        inRange: {
                                            symbolSize: [10, 70]
                                        },
                                        outOfRange: {
                                            symbolSize: [10, 70],
                                            color: ['rgba(255,255,255,.2)']
                                        },
                                        controller: {
                                            inRange: {
                                                color: ['#fe5d4e']
                                            },
                                            outOfRange: {
                                                color: ['#444']
                                            }
                                        }
                                    },
                                    {
                                        right: '50',
                                        bottom: '2%',
                                        dimension: 6,
                                        min: 0,
                                        max: 50,
                                        itemHeight: 120,

                                        precision: 0.1,
                                        text: ['明暗：数据'],
                                        textGap: 30,
                                        textStyle: {
                                            color: '#fff'
                                        },
                                        inRange: {
                                            colorLightness: [1, 0.5]
                                        },
                                        outOfRange: {
                                            color: ['rgba(255,255,255,.2)']
                                        },
                                        controller: {
                                            inRange: {
                                                color: ['#fe5d4e']
                                            },
                                            outOfRange: {
                                                color: ['#444']
                                            }
                                        }
                                    }
                                ],
                                series: visualizationData.series
                            };
                            chartScatter.setOption(ScatterOption,true);

                            break;
                        case 'TABLE':
                            // 表格
                            // var dataColumns = [
                            //     {title: 'idKey'}
                            // ];
                            //
                            // visualizationData.schema.forEach((item)=>{
                            //     dataColumns.push({title: item});
                            //
                            // })
                            // var staData = [{"m4":"1112994.00","name":"面上项目"},{"m4":"216527.00","name":"重点项目"},{"m4":"158278.76","name":"重大项目"},{"m4":"75000.00","name":"优秀青年科学基金项目"},{"m4":"87399.96","name":"重大研究计划"},{"m4":"116920.00","name":"国家杰出青年科学基金"},{"m4":"36010.00","name":"创新研究群体项目"},{"m4":"97459.57","name":"国际(地区)合作与交流项目"},{"m4":"94494.78","name":"国家重大科研仪器研制项目"},{"m4":"238750.40","name":"联合基金项目"},{"m4":"435608.00","name":"青年科学基金项目"},{"m4":"110738.00","name":"地区科学基金项目"},{"m4":"77000.00","name":"科学中心项目"},{"m4":"4500.00","name":"数学天元基金项目"},{"m4":"47710.18","name":"专项项目"}];
                            // $('#chartTable').css('display','block');
                            // var dataSet = [];
                            // var temp = [];
                            // visualizationData.data.forEach((value,index)=>{ //数组循环
                            //     temp.push(i + 1);
                            //     for(var key in value){
                            //         temp.push(value[key]);
                            //     }
                            //     dataSet.push(temp);
                            //     temp = [];
                            // })
                            // $('#statisticsTableMode').DataTable({
                            //     data: dataSet,
                            //     columns: dataColumns,
                            //     "paging": false,
                            //     "destroy": true,
                            //     "bAutoWidth": false,  // 禁止自适应宽度
                            //     "order": [[0, "asc"]],
                            //     "columnDefs": [
                            //         { "visible": false, "targets": [0]}
                            //     ],
                            //     oLanguage: {
                            //         "sLengthMenu": "每页显示 _MENU_ 条记录",
                            //         "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                            //         "sInfoEmpty": "没有数据",
                            //         "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                            //         "sZeroRecords": "没有检索到数据",
                            //         "sSearch": "查询:",
                            //         "oPaginate": {
                            //             "sFirst": "首页",
                            //             "sPrevious": "前一页",
                            //             "sNext": "后一页",
                            //             "sLast": "尾页"
                            //         }
                            //     },
                            //     dom: 'lBfrtip',
                            //     "buttons": [
                            //         {
                            //             extend: 'excelHtml5',
                            //             text: "导出Excel",
                            //             className: "btn-sm",
                            //             customize: function ( xlsx ) {
                            //                 var sheet = xlsx.xl.worksheets['sheet1.xml'];
                            //                 // $('row c[r^="C"]', sheet).attr( 's', '2' );
                            //                 $('c[r=A1] t', sheet).text('      金额单位：万元');
                            //             }
                            //         }
                            //     ]
                            // });
                            break;
                        default:
                            break;
                    }
                }
            }
        }
    });
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/service/IMxCellService.java<|end_filename|>
package cn.cnic.component.mxGraph.service;

import cn.cnic.component.mxGraph.entity.MxCell;

public interface IMxCellService {

    public int deleteMxCellById(String username, String id);

    public MxCell getMeCellById(String id);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/service/IResource.java<|end_filename|>
package cn.cnic.third.service;

public interface IResource {
    /**
     * Call resource/info interface
     *
     * @return
     */
    public String getResourceInfo();


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/vo/PropertyTemplateVo.java<|end_filename|>
package cn.cnic.component.stopsComponent.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class PropertyTemplateVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String stopsTemplate;

    private String name;

    private String displayName;

    private String description;

    private String defaultValue;

    private String allowableValues;

    private Boolean required;

    private Boolean sensitive;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/controller/requestVo/RunStopsVo.java<|end_filename|>
package cn.cnic.controller.requestVo;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@ApiModel(description = "run stops request data")
public class RunStopsVo implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @ApiModelProperty(value = "stops id", required = true)
    private String stopsId;
    
    @ApiModelProperty(value = "is run follow-up", required = true)
    private Boolean isRunFollowUp;
    
    @ApiModelProperty(value = "port array")
    private String ports[];
    
    @ApiModelProperty(value = "testData Id array")
    private String testDataIds[];

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/service/IMxGraphService.java<|end_filename|>
package cn.cnic.component.mxGraph.service;

public interface IMxGraphService {

    public int deleteMxGraphById(String username, String id);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/config/Swagger2Config.java<|end_filename|>
package cn.cnic.base.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;


@Configuration
@EnableSwagger2
//@Profile({"dev", "test"})// Set the "dev", "test" environment to open the "prod" environment and close it
public class Swagger2Config {
    @Bean
    public Docket createRestApi() {

        ParameterBuilder pb = new ParameterBuilder();
        pb.name("Authorization")
                .description("Token")
                .modelRef(new ModelRef("string"))
                .parameterType("header")
                .required(true)
                .defaultValue("Bearer ")
                .build();
        List<Parameter> par = new ArrayList<>();
        par.add(pb.build());//
        return new Docket(DocumentationType.SWAGGER_2)
                .enable(true)
                .apiInfo(apiInfo())
                .groupName("piflow-web")
                .select()
                .apis(RequestHandlerSelectors.basePackage("cn.cnic.controller.api"))
                .paths(PathSelectors.any())
                .build()
                .globalOperationParameters(par);
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("web-api")
                .description("web-api")
                // .termsOfServiceUrl("http:/xxx/xxx")
                .version("1.0")
                .build();
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/service/ISparkJar.java<|end_filename|>
package cn.cnic.third.service;

import cn.cnic.third.vo.sparkJar.SparkJarVo;

public interface ISparkJar {

    public String getSparkJarPath();

    public SparkJarVo mountSparkJar(String sparkJarName);

    public SparkJarVo unmountSparkJar(String sparkJarMountId);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/common/Eunm/ArrowDirection.java<|end_filename|>
package cn.cnic.common.Eunm;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cn.cnic.base.TextureEnumSerializer;

@JsonSerialize(using = TextureEnumSerializer.class)
public enum ArrowDirection {
    UP_DIRECTION(3.5, 0, 3.5, 5, 0, 7, 7, 7),
    DOWN_DIRECTION(3.5, 7, 3.5, 2, 0, 0, 7, 0),
    RIGHT_DIRECTION(7, 3.5, 2, 3.5, 0, 0, 0, 7),
    LEFT_DIRECTION(0, 3.5, 5, 3.5, 7, 0, 7, 7);
    private final double upX;
    private final double upY;
    private final double downX;
    private final double downY;
    private final double rightX;
    private final double rightY;
    private final double lfetX;
    private final double lfetY;

    private ArrowDirection(double upX, double upY, double downX, double downY, double rightX, double rightY, double lfetX, double lfetY) {
        this.upX = upX;
        this.upY = upY;
        this.downX = downX;
        this.downY = downY;
        this.rightX = rightX;
        this.rightY = rightY;
        this.lfetX = lfetX;
        this.lfetY = lfetY;
    }

    public double getUpX() {
        return upX;
    }

    public double getUpY() {
        return upY;
    }

    public double getDownX() {
        return downX;
    }

    public double getDownY() {
        return downY;
    }

    public double getRightX() {
        return rightX;
    }

    public double getRightY() {
        return rightY;
    }

    public double getLfetX() {
        return lfetX;
    }

    public double getLfetY() {
        return lfetY;
    }
}


<|start_filename|>vue-piflow-web/public/drawingBoard/js/ajaxUtils.js<|end_filename|>
// var web_header_prefix = "http://10.0.88.46:86/piflow";
var web_base_origin = window.location.origin;
var web_drawingBoard = "/drawingBoard";
var sever_base_origin = "http://10.0.85.80:6002/piflow-web";
// var basePath = window.sessionStorage.getItem("basePath")
var basePath = null;
// var token = top.window.sessionStorage.getItem('token') //此处放置请求到的用户token
var token = null;

if (document.cookie && document.cookie != '') {
    var cookies = document.cookie.split(';');//将获得的所有cookie切割成数组
    for (var i = 0; i < cookies.length; i++) {
        var cookie = cookies[i];//得到某下标的cookies数组
        if (cookie.substring(0, 'basePath'.length + 2).trim() == 'basePath='.trim()) {//如果存在该cookie的话就将cookie的值拿出来
            basePath = cookie.substring('basePath'.length + 2, cookie.length);
            // break
        }else if (cookie.substring(0, 'basePath'.length + 1).trim() == 'basePath='.trim()) {//如果存在该cookie的话就将cookie的值拿出来
            basePath = cookie.substring('basePath'.length + 1, cookie.length);
            // break
        }
        if (cookie.substring(0, 'token'.length + 2).trim() == 'token='.trim()) {
            token = cookie.substring('token'.length + 2, cookie.length);
            // break
        }
    }
}

var web_header_prefix = basePath.indexOf(window.location.origin) || basePath.indexOf('http') > -1 ? basePath : web_base_origin + basePath; //与 .env.production 内容同步
/**
 * ajax工具js
 * @param requestType 请求类型(get,post)
 * @param url 请求url
 * @param async 是否异步
 * @param requestData 请求参数
 * @param backFunc 请求成功后回调方法
 * @param errBackFunc 请求失败后回调方法
 */
function ajaxRequest(param) {
    if (!param.url) {
        throw "url is null"
    }
    var requestType = param.type ? param.type : "GET";
    var url = param.url;
    var cache = param.cache ? true : false;
    var async = param.async ? true : false;
    var traditional = param.traditional ? true : false;
    var requestData = param.data ? param.data : {};
    var backFunc = param.success;
    var errBackFunc = param.error;
    var processData = true;
    if (undefined !== param.processData) {
        processData = param.processData ? true : false;
    }
    var async = true;
    if (undefined !== param.async) {
        async = param.async ? true : false;
    }
    var contentType = "application/x-www-form-urlencoded;charset=UTF-8";
    if (undefined !== param.contentType) {
        contentType = param.contentType
    }
    $.ajax({
        cache: cache,
        type: requestType,
        async: async,
        url: web_header_prefix + url,
        data: requestData,
        traditional: traditional,
        contentType: contentType,
        processData: processData,
        headers: {
            Authorization: ("Bearer " + token)
        },
        // dataType: 'json',
        // beforeSend: function (request) {
        //     request.setRequestHeader("token", tokenInfo);
        // },
        // xhrFields: {
        //     withCredentials: true
        // },
        success: function (data) {
            //data =  JSON.parse(data);
            if (data.code === 403 || data.code === 401) {
                //  alert(data.errMsg);
                // console.log(data);
                window.location.href = web_base_origin + "/#/login";
                return;
            }
            if (backFunc && $.isFunction(backFunc)) {
                backFunc(data);
            }
        },
        error: function (request) {//请求失败之后的操作
            if (errBackFunc && $.isFunction(errBackFunc)) {
                errBackFunc(request);
            }
            return;
        }
    });
};

function ajaxLoad(elementId, requestUrl, backFunc, errBackFunc) {
    ajaxLoadAsync(elementId, requestUrl, true, backFunc, errBackFunc);
}

function ajaxLoadAsync(elementId, requestUrl, async, backFunc, errBackFunc) {
    async = (async === undefined) ? true : async;
    $.ajax({
        type: "GET",
        async: async,
        url: web_drawingBoard + requestUrl,
        headers: {
            Authorization: ("Bearer " + token)
        },
        success: function (data) {
            $("#" + elementId).html(data);
            if (backFunc && $.isFunction(backFunc)) {
                backFunc(data);
            }
        },
        error: function (request) {//请求失败之后的操作
            if (errBackFunc && $.isFunction(errBackFunc)) {
                errBackFunc(request);
            }
            return;
        }
    });

}

function ajaxFun(config) {
    if (config) {
        config.headers = {Authorization: ("Bearer " + token)};
        config.url = sever_base_origin + config.url;
    } else {
        console.log("ajax config error");
        layer.msg("ajax config error", {icon: 2, shade: 0, time: 2000});
    }
}

function getUrlParams(url) {
    var result = new Object();
    var idx = url.lastIndexOf('?');

    if (idx > 0) {
        var params = url.substring(idx + 1).split('&');

        for (var i = 0; i < params.length; i++) {
            idx = params[i].indexOf('=');

            if (idx > 0) {
                result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
            }
        }
    }

    return result;
}

function openLayerWindowLoadHtml(htmlStr, window_width, window_height, title, shade) {
    shade = shade ? shade : 0;
    layer.open({
        type: 1,
        title: '<span style="color: #269252;">' + title + '</span>',
        shade: shade,
        shadeClose: false,
        closeBtn: 1,
        shift: 7,
        area: [window_width + 'px', window_height + 'px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: htmlStr
    });
}

function openLayerTypeIframeWindowLoadUrl(url, window_width, window_height, title, shade) {
    shade = shade ? shade : 0;
    layer.open({
        type: 2,
        title: '<span style="color: #269252;">' + title + '</span>',
        shade: shade,
        shadeClose: false,
        closeBtn: 1,
        shift: 7,
        area: [window_width + 'px', window_height + 'px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: web_drawingBoard + url
    });
}

// window.location
function window_location_href(url) {
    window.top.location.href = window.location.origin + "/#/drawingBoard?src=" + web_drawingBoard + url ;
    // window.top.location.reload();
    // window.open(window.location.origin + "/#/drawingBoard?src=" + web_drawingBoard + url,"_blank");
}

function new_window_open(url) {

    var tempWindow = window.open(window.location.origin + "/#/drawingBoard?src=" + web_drawingBoard + url);
    if (tempWindow == null || typeof (tempWindow) == 'undefined') {
        alert('The window cannot be opened. Please check your browser settings.')
    }

}



<|start_filename|>piflow-web/src/main/java/cn/cnic/base/BaseHibernateModelNoIdUtils.java<|end_filename|>
package cn.cnic.base;

import java.util.Date;

public class BaseHibernateModelNoIdUtils {

    public static BaseHibernateModelNoId newBaseHibernateModelNoId(String username) {

        BaseHibernateModelNoId baseHibernateModelNoId = new BaseHibernateModelNoId();
        // basic properties (required when creating)
        baseHibernateModelNoId.setCrtDttm(new Date());
        baseHibernateModelNoId.setCrtUser(username);
        // basic properties
        baseHibernateModelNoId.setEnableFlag(true);
        baseHibernateModelNoId.setLastUpdateUser(username);
        baseHibernateModelNoId.setLastUpdateDttm(new Date());
        baseHibernateModelNoId.setVersion(0L);
        return baseHibernateModelNoId;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/dataSource/mapper/DataSourceMapper.java<|end_filename|>
package cn.cnic.component.dataSource.mapper;

import cn.cnic.component.dataSource.entity.DataSource;
import cn.cnic.component.dataSource.mapper.provider.DataSourceMapperProvider;
import cn.cnic.component.dataSource.vo.DataSourceVo;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

@Mapper
public interface DataSourceMapper {
    /**
     * add DataSource
     *
     * @param dataSource
     * @return
     */
    @InsertProvider(type = DataSourceMapperProvider.class, method = "addDataSource")
    public int addDataSource(DataSource dataSource);

    /**
     * update DataSource
     *
     * @param dataSource
     * @return
     */
    @UpdateProvider(type = DataSourceMapperProvider.class, method = "updateDataSource")
    public int updateDataSource(DataSource dataSource);

    /**
     * query all DataSource
     *
     * @return
     */
    @SelectProvider(type = DataSourceMapperProvider.class, method = "getDataSourceList")
    public List<DataSource> getDataSourceList(@Param("username") String username, @Param("isAdmin") boolean isAdmin);

    @SelectProvider(type = DataSourceMapperProvider.class, method = "getDataSourceListParam")
    public List<DataSource> getDataSourceListParam(@Param("username") String username, @Param("isAdmin") boolean isAdmin, String param);

    @SelectProvider(type = DataSourceMapperProvider.class, method = "getDataSourceListParam")
    public List<DataSourceVo> getDataSourceVoListParam(@Param("username") String username, @Param("isAdmin") boolean isAdmin, String param);

    /**
     * query all TemplateDataSource
     *
     * @return
     */
    @SelectProvider(type = DataSourceMapperProvider.class, method = "getDataSourceTemplateList")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "id", property = "dataSourcePropertyList", many = @Many(select = "cn.cnic.component.dataSource.mapper.DataSourcePropertyMapper.getDataSourcePropertyListByDataSourceId", fetchType = FetchType.LAZY))
    })
    public List<DataSource> getDataSourceTemplateList();

    /**
     * query DataSource by DataSourceId
     *
     * @param id
     * @return
     */
    @SelectProvider(type = DataSourceMapperProvider.class, method = "getDataSourceById")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "id", property = "dataSourcePropertyList", many = @Many(select = "cn.cnic.component.dataSource.mapper.DataSourcePropertyMapper.getDataSourcePropertyListByDataSourceId", fetchType = FetchType.LAZY))
    })
    DataSource getDataSourceByIdAndUser(@Param("username") String username, @Param("isAdmin") boolean isAdmin, @Param("id") String id);


    /**
     * query DataSource by DataSourceId
     *
     * @param id
     * @return
     */
    @SelectProvider(type = DataSourceMapperProvider.class, method = "getDataSourceById")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "id", property = "dataSourcePropertyList", many = @Many(select = "cn.cnic.component.dataSource.mapper.DataSourcePropertyMapper.getDataSourcePropertyListByDataSourceId", fetchType = FetchType.LAZY))
    })
    DataSource getDataSourceById(@Param("id") String id);

    /**
     * query DataSource by DataSourceId
     *
     * @param id
     * @return
     */
    @SelectProvider(type = DataSourceMapperProvider.class, method = "adminGetDataSourceById")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "id", property = "dataSourcePropertyList", many = @Many(select = "cn.cnic.component.dataSource.mapper.DataSourcePropertyMapper.getDataSourcePropertyListByDataSourceId", fetchType = FetchType.LAZY))
    })
    DataSource adminGetDataSourceById(@Param("id") String id);

    @UpdateProvider(type = DataSourceMapperProvider.class, method = "updateEnableFlagById")
    public int updateEnableFlagById(@Param("username") String username, @Param("id") String id);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/mapper/provider/TestDataMapperProvider.java<|end_filename|>
package cn.cnic.component.testData.mapper.provider;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.testData.entity.TestData;

public class TestDataMapperProvider {

    private String id;
    private String lastUpdateUser;
    private String lastUpdateDttmStr;
    private long version;
    private int enableFlag;
    private String name;
    private String description;

    private boolean preventSQLInjectionTestData(TestData testData) {
        if (null == testData || StringUtils.isBlank(testData.getLastUpdateUser())) {
            return false;
        }
        // Mandatory Field
        String lastUpdateDttm = DateUtils
                .dateTimesToStr(null != testData.getLastUpdateDttm() ? testData.getLastUpdateDttm() : new Date());
        this.id = SqlUtils.preventSQLInjection(testData.getId());
        this.enableFlag = ((null != testData.getEnableFlag() && testData.getEnableFlag()) ? 1 : 0);
        this.version = (null != testData.getVersion() ? testData.getVersion() : 0L);
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttm);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(testData.getLastUpdateUser());

        // Selection field
        this.name = SqlUtils.preventSQLInjection(testData.getName());
        this.description = SqlUtils.preventSQLInjection(testData.getDescription());

        return true;
    }

    private void resetTestData() {
        this.id = null;
        this.lastUpdateUser = null;
        this.lastUpdateDttmStr = null;
        this.version = 0L;
        this.enableFlag = 1;
        this.name = null;
        this.description = null;
    }

    /**
     * add TestData
     * 
     * @param testData
     * @return String
     */
    public String addTestData(TestData testData) {
        String sql = "SELECT 0";
        if (preventSQLInjectionTestData(testData)) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("INSERT INTO test_data ");
            strBuf.append("( ");
            strBuf.append(SqlUtils.baseFieldName() + ", ");
            strBuf.append("name, ");
            strBuf.append("description ");
            strBuf.append(") ");

            strBuf.append("values ");
            strBuf.append("(");
            strBuf.append(SqlUtils.baseFieldValues(testData) + ", ");
            strBuf.append(this.name + ", ");
            strBuf.append(this.description + " ");
            strBuf.append(")");
            sql = strBuf.toString();
        }
        this.resetTestData();
        return sql;
    }

    /**
     * update TestData
     * 
     * @param testData
     * @return String
     */
    public String updateTestData(TestData testData) {
        String sqlStr = "SELECT 0";
        boolean flag = preventSQLInjectionTestData(testData);
        if (flag && StringUtils.isNotBlank(this.id)) {
            SQL sql = new SQL();
            // INSERT_INTO brackets is table name
            sql.UPDATE("test_data");
            // The first string in the SET is the name of the field corresponding to the
            // table in the database
            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + this.enableFlag);
            sql.SET("name = " + this.name);
            sql.SET("description = " + this.description);
            sql.WHERE("version = " + this.version);
            sql.WHERE("id = " + this.id);
            sqlStr = sql.toString();
        }
        this.resetTestData();
        return sqlStr;
    }

    /**
     * update TestData enable_flag
     * 
     * @param isAdmin
     * @param username
     * @param id
     * @return String
     */
    public String delTestDataById(boolean isAdmin, String username, String id){
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("UPDATE test_data SET enable_flag=0 WHERE ");
        stringBuffer.append("id=" + SqlUtils.preventSQLInjection(id));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }

    /**
     * search TestData List
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @return String
     */
    public String getTestDataList(boolean isAdmin, String username, String param) {
        StringBuffer stringBuf = new StringBuffer();
        stringBuf.append("SELECT * FROM test_data WHERE enable_flag=1 ");
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            stringBuf.append("AND crt_user=" + SqlUtils.preventSQLInjection(username) + " ");
        }
        if (StringUtils.isNotBlank(param)) {
            stringBuf.append("crt_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("last_update_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("name LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("description LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
        }
        stringBuf.append("ORDER BY  last_update_dttm DESC ");
        return stringBuf.toString();
    }


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/service/IPathsService.java<|end_filename|>
package cn.cnic.component.flow.service;

import cn.cnic.component.flow.entity.Flow;
import cn.cnic.component.flow.entity.Paths;
import cn.cnic.component.flow.vo.PathsVo;

import java.util.List;

public interface IPathsService {

    public int deletePathsByFlowId(String username, String id);

    /**
     * Query connection information according to flowId and pageid
     *
     * @param flowId
     * @param pageId
     * @return
     */
    public String getPathsByFlowIdAndPageId(String flowId, String pageId);

    /**
     * Query connection information
     *
     * @param flowId
     * @param from
     * @param to
     * @return
     */
    public List<PathsVo> getPaths(String flowId, String from, String to);

    /**
     * Query the number of connections
     *
     * @param flowId
     * @param from
     * @param to
     * @return
     */
    public Integer getPathsCounts(String flowId, String from, String to);

    /**
     * Save update connection information
     *
     * @param pathsVo
     * @return
     */
    public int upDatePathsVo(String username, PathsVo pathsVo);

    /**
     * Insert list<Paths>
     *
     * @param pathsList
     * @return
     */
    public int addPathsList(String username, List<Paths> pathsList, Flow flow);


}


<|start_filename|>vue-piflow-web/public/drawingBoard/css/jquery.custom.css<|end_filename|>

/* ========================================================
*
* Pannonia - responsive admin template
*
* ========================================================
*
* File: jquery.custom.css;
* Description: Jquery UI custom styles
* Version: 1.0
*
* ======================================================== */


/* Layout helpers
----------------------------------*/

.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.ui-helper-clearfix:after { clear: both; }
.ui-helper-clearfix { min-height: 0; }
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
.ui-front { z-index: 100; }


/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }


/* Icons
----------------------------------*/

.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }


/* Misc visuals
----------------------------------*/

.ui-widget-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; }
.ui-resizable { position: relative; }
.ui-resizable-handle { position: absolute; font-size: 0.1px; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px; }
.ui-autocomplete { position: absolute; top: 0; left: 0; cursor: default; }




/*===== Datepicker =====*/

.ui-datepicker { width: 17em; display: none; z-index: 10!important; }
.ui-datepicker .ui-datepicker-header { position: relative; padding: 2px 0; background: #DB6969; color: #fff; font-weight: bold; }
.date-trigger .ui-datepicker-trigger { margin-left: 6px; cursor: pointer; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position: absolute; padding: 10px; cursor: pointer; top: 3px; width: 5px; height: 8px; -webkit-transition: all ease-in-out 0.2s; -moz-transition: all ease-in-out 0.2s; transition: all ease-in-out 0.2s; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { opacity: 0.8; }
.ui-datepicker .ui-datepicker-prev { background: url(../img/elements/interface/datepicker_arrow_left.png) 10px 10px no-repeat; left: 4px; }
.ui-datepicker .ui-datepicker-next { background: url(../img/elements/interface/datepicker_arrow_right.png) 10px 10px no-repeat; right: 4px; }
.ui-datepicker .ui-datepicker-title { margin: 0 20px; padding: 5px 0 4px 0; text-align: center; font-size: 12px; }
.ui-datepicker .ui-datepicker-title select { font-size: 1em; margin: 1px 0; }
.ui-datepicker select.ui-datepicker-month-year { width: 100%; }
.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%; }
.ui-datepicker table { width: 100%; font-size: 11px; border-collapse: collapse; background: white; border: 1px solid #DDD; margin-top: 1px; }
.ui-datepicker-append { margin-left: 14px; font-size: 11px; }
.no-append .ui-datepicker-append { display: none; }
.datepicker-liquid > .ui-datepicker { width: 100%; }
.datepicker-fixed { width: 17em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: 4px; text-align: center; text-decoration: none; line-height: 16px;}
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding: 0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width: auto; overflow: visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float: left; }

.ui-datepicker.ui-datepicker-multi { width: auto; margin-left: 2px; }
.ui-datepicker-multi .ui-datepicker-group { float: left; margin-left:1px; }
.ui-datepicker-multi .ui-datepicker-group:first-child { margin-left: -2px; }
.ui-datepicker-multi-2 .ui-datepicker-group { width: 50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width: 33.3333333333%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width: 25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width: 0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear: left; }
.ui-datepicker-row-break { clear: both; width: 100%; font-size: 0; }

.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear: right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
.ui-datepicker-rtl .ui-datepicker-group { float: right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width: 0; border-left-width: 1px; }



/* ===== UI Slider ===== */

.ui-slider { position: relative; text-align: left; }
.ui-slider-handle { position: absolute; z-index: 2; width: 13px; height: 18px; cursor: default; background: url(../img/elements/interface/slider_handle.png) no-repeat; border: none; cursor: pointer; }
.ui-slider-handle:hover { background-position: 0 -18px; }
.ui-slider-handle:active { background-position: 0 -36px; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; height: 6px; font-size: 11px; display: block; border: 1px solid #d05b48; 
	-moz-border-radius: 6px; 
	-webkit-border-radius: 6px; 
	border-radius: 6px; 
	box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset;
	-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset;
	-moz-box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset;
	background: #f38471; 
	background: url(../img/elements/interface/progress_overlay.png) repeat-x, -moz-linear-gradient(top,  #f38471 0%, #ea6853 100%);
	background: url(../img/elements/interface/progress_overlay.png) repeat-x, -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f38471), color-stop(100%,#ea6853));
	background: url(../img/elements/interface/progress_overlay.png) repeat-x, -webkit-linear-gradient(top,  #f38471 0%,#ea6853 100%);
	background: url(../img/elements/interface/progress_overlay.png) repeat-x, -o-linear-gradient(top,  #f38471 0%,#ea6853 100%);
	background: url(../img/elements/interface/progress_overlay.png) repeat-x, -ms-linear-gradient(top,  #f38471 0%,#ea6853 100%);
	background: url(../img/elements/interface/progress_overlay.png) repeat-x, linear-gradient(top,  #f38471 0%,#ea6853 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f38471', endColorstr='#ea6853',GradientType=0 ); 
}
.ui-slider-horizontal { 
	height: 4px;
	background: #F8F8F8;
	border: 1px solid #E7E7E7;
	box-shadow: 0 1px 0 white, 0 1px 0 #EEE inset;
	-webkit-box-shadow: 0 1px 0 white, 0 1px 0 #EEE inset;
	-moz-box-shadow: 0 1px 0 white, 0 1px 0 #eeeeee inset;
	margin: 11px 0;
	-moz-border-radius: 6px;
	-webkit-border-radius: 6px;
	-khtml-border-radius: 6px;
	border-radius: 6px;
}
.ui-slider-horizontal .ui-slider-handle { top: -7px; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: -1px; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { height: 100px; width: 4px; background: #eee; box-shadow: 0 1px 0 white, 0 1px 0 #E5E5E5 inset; -webkit-box-shadow: 0 1px 0 white, 0 1px 0 #E5E5E5 inset; -moz-box-shadow: 0 1px 0 white, 0 1px 0 #E5E5E5 inset; border: 1px solid #d5d5d5; -moz-border-radius: 6px; -webkit-border-radius: 6px; -khtml-border-radius: 6px; border-radius: 6px;  }
.ui-slider-vertical .ui-slider-handle { left: -6px; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: -1px; width: 4px; 
	background: #9bcff5; 
	background: -moz-linear-gradient(top,  #9bcff5 0%, #84c4f3 100%); 
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9bcff5), color-stop(100%,#84c4f3)); 
	background: -webkit-linear-gradient(top,  #9bcff5 0%,#84c4f3 100%); 
	background: -o-linear-gradient(top,  #9bcff5 0%,#84c4f3 100%); 
	background: -ms-linear-gradient(top,  #9bcff5 0%,#84c4f3 100%); 
	background: linear-gradient(top,  #9bcff5 0%,#84c4f3 100%); 
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9bcff5', endColorstr='#84c4f3',GradientType=0 ); 
}
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }
#eq span { height: 120px; float: left; margin-right: 30px; display: block; }
.slider-tip { opacity:1; bottom:120%; margin-left: -1.36em; }



/* ===== UI spinner ===== */

.ui-spinner { position: relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
.ui-spinner-input { border: none; background: none; color: inherit; padding: 0; vertical-align: middle; margin-right: 18px; }
.ui-spinner-button { width: 17px; height: 14px; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
.ui-spinner a.ui-spinner-button { cursor: pointer; border-right: 1px solid #d5d5d5; }
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; }
.ui-spinner-up { top: 0; background: url(../img/elements/forms/spinner_top.png) no-repeat; border-top: 1px solid #d5d5d5; }
.ui-spinner-down { bottom: 0; background: url(../img/elements/forms/spinner_bottom.png) no-repeat; border-bottom: 1px solid #d5d5d5; }
.ui-spinner .ui-icon-triangle-1-s { height: 14px; }



/* ===== UI autocomplete ===== */

.ui-autocomplete { position: absolute; display: none; padding: 0; z-index: 100!important; border: 1px solid #d5d5d5; border-top: none; max-height: 164px; overflow-y: auto; overflow-x: hidden; }	
* html .ui-autocomplete { width: 1px; }
.ui-menu { display: block; float: left; }
.ui-menu .ui-menu-item { zoom: 1; float: left; clear: left; width: 100%; border-top: 1px solid #eeeeee; background: #fff; }
.ui-menu .ui-menu-item:first-child { border-top: 0; }
.ui-menu .ui-menu-item a { text-decoration:none; display: block; padding: 8px 10px; color: #5f5f5f; zoom: 1; font-size: 11px; cursor: pointer; }
.ui-menu .ui-menu-item a:hover, .ui-menu .ui-state-focus { background: #fcfcfc; }
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }



/* Component containers
----------------------------------*/
.ui-widget { font-family: Arial,sans-serif; font-size: 11px; }
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial,sans-serif; font-size: 11px; }
.ui-widget-content { color: #333333; }
.ui-widget-content a { color: #333333; }
.ui-widget-header a { color: #ffffff; }


.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #2e2e2e; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #2e2e2e; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); }




/* ===== UI Dialog ===== */

.ui-dialog { position: absolute; width: auto; border: 3px solid #676767; }
.ui-dialog input[type=text] { width: 96%!important; margin: 12px 0 10px 0; }
.ui-dialog form { text-align: center; }
.ui-dialog .icon { padding: 1px 6px 0 0; float: left; }
.ui-dialog p { padding: 0!important; }
.ui-dialog .ui-dialog-titlebar { position: relative; background: #efefef;
	font-size: 14px;
	font-weight: 600;
	font-family: 'Open Sans', sans-serif;
	background: -moz-linear-gradient(top,  #fafafa 0%, #efefef 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fafafa), color-stop(100%,#efefef));
	background: -webkit-linear-gradient(top,  #fafafa 0%,#efefef 100%);
	background: -o-linear-gradient(top,  #fafafa 0%,#efefef 100%);
	background: -ms-linear-gradient(top,  #fafafa 0%,#efefef 100%);
	background: linear-gradient(top,  #fafafa 0%,#efefef 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#efefef',GradientType=0 );}
.ui-dialog .ui-dialog-title { float: left; height: 38px; font-size: 16px; padding: 0 12px 0 12px; line-height: 38px; } 
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: 10px; top: 12px; width: 16px; height: 16px; background: url(../img/elements/interface/dialog_close.png) no-repeat; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; opacity: 0.6; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus {  }
.ui-dialog .ui-dialog-content { position: relative; overflow: auto; zoom: 1; padding: 14px; background: #FAFAFA; border-bottom: 1px solid #D5D5D5; border-top: 1px solid #D5D5D5; }
.ui-dialog .ui-dialog-buttonpane { padding: 0 12px; font-size: 11px; background: #f5f5f5; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { text-align: center; margin: 0 2px; }
.ui-dialog .ui-dialog-buttonpane button { outline: 0; font-size: 11px; font-weight: bold; border: 1px solid #3581c1; color: #fff; padding: 8px 12px; cursor: pointer; font-family: Arial, Helvetica, sans-serif; margin: 10px 0; 
	background: #4590d2;
	background: -moz-linear-gradient(top,  #5faede 0%, #4590d2 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5faede), color-stop(100%,#4590d2));
	background: -webkit-linear-gradient(top,  #5faede 0%,#4590d2 100%);
	background: -o-linear-gradient(top,  #5faede 0%,#4590d2 100%);
	background: -ms-linear-gradient(top,  #5faede 0%,#4590d2 100%);
	background: linear-gradient(top,  #5faede 0%,#4590d2 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5faede', endColorstr='#4590d2',GradientType=0 );
}
.ui-dialog .ui-dialog-buttonpane button:active { background: #519dd7; box-shadow: 0 0 2px #707070 inset, 0 1px 0 #fff; -webkit-box-shadow: 0 0 2px #707070 inset, 0 1px 0 #fff; -moz-box-shadow: 0 0 2px #707070 inset, 0 1px 0 #fff; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 5px; bottom: 5px; opacity: 0.3; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }



<|start_filename|>piflow-web/src/main/resources/static/my_js/template/flowGroupTemplateList.js<|end_filename|>
var flowGroupTemplateTable;

function initDatatableFlowGroupTemplatePage(testTableId, url) {
    flowGroupTemplateTable = $('#' + testTableId).DataTable({
        "pagingType": "full_numbers",//Set the mode of the paging control
        "searching": true,//Query the query box for datatales
        "aLengthMenu": [10, 20, 50, 100],//Set one page to display 10 records
        "bAutoWidth": true,
        "bLengthChange": true,//A drop-down list of how many records are displayed on a page of a blocked table
        "ordering": false, // Prohibit sorting
        "oLanguage": {
            "sSearch": "<span>Filter records:</span> _INPUT_",
            "sLengthMenu": "<span>Show entries:</span> _MENU_",
            "oPaginate": {"sFirst": "First", "sLast": "Last", "sNext": ">", "sPrevious": "<"}
        },
        "processing": true, //Open wait effect when data is loaded
        "serverSide": true,//Open background paging
        "ajax": {
            "url": url,
            "data": function (d) {
                var level1 = $('#level1').val();
                //Add additional parameters to the server
                d.extra_search = d.search.value;
            },
            "dataSrc": responseHandlerTemplate
        },
        "columns": [
            {"mDataProp": "templateName"},
            {"mDataProp": "createTime"},
            {"mDataProp": "actions"}
        ]

    });
}

//Results returned in the background
function responseHandlerTemplate(res) {
    var resPageData = res.pageData;
    var pageData = []
    if (resPageData && resPageData.length > 0) {
        for (var i = 0; i < resPageData.length; i++) {
            var data1 = {
                "templateName": "",
                "createTime": "",
                "actions": ""
            }
            if (resPageData[i]) {
                var actionsHtmlStr = '<div style="width: 100%; text-align: center" >' +
                    '<a class="btn" ' +
                    'href="javascript:void(0);" ' +
                    'onclick="javascript:downloadFlowGroupTemplate(\'' + resPageData[i].id + '\');" ' +
                    'title="download template">' +
                    '<i class="icon-download icon-white"></i>' +
                    '</a>' +
                    '<a class="btn" href="javascript:void(0);" ' +
                    'onclick="javascript:deleteFlowGroupTemPlate(\'' + resPageData[i].id + '\',\'' + resPageData[i].name + '\'); "' +
                    'title="delete template" > ' +
                    '<i class="icon-trash icon-white"></i>' +
                    '</a>' +
                    '</div>';
                if (resPageData[i].name) {
                    data1.templateName = resPageData[i].name;
                }
                if (resPageData[i].crtDttm) {
                    data1.createTime = resPageData[i].crtDttm;
                }
                if (actionsHtmlStr) {
                    data1.actions = actionsHtmlStr;
                }
            }
            pageData.push(data1);
        }
    }
    return pageData;
}


function initLayerTableFlowGroupTemplatePage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({
            elem: '#' + testTableId
            , url: url
            , cols: [[
                {field: 'name', title: 'TemplateName', sort: true},
                {field: 'crtDttm', title: 'CreateTime', sort: true},
                {
                    field: 'right', title: 'Actions', sort: true, height: 100, templet: function (data) {
                        return responseHandlerFlowGroupTemplate(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });
}

function searchMonitor(layui_table, layui_table_id, searchInputId) {
    //Perform overload
    layui_table.reload(layui_table_id, {
        page: {
            curr: 1 //Start again on page 1
        }
        , where: {param: $('#' + searchInputId).val()}
    }, 'data');
}

//Results returned in the background
function responseHandlerFlowGroupTemplate(data) {
    if (!data) {
        return "";
    }
    var downloadHtmlStr = '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:downloadFlowGroupTemplate(\'' + data.id + '\');" ' +
        'title="download template">' +
        '<i class="icon-download icon-white"></i>' +
        '</a>';

    var delHtmlStr = '<a class="btn" href="javascript:void(0);" ' +
        'onclick="javascript:deleteFlowGroupTemPlate(\'' + data.id + '\',\'' + data.name + '\'); "' +
        'title="delete template" > ' +
        '<i class="icon-trash icon-white"></i>' +
        '</a>';

    return '<div style="width: 100%; text-align: center">' + downloadHtmlStr + delHtmlStr + '</div>';
}

function deleteFlowGroupTemPlate(id, name) {
    layer.confirm("Are you sure to delete '" + name + "' ?", {
        btn: ['confirm', 'cancel'] //button
        , title: 'Confirmation prompt'
    }, function () {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/flowTemplate/deleteFlowTemplate",//This is the name of the file where I receive data in the background.
            data: {id: id},
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                return;
            },
            success: function (data) {//Operation after request successful
                if (data > 0) {
                    layer.msg('Delete Success', {icon: 1, shade: 0, time: 2000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg('Delete failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    }, function () {
    });
}

function initAll(url) {
    window.location.href = url;
}

function listUploadFlowGroupTemplateBtn() {
    document.getElementById("flowTemplateFile").click();
}

function listUploadFlowGroupTemplate() {
    if (!listFileTypeCheck()) {
        return false;
    }
    var formData = new FormData($('#uploadForm')[0]);
    ajaxRequest({
        type: 'post',
        url: "/flowTemplate/uploadXmlFile",
        data: formData,
        cache: false,
        processData: false,
        contentType: false,
    }).success(function (data) {
        var dataMap = JSON.parse(data);
        if (200 === dataMap.code) {
            layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                location.reload();
            });
        } else {
            layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
        }
    }).error(function () {
        layer.msg("Upload failure", {icon: 2, shade: 0, time: 2000});
    });
}

function listFileTypeCheck() {
    var obj = document.getElementById('flowTemplateFile');
    if (obj.value == null || obj.value == '') {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    var length = obj.value.length;
    var charindex = obj.value.lastIndexOf(".");
    var ExtentName = obj.value.substring(charindex, charindex + 4);
    if (!(ExtentName == ".xml")) {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    return true;
}

function downloadFlowGroupTemplate(id) {
    window.location.href = "/piflow-web/flowTemplate/templateDownload?flowTemplateId=" + id;
}



<|start_filename|>piflow-web/src/main/java/cn/cnic/base/utils/CheckFiledUtils.java<|end_filename|>
package cn.cnic.base.utils;

import org.apache.commons.lang3.StringUtils;


import java.lang.reflect.Field;
import java.util.Arrays;

public class CheckFiledUtils {

    /**
     * Determine whether the attribute value in the object has a null value
     *
     * @param object
     * @return
     */
    public static boolean checkObjAnyFieldsIsNull(Object object) {
        if (null != object) {
            try {
                for (Field f : object.getClass().getDeclaredFields()) {
                    f.setAccessible(true);
                    if (f.get(object) == null || StringUtils.isBlank(f.get(object).toString())) {
                        return true;
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            return true;
        }
        return false;
    }

    /**
     * Determine if the specified attribute value in the object is null
     *
     * @param object
     * @return
     */
    public static boolean checkObjSpecifiedFieldsIsNull(Object object, String[] arrStr) {
        if (null != object) {
            try {
                if (null != arrStr && arrStr.length > 0) {
                    for (Field f : object.getClass().getDeclaredFields()) {
                        f.setAccessible(true);
                        String name = f.getName();
                        if (Arrays.asList(arrStr).contains(name)) {
                            if (f.get(object) == null || StringUtils.isBlank(f.get(object).toString())) {
                                return true;
                            }
                        }
                    }
                } else {
                    for (Field f : object.getClass().getDeclaredFields()) {
                        f.setAccessible(true);
                        if (f.get(object) == null || StringUtils.isBlank(f.get(object).toString())) {
                            return true;
                        }
                    }
                }

            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            return true;
        }
        return false;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/sparkJar/service/ISparkJarService.java<|end_filename|>
package cn.cnic.component.sparkJar.service;


import org.springframework.web.multipart.MultipartFile;

public interface ISparkJarService {

    /**
     * Upload spark jar file and save
     *
     * @param username
     * @param file
     * @return
     */
    public String uploadSparkJarFile(String username, MultipartFile file);

    /**
     * mount spark jar
     *
     * @param username
     * @param id
     * @return
     */
    public String mountSparkJar(String username, Boolean isAdmin, String id);

    /**
     * unmount spark jar
     *
     * @param username
     * @param id
     * @return
     */
    public String unmountSparkJar(String username, Boolean isAdmin, String id);

    /**
     * spark jar list page
     *
     * @param username username
     * @param isAdmin  is admin
     * @param page     Number of pages
     * @param limit    Number each page
     * @param param    Search content
     * @return json
     */
    public String sparkJarListPage(String username, Boolean isAdmin, Integer page, Integer limit, String param);

    /**
     * del spark jar
     *
     * @param username username
     * @param id       id
     * @return json
     */
    public String delSparkJar(String username, Boolean isAdmin, String id);


}


<|start_filename|>piflow-web/src/main/resources/static/js/jquery.validate.1.13.1/jquery.validate.ext.js<|end_filename|>
/*!
 * -------------------------------------------
 * Alex
 * 2014-03-27 添加对正则验证的处理,支持自定义错误信息
 *　支持　'\w{10}、^\w{10}$gi、\w{10}$gi
 * -------------------------------------------
 */
$.extend($.validator, {

	normalizeRules : function( rules, element ) {
			// handle dependency check
			$.each(rules, function( prop, val ) {
				// ignore rule when param is explicitly false, eg. required:false
				if ( val === false ) {
					delete rules[prop];
					return;
				}
				if ( val.param || val.depends ) {
					var keepRule = true;
					switch (typeof val.depends) {
					case "string":
						keepRule = !!$(val.depends, element.form).length;
						break;
					case "function":
						keepRule = val.depends.call(element, element);
						break;
					}
					if ( keepRule ) {
						rules[prop] = val.param !== undefined ? val.param : true;
					} else {
						delete rules[prop];
					}
				}
			});
	
			// evaluate parameters
			$.each(rules, function( rule, parameter ) {
				rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter;
			});
	
			// clean number parameters
			$.each(['minlength', 'maxlength'], function() {
				if ( rules[this] ) {
					rules[this] = Number(rules[this]);
				}
			});
			$.each(['rangelength', 'range'], function() {
				var parts;
				if ( rules[this] ) {
					if ( $.isArray(rules[this]) ) {
						rules[this] = [Number(rules[this][0]), Number(rules[this][1])];
					} else if ( typeof rules[this] === "string" ) {
						parts = rules[this].split(/[\s,]+/);
						rules[this] = [Number(parts[0]), Number(parts[1])];
					}
				}
			});
			//2014-03-27 添加对正则验证的处理,支持自定义错误信息
			$.each(['regexHtml'], function() {
				if ( rules[this]) {
					if(!/^\{'.+','.+'\}$/.test(rules[this])){
						throw new Error("regex参数有错!(例如:\"{'\w{10}或^\w{10}$gi','必须是10位的有效字符!'}\")");
					}
					var arrt = /^\{'(.+)','(.+)'\}$/gi.exec(rules[this]);
					rules[this] = [arrt[1],arrt[2]];
				}
			});
			
			if ( $.validator.autoCreateRanges ) {
				// auto-create ranges
				if ( rules.min && rules.max ) {
					rules.range = [rules.min, rules.max];
					delete rules.min;
					delete rules.max;
				}
				if ( rules.minlength && rules.maxlength ) {
					rules.rangelength = [rules.minlength, rules.maxlength];
					delete rules.minlength;
					delete rules.maxlength;
				}
			}
	
			return rules;
		}

});






<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/stop/StopsHubVo.java<|end_filename|>
package cn.cnic.third.vo.stop;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

@Getter
@Setter
public class StopsHubVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String mountId;
    private List<ThirdStopsComponentVo> stops;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/flowGroup/ThirdFlowStopInfoOutResponse.java<|end_filename|>
package cn.cnic.third.vo.flowGroup;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter
public class ThirdFlowStopInfoOutResponse implements Serializable {
    
    private static final long serialVersionUID = 1L;

    private ThirdFlowStopInfoResponse stop;
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/controller/requestVo/UpdatestopsComponentIsShow.java<|end_filename|>
package cn.cnic.controller.requestVo;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * Stop component table
 */
@Getter
@Setter
@ApiModel(description = "Update stops is show request data")
public class UpdatestopsComponentIsShow implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "bundle", required = true)
    private String[] bundle;

    @ApiModelProperty(value = "stopsGroups", required = true)
    private String[] stopsGroups;

    @ApiModelProperty(value = "isShow", required = true)
    private Boolean isShow = true;
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/service/IStopGroupService.java<|end_filename|>
package cn.cnic.component.stopsComponent.service;

import java.util.List;

import cn.cnic.component.stopsComponent.vo.StopGroupVo;

public interface IStopGroupService {

    public List<StopGroupVo> getStopGroupAll();

    /**
     * Call getAllStops and Group to manage, and save the stop attribute information
     */
    public void updateGroupAndStopsListByServer(String username);
    

    /**
     * stopsComponentList
     * 
     * @param username
     * @param isAdmin
     */
    public String stopsComponentList(String username, boolean isAdmin);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/flow/ThirdStopVo.java<|end_filename|>
package cn.cnic.third.vo.flow;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ThirdStopVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String uuid;
    private String name;
    private String bundle;
    private Map<String, Object> properties = new HashMap<String, Object>();

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBundle() {
        return bundle;
    }

    public void setBundle(String bundle) {
        this.bundle = bundle;
    }

    public Map<String, Object> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, Object> properties) {
        this.properties = properties;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/service/impl/CodeSnippetServiceImpl.java<|end_filename|>
package cn.cnic.component.livy.service.impl;

import cn.cnic.base.utils.ReturnMapUtils;
import cn.cnic.component.livy.entity.CodeSnippet;
import cn.cnic.component.livy.entity.NoteBook;
import cn.cnic.component.livy.mapper.CodeSnippetMapper;
import cn.cnic.component.livy.mapper.NoteBookMapper;
import cn.cnic.component.livy.service.ICodeSnippetService;
import cn.cnic.component.livy.util.CodeSnippetUtils;
import cn.cnic.controller.requestVo.CodeSnippetVoRequestAdd;
import cn.cnic.controller.requestVo.CodeSnippetVoRequestUpdate;
import cn.cnic.third.livy.service.ILivy;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class CodeSnippetServiceImpl implements ICodeSnippetService {

    @Autowired
    private NoteBookMapper noteBookMapper;
    
    @Autowired
    private CodeSnippetMapper codeSnippetMapper;

    @Autowired
    private ILivy livyImpl;

    @Override
    public String addCodeSnippet(String username, CodeSnippetVoRequestAdd codeSnippetVo) {
        if (StringUtils.isBlank(username)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Illegal users");
        }
        if (null == codeSnippetVo) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("param name is empty");
        }
        String noteBookId = codeSnippetVo.getNoteBookId();
        if (StringUtils.isBlank(username)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("noteBookId is null");
        }
        NoteBook noteBook = noteBookMapper.getNoteBookById(false, username, noteBookId);
        if (null == noteBook) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("noteBookId data is null");
        }
        CodeSnippet codeSnippet = new CodeSnippet();
        BeanUtils.copyProperties(codeSnippetVo, codeSnippet);
        codeSnippet = CodeSnippetUtils.setCodeSnippetBasicInformation(codeSnippet, true, username);
        codeSnippet.setNoteBook(noteBook);
        int affectedRows = codeSnippetMapper.addCodeSnippet(codeSnippet);
        if (affectedRows > 0) {
            Map<String, Object> rtnMap = ReturnMapUtils.setSucceededMsg("Save codeSnippet succeeded.");
            return ReturnMapUtils.appendValuesToJson(rtnMap, "codeSnippetId", codeSnippet.getId());
        }
        return ReturnMapUtils.setFailedMsgRtnJsonStr("Save noteBook failed");
    }

    @Override
    public String updateCodeSnippet(String username, CodeSnippetVoRequestUpdate codeSnippetVo) {
        if (StringUtils.isBlank(username)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Illegal users");
        }
        if (null == codeSnippetVo) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("param name is empty");
        }
        if (StringUtils.isBlank(codeSnippetVo.getId())) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("param id is empty");
        }
        CodeSnippet codeSnippet = codeSnippetMapper.getCodeSnippetById(codeSnippetVo.getId());
        if (null == codeSnippet) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Update failed, data is null");
        }
        BeanUtils.copyProperties(codeSnippetVo, codeSnippet);
        int affectedRows = codeSnippetMapper.updateCodeSnippet(codeSnippet);
        if (affectedRows > 0) {
            return ReturnMapUtils.setSucceededMsgRtnJsonStr("Update noteBook succeeded.");
        }
        return ReturnMapUtils.setFailedMsgRtnJsonStr("Update noteBook failed");
    }

    @Override
    public String delCodeSnippet(String username, boolean isAdmin, String codeSnippetId) {
        if (StringUtils.isBlank(username)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Illegal users");
        }
        if (StringUtils.isBlank(codeSnippetId)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("codeSnippetId is empty");
        }
        int affectedRows = codeSnippetMapper.delCodeSnippetById(isAdmin, username, codeSnippetId);
        if (affectedRows > 0) {
            return ReturnMapUtils.setSucceededMsgRtnJsonStr("Del noteBook succeeded.");
        }
        return ReturnMapUtils.setFailedMsgRtnJsonStr("Del noteBook failed");
    }

    @Override
    public String getCodeSnippetList(String noteBookId) {
        if (StringUtils.isBlank(noteBookId)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("noteBookId is empty");
        }
        List<CodeSnippet> codeSnippetList = codeSnippetMapper.getCodeSnippetListByNoteBookId(noteBookId);
        if (null == codeSnippetList) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("No data");
        }
        return ReturnMapUtils.setSucceededCustomParamRtnJsonStr("codeSnippetList", codeSnippetList);
    }

    @Override
    public String runCodeSnippet(String username, String codeSnippetId) {
        CodeSnippet codeSnippet = codeSnippetMapper.getCodeSnippetById(codeSnippetId);
        if (null == codeSnippet) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("No data");
        }
        if (null == codeSnippet.getNoteBook()) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Data Error");
        }
        String sessionsId = codeSnippet.getNoteBook().getSessionsId();
        String codeContent = codeSnippet.getCodeContent();
        Map<String, Object> rtnMap = livyImpl.runStatements(sessionsId, codeContent);
        if (null == rtnMap || (int)rtnMap.get("code") != 200) {
        	return ReturnMapUtils.mapToJson(rtnMap);
        }
        String statementsId = rtnMap.get("statementsId").toString();
        codeSnippet.setExecuteId(statementsId);
        codeSnippet.setLastUpdateDttm(new Date());
        codeSnippet.setLastUpdateUser(username);
     	int affectedRows = codeSnippetMapper.updateCodeSnippet(codeSnippet);
       	if (affectedRows > 0) {
    		return ReturnMapUtils.mapToJson(rtnMap);
    	}
        return ReturnMapUtils.setFailedMsgRtnJsonStr("Interface call succeeded, save Failed.");
    }

    @Override
    public String getStatementsResult(String codeSnippetId) {
        if (StringUtils.isBlank(codeSnippetId)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("codeSnippetId is null ");
        }
        CodeSnippet codeSnippet = codeSnippetMapper.getCodeSnippetById(codeSnippetId);
        if (null == codeSnippet) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("No data");
        }
        NoteBook noteBook = codeSnippet.getNoteBook();
        if (null == noteBook) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Data error, noteBook is null");
        }
        String sessionsId = noteBook.getSessionsId();
        if (StringUtils.isBlank(sessionsId)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Data error, sessionsId is null");
        }
        String executeId = codeSnippet.getExecuteId();
        if (StringUtils.isBlank(executeId)) {
            return ReturnMapUtils.setFailedMsgRtnJsonStr("Data error, not execute");
        }
        Map<String, Object> rtnMap = livyImpl.getStatementsResult(noteBook.getSessionsId(), executeId);
        return ReturnMapUtils.mapToJson(rtnMap);
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/system/service/ISysInitRecordsService.java<|end_filename|>
package cn.cnic.component.system.service;

public interface ISysInitRecordsService {

    public boolean isInBootPage();

    public String initComponents(String currentUser);

    public String threadMonitoring(String currentUser);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/config/jwt/exception/CustomException.java<|end_filename|>
package cn.cnic.base.config.jwt.exception;

import cn.cnic.base.config.jwt.common.ResultJson;
import lombok.Getter;


@Getter
@SuppressWarnings("rawtypes")
public class CustomException extends RuntimeException{

    private static final long serialVersionUID = 1L;
    
    private ResultJson resultJson;

    public CustomException(ResultJson resultJson) {
        this.resultJson = resultJson;
    }
}


<|start_filename|>piflow-web/src/main/resources/static/my_js/process/initProcessGraph.js<|end_filename|>
// Extends EditorUi to update I/O action states based on availability of backend
var graphGlobal = null;
var thisEditor = null;
var fullScreen = $('#fullScreen');
var drawingBoardType = "PROCESS"
var index = true
var nodeArr, xmlDate, parentsId, processType, processGroupId, parentProcessId, pID, appId, processState,
    getCheckpointParam;


function initProcessCrumbs(parentAccessPath) {
    if (parentAccessPath) {
        switch (parentAccessPath) {
            case "flow":
                $("#web_processList_navigation").hide();
                $("#web_flowList_navigation").show();
                $("#grapheditor_home_navigation").show();
                break;
            case "flowProcess":
                $("#web_processList_navigation").hide();
                $("#web_groupTypeProcessList_navigation").show();
                break;
            case "processGroupList":
                $("#web_processList_navigation").hide();
                $("#web_processGroupList_navigation").show();
                $("#web_getProcessGroupById_navigation").show();
                break;
        }
    }
}

function initProcessDrawingBoardData(loadId, parentAccessPath, backFunc) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/drawingBoardData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            loadId: loadId,
            parentAccessPath: parentAccessPath
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            // window.location.href = (web_baseUrl + "/error/404");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                processId = dataMap.processId;
                processType = dataMap.processType;
                nodeArr = dataMap.nodeArr;
                xmlDate = dataMap.xmlDate;
                processGroupId = dataMap.processGroupId;
                parentsId = dataMap.processGroupId;
                appId = dataMap.appId;
                parentProcessId = dataMap.parentProcessId;
                pID = dataMap.pID;
                processState = dataMap.processState;
                $("#progress").text(dataMap.percentage);
                getCheckpointParam = "'" + (dataMap.pID ? dataMap.pID : "") + "','" + (dataMap.parentProcessId ? dataMap.parentProcessId : "") + "', '" + (dataMap.processId ? dataMap.processId : "") + "'";
            } else {
                //window.location.href = (web_baseUrl + "/error/404");
            }
            if (backFunc && $.isFunction(backFunc)) {
                backFunc(data);
            }
            $('#fullScreen').hide();
        }
    });
}

function initProcessGraph() {
    Format.noEditing(true);
    $("#right-group-wrap")[0].style.display = "block";
    $("#precess-run")[0].style.display = "block";
    EditorUi.prototype.menubarHeight = 48;
    EditorUi.prototype.menubarShow = false;
    EditorUi.prototype.customToobar = true;

    var editorUiInit = EditorUi.prototype.init;
    EditorUi.prototype.init = function () {
        editorUiInit.apply(this, arguments);
        graphGlobal = this.editor.graph;
        thisEditor = this.editor;
        initMonitorIcon();
        this.actions.get('export').setEnabled(false);
        //Monitoring event
        graphGlobal.addListener(mxEvent.CLICK, function (sender, evt) {
            processMxEventClick(evt.properties.cell);
        });
        graphGlobal.addListener(mxEvent.SIZE, function (sender, evt) {
            changIconTranslate();
        });
        if (xmlDate) {
            var xml = mxUtils.parseXml(xmlDate);
            var node = xml.documentElement;
            var dec = new mxCodec(node.ownerDocument);
            dec.decode(node, graphGlobal.getModel());
            eraseRecord()
        }
        graphGlobal.setCellsEditable(false);
        //graphGlobal.setCellsSelectable(false);
        graphGlobal.setConnectable(false);
        graphGlobal.setCellsMovable(false);
    };

    // Adds required resources (disables loading of fallback properties, this can only
    // be used if we know that all keys are defined in the language specific file)
    mxResources.loadDefaultBundle = false;
    var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
        mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);

    // Fixes possible asynchronous requests
    mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
        // Adds bundle text to resources
        mxResources.parse(xhr[0].getText());

        // Configures the default graph theme
        var themes = new Object();
        themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();

        // Main
        new EditorUi(new Editor(urlParams['chrome'] == '0', themes));
    }, function () {
        document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
    });
    ClickSlider();
}

function processMxEventClick(cell) {
    $("#div_process_info_inc_load_id").hide();
    $("#div_process_path_inc_load_id").hide();
    $("#div_process_property_inc_load_id").hide();
    if (index) {
        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        index = false
    }
    if (cell == undefined || cell && cell.style && (cell.style).indexOf("text\;") === 0) {
        //info
        queryProcessInfo(loadId);
    } else if (cell && cell.style && (cell.style).indexOf("image\;") === 0) {
        //stops
        queryProcessStopsProperty(loadId, cell.id);
    } else {
        //path
        queryProcessPathInfo(loadId, cell.id);
    }

}

function queryProcessInfo(processId) {
    $("#div_process_info_inc_load_id").show();
    $("#div_process_info_inc_id").show();
    $("#div_process_path_inc_id").hide();
    $("#div_process_property_inc_id").hide();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/queryProcessData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#process_info_inc_loading').hide();
            $('#process_info_inc_load_fail').show();
            alert("Request Failed");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            $('#process_info_inc_loading').hide();
            if (200 === dataMap.code) {
                var processVo = dataMap.processVo;
                if (!processVo) {
                    $('#process_info_inc_no_data').show();
                } else {
                    //Process Basic Information
                    $("#span_processVo_id").text(processVo.id);
                    $("#span_processVo_name").text(processVo.name);
                    $("#span_processVo_description").text(processVo.description);
                    $("#span_processVo_crtDttmStr").text(processVo.crtDttmStr);
                    //Process Running Information
                    $("#processStartTimeShow").text(processVo.startTimeStr);
                    $("#processStopTimeShow").text(processVo.endTimeStr);
                    var processVo_state_text = (null !== processVo.state) ? processVo.state.stringValue : "INIT";
                    $("#processStateShow").text(processVo_state_text);
                    if (processVo.progress) {
                        $("#processProgressShow").text(processVo.progress + "%");
                    } else {
                        $("#processProgressShow").text("0.00%");
                    }


                    $('#process_info_inc_load_data').show();
                }
            } else {
                $('#process_info_inc_load_fail').show();
                //alert("Load Failed" + dataMap.errorMsg);
            }
            $('#fullScreen').hide();
        }
    });
}

function queryProcessPathInfo(processId, pageId) {
    $("#div_process_path_inc_load_id").show();
    $("#div_process_info_inc_id").hide();
    $("#div_process_path_inc_id").show();
    $("#div_process_property_inc_id").hide();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/queryProcessPathData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processId,
            pageId: pageId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#process_path_inc_loading').hide();
            $('#process_path_inc_load_fail').show();
            alert("Request Failed");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            $('#process_path_inc_loading').hide();
            if (200 === dataMap.code) {
                var processPathVo = dataMap.processPathVo;
                if (!processPathVo) {
                    $('#process_path_inc_no_data').show();
                } else {
                    // Process Path Information
                    $("#span_processPathVo_from").text(processPathVo.from);
                    $("#span_processPathVo_outport").text(processPathVo.outport);
                    $("#span_processPathVo_inport").text(processPathVo.inport);
                    $("#span_processPathVo_to").text(processPathVo.to);

                    if (dataMap.runModeType && dataMap.runModeType.value === 'DEBUG') {
                        $("#div_view_flow_data").html('<input type="button" class="btn btn-primary" onclick="getDebugData(\'' + processPathVo.from + '\',\'' + processPathVo.outport + '\')" value="View Flow Data">');
                    }

                    $('#process_path_inc_load_data').show();
                }
            } else {
                $('#process_path_inc_load_fail').show();
                //alert("Load Failed" + dataMap.errorMsg);
            }
            $('#fullScreen').hide();
        }
    });
}

function queryProcessStopsProperty(processId, pageId) {
    $("#div_process_property_inc_load_id").show();
    $("#div_process_info_inc_id").hide();
    $("#div_process_path_inc_id").hide();
    $("#div_process_property_inc_id").show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/queryProcessStopData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processId,
            pageId: pageId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#process_property_inc_loading').hide();
            $('#process_property_inc_load_fail').show();
            alert("Request Failed");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            $('#process_property_inc_loading').hide();
            $("#div_processStopVo_processStopPropertyVo").html("");
            if (200 === dataMap.code) {
                var processStopVo = dataMap.processStopVo;
                if (!processStopVo) {
                    $('#process_property_inc_no_data').show();
                } else {

                    // Stop Basic Information
                    $("#stopNameShow").text(processStopVo.name);
                    $("#span_processStopVo_description").text(processStopVo.description);
                    $("#span_processStopVo_groups").text(processStopVo.groups);
                    $("#stopsBundleShow").text(processStopVo.bundel);
                    $("#span_processStopVo_owner").text(processStopVo.owner);

                    //Stop Property Information
                    var processStopPropertyVoList = processStopVo.processStopPropertyVoList;
                    if (processStopPropertyVoList) {
                        var processStopPropertyVoListHtml = '<span>';
                        processStopPropertyVoList.forEach(item => {
                            if (item) {
                                var processStopPropertyVo = '<span>' + item.displayName + ':</span><span class="open_action">' + item.customValue + '</span><br>';
                                processStopPropertyVoListHtml += processStopPropertyVo;
                            }
                        });
                        processStopPropertyVoListHtml += '</span>';
                        $("#div_processStopVo_processStopPropertyVo").append(processStopPropertyVoListHtml);
                        $("#div_processStopVo_processStopPropertyVoList").show();
                    }
                    //Stop Running Information
                    $("#stopStartTimeShow").text(processStopVo.startTimeStr);
                    $("#stopStopTimeShow").text(processStopVo.endTimeStr);
                    var processStopVo_state_text = (null !== processStopVo.state) ? processStopVo.state : "INIT";
                    $("#stopStateShow").text(processStopVo_state_text);

                    $('#process_property_inc_load_data').show();
                }
            } else {
                $('#process_property_inc_load_fail').show();
                //alert("Load Failed" + dataMap.errorMsg);
            }
            $('#fullScreen').hide();
        }
    });
}

//Erase drawing board records
function eraseRecord() {
    thisEditor.lastSnapshot = new Date().getTime();
    thisEditor.undoManager.clear();
    thisEditor.ignoredChanges = 0;
    thisEditor.setModified(false);
}

function initMonitorIcon() {

    setTimeout(() => {
        console.log("svg_element")
        var svg_element = document.getElementsByClassName('geDiagramBackdrop geDiagramContainer')[0].getElementsByTagName("svg")[0];
        nodeArr.forEach(item => {
            var img_element_init = document.createElementNS("http://www.w3.org/2000/svg", "image");
            img_element_init.setAttribute("x", 0);
            img_element_init.setAttribute("y", 0);
            img_element_init.setAttribute("width", 20);
            img_element_init.setAttribute("height", 20);
            img_element_init.setAttribute("PiFlow_IMG", "IMG");
            img_element_init.href.baseVal = web_drawingBoard + "/img/Loading.gif";
            img_element_init.setAttribute("id", "stopLoadingShow" + item.pageId);

            var img_element_ok = document.createElementNS("http://www.w3.org/2000/svg", "image");
            img_element_ok.setAttribute("x", 0);
            img_element_ok.setAttribute("y", 0);
            img_element_ok.setAttribute("width", 20);
            img_element_ok.setAttribute("height", 20);
            img_element_ok.setAttribute("PiFlow_IMG", "IMG");
            img_element_ok.href.baseVal = web_drawingBoard + "/img/Ok.png";
            img_element_ok.setAttribute("id", "stopOkShow" + item.pageId);

            var img_element_fail = document.createElementNS("http://www.w3.org/2000/svg", "image");
            img_element_fail.setAttribute("x", 0);
            img_element_fail.setAttribute("y", 0);
            img_element_fail.setAttribute("width", 20);
            img_element_fail.setAttribute("height", 20);
            img_element_fail.setAttribute("PiFlow_IMG", "IMG");
            img_element_fail.href.baseVal = web_drawingBoard + "/img/Fail.png";
            img_element_fail.setAttribute("id", "stopFailShow" + item.pageId);
            img_element_init.style.display = "none";
            img_element_fail.style.display = "none";
            img_element_ok.style.display = "none";
            if (item.state) {
                if (item.state !== "INIT") {
                    //stopImgChange.attr('opacity', 1);
                    if (item.state && (item.state === "STARTED")) {
                        img_element_init.style.display = "block";
                        img_element_fail.style.display = "none";
                        img_element_ok.style.display = "none";
                    } else if (item.state && item.state === "COMPLETED") {
                        img_element_init.style.display = "none";
                        img_element_fail.style.display = "none";
                        img_element_ok.style.display = "block";
                    } else if (item.state && item.state === "FAILED") {
                        img_element_init.style.display = "none";
                        img_element_fail.style.display = "block";
                        img_element_ok.style.display = "none";
                    } else if (item.state && item.state === "KILLED") {
                        img_element_init.style.display = "none";
                        img_element_fail.style.display = "block";
                        img_element_ok.style.display = "none";
                    }
                }
            }

            if (svg_element && img_element_init && img_element_ok && img_element_fail) {
                var g_element = document.createElementNS("http://www.w3.org/2000/svg", "g");
                g_element.appendChild(img_element_init);
                g_element.appendChild(img_element_ok);
                g_element.appendChild(img_element_fail);
                svg_element.append(g_element);
            }
        });
        changIconTranslate();
    }, 300)
}

function changIconTranslate() {
    var iconPositionElementArr = document.querySelectorAll("div[style='display: inline-block; font-size: 1px; font-family: PiFlow; color: #FFFFFF; line-height: 1.2; pointer-events: all; white-space: nowrap; ']");
    if (iconPositionElementArr && iconPositionElementArr.length > 0) {
        var iconPositionArr = {};
        iconPositionElementArr.forEach(item => {
            var x_y_div = item.parentElement.parentElement.style;
            var x_Position = x_y_div['margin-left'].replace("px", "");
            var y_Position = x_y_div['padding-top'].replace("px", "");
            iconPositionArr['stopLoadingShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopFailShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopOkShow' + item.textContent] = {x: x_Position, y: y_Position};
        });
        var imgsArr = document.querySelectorAll("image[PiFlow_IMG='IMG']");
        imgsArr.forEach(item => {
            var iconPosition = iconPositionArr[item.id]
            if (iconPosition) {
                item.setAttribute("transform", "translate(" + iconPosition.x + "," + iconPosition.y + ")");
            }
        });
    }
}

window.onresize = function (e) {
    setTimeout(() => {
        changIconTranslate()
    }, 300);
}

function ClickSlider() {
    $(".triggerSlider").click(function () {
        var flag = ($(".triggerSlider i:first").hasClass("fa fa-angle-right fa-2x"));
        if (flag === false)
            $(".triggerSlider i").removeClass("fa fa-angle-left fa-2x ").toggleClass("fa fa-angle-right fa-2x");
        else
            $(".triggerSlider i").removeClass("fa fa-angle-right fa-2x").toggleClass("fa fa-angle-left fa-2x");

        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        $(this).toggleClass("triggerSlider-open");
        index = !index
    });
}




<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/util/NoteBookUtils.java<|end_filename|>
package cn.cnic.component.livy.util;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.livy.entity.NoteBook;

import java.util.Date;

public class NoteBookUtils {

    public static NoteBook setNoteBookBasicInformation(NoteBook noteBook, boolean isSetId, String username) {
        if (null == noteBook) {
            noteBook = new NoteBook();
        }
        if (isSetId) {
            noteBook.setId(UUIDUtils.getUUID32());
        }
        noteBook.setCrtDttm(new Date());
        noteBook.setCrtUser(username);
        noteBook.setLastUpdateDttm(new Date());
        noteBook.setLastUpdateUser(username);
        noteBook.setVersion(0L);
        return noteBook;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/mapper/CustomizedPropertyMapper.java<|end_filename|>
package cn.cnic.component.flow.mapper;

import cn.cnic.component.flow.entity.CustomizedProperty;
import cn.cnic.component.flow.mapper.provider.CustomizedPropertyMapperProvider;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

@Mapper
public interface CustomizedPropertyMapper {

    /**
     * Insert "list<CustomizedProperty>" Note that the method of spelling "sql" must use "map" to connect the "Param" content to the key value.
     *
     * @param customizedPropertyList (Content: "customizedPropertyList" with a value of "List<CustomizedProperty>")
     * @return
     */
    @InsertProvider(type = CustomizedPropertyMapperProvider.class, method = "addCustomizedPropertyList")
    public int addCustomizedPropertyList(@Param("customizedPropertyList") List<CustomizedProperty> customizedPropertyList);

    @InsertProvider(type = CustomizedPropertyMapperProvider.class, method = "addCustomizedProperty")
    public int addCustomizedProperty(@Param("customizedProperty") CustomizedProperty customizedProperty);

    @Select("select * from flow_stops_customized_property where id = #{id} and enable_flag = 1 ")
    @Results({
            @Result(column = "fk_stops_id", property = "stops", many = @Many(select = "cn.cnic.component.flow.mapper.StopsMapper.getStopsById", fetchType = FetchType.LAZY))
    })
    public CustomizedProperty getCustomizedPropertyById(String id);

    @Select("select * from flow_stops_customized_property where fk_stops_id = #{stopsId} and enable_flag = 1 ")
    public List<CustomizedProperty> getCustomizedPropertyListByStopsId(String stopsId);

    @Select("select * from flow_stops_customized_property where fk_stops_id = #{stopsId} and name = #{name} and enable_flag = 1 ")
    public List<CustomizedProperty> getCustomizedPropertyListByStopsIdAndName(String stopsId, String name);

    @UpdateProvider(type = CustomizedPropertyMapperProvider.class, method = "updateStopsCustomizedProperty")
    public int updateStopsCustomizedProperty(@Param("customizedProperty") CustomizedProperty customizedProperty);

    @UpdateProvider(type = CustomizedPropertyMapperProvider.class, method = "updateEnableFlagByStopId")
    public int updateEnableFlagByStopId(@Param("username") String username, @Param("id") String id);

    @UpdateProvider(type = CustomizedPropertyMapperProvider.class, method = "updateCustomizedPropertyCustomValue")
    public int updateCustomizedPropertyCustomValue(String username, String content, String id);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/vo/ProcessAndProcessGroupVo.java<|end_filename|>
package cn.cnic.component.process.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

@Setter
@Getter
public class ProcessAndProcessGroupVo implements Serializable {

    private static final long serialVersionUID = 1L;
    private String id;
    private Date lastUpdateDttm;
    private Date crtDttm;
    private String appId;
    private String name;
    private String description;
    private Date startTime;
    private Date endTime;
    private String progress;
    private String state;
    private String parentProcessId;
    private String processType;
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/mapper/ProcessStopPropertyMapper.java<|end_filename|>
package cn.cnic.component.process.mapper;

import cn.cnic.component.process.entity.ProcessStopProperty;
import cn.cnic.component.process.mapper.provider.ProcessStopPropertyMapperProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProcessStopPropertyMapper {

    @InsertProvider(type = ProcessStopPropertyMapperProvider.class, method = "addProcessStopProperty")
    public int addProcessStopProperty(ProcessStopProperty processStopProperty);

    @InsertProvider(type = ProcessStopPropertyMapperProvider.class, method = "addProcessStopProperties")
    public int addProcessStopProperties(@Param("processStopPropertyList") List<ProcessStopProperty> processStopPropertyList);

    /**
     * Query processStop attribute based on processStopId
     *
     * @param processStopId
     * @return
     */
    @SelectProvider(type = ProcessStopPropertyMapperProvider.class, method = "getStopPropertyByProcessStopId")
    @Results({
            @Result(column = "custom_value", property = "customValue"),
            @Result(column = "allowable_values", property = "allowableValues"),
            @Result(column = "property_required", property = "required"),
            @Result(column = "property_sensitive", property = "sensitive")
    })
    public ProcessStopProperty getStopPropertyByProcessStopId(String processStopId);

    @UpdateProvider(type = ProcessStopPropertyMapperProvider.class, method = "updateProcessStopProperty")
    public int updateProcessStopProperty(ProcessStopProperty processStopProperty);

    @UpdateProvider(type = ProcessStopPropertyMapperProvider.class, method = "updateEnableFlagByProcessStopId")
    public int updateEnableFlagByProcessStopId(String processStopId, String username);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/domain/TestDataDomain.java<|end_filename|>
package cn.cnic.component.testData.domain;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.testData.entity.TestData;
import cn.cnic.component.testData.entity.TestDataSchema;
import cn.cnic.component.testData.entity.TestDataSchemaValues;
import cn.cnic.component.testData.mapper.TestDataMapper;
import cn.cnic.component.testData.mapper.TestDataSchemaMapper;
import cn.cnic.component.testData.mapper.TestDataSchemaValuesMapper;
import cn.cnic.component.testData.vo.TestDataSchemaVo;
import cn.cnic.component.testData.vo.TestDataVo;

@Component
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
public class TestDataDomain {

    @Autowired
    private TestDataMapper testDataMapper;

    @Autowired
    private TestDataSchemaMapper testDataSchemaMapper;

    @Autowired
    private TestDataSchemaValuesMapper testDataSchemaValuesMapper;

    /**
     * save or update TestData
     * 
     * @param testData
     * @param username
     * @return int
     * @throws Exception
     */
    public int saveOrUpdate(TestData testData, String username) throws Exception {
        if (StringUtils.isBlank(testData.getId())) {
            return addTestData(testData, username);
        }
        return updateTestData(testData, username);
    }
    
    /**
     * save or update TestDataSchemaValues list
     * 
     * @param username
     * @param schemaValuesList
     * @param testData
     * @return
     * @throws Exception
     */
    public int saveOrUpdateTestDataSchemaValuesList(String username, List<TestDataSchemaValues> schemaValuesList, TestData testData) throws Exception {

        if (null == schemaValuesList) {
            return 0;
        }
        int affectedRows = 0;
        for (TestDataSchemaValues testDataSchemaValues : schemaValuesList) {
            if (StringUtils.isBlank(testDataSchemaValues.getId())) {
                affectedRows += addTestDataSchemaValues(username, testDataSchemaValues, testData);
            }
            affectedRows += updateTestDataSchemaValues(username, testDataSchemaValues, testDataSchemaValues.getTestDataSchema(), testData);
        }
        return affectedRows;

    }
    
    /**
     * add TestData
     * 
     * @param testData
     * @param username
     * @return int
     * @throws Exception
     */
    public int addTestData(TestData testData, String username) throws Exception {
        if (null == testData) {
            throw new Exception("testData is null");
        }
        if (StringUtils.isBlank(testData.getId())) {
            testData.setId(UUIDUtils.getUUID32());
        }
        testData.setCrtUser(username);
        testData.setCrtDttm(new Date());
        testData.setLastUpdateUser(username);
        testData.setLastUpdateDttm(new Date());
        int affectedRows = testDataMapper.addTestData(testData);
        if (affectedRows < 0) {
            throw new Exception("save testData failed");
        }
        affectedRows += addSchemaList(testData.getSchemaList(), testData, username);
        return affectedRows;
    }

    /**
     * add TestDataSchema
     * 
     * @param testDataSchema
     * @param username
     * @return int
     * @throws Exception
     */
    public int addTestDataSchema(TestDataSchema testDataSchema, String username) throws Exception {
        if (null == testDataSchema) {
            throw new Exception("testDataSchema is null");
        }
        if (StringUtils.isBlank(testDataSchema.getId())) {
            testDataSchema.setId(UUIDUtils.getUUID32());
        }
        testDataSchema.setCrtUser(username);
        testDataSchema.setCrtDttm(new Date());
        testDataSchema.setLastUpdateUser(username);
        testDataSchema.setLastUpdateDttm(new Date());
        int affectedRows = testDataSchemaMapper.addTestDataSchema(testDataSchema);
        if (affectedRows < 0) {
            throw new Exception("save testData failed");
        }
        //affectedRows += addTestDataSchemaValuesList(username, testDataSchema.getSchemaValuesList(), testDataSchema, testDataSchema.getTestData());
        return affectedRows;
    }

    /**
     * add schemaList
     *
     * @param schemaList
     * @param username
     * @return int
     * @throws Exception
     */
    public int addSchemaList(List<TestDataSchema> schemaList, TestData testData, String username) throws Exception {
        if (null == schemaList || schemaList.size() <= 0) {
            return 0;
        }
        int affectedRows = 0;
        for (TestDataSchema testDataSchema : schemaList) {
        	testDataSchema.setTestData(testData);
        	affectedRows += addTestDataSchema(testDataSchema, username);
        }
        return affectedRows;
    }

    /**
     * add TestDataSchemaValues
     * 
     * @param username
     * @param schemaValuesList
     * @param testData
     * @return
     * @throws Exception
     */
    public int addTestDataSchemaValuesList(String username, List<TestDataSchemaValues> schemaValuesList, TestData testData) throws Exception {
        if (null == schemaValuesList) {
            throw new Exception("testDataSchemaValues is null");
        }
        if (null == testData) {
            throw new Exception("testData is null");
        }
        int affectedRows = 0;
        for (TestDataSchemaValues testDataSchemaValues : schemaValuesList) {
            affectedRows += addTestDataSchemaValues(username, testDataSchemaValues, testData);
        }
        if (affectedRows < 0) {
            throw new Exception("save testData failed");
        }
        return affectedRows;
    }

    /**
     * add TestDataSchemaValues
     * 
     * @param username
     * @param testDataSchemaValues
     * @param testData
     * @return
     * @throws Exception
     */
    public int addTestDataSchemaValues(String username, TestDataSchemaValues testDataSchemaValues, TestData testData) throws Exception {
        if (null == testDataSchemaValues) {
            throw new Exception("testDataSchemaValues is null");
        }
        if (null == testDataSchemaValues.getTestDataSchema()) {
            throw new Exception("testDataSchema is null");
        }
        if (null == testData) {
            throw new Exception("testData is null");
        }
        if (StringUtils.isBlank(testDataSchemaValues.getId())) {
            testDataSchemaValues.setId(UUIDUtils.getUUID32());
        }
        testDataSchemaValues.setCrtUser(username);
        testDataSchemaValues.setCrtDttm(new Date());
        testDataSchemaValues.setLastUpdateUser(username);
        testDataSchemaValues.setLastUpdateDttm(new Date());
        testDataSchemaValues.setTestData(testData);
        int affectedRows = testDataSchemaValuesMapper.addTestDataSchemaValues(testDataSchemaValues);
        if (affectedRows < 0) {
            throw new Exception("save testData failed");
        }
        return affectedRows;
    }

    /**
     * update TestData
     * 
     * @param testData
     * @param username
     * @return int
     * @throws Exception
     */
    public int updateTestData(TestData testData, String username) throws Exception {
        if (null == testData) {
            throw new Exception("testData is null");
        }
        if (StringUtils.isBlank(testData.getId())) {
            throw new Exception("testDataSchema id is null");
        }
        testData.setLastUpdateUser(username);
        testData.setLastUpdateDttm(new Date());
        int affectedRows = testDataMapper.updateTestData(testData);
        List<TestDataSchema> schemaList = testData.getSchemaList();
        if (null != schemaList) {
            for (TestDataSchema testDataSchema : schemaList) {
                testDataSchema.setTestData(testData);
                if (StringUtils.isBlank(testDataSchema.getId())) {
                    affectedRows += addTestDataSchema(testDataSchema, username);
                    continue;
                }
                affectedRows += updateTestDataSchema(testDataSchema, username);
            }
        }
        return affectedRows;
    }

    /**
     * update TestDataSchema
     * 
     * @param testDataSchema
     * @param username
     * @return int
     * @throws Exception
     */
    public int updateTestDataSchema(TestDataSchema testDataSchema, String username) throws Exception {
        if (null == testDataSchema) {
            throw new Exception("testDataSchema is null");
        }
        if (StringUtils.isBlank(testDataSchema.getId())) {
            throw new Exception("testDataSchema id is null");
        }
        testDataSchema.setLastUpdateUser(username);
        testDataSchema.setLastUpdateDttm(new Date());
        int affectedRows = testDataSchemaMapper.updateTestDataSchema(testDataSchema);
        //affectedRows += saveOrUpdateTestDataSchemaValuesList(username, false, testDataSchema.getSchemaValuesList(), testDataSchema.getTestData());
        return affectedRows;

    }

    /**
     * update TestDataSchemaValues
     * 
     * @param username
     * @param testDataSchemaValues
     * @param testDataSchema
     * @param testData
     * @return
     * @throws Exception
     */
    public int updateTestDataSchemaValues(String username, TestDataSchemaValues testDataSchemaValues, TestDataSchema testDataSchema, TestData testData) throws Exception {
        if (null == testDataSchemaValues) {
            throw new Exception("testDataSchemaValues is null");
        }
        if (null == testDataSchema) {
            throw new Exception("testDataSchema is null");
        }
        if (null == testData) {
            throw new Exception("testData is null");
        }
        if (StringUtils.isBlank(testDataSchemaValues.getId())) {
            throw new Exception("testDataSchemaValues id is null");
        }
        testDataSchemaValues.setTestDataSchema(testDataSchema);
        testDataSchemaValues.setTestData(testData);
        testDataSchemaValues.setLastUpdateUser(username);
        testDataSchemaValues.setLastUpdateDttm(new Date());
        testDataSchemaValues.setTestData(testData);
        testDataSchemaValues.setTestDataSchema(testDataSchema);
        return testDataSchemaValuesMapper.updateTestDataSchemaValues(testDataSchemaValues);
    }

    /**
     * delete TestData
     * 
     * @param username
     * @param isAdmin
     * @param testDataId
     * @return int 
     * @throws
     */
    public int delTestData(String username, boolean isAdmin, String testDataId) {
        int affectedRows = testDataSchemaValuesMapper.delTestDataSchemaValuesByTestDataId(isAdmin, username, testDataId);
        affectedRows += testDataSchemaMapper.delTestDataSchemaByTestDataId(isAdmin, username, testDataId);
        affectedRows += testDataMapper.delTestDataById(isAdmin, username, testDataId);
        return affectedRows;
    }

    /**
     * update TestDataSchema
     *
     * @param schemaIdList
     * @param username
     * @return int
     * @throws Exception
     */
    public int delTestDataSchemaList(List<String> schemaIdList, boolean isAdmin, String username) throws Exception {
        if (null == schemaIdList || schemaIdList.size() <=0) {
            throw new Exception("schemaIdList is null");
        }
        if (StringUtils.isBlank(username)) {
            throw new Exception("username is null");
        }
        int affectedRows = 0;
        for (String schemaId : schemaIdList) {
            if (StringUtils.isBlank(schemaId)) {
                throw new Exception("testDataSchema id is null");
            }
            Integer integer = testDataSchemaMapper.delTestDataSchemaById(isAdmin, username, schemaId);
            if (integer > 0){
                affectedRows += testDataSchemaValuesMapper.delTestDataSchemaValuesBySchemaId(isAdmin, username, schemaId);
            }
            affectedRows += integer;
        }
        return affectedRows;
    }
    
    /**
     * getTestDataVoById
     * 
     * @param id
     * @return TestDataVo 
     * @throws
     */
    public TestDataVo getTestDataVoById(String id) {
        return testDataMapper.getTestDataVoById(id);
    }
    
    /**
     * getTestDataById
     * 
     * @param id
     * @return TestDataVo 
     * @throws
     */
    public TestData getTestDataById(String id) {
        return testDataMapper.getTestDataById(id);
    }

    /**
     * getTestDataList
     * @param isAdmin
     * @param username
     * @param param
     * @return List<TestData>
     * @throws
     */
    public List<TestData> getTestDataList(boolean isAdmin, String username, String param) {
        return testDataMapper.getTestDataList(isAdmin, username, param);
    }
    
    /**
     * getTestDataVoList
     * @param isAdmin
     * @param username
     * @param param
     * @return List<TestDataVo>
     * @throws
     */
    public List<TestDataVo> getTestDataVoList(boolean isAdmin, String username, String param) {
        return testDataMapper.getTestDataVoList(isAdmin, username, param);
    }

    /**
     * getTestDataSchemaListByTestDataId
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @param testDataId
     * @return List<TestDataSchema>
     * @throws
     */
    public List<TestDataSchema> getTestDataSchemaListByTestDataIdSearch(boolean isAdmin, String username, String param, String testDataId) {
        return testDataSchemaMapper.getTestDataSchemaListByTestDataIdSearch(isAdmin, username, param, testDataId);
    }
    
    /**
     * getTestDataSchemaVoListByTestDataId
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @param testDataId
     * @return List<TestDataSchemaVo>
     * @throws
     */
    public List<TestDataSchemaVo> getTestDataSchemaVoListByTestDataIdSearch(boolean isAdmin, String username, String param, String testDataId) {
        return testDataSchemaMapper.getTestDataSchemaVoListByTestDataIdSearch(isAdmin, username, param, testDataId);
    }


    /**
     * getTestDataSchemaIdAndNameListByTestDataId
     * 
     * @param testDataId
     * @return List<Map<String,String>> key1=ID key2=FIELD_NAME
     * @throws
     */
    public List<LinkedHashMap<String, Object>> getTestDataSchemaIdAndNameListByTestDataId(String testDataId) {
        return testDataSchemaMapper.getTestDataSchemaIdAndNameListByTestDataId(testDataId);
    }

    /**
     * getTestDataSchemaValuesCustomList
     * 
     * @param isAdmin
     * @param username
     * @param fieldNameList
     * @param testDataId
     * @return List<Map<String,String>> 
     * @throws
     */
    public List<LinkedHashMap<String, Object>> getTestDataSchemaValuesCustomList(boolean isAdmin, String username, String testDataId, List<LinkedHashMap<String, Object>> fieldNameList) {
        if (null == fieldNameList) {
            return null;
        }
        return testDataSchemaValuesMapper.getTestDataSchemaValuesCustomList(isAdmin, username, testDataId, fieldNameList);
    }
    
    /**
     * getTestDataSchemaValuesCustomListId
     * 
     * @param isAdmin
     * @param username
     * @param fieldNameList
     * @param testDataId
     * @return List<Map<String,String>> 
     * @throws
     */
    public List<LinkedHashMap<String, Object>> getTestDataSchemaValuesCustomListId(boolean isAdmin, String username, String testDataId, List<LinkedHashMap<String, Object>> fieldNameList) {
        if (null == fieldNameList) {
            return null;
        }
        return testDataSchemaValuesMapper.getTestDataSchemaValuesCustomListId(isAdmin, username, testDataId, fieldNameList);
    }
    
    
    /**
     * getTestDataSchemaValuesListByTestDataId
     * 
     * @param testDataId
     * @throws
     */
    public List<TestDataSchemaValues> getTestDataSchemaValuesListByTestDataId(String testDataId) {
        if (StringUtils.isBlank(testDataId)) {
            return null;
        }
        return testDataSchemaValuesMapper.getTestDataSchemaValuesListByTestDataId(testDataId);
    }

    /**
     * getTestDataSchemaValuesListBySchemaId
     *
     * @param schemaId
     * @throws
     */
    public List<TestDataSchemaValues> getTestDataSchemaValuesListBySchemaId(String schemaId) {
        if (StringUtils.isBlank(schemaId)) {
            return null;
        }
        return testDataSchemaValuesMapper.getTestDataSchemaValuesListBySchemaId(schemaId);
    }

    public String getTestDataName(String testDataName){
        return testDataMapper.getTestDataName(testDataName);
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/utils/SqlUtils.java<|end_filename|>
package cn.cnic.base.utils;

import cn.cnic.base.BaseHibernateModelUUIDNoCorpAgentId;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.List;

public class SqlUtils {

    /**
     * str(Add a single quote to a string)
     *
     * @param str
     * @return
     */
    public static String addSqlStr(String str) {
        if (StringUtils.isNotBlank(str)) {
            return "'" + str + "' ";
        } else {
            return "'' ";
        }
    }

    /**
     * str(Replace the single quote in the string as a double single quote)
     *
     * @param str
     * @return
     */
    public static String replaceString(String str) {
        if (null != str) {
            str = str.replace("'", "''").replace("\\","\\\\");
        }
        return str;
    }

    /**
     * str(Add a single quote to the string and replace the single quote in the string with a double quote)
     *
     * @param str
     * @return
     */
    public static String addSqlStrAndReplace(String str) {
        if (StringUtils.isNotBlank(str)) {
            return "'" + replaceString(str) + "' ";
        } else {
            return "'' ";
        }
    }

    public static String baseFieldName() {
        return " `id`, `crt_dttm`, `crt_user`, `last_update_dttm`, `last_update_user`, `enable_flag`, `version` ";
    }

    public static String baseFieldValues(BaseHibernateModelUUIDNoCorpAgentId baseInfo) {
        if (null == baseInfo) {
            return " ";
        }
        StringBuffer valueStringBuffer = new StringBuffer();
        String id = StringUtils.isNotBlank(baseInfo.getId()) ? baseInfo.getId() : UUIDUtils.getUUID32();
        String crtUser = StringUtils.isNotBlank(baseInfo.getCrtUser()) ? baseInfo.getCrtUser() : "-1";
        String lastUpdateUser = baseInfo.getLastUpdateUser();
        Boolean enableFlag = baseInfo.getEnableFlag();
        Long version = baseInfo.getVersion();
        Date crtDttm = (null == baseInfo.getCrtDttm()) ? new Date() : baseInfo.getCrtDttm();
        String crtDttmStr = DateUtils.dateTimesToStr(crtDttm);
        Date lastUpdateDttm = (null == baseInfo.getLastUpdateDttm()) ? new Date() : baseInfo.getLastUpdateDttm();
        String lastUpdateDttmStr = DateUtils.dateTimesToStr(null != lastUpdateDttm ? lastUpdateDttm : new Date());


        valueStringBuffer.append(SqlUtils.preventSQLInjection(id) + ",");
        valueStringBuffer.append(SqlUtils.preventSQLInjection(crtDttmStr) + ",");
        valueStringBuffer.append(SqlUtils.preventSQLInjection(crtUser) + ",");
        valueStringBuffer.append(SqlUtils.preventSQLInjection(lastUpdateDttmStr) + ",");
        valueStringBuffer.append(SqlUtils.preventSQLInjection(lastUpdateUser) + ",");
        valueStringBuffer.append(((null != enableFlag && enableFlag) ? 1 : 0) + ",");
        valueStringBuffer.append((null != version ? version : 0L) + " ");
        return valueStringBuffer.toString();
    }

    public static String strArrayToStr(String[] strArray) {
        String str = "";
        if (null != strArray && strArray.length > 0) {
            for (int i = 0; i < strArray.length; i++) {
                if (StringUtils.isNotBlank(strArray[i])) {
                    str += addSqlStrAndReplace(strArray[i]);
                    if (i < strArray.length - 1) {
                        str += ",";
                    }
                }
            }
        }
        return str;
    }

    public static String preventSQLInjection(String str) {
        String sqlStr = "null";
        if (null != str) {
            String replace = str.replace("'", "''").replace("\\","\\\\");
            sqlStr = "'" + replace + "'";
        }
        return sqlStr;
    }
    /**
     * addSymbol
     * 
     * @param str
     * @param symbol
     * @param isbefore
     * @param after
     * @return
     */
    public static String addSymbol(String str, String symbol, boolean isbefore, boolean after) {
        if (null ==str) {
            return "null";
        }
        if (null == symbol) {
            return str;
        }
        String sqlStr = str;
        if (isbefore) {
            sqlStr = (symbol + sqlStr);
        }
        if (isbefore) {
            sqlStr = (sqlStr + symbol);
        }
        return sqlStr;
    }

    public static String strListToStr(List<String> strArray) {
        String str = "";
        if (null != strArray && strArray.size() > 0) {
            for (int i = 0; i < strArray.size(); i++) {
                if (StringUtils.isNotBlank(strArray.get(i))) {
                    String replaceString = replaceString(strArray.get(i));
                    if (null != replaceString) {
                        str += addSqlStr(strArray.get(i));
                    }
                    if (i < strArray.size() - 1) {
                        str += ",";
                    }
                }
            }
        }
        return str;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/dataSource/utils/DataSourceUtils.java<|end_filename|>
package cn.cnic.component.dataSource.utils;

import cn.cnic.component.dataSource.entity.DataSource;
import cn.cnic.component.dataSource.entity.DataSourceProperty;
import cn.cnic.component.dataSource.vo.DataSourcePropertyVo;
import cn.cnic.component.dataSource.vo.DataSourceVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DataSourceUtils {
    /**
     * dataSource Po To Vo
     *
     * @param dataSource
     * @param isToAll
     * @return
     */
    public static DataSourceVo dataSourcePoToVo(DataSource dataSource, boolean isToAll) {
        DataSourceVo dataSourceVo = null;
        if (null != dataSource) {
            dataSourceVo = new DataSourceVo();
            BeanUtils.copyProperties(dataSource, dataSourceVo);
            if (isToAll) {
                List<DataSourcePropertyVo> dataSourcePropertyVoList = dataSourcePropertyListPoToVo(dataSource.getDataSourcePropertyList());
                if (null != dataSourcePropertyVoList) {
                    dataSourceVo.setDataSourcePropertyVoList(dataSourcePropertyVoList);
                }
            }
        }
        return dataSourceVo;
    }

    /**
     * dataSourcePropertyList Po To Vo
     *
     * @param dataSourcePropertyList
     * @return
     */
    public static List<DataSourcePropertyVo> dataSourcePropertyListPoToVo(List<DataSourceProperty> dataSourcePropertyList) {
        List<DataSourcePropertyVo> dataSourcePropertyVoList = null;
        DataSourcePropertyVo dataSourcePropertyVo = null;
        if (null != dataSourcePropertyList && dataSourcePropertyList.size() > 0) {
            dataSourcePropertyVoList = new ArrayList<>();
            for (DataSourceProperty dataSourceProperty : dataSourcePropertyList) {
                dataSourcePropertyVo = new DataSourcePropertyVo();
                BeanUtils.copyProperties(dataSourceProperty, dataSourcePropertyVo);
                dataSourcePropertyVoList.add(dataSourcePropertyVo);
            }
        }
        return dataSourcePropertyVoList;
    }

    /**
     * dataSourceList Po To Vo
     *
     * @param dataSourceList
     * @return
     */
    public static List<DataSourceVo> dataSourceListPoToVo(List<DataSource> dataSourceList, boolean isToAll) {
        List<DataSourceVo> dataSourceVoList = null;
        if (null != dataSourceList && dataSourceList.size() > 0) {
            dataSourceVoList = new ArrayList<>();
            DataSourceVo dataSourceVo = null;
            for (DataSource dataSource : dataSourceList) {
                dataSourceVo = dataSourcePoToVo(dataSource, isToAll);
                if (null != dataSource) {
                    dataSourceVoList.add(dataSourceVo);
                }
            }
        }
        return dataSourceVoList;
    }

    public static Map<String, String> dataSourceToPropertyMap(DataSource dataSource) {
        Map<String, String> dataSourcePropertyMap = new HashMap<>();
        if (null == dataSource) {
            return dataSourcePropertyMap;
        }
        List<DataSourceProperty> dataSourcePropertyList = dataSource.getDataSourcePropertyList();
        if (null != dataSourcePropertyList && dataSourcePropertyList.size() > 0) {
            // Loop "datasource" attribute to map
            for (DataSourceProperty dataSourceProperty : dataSourcePropertyList) {
                // "datasource" attribute name
                String dataSourcePropertyName = dataSourceProperty.getName();
                // Judge empty and lowercase
                if (StringUtils.isNotBlank(dataSourcePropertyName)) {
                    dataSourcePropertyName = dataSourcePropertyName.toLowerCase();
                }
                dataSourcePropertyMap.put(dataSourcePropertyName, dataSourceProperty.getValue());
            }
        }
        return dataSourcePropertyMap;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/mapper/ProcessAndProcessGroupMapper.java<|end_filename|>
package cn.cnic.component.process.mapper;

import cn.cnic.component.process.mapper.provider.ProcessAndProcessGroupMapperProvider;
import cn.cnic.component.process.vo.ProcessAndProcessGroupVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

@Mapper
public interface ProcessAndProcessGroupMapper {

    /**
     * query all TemplateDataSource
     *
     * @return
     */
    @SelectProvider(type = ProcessAndProcessGroupMapperProvider.class, method = "getProcessAndProcessGroupList")
    public List<ProcessAndProcessGroupVo> getProcessAndProcessGroupList(String param);

    @SelectProvider(type = ProcessAndProcessGroupMapperProvider.class, method = "getProcessAndProcessGroupListByUser")
    public List<ProcessAndProcessGroupVo> getProcessAndProcessGroupListByUser(String param, String username);


}


<|start_filename|>piflow-web/src/main/resources/static/my_js/schedule/scheduleList.js<|end_filename|>
function initDatatableSchedulePage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({

            elem: '#' + testTableId
            , url: (web_drawingBoard + url)
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , cols: [[
                {field: 'type', title: 'Type', sort: true},
                {field: 'scheduleRunTemplateName', title: 'Name', sort: true},
                {field: 'cronExpression', title: 'Cron', sort: true},
                {field: 'planStartTimeStr', title: 'PlanStartTime', sort: true},
                {field: 'planEndTimeStr', title: 'PlanEndTime', sort: true},
                {
                    field: 'dataSourceType', title: 'Status', sort: true, templet: function (data) {
                        return data.status.text
                    }
                },
                {
                    field: 'right', title: 'Actions', sort: true, height: 100, templet: function (data) {
                        return responseHandlerSchedule(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });

    function searchMonitor(layui_table, layui_table_id, searchInputId) {
        //Perform overload
        layui_table.reload(layui_table_id, {
            page: {
                curr: 1 //Start again on page 1
            }
            , where: {param: $('#' + searchInputId).val()}
        }, 'data');
    }
}

//Results returned in the background
function responseHandlerSchedule(res) {
    var actionsHtmlStr = "";
    if (res) {
        var actions_btn_1 = '<a class="btn" '
            + 'title="Run this timed task once" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:onceTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-tag icon-white"></i>'
            + '</a>';
        var actions_btn_2 = '<a class="btn" '
            + 'title="Run this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:startScheduleTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-play icon-white"></i>'
            + '</a>';
        var actions_btn_3 = '<a class="btn" '
            + 'title="Stop this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:stopScheduleTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-stop icon-white"></i>'
            + '</a>';
        var actions_btn_4 = '<a class="btn" '
            + 'title="Edit this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:schedulePopup(\'' + res.id + '\',\'update schedule\');"'
            + 'style="margin-right: 2px;">'
            + '<i class="icon-edit icon-white"></i>'
            + '</a>';
        var actions_btn_5 = '<a class="btn" '
            + 'title="Remove this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:delScheduleTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-trash icon-white"></i>'
            + '</a>';
        if (res.status) {
            res.status = res.status.text;
            if ('RUNNING' === res.status) {
                actionsHtmlStr = '<div style="width: 100%; text-align: center" >'
                    + actions_btn_3
                    + actions_btn_4
                    + actions_btn_5
                    + '</div>';
            } else {
                actionsHtmlStr = '<div style="width: 100%; text-align: center" >'
                    + actions_btn_2
                    + actions_btn_3
                    + actions_btn_4
                    + actions_btn_5
                    + '</div>';
            }
        }
    }
    return actionsHtmlStr;
}

function createScheduleTask() {
    if ($("#schedule_cron").val()) {
        layer.msg("Cron cannot be empty");
    }
    if ($("#schedule_class").val()) {
        layer.msg("Flow or FlowGroup cannot be empty");
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/schedule/addSchedule",//This is the name of the file where I receive data in the background.
        data: {
            id: $("#scheduleId").val(),
            type: $("#schedule_type").val(),
            cronExpression: $("#schedule_cron").val(),
            planStartTimeStr: $("#schedule_plan_start_time").val(),
            planEndTimeStr: $("#schedule_plan_end_time").val(),
            scheduleRunTemplateId: $("#schedule_class").val()
        },
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.closeAll('page');
            layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    window.location.reload();
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

function updateScheduleTask(scheduleId) {
    if ($("#schedule_cron").val()) {
        layer.msg("Cron cannot be empty");
    }
    if ($("#schedule_class").val()) {
        layer.msg("Flow or FlowGroup cannot be empty");
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/schedule/updateSchedule",//This is the name of the file where I receive data in the background.
        data: {
            id: $("#scheduleId").val(),
            type: $("#schedule_type").val(),
            cronExpression: $("#schedule_cron").val(),
            planStartTimeStr: $("#schedule_plan_start_time").val(),
            planEndTimeStr: $("#schedule_plan_end_time").val(),
            scheduleRunTemplateId: $("#schedule_class").val()
        },
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.closeAll('page');
            layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                   window.location.reload();
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

function startScheduleTask(scheduleId) {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/schedule/startSchedule",//This is the name of the file where I receive data in the background.
        data: {scheduleId: scheduleId},
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.closeAll('page');
            layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    window.location.reload();
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

function stopScheduleTask(scheduleId) {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/schedule/stopSchedule",//This is the name of the file where I receive data in the background.
        data: {scheduleId: scheduleId},
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.closeAll('page');
            layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    window.location.reload();
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

function delScheduleTask(scheduleId) {
    layer.confirm("Are you sure to delete ?", {
        btn: ['confirm', 'cancel'] //button
        , title: 'Confirmation prompt'
    }, function () {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/schedule/delSchedule",//This is the name of the file where I receive data in the background.
            data: {scheduleId: scheduleId},
            async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.closeAll('page');
                layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                        window.location.reload();
                    });
                } else {
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    });
}

function schedulePopup(id, titleName) {
    openLayerWindowLoadHtml('<div id="layer_open_content_id" style="display:none;"></div>', 580, 520, titleName, 0.3);
    ajaxLoadAsync("layer_open_content_id", "/page/schedule/schedule_new_or_update.html", true, function () {
        onloadScheduleInfoHtmlDate(id);
    });
}

function checkScheduleInput(scheduleCron, scheduleRunTemplateId, description) {
    $('#schedule_cron').removeClass('error_class');
    $('#scheduleRunTemplateId').removeClass('error_class');
    if (scheduleCron == '') {
        layer.msg('cron Can not be empty', {icon: 2, shade: 0, time: 2000});
        $('#schedule_cron').addClass('error_class');
        return false;
    }
    if (scheduleRunTemplateId == '') {
        layer.msg('flow or group Can not be empty', {icon: 2, shade: 0, time: 2000});
        $('#scheduleRunTemplateId').addClass('error_class');
        return false;
    }
    /*if (description == '') {
        layer.msg('description不能为空！', {icon: 2, shade: 0, time: 2000});
        document.getElementById('description').focus();
        return false;
    } */
    return true;
}

function onloadScheduleInfoHtmlDate(scheduleId) {
    $("#buttonSchedule").attr("onclick", "");
    if (scheduleId) {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/schedule/getScheduleById",//This is the name of the file where I receive data in the background.
            data: {scheduleId: scheduleId},
            async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.closeAll('page');
                layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    var scheduleVo = dataMap.scheduleVo;
                    $("#buttonSchedule").attr("onclick", "updateScheduleTask()");
                    $("#scheduleId").val(scheduleVo.id);
                    $("#schedule_class").val(scheduleVo.scheduleRunTemplateId);
                    $("#schedule_cron").val(scheduleVo.cronExpression);
                    $("#schedule_plan_start_time").val(scheduleVo.planStartTime);
                    $("#schedule_plan_end_time").val(scheduleVo.planEndTime);
                } else {
                    layer.msg('open failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    } else {
        $("#buttonSchedule").attr("onclick", "createScheduleTask()");
        $("#scheduleId").val("");
        $("#scheduleName").val("");
        $("#scheduleClass").val("");
        $("#schedule_cron").val("");
        $("#schedule_plan_start_time").val();
        $("#schedule_plan_end_time").val();
    }
}

function loadFlowOrGroupSelect() {
    var schedule_type = $("#schedule_type").val();
    var request_url = "/flow/getFlowListPage";
    if (schedule_type === "FLOW_GROUP") {
        request_url = "/flowGroup/getFlowGroupListPage";
    }
    console.log(schedule_type);
    $("#schedule_class").val("");
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: request_url,//This is the name of the file where I receive data in the background.
        data: {page: 1, limit: 10000},
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.closeAll('page');
            layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                $("#schedule_class").html('<option value="">Please select</option>');
                var option_data = dataMap.data;
                if (dataMap.data) {
                    for (var i = 0; i < option_data.length; i++) {
                        var option_data_i = option_data[i];
                        $("#schedule_class").append('<option value="' + option_data_i.id + '">' + option_data_i.name + '</option>');
                    }
                }

            } else {
                layer.msg('open failed', {icon: 2, shade: 0, time: 2000});
            }
            $("#layer_open_content_id").show();
        }
    });
}

function developmentFunc() {
    layer.msg("Functional development", {icon: 5, shade: 0, time: 2000}, function () {
    });
}



<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/vo/MxCellVo.java<|end_filename|>
package cn.cnic.component.mxGraph.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class MxCellVo implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private MxGraphModelVo mxGraphModelVo;

    private String pageId;

    private String parent;

    private String style;

    private String edge; // Line has

    private String source; // Line has

    private String target; // Line has

    private String value;

    private String vertex;

    private MxGeometryVo mxGeometryVo;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/vo/CodeSnippetVo.java<|end_filename|>
package cn.cnic.component.livy.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter
public class CodeSnippetVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;
    private String codeContent;
    private String executeId;
    private int codeSnippetSort;


}


<|start_filename|>vue-piflow-web/src/mock/index.js<|end_filename|>
import pie from './pie/pie';
export default { pie };

<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/service/ICodeSnippetService.java<|end_filename|>
package cn.cnic.component.livy.service;


import cn.cnic.controller.requestVo.CodeSnippetVoRequestAdd;
import cn.cnic.controller.requestVo.CodeSnippetVoRequestUpdate;

public interface ICodeSnippetService {

    public String addCodeSnippet(String username, CodeSnippetVoRequestAdd codeSnippetVo);

    public String updateCodeSnippet(String username, CodeSnippetVoRequestUpdate codeSnippetVo);

    public String delCodeSnippet(String username, boolean isAdmin, String codeSnippetId);

    public String getCodeSnippetList(String noteBookId);

    public String runCodeSnippet(String username, String codeSnippetId);

    public String getStatementsResult(String codeSnippetId);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/mapper/MxGraphModelMapper.java<|end_filename|>
package cn.cnic.component.mxGraph.mapper;

import cn.cnic.component.mxGraph.entity.MxGraphModel;
import cn.cnic.component.mxGraph.mapper.provider.MxGraphModelProvider;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

@Mapper
public interface MxGraphModelMapper {

    /**
     * add mxGraphModel
     *
     * @param mxGraphModel
     * @return
     */
    @InsertProvider(type = MxGraphModelProvider.class, method = "addMxGraphModel")
    public int addMxGraphModel(MxGraphModel mxGraphModel);

    /**
     * Modify mxgraphmodel
     *
     * @param mxGraphModel
     * @return
     */
    @UpdateProvider(type = MxGraphModelProvider.class, method = "updateMxGraphModel")
    public int updateMxGraphModel(MxGraphModel mxGraphModel);

    /**
     * Query mxgraphmodel according to ID
     *
     * @param id
     * @return
     */
    @SelectProvider(type = MxGraphModelProvider.class, method = "getMxGraphModelById")
    @Results({@Result(id = true, column = "id", property = "id"),
            @Result(column = "mx_dx", property = "dx"),
            @Result(column = "mx_dy", property = "dy"),
            @Result(column = "mx_grid", property = "grid"),
            @Result(column = "mx_gridsize", property = "gridSize"),
            @Result(column = "mx_guides", property = "guides"),
            @Result(column = "mx_tooltips", property = "tooltips"),
            @Result(column = "mx_connect", property = "connect"),
            @Result(column = "mx_arrows", property = "arrows"),
            @Result(column = "mx_fold", property = "fold"),
            @Result(column = "mx_page", property = "page"),
            @Result(column = "mx_pagescale", property = "pageScale"),
            @Result(column = "mx_pagewidth", property = "pageWidth"),
            @Result(column = "mx_pageheight", property = "pageHeight"),
            @Result(column = "mx_background", property = "background"),
            @Result(column = "id", property = "root", many = @Many(select = "cn.cnic.component.mxGraph.mapper.MxCellMapper.getMeCellByMxGraphId", fetchType = FetchType.LAZY))})
    public MxGraphModel getMxGraphModelById(String id);

    /**
     * Query mxGraphModel according to flowId
     *
     * @param flowId
     * @return
     */
    @SelectProvider(type = MxGraphModelProvider.class, method = "getMxGraphModelByFlowId")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "mx_dx", property = "dx"),
            @Result(column = "mx_dy", property = "dy"),
            @Result(column = "mx_grid", property = "grid"),
            @Result(column = "mx_gridsize", property = "gridSize"),
            @Result(column = "mx_guides", property = "guides"),
            @Result(column = "mx_tooltips", property = "tooltips"),
            @Result(column = "mx_connect", property = "connect"),
            @Result(column = "mx_arrows", property = "arrows"),
            @Result(column = "mx_fold", property = "fold"),
            @Result(column = "mx_page", property = "page"),
            @Result(column = "mx_pagescale", property = "pageScale"),
            @Result(column = "mx_pagewidth", property = "pageWidth"),
            @Result(column = "mx_pageheight", property = "pageHeight"),
            @Result(column = "mx_background", property = "background"),
            @Result(column = "id", property = "root", many = @Many(select = "cn.cnic.component.mxGraph.mapper.MxCellMapper.getMeCellByMxGraphId", fetchType = FetchType.LAZY))
    })
    public MxGraphModel getMxGraphModelByFlowId(String flowId);

    /**
     * Query mxGraphModel according to flowGroupId
     *
     * @param flowGroupId
     * @return
     */
    @SelectProvider(type = MxGraphModelProvider.class, method = "getMxGraphModelByFlowGroupId")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "mx_dx", property = "dx"),
            @Result(column = "mx_dy", property = "dy"),
            @Result(column = "mx_grid", property = "grid"),
            @Result(column = "mx_gridsize", property = "gridSize"),
            @Result(column = "mx_guides", property = "guides"),
            @Result(column = "mx_tooltips", property = "tooltips"),
            @Result(column = "mx_connect", property = "connect"),
            @Result(column = "mx_arrows", property = "arrows"),
            @Result(column = "mx_fold", property = "fold"),
            @Result(column = "mx_page", property = "page"),
            @Result(column = "mx_pagescale", property = "pageScale"),
            @Result(column = "mx_pagewidth", property = "pageWidth"),
            @Result(column = "mx_pageheight", property = "pageHeight"),
            @Result(column = "mx_background", property = "background"),
            @Result(column = "id", property = "root", many = @Many(select = "cn.cnic.component.mxGraph.mapper.MxCellMapper.getMeCellByMxGraphId", fetchType = FetchType.LAZY))
    })
    public MxGraphModel getMxGraphModelByFlowGroupId(String flowGroupId);
    /**
     * Query mxGraphModel according to flowGroupId
     *
     * @param processId
     * @return
     */
    @SelectProvider(type = MxGraphModelProvider.class, method = "getMxGraphModelByProcessId")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "mx_dx", property = "dx"),
            @Result(column = "mx_dy", property = "dy"),
            @Result(column = "mx_grid", property = "grid"),
            @Result(column = "mx_gridsize", property = "gridSize"),
            @Result(column = "mx_guides", property = "guides"),
            @Result(column = "mx_tooltips", property = "tooltips"),
            @Result(column = "mx_connect", property = "connect"),
            @Result(column = "mx_arrows", property = "arrows"),
            @Result(column = "mx_fold", property = "fold"),
            @Result(column = "mx_page", property = "page"),
            @Result(column = "mx_pagescale", property = "pageScale"),
            @Result(column = "mx_pagewidth", property = "pageWidth"),
            @Result(column = "mx_pageheight", property = "pageHeight"),
            @Result(column = "mx_background", property = "background"),
            @Result(column = "id", property = "root", many = @Many(select = "cn.cnic.component.mxGraph.mapper.MxCellMapper.getMeCellByMxGraphId", fetchType = FetchType.LAZY))
    })
    public MxGraphModel getMxGraphModelByProcessId(String processId);

    /**
     * Query mxGraphModel according to processGroupId
     *
     * @param processGroupId
     * @return
     */
    @SelectProvider(type = MxGraphModelProvider.class, method = "getMxGraphModelByProcessGroupId")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "mx_dx", property = "dx"),
            @Result(column = "mx_dy", property = "dy"),
            @Result(column = "mx_grid", property = "grid"),
            @Result(column = "mx_gridsize", property = "gridSize"),
            @Result(column = "mx_guides", property = "guides"),
            @Result(column = "mx_tooltips", property = "tooltips"),
            @Result(column = "mx_connect", property = "connect"),
            @Result(column = "mx_arrows", property = "arrows"),
            @Result(column = "mx_fold", property = "fold"),
            @Result(column = "mx_page", property = "page"),
            @Result(column = "mx_pagescale", property = "pageScale"),
            @Result(column = "mx_pagewidth", property = "pageWidth"),
            @Result(column = "mx_pageheight", property = "pageHeight"),
            @Result(column = "mx_background", property = "background"),
            @Result(column = "id", property = "root", many = @Many(select = "cn.cnic.component.mxGraph.mapper.MxCellMapper.getMeCellByMxGraphId", fetchType = FetchType.LAZY))
    })
    public MxGraphModel getMxGraphModelByProcessGroupId(String processGroupId);


    @UpdateProvider(type = MxGraphModelProvider.class, method = "updateEnableFlagByFlowId")
    public int updateEnableFlagByFlowId(@Param("username") String username,@Param("flowId") String flowId);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/system/mapper/SysScheduleMapper.java<|end_filename|>
package cn.cnic.component.system.mapper;

import cn.cnic.common.Eunm.ScheduleState;
import cn.cnic.component.system.entity.SysSchedule;
import cn.cnic.component.system.vo.SysScheduleVo;
import cn.cnic.component.system.mapper.provider.SysScheduleMapperProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

@Mapper
public interface SysScheduleMapper {

    @InsertProvider(type = SysScheduleMapperProvider.class, method = "insert")
    public int insert(SysSchedule sysSchedule);

    @InsertProvider(type = SysScheduleMapperProvider.class, method = "update")
    public int update(SysSchedule sysSchedule);

    @SelectProvider(type = SysScheduleMapperProvider.class, method = "getSysScheduleById")
    public SysSchedule getSysScheduleById(boolean isAdmin, String id);

    /**
     * getSysScheduleListByStatus
     *
     * @param isAdmin
     * @param status
     * @return
     */
    @SelectProvider(type = SysScheduleMapperProvider.class, method = "getSysScheduleListByStatus")
    public List<SysSchedule> getSysScheduleListByStatus(@Param("isAdmin") boolean isAdmin, @Param("status") ScheduleState status);

    /**
     * getSysScheduleList
     *
     * @param param
     * @return
     */
    @SelectProvider(type = SysScheduleMapperProvider.class, method = "getSysScheduleList")
    public List<SysScheduleVo> getSysScheduleList(@Param("isAdmin") boolean isAdmin, @Param("param") String param);

    @SelectProvider(type = SysScheduleMapperProvider.class, method = "getSysScheduleById")
    public SysScheduleVo getSysScheduleVoById(boolean isAdmin, String id);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/dashboard/service/IStatisticService.java<|end_filename|>
package cn.cnic.component.dashboard.service;

import java.util.Map;

public interface IStatisticService {

    /**
     * get flow statistic info
     *
     * @return statisticInfo
     */
    public Map<String,String> getFlowStatisticInfo();

    /**
     * get group statistic info
     *
     * @return statisticInfo
     */
    public Map<String,String> getGroupStatisticInfo();

    /**
     * get schedule statistic info
     *
     * @return statisticInfo
     */
    public Map<String,String> getScheduleStatisticInfo();

    /**
     * get template and dataSource statistic info
     *
     * @return statisticInfo
     */
    public Map<String,String> getTemplateAndDataSourceStatisticInfo();

    /**
     * get stop statistic info
     *
     * @return statisticInfo
     */
    public Map<String,String> getStopStatisticInfo();

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/vo/MxGeometryVo.java<|end_filename|>
package cn.cnic.component.mxGraph.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class MxGeometryVo implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private String relative;

    private String as;

    private String x;

    private String y;

    private String width;

    private String height;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/mapper/provider/NoteBookMapperProvider.java<|end_filename|>
package cn.cnic.component.livy.mapper.provider;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.livy.entity.NoteBook;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;
import java.util.Date;


public class NoteBookMapperProvider {

    private String id;
    private String lastUpdateUser;
    private String lastUpdateDttmStr;
    private long version;
    private int enableFlag;
    private String name;
    private String description;
    private String codeType;
    private String sessionsId;

    private boolean preventSQLInjectionNoteBook(NoteBook noteBook) {
        if (null == noteBook || StringUtils.isBlank(noteBook.getLastUpdateUser())) {
            return false;
        }
        // Mandatory Field
        String lastUpdateDttm = DateUtils
                .dateTimesToStr(null != noteBook.getLastUpdateDttm() ? noteBook.getLastUpdateDttm() : new Date());
        this.id = SqlUtils.preventSQLInjection(noteBook.getId());
        this.enableFlag = ((null != noteBook.getEnableFlag() && noteBook.getEnableFlag()) ? 1 : 0);
        this.version = (null != noteBook.getVersion() ? noteBook.getVersion() : 0L);
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttm);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(noteBook.getLastUpdateUser());

        // Selection field
        this.name = SqlUtils.preventSQLInjection(noteBook.getName());
        this.description = SqlUtils.preventSQLInjection(noteBook.getDescription());
        this.codeType = SqlUtils.preventSQLInjection(noteBook.getCodeType());
        this.sessionsId = SqlUtils.preventSQLInjection(noteBook.getSessionsId());

        return true;
    }

    private void resetNoteBook() {
        this.id = null;
        this.lastUpdateUser = null;
        this.lastUpdateDttmStr = null;
        this.version = 0L;
        this.enableFlag = 1;
        this.name = null;
        this.description = null;
        this.codeType = null;
        this.sessionsId = null;
    }

    /**
     * add NoteBook
     *
     * @param noteBook
     * @return Integer
     */
    public String addNoteBook(NoteBook noteBook) {
        String sql = "SELECT 0";
        if (preventSQLInjectionNoteBook(noteBook)) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("INSERT INTO note_book ");
            strBuf.append("( ");
            strBuf.append(SqlUtils.baseFieldName() + ", ");
            strBuf.append("name, ");
            strBuf.append("description, ");
            strBuf.append("code_type, ");
            strBuf.append("sessions_id ");
            strBuf.append(") ");

            strBuf.append("values ");
            strBuf.append("(");
            strBuf.append(SqlUtils.baseFieldValues(noteBook) + ", ");
            strBuf.append(this.name + ", ");
            strBuf.append(this.description + ", ");
            strBuf.append(this.codeType + ", ");
            strBuf.append(this.sessionsId + " ");
            strBuf.append(")");
            sql = strBuf.toString();
        }
        this.resetNoteBook();
        return sql;
    }

    /**
     * update NoteBook
     *
     * @param noteBook
     * @return Integer
     */
    public String updateNoteBook(NoteBook noteBook) {
        String sqlStr = "SELECT 0";
        boolean flag = preventSQLInjectionNoteBook(noteBook);
        if (flag && StringUtils.isNotBlank(this.id)) {
            SQL sql = new SQL();
            // INSERT_INTO brackets is table name
            sql.UPDATE("note_book");
            // The first string in the SET is the name of the field corresponding to the
            // table in the database
            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + this.enableFlag);
            sql.SET("name = " + this.name);
            sql.SET("description = " + this.description);
            sql.SET("code_type = " + this.codeType);
            sql.SET("sessions_id = " + this.sessionsId);
            sql.WHERE("version = " + this.version);
            sql.WHERE("id = " + this.id);
            sqlStr = sql.toString();
        }
        this.resetNoteBook();
        return sqlStr;
    }

    /**
     * update NoteBook enable_flag
     *
     * @param isAdmin
     * @param username
     * @param id
     * @return Integer
     */
    public String deleteNoteBookById(boolean isAdmin, String username, String id){
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("UPDATE note_book SET enable_flag=0 WHERE ");
        stringBuffer.append("id=" + SqlUtils.preventSQLInjection(id));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }

    /**
     * get NoteBook by name
     *
     * @param isAdmin
     * @param username
     * @param name
     * @return String
     */
    public String checkNoteBookByName(boolean isAdmin, String username, String name){
        if (StringUtils.isBlank(name)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("SELECT count(name) FROM note_book WHERE ");
        stringBuffer.append("enable_flag=1 and name=" + SqlUtils.preventSQLInjection(name));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }

    /**
     * get NoteBook by id
     *
     * @param isAdmin
     * @param username
     * @param id
     * @return String
     */
    public String getNoteBookById(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("id") String id){
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("SELECT * FROM note_book WHERE ");
        stringBuffer.append("enable_flag=1 and id=" + SqlUtils.preventSQLInjection(id));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }


    /**
     * search NoteBook List
     *
     * @param isAdmin
     * @param username
     * @param param
     * @return
     */
    public String adminGetNoteBookById(String id) {
    	if (StringUtils.isBlank(id)) {
    		return "SELECT 0";
        }
        StringBuffer stringBuf = new StringBuffer();
        stringBuf.append("SELECT * FROM note_book WHERE enable_flag=1 ");
        stringBuf.append("AND id=" + SqlUtils.preventSQLInjection(id) + " ");
        return stringBuf.toString();
    }
    


    /**
     * search NoteBook List
     *
     * @param isAdmin
     * @param username
     * @param param
     * @return
     */
    public String getNoteBookList(boolean isAdmin, String username, String param) {
        StringBuffer stringBuf = new StringBuffer();
        stringBuf.append("SELECT * FROM note_book WHERE enable_flag=1 ");
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            stringBuf.append("AND crt_user=" + SqlUtils.preventSQLInjection(username) + " ");
        }
        if (StringUtils.isNotBlank(param)) {
            stringBuf.append("crt_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%') ");
            stringBuf.append("last_update_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%') ");
            stringBuf.append("name LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%') ");
            stringBuf.append("description LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%') ");
        }
        stringBuf.append("ORDER BY  last_update_dttm DESC ");
        return stringBuf.toString();
    }
}


<|start_filename|>vue-piflow-web/src/mock/pie/pie.js<|end_filename|>
let Mock = require('mockjs');

const data = Mock.mock({
    'status': 200,
    'dataSource|1-9': [{
        'key|+1': 1,
        'mockTitle|1': ['肆无忌惮'],
        'mockContent|1': ['角色精湛主题略荒诞', '理由太短 是让人不安', '疑信参半 却无比期盼', '你的惯犯 圆满', '别让纠缠 显得 孤单'],
        'mockAction|1': ['下载', '试听', '喜欢']
    }]
});
const data1 = Mock.mock({
    'status': 200,
    'dataSource|1-9': [{
        'key|+1': 1,
        'mockTitle|1': ['肆无忌惮'],
        'mockContent|1': ['角色精湛主题略荒诞', '理由太短 是让人不安', '疑信参半 却无比期盼', '你的惯犯 圆满', '别让纠缠 显得 孤单'],
        'mockAction|1': ['下载', '试听', '喜欢']
    }]
});
export default { data, data1 }

<|start_filename|>piflow-web/src/main/java/cn/cnic/component/schedule/utils/ScheduleUtils.java<|end_filename|>
package cn.cnic.component.schedule.utils;

import cn.cnic.component.schedule.entity.Schedule;

import java.util.Date;

public class ScheduleUtils {

    public static Schedule newScheduleNoId(String username) {

        Schedule schedule = new Schedule();
        // basic properties (required when creating)
        schedule.setCrtDttm(new Date());
        schedule.setCrtUser(username);
        // basic properties
        schedule.setEnableFlag(true);
        schedule.setLastUpdateUser(username);
        schedule.setLastUpdateDttm(new Date());
        schedule.setVersion(0L);
        return schedule;
    }


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/config/jwt/JwtAuthenticationTokenFilter.java<|end_filename|>
package cn.cnic.base.config.jwt;

import cn.cnic.base.config.jwt.common.JwtUtils;
import cn.cnic.base.vo.UserVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * token校验,引用的stackoverflow一个答案里的处理方式
 */
@Component
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {

    @Value("${jwt.header}")
    private String token_header;

    @Autowired
    private JwtUtils jwtUtils;

    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
        response.addHeader("Access-Control-Allow-Credentials", "false");
        response.addHeader("Access-Control-Allow-Origin", "*");
        response.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS");
        response.addHeader("Access-Control-Allow-Headers", "Content-Type,X-Requested-With,X-CAF-Authorization-Token,sessionToken,X-TOKEN,Authorization");
        String auth_token = request.getHeader(this.token_header);
        final String auth_token_start = "Bearer ";
        if (StringUtils.isNotEmpty(auth_token) && auth_token.startsWith(auth_token_start)) {
            auth_token = auth_token.substring(auth_token_start.length());
        } else {
            // 不按规范,不允许通过验证
            auth_token = null;
        }

        String username = jwtUtils.getUsernameFromToken(auth_token);

        logger.debug(String.format("Checking authentication for user %s.", username));

        if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
            UserVo userVo = jwtUtils.getUserFromToken(auth_token);
            if (jwtUtils.validateToken(auth_token, userVo)) {
                UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userVo, null, userVo.getAuthorities());
                authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
                logger.info(String.format("Authenticated user %s, setting security context", username));
                SecurityContextHolder.getContext().setAuthentication(authentication);
            }
        }
        chain.doFilter(request, response);
    }
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/sparkJar/SparkJarVo.java<|end_filename|>
package cn.cnic.third.vo.sparkJar;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class SparkJarVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String mountId;
    //private List<ThirdStopsComponentVo> stops;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/dashboard/service/IResourceService.java<|end_filename|>
package cn.cnic.component.dashboard.service;

public interface IResourceService {

    /**
     * get resource info
     *
     * @return resourceInfo
     */
    public String getResourceInfo();
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/vo/ProcessGroupPathVo.java<|end_filename|>
package cn.cnic.component.process.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter
public class ProcessGroupPathVo implements Serializable {

    private static final long serialVersionUID = 1L;
    
    private ProcessGroupVo processGroupVo;
    private String from;
    private String outport;
    private String inport;
    private String to;
    private String pageId;
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/service/IGroup.java<|end_filename|>
package cn.cnic.third.service;

import cn.cnic.common.Eunm.RunModeType;
import cn.cnic.component.process.entity.ProcessGroup;
import cn.cnic.third.vo.flowGroup.ThirdFlowGroupInfoResponse;

import java.util.List;
import java.util.Map;

public interface IGroup {

    /**
     * startFlowGroup
     *
     * @param processGroup
     * @return
     */
    public Map<String, Object> startFlowGroup(ProcessGroup processGroup, RunModeType runModeType);

    /**
     * stopFlowGroup
     *
     * @param processGroupId
     * @return
     */
    public String stopFlowGroup(String processGroupId);

    /**
     * getFlowGroupInfoStr
     *
     * @param groupId
     * @return
     */
    public String getFlowGroupInfoStr(String groupId);

    /**
     * getFlowGroupInfo
     *
     * @param groupId
     * @return
     */
    public ThirdFlowGroupInfoResponse getFlowGroupInfo(String groupId);

    /**
     * getFlowGroupProgress
     *
     * @param groupId
     * @return
     */
    public Double getFlowGroupProgress(String groupId);

    /**
     * update FlowGroup By Interface
     *
     * @param groupId
     * @throws Exception 
     */
    public void updateFlowGroupByInterface(String groupId) throws Exception;

    /**
     * update FlowGroups By Interface
     *
     * @param groupIds
     * @throws Exception 
     */
    public void updateFlowGroupsByInterface(List<String> groupIds) throws Exception ;


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/stop/ThirdStopsComponentPropertyVo.java<|end_filename|>
package cn.cnic.third.vo.stop;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class ThirdStopsComponentPropertyVo implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    private String name;
    private String displayName;
    private String description;
    private String defaultValue;
    private String allowableValues;
    private String required;
    private boolean sensitive;
    private String example;
    private String language;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/controller/requestVo/SchemaValuesVo.java<|end_filename|>
package cn.cnic.controller.requestVo;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
@ApiModel(description = "save TestData")
public class SchemaValuesVo implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    

    @ApiModelProperty(value = "schema name")
    private String schemaName;

    @ApiModelProperty(value = "schemaValues id")
    private String schemaValueId;
    
    @ApiModelProperty(value = "schema value")
    private String schemaValue;
    
    @ApiModelProperty(value = "schema value row", example = "0")
    private int dataRow;

    @ApiModelProperty(value = "delete or not")
    private boolean isDelete;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/flowLog/ThirdAppVo.java<|end_filename|>
package cn.cnic.third.vo.flowLog;

import java.io.Serializable;

public class ThirdAppVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;
    private String user;
    private String name;
    private String queue;
    private String state;
    private String finalStatus;
    private Boolean progress;
    private String trackingUI;
    private String trackingUrl;
    private String diagnostics;
    private Long clusterId;
    private String applicationType;
    private String applicationTags;
    private Long startedTime;
    private Long finishedTime;
    private Long elapsedTime;
    private String amContainerLogs;
    private String amHostHttpAddress;
    private Integer allocatedMB;
    private Integer allocatedVCores;
    private Integer runningContainers;
    private Integer memorySeconds;
    private Integer vcoreSeconds;
    private Integer preemptedResourceMB;
    private Integer preemptedResourceVCores;
    private Integer numNonAMContainerPreempted;
    private Integer numAMContainerPreempted;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getQueue() {
        return queue;
    }

    public void setQueue(String queue) {
        this.queue = queue;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getFinalStatus() {
        return finalStatus;
    }

    public void setFinalStatus(String finalStatus) {
        this.finalStatus = finalStatus;
    }

    public Boolean getProgress() {
        return progress;
    }

    public void setProgress(Boolean progress) {
        this.progress = progress;
    }

    public String getTrackingUI() {
        return trackingUI;
    }

    public void setTrackingUI(String trackingUI) {
        this.trackingUI = trackingUI;
    }

    public String getTrackingUrl() {
        return trackingUrl;
    }

    public void setTrackingUrl(String trackingUrl) {
        this.trackingUrl = trackingUrl;
    }

    public String getDiagnostics() {
        return diagnostics;
    }

    public void setDiagnostics(String diagnostics) {
        this.diagnostics = diagnostics;
    }

    public Long getClusterId() {
        return clusterId;
    }

    public void setClusterId(Long clusterId) {
        this.clusterId = clusterId;
    }

    public String getApplicationType() {
        return applicationType;
    }

    public void setApplicationType(String applicationType) {
        this.applicationType = applicationType;
    }

    public String getApplicationTags() {
        return applicationTags;
    }

    public void setApplicationTags(String applicationTags) {
        this.applicationTags = applicationTags;
    }

    public Long getStartedTime() {
        return startedTime;
    }

    public void setStartedTime(Long startedTime) {
        this.startedTime = startedTime;
    }

    public Long getFinishedTime() {
        return finishedTime;
    }

    public void setFinishedTime(Long finishedTime) {
        this.finishedTime = finishedTime;
    }

    public Long getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(Long elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public String getAmContainerLogs() {
        return amContainerLogs;
    }

    public void setAmContainerLogs(String amContainerLogs) {
        this.amContainerLogs = amContainerLogs;
    }

    public String getAmHostHttpAddress() {
        return amHostHttpAddress;
    }

    public void setAmHostHttpAddress(String amHostHttpAddress) {
        this.amHostHttpAddress = amHostHttpAddress;
    }

    public Integer getAllocatedMB() {
        return allocatedMB;
    }

    public void setAllocatedMB(Integer allocatedMB) {
        this.allocatedMB = allocatedMB;
    }

    public Integer getAllocatedVCores() {
        return allocatedVCores;
    }

    public void setAllocatedVCores(Integer allocatedVCores) {
        this.allocatedVCores = allocatedVCores;
    }

    public Integer getRunningContainers() {
        return runningContainers;
    }

    public void setRunningContainers(Integer runningContainers) {
        this.runningContainers = runningContainers;
    }

    public Integer getMemorySeconds() {
        return memorySeconds;
    }

    public void setMemorySeconds(Integer memorySeconds) {
        this.memorySeconds = memorySeconds;
    }

    public Integer getVcoreSeconds() {
        return vcoreSeconds;
    }

    public void setVcoreSeconds(Integer vcoreSeconds) {
        this.vcoreSeconds = vcoreSeconds;
    }

    public Integer getPreemptedResourceMB() {
        return preemptedResourceMB;
    }

    public void setPreemptedResourceMB(Integer preemptedResourceMB) {
        this.preemptedResourceMB = preemptedResourceMB;
    }

    public Integer getPreemptedResourceVCores() {
        return preemptedResourceVCores;
    }

    public void setPreemptedResourceVCores(Integer preemptedResourceVCores) {
        this.preemptedResourceVCores = preemptedResourceVCores;
    }

    public Integer getNumNonAMContainerPreempted() {
        return numNonAMContainerPreempted;
    }

    public void setNumNonAMContainerPreempted(Integer numNonAMContainerPreempted) {
        this.numNonAMContainerPreempted = numNonAMContainerPreempted;
    }

    public Integer getNumAMContainerPreempted() {
        return numAMContainerPreempted;
    }

    public void setNumAMContainerPreempted(Integer numAMContainerPreempted) {
        this.numAMContainerPreempted = numAMContainerPreempted;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/stop/ThirdStopsComponentVo.java<|end_filename|>
package cn.cnic.third.vo.stop;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

@Getter
@Setter
public class ThirdStopsComponentVo implements Serializable {

    private static final long serialVersionUID = 1L;
    
    private String name;
    private String bundle;
    private String owner;
    private String inports;
    private String outports;
    private String groups;
    private boolean isCustomized;
    private String description;
    private String icon;
    private String visualizationType;
    List<ThirdStopsComponentPropertyVo> properties;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/utils/PathsUtil.java<|end_filename|>
package cn.cnic.component.flow.utils;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.flow.entity.Paths;
import cn.cnic.component.flow.vo.PathsVo;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class PathsUtil {
    /**
     * pathsList Po To Vo
     *
     * @param pathsList
     * @return
     */
    public static List<PathsVo> pathsListPoToVo(List<Paths> pathsList) {
        List<PathsVo> pathsVoList = null;
        if (null != pathsList && pathsList.size() > 0) {
            pathsVoList = new ArrayList<PathsVo>();
            for (Paths paths : pathsList) {
                if (null != paths) {
                    PathsVo pathsVo = new PathsVo();
                    BeanUtils.copyProperties(paths, pathsVo);
                    pathsVoList.add(pathsVo);
                }
            }
        }
        return pathsVoList;
    }

    /**
     * pathsVoList Vo To Po
     *
     * @param pathsVoList
     * @return
     */
    public static List<Paths> pathsListVoToPo(String username, List<PathsVo> pathsVoList) {
        List<Paths> pathsList = null;
        if (null != pathsVoList && pathsVoList.size() > 0) {
            pathsList = new ArrayList<Paths>();
            for (PathsVo pathsVo : pathsVoList) {
                if (null != pathsVo) {
                    Paths paths = new Paths();
                    BeanUtils.copyProperties(pathsVo, paths);
                    paths.setId(UUIDUtils.getUUID32());
                    paths.setCrtDttm(new Date());
                    paths.setCrtUser(username);
                    paths.setLastUpdateDttm(new Date());
                    paths.setLastUpdateUser(username);
                    paths.setEnableFlag(true);
                    pathsList.add(paths);
                }
            }
        }
        return pathsList;
    }


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/service/IPropertyService.java<|end_filename|>
package cn.cnic.component.flow.service;

import java.util.List;

import cn.cnic.component.flow.entity.Property;
import cn.cnic.component.flow.request.UpdatePathRequest;


public interface IPropertyService {

    /**
     * Querying group attribute information based on stopPageId
     *
     * @param stopPageId
     * @return
     */
    public String queryAll(String fid, String stopPageId);

    /**
     * Modify stops attribute information
     *
     * @param content
     * @return
     */
    public String updatePropertyList(String username, String[] content);

    /**
     * Modify stops attribute information
     *
     * @param id
     * @param content
     * @return
     */
    public String updateProperty(String username, String content, String id);


    /**
     * query All StopsProperty List;
     *
     * @return
     */
    public List<Property> getStopsPropertyList();

    /**
     * delete StopsProperty according to ID;
     *
     * @return
     */
    public int deleteStopsPropertyById(String id);


    /**
     * check stops template
     *
     * @param username
     * @param stopsId
     */
    public void checkStopTemplateUpdate(String username, String stopsId);

    public String saveOrUpdateRoutePath(String username, UpdatePathRequest updatePathRequest);

    /**
     * deleteLastReloadDataByStopsId
     *
     * @param stopId
     * @return
     */
    public String deleteLastReloadDataByStopsId(String stopId);

}


<|start_filename|>piflow-web/src/main/resources/static/my_js/processGroup/initProcessGroupGraph.js<|end_filename|>
// Extends EditorUi to update I/O action states based on availability of backend
var graphGlobal = null;
var thisEditor = null;
var flag = 0;
var index = true
var nodePageIdAndStateList, xmlDate, processType, appId, processState, processId,stdoutLog,stderrLog;

// init crumbs
function initCrumbs(parentAccessPath) {
    if (parentAccessPath) {
        switch (parentAccessPath) {
            case "flow":
                $("#web_processList_navigation").hide();
                $("#web_flowList_navigation").show();
                $("#grapheditor_home_navigation").show();
                break;
            case "flowProcess":
                $("#web_processList_navigation").hide();
                $("#web_groupTypeProcessList_navigation").show();
                break;
            case "processGroupList":
                $("#web_processList_navigation").hide();
                $("#web_processGroupList_navigation").show();
                $("#web_getProcessGroupById_navigation").show();
                break;
        }
    }
}

// init right slider style
function ClickSlider() {
    $(".triggerSlider").click(function () {
        var flag = ($(".triggerSlider i:first").hasClass("fa fa-angle-right fa-2x"));
        if (flag === false)
            $(".triggerSlider i").removeClass("fa fa-angle-left fa-2x ").toggleClass("fa fa-angle-right fa-2x");
        else
            $(".triggerSlider i").removeClass("fa fa-angle-right fa-2x").toggleClass("fa fa-angle-left fa-2x");

        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        $(this).toggleClass("triggerSlider-open");
        index = !index
    });
}

// get processGroup DrawingBoard data
function initProcessGroupDrawingBoardData(loadId, parentAccessPath, backFunc) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/processGroup/drawingBoardData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            loadId: loadId,
            parentAccessPath: parentAccessPath
        },
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            // window.location.href = (web_baseUrl + "/error/404");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            console.log(dataMap);
            if (200 === dataMap.code) {
                processId = dataMap.processId;
                processType = dataMap.processType;
                nodePageIdAndStateList = dataMap.nodePageIdAndStateList;
                xmlDate = dataMap.xmlDate;
                parentsId = dataMap.processGroupId;
                appId = dataMap.appId;
                processState = dataMap.processState;
                $("#progress").text(dataMap.percentage);
                var getCheckpointParam = "'" + (dataMap.pID ? dataMap.pID : "") + "','" + (dataMap.parentProcessId ? dataMap.parentProcessId : "") + "', '" + (dataMap.processId ? dataMap.processId : "") + "'";
                $("#runFlow").attr("onclick", "getCheckpoint(" + getCheckpointParam + ")");
                $("#debugFlow").attr("onclick", "getCheckpoint(" + getCheckpointParam + ",'DEBUG')");
                $("#run_checkpoint_new").attr("onclick", "getCheckpoint(" + getCheckpointParam + ")");
                $("#debug_checkpoint_new").attr("onclick", "getCheckpoint(" + getCheckpointParam + ",'DEBUG')");
            } else {
                //window.location.href = (web_baseUrl + "/error/404");
            }
            $('#fullScreen').hide();
            if (backFunc && $.isFunction(backFunc)) {
                backFunc(data);
            }
        }
    });
}

// init processGroup mxGraph
function initProcessGroupGraph() {
    $("#right-group-wrap")[0].style.display = "block";
    $("#precessGroup-run")[0].style.display = "block";
    Format.noEditing(true);
    //EditorUi.prototype.noEditing = true;
    EditorUi.prototype.menubarHeight = 48;
    EditorUi.prototype.menubarShow = false;
    EditorUi.prototype.customToobar = true;
    var editorUiInit = EditorUi.prototype.init;
    EditorUi.prototype.init = function () {
        editorUiInit.apply(this, arguments);
        graphGlobal = this.editor.graph;
        thisEditor = this.editor;
        this.actions.get('export').setEnabled(false);
        graphGlobal.addListener(mxEvent.CLICK, function (sender, evt) {
            processGroupMxEventClick(evt.properties.cell)
        });
        graphGlobal.addListener(mxEvent.SIZE, function (sender, evt) {
            changIconTranslate();
        });
        graphGlobal.addListener(mxEvent.DOUBLE_CLICK, function (sender, evt) {
            OpenTheMonitorArtBoard(evt);
        });
        if (xmlDate) {
            var xml = mxUtils.parseXml(xmlDate);
            var node = xml.documentElement;
            var dec = new mxCodec(node.ownerDocument);
            dec.decode(node, graphGlobal.getModel());
            eraseRecord()
        }
    };

    // Adds required resources (disables loading of fallback properties, this can only
    // be used if we know that all keys are defined in the language specific file)
    mxResources.loadDefaultBundle = false;
    var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
        mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);

    // Fixes possible asynchronous requests
    mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
        // Adds bundle text to resources
        mxResources.parse(xhr[0].getText());

        // Configures the default graph theme
        var themes = new Object();
        themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();

        // Main
        new EditorUi(new Editor(urlParams['chrome'] == '0', themes));
    }, function () {
        document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
    });
    ClickSlider();
    setTimeout(() => {
        console.log("svg_element");
        initMonitorIcon();
    }, 300)
}

//open xml file
function openXml() {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/flow/loadData",
        //data:$('#loginForm').serialize(),//Serialize the form
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//After the request is successful
            loadXml(data);
            console.log("success");
        }
    });
}

//load xml file
function loadXml(loadStr) {
    var xml = mxUtils.parseXml(loadStr);
    var node = xml.documentElement;
    var dec = new mxCodec(node.ownerDocument);
    dec.decode(node, graphGlobal.getModel());
    eraseRecord()
}

// init Monitor Icon
function initMonitorIcon() {
    var svg_element = document.getElementsByClassName('geDiagramBackdrop geDiagramContainer')[0].getElementsByTagName("svg")[0];
    nodePageIdAndStateList.forEach(item => {
        var img_element_init = document.createElementNS("http://www.w3.org/2000/svg", "image");
        img_element_init.setAttribute("x", 0);
        img_element_init.setAttribute("y", 0);
        img_element_init.setAttribute("width", 20);
        img_element_init.setAttribute("height", 20);
        img_element_init.setAttribute("PiFlow_IMG", "IMG");
        img_element_init.href.baseVal = web_drawingBoard + "/img/Loading.gif";
        img_element_init.setAttribute("id", "stopLoadingShow" + item.pageId);

        var img_element_ok = document.createElementNS("http://www.w3.org/2000/svg", "image");
        img_element_ok.setAttribute("x", 0);
        img_element_ok.setAttribute("y", 0);
        img_element_ok.setAttribute("width", 20);
        img_element_ok.setAttribute("height", 20);
        img_element_ok.setAttribute("PiFlow_IMG", "IMG");
        img_element_ok.href.baseVal = web_drawingBoard + "/img/Ok.png";
        img_element_ok.setAttribute("id", "stopOkShow" + item.pageId);

        var img_element_fail = document.createElementNS("http://www.w3.org/2000/svg", "image");
        img_element_fail.setAttribute("x", 0);
        img_element_fail.setAttribute("y", 0);
        img_element_fail.setAttribute("width", 20);
        img_element_fail.setAttribute("height", 20);
        img_element_fail.setAttribute("PiFlow_IMG", "IMG");
        img_element_fail.href.baseVal = web_drawingBoard + "/img/Fail.png";
        img_element_fail.setAttribute("id", "stopFailShow" + item.pageId);
        img_element_init.style.display = "none";
        img_element_fail.style.display = "none";
        img_element_ok.style.display = "none";
        if (item.state) {
            if (item.state !== "INIT") {
                //stopImgChange.attr('opacity', 1);
                if (item.state && (item.state === "STARTED")) {
                    img_element_init.style.display = "block";
                    img_element_fail.style.display = "none";
                    img_element_ok.style.display = "none";
                } else if (item.state && item.state === "COMPLETED") {
                    img_element_init.style.display = "none";
                    img_element_fail.style.display = "none";
                    img_element_ok.style.display = "block";
                } else if (item.state && item.state === "FAILED") {
                    img_element_init.style.display = "none";
                    img_element_fail.style.display = "block";
                    img_element_ok.style.display = "none";
                } else if (item.state && item.state === "KILLED") {
                    img_element_init.style.display = "none";
                    img_element_fail.style.display = "block";
                    img_element_ok.style.display = "none";
                }
            }
        }

        if (svg_element && img_element_init && img_element_ok && img_element_fail) {
            var g_element = document.createElementNS("http://www.w3.org/2000/svg", "g");
            g_element.appendChild(img_element_init);
            g_element.appendChild(img_element_ok);
            g_element.appendChild(img_element_fail);
            svg_element.append(g_element);
        }
    });
    changIconTranslate();
}

// chang icon translate
function changIconTranslate() {
    var iconPositionElementArr = document.querySelectorAll("div[style='display: inline-block; font-size: 1px; font-family: PiFlow; color: #FFFFFF; line-height: 1.2; pointer-events: all; white-space: nowrap; ']");
    if (iconPositionElementArr && iconPositionElementArr.length > 0) {
        var iconPositionArr = {};
        iconPositionElementArr.forEach(item => {
            var x_y_div = item.parentElement.parentElement.style;
            var x_Position = x_y_div['margin-left'].replace("px", "");
            var y_Position = x_y_div['padding-top'].replace("px", "");
            iconPositionArr['stopLoadingShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopFailShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopOkShow' + item.textContent] = {x: x_Position, y: y_Position};
        });
        var imgsArr = document.querySelectorAll("image[PiFlow_IMG='IMG']");
        imgsArr.forEach(item => {
            var iconPosition = iconPositionArr[item.id]
            if (iconPosition) {
                item.setAttribute("transform", "translate(" + iconPosition.x + "," + iconPosition.y + ")");
            }
        });
    }
}

//Erase drawing board records
function eraseRecord() {
    thisEditor.lastSnapshot = new Date().getTime();
    thisEditor.undoManager.clear();
    thisEditor.ignoredChanges = 0;
    thisEditor.setModified(false);
}

//Double-click monitoring events
function OpenTheMonitorArtBoard(evt) {
    var cellFor = evt.properties.cell;
    if (cellFor.style && (cellFor.style).indexOf("text\;") === 0) {
    } else {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/processGroup/getProcessIdByPageId",//This is the name of the file where I receive data in the background.
            data: {
                processGroupId: loadId,
                pageId: cellFor.id
            },
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.msg(' failed', {icon: 2, shade: 0, time: 1000});
                return;
            },
            success: function (data) {//Operation after request successful
                if (data) {
                    var dataMap = JSON.parse(data);
                    if (200 === dataMap.code) {
                        if ('flow' === dataMap.nodeType) {
                            window_location_href("/page/process/mxGraph/index.html?drawingBoardType=PROCESS&parentAccessPath=processGroupList&processType=PROCESS&load=" + dataMap.processId);
                        } else if ('flowGroup' === dataMap.nodeType) {
                            window_location_href("/page/processGroup/mxGraph/index.html?drawingBoardType=PROCESS&parentAccessPath=processGroupList&processType=PROCESS_GROUP&load=" + dataMap.processGroupId);
                        }
                    }
                } else {
                    layer.msg(' failed', {icon: 2, shade: 0, time: 1000});
                }
            }
        });
    }
}

// processGroup mxEventClick
function processGroupMxEventClick(cell) {
    if (index) {
        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        index = false
    }

    if (cell && cell.style && (cell.style).indexOf("image\;") === 0 && processType == "GROUP") {
        //node info
        queryNodeInfo(loadId, cell.id);

    } else if (cell == undefined || cell && cell.style && (cell.style).indexOf("text\;") === 0) {
        // ProcessGroup info
        queryProcessGroup(loadId);
    } else {
        // path
        queryPathInfo(loadId, cell.id);
    }

}

// query processGroup info
function queryProcessGroup(loadId) {
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/processGroup/queryProcessGroup",
        data: {processGroupId: loadId},
        async: true,
        error: function (request) {
            return;
        },
        success: function (data) {
            $("#right-group")[0].innerHTML = data
        }
    });
}

// query node info
function queryNodeInfo(loadId, pageId) {
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/processGroup/queryProcess",
        data: {
            pageId: pageId,
            processGroupId: loadId
        },
        async: true,
        error: function (request) {
            return;
        },
        success: function (data) {
            $("#right-group")[0].innerHTML = data
        }
    });
}

// query path info
function queryPathInfo(loadId, pageId) {
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/processGroup/queryProcessGroupPath",
        data: {
            pageId: pageId,
            processGroupId: loadId
        },
        async: true,
        error: function (request) {
            return;
        },
        success: function (data) {
            $("#right-group")[0].innerHTML = data
        }
    })
}

window.onresize = function (e) {
    setTimeout(() => {
        changIconTranslate()
    }, 300);
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/common/Eunm/PortType.java<|end_filename|>
package cn.cnic.common.Eunm;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cn.cnic.base.TextureEnumSerializer;
import org.apache.commons.lang3.StringUtils;

@JsonSerialize(using = TextureEnumSerializer.class)
public enum PortType {
    ANY("Any", "Any", "Any quantity"),
    DEFAULT("Default", "Default", "Default number 1"),
    USER_DEFAULT("UserDefault", "UserDefault", " 'stop' defines ports"),
    NONE("None", "None", "prohibit"),
    ROUTE("Route", "Route", "Routing port");

    private final String value;
    private final String text;
    private final String desc;

    private PortType(String text, String value, String desc) {
        this.text = text;
        this.value = value;
        this.desc = desc;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static PortType selectGender(String name) {
        if (StringUtils.isBlank(name)) {
            return PortType.DEFAULT;
        }
        for (PortType portType : PortType.values()) {
            if (name.equalsIgnoreCase(portType.name())) {
                return portType;
            }
        }
        return null;
    }

    public static PortType selectGenderByValue(String value) {
        if (StringUtils.isBlank(value)) {
            return PortType.DEFAULT;
        }
        for (PortType portType : PortType.values()) {
            if (value.equalsIgnoreCase(portType.value)) {
                return portType;
            }
        }
        return null;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/mapper/TestDataMapper.java<|end_filename|>
package cn.cnic.component.testData.mapper;

import cn.cnic.component.testData.entity.TestData;
import cn.cnic.component.testData.mapper.provider.TestDataMapperProvider;
import cn.cnic.component.testData.vo.TestDataVo;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

@Mapper
public interface TestDataMapper {

    /**
     * add TestData
     * 
     * @param testData
     * @return Integer
     */
    @InsertProvider(type = TestDataMapperProvider.class, method = "addTestData")
    public Integer addTestData(TestData testData);

    /**
     * update TestData
     * 
     * @param testData
     * @return Integer
     */
    @UpdateProvider(type = TestDataMapperProvider.class, method = "updateTestData")
    public Integer updateTestData(TestData testData);

    /**
     * update TestData enable_flag
     * 
     * @param isAdmin
     * @param username
     * @param id
     * @return Integer
     */
    @UpdateProvider(type = TestDataMapperProvider.class,method = "delTestDataById")
    public Integer delTestDataById(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("id") String id);

    /**
     * get TestData by id
     * 
     * @param id
     * @return TestData
     */
    @Select("select * from test_data where enable_flag=1 and id=#{id} ")
    @Results({
        @Result(id = true, column = "id", property = "id"),
        @Result(column = "id", property = "schemaList", many = @Many(select = "cn.cnic.component.testData.mapper.TestDataSchemaMapper.getTestDataSchemaListByTestDataId", fetchType = FetchType.LAZY)),
        @Result(column = "id", property = "schemaValuesList", many = @Many(select = "cn.cnic.component.testData.mapper.TestDataSchemaValuesMapper.getTestDataSchemaValuesListByTestDataId", fetchType = FetchType.LAZY))
    })
    public TestData getTestDataById(String id);
    
    /**
     * get TestData by id, Do not perform related queries
     * 
     * @param id
     * @return TestData
     */
    @Select("select * from test_data where enable_flag=1 and id=#{id} ")
    public TestData getTestDataByIdOnly(String id);
    
    /**
     * get TestDataVo by id
     * 
     * @param id
     * @return TestDataVo
     */
    @Select("select * from test_data where enable_flag=1 and id=#{id} ")
    public TestDataVo getTestDataVoById(String id);
    
    /**
     * search TestData List
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @return
     */
    @SelectProvider(type = TestDataMapperProvider.class,method = "getTestDataList")
    public List<TestData> getTestDataList(boolean isAdmin, String username, String param);
    
    /**
     * search TestDataVo List
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @return
     */
    @SelectProvider(type = TestDataMapperProvider.class,method = "getTestDataList")
    public List<TestDataVo> getTestDataVoList(boolean isAdmin, String username, String param);

    /**
     * get TestDataVo by id
     *
     * @param testDataName
     * @return TestDataVo
     */
    @Select("SELECT name FROM test_data WHERE enable_flag=1 and name=#{testDataName} ")
    public String getTestDataName(String testDataName);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/config/jwt/CustomUserDetailsService.java<|end_filename|>
package cn.cnic.base.config.jwt;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

import cn.cnic.base.vo.UserVo;
import cn.cnic.common.Eunm.SysRoleType;
import cn.cnic.component.system.mapper.SysMenuMapper;
import cn.cnic.component.system.mapper.SysUserMapper;
import cn.cnic.component.system.entity.SysMenu;
import cn.cnic.component.system.entity.SysRole;
import cn.cnic.component.system.entity.SysUser;
import cn.cnic.component.system.vo.SysMenuVo;

/**
 * 登陆身份认证
 */
@Component
public class CustomUserDetailsService implements UserDetailsService {

    @Autowired
    private SysUserMapper sysUserMapper;
    @Autowired
    private SysMenuMapper sysMenuMapper;

    @Override
    public UserVo loadUserByUsername(String username) throws UsernameNotFoundException {

        UserVo userVo = null;
        SysUser sysUser = sysUserMapper.findUserByUserName(username);
        if (sysUser == null) {
            throw new UsernameNotFoundException(String.format("No user found with username '%s'.", username));
        }
        if (null != sysUser) {
            userVo = new UserVo();
            userVo.setUsername(sysUser.getUsername());
            userVo.setPassword(sysUser.getPassword());
            userVo.setName(sysUser.getName());
            userVo.setAge(sysUser.getAge());
            List<SysRole> sysRoleTypes = sysUser.getRoles();
            userVo.setRoles(sysRoleTypes);
            if (CollectionUtils.isNotEmpty(sysRoleTypes)) {
                SysRoleType sysRoleHighest = null;
                String[] valueArray = new String[sysRoleTypes.size()];
                for (int i = 0; i < sysRoleTypes.size(); i++) {
                    SysRole sysRole = sysRoleTypes.get(i);
                    if (null != sysRole && null != sysRole.getRole()) {
                        SysRoleType role = sysRole.getRole();
                        valueArray[i] = sysRole.getRole().getValue();
                        if (role == SysRoleType.ADMIN) {
                            sysRoleHighest = role;
                        }
                    }

                }
                if (valueArray.length > 0) {
                    userVo.setAuthorities(AuthorityUtils.createAuthorityList(valueArray));
                    if (null == sysRoleHighest) {
                        sysRoleHighest = SysRoleType.USER;
                    }
                }
                List<SysMenu> sysMenuList = sysMenuMapper.getSysMenuList(sysRoleHighest.getValue());
                if (CollectionUtils.isNotEmpty(sysMenuList)) {
                    List<SysMenuVo> sysMenuVoList = new ArrayList<>();
                    SysMenuVo sysMenuVo;
                    for (SysMenu sysMenu : sysMenuList) {
                        sysMenuVo = new SysMenuVo();
                        BeanUtils.copyProperties(sysMenu, sysMenuVo);
                        sysMenuVoList.add(sysMenuVo);
                    }
                    userVo.setSysMenuVoList(sysMenuVoList);
                }
            }
        }
        return userVo;

    }
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/common/Eunm/FlowState.java<|end_filename|>
package cn.cnic.common.Eunm;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cn.cnic.base.TextureEnumSerializer;

@JsonSerialize(using = TextureEnumSerializer.class)
public enum FlowState {
    STARTED("STARTED", "start up"),
    COMPLETED("COMPLETED", "completed"),
    HOME("FAILED", "failed"),
    ABORTED("ABORTED", "aborted"),
    FORK("FORK", "FORK");

    private final String value;
    private final String text;

    private FlowState(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public static FlowState selectGender(String name) {
        for (FlowState portType : FlowState.values()) {
            if (name.equalsIgnoreCase(portType.name())) {
                return portType;
            }
        }
        return null;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/entity/TestDataSchemaValues.java<|end_filename|>
package cn.cnic.component.testData.entity;

import cn.cnic.base.BaseHibernateModelUUIDNoCorpAgentId;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TestDataSchemaValues extends BaseHibernateModelUUIDNoCorpAgentId {

    private static final long serialVersionUID = 1L;

    private String fieldValue;
    private int dataRow;
    private TestData testData;
    private TestDataSchema testDataSchema;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/mapper/provider/StopsMapperProvider.java<|end_filename|>
package cn.cnic.component.flow.mapper.provider;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.flow.entity.Stops;
import cn.cnic.third.vo.flow.ThirdFlowInfoStopVo;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class StopsMapperProvider {

    private String id;
    private String lastUpdateDttmStr;
    private String lastUpdateUser;
    private int enableFlag;
    private long version;
    private String bundel;
    private String description;
    private String groups;
    private String name;
    private String inports;
    private String inPortType;
    private String outports;
    private String outPortType;
    private String owner;
    private String pageId;
    private Integer checkpoint;
    private int isCustomized;
    private String flowId;
    private String dataSourceId;

    private boolean preventSQLInjectionStops(Stops stops) {
        if (null == stops || StringUtils.isBlank(stops.getLastUpdateUser())) {
            return false;
        }
        // Mandatory Field
        String id = stops.getId();
        String lastUpdateUser = stops.getLastUpdateUser();
        Boolean enableFlag = stops.getEnableFlag();
        Long version = stops.getVersion();
        Date lastUpdateDttm = stops.getLastUpdateDttm();
        this.id = SqlUtils.preventSQLInjection(id);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(lastUpdateUser);
        this.enableFlag = ((null != enableFlag && enableFlag) ? 1 : 0);
        this.version = (null != version ? version : 0L);
        String lastUpdateDttmStr = DateUtils.dateTimesToStr(null != lastUpdateDttm ? lastUpdateDttm : new Date());
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttmStr);

        // Selection field
        this.bundel = SqlUtils.preventSQLInjection(stops.getBundel());
        this.description = SqlUtils.preventSQLInjection(stops.getDescription());
        this.groups = SqlUtils.preventSQLInjection(stops.getGroups());
        this.name = SqlUtils.preventSQLInjection(stops.getName());
        this.inports = SqlUtils.preventSQLInjection(stops.getInports());
        this.inPortType = SqlUtils.preventSQLInjection(null != stops.getInPortType() ? stops.getInPortType().name() : null);
        this.outports = SqlUtils.preventSQLInjection(stops.getOutports());
        this.outPortType = SqlUtils.preventSQLInjection(null != stops.getOutPortType() ? stops.getOutPortType().name() : null);
        this.owner = SqlUtils.preventSQLInjection(stops.getOwner());
        this.pageId = SqlUtils.preventSQLInjection(stops.getPageId());
        this.checkpoint = ((null != stops.getIsCheckpoint() && stops.getIsCheckpoint()) ? 1 : 0);
        this.isCustomized = ((null != stops.getIsCustomized() && stops.getIsCustomized()) ? 1 : 0);
        String flowIdStr = (null != stops.getFlow() ? stops.getFlow().getId() : null);
        this.flowId = (null != flowIdStr ? SqlUtils.preventSQLInjection(flowIdStr) : null);
        String dataSourceIdStr = (null != stops.getDataSource() ? stops.getDataSource().getId() : null);
        this.dataSourceId = (null != dataSourceIdStr ? SqlUtils.preventSQLInjection(dataSourceIdStr) : null);
        return true;
    }

    private void reset() {
        this.id = null;
        this.lastUpdateDttmStr = null;
        this.lastUpdateUser = null;
        this.enableFlag = 1;
        this.version = 0L;
        this.bundel = null;
        this.description = null;
        this.groups = null;
        this.name = null;
        this.inports = null;
        this.inPortType = null;
        this.outports = null;
        this.outPortType = null;
        this.owner = null;
        this.pageId = null;
        this.checkpoint = null;
        this.isCustomized = 0;
        this.flowId = null;
        this.dataSourceId = null;
    }

    /**
     * add Stops
     *
     * @param stops
     * @return
     */
    public String addStops(Stops stops) {
        String sqlStr = "SELECT 0";
        boolean flag = this.preventSQLInjectionStops(stops);
        if (flag) {
            StringBuffer stringBuffer = new StringBuffer();
            stringBuffer.append("INSERT INTO ");
            stringBuffer.append("flow_stops ");
            stringBuffer.append("(");
            stringBuffer.append(SqlUtils.baseFieldName() + ",");
            stringBuffer.append("bundel,description,groups,name,inports,in_port_type,outports,out_port_type,owner,page_id,is_checkpoint,is_customized,fk_flow_id,fk_data_source_id");
            stringBuffer.append(") ");
            stringBuffer.append("VALUES");
            stringBuffer.append("(");
            stringBuffer.append(SqlUtils.baseFieldValues(stops) + ",");
            stringBuffer.append(this.bundel + ",");
            stringBuffer.append(this.description + ",");
            stringBuffer.append(this.groups + ",");
            stringBuffer.append(this.name + ",");
            stringBuffer.append(this.inports + ",");
            stringBuffer.append(this.inPortType + ",");
            stringBuffer.append(this.outports + ",");
            stringBuffer.append(this.outPortType + ",");
            stringBuffer.append(this.owner + ",");
            stringBuffer.append(this.pageId + ",");
            stringBuffer.append(this.checkpoint + ",");
            stringBuffer.append(this.isCustomized + ",");
            stringBuffer.append(this.flowId + ",");
            stringBuffer.append(this.dataSourceId);
            stringBuffer.append(")");
            sqlStr = stringBuffer.toString();
        }
        this.reset();
        return sqlStr;
    }

    /**
     * Insert list<Stops> Note that the method of spelling sql must use Map to connect Param content to key value.
     *
     * @param map (Content: The key is stopsList and the value is List<Stops>)
     * @return
     */
    @SuppressWarnings({"unchecked", "rawtypes"})
    public String addStopsList(Map map) {
        List<Stops> stopsList = (List<Stops>) map.get("stopsList");
        StringBuffer sql = new StringBuffer();
        if (null != stopsList && stopsList.size() > 0) {
            sql.append("INSERT INTO ");
            sql.append("flow_stops ");
            sql.append("(");
            sql.append(SqlUtils.baseFieldName() + ",");            
            sql.append("bundel,");
            sql.append("description,");
            sql.append("groups,");
            sql.append("name,");
            sql.append("inports,");
            sql.append("in_port_type,");
            sql.append("outports,");
            sql.append("out_port_type,");
            sql.append("owner,");
            sql.append("page_id,");
            sql.append("is_checkpoint,");
            sql.append("is_customized,");
            sql.append("fk_flow_id,");
            sql.append("fk_data_source_id");
            sql.append(") ");
            sql.append("VALUES");
            int i = 0;
            for (Stops stops : stopsList) {
                i++;
                boolean flag = this.preventSQLInjectionStops(stops);
                if (flag) {
                    sql.append("(");
                    sql.append(SqlUtils.baseFieldValues(stops) + ",");
                    // handle other fields
                    sql.append(bundel + ",");
                    sql.append(description + ",");
                    sql.append(groups + ",");
                    sql.append(name + ",");
                    sql.append(inports + ",");
                    sql.append(inPortType + ",");
                    sql.append(outports + ",");
                    sql.append(outPortType + ",");
                    sql.append(owner + ",");
                    sql.append(pageId + ",");
                    sql.append(checkpoint + ",");
                    sql.append(isCustomized + ",");
                    sql.append(flowId + ",");
                    sql.append(dataSourceId);
                    if (i != stopsList.size()) {
                        sql.append("),");
                    } else {
                        sql.append(")");
                    }
                }
                this.reset();
            }
            sql.append(";");
        }
        return sql.toString();
    }

    /**
     * update stops
     *
     * @param stops
     * @return
     */
    public String updateStops(Stops stops) {
        String sqlStr = "";
        boolean flag = this.preventSQLInjectionStops(stops);
        if (flag) {
            SQL sql = new SQL();

            sql.UPDATE("flow_stops");

            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + enableFlag);
            sql.SET("bundel = " + bundel);
            sql.SET("description = " + description);
            sql.SET("groups = " + groups);
            sql.SET("name = " + name);
            sql.SET("inports = " + inports);
            sql.SET("in_port_type = " + inPortType);
            sql.SET("outports = " + outports);
            sql.SET("out_port_type = " + outPortType);
            sql.SET("owner = " + owner);
            sql.SET("is_checkpoint = " + checkpoint);
            sql.SET("fk_data_source_id = " + dataSourceId);
            sql.WHERE("version = " + version);
            sql.WHERE("id = " + id);
            sqlStr = sql.toString();
            if (StringUtils.isBlank(id)) {
                sqlStr = "";
            }
        }
        this.reset();
        return sqlStr;
    }

    /**
     * Query all stops data
     *
     * @return
     */
    public String getStopsList() {
        String sqlStr = "SELECT * FROM flow_stops WHERE enable_flag=1";
        return sqlStr;
    }

    /**
     * Query StopsList based on flowId
     *
     * @param flowId
     * @return
     */
    public String getStopsListByFlowId(String flowId) {
        String sqlStr = "";
        SQL sql = new SQL();
        sql.SELECT("*");
        sql.FROM("flow_stops");
        sql.WHERE("enable_flag = 1");
        sql.WHERE("fk_flow_id = " + SqlUtils.preventSQLInjection(flowId));
        sqlStr = sql.toString();
        return sqlStr;
    }

    /**
     * Query StopsList based on flowId
     *
     * @param map
     * @return
     */
    @SuppressWarnings("rawtypes")
    public String getStopsListByFlowIdAndPageIds(Map map) {
        String flowId = (String) map.get("flowId");
        String[] pageIds = (String[]) map.get("pageIds");
        String sqlStr = "";
        SQL sql = new SQL();
        sql.SELECT("*");
        sql.FROM("flow_stops");
        sql.WHERE("enable_flag = 1");
        sql.WHERE("fk_flow_id = " + SqlUtils.preventSQLInjection(flowId));
        if (null != pageIds && pageIds.length > 0) {
            StringBuffer pageIdsStr = new StringBuffer();
            pageIdsStr.append("( ");
            for (int i = 0; i < pageIds.length; i++) {
                String pageId = pageIds[i];
                pageIdsStr.append("page_id = " + SqlUtils.preventSQLInjection(pageId));
                if (i < pageIds.length - 1) {
                    pageIdsStr.append(" OR ");
                }
            }
            pageIdsStr.append(")");
            sql.WHERE(pageIdsStr.toString());
        }
        sqlStr = sql.toString();
        return sqlStr;
    }

    /**
     * Query according to stopsId
     *
     * @param Id
     * @return
     */
    public String getStopsById(String Id) {
        String sqlStr = "";
        SQL sql = new SQL();
        sql.SELECT("*");
        sql.FROM("flow_stops");
        sql.WHERE("enable_flag = 1");
        sql.WHERE("id = " + SqlUtils.preventSQLInjection(Id));
        sqlStr = sql.toString();
        return sqlStr;
    }

    /**
     * Modify the stop status information according to flowId and name
     *
     * @param stopVo
     * @return
     */
    public String updateStopsByFlowIdAndName(ThirdFlowInfoStopVo stopVo) {
        String sqlStr = "";
        SQL sql = new SQL();
        sql.UPDATE("flow_stops");
        Date endTime = DateUtils.strCstToDate(stopVo.getEndTime());
        Date startTime = DateUtils.strCstToDate(stopVo.getStartTime());
        String name = stopVo.getName();
        String state = stopVo.getState();
        String flowId = stopVo.getFlowId();
        if (null != endTime) {
            sql.SET("stop_time = " + SqlUtils.preventSQLInjection(DateUtils.dateTimeToStr(endTime)));
        }
        if (StringUtils.isNotBlank(state)) {
            sql.SET("state = " + SqlUtils.preventSQLInjection(state));
        }
        if (null != startTime) {
            sql.SET("start_time = " + SqlUtils.preventSQLInjection(DateUtils.dateTimeToStr(startTime)));
        }
        sql.WHERE("fk_flow_id = " + SqlUtils.preventSQLInjection(flowId));
        sql.WHERE("name = " + SqlUtils.preventSQLInjection(name));
        sqlStr = sql.toString();
        return sqlStr;
    }


    public String updateEnableFlagByFlowId(String username, String id) {
        if (StringUtils.isBlank(username)) {
            return "SELECT 0";
        }
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        SQL sql = new SQL();
        sql.UPDATE("flow_stops");
        sql.SET("enable_flag=0");
        sql.SET("last_update_user=" + SqlUtils.preventSQLInjection(username));
        sql.SET("last_update_dttm=" + SqlUtils.preventSQLInjection(DateUtils.dateTimesToStr(new Date())));
        sql.WHERE("enable_flag = 0");
        sql.WHERE("fk_flow_id=" + SqlUtils.preventSQLInjection(id));

        return sql.toString();
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/entity/NoteBook.java<|end_filename|>
package cn.cnic.component.livy.entity;

import cn.cnic.base.BaseHibernateModelUUIDNoCorpAgentId;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Setter
@Getter
public class NoteBook extends BaseHibernateModelUUIDNoCorpAgentId {

    private static final long serialVersionUID = 1L;

    private String name;
    private String description;
    private String sessionsId;
    private String codeType;
    private List<CodeSnippet> codeSnippetList = new ArrayList<>();


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/util/CodeSnippetUtils.java<|end_filename|>
package cn.cnic.component.livy.util;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.livy.entity.CodeSnippet;

import java.util.Date;

public class CodeSnippetUtils {

    public static CodeSnippet setCodeSnippetBasicInformation(CodeSnippet codeSnippet, boolean isSetId, String username) {
        if (null == codeSnippet) {
            codeSnippet = new CodeSnippet();
        }
        if (isSetId) {
            codeSnippet.setId(UUIDUtils.getUUID32());
        } else {
            codeSnippet.setId(null);
        }
        // set MxGraphModel basic information
        codeSnippet.setCrtDttm(new Date());
        codeSnippet.setCrtUser(username);
        codeSnippet.setLastUpdateDttm(new Date());
        codeSnippet.setLastUpdateUser(username);
        codeSnippet.setVersion(0L);
        return codeSnippet;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/flow/ThirdFlowInfoStopVo.java<|end_filename|>
package cn.cnic.third.vo.flow;

import java.io.Serializable;

public class ThirdFlowInfoStopVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String name;
    private String state;
    private String startTime;
    private String endTime;
    private String flowId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getFlowId() {
        return flowId;
    }

    public void setFlowId(String flowId) {
        this.flowId = flowId;
    }


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/template/mapper/FlowGroupTemplateMapper.java<|end_filename|>
package cn.cnic.component.template.mapper;

import cn.cnic.component.template.mapper.provider.FlowGroupTemplateMapperProvider;
import cn.cnic.component.template.vo.FlowGroupTemplateVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FlowGroupTemplateMapper {

    @SelectProvider(type = FlowGroupTemplateMapperProvider.class, method = "getFlowGroupTemplateVoListPage")
    @Results({
            @Result(id = true, column = "id", property = "id")
    })
    public List<FlowGroupTemplateVo> getFlowGroupTemplateVoListPage(@Param("username") String username, @Param("isAdmin") boolean isAdmin, @Param("param") String param);

    @SelectProvider(type = FlowGroupTemplateMapperProvider.class, method = "getFlowGroupTemplateVoById")
    @Results({
            @Result(id = true, column = "id", property = "id")
    })
    public FlowGroupTemplateVo getFlowGroupTemplateVoById(@Param("username") String username, @Param("isAdmin") boolean isAdmin, @Param("id") String id);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/service/IProcessAndProcessGroupService.java<|end_filename|>
package cn.cnic.component.process.service;


public interface IProcessAndProcessGroupService {

    /**
     * Query ProcessAndProcessGroupVoList (parameter space-time non-paging)
     *
     * @param offset Number of pages
     * @param limit  Number each page
     * @param param  Search content
     * @return json
     */
    public String getProcessAndProcessGroupListPage(String username, boolean isAdmin, Integer offset, Integer limit, String param);

    /**
     * getAppInfoList
     *
     * @param taskAppIds task appId array
     * @param groupAppIds group appId array
     * @return json
     */
    public String getAppInfoList(String[] taskAppIds,String[] groupAppIds);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/mapper/ProcessPathMapper.java<|end_filename|>
package cn.cnic.component.process.mapper;

import cn.cnic.component.process.entity.ProcessPath;
import cn.cnic.component.process.mapper.provider.ProcessPathMapperProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProcessPathMapper {


    /**
     * add processPath
     *
     * @param processPath
     * @return
     */
    @InsertProvider(type = ProcessPathMapperProvider.class, method = "addProcessPath")
    public int addProcessPath(ProcessPath processPath);

    /**
     * add processPath
     *
     * @param processPathList
     * @return
     */
    @InsertProvider(type = ProcessPathMapperProvider.class, method = "addProcessPathList")
    public int addProcessPathList(@Param("processPathList") List<ProcessPath> processPathList);

    /**
     * Query processPath according to process Id
     *
     * @param processId
     * @return
     */
    @SelectProvider(type = ProcessPathMapperProvider.class, method = "getProcessPathByProcessId")
    @Results({
            @Result(column = "line_from", property = "from"),
            @Result(column = "line_outport", property = "outport"),
            @Result(column = "line_inport", property = "inport"),
            @Result(column = "line_to", property = "to")
    })
    public ProcessPath getProcessPathByProcessId(String processId);

    /**
     * Query based on pid and pageId
     *
     * @param processId
     * @param pageId
     * @return
     */
    @SelectProvider(type = ProcessPathMapperProvider.class, method = "getProcessPathByPageIdAndPid")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "line_from", property = "from"),
            @Result(column = "line_outport", property = "outport"),
            @Result(column = "line_inport", property = "inport"),
            @Result(column = "line_to", property = "to")
    })
    public ProcessPath getProcessPathByPageIdAndPid(String processId, String pageId);

    /**
     * update processPath
     *
     * @param processPath
     * @return
     */
    @UpdateProvider(type = ProcessPathMapperProvider.class, method = "updateProcessPath")
    public int updateProcessPath(ProcessPath processPath);

    @UpdateProvider(type = ProcessPathMapperProvider.class, method = "updateEnableFlagByProcessId")
    public int updateEnableFlagByProcessId(String processId, String userName);

    /**
     * Query based on processGroupId and pageId
     *
     * @param processGroupId
     * @param pageId
     * @return
     */
    @SelectProvider(type = ProcessPathMapperProvider.class, method = "getProcessPathByPageIdAndProcessGroupId")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "line_from", property = "from"),
            @Result(column = "line_outport", property = "outport"),
            @Result(column = "line_inport", property = "inport"),
            @Result(column = "line_to", property = "to")
    })
    public ProcessPath getProcessPathByPageIdAndProcessGroupId(String processGroupId, String pageId);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/system/mapper/provider/SysRoleMapperProvider.java<|end_filename|>
package cn.cnic.component.system.mapper.provider;

import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.system.entity.SysRole;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Map;


public class SysRoleMapperProvider {


    /**
     * getSysRoleListBySysUserId
     *
     * @param sysUserId
     * @return
     */
    public String getSysRoleListBySysUserId(String sysUserId) {
        String strSql = "SELECT 0";
        if (StringUtils.isNotBlank(sysUserId)) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("select * ");
            strBuf.append("from sys_role ");
            strBuf.append("where ");
            strBuf.append("fk_sys_user_id = '" + sysUserId + "'");
            strSql = strBuf.toString();
        }
        return strSql;
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public String insertSysRoleList(Map map) {
        List<SysRole> roles = (List<SysRole>) map.get("roles");
        String userId = (String) map.get("userId");
        if (null == roles || roles.isEmpty() || StringUtils.isBlank(userId)) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("INSERT INTO sys_role ");
        strBuf.append("(id,role,fk_sys_user_id)");
        strBuf.append("values");
        SysRole sysRole;
        for (int i = 0; i < roles.size(); i++) {
            sysRole = roles.get(i);
            if (null == sysRole) {
                continue;
            }
            if (i != 0 && roles.size() - 1 > i) {
                strBuf.append(",(");
            } else {
                strBuf.append("(");
            }
            strBuf.append(sysRole.getId() + ", ");
            strBuf.append(SqlUtils.preventSQLInjection(sysRole.getRole().name()) + ", ");
            strBuf.append(SqlUtils.preventSQLInjection(userId));
            strBuf.append(")");

        }
        return strBuf.toString();

    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/controller/requestVo/TestDataSchemaValuesSaveVo.java<|end_filename|>
package cn.cnic.controller.requestVo;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
@ApiModel(description = "save TestData")
public class TestDataSchemaValuesSaveVo implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    

    @ApiModelProperty(value = "testData Id", required = true)
    private String testDataId;
    
    @ApiModelProperty(value = "schemaValues")
    private SchemaValuesVo[] schemaValuesList;
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/flow/ThirdFlowInfoVo.java<|end_filename|>
package cn.cnic.third.vo.flow;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class ThirdFlowInfoVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;
    private String pid;
    private String name;
    private String state;
    private String startTime;
    private String endTime;
    private String progress;

    List<ThirdFlowInfoStopsVo> stops = new ArrayList<ThirdFlowInfoStopsVo>();

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/system/vo/SysScheduleVo.java<|end_filename|>
package cn.cnic.component.system.vo;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.common.Eunm.ScheduleRunResultType;
import cn.cnic.common.Eunm.ScheduleState;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

@Getter
@Setter
public class SysScheduleVo implements Serializable {

    private static final long serialVersionUID = 1L;
    
    private String id;
    private Date crtDttm;
    private Date lastUpdateDttm;
    private String jobName;
    private String jobClass;
    private String cronExpression;
    private ScheduleState status;
    private ScheduleRunResultType lastRunResult;
    private String description;

    /**
     * @return yyyy-MM-dd HH:mm:ss ,such as 2012-12-25 20:20:20
     */
    public String getCrtDttmString() {
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN_yyyy_MM_dd_HH_MM_ss);
        return crtDttm != null ? sdf.format(crtDttm) : "";
    }

    /**
     * @return yyyy-MM-dd HH:mm:ss ,such as 2012-12-25 20:20:20
     */
    public String getLastUpdateDttmString() {
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN_yyyy_MM_dd_HH_MM_ss);
        return lastUpdateDttm != null ? sdf.format(lastUpdateDttm) : "";
    }
}


<|start_filename|>piflow-web/src/main/resources/static/components/load/progressLoading.css<|end_filename|>
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline
}

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
    display: block
}

body {
    line-height: 1
}

ol, ul {
    list-style: none
}

blockquote, q {
    quotes: none
}

blockquote:before, blockquote:after, q:before, q:after {
    content: '';
    content: none
}

table {
    border-collapse: collapse;
    border-spacing: 0
}

@import url(http://fonts.googleapis.com/css?family=Open+Sans:300);
*, *:before, *:after {
    box-sizing: border-box;
}

body {
    font-size: 100%;
    font-family: "Open sans", Arial, sans-serif;
    color: white;
    background: #0C0C0C;
}

.container {
    margin: 3rem auto;
    max-width: 600px;
}

@media (max-width: 610px) {
    .container {
        padding: 0 5%;
    }
}

.bar {
    height: 40px;
    width: 0;
    transition: width 1.2s ease-in-out;
    position: relative;
    /*margin: 0.5rem 0;*/
    border-radius: 4px;
}

@media (max-width: 350px) {
    .bar {
        margin: 2.5rem 0 0.5rem;
    }
}

.bar.mint {
    background-color: #14c3a2;
    background-image: repeating-linear-gradient(-45deg, #14c3a2, #14c3a2 30px, #22e8c3 30px, #22e8c3 60px);
    background-size: 600px 100%;
    animation: barberpole 12s linear infinite;
    /*border-bottom: 0.2rem solid #0d7e68;*/
}

.bar.red {
    background-color: #cf4647;
    background-image: repeating-linear-gradient(-45deg, #cf4647, #cf4647 30px, #da6e6f 30px, #da6e6f 60px);
    background-size: 600px 100%;
    animation: barberpole 12s linear infinite;
    border-bottom: 0.2rem solid #9f292a;
}

.bar.orange {
    background-color: #eb7b59;
    background-image: repeating-linear-gradient(-45deg, #eb7b59, #eb7b59 30px, #f09f87 30px, #f09f87 60px);
    background-size: 600px 100%;
    animation: barberpole 12s linear infinite;
    border-bottom: 0.2rem solid #dd481b;
}

.bar.lila {
    background-color: #524656;
    background-image: repeating-linear-gradient(-45deg, #524656, #524656 30px, #6d5d72 30px, #6d5d72 60px);
    background-size: 600px 100%;
    animation: barberpole 12s linear infinite;
    border-bottom: 0.2rem solid #2a242c;
}

.bar.gray {
    background-color: #595b5a;
    background-image: repeating-linear-gradient(-45deg, #595b5a, #595b5a 30px, #727574 30px, #727574 60px);
    background-size: 600px 100%;
    animation: barberpole 12s linear infinite;
    border-bottom: 0.2rem solid #333434;
}

.bar.active:after, .bar.active:before {
    opacity: 1;
}

.bar:before {
    content: attr(data-skill);
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    padding: 10px;
    height: 40px;
    font-style: italic;
    opacity: 0;
    transition: opacity 2s 0.6s;
}

@media (max-width: 350px) {
    .bar:before {
        top: -100%;
        color: black;
        padding: 10px 0 0;
    }
}

.bar:after {
    content: attr(data-percent) "%";
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    height: 40px;
    padding: 10px;
    opacity: 0;
    transition: opacity 2s 0.6s;
}

@media (max-width: 350px) {
    .bar:after {
        left: 0;
    }
}

@keyframes barberpole {
    from {
        background-position: 0% 0%;
    }

    to {
        background-position: 600px 0%;
    }
}

.bar.active[data-percent="1"] {
    width: 1%;
}

.bar.active[data-percent="2"] {
    width: 2%;
}

.bar.active[data-percent="3"] {
    width: 3%;
}

.bar.active[data-percent="4"] {
    width: 4%;
}

.bar.active[data-percent="5"] {
    width: 5%;
}

.bar.active[data-percent="6"] {
    width: 6%;
}

.bar.active[data-percent="7"] {
    width: 7%;
}

.bar.active[data-percent="8"] {
    width: 8%;
}

.bar.active[data-percent="9"] {
    width: 9%;
}

.bar.active[data-percent="10"] {
    width: 10%;
}

.bar.active[data-percent="11"] {
    width: 11%;
}

.bar.active[data-percent="12"] {
    width: 12%;
}

.bar.active[data-percent="13"] {
    width: 13%;
}

.bar.active[data-percent="14"] {
    width: 14%;
}

.bar.active[data-percent="15"] {
    width: 15%;
}

.bar.active[data-percent="16"] {
    width: 16%;
}

.bar.active[data-percent="17"] {
    width: 17%;
}

.bar.active[data-percent="18"] {
    width: 18%;
}

.bar.active[data-percent="19"] {
    width: 19%;
}

.bar.active[data-percent="20"] {
    width: 20%;
}

.bar.active[data-percent="21"] {
    width: 21%;
}

.bar.active[data-percent="22"] {
    width: 22%;
}

.bar.active[data-percent="23"] {
    width: 23%;
}

.bar.active[data-percent="24"] {
    width: 24%;
}

.bar.active[data-percent="25"] {
    width: 25%;
}

.bar.active[data-percent="26"] {
    width: 26%;
}

.bar.active[data-percent="27"] {
    width: 27%;
}

.bar.active[data-percent="28"] {
    width: 28%;
}

.bar.active[data-percent="29"] {
    width: 29%;
}

.bar.active[data-percent="30"] {
    width: 30%;
}

.bar.active[data-percent="31"] {
    width: 31%;
}

.bar.active[data-percent="32"] {
    width: 32%;
}

.bar.active[data-percent="33"] {
    width: 33%;
}

.bar.active[data-percent="34"] {
    width: 34%;
}

.bar.active[data-percent="35"] {
    width: 35%;
}

.bar.active[data-percent="36"] {
    width: 36%;
}

.bar.active[data-percent="37"] {
    width: 37%;
}

.bar.active[data-percent="38"] {
    width: 38%;
}

.bar.active[data-percent="39"] {
    width: 39%;
}

.bar.active[data-percent="40"] {
    width: 40%;
}

.bar.active[data-percent="41"] {
    width: 41%;
}

.bar.active[data-percent="42"] {
    width: 42%;
}

.bar.active[data-percent="43"] {
    width: 43%;
}

.bar.active[data-percent="44"] {
    width: 44%;
}

.bar.active[data-percent="45"] {
    width: 45%;
}

.bar.active[data-percent="46"] {
    width: 46%;
}

.bar.active[data-percent="47"] {
    width: 47%;
}

.bar.active[data-percent="48"] {
    width: 48%;
}

.bar.active[data-percent="49"] {
    width: 49%;
}

.bar.active[data-percent="50"] {
    width: 50%;
}

.bar.active[data-percent="51"] {
    width: 51%;
}

.bar.active[data-percent="52"] {
    width: 52%;
}

.bar.active[data-percent="53"] {
    width: 53%;
}

.bar.active[data-percent="54"] {
    width: 54%;
}

.bar.active[data-percent="55"] {
    width: 55%;
}

.bar.active[data-percent="56"] {
    width: 56%;
}

.bar.active[data-percent="57"] {
    width: 57%;
}

.bar.active[data-percent="58"] {
    width: 58%;
}

.bar.active[data-percent="59"] {
    width: 59%;
}

.bar.active[data-percent="60"] {
    width: 60%;
}

.bar.active[data-percent="61"] {
    width: 61%;
}

.bar.active[data-percent="62"] {
    width: 62%;
}

.bar.active[data-percent="63"] {
    width: 63%;
}

.bar.active[data-percent="64"] {
    width: 64%;
}

.bar.active[data-percent="65"] {
    width: 65%;
}

.bar.active[data-percent="66"] {
    width: 66%;
}

.bar.active[data-percent="67"] {
    width: 67%;
}

.bar.active[data-percent="68"] {
    width: 68%;
}

.bar.active[data-percent="69"] {
    width: 69%;
}

.bar.active[data-percent="70"] {
    width: 70%;
}

.bar.active[data-percent="71"] {
    width: 71%;
}

.bar.active[data-percent="72"] {
    width: 72%;
}

.bar.active[data-percent="73"] {
    width: 73%;
}

.bar.active[data-percent="74"] {
    width: 74%;
}

.bar.active[data-percent="75"] {
    width: 75%;
}

.bar.active[data-percent="76"] {
    width: 76%;
}

.bar.active[data-percent="77"] {
    width: 77%;
}

.bar.active[data-percent="78"] {
    width: 78%;
}

.bar.active[data-percent="79"] {
    width: 79%;
}

.bar.active[data-percent="80"] {
    width: 80%;
}

.bar.active[data-percent="81"] {
    width: 81%;
}

.bar.active[data-percent="82"] {
    width: 82%;
}

.bar.active[data-percent="83"] {
    width: 83%;
}

.bar.active[data-percent="84"] {
    width: 84%;
}

.bar.active[data-percent="85"] {
    width: 85%;
}

.bar.active[data-percent="86"] {
    width: 86%;
}

.bar.active[data-percent="87"] {
    width: 87%;
}

.bar.active[data-percent="88"] {
    width: 88%;
}

.bar.active[data-percent="89"] {
    width: 89%;
}

.bar.active[data-percent="90"] {
    width: 90%;
}

.bar.active[data-percent="91"] {
    width: 91%;
}

.bar.active[data-percent="92"] {
    width: 92%;
}

.bar.active[data-percent="93"] {
    width: 93%;
}

.bar.active[data-percent="94"] {
    width: 94%;
}

.bar.active[data-percent="95"] {
    width: 95%;
}

.bar.active[data-percent="96"] {
    width: 96%;
}

.bar.active[data-percent="97"] {
    width: 97%;
}

.bar.active[data-percent="98"] {
    width: 98%;
}

.bar.active[data-percent="99"] {
    width: 99%;
}

.bar.active[data-percent="100"] {
    width: 100%;
}



<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/mapper/TestDataSchemaValuesMapper.java<|end_filename|>
package cn.cnic.component.testData.mapper;

import java.util.LinkedHashMap;
import java.util.List;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.mapping.FetchType;

import cn.cnic.component.testData.entity.TestDataSchemaValues;
import cn.cnic.component.testData.mapper.provider.TestDataSchemaValuesMapperProvider;

@Mapper
public interface TestDataSchemaValuesMapper {

    /**
     * add TestDataSchemaValues
     * 
     * @param testDataSchemaValues
     * @return
     */
    @InsertProvider(type = TestDataSchemaValuesMapperProvider.class, method = "addTestDataSchemaValues")
    public Integer addTestDataSchemaValues(TestDataSchemaValues testDataSchemaValues);

    /**
     * add TestDataSchemaValues list
     * 
     * @param testDataSchemaValuesList
     * @return
     */
    @InsertProvider(type = TestDataSchemaValuesMapperProvider.class, method = "addTestDataSchemaValuesList")
    public Integer addTestDataSchemaValuesList(List<TestDataSchemaValues> testDataSchemaValuesList);

    /**
     * update TestDataSchemaValues
     * 
     * @param testDataSchemaValues
     * @return
     */
    @UpdateProvider(type = TestDataSchemaValuesMapperProvider.class, method = "updateTestDataSchemaValues")
    public Integer updateTestDataSchemaValues(TestDataSchemaValues testDataSchemaValues);

    /**
     * update TestDataSchemaValues enable_flag
     * 
     * @param isAdmin
     * @param username
     * @param testDataId
     * @return
     */
    @UpdateProvider(type = TestDataSchemaValuesMapperProvider.class,method = "delTestDataSchemaValuesByTestDataId")
    public Integer delTestDataSchemaValuesByTestDataId(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("testDataId") String testDataId);

    /**
     * update TestDataSchemaValues enable_flag
     *
     * @param isAdmin
     * @param username
     * @param schemaId
     * @return
     */
    @UpdateProvider(type = TestDataSchemaValuesMapperProvider.class,method = "delTestDataSchemaValuesBySchemaId")
    public Integer delTestDataSchemaValuesBySchemaId(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("schemaId") String schemaId);
    
    /**
     * get TestDataSchemaValues list
     * @return
     */
    @Select("select * from test_data_schema_values where enable_flag=1 order by data_row asc ")
    @Results({
            @Result(column = "fk_test_data_schema_id", property = "testDataSchema", one = @One(select = "cn.cnic.component.testData.mapper.TestDataSchemaMapper.getTestDataSchemaById", fetchType = FetchType.LAZY)) 
    })
    public List<TestDataSchemaValues> getTestDataSchemaValuesList();
    
    /**
     * get TestDataSchemaValuesList by schemaId
     * 
     * @param schemaId
     * @return
     */
    @Select("select * from test_data_schema_values where enable_flag=1 and fk_test_data_schema_id=#{schemaId} order by data_row asc ")
    @Results({
            @Result(column = "fk_test_data_schema_id", property = "testDataSchema", one = @One(select = "cn.cnic.component.testData.mapper.TestDataSchemaMapper.getTestDataSchemaById", fetchType = FetchType.LAZY)) 
    })
    public List<TestDataSchemaValues> getTestDataSchemaValuesListBySchemaId(String schemaId);
    
    @Select("select * from test_data_schema_values where enable_flag=1 and id=#{id} order by data_row asc ")
    @Results({
            @Result(column = "fk_test_data_schema_id", property = "testDataSchema", one = @One(select = "cn.cnic.component.testData.mapper.TestDataSchemaMapper.getTestDataSchemaById", fetchType = FetchType.LAZY)) 
    })
    public TestDataSchemaValues getTestDataSchemaValuesById(String id);
    
    /**
     * get TestDataSchemaValuesList by schemaId
     * 
     * @param testDataId
     * @return
     */
    @Select("select * from test_data_schema_values where enable_flag=1 and fk_test_data_id=#{testDataId} order by data_row asc ")
    @Results({
        @Result(column = "fk_test_data_id", property = "testData", one = @One(select = "cn.cnic.component.testData.mapper.TestDataMapper.getTestDataByIdOnly", fetchType = FetchType.LAZY)),
        @Result(column = "fk_test_data_schema_id", property = "testDataSchema", one = @One(select = "cn.cnic.component.testData.mapper.TestDataSchemaMapper.getTestDataSchemaById", fetchType = FetchType.LAZY))
    })
    public List<TestDataSchemaValues> getTestDataSchemaValuesListByTestDataId(String testDataId);

    /**
     * get TestDataSchemaValues custom list
     * 
     * @param isAdmin
     * @param username
     * @param testDataId
     * @param map
     * @return
     */
    @SelectProvider(type = TestDataSchemaValuesMapperProvider.class, method = "getTestDataSchemaValuesCustomList")
    public List<LinkedHashMap<String, Object>> getTestDataSchemaValuesCustomList(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("testDataId") String testDataId, @Param("fieldNameList") List<LinkedHashMap<String, Object>> map);

    /**
     * get testDataSchemaValuesId custom list
     * @param isAdmin
     * @param username
     * @param testDataId
     * @param map
     * @return
     */
    @SelectProvider(type = TestDataSchemaValuesMapperProvider.class, method = "getTestDataSchemaValuesCustomListId")
    public List<LinkedHashMap<String, Object>> getTestDataSchemaValuesCustomListId(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("testDataId") String testDataId, @Param("fieldNameList") List<LinkedHashMap<String, Object>> map);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/mapper/TestDataSchemaMapper.java<|end_filename|>
package cn.cnic.component.testData.mapper;

import java.util.LinkedHashMap;
import java.util.List;

import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import cn.cnic.component.testData.entity.TestDataSchema;
import cn.cnic.component.testData.mapper.provider.TestDataSchemaMapperProvider;
import cn.cnic.component.testData.vo.TestDataSchemaVo;

@Mapper
public interface TestDataSchemaMapper {

    /**
     * add TestDataSchema
     * 
     * @param testDataSchema
     * @return Integer
     */
    @InsertProvider(type = TestDataSchemaMapperProvider.class, method = "addTestDataSchema")
    public Integer addTestDataSchema(TestDataSchema testDataSchema);

    /**
     * add TestDataSchema List
     * 
     * @param testDataSchemaList
     * @return
     */
    @InsertProvider(type = TestDataSchemaMapperProvider.class, method = "addTestDataSchemaList")    
    public Integer addTestDataSchemaList(List<TestDataSchema> testDataSchemaList);

    /**
     * update TestDataSchema
     * 
     * @param testDataSchema
     * @return
     */
    @UpdateProvider(type = TestDataSchemaMapperProvider.class, method = "updateTestDataSchema")
    public Integer updateTestDataSchema(TestDataSchema testDataSchema);

    /**
     * update TestDataSchema enable_flag
     * 
     * @param isAdmin
     * @param username
     * @param testDataId
     * @return
     */
    @UpdateProvider(type = TestDataSchemaMapperProvider.class,method = "delTestDataSchemaByTestDataId")
    public Integer delTestDataSchemaByTestDataId(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("testDataId") String testDataId);

    /**
     * update TestDataSchema enable_flag
     *
     * @param isAdmin
     * @param username
     * @param schemaId
     * @return
     */
    @UpdateProvider(type = TestDataSchemaMapperProvider.class,method = "delTestDataSchemaById")
    public Integer delTestDataSchemaById(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("schemaId") String schemaId);

    /**
     * get TestDataSchema by id
     * 
     * @param id
     * @return
     */
    @SelectProvider(type = TestDataSchemaMapperProvider.class,method = "getTestDataSchemaById")
    public TestDataSchema getTestDataSchemaById(String id);

    /**
     * get TestDataSchema list by testDataId
     * 
     * @param testDataId
     * @return
     */
    @Select("SELECT * FROM test_data_schema WHERE enable_flag=1 AND fk_test_data_id=#{testDataId} ORDER BY  field_soft ASC ")
    @Results({
        @Result(id = true, column = "id", property = "id"),
        //@Result(column = "id", property = "schemaValuesList", many = @Many(select = "cn.cnic.component.testData.mapper.TestDataSchemaValuesMapper.getTestDataSchemaValuesListBySchemaId", fetchType = FetchType.LAZY)) 
    })
    public List<TestDataSchema> getTestDataSchemaListByTestDataId(String testDataId);
    
    /**
     * get TestDataSchema list by testDataId page
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @param testDataId
     * @return
     */
    @SelectProvider(type = TestDataSchemaMapperProvider.class,method = "getTestDataSchemaListByTestDataIdSearch")
    public List<TestDataSchema> getTestDataSchemaListByTestDataIdSearch(boolean isAdmin, String username, String param, String testDataId);

    /**
     * get TestDataSchemaVo list by testDataId search
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @param testDataId
     * @return
     */
    @SelectProvider(type = TestDataSchemaMapperProvider.class,method = "getTestDataSchemaListByTestDataIdSearch")
    public List<TestDataSchemaVo> getTestDataSchemaVoListByTestDataIdSearch(boolean isAdmin, String username, String param, String testDataId);
    
    /**
     * get TestDataSchemaId and NameList by testDataId
     * 
     * @param testDataId
     * @return List<Map<String,String>> key1=ID key2=FIELD_NAME
     */
    @Select("SELECT TDS.id AS ID,TDS.field_name as FIELD_NAME FROM test_data_schema TDS WHERE TDS.enable_flag=1 AND TDS.fk_test_data_id=#{testDataId} ORDER BY TDS.field_soft ASC ")
    public List<LinkedHashMap<String,Object>> getTestDataSchemaIdAndNameListByTestDataId(String testDataId);



}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/utils/FlowUtil.java<|end_filename|>
package cn.cnic.component.flow.utils;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.flow.entity.*;
import cn.cnic.component.flow.vo.FlowVo;
import cn.cnic.component.flow.vo.PathsVo;
import cn.cnic.component.flow.vo.StopsVo;
import cn.cnic.component.mxGraph.entity.MxCell;
import cn.cnic.component.mxGraph.entity.MxGeometry;
import cn.cnic.component.mxGraph.entity.MxGraphModel;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class FlowUtil {

    public static Flow setFlowBasicInformation(Flow flow, boolean isSetId, String username) {
        if (null == flow) {
            flow = new Flow();
        }
        if (isSetId) {
            flow.setId(UUIDUtils.getUUID32());
        }
        //set MxGraphModel basic information
        flow.setCrtDttm(new Date());
        flow.setCrtUser(username);
        flow.setLastUpdateDttm(new Date());
        flow.setLastUpdateUser(username);
        flow.setVersion(0L);
        return flow;
    }

    /**
     * stopsList Po To Vo
     *
     * @param flowList
     * @return
     */
    public static List<FlowVo> flowListPoToVo(List<Flow> flowList) {
        List<FlowVo> flowVoList = null;
        if (null != flowList && flowList.size() > 0) {
            flowVoList = new ArrayList<>();
            for (Flow flow : flowList) {
                FlowVo flowVo = flowPoToVo(flow);
                if (null != flowVo) {
                    flowVoList.add(flowVo);
                }
            }
        }
        return flowVoList;
    }

    /**
     * stop Po To Vo
     *
     * @param flow
     * @return
     */
    public static FlowVo flowPoToVo(Flow flow) {
        FlowVo flowVo = null;
        if (null != flow) {
            flowVo = new FlowVo();
            BeanUtils.copyProperties(flow, flowVo);
            List<StopsVo> stopsVoList = StopsUtils.stopsListPoToVo(flow.getStopsList());
            List<PathsVo> pathsVoList = PathsUtil.pathsListPoToVo(flow.getPathsList());
            flowVo.setStopsVoList(stopsVoList);
            flowVo.setPathsVoList(pathsVoList);
        }
        return flowVo;
    }

    public static Flow copyCreateFlow(Flow flow, String username) {
        Flow flowNew = new Flow();
        //set MxGraphModel basic information
        flowNew.setCrtDttm(new Date());
        flowNew.setCrtUser(username);
        flowNew.setLastUpdateDttm(new Date());
        flowNew.setLastUpdateUser(username);
        // copy flow
        flowNew.setName(flow.getName());
        flowNew.setDriverMemory(flow.getDriverMemory());
        flowNew.setExecutorNumber(flow.getExecutorNumber());
        flowNew.setExecutorMemory(flow.getExecutorMemory());
        flowNew.setExecutorCores(flow.getExecutorCores());
        flowNew.setDescription(flow.getDescription());
        flowNew.setPageId(flow.getPageId());
        flowNew.setIsExample(flow.getIsExample());

        // get MxGraphModel
        MxGraphModel mxGraphModel = flow.getMxGraphModel();
        if (null != mxGraphModel) {
            MxGraphModel mxGraphModelNew = new MxGraphModel();
            // link Flow new
            mxGraphModelNew.setFlow(flowNew);
            //set MxGraphModel basic information
            mxGraphModelNew.setCrtDttm(new Date());
            mxGraphModelNew.setCrtUser(username);
            mxGraphModelNew.setLastUpdateDttm(new Date());
            mxGraphModelNew.setLastUpdateUser(username);
            //copy MxGraphModel
            mxGraphModelNew.setDx(mxGraphModel.getDx());
            mxGraphModelNew.setDy(mxGraphModel.getDy());
            mxGraphModelNew.setGrid(mxGraphModel.getGrid());
            mxGraphModelNew.setGridSize(mxGraphModel.getGridSize());
            mxGraphModelNew.setGuides(mxGraphModel.getGuides());
            mxGraphModelNew.setTooltips(mxGraphModel.getTooltips());
            mxGraphModelNew.setConnect(mxGraphModel.getConnect());
            mxGraphModelNew.setArrows(mxGraphModel.getArrows());
            mxGraphModelNew.setFold(mxGraphModel.getFold());
            mxGraphModelNew.setPage(mxGraphModel.getPage());
            mxGraphModelNew.setPageScale(mxGraphModel.getPageScale());
            mxGraphModelNew.setPageWidth(mxGraphModel.getPageWidth());
            mxGraphModelNew.setPageHeight(mxGraphModel.getPageHeight());
            mxGraphModelNew.setBackground(mxGraphModel.getBackground());

            //get MxCell array
            List<MxCell> root = mxGraphModel.getRoot();
            // Determine if the MxCell array is empty
            if (CollectionUtils.isNotEmpty(root)) {
                List<MxCell> rootNew = new ArrayList<>();
                // loop
                for (MxCell mxCell : root) {
                    //Determine if it is empty
                    if (null != mxCell) {
                        MxCell mxCellNew = new MxCell();
                        // link MxGraphModel new
                        mxCellNew.setMxGraphModel(mxGraphModelNew);
                        //set MxCell basic information
                        mxCellNew.setCrtDttm(new Date());
                        mxCellNew.setCrtUser(username);
                        mxCellNew.setLastUpdateDttm(new Date());
                        mxCellNew.setLastUpdateUser(username);
                        // copy MxCell
                        mxCellNew.setPageId(mxCell.getPageId());
                        mxCellNew.setParent(mxCell.getParent());
                        mxCellNew.setStyle(mxCell.getStyle());
                        mxCellNew.setEdge(mxCell.getEdge()); // Line has
                        mxCellNew.setSource(mxCell.getSource()); // Line has
                        mxCellNew.setTarget(mxCell.getTarget()); // Line has
                        mxCellNew.setValue(mxCell.getValue());
                        mxCellNew.setVertex(mxCell.getVertex());
                        // get MxGeometry
                        MxGeometry mxGeometry = mxCell.getMxGeometry();
                        // Determine if MxGeometry is empty
                        if (null != mxGeometry) {
                            MxGeometry mxGeometryNew = new MxGeometry();
                            // link MxCell new
                            mxGeometryNew.setMxCell(mxCellNew);
                            //set MxCell basic information
                            mxGeometryNew.setCrtDttm(new Date());
                            mxGeometryNew.setCrtUser(username);
                            mxGeometryNew.setLastUpdateDttm(new Date());
                            mxGeometryNew.setLastUpdateUser(username);
                            // copy MxGeometry
                            mxGeometryNew.setRelative(mxGeometry.getRelative());
                            mxGeometryNew.setAs(mxGeometry.getAs());
                            mxGeometryNew.setX(mxGeometry.getX());
                            mxGeometryNew.setY(mxGeometry.getY());
                            mxGeometryNew.setWidth(mxGeometry.getWidth());
                            mxGeometryNew.setHeight(mxGeometry.getHeight());

                            // set MxGeometry new
                            mxCellNew.setMxGeometry(mxGeometryNew);
                        }
                        // add MxCell new
                        rootNew.add(mxCellNew);
                    }
                }
                // set MxCell array
                mxGraphModelNew.setRoot(rootNew);
            }
            // set MxGraphModel array
            flowNew.setMxGraphModel(mxGraphModelNew);
        }

        // get StopsList
        List<Stops> stopsList = flow.getStopsList();
        // Determine if Stops array is empty
        if (CollectionUtils.isNotEmpty(stopsList)) {
            List<Stops> stopsListNew = new ArrayList<>();
            // loop
            for (Stops stops : stopsList) {
                //Determine if it is empty
                if (null != stops) {
                    Stops stopsNew = new Stops();
                    // link Flow new
                    stopsNew.setFlow(flowNew);
                    //set Stops basic information
                    stopsNew.setCrtDttm(new Date());
                    stopsNew.setCrtUser(username);
                    stopsNew.setLastUpdateDttm(new Date());
                    stopsNew.setLastUpdateUser(username);
                    // copy Stops new
                    stopsNew.setName(stops.getName());
                    stopsNew.setBundel(stops.getBundel());
                    stopsNew.setGroups(stops.getGroups());
                    stopsNew.setOwner(stops.getOwner());
                    stopsNew.setDescription(stops.getDescription());
                    stopsNew.setInports(stops.getInports());
                    stopsNew.setInPortType(stops.getInPortType());
                    stopsNew.setOutports(stops.getOutports());
                    stopsNew.setOutPortType(stops.getOutPortType());
                    stopsNew.setPageId(stops.getPageId());
                    stopsNew.setState(stops.getState());
                    stopsNew.setStartTime(stops.getStartTime());
                    stopsNew.setStopTime(stops.getStopTime());
                    stopsNew.setIsCheckpoint(stops.getIsCheckpoint());
                    stopsNew.setIsCustomized(stops.getIsCustomized());
                    stopsNew.setDataSource(stops.getDataSource());

                    // get Properties
                    List<Property> properties = stops.getProperties();
                    // Determine if Property array is empty
                    if (CollectionUtils.isNotEmpty(properties)) {
                        List<Property> propertiesNew = new ArrayList<>();
                        // loop
                        for (Property property : properties) {
                            //Determine if it is empty
                            if (null != property) {
                                Property propertyNew = new Property();
                                //link Stops new
                                propertyNew.setStops(stopsNew);
                                //set Property basic information
                                propertyNew.setCrtDttm(new Date());
                                propertyNew.setCrtUser(username);
                                propertyNew.setLastUpdateDttm(new Date());
                                propertyNew.setLastUpdateUser(username);
                                // copy Property
                                propertyNew.setName(property.getName());
                                propertyNew.setDisplayName(property.getDisplayName());
                                propertyNew.setDescription(property.getDescription());
                                propertyNew.setCustomValue(property.getCustomValue());
                                propertyNew.setAllowableValues(property.getAllowableValues());
                                propertyNew.setRequired(property.getRequired());
                                propertyNew.setSensitive(property.getSensitive());
                                propertyNew.setIsSelect(property.getIsSelect());
                                propertyNew.setIsLocked(property.getIsLocked());
                                propertyNew.setPropertySort(property.getPropertySort());
                                // add Property new
                                propertiesNew.add(propertyNew);
                            }
                        }
                        // set Properties
                        stopsNew.setProperties(propertiesNew);
                    }
                    List<CustomizedProperty> customizedPropertyList = stops.getCustomizedPropertyList();
                    // Determine if CustomizedProperty array is empty
                    if (CollectionUtils.isNotEmpty(customizedPropertyList)) {
                        List<CustomizedProperty> customizedPropertyListNew = new ArrayList<>();
                        // loop
                        for (CustomizedProperty customizedProperty : customizedPropertyList) {
                            //Determine if it is empty
                            if (null != customizedProperty) {
                                CustomizedProperty customizedPropertyNew = new CustomizedProperty();
                                //link Stops new
                                customizedPropertyNew.setStops(stopsNew);
                                //set CustomizedProperty basic information
                                customizedPropertyNew.setCrtDttm(new Date());
                                customizedPropertyNew.setCrtUser(username);
                                customizedPropertyNew.setLastUpdateDttm(new Date());
                                customizedPropertyNew.setLastUpdateUser(username);
                                // copy Property
                                customizedPropertyNew.setName(customizedProperty.getName());
                                customizedPropertyNew.setCustomValue(customizedProperty.getCustomValue());
                                customizedPropertyNew.setDescription(customizedProperty.getDescription());
                                // add CustomizedProperty new
                                customizedPropertyListNew.add(customizedPropertyNew);
                            }
                        }
                        // set CustomizedPropertyList
                        stopsNew.setCustomizedPropertyList(customizedPropertyListNew);
                    }
                    // add Stops new
                    stopsListNew.add(stopsNew);
                }
            }
            // set StopsList
            flowNew.setStopsList(stopsListNew);
        }
        List<Paths> pathsList = flow.getPathsList();
        if (CollectionUtils.isNotEmpty(pathsList)) {
            List<Paths> pathsListNew = new ArrayList<>();
            for (Paths paths : pathsList) {
                if (null != paths) {
                    Paths pathsNew = new Paths();
                    //link Flow new
                    pathsNew.setFlow(flowNew);
                    //set Paths basic information
                    pathsNew.setCrtDttm(new Date());
                    pathsNew.setCrtUser(username);
                    pathsNew.setLastUpdateDttm(new Date());
                    pathsNew.setLastUpdateUser(username);
                    // copy Path
                    pathsNew.setFrom(paths.getFrom());
                    pathsNew.setOutport(paths.getOutport());
                    pathsNew.setInport(paths.getInport());
                    pathsNew.setTo(paths.getTo());
                    pathsNew.setPageId(paths.getPageId());
                    pathsNew.setFilterCondition(paths.getFilterCondition());
                    // add Paths new
                    pathsListNew.add(pathsNew);
                }
            }
            // set PathsList
            flowNew.setPathsList(pathsListNew);
        }
        return flowNew;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/utils/ThirdFlowGroupInfoResponseUtils.java<|end_filename|>
package cn.cnic.third.utils;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.common.Eunm.ProcessState;
import cn.cnic.common.Eunm.StopState;
import cn.cnic.component.process.entity.Process;
import cn.cnic.component.process.entity.ProcessGroup;
import cn.cnic.component.process.entity.ProcessStop;
import cn.cnic.third.vo.flowGroup.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ThirdFlowGroupInfoResponseUtils {

    public static ProcessGroup setProcessGroup(ProcessGroup processGroup, ThirdFlowGroupInfoResponse thirdFlowGroupInfoResponse) {

        if (null != thirdFlowGroupInfoResponse && null != processGroup) {
            processGroup.setLastUpdateUser("syncTask");
            processGroup.setLastUpdateDttm(new Date());
            //processGroup.setProgress(thirdFlowGroupInfoResponse.getProgress());
            if (StringUtils.isNotBlank(thirdFlowGroupInfoResponse.getState())) {
                processGroup.setState(ProcessState.selectGender(thirdFlowGroupInfoResponse.getState()));
            }
            //process.setProcessId(thirdFlowGroupInfoResponse.getPid());
            processGroup.setProcessId(thirdFlowGroupInfoResponse.getId());
            processGroup.setName(thirdFlowGroupInfoResponse.getName());
            processGroup.setStartTime(DateUtils.strCstToDate(thirdFlowGroupInfoResponse.getStartTime()));
            processGroup.setEndTime(DateUtils.strCstToDate(thirdFlowGroupInfoResponse.getEndTime()));
            if (StringUtils.isBlank(processGroup.getAppId())) {
                processGroup.setAppId(thirdFlowGroupInfoResponse.getId());
            }

            Map<String, ThirdFlowInfoResponse> flowInfoResponseMap = new HashMap<>();
            List<ThirdFlowInfoOutResponse> flows = thirdFlowGroupInfoResponse.getFlows();
            List<Process> processList = processGroup.getProcessList();
            if (CollectionUtils.isNotEmpty(flows) && CollectionUtils.isNotEmpty(processList)) {
                for (ThirdFlowInfoOutResponse thirdFlowInfoOutResponse : flows) {
                    if (null != thirdFlowInfoOutResponse) {
                        ThirdFlowInfoResponse flowInfoResponse = thirdFlowInfoOutResponse.getFlow();
                        if (null != flowInfoResponse) {
                            flowInfoResponseMap.put(flowInfoResponse.getName(), flowInfoResponse);
                        }
                    }
                }
                for (Process process : processList) {
                    if (null != process) {
                        ThirdFlowInfoResponse flowInfoResponse = flowInfoResponseMap.get(process.getName());
                        if (null != flowInfoResponse) {
                            setProcess(process, flowInfoResponse);
                        }
                    }
                }
            }

            Map<String, ThirdFlowGroupInfoResponse> flowGrpupInfoResponseMap = new HashMap<>();
            List<ThirdFlowGroupInfoOutResponse> flowGroups = thirdFlowGroupInfoResponse.getGroups();
            List<ProcessGroup> processGroupList = processGroup.getProcessGroupList();
            if (CollectionUtils.isNotEmpty(flowGroups) && CollectionUtils.isNotEmpty(processGroupList)) {
                for (ThirdFlowGroupInfoOutResponse thirdFlowGroupInfoOutResponse_i : flowGroups) {
                    if (null != thirdFlowGroupInfoOutResponse_i) {
                        ThirdFlowGroupInfoResponse thirdFlowGroupInfoResponse_i = thirdFlowGroupInfoOutResponse_i.getGroup();
                        if (null != thirdFlowGroupInfoResponse_i) {
                            flowGrpupInfoResponseMap.put(thirdFlowGroupInfoResponse_i.getName(), thirdFlowGroupInfoResponse_i);
                        }
                    }
                }
                for (ProcessGroup processGroup_i : processGroupList) {
                    if (null != processGroup_i) {
                        ThirdFlowGroupInfoResponse thirdFlowGroupInfoResponse_copy = flowGrpupInfoResponseMap.get(processGroup_i.getName());
                        if (null != thirdFlowGroupInfoResponse_copy) {
                            setProcessGroup(processGroup_i, thirdFlowGroupInfoResponse_copy);
                        }
                    }
                }
            }
        }
        return processGroup;
    }

    public static Process setProcess(Process process, ThirdFlowInfoResponse flowInfoResponse) {

        if (null != flowInfoResponse && null != process) {
            Map<String, ThirdFlowStopInfoResponse> stopsMap = new HashMap<>();
            List<ThirdFlowStopInfoOutResponse> stops = flowInfoResponse.getStops();
            process.setLastUpdateUser("syncTask");
            process.setLastUpdateDttm(new Date());
            process.setProgress(flowInfoResponse.getProgress());
            if (StringUtils.isNotBlank(flowInfoResponse.getState())) {
                process.setState(ProcessState.selectGender(flowInfoResponse.getState()));
            }
            //process.setProcessId(flowInfoResponse.getPid());
            process.setProcessId(flowInfoResponse.getId());
            process.setAppId(flowInfoResponse.getId());
            process.setName(flowInfoResponse.getName());
            process.setStartTime(DateUtils.strCstToDate(flowInfoResponse.getStartTime()));
            process.setEndTime(DateUtils.strCstToDate(flowInfoResponse.getEndTime()));
            List<ProcessStop> processStopList = process.getProcessStopList();
            if (CollectionUtils.isNotEmpty(stops) && CollectionUtils.isNotEmpty(processStopList)) {
                for (ThirdFlowStopInfoOutResponse thirdFlowStopInfoOutResponse : stops) {
                    if (null != thirdFlowStopInfoOutResponse) {
                        ThirdFlowStopInfoResponse stopInfoResponse = thirdFlowStopInfoOutResponse.getStop();
                        if (null != stopInfoResponse) {
                            stopsMap.put(stopInfoResponse.getName(), stopInfoResponse);
                        }
                    }
                }
                for (ProcessStop processStop : processStopList) {
                    if (null != processStop) {
                        ThirdFlowStopInfoResponse stopInfoResponse = stopsMap.get(processStop.getName());
                        if (null != stopInfoResponse) {
                            processStop.setState(StopState.selectGender(stopInfoResponse.getState()));
                            processStop.setStartTime(DateUtils.strCstToDate(stopInfoResponse.getStartTime()));
                            processStop.setEndTime(DateUtils.strCstToDate(stopInfoResponse.getEndTime()));
                        }
                    }
                }
            }
        }
        return process;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/mapper/provider/PropertyMapperProvider.java<|end_filename|>
package cn.cnic.component.flow.mapper.provider;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.flow.entity.Property;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class PropertyMapperProvider {

    private String id;
    private String lastUpdateDttmStr;
    private String lastUpdateUser;
    private int enableFlag;
    private long version;
    private String name;
    private String displayName;
    private String description;
    private String customValue;
    private String allowableValues;
    private Integer required;
    private Integer sensitive;
    private String stopsId;
    private Integer isSelect;
    private Integer isLocked;
    private long propertySort;
    private String example;
    private Integer isOldData;

    private boolean preventSQLInjectionProperty(Property property) {
        if (null == property || StringUtils.isBlank(property.getLastUpdateUser())) {
            return false;
        }

        // Mandatory Field
        String id = property.getId();
        String lastUpdateUser = property.getLastUpdateUser();
        Boolean enableFlag = property.getEnableFlag();
        Long version = property.getVersion();
        Date lastUpdateDttm = property.getLastUpdateDttm();
        this.id = SqlUtils.preventSQLInjection(id);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(lastUpdateUser);
        this.enableFlag = ((null != enableFlag && enableFlag) ? 1 : 0);
        this.version = (null != version ? version : 0L);
        String lastUpdateDttmStr = DateUtils.dateTimesToStr(null != lastUpdateDttm ? lastUpdateDttm : new Date());
        
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttmStr);

        // Selection field
        this.name = SqlUtils.preventSQLInjection(property.getName());
        this.displayName = SqlUtils.preventSQLInjection(property.getDisplayName());
        this.description = SqlUtils.preventSQLInjection(property.getDescription());
        this.customValue = SqlUtils.preventSQLInjection(property.getCustomValue());
        this.allowableValues = SqlUtils.preventSQLInjection(property.getAllowableValues());
        this.required = (null == property.getRequired() ? null : (property.getRequired() ? 1 : 0));
        this.sensitive = (null == property.getSensitive() ? null : (property.getSensitive() ? 1 : 0));
        String stopsIdStr = (null != property.getStops() ? property.getStops().getId() : null);
        this.stopsId = (null != stopsIdStr ? SqlUtils.preventSQLInjection(stopsIdStr) : null);
        this.isSelect = (null == property.getIsSelect() ? null : (property.getIsSelect() ? 1 : 0));
        this.isLocked = (null == property.getIsLocked() ? null : (property.getIsLocked() ? 1 : 0));
        this.propertySort = (null != property.getPropertySort() ? property.getPropertySort() : 0L);
        this.example = SqlUtils.preventSQLInjection(property.getExample());
        this.isOldData = (null == property.getIsOldData() ? null : (property.getIsOldData() ? 1 : 0));
        return true;
    }

    private void reset() {
        this.id = null;
        this.lastUpdateDttmStr = null;
        this.lastUpdateUser = null;
        this.enableFlag = 1;
        this.version = 0L;
        this.name = null;
        this.displayName = null;
        this.description = null;
        this.customValue = null;
        this.allowableValues = null;
        this.required = null;
        this.sensitive = null;
        this.stopsId = null;
        this.isSelect = null;
        this.isLocked = null;
        this.propertySort = 0L;
        this.example = null;
        this.isOldData = null;
    }

    /**
     * Insert list<Property> Note that the method of spelling sql must use Map to
     * connect Param content to key value.
     *
     * @param property (Content: The key is propertyList and the value is List<Property>)
     * @return
     */
    public String addProperty(Property property) {
        String sqlStr = "SELECT 0";
        boolean flag =this.preventSQLInjectionProperty(property);
        if (flag) {
            StringBuffer sqlStrBuffer = new StringBuffer();
            sqlStrBuffer.append("INSERT INTO flow_stops_property ");
            sqlStrBuffer.append("( ");
            sqlStrBuffer.append(SqlUtils.baseFieldName() + ", ");
            sqlStrBuffer.append("name,");
            sqlStrBuffer.append("display_name,");
            sqlStrBuffer.append("description,");
            sqlStrBuffer.append("custom_value,");
            sqlStrBuffer.append("allowable_values,");
            sqlStrBuffer.append("property_required,");
            sqlStrBuffer.append("property_sensitive,");
            sqlStrBuffer.append("fk_stops_id,");
            sqlStrBuffer.append("is_select,");
            sqlStrBuffer.append("is_locked,");
            sqlStrBuffer.append("property_sort,");
            sqlStrBuffer.append("example,");
            sqlStrBuffer.append("is_old_data");
            sqlStrBuffer.append(") ");
            sqlStrBuffer.append("VALUES ");
            sqlStrBuffer.append("( ");
            sqlStrBuffer.append(SqlUtils.baseFieldValues(property) + ", ");
            sqlStrBuffer.append(this.name + ",");
            sqlStrBuffer.append(this.displayName + ",");
            sqlStrBuffer.append(this.description + ",");
            sqlStrBuffer.append(this.customValue + ",");
            sqlStrBuffer.append(this.allowableValues + ",");
            sqlStrBuffer.append(this.required + ",");
            sqlStrBuffer.append(this.sensitive + ",");
            sqlStrBuffer.append(this.stopsId + ",");
            sqlStrBuffer.append(this.isSelect + ",");
            sqlStrBuffer.append(this.isLocked + ",");
            sqlStrBuffer.append(this.propertySort + ",");
            sqlStrBuffer.append(this.example + ",");
            sqlStrBuffer.append(this.isOldData + " ");
            sqlStrBuffer.append(")");
            sqlStr = sqlStrBuffer.toString();
            this.reset();
        }
        return sqlStr;
    }

    /**
     * Insert list<Property> Note that the method of spelling sql must use Map to
     * connect Param content to key value.
     *
     * @param map (Content: The key is propertyList and the value is List<Property>)
     * @return
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    public String addPropertyList(Map map) {
        List<Property> propertyList = (List<Property>) map.get("propertyList");
        StringBuffer sqlStrBuffer = new StringBuffer();
        if (null != propertyList && propertyList.size() > 0) {
            sqlStrBuffer.append("INSERT INTO ");
            sqlStrBuffer.append("flow_stops_property ");
            sqlStrBuffer.append("(");
            sqlStrBuffer.append(SqlUtils.baseFieldName() + ", ");
            sqlStrBuffer.append("name,");
            sqlStrBuffer.append("display_name,");
            sqlStrBuffer.append("description,");
            sqlStrBuffer.append("custom_value,");
            sqlStrBuffer.append("allowable_values,");
            sqlStrBuffer.append("property_required,");
            sqlStrBuffer.append("property_sensitive,");
            sqlStrBuffer.append("fk_stops_id,");
            sqlStrBuffer.append("is_select,");
            sqlStrBuffer.append("is_locked,");
            sqlStrBuffer.append("property_sort,");
            sqlStrBuffer.append("example,");
            sqlStrBuffer.append("is_old_data");
            sqlStrBuffer.append(") ");
            sqlStrBuffer.append("VALUES");
            int i = 0;
            for (Property property : propertyList) {
                i++;
                boolean flag =this.preventSQLInjectionProperty(property);
                if (flag) {
                    sqlStrBuffer.append("(");
                    // You can't make a mistake when you splice
                    sqlStrBuffer.append(SqlUtils.baseFieldValues(property) + ", ");
                    sqlStrBuffer.append(name + ",");
                    sqlStrBuffer.append(displayName + ",");
                    sqlStrBuffer.append(description + ",");
                    sqlStrBuffer.append(customValue + ",");
                    sqlStrBuffer.append(allowableValues + ",");
                    sqlStrBuffer.append(required + ",");
                    sqlStrBuffer.append(sensitive + ",");
                    sqlStrBuffer.append(stopsId + ",");
                    sqlStrBuffer.append(isSelect + ",");
                    sqlStrBuffer.append(isLocked + ",");
                    sqlStrBuffer.append(propertySort + ",");
                    sqlStrBuffer.append(example + ",");
                    sqlStrBuffer.append(isOldData);
                    if (i != propertyList.size()) {
                        sqlStrBuffer.append("),");
                    } else {
                        sqlStrBuffer.append(")");
                    }
                }
                this.reset();
            }
            sqlStrBuffer.append(";");
        }
        String sqlStr = sqlStrBuffer.toString();
        return sqlStr;
    }

    /**
     * 修改Property
     *
     * @param property
     * @return
     */
    public String updateStopsProperty(Property property) {
        String sqlStr = "";
        this.preventSQLInjectionProperty(property);
        if (null != property) {

            SQL sql = new SQL();

            // INSERT_INTO brackets is table name
            sql.UPDATE("flow_stops_property");
            // The first string in the SET is the name of the field corresponding to the
            // table in the database

            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + enableFlag);
            sql.SET("description = " + description);
            sql.SET("name = " + name);
            sql.SET("allowable_values = " + allowableValues);
            sql.SET("custom_value = " + customValue);
            sql.SET("display_name = " + displayName);
            sql.SET("property_required = " + required);
            sql.SET("property_sensitive = " + sensitive);
            sql.SET("is_locked = " + isLocked);
            sql.SET("property_sort = " + propertySort);
            sql.SET("is_old_data = " + isOldData);
            // sql.SET("fk_stops_id = " + stopsId);
            sql.WHERE("version = " + version);
            sql.WHERE("id = " + id);
            sqlStr = sql.toString();
            if (StringUtils.isBlank(id)) {
                sqlStr = "";
            }
        }
        this.reset();
        return sqlStr;
    }

    /**
     * remove
     *
     * @param id
     * @return
     */
    public String updateEnableFlagByStopId(String username, String id) {
        if (StringUtils.isBlank(username)) {
            return "SELECT 0";
        }
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }

        SQL sql = new SQL();
        sql.UPDATE("flow_stops_property");
        sql.SET("enable_flag = 0");
        sql.SET("last_update_user = " + SqlUtils.preventSQLInjection(username));
        sql.SET("last_update_dttm = " + SqlUtils.preventSQLInjection(DateUtils.dateTimesToStr(new Date())));
        sql.WHERE("enable_flag = 1");
        sql.WHERE("ID = " + SqlUtils.preventSQLInjection(id));

        return sql.toString();
    }

    /**
     * Modify the stop attribute
     *
     * @param id
     * @return
     */
    public String updatePropertyCustomValue(String username, String content, String id) {
        if (StringUtils.isBlank(username)) {
            return "SELECT 0";
        }
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        SQL sql = new SQL();
        sql.UPDATE("flow_stops_property");
        sql.SET("custom_value = " + SqlUtils.preventSQLInjection(content));
        sql.SET("last_update_user = " + SqlUtils.preventSQLInjection(username));
        sql.SET("last_update_dttm = " + SqlUtils.preventSQLInjection(DateUtils.dateTimesToStr(new Date())));
        sql.SET("version = " + 1);
        sql.WHERE("enable_flag = 1");
        sql.WHERE("id = " + SqlUtils.preventSQLInjection(id));
        return sql.toString();
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/entity/TestData.java<|end_filename|>
package cn.cnic.component.testData.entity;

import java.util.ArrayList;
import java.util.List;

import cn.cnic.base.BaseHibernateModelUUIDNoCorpAgentId;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TestData extends BaseHibernateModelUUIDNoCorpAgentId {

    private static final long serialVersionUID = 1L;

    private String name;
    private String description;
    private List<TestDataSchema> schemaList = new ArrayList<>();
    private List<TestDataSchemaValues> schemaValuesList = new ArrayList<>();
    

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/entity/CodeSnippet.java<|end_filename|>
package cn.cnic.component.livy.entity;

import cn.cnic.base.BaseHibernateModelUUIDNoCorpAgentId;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class CodeSnippet extends BaseHibernateModelUUIDNoCorpAgentId {

    private static final long serialVersionUID = 1L;

    private String codeContent;
    private String executeId;
    private int codeSnippetSort;

    private NoteBook noteBook;


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/utils/SpringContextUtil.java<|end_filename|>
package cn.cnic.base.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class SpringContextUtil {

    private static ApplicationContext applicationContext;

    //Get context
    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    //Set context
    @Autowired
    public static void setApplicationContext(ApplicationContext applicationContext) {
        SpringContextUtil.applicationContext = applicationContext;
    }

    //Get the "bean" in the context by name
    public static Object getBean(String name) {
        return applicationContext.getBean(name);
    }

    //Get the "bean" in the context by type
    public static Object getBean(Class<?> requiredType) {
        return applicationContext.getBean(requiredType);
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/config/jwt/exception/DefaultExceptionHandler.java<|end_filename|>
package cn.cnic.base.config.jwt.exception;

import org.slf4j.Logger;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import cn.cnic.base.config.jwt.common.ResultJson;
import cn.cnic.base.utils.LoggerUtil;
import cn.cnic.common.Eunm.ResultCode;

/**
 * 异常处理类
 * controller层异常无法捕获处理，需要自己处理
 */
@RestControllerAdvice
@SuppressWarnings("rawtypes")
public class DefaultExceptionHandler {

	/**
     * Introducing logs, note that they are all packaged under "org.slf4j"
     */
    private Logger logger = LoggerUtil.getLogger();
	
    /**
     * 处理所有自定义异常
     * @param e
     * @return
     */
    @ExceptionHandler(CustomException.class)
    public ResultJson handleCustomException(CustomException e){
        logger.error(e.getResultJson().getMsg().toString());
        return e.getResultJson();
    }
    /**
     * 处理参数校验异常
     * @param e
     * @return
     */
    @ExceptionHandler(MethodArgumentNotValidException.class)
    public ResultJson handleMethodArgumentNotValidException(MethodArgumentNotValidException e){
        logger.error(e.getBindingResult().getFieldError().getField() + e.getBindingResult().getFieldError().getDefaultMessage());
        return ResultJson.failure(ResultCode.BAD_REQUEST, e.getBindingResult().getFieldError().getDefaultMessage());
    }
}


<|start_filename|>piflow-web/src/main/resources/static/my_js/template/flowTemplateList.js<|end_filename|>
function initDatatableFlowTemplatePage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({
            elem: '#' + testTableId
            , url: (web_drawingBoard + url)
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , cols: [[
                {field: 'name', title: 'TemplateName', sort: true},
                {field: 'crtDttm', title: 'CreateTime', sort: true},
                {
                    field: 'right', title: 'Actions', sort: true, height: 100, templet: function (data) {
                        return responseActionsTemplate(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });
}

function searchMonitor(layui_table, layui_table_id, searchInputId) {
    //Perform overload
    layui_table.reload(layui_table_id, {
        page: {
            curr: 1 //Start again on page 1
        }
        , where: {param: $('#' + searchInputId).val()}
    }, 'data');
}

//Results returned in the background
function responseActionsTemplate(res) {
    var actionsHtmlStr = '<div style="width: 100%; text-align: center" >' +
        '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:downloadFlowTemplate(\'' + res.id + '\');" ' +
        'title="download template">' +
        '<i class="icon-download icon-white"></i>' +
        '</a>' +
        '<a class="btn" href="javascript:void(0);" ' +
        'onclick="javascript:deleteFlowTemPlate(\'' + res.id + '\',\'' + res.name + '\'); "' +
        'title="delete template" > ' +
        '<i class="icon-trash icon-white"></i>' +
        '</a>' +
        '</div>';
    return actionsHtmlStr;
}

function searchTemplatePage() {
    flowGroupTemplateTable.ajax.reload();
}

function deleteFlowTemPlate(id, name) {
    layer.confirm("Are you sure to delete '" + name + "' ?", {
        btn: ['confirm', 'cancel'] //button
        , title: 'Confirmation prompt'
    }, function () {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/flowTemplate/deleteFlowTemplate",//This is the name of the file where I receive data in the background.
            data: {id: id},
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                return;
            },
            success: function (data) {//Operation after request successful
                if (data > 0) {
                    layer.msg('Delete Success', {icon: 1, shade: 0, time: 2000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg('Delete failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    }, function () {
    });
}

function initAll(url) {
    window.location.href = url;
}

function listUploadFlowTemplateBtn() {
    document.getElementById("flowTemplateFile").click();
}

function listUploadFlowTemplate() {
    if (!listFileTypeCheck()) {
        return false;
    }
    var formData = new FormData($('#uploadForm')[0]);
    ajaxRequest({
        type: 'post',
        url: "/flowTemplate/uploadXmlFile",
        data: formData,
        cache: false,
        processData: false,
        contentType: false,
    }).success(function (data) {
        var dataMap = JSON.parse(data);
        if (200 === dataMap.code) {
            layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                location.reload();
            });
        } else {
            layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
        }
    }).error(function () {
        layer.msg("Upload failure", {icon: 2, shade: 0, time: 2000});
    });
}

function listFileTypeCheck() {
    var obj = document.getElementById('flowTemplateFile');
    if (obj.value == null || obj.value == '') {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    var length = obj.value.length;
    var charindex = obj.value.lastIndexOf(".");
    var ExtentName = obj.value.substring(charindex, charindex + 4);
    if (!(ExtentName == ".xml")) {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    return true;
}

function downloadFlowTemplate(id) {
    window.location.href = "/piflow-web/flowTemplate/templateDownload?flowTemplateId=" + id;
}



<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/utils/ProcessStopPropertyUtils.java<|end_filename|>
package cn.cnic.component.process.utils;

import cn.cnic.component.process.entity.ProcessStopProperty;

import java.util.Date;

public class ProcessStopPropertyUtils {

    public static ProcessStopProperty processStopPropertyNewNoId(String username) {
        ProcessStopProperty processStopProperty = new ProcessStopProperty();
        // basic properties (required when creating)
        processStopProperty.setCrtDttm(new Date());
        processStopProperty.setCrtUser(username);
        // basic properties
        processStopProperty.setEnableFlag(true);
        processStopProperty.setLastUpdateUser(username);
        processStopProperty.setLastUpdateDttm(new Date());
        processStopProperty.setVersion(0L);
        return processStopProperty;
    }

    public static ProcessStopProperty initProcessStopPropertyBasicPropertiesNoId(ProcessStopProperty processStopProperty, String username) {
        if (null == processStopProperty) {
            return processStopPropertyNewNoId(username);
        }
        // basic properties (required when creating)
        processStopProperty.setCrtDttm(new Date());
        processStopProperty.setCrtUser(username);
        // basic properties
        processStopProperty.setEnableFlag(true);
        processStopProperty.setLastUpdateUser(username);
        processStopProperty.setLastUpdateDttm(new Date());
        processStopProperty.setVersion(0L);
        return processStopProperty;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/utils/ProcessPathUtils.java<|end_filename|>
package cn.cnic.component.process.utils;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.flow.entity.Paths;
import cn.cnic.component.process.entity.ProcessPath;
import org.springframework.beans.BeanUtils;

import java.util.Date;

public class ProcessPathUtils {

    public static ProcessPath processPathNewNoId(String username) {
        ProcessPath processPath = new ProcessPath();
        // basic properties (required when creating)
        processPath.setCrtDttm(new Date());
        processPath.setCrtUser(username);
        // basic properties
        processPath.setEnableFlag(true);
        processPath.setLastUpdateUser(username);
        processPath.setLastUpdateDttm(new Date());
        processPath.setVersion(0L);
        return processPath;
    }

    public static ProcessPath initProcessPathBasicPropertiesNoId(ProcessPath processPath, String username) {
        if (null == processPath) {
            return processPathNewNoId(username);
        }
        // basic properties (required when creating)
        processPath.setCrtDttm(new Date());
        processPath.setCrtUser(username);
        // basic properties
        processPath.setEnableFlag(true);
        processPath.setLastUpdateUser(username);
        processPath.setLastUpdateDttm(new Date());
        processPath.setVersion(0L);
        return processPath;
    }

    public static ProcessPath copyProcessPathBasicPropertiesNoIdAndUnlink(ProcessPath processPath, String username) {
        if (null == processPath) {
            return null;
        }
        // ProcessPath
        ProcessPath copyProcessPath = new ProcessPath();
        BeanUtils.copyProperties(processPath, copyProcessPath);
        copyProcessPath = initProcessPathBasicPropertiesNoId(copyProcessPath,username);
        copyProcessPath.setProcess(null);
        return copyProcessPath;
    }
    
    public static ProcessPath pathsToProcessPath(Paths paths, String username, boolean isAddId) {

        // isEmpty
        if (null == paths) {
            return null;
        }
        ProcessPath processPath = new ProcessPath();
        // Copy paths information into processPath
        BeanUtils.copyProperties(paths, processPath);
        // Set basic information
        processPath = ProcessPathUtils.initProcessPathBasicPropertiesNoId(processPath, username);
        if (isAddId) {
            processPath.setId(UUIDUtils.getUUID32());
        } else {
            processPath.setId(null);
        }
        
        return processPath;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/service/IStop.java<|end_filename|>
package cn.cnic.third.service;

import cn.cnic.third.vo.stop.StopsHubVo;
import cn.cnic.third.vo.stop.ThirdStopsComponentVo;

import java.util.List;
import java.util.Map;

public interface IStop {
    /**
     * Call the group interface
     *
     * @return
     */
    public String[] getAllGroup();

    public String[] getAllStops();

    public Map<String, List<String>> getStopsListWithGroup();

    public ThirdStopsComponentVo getStopInfo(String bundleStr);

    public String getStopsHubPath();

    public StopsHubVo mountStopsHub(String stopsHubName);

    public StopsHubVo unmountStopsHub(String stopsHubMountId);

}


<|start_filename|>piflow-web/src/main/resources/static/components/mxGraph/initGraph.js<|end_filename|>
// Extends EditorUi to update I/O action states based on availability of backend
var graphGlobal = null;
var thisEditor = null;
var sign = true;
var fullScreen = $('#fullScreen');
var pathsCells = [];
var flag = 0;
var timerPath;
var currentStopPageId;
var drawingBoardType = $("#drawingBoardType").val();
var statusgroup, flowPageIdcha, flowGroupdata, cellprecess, flowdatas, removegroupPaths, flowsPagesId
getRightInfo()
var index = true

function getRightInfo(cell) {
    var processGroupId = getQueryString("load")
    var pageId, value, data
    if (index) {
        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        index = false
    }
    if (cell == undefined) {
        data = {processGroupId}
    } else {
        pageId = cell.id
        value = cell.value
        data = {pageId, processGroupId}
    }
    //group
    if (cell && cell.style && (cell.style).indexOf("image\;") === 0 && processType == "GROUP") {
        $.ajax({
            cache: true,
            type: "POST",
            url: "/piflow-web/processGroup/queryProcess",
            data: data,
            async: true,
            error: function (request) {
                return;
            },
            success: function (data) {
                $("#right-group")[0].innerHTML = data
            }
        })
        //info
    } else if (cell == undefined || cell && cell.style && (cell.style).indexOf("text\;") === 0) {
        if (processType == "GROUP") {
            $.ajax({
                cache: true,
                type: "POST",
                url: " /piflow-web/processGroup/queryProcessGroup",
                data: data,
                async: true,
                error: function (request) {
                    return;
                },
                success: function (data) {
                    $("#right-group")[0].innerHTML = data
                }
            })
        } else if (processType == "TASK") {
            $.ajax({
                cache: true,
                type: "POST",
                url: "/piflow-web/page/process/inc/process_info_inc.html",
                data: {processId: processGroupId},
                async: true,
                error: function (request) {
                    return;
                },
                success: function (data) {
                    $("#right-group").html(data);
                }
            })
        }


        //task
    } else if (cell && cell.style && (cell.style).indexOf("image\;") === 0 && processType == "TASK") {
        $.ajax({
            cache: true,
            type: "POST",
            url: "/piflow-web/page/process/inc/process_property_inc.html",
            data: {processId: processGroupId, pageId: cell.id},
            async: true,
            error: function (request) {
                return;
            },
            success: function (data) {
                $("#right-group").html(data);
            }
        })
        //    path
    } else {
        if (processType == "GROUP") {
            $.ajax({
                cache: true,
                type: "POST",
                url: "/piflow-web/processGroup/queryProcessGroupPath",
                data: {processGroupId, pageId: cell.id},
                async: true,
                error: function (request) {
                    return;
                },
                success: function (data) {
                    $("#right-group")[0].innerHTML = data
                }
            })
        } else if (processType == "TASK") {
            $.ajax({
                cache: true,
                type: "POST",
                url: "/piflow-web/page/process/inc/process_path_inc.html",
                data: {processId: processGroupId, pageId: cell.id},
                async: true,
                error: function (request) {
                    return;
                },
                success: function (data) {
                    $("#right-group").html(data);
                }
            })
        }
    }

}

function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}

function initGraph() {
    if("PROCESS"==drawingBoardType){
        EditorUi.prototype.noEditing = true;
    }
    Format.customizeType = drawingBoardType;
    Format.customizeTypeAttr_init();
    var editorUiInit = EditorUi.prototype.init;
    if (EditorUi.prototype.noEditing) {
        $("#right-group-wrap")[0].style.display = "block";
        $("#precess-run")[0].style.display = "block";
    } else {
        $("#right-group-wrap")[0].style.display = "none";
        $("#precess-run")[0].style.display = "none";
    }

    EditorUi.prototype.init = function () {
        editorUiInit.apply(this, arguments);
        graphGlobal = this.editor.graph;
        thisEditor = this.editor;
        if (EditorUi.prototype.noEditing) {
            setTimeout(() => {
                console.log("svg_element")
                var svg_element = document.getElementsByClassName('geDiagramBackdrop geDiagramContainer')[0].getElementsByTagName("svg")[0];
                nodeArr.forEach(item => {
                    var img_element_init = document.createElementNS("http://www.w3.org/2000/svg", "image");
                    img_element_init.setAttribute("x", 0);
                    img_element_init.setAttribute("y", 0);
                    img_element_init.setAttribute("width", 20);
                    img_element_init.setAttribute("height", 20);
                    img_element_init.setAttribute("PiFlow_IMG", "IMG");
                    img_element_init.href.baseVal = "/piflow-web/img/Loading.gif";
                    img_element_init.setAttribute("id", "stopLoadingShow" + item.pageId);

                    var img_element_ok = document.createElementNS("http://www.w3.org/2000/svg", "image");
                    img_element_ok.setAttribute("x", 0);
                    img_element_ok.setAttribute("y", 0);
                    img_element_ok.setAttribute("width", 20);
                    img_element_ok.setAttribute("height", 20);
                    img_element_ok.setAttribute("PiFlow_IMG", "IMG");
                    img_element_ok.href.baseVal = "/piflow-web/img/Ok.png";
                    img_element_ok.setAttribute("id", "stopOkShow" + item.pageId);

                    var img_element_fail = document.createElementNS("http://www.w3.org/2000/svg", "image");
                    img_element_fail.setAttribute("x", 0);
                    img_element_fail.setAttribute("y", 0);
                    img_element_fail.setAttribute("width", 20);
                    img_element_fail.setAttribute("height", 20);
                    img_element_fail.setAttribute("PiFlow_IMG", "IMG");
                    img_element_fail.href.baseVal = "/piflow-web/img/Fail.png";
                    img_element_fail.setAttribute("id", "stopFailShow" + item.pageId);
                    img_element_init.style.display = "none";
                    img_element_fail.style.display = "none";
                    img_element_ok.style.display = "none";
                    if (item.state) {
                        if (item.state !== "INIT") {
                            //stopImgChange.attr('opacity', 1);
                            if (item.state && (item.state === "STARTED")) {
                                img_element_init.style.display = "block";
                                img_element_fail.style.display = "none";
                                img_element_ok.style.display = "none";
                            } else if (item.state && item.state === "COMPLETED") {
                                img_element_init.style.display = "none";
                                img_element_fail.style.display = "none";
                                img_element_ok.style.display = "block";
                            } else if (item.state && item.state === "FAILED") {
                                img_element_init.style.display = "none";
                                img_element_fail.style.display = "block";
                                img_element_ok.style.display = "none";
                            } else if (item.state && item.state === "KILLED") {
                                img_element_init.style.display = "none";
                                img_element_fail.style.display = "block";
                                img_element_ok.style.display = "none";
                            }
                        }
                    }

                    if (svg_element && img_element_init && img_element_ok && img_element_fail) {
                        var g_element = document.createElementNS("http://www.w3.org/2000/svg", "g");
                        g_element.appendChild(img_element_init);
                        g_element.appendChild(img_element_ok);
                        g_element.appendChild(img_element_fail);
                        svg_element.append(g_element);
                    }
                });
                changIconTranslate();
            }, 300)
        }
        this.actions.get('export').setEnabled(false);
        /*
        // Updates action states which require a backend
        if (!Editor.useLocalStorage) {
            mxUtils.post(OPEN_URL, '', mxUtils.bind(this, function(req) {
                var enabled = req.getStatus() != 404;
                this.actions.get('open').setEnabled(enabled || Graph.fileSupport);
                this.actions.get('import').setEnabled(enabled || Graph.fileSupport);
                this.actions.get('save').setEnabled(enabled);
                this.actions.get('saveAs').setEnabled(enabled);
                this.actions.get('export').setEnabled(enabled);
            }));
        }
        */
        //Monitoring event
        graphGlobal.addListener(mxEvent.CELLS_ADDED, function (sender, evt) {
            if (isExample) {
                prohibitEditing(evt, 'ADD');
            } else {
                addMxCellOperation(evt);
            }
        });
        graphGlobal.addListener(mxEvent.CELLS_MOVED, function (sender, evt) {
            if (isExample) {
                prohibitEditing(evt, 'MOVED');
            } else {
                movedMxCellOperation(evt);
            }
        });
        graphGlobal.addListener(mxEvent.CELLS_REMOVED, function (sender, evt) {
            evtchan = evt;
            if (isExample) {
                prohibitEditing(evt, 'REMOVED');
            } else {
                removeMxCellOperation(evt);
            }
        });

        graphGlobal.addListener(mxEvent.CLICK, function (sender, evt) {
            findBasicInfo(evt);
            console.log(evt)
            if (EditorUi.prototype.noEditing) {
                getRightInfo(evt.properties.cell)
            }
        });
        graphGlobal.addListener(mxEvent.SIZE, function (sender, evt) {
            if (EditorUi.prototype.noEditing) {
                changIconTranslate();
            }
        });
        if ('GROUP' === Format.customizeType) {
            graphGlobal.addListener(mxEvent.DOUBLE_CLICK, function (sender, evt) {
                openProcessMonitor(evt);
                if (evt.properties.cell.style && (evt.properties.cell.style).indexOf("text\;") === 0) {
                    if (graphGlobal.isEnabled()) {
                        graphGlobal.startEditingAtCell();
                    }
                }
            });
        }
        if ('TASK' === Format.customizeType) {
            graphGlobal.addListener(mxEvent.DOUBLE_CLICK, function (sender, evt) {
                openProcessMonitor(evt);
                if (evt.properties.cell.style && (evt.properties.cell.style).indexOf("text\;") === 0) {
                    if (graphGlobal.isEnabled()) {
                        graphGlobal.startEditingAtCell();
                    }
                }
            });
        }


        if (processType === "GROUP") {
            graphGlobal.addListener(mxEvent.DOUBLE_CLICK, function (sender, evt) {
                OpenTheMonitorArtboard(evt);

            });
        }
        if (xmlDate) {
            var xml = mxUtils.parseXml(xmlDate);
            var node = xml.documentElement;
            var dec = new mxCodec(node.ownerDocument);
            dec.decode(node, graphGlobal.getModel());
            eraseRecord()
        }
    };

    // Adds required resources (disables loading of fallback properties, this can only
    // be used if we know that all keys are defined in the language specific file)
    mxResources.loadDefaultBundle = false;
    var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
        mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);

    // Fixes possible asynchronous requests
    mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
        // Adds bundle text to resources
        mxResources.parse(xhr[0].getText());

        // Configures the default graph theme
        var themes = new Object();
        themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();

        // Main
        new EditorUi(new Editor(urlParams['chrome'] == '0', themes));
    }, function () {
        document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
    });
    EditorUi.prototype.menubarHeight = 48;
    EditorUi.prototype.menubarShow = false;
    EditorUi.prototype.customToobar = true;
    ClickSlider();
}

function prohibitEditing(evt, operationType) {
    if ('ADD' === operationType || 'REMOVED' === operationType) {
        layer.msg("This is an example, you can't add, edit or delete", {
            icon: 2,
            shade: 0,
            time: 2000
        }, function () {

        });
    } else if ('MOVED' === operationType) {
        findBasicInfo(evt);
    }
    $.ajax({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/mxGraph/eraseRecord",
        data: {},
        async: true,
        error: function (request) {//Operation after request failure
            if ('ADD' === operationType || 'REMOVED' === operationType) {
                location.reload();
            }
            eraseRecord()
            return;
        },
        success: function (data) {//After the request is successful
            if ('ADD' === operationType || 'REMOVED' === operationType) {
                location.reload();
            }
            eraseRecord()
        }
    });
}

function addMxCellOperation(evt) {
    var cells = evt.properties.cells;
    statusgroup = cells[0].value;
    // cells.forEach(cellFor => {
    //     console.log("=============================================");
    //     if (cellFor && cellFor.edge) {
    //         var cellForTarget = cellFor.target;
    //         var cellForSource = cellFor.source;
    //         if (!cellForSource) {
    //         }
    //         if (cellForTarget && cellForTarget && cellForTarget.style && (cellForTarget.style).indexOf("text\;") !== 0 && cellForSource.style && (cellForSource.style).indexOf("text\;") !== 0) {
    //             var arr = []
    //             arr.push(cellFor)
    //             graphGlobal.removeCells(arr)
    //         }
    //     }
    // });
    if ('GROUP' === Format.customizeType) {
        groupGraphAddCells(cells);
    } else {
        var removeCellArray = [];
        var paths = [];
        cells.forEach(cellFor => {
            if (cellFor && cellFor.edge) {
                var cellForSource = cellFor.source;
                var cellForTarget = cellFor.target;
                console.log("==========================================");
                if (cellForSource && cellForTarget
                    && (cellForSource.style && (cellForSource.style).indexOf("text\;") !== 0)
                    && (cellForTarget.style && (cellForTarget.style).indexOf("text\;") !== 0)) {
                    paths[paths.length] = cellFor;
                } else {
                    removeCellArray.push(cellFor);
                }
            } else if (cellFor.style && (cellFor.style).indexOf("image\;") === 0) {
                if (!removegroupPaths) {
                    removegroupPaths = [];
                }
                removegroupPaths.push(cellFor);
            }
        });
        graphGlobal.removeCells(removeCellArray);
        if (cells.length != removeCellArray.length) {
            saveXml(paths, 'ADD');
        }
    }

    if ('cellsAdded' == evt.name) {
        findBasicInfo(evt);
    }
}

function movedMxCellOperation(evt) {
    statusgroup = ""
    if (evt.properties.disconnect) {
        saveXml(null, 'MOVED');   // preservation method
    }
    findBasicInfo(evt);
}

function removeMxCellOperation(evt) {
    saveXml(null, 'REMOVED');
}

function groupGraphAddCells(cells) {
    var removeCellArray = [];
    var addCellArray = [];
    var addPathArray = [];
    cells.forEach(cellFor => {
        if (cellFor && cellFor.edge) {
            var cellForSource = cellFor.source;
            var cellForTarget = cellFor.target;
            if (cellForSource && cellForTarget
                && (cellForSource.style && (cellForSource.style).indexOf("text\;") !== 0)
                && (cellForTarget.style && (cellForTarget.style).indexOf("text\;") !== 0)) {
                var addCell = graphCellToMxCellVo(cellFor);
                if (addCell) {
                    addCellArray.push(addCell);
                }
                addPathArray.push(cellFor);
            } else {
                removeCellArray.push(cellFor);
            }
        } else if (cellFor.style && (cellFor.style).indexOf("image\;") === 0) {
            var addCell = graphCellToMxCellVo(cellFor);
            if (addCell) {
                addCellArray.push(addCell);
            }
            if (!removegroupPaths) {
                removegroupPaths = [];
            }
            removegroupPaths.push(cellFor);
        } else {
            var addCell = graphCellToMxCellVo(cellFor);
            if (addCell) {
                addCellArray.push(addCell);
            }
        }
    });
    graphGlobal.removeCells(removeCellArray);
    if (cells.length != removeCellArray.length) {
        var time, time1;
        $.ajax({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/piflow-web/mxGraph/addMxCellAndData",
            data: JSON.stringify({
                mxCellVoList: addCellArray,
                loadId: loadId
            }),
            //contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
            contentType: 'application/json;charset=utf-8',
            async: true,//Synchronous Asynchronous
            error: function (request) {//Operation after request failure
                layer.msg('Add failed, refresh page after 1 second', {icon: 2, shade: 0, time: 2000}, function () {
                    window.location.reload();
                });
                return;
            },
            success: function (data) {//After the request is successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    //console.log(operType + " save success");
                    console.log("Add save success");
                    if (statusgroup == "group") {
                        $("#flowGroupId").val("");
                        $("#flowGroupName").val("");
                        $("#description1").val("");
                        layer.open({
                            type: 1,
                            title: '<span style="color: #269252;">create flow group</span>',
                            shadeClose: false,
                            shade: 0.3,
                            closeBtn: 1,
                            shift: 7,
                            area: ['580px', '520px'], //Width height
                            skin: 'layui-layer-rim', //Add borders
                            content: $("#SubmitPage"),
                            success: function () {
                                $(".layui-layer-page").css("z-index", "1998910151");

                                queryFlowOrFlowGroupProperty(flowsPagesId);

                                setTimeout(() => {
                                    if (flowGroupdata == undefined) {
                                        var index2 = 0
                                        clearInterval(time)
                                        clearInterval(time1)
                                        time1 = setInterval(() => {
                                            if (index2 < 4) {
                                                queryFlowOrFlowGroupProperty(flowsPagesId)
                                                index2++
                                            } else if (index2 >= 4) {
                                                // layer.closeAll()
                                                // layer.msg("Network Anomaly", {icon: 5})
                                                alert("Network Anomaly")
                                                clearInterval(time1)
                                                index2 = 0
                                            } else {
                                                clearInterval(time)
                                                clearInterval(time1)
                                            }
                                        }, 300)
                                    }
                                }, 500)

                            },
                            cancel: function (index, layero) {
                                graphGlobal.removeCells(removegroupPaths);
                                layer.close(index)

                                return false;
                            }
                        });
                    } else if (statusgroup == "flow") {
                        $("#flowId").val("");
                        $("#flowName").val("");
                        $("#description").val("");
                        $("#driverMemory").val('1g');
                        $("#executorNumber").val('1');
                        $("#executorMemory").val('1g');
                        $("#executorCores").val('1');
                        layer.open({
                            type: 1,
                            title: '<span style="color: #269252;">Create Flow</span>',
                            shadeClose: false,
                            shade: 0.3,
                            closeBtn: 1,
                            shift: 7,
                            area: ['580px', '520px'], //Width height
                            skin: 'layui-layer-rim', //Add borders
                            content: $("#SubmitPageFlow"),
                            success: function () {
                                queryFlowOrFlowGroupProperty(flowsPagesId)


                                setTimeout(() => {
                                    if (flowdatas == undefined) {
                                        var index2 = 0
                                        clearInterval(time)
                                        clearInterval(time1)
                                        time1 = setInterval(() => {
                                            if (index2 < 4) {
                                                queryFlowOrFlowGroupProperty(flowsPagesId)
                                                index2++
                                            } else if (index2 >= 4) {
                                                // layer.closeAll()
                                                // layer.msg("Network Anomaly", {icon: 5})
                                                alert("Network Anomaly")
                                                clearInterval(time1)
                                                index2 = 0
                                            } else {
                                                clearInterval(time)
                                                clearInterval(time1)
                                            }
                                        }, 300)
                                    }
                                }, 500)
                            },

                            cancel: function (index, layero) {
                                graphGlobal.removeCells(removegroupPaths);
                                getRunningProcessList()
                                layer.close(index)
                                return false;
                            }
                        });

                    } else if (statusgroup == null || statusgroup == "" || 'TASK' === Format.customizeType) {


                    } else {

                        if (graphGlobal.isEnabled()) {
                            graphGlobal.startEditingAtCell();
                        }
                    }
                    thisEditor.setModified(false);
                    //获取port
                    //getStopsPort(paths);
                    if ('TASK' === Format.customizeType) {
                        getStopsPortNew(addPathArray);
                    }
                } else {
                    layer.msg("Add save fail", {icon: 2, shade: 0, time: 2000});
                    console.log("Add save fail");
                    fullScreen.hide();
                }

            }

        });
    }
}

function graphCellToMxCellVo(cellObject) {
    if (cellObject) {
        var mxCellVoObject = {};
        mxCellVoObject.pageId = cellObject.id;
        mxCellVoObject.parent = cellObject.parent.id;
        mxCellVoObject.style = cellObject.style;
        mxCellVoObject.value = cellObject.value;
        mxCellVoObject.vertex = cellObject.vertex;
        mxCellVoObject.edge = cellObject.edge;
        if (cellObject.source) {
            mxCellVoObject.source = cellObject.source.id;
        }
        if (cellObject.target) {
            mxCellVoObject.target = cellObject.target.id;
        }
        mxCellVoObject.mxGeometryVo = {};
        if (cellObject.geometry) {
            mxCellVoObject.mxGeometryVo.as = "geometry";
            mxCellVoObject.mxGeometryVo.x = cellObject.geometry.x;
            mxCellVoObject.mxGeometryVo.y = cellObject.geometry.y;
            mxCellVoObject.mxGeometryVo.width = cellObject.geometry.width;
            mxCellVoObject.mxGeometryVo.height = cellObject.geometry.height;
            mxCellVoObject.mxGeometryVo.relative = cellObject.geometry.relative;
        }
        return mxCellVoObject;
    }
    return;
}

//Double click event
function openProcessMonitor(evt) {
    var cellFor = evt.properties.cell;
    if (cellFor.style && (cellFor.style).indexOf("text\;") === 0) {
    } else {
        $.ajax({
            cache: true,
            type: "POST",
            url: "/piflow-web/flowGroup/findFlowByGroup",
            data: {"pageId": cellFor.id, "fId": loadId},
            async: true,
            error: function (request) {
                //alert("Jquery Ajax request error!!!");
                return;
            },
            success: function (data) {
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    if ('flow' === dataMap.nodeType) {
                        var flow_obj = dataMap.flowVo;
                        window.location.href = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=TASK&parentAccessPath=flowGroupList&load=" + flow_obj.id;
                    } else if ('flowGroup' === dataMap.nodeType) {
                        var flowGroup_obj = dataMap.flowGroupVo;
                        window.location.href = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=GROUP&parentAccessPath=flowGroupList&load=" + flowGroup_obj.id;
                    }
                } else {
                    console.log(dataMap.errorMsg);
                }
            }
        });
    }
}

//Double-click monitoring events
function OpenTheMonitorArtboard(evt) {
    var cellFor = evt.properties.cell;
    var processGroupId = getQueryString("load")
    if (cellFor.style && (cellFor.style).indexOf("text\;") === 0) {
    } else {
        $.ajax({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/piflow-web/processGroup/getProcessIdByPageId",//This is the name of the file where I receive data in the background.
            data: {
                processGroupId: processGroupId,
                pageId: cellFor.id
            },
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.msg(' failed', {icon: 2, shade: 0, time: 1000});
                return;
            },
            success: function (data) {//Operation after request successful
                if (data) {
                    var dataMap = JSON.parse(data);
                    if (200 === dataMap.code) {
                        var urlPath = "";
                        // if ('flow' === dataMap.nodeType) {
                        //     urlPath = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&processType=PROCESS&load=" + dataMap.processId;
                        // } else if ('flowGroup' === dataMap.nodeType) {
                        //     urlPath = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&processType=PROCESS_GROUP&load=" + dataMap.processGroupId;
                        // }
                        if ('flow' === dataMap.nodeType) {
                            urlPath = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&parentAccessPath=processGroupList&processType=PROCESS&load=" + dataMap.processId;
                        } else if ('flowGroup' === dataMap.nodeType) {
                            urlPath = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&parentAccessPath=processGroupList&processType=PROCESS_GROUP&load=" + dataMap.processGroupId;
                        }
                        if (urlPath) {
                            var tempWindow = window.location.href = urlPath;
                            // var tempWindow = window.open(urlPath, "_blank",);
                            if (tempWindow == null || typeof (tempWindow) == 'undefined') {
                                alert('The window cannot be opened. Please check your browser settings.')
                            }
                        }
                    }
                } else {
                    layer.msg(' failed', {icon: 2, shade: 0, time: 1000});
                }
            }
        });
    }
}

function findBasicInfo(evt) {
    flag = 0;
    var id = null;
    var value = null;
    var ss = [];
    //Set values for different events
    var cells = evt.properties.cells;
    if (null != cells) {
        //cellsAdded and cellsMoved operations go here
        value = cells[0].value;
        id = cells[0].id;
    } else {
        cells = evt.properties;
        if (null != cells.cell) {
            //Click on the Stop operation
            value = cells.cell.value;
            id = cells.cell.id;
        } else {
            //When you add a stop to the drawing board for the first time, the drag process does not get the id.
            if ('TASK' === Format.customizeType) {
                queryStopsProperty(maxStopPageId);
            } else if ('GROUP' === Format.customizeType) {
                queryFlowOrFlowGroupProperty(maxFlowPageId);
            }
        }
    }
    if (typeof (cells) != "undefined" && null != id && "" != id && "null" != id) {
        if (document.getElementById("customizeBasic_td_1_2_input1_id"))
            document.getElementById('customizeBasic_td_1_2_input1_id').value = value;
        //Check the line is the case
        if (cells.cell && cells.cell.edge) {
            if (cells.cell.target && cells.cell.source) {
                //Query Path
                queryPathInfo(id);
            }
        } else {
            //Query attribute information;
            if ('TASK' === Format.customizeType) {
                queryStopsProperty(id);
            } else if ('GROUP' === Format.customizeType) {
                queryFlowOrFlowGroupProperty(id);
            }
        }
    }
}

function queryStopsProperty(stopPageId) {
    $.ajax({
        cache: true,
        type: "POST",
        url: "/piflow-web/stops/queryIdInfo",
        data: {"stopPageId": stopPageId, "fid": loadId},
        async: true,
        error: function (request) {
            //alert("Jquery Ajax request error!!!");
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var stopsVoData = dataMap.stopsVo;
                var addParamData = {
                    data: stopsVoData.propertiesVo,
                    stopId: stopsVoData.id,
                    isCheckpoint: stopsVoData.isCheckpoint,
                    stopPageId: stopPageId,
                    isCustomized: stopsVoData.isCustomized,
                    stopsCustomizedPropertyVoList: stopsVoData.stopsCustomizedPropertyVoList,
                    stopOutPortType: stopsVoData.outPortType,
                    dataSourceVo: stopsVoData.dataSourceVo
                };
                getImagesType(data, "TASK")
                add(addParamData);
                //  $("#customizeBasic_td_1_2_input2_id").data("result",evt);
                $('#customizeBasic_td_1_2_span_id').text(stopsVoData.name);
                $('#customizeBasic_td_1_2_input1_id').attr("value", stopsVoData.name);
                $('#customizeBasic_td_1_2_input1_id').attr("name", stopsVoData.id);
                $('#customizeBasic_td_1_2_input2_id').attr("value", stopsVoData.name);
                $('#customizeBasic_td_1_2_input2_id').attr("name", stopsVoData.pageId);
                $('#customizeBasic_td_2_2_span_id').text(stopsVoData.description);
                $('#customizeBasic_td_3_2_label_id').text(stopsVoData.groups);
                $('#customizeBasic_td_4_2_label_id').text(stopsVoData.bundel);
                $('#customizeBasic_td_5_2_label_id').text(stopsVoData.version);
                $('#customizeBasic_td_6_2_label_id').text(stopsVoData.owner);
                $('#customizeBasic_td_7_2_label_id').text(stopsVoData.crtDttmString);
                var oldPropertiesVo = stopsVoData.oldPropertiesVo;
                if (oldPropertiesVo && oldPropertiesVo.length > 0) {
                    var table = document.createElement("table");
                    table.style.borderCollapse = "separate";
                    table.style.borderSpacing = "0px 5px";
                    table.style.marginLeft = "12px";
                    table.style.width = "97%";
                    var tbody = document.createElement("tbody");
                    for (var y = 0; y < oldPropertiesVo.length; y++) {
                        var select = document.createElement('select');
                        //select.style.width = "290px";
                        select.style.height = "32px";
                        select.setAttribute('id', 'old_' + oldPropertiesVo[y].name + '');
                        select.setAttribute('class', 'form-control');
                        select.setAttribute('disabled', 'disabled');
                        var displayName = oldPropertiesVo[y].displayName;
                        var customValue = oldPropertiesVo[y].customValue;
                        var allowableValues = oldPropertiesVo[y].allowableValues;
                        var isSelect = oldPropertiesVo[y].isSelect;
                        //Is it required?
                        var required = oldPropertiesVo[y].required;
                        //If it is greater than 4 and isSelect is true, there is a drop-down box
                        if (allowableValues.length > 4 && isSelect) {
                            var selectValue = JSON.parse(allowableValues);
                            var selectInfo = JSON.stringify(selectValue);
                            var strs = selectInfo.split(",");
                            var optionDefault = document.createElement("option");
                            optionDefault.value = '';
                            optionDefault.innerHTML = '';
                            optionDefault.setAttribute('selected', 'selected');
                            select.appendChild(optionDefault);
                            //Loop to assign value to select
                            for (i = 0; i < strs.length; i++) {
                                var option = document.createElement("option");
                                option.style.backgroundColor = "#DBDBDB";
                                option.value = strs[i].replace("\"", "").replace("\"", "").replace("\[", "").replace("\]", "");
                                option.innerHTML = strs[i].replace("\"", "").replace("\"", "").replace("\[", "").replace("\]", "");
                                //Sets the default selection
                                if (strs[i].indexOf('' + customValue + '') != -1) {
                                    option.setAttribute('selected', 'selected');
                                }
                                select.appendChild(option);
                            }
                        }
                        var displayName = document.createElement('input');
                        if (required)
                            displayName.setAttribute('data-toggle', 'true');
                        displayName.setAttribute('class', 'form-control');
                        displayName.setAttribute('id', 'old_' + oldPropertiesVo[y].id + '');
                        displayName.setAttribute('name', '' + oldPropertiesVo[y].name + '');
                        displayName.setAttribute('locked', oldPropertiesVo[y].isLocked);
                        // displayName.style.width = "290px";
                        displayName.setAttribute('readonly', 'readonly');
                        displayName.style.cursor = "pointer";
                        displayName.style.background = "rgb(245, 245, 245)";
                        customValue = customValue == 'null' ? '' : customValue;
                        displayName.setAttribute('value', '' + customValue + '');
                        var spanDisplayName = 'span' + oldPropertiesVo[y].displayName;
                        var spanDisplayName = document.createElement('span');
                        var spanFlag = document.createElement('span');
                        spanFlag.setAttribute('style', 'color:red');
                        mxUtils.write(spanDisplayName, '' + oldPropertiesVo[y].name + '' + ": ");
                        mxUtils.write(spanFlag, '*');
                        //Port uneditable
                        if ("outports" == oldPropertiesVo[y].displayName || "inports" == oldPropertiesVo[y].displayName) {
                            displayName.setAttribute('disabled', 'disabled');
                        }

                        var img = document.createElement("img");
                        img.setAttribute('src', '/piflow-web/img/descIcon.png');
                        img.style.cursor = "pointer";
                        img.setAttribute('title', '' + oldPropertiesVo[y].description + '');
                        var tr = document.createElement("tr");
                        tr.setAttribute('class', 'trTableStop');
                        var td = document.createElement("td");
                        td.style.width = "60px";
                        var td1 = document.createElement("td");
                        var td2 = document.createElement("td");
                        var td3 = document.createElement("td");
                        td3.style.width = "25px";
                        //Appendchild () appends elements
                        td.appendChild(spanDisplayName);
                        td3.appendChild(img);
                        //This loop is greater than 4 append drop-down, less than 4 default text box
                        if (allowableValues.length > 4 && isSelect) {
                            td1.appendChild(select);
                        } else {
                            td1.appendChild(displayName);
                            if (required) {
                                td2.appendChild(spanFlag);
                            }
                        }
                        tr.appendChild(td);
                        tr.appendChild(td3);
                        tr.appendChild(td1);
                        tr.appendChild(td2);
                        tbody.appendChild(tr);
                        table.appendChild(tbody);
                    }
                    var old_data_div = '<div id="del_last_reload_div" style="line-height: 27px;margin-left: 10px;font-size: 20px;">'
                        + '<span>last reload data</span>'
                        + '<button class="btn" style="margin-left: 2px;" onclick="deleteLastReloadData(\'' + stopsVoData.id + '\')"><i class="icon-trash"></i></button>'
                        + '</div>';
                    table.setAttribute('id', 'del_last_reload_table');
                    var attributeInfoDivObj = $("#isCheckpoint").parent();
                    attributeInfoDivObj.append(old_data_div);
                    attributeInfoDivObj.append(table);
                    attributeInfoDivObj.append("<hr>");
                }

                //Remove the timer if successful
                window.clearTimeout(timerPath);
            } else {
                //STOP attribute query null
                //console.log("STOP attribute query null");
                if (!timerPath) {
                    timerPath = window.setTimeout(queryStopsProperty(stopPageId), 500);
                }
                flag++;
                if (flag > 5) {
                    window.clearTimeout(timerPath);
                    return;
                }
            }
            layer.close(layer.index);
        }
    });
}

function queryFlowOrFlowGroupProperty(flowPageId) {
    flowsPagesId = flowPageId
    // flowdatas = undefined
    // flowGroupdata = undefined
    if (!flowPageId || !loadId) {
        return;
    }
    $.ajax({
        cache: true,
        type: "POST",
        url: "/piflow-web/flowGroup/queryIdInfo",
        data: {"flowPageId": pageId, "fId": loadId},
        async: true,
        error: function (request) {
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var flowVoNodeData = dataMap.flowVo;
                var flowGroupVoNodeData = dataMap.flowGroupVo;
                if ("flow" == dataMap.nodeType) {
                    flowdatas = dataMap.flowVo
                    flowGroupdata = ""
                    var dataId = (null != flowVoNodeData.id ? flowVoNodeData.id : "");
                    var dataName = (null != flowVoNodeData.name ? flowVoNodeData.name : "");
                    var dataPageId = (null != flowVoNodeData.pageId ? flowVoNodeData.pageId : "");
                    var dataDriverMemory = (null != flowVoNodeData.driverMemory ? flowVoNodeData.driverMemory : "");
                    var dataExecutorCores = (null != flowVoNodeData.executorCores ? flowVoNodeData.executorCores : "");
                    var dataExecutorMemory = (null == flowVoNodeData.executorMemory ? "" : flowVoNodeData.executorMemory);
                    var dataExecutorNumber = (null == flowVoNodeData.executorNumber ? "" : flowVoNodeData.executorNumber);
                    var dataDescription = (null != flowVoNodeData.description ? flowVoNodeData.description : "");
                    var dataCrtDttmString = (null == flowVoNodeData.crtDttmString ? "" : flowVoNodeData.crtDttmString);
                    var stopQuantity = flowVoNodeData.stopQuantity;
                    $('#customizeBasic_td_1_2_span_id').text(dataName);
                    $('#customizeBasic_td_1_2_input1_id').attr("value", dataName);
                    $('#customizeBasic_td_1_2_input1_id').attr("name", dataId);
                    $('#customizeBasic_td_1_2_input2_id').attr("value", dataName);
                    $('#customizeBasic_td_1_2_input2_id').attr("name", dataPageId);
                    $('#customizeBasic_td_2_2_span_id').text(dataDescription);
                    $('#customizeBasic_td_3_2_label_id').text(dataDriverMemory);
                    $('#customizeBasic_td_4_2_label_id').text(dataExecutorCores);
                    $('#customizeBasic_td_5_2_label_id').text(dataExecutorMemory);
                    $('#customizeBasic_td_6_2_label_id').text(dataExecutorNumber);
                    $('#customizeBasic_td_7_2_label_id').text(dataCrtDttmString);
                    $('#customizeBasic_td_8_2_label_id').text(stopQuantity);
                    var addDatas = [
                        {id: "id0", name: "driverMemory", value: dataDriverMemory, description: "driverMemory"},
                        {id: "id1", name: "executorCores", value: dataExecutorCores, description: "executorCores"},
                        {id: "id2", name: "executorMemory", value: dataExecutorMemory, description: "executorMemory"},
                        {id: "id3", name: "executorNumber", value: dataExecutorNumber, description: "executorNumber"},
                        {id: "id4", name: "description", value: dataDescription, description: "description"}
                    ];
                    add();
                    add(addDatas, dataId, dataMap.nodeType);
                    //Remove the timer if successful
                    window.clearTimeout(timerPath);
                } else if ("flowGroup" === dataMap.nodeType) {
                    flowGroupdata = dataMap.flowGroupVo
                    flowdatas = ""
                    // if(flowGroupdata==undefined){
                    //     queryFlowOrFlowGroupProperty(flowPageId)
                    // }
                    var dataId = (null != flowGroupVoNodeData.id ? flowGroupVoNodeData.id : "");
                    var dataName = (null != flowGroupVoNodeData.name ? flowGroupVoNodeData.name : "");
                    var dataPageId = (null != flowGroupVoNodeData.pageId ? flowGroupVoNodeData.pageId : "");
                    var dataDescription = (null != flowGroupVoNodeData.description ? flowGroupVoNodeData.description : "");
                    var dataCrtDttmString = (null == flowGroupVoNodeData.crtDttmString ? "" : flowGroupVoNodeData.crtDttmString);
                    var flowGroupQuantity = flowGroupVoNodeData.flowGroupQuantity;
                    var flowQuantity = flowGroupVoNodeData.flowQuantity;
                    $('#customizeBasic_td_1_2_span_id').text(dataName);
                    $('#customizeBasic_td_1_2_input1_id').attr("value", dataName);
                    $('#customizeBasic_td_1_2_input1_id').attr("name", dataId);
                    $('#customizeBasic_td_1_2_input2_id').attr("value", dataName);
                    $('#customizeBasic_td_1_2_input2_id').attr("name", dataPageId);
                    $('#customizeBasic_td_1_2_input2_id').data("updateType", dataMap.nodeType);
                    $('#customizeBasic_td_2_2_span_id').text(dataDescription);
                    $('#customizeBasic_td_3_2_label_id').text(dataCrtDttmString);
                    $('#customizeBasic_td_4_2_label_id').text(flowGroupQuantity);
                    $('#customizeBasic_td_5_2_label_id').text(flowQuantity);
                    $('#customizeBasic_td_6_2_label_id').hide();
                    $('#customizeBasic_td_7_2_label_id').hide();
                    $('#customizeBasic_td_8_2_label_id').hide();

                    $('#customizeBasic_td_1_1_span_id').text("flowGroupName： ");
                    $('#customizeBasic_td_2_1_span_id').text("flowDescription： ");
                    $('#customizeBasic_td_3_1_span_id').text("createTime： ");
                    $('#customizeBasic_td_4_1_span_id').text("groups： ");
                    $('#customizeBasic_td_5_1_span_id').text("flows： ");
                    $('#customizeBasic_td_6_1_span_id').hide();
                    $('#customizeBasic_td_7_1_span_id').hide();
                    $('#customizeBasic_td_8_1_span_id').hide();
                    var addDatas = [
                        {id: "id0", name: "description", value: dataDescription, description: "description"}
                    ];
                    add();
                    add(addDatas, dataId, dataMap.nodeType);
                    //Remove the timer if successful
                    window.clearTimeout(timerPath);
                } else {
                    if (!timerPath) {
                        timerPath = window.setTimeout(queryFlowOrFlowGroupProperty(flowPageId), 500);
                    }
                    flag++;
                    if (flag > 5) {
                        window.clearTimeout(timerPath);
                        return;
                    }
                }
            } else {
                layer.msg("Load fail,Please click again to reload", {icon: 2, shade: 0, time: 2000});
            }
            if (flowGroupdata == "") {
                getNodeId(flowdatas, "TASK")
                getImagesType(flowdatas, "TASK")
                // console.log(flowdatas,"TASK")
            } else {
                getNodeId(flowGroupdata, "GROUP")
                getImagesType(flowGroupdata, "GROUP")
                // console.log("GROUP")
            }
            //layer.close(layer.index);
        }
    });
    // }
    // },500)
}

function queryPathInfo(id) {
    var param_values = {};
    param_values.customizeBasic_td_1_1_span_children = 'pageId：';
    param_values.customizeBasic_td_3_1_span_children = 'inport：';
    param_values.customizeBasic_td_4_1_span_children = 'outport：';
    param_values.customizeBasic_td_5_1_span_children = 'form：';
    param_values.customizeBasic_td_6_1_span_children = 'to：';
    param_values.customizeBasic_td_7_1_span_children = 'createTime：';
    if ('TASK' === Format.customizeType) {
        param_values.url = "/piflow-web/path/queryPathInfo";
        param_values.customizeBasic_td_2_1_span_children = 'flowName：';
    } else if ('GROUP' === Format.customizeType) {
        param_values.url = "/piflow-web/flowGroupPath/queryPathInfoFlowGroup";
        param_values.customizeBasic_td_2_1_span_children = 'flowGroupName：';
    }
    if (param_values.url) {
        $.ajax({
            cache: true,
            type: "POST",
            url: param_values.url,
            data: {"id": id, "fid": loadId},
            async: true,
            error: function (request) {
                //alert("Jquery Ajax request error!!!");
                return;
            },
            success: function (data) {
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    var queryInfo = dataMap.queryInfo;
                    if ("" != queryInfo) {
                        $("#AttributeInfoId").hide();
                        $("#containerID").show();
                        $("#basicInfoId").html('path info');
                        $('#basicInfoId').css('text-align', '');
                        $('#basicInfoId').css('background-color', '');
                        $('#basicInfoId').css('border-style', '');
                        $('#basicInfoId').css('height', '27px');
                        $("#customizeBasic_td_1_1_span_id").html(param_values.customizeBasic_td_1_1_span_children);
                        $("#customizeBasic_td_2_1_span_id").html(param_values.customizeBasic_td_2_1_span_children);
                        $("#customizeBasic_td_3_1_span_id").html(param_values.customizeBasic_td_3_1_span_children);
                        $("#customizeBasic_td_4_1_span_id").html(param_values.customizeBasic_td_4_1_span_children);
                        $("#customizeBasic_td_5_1_span_id").html(param_values.customizeBasic_td_5_1_span_children);
                        $("#customizeBasic_td_6_1_span_id").html(param_values.customizeBasic_td_6_1_span_children);
                        $("#customizeBasic_td_7_1_span_id").html(param_values.customizeBasic_td_7_1_span_children);
                        $("#customizeBasic_td_1_2_button_id").hide();
                        $("#customizeBasic_td_3_2_label_id").html(queryInfo.inport);
                        $("#customizeBasic_td_4_2_label_id").html(queryInfo.outport);
                        $("#customizeBasic_td_7_2_label_id").html(queryInfo.crtDttmString);
                        if ('TASK' === Format.customizeType) {
                            $("#customizeBasic_td_1_2_input1_id").val(queryInfo.pageId);
                            $("#customizeBasic_td_2_2_span_id").html(queryInfo.flowVo.name);
                            $("#customizeBasic_td_5_2_label_id").html(queryInfo.stopFrom.name);
                            $("#customizeBasic_td_6_2_label_id").html(queryInfo.stopTo.name);
                        } else if ('GROUP' === Format.customizeType) {
                            $("#customizeBasic_td_1_2_span_id").html(queryInfo.pageId);
                            $("#customizeBasic_td_2_2_span_id").html(queryInfo.flowGroupVo.name);
                            $("#customizeBasic_td_5_2_label_id").html(queryInfo.flowFrom);
                            $("#customizeBasic_td_6_2_label_id").html(queryInfo.flowTo);
                        }
                    }
                } else {
                    console.log("Path attribute query null");
                }
            }
        });
    }
}

function add(addParamData, flowId, nodeType) {
    if ('TASK' === Format.customizeType) {
        taskAdd(addParamData);
    } else if ('GROUP' === Format.customizeType) {
        groupAdd(addParamData, flowId, nodeType)
    }
}

function taskAdd(addParamData) {
    //function add(data, stopId, isCheckpoint, stopPageId, isCustomized, stopsCustomizedPropertyVoList, stopOutPortType, dataSourceVo) {
    if (addParamData.data && addParamData.data != null && addParamData.data.length > 0) {
        var data = addParamData.data
        while (divValue.hasChildNodes()) {
            divValue.removeChild(divValue.firstChild);
        }
        var table = document.createElement("table");
        table.style.borderCollapse = "separate";
        table.style.borderSpacing = "0px 5px";
        table.style.marginLeft = "12px";
        table.style.width = "97%";
        var tbody = document.createElement("tbody");
        for (var y = 0; y < data.length; y++) {
            var select = document.createElement('select');
            //select.style.width = "290px";
            select.style.height = "32px";
            select.setAttribute('id', '' + data[y].name + '');
            select.setAttribute('onblur', 'shiqu("' + data[y].id + '","' + data[y].name + '","select")');
            select.setAttribute('class', 'form-control');
            if (isExample) {
                select.setAttribute('disabled', 'disabled');
            }
            var displayName = data[y].displayName;
            var customValue = data[y].customValue;
            var allowableValues = data[y].allowableValues;
            var isSelect = data[y].isSelect;
            //Is it required?
            var required = data[y].required;
            //If it is greater than 4 and isSelect is true, there is a drop-down box
            if (allowableValues.length > 4 && isSelect) {
                var selectValue = JSON.parse(allowableValues);
                var selectInfo = JSON.stringify(selectValue);
                var strs = selectInfo.split(",");
                var optionDefault = document.createElement("option");
                optionDefault.value = '';
                optionDefault.innerHTML = '';
                optionDefault.setAttribute('selected', 'selected');
                select.appendChild(optionDefault);
                //Loop to assign value to select
                for (i = 0; i < strs.length; i++) {
                    var option = document.createElement("option");
                    option.style.backgroundColor = "#DBDBDB";
                    option.value = strs[i].replace("\"", "").replace("\"", "").replace("\[", "").replace("\]", "");
                    option.innerHTML = strs[i].replace("\"", "").replace("\"", "").replace("\[", "").replace("\]", "");
                    //Sets the default selection
                    if (strs[i].indexOf('' + customValue + '') != -1) {
                        option.setAttribute('selected', 'selected');
                    }
                    select.appendChild(option);
                }
            }
            var displayName = document.createElement('input');
            if (required)
                displayName.setAttribute('data-toggle', 'true');
            displayName.setAttribute('class', 'form-control');
            displayName.setAttribute('id', '' + data[y].id + '');
            displayName.setAttribute('name', '' + data[y].name + '');
            displayName.setAttribute('onclick', 'attributeTabTd(this,false,null)');
            displayName.setAttribute('locked', data[y].isLocked);
            // displayName.style.width = "290px";
            displayName.setAttribute('readonly', 'readonly');
            displayName.style.cursor = "pointer";
            displayName.style.background = "rgb(245, 245, 245)";
            customValue = customValue == 'null' ? '' : customValue;
            displayName.setAttribute('value', '' + customValue + '');
            var spanDisplayName = 'span' + data[y].displayName;
            var spanDisplayName = document.createElement('span');
            var spanFlag = document.createElement('span');
            spanFlag.setAttribute('style', 'color:red');
            mxUtils.write(spanDisplayName, '' + data[y].name + '' + ": ");
            mxUtils.write(spanFlag, '*');
            //Port uneditable
            if ("outports" == data[y].displayName || "inports" == data[y].displayName) {
                displayName.setAttribute('disabled', 'disabled');
            }

            var img = document.createElement("img");
            img.setAttribute('src', '/piflow-web/img/descIcon.png');
            img.style.cursor = "pointer";
            img.setAttribute('title', '' + data[y].description + '');
            var tr = document.createElement("tr");
            tr.setAttribute('class', 'trTableStop');
            var td = document.createElement("td");
            td.style.width = "60px";
            var td1 = document.createElement("td");
            var td2 = document.createElement("td");
            var td3 = document.createElement("td");
            td3.style.width = "25px";
            //Appendchild () appends elements
            td.appendChild(spanDisplayName);
            td3.appendChild(img);
            //This loop is greater than 4 append drop-down, less than 4 default text box
            if (allowableValues.length > 4 && isSelect) {
                td1.appendChild(select);

            } else {
                td1.appendChild(displayName);
                if (required)
                    td2.appendChild(spanFlag);
            }
            tr.appendChild(td);
            tr.appendChild(td3);
            tr.appendChild(td1);
            tr.appendChild(td2);
            tbody.appendChild(tr);
            table.appendChild(tbody);
        }
        var btn = mxUtils.button('submit', mxUtils.bind(this, function (evt) {
            //Create an array
            var arrayObj = new Array();
            for (var y = 0; y < data.length; y++) {
                var content = document.getElementById('' + data[y].displayName + '').value;
                var classname = document.getElementById('' + data[y].displayName + '').className;
                if (content != null && content.length > 0) {
                    arrayObj.push(content + "#id#" + data[y].id);
                } else {
                    if (classname == 'true') {
                        $("#" + data[y].displayName + "").focus();
                        $("#" + data[y].displayName + "").css("background-color", "#FFD39B");
                    }
                }
            }
            $.ajax({
                cache: true,
                type: "POST",
                url: "/piflow-web/stops/updateStops",
                data: {content: arrayObj},
                async: true,
                traditional: true,
                error: function (request) {
                    console.log("attribute update error");
                    return;
                },
                success: function (data) {
                    console.log("attribute update success");
                    $("textarea").blur();
                    $("select").blur();
                }
            });
        }));
        var checkboxCheckpoint = document.createElement('input');
        checkboxCheckpoint.setAttribute('type', 'checkbox');
        checkboxCheckpoint.setAttribute('id', 'isCheckpoint');
        if (addParamData.isCheckpoint) {
            checkboxCheckpoint.setAttribute('checked', 'checked');
        }
        if (isExample) {
            checkboxCheckpoint.setAttribute('disabled', 'disabled');
        }
        checkboxCheckpoint.setAttribute('onclick', 'saveCheckpoints("' + addParamData.stopId + '")');
        var spanCheckpoint = document.createElement('span');
        mxUtils.write(spanCheckpoint, 'Whether to add Checkpoint');
        btn.style.width = '202px';
        btn.style.marginLeft = '18px';
        btn.style.marginTop = '10px';


        var dataSource = '<table style="border-collapse: separate; border-spacing: 0px 5px; margin-left: 12px; width: 97%;">'
            + '<tbody>'
            + '<tr>'
            + '<td style="width: 99px;"><span>dataSource: </span></td>'
            + '<td style="width: 25px;"><img src="/piflow-web/img/descIcon.png" title="Fill Datasoure" style="cursor: pointer;"></td>'
            + '<td>'
            // + '<select id="datasourceSelectElement" onblur="alert(1);" class="form-control" style="height: 32px;">'
            + '<div id="datasourceDivElement" style="float: left;width: 98%;">'
            + '<select id="datasourceSelectElement" class="form-control" style="height: 32px;">'
            + '<option value="" selected="selected"></option>'
            + '</select>'
            + '</div>'
            + '<div style="float: left;width: 2%;">'
            + '<button class="btn" onclick="openDatasourceList()" style="margin-left: 2px;"><i class="glyphicon glyphicon-edit"></i></button>'
            + '</div>'
            + '</td>'
            + '<td style="width: 37px;text-align: right;">'
            + ''
            + '</td>'
            + '</tr>'
            + '</tbody>'
            + '</table>'
            + '<hr>';

        $(divValue).append(dataSource);
        divValue.appendChild(table);
        //divValue.appendChild(btn);
        divValue.appendChild(checkboxCheckpoint);
        divValue.appendChild(spanCheckpoint);
        $(divValue).append('<hr>');
        getDatasourceList(addParamData.stopId, addParamData.stopPageId, addParamData.dataSourceVo);
    }
    if (addParamData.isCustomized) {
        var div_obj_fill = $("#fill_datasource_id");
        if (!div_obj_fill.html()) {
            $(divValue).append('<div id="fill_datasource_id"></div>');
            div_obj_fill = $("#fill_datasource_id");
        }
        $("#customized_id").remove();
        var customizedTableObj = $("#customizedTableObj").clone();
        var tr_all = "";
        if (addParamData.stopsCustomizedPropertyVoList && addParamData.stopsCustomizedPropertyVoList.length > 0) {
            var stopsCustomizedPropertyVoList = addParamData.stopsCustomizedPropertyVoList;
            for (var i = 0; i < stopsCustomizedPropertyVoList.length; i++) {
                tr_all += setCustomizedTableHtml(addParamData.stopPageId, stopsCustomizedPropertyVoList[i], addParamData.stopOutPortType);
            }
        }
        customizedTableObj.find("a").attr("href", "javascript:openAddStopCustomAttrPage('" + addParamData.stopId + "');")
        customizedTableObj.find(".trTableCustomizedStopProperty").remove();
        customizedTableObj.find("tbody").append(tr_all);
        var customized_obj = '<div id="customized_id">' + customizedTableObj.html() + '</div>';
        div_obj_fill.before(customized_obj);
    }
}

function groupAdd(addParamData, flowId, nodeType) {
    if (flowId && addParamData && addParamData.length > 0 && divValue) {
        var table = document.createElement("table");
        table.style.borderCollapse = "separate";
        table.style.borderSpacing = "0px 5px";
        table.style.marginLeft = "12px";
        table.style.width = "97%";
        var tbody = document.createElement("tbody");
        for (var i = 0; i < addParamData.length; i++) {
            var addData_i = addParamData[i];
            var displayName = document.createElement('input');
            displayName.setAttribute('data-toggle', 'true');
            displayName.setAttribute('class', 'form-control');
            displayName.setAttribute('id', '' + addData_i.id + '');
            displayName.setAttribute('name', '' + addData_i.name + '');
            displayName.setAttribute('onclick', 'attributeTabTd(this,false,"' + nodeType + '")');
            displayName.setAttribute('readonly', 'readonly');
            displayName.style.cursor = "pointer";
            displayName.style.background = "rgb(245, 245, 245)";
            var customValue = (addData_i.value == 'null' ? '' : addData_i.value);
            displayName.setAttribute('value', '' + customValue + '');
            var spanDisplayName = document.createElement('span');
            var spanFlag = document.createElement('span');
            spanFlag.setAttribute('style', 'color:red');
            mxUtils.write(spanDisplayName, '' + addData_i.name + '' + ": ");
            mxUtils.write(spanFlag, '*');
            var img = document.createElement("img");
            img.setAttribute('src', '/piflow-web/img/descIcon.png');
            img.style.cursor = "pointer";
            img.setAttribute('title', '' + addData_i.description + '');
            var tr_1 = document.createElement("tr");
            tr_1.setAttribute('class', 'trTableStop');
            var td1_1 = document.createElement("td");
            var td1_2 = document.createElement("td");
            var td1_3 = document.createElement("td");
            var td1_4 = document.createElement("td");
            td1_1.style.width = "60px";
            td1_2.style.width = "25px";
            //开始appendchild()追加各个元素
            td1_1.appendChild(spanDisplayName);
            td1_2.appendChild(img);
            td1_3.appendChild(displayName);
            td1_4.appendChild(spanFlag);
            tr_1.appendChild(td1_1);
            tr_1.appendChild(td1_2);
            tr_1.appendChild(td1_3);
            tr_1.appendChild(td1_4);
            tbody.appendChild(tr_1);
        }
        table.appendChild(tbody);
        divValue.appendChild(table);
        var flowIdInput = document.createElement("input");
        flowIdInput.setAttribute("id", "updateFlowId")
        flowIdInput.setAttribute("value", flowId);
        flowIdInput.setAttribute("style", "display:none;");
        divValue.appendChild(flowIdInput);
    } else {
        while (divValue && divValue.hasChildNodes()) {
            divValue.removeChild(divValue.firstChild);
        }
    }
}

function setCustomizedTableHtml(stopPageId, stopsCustomizedPropertyVo, stopOutPortType) {
    var isRouter = false;
    if (stopOutPortType && stopOutPortType.stringValue === "ROUTE") {
        isRouter = true;
    }
    var table_tr = "";
    if (stopsCustomizedPropertyVo) {
        table_tr = '<tr class="trTableCustomizedStopProperty">'
            + '<td style="width: 60px;">'
            + '<span style="margin-left: 10px;">' + stopsCustomizedPropertyVo.name + ': </span>'
            + '</td>'
            + '<td style="width: 25px;">'
            + '<img src="/piflow-web/img/descIcon.png" title="' + stopsCustomizedPropertyVo.description + '" style="cursor: pointer;">'
            + '</td>'
            + '<td>'
            + '<input data-toggle="true"class="form-control"'
            + 'id="' + stopsCustomizedPropertyVo.id + '"'
            + 'name="' + stopsCustomizedPropertyVo.name + '" '
            + 'value="' + stopsCustomizedPropertyVo.customValue + '" '
            + 'onclick="attributeTabTd(this,true,null)"readonly="readonly" value=""style="background: rgb(245, 245, 245);">'
            + '</td>'
            + '<td>'
            + '<span style="color:red">*</span>'
            + '<a class="btn" href="javascript:removeStopCustomProperty(\'' + stopPageId + '\',\'' + stopsCustomizedPropertyVo.id + '\',' + isRouter + ');"><i class="glyphicon glyphicon-remove" style="color: red;"></i></a>'
            + '</td>'
            + '</tr>';
    }
    return table_tr;

}

function getDatasourceList(stop_id, stop_page_id, dataSourceVo) {
    $.ajax({
        cache: true,//sava cache data
        type: "POST",// request type
        url: "/piflow-web/datasource/getDatasourceList",

        //data:$('#loginForm').serialize(),//Form serialization
        async: true,//open asynchronous request
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var dataSourceList = dataMap.data;
                var select_html = '<select id="datasourceSelectElement" class="form-control" style="width: 100%;" onchange="fillDatasource(this,\'' + stop_id + '\',\'' + stop_page_id + '\')">'
                if (dataSourceList && dataSourceList.length > 0) {
                    var option_html = '<option value="">please select datasource...</option>';
                    var dataSourceVoId = '';
                    if (dataSourceVo && dataSourceVo.id) {
                        dataSourceVoId = dataSourceVo.id;
                    }
                    if ('' === dataSourceVoId) {
                        option_html = '<option selected="selected" value="">please select datasource...</option>';
                    }
                    for (var i = 0; i < dataSourceList.length; i++) {
                        if (dataSourceList[i].id === dataSourceVoId) {
                            option_html += ('<option selected="selected" value="' + dataSourceList[i].id + '">');
                        } else {
                            option_html += ('<option value="' + dataSourceList[i].id + '">');
                        }
                        option_html += (dataSourceList[i].dataSourceName + '(' + dataSourceList[i].dataSourceType + ')'
                            + '</option>');
                    }
                }
                select_html += (option_html + "</select></div>");
                $('#datasourceDivElement').html(select_html);
            } else {
                //alert(operType + " save fail");
                layer.msg("Load fail", {icon: 2, shade: 0, time: 2000});
                console.log("Load fail");
            }
        }
    });
}

function fillDatasource(datasource, stop_id, stop_page_id) {
    var datasourceId = $(datasource).val();
    if (stop_id) {
        $.ajax({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/piflow-web/datasource/fillDatasource",//This is the name of the file where I receive data in the background.
            //data:$('#loginForm').serialize(),//Serialize the form
            data: {"dataSourceId": datasourceId, "stopId": stop_id},
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    queryStopsProperty(stop_page_id);
                } else {
                    //alert(operType + " save fail");
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                    console.log(dataMap.errorMsg);
                }
            }
        });
    } else {
        layer.msg("failed, stopId is null or datasourceId is null", {icon: 2, shade: 0, time: 2000});
    }
}

//Save XML file and related information
function saveXml(paths, operType) {
    var getXml = thisEditor.getGraphXml();
    var xml_outer_html = getXml.outerHTML;
    //var waitxml = encodeURIComponent(getXml.outerHTML);//This is the XML code to submit to the background
    var url = "/piflow-web/mxGraph/saveDataForTask";
    if ('TASK' === Format.customizeType) {
        url = "/piflow-web/mxGraph/saveDataForTask";
    } else if ('GROUP' === Format.customizeType) {
        url = "/piflow-web/mxGraph/saveDataForGroup";
    }
    var time, time1
    $.ajax({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: url,
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            imageXML: xml_outer_html,
            load: loadId,
            operType: operType
        },
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//After the request is successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                console.log(operType + " save success");
                if (statusgroup == "group" && operType == "ADD") {
                    $("#buttonGroup").attr("onclick", "");
                    $("#buttonGroup").attr("onclick", "saveOrUpdateFlowGroup()");
                    $("#flowGroupId").val("");
                    $("#flowGroupName").val("");
                    $("#description1").val("");
                    layer.open({
                        type: 1,
                        title: '<span style="color: #269252;">create flow group</span>',
                        shadeClose: false,
                        shade: 0.3,
                        closeBtn: 1,
                        shift: 7,
                        area: ['580px', '520px'], //Width height
                        skin: 'layui-layer-rim', //Add borders
                        content: $("#SubmitPage"),
                        success: function () {
                            $(".layui-layer-page").css("z-index", "1998910151");

                            queryFlowOrFlowGroupProperty(flowsPagesId)

                            setTimeout(() => {
                                if (flowGroupdata == undefined) {
                                    var index2 = 0
                                    clearInterval(time)
                                    clearInterval(time1)
                                    time1 = setInterval(() => {
                                        if (index2 < 4) {
                                            queryFlowOrFlowGroupProperty(flowsPagesId)
                                            index2++
                                        } else if (index2 >= 4) {
                                            // layer.closeAll()
                                            // layer.msg("Network Anomaly", {icon: 5})
                                            alert("Network Anomaly")
                                            clearInterval(time1)
                                            index2 = 0
                                        } else {
                                            clearInterval(time)
                                            clearInterval(time1)
                                        }
                                    }, 300)
                                }
                            }, 500)

                        },
                        cancel: function (index, layero) {
                            graphGlobal.removeCells(removegroupPaths);
                            layer.close(index)

                            return false;
                        }
                    });
                } else if (statusgroup == "flow" && operType == "ADD") {
                    $("#buttonFlowCancel").attr("onclick", "");
                    $("#buttonFlowCancel").attr("onclick", "cancelFlow()");
                    $("#buttonFlow").attr("onclick", "");
                    $("#buttonFlow").attr("onclick", "saveFlow()");
                    $("#flowId").val("");
                    $("#flowName").val("");
                    $("#description").val("");
                    $("#driverMemory").val('1g');
                    $("#executorNumber").val('1');
                    $("#executorMemory").val('1g');
                    $("#executorCores").val('1');
                    layer.open({
                        type: 1,
                        title: '<span style="color: #269252;">create flow</span>',
                        shadeClose: false,
                        shade: 0.3,
                        closeBtn: 1,
                        shift: 7,
                        area: ['580px', '520px'], //Width height
                        skin: 'layui-layer-rim', //Add borders
                        content: $("#SubmitPageFlow"),
                        success: function () {
                            queryFlowOrFlowGroupProperty(flowsPagesId)


                            setTimeout(() => {
                                if (flowdatas == undefined) {
                                    var index2 = 0
                                    clearInterval(time)
                                    clearInterval(time1)
                                    time1 = setInterval(() => {
                                        if (index2 < 4) {
                                            queryFlowOrFlowGroupProperty(flowsPagesId)
                                            index2++
                                        } else if (index2 >= 4) {
                                            // layer.closeAll()
                                            // layer.msg("Network Anomaly", {icon: 5})
                                            alert("Network Anomaly")
                                            clearInterval(time1)
                                            index2 = 0
                                        } else {
                                            clearInterval(time)
                                            clearInterval(time1)
                                        }
                                    }, 300)
                                }
                            }, 500)
                        },

                        cancel: function (index, layero) {
                            graphGlobal.removeCells(removegroupPaths);
                            getRunningProcessList()
                            layer.close(index)
                            return false;
                        }
                    });

                } else if (statusgroup == null || statusgroup == "" || 'TASK' === Format.customizeType) {


                } else {

                    if (graphGlobal.isEnabled()) {
                        graphGlobal.startEditingAtCell();
                    }
                }
                thisEditor.setModified(false);
                if (operType && '' !== operType) {
                    //获取port
                    //getStopsPort(paths);
                    if ('TASK' === Format.customizeType) {
                        getStopsPortNew(paths);
                    }
                }
            } else {
                //alert(operType + " save fail");
                layer.msg(operType + " save fail", {icon: 2, shade: 0, time: 2000});
                console.log(operType + " save fail");
                fullScreen.hide();
            }

        }

    });
}

function cancelFlow() {
    graphGlobal.removeCells(removegroupPaths);
    layer.closeAll()
}

function cancelGroup() {
    graphGlobal.removeCells(removegroupPaths);
    layer.closeAll()
}

//弹框------------------start---------------------------
function checkGroupInput(flowName) {
    if (flowName == '') {
        layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('flowName').focus();
        return false;
    }
    /*  if (description == '') {
         layer.msg('description不能为空！', {icon: 2, shade: 0, time: 2000});
         document.getElementById('description').focus();
         return false;
     } */
    return true;
};

function saveOrUpdateFlowGroup() {
    if (flowGroupdata == undefined) {
        alert("Please click the close button and drag it again to create")
        return
    }
    var id = $("#flowGroupId").val();
    var flowGroupName = $("#flowGroupName").val();
    var description = $("#description1").val();
    if (!checkGroupInput(flowGroupName)) {
        // layer.closeAll()
        // layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        alert("flowName Can not be empty")
    } else {
        // if (flowGroupdata == undefined || "") {
        //     layer.closeAll()
        //     layer.msg("Network Anomaly", {icon: 5})
        // } else {
        var requestDataParam = {
            flowGroupId: loadId,
            flowId: flowGroupdata.id,
            pageId: flowGroupdata.pageId,
            updateType: "flowGroup",
            name: flowGroupName
        };
        var msgtrue = false
        $.ajax({
            cache: true,
            type: "POST",
            url: Format.customizeTypeAttr.updateNameUrl,
            data: requestDataParam,
            async: true,
            traditional: true,
            error: function (request) {
                console.log("attribute update error");
                return;
            },
            success: function (data) {
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    //reload xml
                    var xml = mxUtils.parseXml(dataMap.XmlData);
                    var node = xml.documentElement;
                    var dec = new mxCodec(node.ownerDocument);
                    dec.decode(node, graphGlobal.getModel());
                    $("#customizeBasic_td_1_2_input2_id").val(flowGroupName);
                    layer.closeAll()
                    msgtrue = true
                    layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                        // findBasicInfo(results);
                    });

                } else {
                    // layer.closeAll()
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                    alert(dataMap.errorMsg)
                    msgtrue = false
                }
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: "/piflow-web/flowGroup/updateFlowGroupBaseInfo",
                    data: {
                        id: flowGroupdata.id,
                        description: description,
                        name: flowGroupName
                    },
                    async: true,
                    traditional: true,
                    error: function (request) {
                        console.log("attribute update error");
                        return;
                    },
                    success: function (data) {
                        var dataMap = JSON.parse(data);
                        if (200 === dataMap.code) {
                            var flowGroupVo = dataMap.flowGroupVo;
                            // descriptionObj.val(flowGroupVo.description)
                            //baseInfo
                            $('#customizeBasic_td_2_2_span_id').text(flowGroupVo.description);
                        } else {
                            layer.msg('', {icon: 2, shade: 0, time: 2000});
                        }
                        if (msgtrue) {
                            layer.closeAll();
                        }

                        console.log("attribute update success");
                    }
                });

            }
        });


    }

}

//弹框------------------end---------------------------

//flow Information popup-----
function saveFlow() {

    if (flowdatas == undefined) {
        alert("Please click the close button and drag it again to create")
        return
    }
    // queryFlowOrFlowGroupProperty(flowsPagesId)
    var flowName = $("#flowName").val();
    var description = $("#description").val();
    var driverMemory = $("#driverMemory").val();
    var executorNumber = $("#executorNumber").val();
    var executorMemory = $("#executorMemory").val();
    var executorCores = $("#executorCores").val();
    if (!checkFlowInput(flowName, description, driverMemory, executorNumber, executorMemory, executorCores)) {
        // layer.closeAll()
        // layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        alert("flowName Can not be empty")
    } else {
        // if (flowdatas == undefined || "") {
        //     layer.closeAll()
        //     layer.msg("Network Anomaly", {icon: 5})
        // } else {

        var requestDataParam = {
            flowGroupId: loadId,
            flowId: flowdatas.id,
            pageId: flowdatas.pageId,
            updateType: "flow",
            name: flowName
        };
        $.ajax({
            cache: true,
            type: "POST",
            url: Format.customizeTypeAttr.updateNameUrl,
            data: requestDataParam,
            async: true,
            traditional: true,
            error: function (request) {
                console.log("attribute update error");
                return;
            },
            success: function (data) {
                var dataMap = JSON.parse(data);
                var msgtrue = false
                if (200 === dataMap.code) {
                    //reload xml
                    var xml = mxUtils.parseXml(dataMap.XmlData);
                    var node = xml.documentElement;
                    var dec = new mxCodec(node.ownerDocument);
                    dec.decode(node, graphGlobal.getModel());
                    $("#customizeBasic_td_1_2_input2_id").val(flowName);
                    layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                        // findBasicInfo(results);
                    });
                    layer.closeAll()
                } else {
                    // layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000}, function () {
                    // });
                    alert(dataMap.errorMsg)
                    msgtrue = false

                }

                $.ajax({
                    cache: true,
                    type: "POST",
                    url: "/piflow-web/flow/updateFlowBaseInfo",
                    data: {
                        id: flowdatas.id,
                        driverMemory: driverMemory,
                        executorCores: executorCores,
                        executorMemory: executorMemory,
                        executorNumber: executorNumber,
                        description: description
                    },
                    async: true,
                    traditional: true,
                    error: function (request) {
                        console.log("attribute update error");
                        return;
                    },
                    success: function (data) {
                        var dataMap = JSON.parse(data);
                        if (200 === dataMap.code) {
                            var flowVo = dataMap.flowVo;
                            //baseInfo
                            $('#customizeBasic_td_2_2_span_id').text(flowVo.description);
                            $('#customizeBasic_td_3_2_label_id').text(flowVo.driverMemory);
                            $('#customizeBasic_td_4_2_label_id').text(flowVo.executorCores);
                            $('#customizeBasic_td_5_2_label_id').text(flowVo.executorMemory);
                            $('#customizeBasic_td_6_2_label_id').text(flowVo.executorNumber);
                        } else {
                            layer.msg('', {icon: 2, shade: 0, time: 2000});
                        }
                        console.log("attribute update success");
                        if (msgtrue) {
                            layer.closeAll('page');
                        }
                    }
                });

            }
        });


        // if (checkFlowInput(flowName, description, driverMemory, executorNumber, executorMemory, executorCores)){
        //     $.ajax({
        //         cache: true,
        //         type: "POST",
        //         url: "/piflow-web/flow/updateFlowBaseInfo",
        //         data: {
        //             id: flowdatas.id,
        //             driverMemory: driverMemory,
        //             executorCores: executorCores,
        //             executorMemory: executorMemory,
        //             executorNumber: executorNumber,
        //             description: description
        //         },
        //         async: true,
        //         traditional: true,
        //         error: function (request) {
        //             console.log("attribute update error");
        //             return;
        //         },
        //         success: function (data) {
        //             var dataMap = JSON.parse(data);
        //             if (200 === dataMap.code) {
        //                 var flowVo = dataMap.flowVo;
        //                 //baseInfo
        //                 $('#customizeBasic_td_2_2_span_id').text(flowVo.description);
        //                 $('#customizeBasic_td_3_2_label_id').text(flowVo.driverMemory);
        //                 $('#customizeBasic_td_4_2_label_id').text(flowVo.executorCores);
        //                 $('#customizeBasic_td_5_2_label_id').text(flowVo.executorMemory);
        //                 $('#customizeBasic_td_6_2_label_id').text(flowVo.executorNumber);
        //             } else {
        //                 layer.msg('', {icon: 2, shade: 0, time: 2000}, function () {
        //                 });
        //             }
        //             layer.closeAll('page');
        //             console.log("attribute update success");
        //         }
        //     });
        // }

        // if (checkFlowInput(flowName, description, driverMemory, executorNumber, executorMemory, executorCores)){
        //
        // }
        // // $.ajax({
        //     // cache: true,//Keep cached data
        //     // type: "get",//Request type post
        //     // url: "/piflow-web/flow/saveFlowInfo",//This is the name of the file where I receive data in the background.
        //     //
        //     // async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        //     // error: function (request) {//Operation after request failure
        //     //     layer.closeAll('page');
        //     //     layer.msg('creation failed ', {icon: 2, shade: 0, time: 2000}, function () {
        //     //     });
        //     //     return;
        //     // },
        //     success: function (data) {//Operation after request successful
        //         layer.closeAll('page');
        //         var dataMap = JSON.parse(data);
        //         if (200 === dataMap.code) {
        //             layer.msg('create success ', {icon: 1, shade: 0, time: 2000}, function () {
        //                 var tempWindow = window.open('_blank');
        //                 if (tempWindow == null || typeof(tempWindow)=='undefined'){
        //                     alert('The window cannot be opened. Please check your browser settings.')
        //                 } else {
        //                     tempWindow.location = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=TASK&load=" + dataMap.flowId;
        //                 }
        //             });
        //         } else {
        //             layer.msg('creation failed', {icon: 2, shade: 0, time: 2000}, function () {
        //             });
        //         }
        //     }
        // });
        // }
    }
};

function checkFlowInput(flowName, description, driverMemory, executorNumber, executorMemory, executorCores) {
    if (flowName == '') {
        layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('flowName').focus();
        return false;
    }

    /*  if (description == '') {
         layer.msg('description不能为空！', {icon: 2, shade: 0, time: 2000});
         document.getElementById('description').focus();
         return false;
     } */
    if (driverMemory == '') {
        layer.msg('driverMemory Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('driverMemory').focus();
        return false;
    }
    if (executorNumber == '') {
        layer.msg('executorNumber Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('executorNumber').focus();
        return false;
    }
    if (executorMemory == '') {
        layer.msg('executorMemory Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('executorMemory').focus();
        return false;
    }
    if (executorCores == '') {
        layer.msg('executorCores Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('executorCores').focus();
        return false;
    }
    return true;
}

//open xml file
function openXml() {
    $.ajax({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/flow/loadData",
        //data:$('#loginForm').serialize(),//Serialize the form
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//After the request is successful
            loadXml(data);
            console.log("success");
        }
    });
}

//load xml file
function loadXml(loadStr) {
    var xml = mxUtils.parseXml(loadStr);
    var node = xml.documentElement;
    var dec = new mxCodec(node.ownerDocument);
    dec.decode(node, graphGlobal.getModel());
    eraseRecord()
}

//Request interface to reload'stops'
function reloadStops() {
    fullScreen.show();
    $.ajax({
        data: {"load": loadId},
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/stops/reloadStops",
        error: function (request) {//Operation after request failure
            fullScreen.hide();
            //alert("reload fail");
            layer.msg("reload fail", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                window.location.href = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=TASK&load=" + dataMap.load + "&_" + new Date().getTime();
            } else {
                //alert("reload fail");
                layer.msg("reload fail", {icon: 2, shade: 0, time: 2000});
                fullScreen.hide();
            }
        }
    });
}

function queryFlowInfo() {
    $.ajax({
        data: {"load": loadId},
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/flow/queryFlowData",
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//After the request is successful
            var dataMap = JSON.parse(data);
            if (document.getElementById("drawingBoardDescription_td_1_2_label_id")) {
                var flow = dataMap.flow;
                if (flow != null && flow != "")
                    var flowInfoDbInfo = flow.flowInfoDbVo;
                if (flow != null && flow != "") {
                    document.getElementById('drawingBoardDescription_td_1_2_label_id').innerText = flow.uuid ? flow.uuid : "No content";
                    document.getElementById('drawingBoardDescription_td_2_2_label_id').innerText = flow.name ? flow.name : "No content";
                    document.getElementById('drawingBoardDescription_td_3_2_label_id').innerText = flow.description ? flow.description : "No content";
                    document.getElementById('drawingBoardDescription_td_4_2_label_id').innerText = flow.crtDttmString ? flow.crtDttmString : "No content";
                    document.getElementById('drawingBoardDescription_td_5_2_label_id').innerText = flow.stopsVoList ? flow.stopsVoList.length : "0";
                } else {
                    document.getElementById('drawingBoardDescription_td_1_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_2_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_3_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_4_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_5_2_label_id').innerText = "0";
                }
                getRunningProcessList();
            }
        }
    });
}

function queryFlowGroup() {
    $.ajax({
        data: {"load": loadId},
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/flowGroup/queryFlowGroupData",
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//After the request is successful
            var dataMap = JSON.parse(data);
            if (document.getElementById("drawingBoardDescription_td_1_2_label_id")) {
                var flowGroupVo = dataMap.flowGroupVo;
                if (flowGroupVo != null && flowGroupVo != "") {
                    document.getElementById('drawingBoardDescription_td_1_2_label_id').innerText = flowGroupVo.id ? flowGroupVo.id : "No content";
                    document.getElementById('drawingBoardDescription_td_2_2_label_id').innerText = flowGroupVo.name ? flowGroupVo.name : "No content";
                    document.getElementById('drawingBoardDescription_td_3_2_label_id').innerText = flowGroupVo.description ? flowGroupVo.description : "No content";
                    document.getElementById('drawingBoardDescription_td_4_2_label_id').innerText = flowGroupVo.crtDttmString ? flowGroupVo.crtDttmString : "No content";
                    document.getElementById('drawingBoardDescription_td_5_2_label_id').innerText = flowGroupVo.flowVoList ? flowGroupVo.flowVoList.length : "0";
                } else {
                    document.getElementById('drawingBoardDescription_td_1_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_2_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_3_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_4_2_label_id').innerText = "No content";
                    document.getElementById('drawingBoardDescription_td_5_2_label_id').innerText = "0";
                }
                getRunningProcessList();
            }
        }
    });
}

//run
function runFlow(runMode) {
    fullScreen.show();
    // console.info("ss");
    var data = {flowId: loadId}
    if (runMode) {
        data.runMode = runMode;
    }
    $.ajax({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/flow/runFlow",
        //data:$('#loginForm').serialize(),//Serialize the form
        data: data,
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            //alert("Request Failed");
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000}, function () {
                fullScreen.hide();
            });

            return;
        },
        success: function (data) {//After the request is successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    //Jump to the monitor page after starting successfully
                    var tempWindow = window.open('');
                    if (tempWindow == null || typeof (tempWindow) == 'undefined') {
                        alert('The window cannot be opened. Please check your browser settings.')
                    } else {
                        tempWindow.location = "/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&processType=PROCESS&load=" + dataMap.processId;
                    }
                });
            } else {
                //alert("Startup failure：" + dataMap.errorMsg);
                layer.msg("Startup failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
            fullScreen.hide();
        }
    });
}

//run
function runFlowGroup(runMode) {
    fullScreen.show();
    var data = {flowGroupId: loadId}
    if (runMode) {
        data.runMode = runMode;
    }
    $.ajax({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/flowGroup/runFlowGroup",
        //data:$('#loginForm').serialize(),//Serialize the form
        data: data,
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            //alert("Request Failed");
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000}, function () {
                fullScreen.hide();
            });

            return;
        },
        success: function (data) {//After the request is successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    //Jump to the monitoring page after starting successfully
                    var windowOpen = window.open("/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&processType=PROCESS_GROUP&load=" + dataMap.processGroupId, '_blank');
                    //var tempwindow = window.open('_blank');
                    if (windowOpen == null || typeof (windowOpen) == 'undefined') {
                        alert('The window cannot be opened. Please check your browser settings.')
                    }
                });
            } else {
                //alert("Startup failure：" + dataMap.errorMsg);
                layer.msg("Startup failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
            fullScreen.hide();
        }
    });
}

//get port
function getStopsPortNew(paths) {
    if (paths && paths.length > 0) {
        pathsCells = paths;
        if (pathsCells.length > 1) {
            graphGlobal.removeCells(pathsCells);
        } else {
            var sourceMxCellId = '';
            var targetMxCellId = '';
            var pathLine = pathsCells[0];
            var pathLineId = pathLine.id;
            var sourceMxCell = pathLine.source;
            var targetMxCell = pathLine.target;
            if (targetMxCell) {
                sourceMxCellId = sourceMxCell.id;
            }
            if (targetMxCell) {
                targetMxCellId = targetMxCell.id;
            }
            $.ajax({
                cache: true,
                type: "get",
                url: "/piflow-web/stops/getStopsPort",
                data: {
                    "flowId": loadId,
                    "sourceId": sourceMxCellId,
                    "targetId": targetMxCellId,
                    "pathLineId": pathLineId
                },
                async: true,
                traditional: true,
                error: function (request) {
                    console.log("error");
                    return;
                },
                success: function (data) {
                    var dataMap = JSON.parse(data);
                    if (200 === dataMap.code) {
                        var showHtml = $('#portShowDiv').clone();
                        showHtml.find('#protInfo1Copy').attr('id', 'protInfoR_R');
                        showHtml.find('#sourceTitle1Copy').attr('id', 'sourceTitleR_R');
                        showHtml.find('#sourceTitleStr1Copy').attr('id', 'sourceTitleStrR_R');
                        showHtml.find('#sourceTitleCheckbox1Copy').attr('id', 'sourceTitleCheckboxR_R');
                        showHtml.find('#sourceTitleBtn1Copy').attr('id', 'sourceTitleBtnR_R');
                        showHtml.find('#sourceCrtPortId1Copy').attr('id', 'sourceCrtPortIdR_R');
                        showHtml.find('#sourceCrtPortBtnId1Copy').attr('id', 'sourceCrtPortBtnIdR_R');
                        showHtml.find('#sourceTypeDiv1Copy').attr('id', 'sourceTypeDivR_R');
                        showHtml.find('#sourceRouteFilterList1Copy').attr('id', 'sourceRouteFilterListR_R');
                        showHtml.find('#sourceRouteFilterSelect1Copy').attr('id', 'sourceRouteFilterSelectR_R');
                        showHtml.find('#targetTitle1Copy').attr('id', 'targetTitleR_R');
                        showHtml.find('#targetTitleStr1Copy').attr('id', 'targetTitleStrR_R');
                        showHtml.find('#targetTitleCheckbox1Copy').attr('id', 'targetTitleCheckboxR_R');
                        showHtml.find('#targetTitleBtn1Copy').attr('id', 'targetTitleBtnR_R');
                        showHtml.find('#targetCrtPortId1Copy').attr('id', 'targetCrtPortIdR_R');
                        showHtml.find('#targetCrtPortBtnId1Copy').attr('id', 'targetCrtPortBtnIdR_R');
                        showHtml.find('#targetTypeDiv1Copy').attr('id', 'targetTypeDivR_R');
                        showHtml.find('#targetRouteFilterList1Copy').attr('id', 'targetRouteFilterListR_R');
                        showHtml.find('#targetRouteFilterSelect1Copy').attr('id', 'targetRouteFilterSelectR_R');

                        showHtml.find('#sourceCrtPortBtnIdR_R').attr('onclick', 'crtAnyPort("sourceCrtPortIdR_R",true)');
                        showHtml.find('#targetCrtPortBtnIdR_R').attr('onclick', 'crtAnyPort("targetCrtPortIdR_R",false)');
                        showHtml.find('#targetTitleBtnR_R').hide();
                        showHtml.find('#targetRouteFilterListR_R').hide();
                        showHtml.find('#sourceTitleBtnR_R').hide();
                        showHtml.find('#sourceRouteFilterListR_R').hide();
                        var sourceType = dataMap.sourceType;
                        var targetType = dataMap.targetType;
                        var sourceTypeStr = sourceType.text;
                        var targetTypeStr = targetType.text;
                        //Determine the number of available ports. If the number of available ports is not greater than 0, delete the line directly
                        if (dataMap.sourceCounts > 0 && dataMap.targetCounts > 0) {
                            // Get a detailed use of the source port
                            var sourcePortUsageMap = dataMap.sourcePortUsageMap;
                            if (sourcePortUsageMap) {
                                showHtml.find('#sourceTitleCheckboxR_R').html("");
                                for (portName in sourcePortUsageMap) {
                                    var portNameVal = sourcePortUsageMap[portName];
                                    var portCheckDiv = '<div id="' + portName + 'Checkbox" class="addCheckbox">'
                                        + '<input id="' + portName + '" name="' + portName + '" type="checkbox" class="addCheckbox" value="' + portName + '"' + (!portNameVal ? 'checked="checked" disabled="disabled"' : '') + '/>'
                                        + '<span class="addCheckbox ' + portName + '" disabled="' + !portNameVal + '">' + portName + '</span>'
                                        + '</div>';
                                    showHtml.find('#sourceTitleCheckboxR_R').append(portCheckDiv);
                                }
                                // Add a create button when the type is Any
                                if ('Any' === sourceTypeStr) {
                                    showHtml.find('#sourceTitleBtnR_R').show();
                                } else if ('Route' === sourceTypeStr) {
                                    showHtml.find('#sourceRouteFilterListR_R').show();
                                    if (dataMap.sourceFilter) {
                                        var sourceFilters = dataMap.sourceFilter;
                                        var selectOptionHtml = '<option value="">Please click Select Filter Country</option>';
                                        for (var i = 0; i < sourceFilters.length; i++) {
                                            var sourceFilter = sourceFilters[i];
                                            selectOptionHtml += '<option value="' + sourceFilter.name + '" title="' + sourceFilter.customValue + '">' + sourceFilter.name + '</option>';
                                        }
                                        showHtml.find('#sourceRouteFilterSelectR_R').html(selectOptionHtml);
                                    } else {
                                        showHtml.find('#sourceRouteFilterSelectR_R').parent().html("Route no filter rule");
                                    }
                                }
                            }
                            showHtml.find('#sourceTypeDivR_R').html(sourceTypeStr);
                            showHtml.find('#sourceTitleStrR_R').html('Source:' + dataMap.sourceName);
                            // Gets the detailed use of the target port
                            var targetPortUsageMap = dataMap.targetPortUsageMap;
                            if (targetPortUsageMap) {
                                showHtml.find('#targetTitleCheckboxR_R').html("");
                                for (portName in targetPortUsageMap) {
                                    var portNameVal = targetPortUsageMap[portName];
                                    var portCheckDiv = '<div id="' + portName + 'Checkbox" class="addCheckbox">'
                                        + '<input id="' + portName + '" name="' + portName + '" type="checkbox" class="addCheckbox" value="' + portName + '"' + (!portNameVal ? 'checked="checked" disabled="disabled"' : '') + '/>'
                                        + '<span class="addCheckbox ' + portName + '" disabled="' + !portNameVal + '">' + portName + '</span>'
                                        + '</div>';
                                    showHtml.find('#targetTitleCheckboxR_R').append(portCheckDiv);
                                }
                                // Add a create button when the type is Any
                                if ('Any' === targetTypeStr) {
                                    showHtml.find('#targetTitleBtnR_R').show();
                                } else if ('Route' === targetTypeStr) {
                                    showHtml.find('#targetRouteFilterListR_R').show();
                                    if (dataMap.targetFilter) {
                                        var targetFilters = dataMap.targetFilter;
                                        var selectOptionHtml = '<option value="">Please click Select Filter Country</option>';
                                        for (var i = 0; i < targetFilters.length; i++) {
                                            var targetFilter = targetFilters[i];
                                            selectOptionHtml += '<option value="' + targetFilter.name + '" title="' + targetFilter.customValue + '">' + targetFilter.name + '</option>';
                                        }
                                        showHtml.find('#targetRouteFilterSelectR_R').html(selectOptionHtml);
                                    } else {
                                        showHtml.find('#targetRouteFilterSelectR_R').parent().html("Route no filter rule");
                                    }
                                }
                            }
                            showHtml.find('#targetTypeDivR_R').html(targetTypeStr);
                            showHtml.find('#targetTitleStrR_R').html('Target:' + dataMap.targetName);
                            if ("Default" === sourceTypeStr && "Default" === targetTypeStr) {
                            } else if ("None" === sourceTypeStr || "None" === targetTypeStr) {
                            } else {
                                layuiOpenWindowDivFunc('SET PATN PROT WINDOWS', showHtml.html());
                            }
                        } else {
                            graphGlobal.removeCells(pathsCells);
                        }
                    } else {
                        graphGlobal.removeCells(pathsCells);
                    }
                }
            });

        }
    }
}

// check choose port data
function checkChoosePort() {
    var sourcePortVal = '';
    var targetPortVal = '';
    var sourceTypeDivR_R = $('#sourceTypeDivR_R');
    var targetTypeDivR_R = $("#targetTypeDivR_R");
    if (!sourceTypeDivR_R && !targetTypeDivR_R) {
        layer.msg("Page error, please check!", {icon: 2, shade: 0, time: 2000});
        return false;
    }
    var isSourceRoute = false;
    var isTargetRoute = false;
    var sourceTitleCheckboxR_R = $('#sourceTitleCheckboxR_R');
    var targetTitleCheckboxR_R = $("#targetTitleCheckboxR_R");
    if (sourceTitleCheckboxR_R) {
        var sourceDivType = sourceTypeDivR_R.html();
        if ('Default' === sourceDivType) {
            //'default' type is not verified
        } else if ("Route" === sourceDivType) {
            isSourceRoute = true;
            //'Route' type is not verified
        } else {
            var sourceEffCheckbox = [];
            sourceTitleCheckboxR_R.find("input[type='checkbox']:checked").each(function () {
                if ($(this).prop("disabled") == false) {
                    sourceEffCheckbox[sourceEffCheckbox.length] = $(this);
                }
            });
            if (sourceEffCheckbox.length > 1) {
                layer.msg("'sourcePort'can only choose one", {icon: 2, shade: 0, time: 2000});
                return false;
            }
            if (sourceEffCheckbox < 1) {
                layer.msg("Please select'sourcePort'", {icon: 2, shade: 0, time: 2000});
                return false;
            }
            for (var i = 0; i < sourceEffCheckbox.length; i++) {
                var sourcecheckBoxEff = sourceEffCheckbox[i];
                if ('' === sourcePortVal) {
                    sourcePortVal = sourcecheckBoxEff.val();
                } else {
                    sourcePortVal = sourcePortVal + "," + sourcecheckBoxEff.val();
                }
            }
        }
    } else {
        layer.msg("Page error, please check!", {icon: 2, shade: 0, time: 2000});
        return false;
    }
    if (targetTitleCheckboxR_R) {
        var targetDivType = targetTypeDivR_R.html();
        if ('Default' === targetDivType) {
            //Default type not checked
        } else if ("Route" === targetDivType) {
            isTargetRoute = true;
            //Route type not checked
        } else {
            var targetEffCheckbox = [];
            targetTitleCheckboxR_R.find("input[type='checkbox']:checked").each(function () {
                if ($(this).prop("disabled") == false) {
                    targetEffCheckbox[targetEffCheckbox.length] = $(this);
                }
            });
            if (targetEffCheckbox.length > 1) {
                layer.msg("'targetPort'can only choose one", {icon: 2, shade: 0, time: 2000});
                return false;
            }
            if (targetEffCheckbox.length < 1) {
                layer.msg("Please select'targetPort'", {icon: 2, shade: 0, time: 2000});
                return false;
            }
            for (var i = 0; i < targetEffCheckbox.length; i++) {
                var targetcheckBoxEff = targetEffCheckbox[i];
                if ('' === targetPortVal) {
                    targetPortVal = targetcheckBoxEff.val();
                } else {
                    targetPortVal = targetPortVal + "," + targetcheckBoxEff.val();
                }
            }
        }
    } else {
        layer.msg("Page error, please check!", {icon: 2, shade: 0, time: 2000});
        return false;
    }

    var sourceMxCellId = '';
    var targetMxCellId = '';
    var pathLine = pathsCells[0];
    var pathLineId = pathLine.id;
    var sourceMxCell = pathLine.source;
    var targetMxCell = pathLine.target;
    if (targetMxCell) {
        sourceMxCellId = sourceMxCell.id;
    }
    if (targetMxCell) {
        targetMxCellId = targetMxCell.id;
    }
    var sourceRouteFilterSelectValue = $('#sourceRouteFilterSelectR_R').val();
    var targetRouteFilterSelectValue = $('#targetRouteFilterSelectR_R').val();
    var reqData = {
        "flowId": loadId,
        "pathLineId": pathLineId,
        "sourcePortVal": sourcePortVal,
        "targetPortVal": targetPortVal,
        "sourceId": sourceMxCellId,
        "targetId": targetMxCellId,
        "sourceFilter": sourceRouteFilterSelectValue,
        "targetFilter": targetRouteFilterSelectValue,
        "sourceRoute": isSourceRoute,
        "targetRoute": isTargetRoute
    }
    return reqData;
}

function choosePortNew() {
    if (pathsCells.length > 1) {
        graphGlobal.removeCells(pathsCells);
        layer.msg("Page error, please check!", {icon: 2, shade: 0, time: 2000}, function () {
            layer.closeAll();
            layer.closeAll();
        });
        return false;
    } else {
        var reqData = checkChoosePort();
        if (reqData) {
            $.ajax({
                cache: true,
                type: "get",
                url: "/piflow-web/path/savePathsPort",
                data: reqData,
                async: true,
                traditional: true,
                error: function (request) {
                    console.log("error");
                    return;
                },
                success: function (data) {
                    var dataMap = JSON.parse(data);
                    //alert(dataMap);
                    if (200 === dataMap.code) {
                        layer.closeAll();
                    } else {
                        //alert("Port Selection Save Failed");
                        layer.msg("Port Selection Save Failed", {icon: 2, shade: 0, time: 2000}, function () {
                            layer.closeAll();
                        });
                        graphGlobal.removeCells(pathsCells);
                    }
                }
            });
        }
    }
}

function cancelPortAndPathNew() {
    layer.closeAll();
    graphGlobal.removeCells(pathsCells);
}

function crtAnyPort(crtProtInputId, isSource) {
    var crtProtInput = $('#' + crtProtInputId);
    var portNameVal = crtProtInput.val();
    if (portNameVal && '' !== portNameVal) {
        if (!document.getElementById(portNameVal)) {
            var obj = '<div style="display: block;" class="addCheckbox" id="jCheckbox">'
                + '<input type="checkbox" class="addCheckbox" id="' + portNameVal + '" name="' + portNameVal + '" value="' + portNameVal + '">'
                + '<span class="' + portNameVal + '">' + portNameVal + '</span>'
                + '</div>';
            if (isSource) {
                $('#sourceTitleCheckboxR_R').append(obj);
            } else {
                $('#targetTitleCheckboxR_R').append(obj);
            }
            $('.' + portNameVal).text(portNameVal);
        } else {
            layer.msg("Port name occupied!!", {icon: 2, shade: 0, time: 2000});
        }
    } else {
        //alert("The port name cannot be empty");
        layer.msg("Port name cannot be empty", {icon: 2, shade: 0, time: 2000});
    }
}

function saveCheckpoints(stopId) {
    //alert("ssss");
    var isCheckpoint = 0;
    if ($('#isCheckpoint').is(':checked')) {
        isCheckpoint = 1;
    }
    $.ajax({
        cache: true,
        type: "POST",
        url: "/piflow-web/stops/updateStopsById",
        data: {
            stopId: stopId,
            isCheckpoint: isCheckpoint
        },
        async: true,
        traditional: true,
        error: function (request) {
            layer.msg("Failure to mark'Checkpoint'", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            //alert(dataMap);
            //console.log("attribute update success");
            if (200 === dataMap.code) {
                layer.msg("Successful modification of the tag'Checkpoint'", {
                    icon: 1,
                    shade: 0,
                    time: 2000
                }, function () {
                });
            } else {
                layer.msg("Failed to modify the tag'Checkpoint'", {icon: 2, shade: 0, time: 2000});
            }

        }
    });
}

function saveTemplateFun(url) {
    var templateType = drawingBoardType;
    var getXml = thisEditor.getGraphXml();
    var xml_outer_html = getXml.outerHTML;
    layer.prompt({
        title: 'please enter the template name',
        formType: 0,
        btn: ['submit', 'cancel']
    }, function (text, index) {
        layer.close(index);
        $.ajax({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/piflow-web/flowTemplate/saveFlowTemplate",
            data: {
                value: xml_outer_html,
                load: loadId,
                name: text,
                templateType: templateType
            },
            async: true,
            error: function (request) {//Operation after request failure
                console.log(" save template error");
                return;
            },
            success: function (data) {//After the request is successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    });
                } else {
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    });
}

function uploadTemplate() {
    document.getElementById("uploadFile").click();
}

function uploadFlowGroupTemplateBtn() {
    document.getElementById("flowTemplateFile").click();
}

function uploadTemplateFile(element) {
    if (!FileTypeCheck(element)) {
        return false;
    }
    if (url) {
        return false;
    }
    var formData = new FormData($('#uploadForm')[0]);
    $.ajax({
        type: 'post',
        url: '/piflow-web/flowTemplate/uploadXmlFile',
        data: formData,
        cache: false,
        processData: false,
        contentType: false,
    }).success(function (data) {
        var dataMap = JSON.parse(data);
        if (200 === dataMap.code) {
            layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000});
        } else {
            layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
        }
    }).error(function () {
        layer.msg("Upload failure", {icon: 2, shade: 0, time: 2000});
    });
}

function FileTypeCheck(element) {
    if (element.value == null || element.value == '') {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    var length = element.value.length;
    var charindex = element.value.lastIndexOf(".");
    var ExtentName = element.value.substring(charindex, charindex + 4);
    if (!(ExtentName == ".xml")) {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    return true;
}

function loadingXml(id, loadId) {
    var loadType = Format.customizeType;
    fullScreen.show();
    $.ajax({
        type: 'post',
        data: {
            templateId: id,
            loadType: loadType,
            load: loadId
        },
        async: true,
        url: "/piflow-web/flowTemplate/loadingXmlPage",
    }).success(function (data) {
        var dataMap = JSON.parse(data);
        var icon_code = 2;
        if (200 === dataMap.code) {
            icon_code = 1;
        }
        fullScreen.hide();
        layer.msg(dataMap.errorMsg, {icon: icon_code, shade: 0.7, time: 2000}, function () {
            window.location.reload();
        });
    }).error(function () {
        fullScreen.hide();
    });
}

function openTemplateList() {
    if (isExample) {
        layer.msg('This is an example, you can\'t edit', {icon: 2, shade: 0, time: 2000});
        return;
    }
    var url = "";
    var functionNameStr = "";
    if ('TASK' !== Format.customizeType && 'GROUP' !== Format.customizeType) {
        return;
    }
    $.ajax({
        url: "/piflow-web/flowTemplate/flowTemplateList",
        type: "post",
        async: false,
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var temPlateList = dataMap.temPlateList;
                var showSelectDivHtml = '<div style="width: 100%;height: 146px;position: relative;">';
                var showOptionHtml = '';
                for (var i = 0; i < temPlateList.length; i++) {
                    showOptionHtml += ("<option value=" + temPlateList[i].id + " >" + temPlateList[i].name + "</option>");
                }
                var showSelectHtml = 'There is no template, please create';
                var loadTemplateBtn = '';
                if (showOptionHtml) {
                    showSelectHtml = ('<div style="width: 100%;text-align: center;">'
                        + '<select name="loadingXmlSelect" id="loadingXmlSelectNew" style="width: 80%;margin-top: 15px;">'
                        + '<option value=\'-1\' >------------please choose------------</option>'
                        + showOptionHtml
                        + '</select>'
                        + '</div>');
                    loadTemplateBtn = '<div style="position: absolute;bottom: 12px;right: 10px;">'
                        + '<input type="button" class="btn" value="Submit" onclick="loadTemplateFun()"/>'
                        + '</div>';
                }
                showSelectDivHtml += (showSelectHtml + loadTemplateBtn + '</div>');
                layer.open({
                    type: 1,
                    title: '<span style="color: #269252;">Please choose</span>',
                    shadeClose: false,
                    resize: false,
                    closeBtn: 1,
                    shift: 7,
                    area: ['500px', '200px'], //Width height
                    skin: 'layui-layer-rim', //Add borders
                    content: showSelectDivHtml
                });
            } else {
                layer.msg("No template, please create", {time: 2000});
            }
        }
    });
}

function loadTemplateFun() {
    var id = $("#loadingXmlSelectNew").val();
    if (id == '-1') {
        layer.msg('Please choose template', {icon: 2, shade: 0, time: 2000});
        return;
    }

    var name = $("#loadingXmlSelect option:selected").text();
    layer.open({
        title: 'LoadTemplate',
        content: 'Are you sure you want to load ' + name + '？',
        btn: ['submit', 'cancel'],
        yes: function (index, layero) {
            loadingXml(id, loadId);
            var oDiv = document.getElementById("divloadingXml");
            oDiv.style.display = "none";
        },
        btn2: function (index, layero) {
            var oDiv = document.getElementById("divloadingXml");
            oDiv.style.display = "none";
        }, cancel: function () {
            var oDiv = document.getElementById("divloadingXml");
            oDiv.style.display = "none";
        }
    });
}

function getRunningProcessList() {
    $.ajax({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/piflow-web/process/getRunningProcessList",
        data: {"flowId": loadId},
        async: true,
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//
            $('#runningProcessID').remove();
            $('#rightSidebarID').append(data);
        }
    });
}

//Erase drawing board records
function eraseRecord() {
    thisEditor.lastSnapshot = new Date().getTime();
    thisEditor.undoManager.clear();
    thisEditor.ignoredChanges = 0;
    thisEditor.setModified(false);
}

function openAddStopCustomAttrPage(stopId) {
    var addStopCustomizedAttrOpenTemplate = $("#addStopCustomizedAttrOpenTemplate").clone();
    addStopCustomizedAttrOpenTemplate.find("form").attr("id", "openAddStopCustomAttrId");
    addStopCustomizedAttrOpenTemplate.find("#openAddCustomizedWindowStopId").hide();
    addStopCustomizedAttrOpenTemplate.find("#openAddCustomizedWindowStopId").attr("value", stopId);
    layer.open({
        type: 1,
        title: "Add Customized Property",
        shadeClose: true,
        closeBtn: 1,
        shift: 7,
        anim: 5,//Bounce up and down
        shade: 0.1,
        // resize: false,//No stretch
        // move: false,//No drag and drop
        // offset: ['' + p.top + 'px', '' + p.left + 'px'],//coordinate
        area: ['555px', '340px'], //Width height
        content: addStopCustomizedAttrOpenTemplate.html()
    });
}


function addStopCustomProperty(reqData) {
    $.ajax({
        type: "POST",//Request type post
        url: "/piflow-web/stops/addStopCustomizedProperty",//This is the name of the file where I receive data in the background.
        data: reqData,
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg("add success", {icon: 1, shade: 0, time: 1000}, function () {
                    layer.closeAll();
                    queryStopsProperty(dataMap.stopPageId);
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });

}

function removeStopCustomProperty(stopPageId, customPropertyId, isRouter) {
    if (isRouter) {
        getRouterAllPaths(customPropertyId)
    } else {
        var reqUrl = "/piflow-web/stops/deleteStopsCustomizedProperty";
        var reqData = {customPropertyId: customPropertyId};
        $.ajax({
            type: "POST",//Request type post
            url: reqUrl,//This is the name of the file where I receive data in the background.
            data: reqData,
            error: function (request) {//Operation after request failure
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                //console.log(dataMap);
                if (200 === dataMap.code) {
                    layer.msg("add success", {icon: 1, shade: 0, time: 1000}, function () {
                        layer.closeAll();
                        queryStopsProperty(stopPageId);
                    });
                } else {
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    }
}

function getRouterAllPaths(customPropertyId) {
    var reqUrl = "/piflow-web/stops/getRouterStopsCustomizedProperty";
    var reqData = {customPropertyId: customPropertyId};
    $.ajax({
        type: "POST",//Request type post
        url: reqUrl,//This is the name of the file where I receive data in the background.
        data: reqData,
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            //console.log(dataMap);
            if (200 === dataMap.code) {
                if (dataMap.pathsVoList) {
                    var showPathsHtml = '<span>Deleting this rule will affect the following:</span>';
                    layer.confirm(showPathsHtml, {icon: 1, shade: 0, time: 1000}, function () {
                    });
                } else {
                    //removeRouterStopCustomProperty(customPropertyId);
                    console.log("failed");
                }
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

function removeRouterStopCustomProperty(customPropertyId) {
    var reqUrl = "/piflow-web/stops/deleteRouterStopsCustomizedProperty";
    var reqData = {customPropertyId: customPropertyId};
    $.ajax({
        type: "POST",//Request type post
        url: reqUrl,//This is the name of the file where I receive data in the background.
        data: reqData,
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            //console.log(dataMap);
            if (200 === dataMap.code) {
                layer.msg("add success", {icon: 1, shade: 0, time: 1000}, function () {
                    layer.closeAll();
                    queryStopsProperty(stopPageId);
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

function layuiOpenWindowDivFunc(title, contentHtml) {
    layer.open({
        type: 1,
        title: '<span style="color: #269252;">' + title + '</span>',
        shadeClose: false,
        closeBtn: 0,
        shift: 7,
        area: ['580px', '520px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: contentHtml
    });
}

function closeChoosePortWindow() {
    layer.closeAll();
    graphGlobal.removeCells(pathsCells);
}

function openDatasourceList() {
    var window_width = $(window).width();//Get browser window width
    var window_height = $(window).height();//Get browser window height
    $.ajax({
        type: "POST",//Request type post
        url: "/piflow-web/page/datasource/getDatasourceListPage",
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            layer.open({
                type: 1,
                title: '<span style="color: #269252;">DatasourceList</span>',
                shadeClose: false,
                closeBtn: 1,
                shift: 7,
                area: [(window_width - 100) + 'px', (window_height - 100) + 'px'], //Width height
                skin: 'layui-layer-rim', //Add borders
                content: data
            });
        }
    });
}

function getFlowList() {
    var window_width = $(window).width();//Get browser window width
    var window_height = $(window).height();//Get browser window height
    $.ajax({
        type: "POST",//Request type post
        url: "/piflow-web/page/flow/getFlowListHtml",//This is the name of the file where I receive data in the background.
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            layer.open({
                type: 1,
                title: '<span style="color: #269252;">Flows</span>',
                shade: 0,
                shadeClose: false,
                closeBtn: 1,
                shift: 7,
                area: [(window_width / 2) + 'px', (window_height - 100) + 'px'], //Width height
                skin: 'layui-layer-rim', //Add borders
                content: data
            });
        }
    });
}

function changIconTranslate() {
    var iconPositionElementArr = document.querySelectorAll("div[style='display: inline-block; font-size: 1px; font-family: PiFlow; color: #FFFFFF; line-height: 1.2; pointer-events: all; white-space: nowrap; ']");
    if (iconPositionElementArr && iconPositionElementArr.length > 0) {
        var iconPositionArr = {};
        iconPositionElementArr.forEach(item => {
            var x_y_div = item.parentElement.parentElement.style;
            var x_Position = x_y_div['margin-left'].replace("px", "");
            var y_Position = x_y_div['padding-top'].replace("px", "");
            iconPositionArr['stopLoadingShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopFailShow' + item.textContent] = {x: x_Position, y: y_Position};
            iconPositionArr['stopOkShow' + item.textContent] = {x: x_Position, y: y_Position};
        });
        var imgsArr = document.querySelectorAll("image[PiFlow_IMG='IMG']");
        imgsArr.forEach(item => {
            var iconPosition = iconPositionArr[item.id]
            if (iconPosition) {
                item.setAttribute("transform", "translate(" + iconPosition.x + "," + iconPosition.y + ")");
            }
        });
    }
}

window.onresize = function (e) {
    setTimeout(() => {
        changIconTranslate()
    }, 300);
}

function ClickSlider() {
    $(".triggerSlider").click(function () {
        var flag = ($(".triggerSlider i:first").hasClass("fa fa-angle-right fa-2x"));
        if (flag === false)
            $(".triggerSlider i").removeClass("fa fa-angle-left fa-2x ").toggleClass("fa fa-angle-right fa-2x");
        else
            $(".triggerSlider i").removeClass("fa fa-angle-right fa-2x").toggleClass("fa fa-angle-left fa-2x");

        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        $(this).toggleClass("triggerSlider-open");
        index = !index
    });
}

function deleteLastReloadData(stopId) {
    $.ajax({
        type: "POST",//Request type post
        url: "/piflow-web/stops/deleteLastReloadData",//This is the name of the file where I receive data in the background.
        data: {stopId: stopId},
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 == dataMap.code) {
                layer.msg(dataMap.errorMsg, {
                    icon: 1,
                    shade: 0,
                    time: 2000
                }, function () {
                    $("#del_last_reload_div").hide();
                    $("#del_last_reload_table").hide();
                });
            } else {
                layer.msg(dataMap.errorMsg, {
                    icon: 2,
                    shade: 0,
                    time: 2000
                }, function () {

                });
            }
        }
    });
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/flowGroup/ThirdFlowStopInfoResponse.java<|end_filename|>
package cn.cnic.third.vo.flowGroup;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter
public class ThirdFlowStopInfoResponse implements Serializable {
    
    private static final long serialVersionUID = 1L;

    private String name;
    private String state;
    private String startTime;
    private String endTime;
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/stop/ThirdAllowableValuesVo.java<|end_filename|>
package cn.cnic.third.vo.stop;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ThirdAllowableValuesVo implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    private String name;
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/service/ISchedule.java<|end_filename|>
package cn.cnic.third.service;

import cn.cnic.component.process.entity.Process;
import cn.cnic.component.process.entity.ProcessGroup;
import cn.cnic.component.schedule.entity.Schedule;
import cn.cnic.third.vo.schedule.ThirdScheduleVo;

import java.util.Map;

public interface ISchedule {

    public Map<String, Object> scheduleStart(Schedule schedule, Process process, ProcessGroup processGroup);

    public String scheduleStop(String scheduleId);

    public ThirdScheduleVo scheduleInfo(String scheduleId);
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/vo/PathsVo.java<|end_filename|>
package cn.cnic.component.flow.vo;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.component.flow.entity.Stops;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

@Getter
@Setter
public class PathsVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    private FlowVo flowVo;

    private String from;

    private String outport;

    private String inport;

    private String to;

    private String port;

    private String pageId;

    private String flowFrom;

    private String flowTo;

    private Stops stopFrom;

    private Stops StopTo;

    private Date crtDttm;

    private String filterCondition;

    public String getCrtDttmString() {
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN_yyyy_MM_dd_HH_MM_ss);
        return crtDttm != null ? sdf.format(crtDttm) : "";
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/utils/TestDataUtils.java<|end_filename|>
package cn.cnic.component.testData.utils;

import java.util.Date;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.testData.entity.TestData;

public class TestDataUtils {

    public static TestData setTestDataBasicInformation(TestData testData, boolean isSetId, String username) {
        if (null == testData) {
            testData = new TestData();
        }
        if (isSetId) {
            testData.setId(UUIDUtils.getUUID32());
        }
        // set MxGraphModel basic information
        testData.setCrtDttm(new Date());
        testData.setCrtUser(username);
        testData.setLastUpdateDttm(new Date());
        testData.setLastUpdateUser(username);
        testData.setVersion(0L);
        return testData;
    }
}


<|start_filename|>piflow-web/src/main/resources/static/my_js/admin/sysScheduleList.js<|end_filename|>
function initDatatableSysSchedulePage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({

            elem: '#' + testTableId
            , url: (web_drawingBoard + url)
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , cols: [[
                {field: 'jobName', title: 'Name', sort: true},
                {field: 'jobClass', title: 'Class', sort: true},
                {field: 'cronExpression', title: 'Cron', sort: true},
                {
                    field: 'dataSourceType', title: 'Status', sort: true, templet: function (data) {
                        return data.status.text
                    }
                },
                {field: 'crtDttmString', title: 'CreateTime', sort: true},
                {
                    field: 'right', title: 'Actions', sort: true, height: 100, templet: function (data) {
                        return responseHandlerSysSchedule(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });

    function searchMonitor(layui_table, layui_table_id, searchInputId) {
        //Perform overload
        layui_table.reload(layui_table_id, {
            page: {
                curr: 1 //Start again on page 1
            }
            , where: {param: $('#' + searchInputId).val()}
        }, 'data');
    }
}


//Results returned in the background
function responseHandlerSysSchedule(res) {
    var actionsHtmlStr = "";
    if (res) {
        var actions_btn_1 = '<a class="btn" '
            + 'title="Run this timed task once" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:onceTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-tag icon-white"></i>'
            + '</a>';
        var actions_btn_2 = '<a class="btn" '
            + 'title="Run this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:startTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-play icon-white"></i>'
            + '</a>';
        var actions_btn_3 = '<a class="btn" '
            + 'title="Stop this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:stopTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-stop icon-white"></i>'
            + '</a>';
        var actions_btn_4 = '<a class="btn" '
            + 'title="Pause this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:pauseTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-pause icon-white"></i>'
            + '</a>';
        var actions_btn_5 = '<a class="btn" '
            + 'title="Reply to this scheduled task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:resumeTask(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-repeat icon-white"></i>'
            + '</a>';
        var actions_btn_6 = '<a class="btn" '
            + 'title="Edit this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:newSysScheduleWindow(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-edit icon-white"></i>'
            + '</a>';
        var actions_btn_7 = '<a class="btn" '
            + 'title="Remove this timed task" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:deleteTask(\'' + res.id + '\',\'' + res.jobName + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-trash icon-white"></i>'
            + '</a>';
        if (res.status) {
            res.status = res.status.text;
            if ('RUNNING' === res.status) {
                actionsHtmlStr = '<div style="width: 100%; text-align: center" >'
                    + actions_btn_3
                    + actions_btn_6
                    + actions_btn_7
                    + '</div>';
            } else {
                actionsHtmlStr = '<div style="width: 100%; text-align: center" >'
                    + actions_btn_2
                    + actions_btn_6
                    + actions_btn_7
                    + '</div>';
            }
        }
    }
    return actionsHtmlStr;
}

function newSysScheduleWindow(id) {
    $("#buttonSysSchedule").attr("onclick", "");
    if (id) {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/sysSchedule/getScheduleById",//This is the name of the file where I receive data in the background.
            data: {scheduleId: id},
            async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.closeAll('page');
                layer.msg('open failed ', {icon: 2, shade: 0, time: 2000});
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    console.log(dataMap);
                    var sysScheduleVo = dataMap.sysScheduleVo;
                    $("#buttonSysSchedule").attr("onclick", "updateSysSchedule()");
                    $("#scheduleId").val(id);
                    $("#scheduleName").val(sysScheduleVo.jobName);
                    $("#scheduleClass").val(sysScheduleVo.jobClass);
                    $("#scheduleCron").val(sysScheduleVo.cronExpression);
                    layer.open({
                        type: 1,
                        title: '<span style="color: #269252;">update schedule</span>',
                        shadeClose: true,
                        closeBtn: false,
                        shift: 7,
                        closeBtn: 1,
                        area: ['580px', '520px'], //Width height
                        skin: 'layui-layer-rim', //Add borders
                        content: $("#SubmitPage")
                    });
                } else {
                    layer.msg('open failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    } else {
        $("#buttonSysSchedule").attr("onclick", "createTask()");
        $("#scheduleId").val("");
        $("#scheduleName").val("");
        $("#scheduleClass").val("");
        $("#scheduleCron").val("");
        layer.open({
            type: 1,
            title: '<span style="color: #269252;">create schedule</span>',
            shadeClose: true,
            closeBtn: 1,
            shift: 7,
            area: ['580px', '520px'], //Width height
            skin: 'layui-layer-rim', //Add borders
            content: $("#SubmitPage")
        });
    }
}

function checkSysScheduleInput(scheduleName, scheduleClass, scheduleCron, description) {
    $('#scheduleName').removeClass('error_class');
    $('#scheduleClass').removeClass('error_class');
    $('#scheduleCron').removeClass('error_class');
    if (scheduleName == '') {
        layer.msg('name Can not be empty', {icon: 2, shade: 0, time: 2000});
        $('#scheduleName').addClass('error_class');
        return false;
    }
    if (scheduleClass == '') {
        layer.msg('class Can not be empty', {icon: 2, shade: 0, time: 2000});
        $('#scheduleClass').addClass('error_class');
        return false;
    }
    if (scheduleCron == '') {
        layer.msg('cron Can not be empty', {icon: 2, shade: 0, time: 2000});
        $('#scheduleCron').addClass('error_class');
        return false;
    }
    /*if (description == '') {
        layer.msg('description不能为空！', {icon: 2, shade: 0, time: 2000});
        document.getElementById('description').focus();
        return false;
    } */
    return true;
}

function createTask() {
    var scheduleName = $("#scheduleName").val();
    var scheduleClass = $("#scheduleClass").val();
    var scheduleCron = $("#scheduleCron").val();
    if (checkSysScheduleInput(scheduleName, scheduleClass, scheduleCron))
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/sysSchedule/createTask",//This is the name of the file where I receive data in the background.
            data: {
                jobName: scheduleName,
                jobClass: scheduleClass,
                cronExpression: scheduleCron
            },
            async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.closeAll('page');
                layer.msg('creation failed ', {icon: 2, shade: 0, time: 2000});
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.closeAll('page');
                    layer.msg('create success ', {icon: 1, shade: 0, time: 2000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg('creation failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
}

function updateSysSchedule() {
    var id = $("#scheduleId").val();
    var scheduleName = $("#scheduleName").val();
    var scheduleClass = $("#scheduleClass").val();
    var scheduleCron = $("#scheduleCron").val();

    if (checkSysScheduleInput(scheduleName, scheduleClass, scheduleCron))
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/sysSchedule/updateTask",//This is the name of the file where I receive data in the background.
            data: {
                id: id,
                jobName: scheduleName,
                jobClass: scheduleClass,
                cronExpression: scheduleCron
            },
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.closeAll('page');
                layer.msg('update failed ', {icon: 2, shade: 0, time: 2000}, function () {
                    window.location.reload();
                });
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.closeAll('page');
                    layer.msg('update success', {icon: 1, shade: 0, time: 2000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg('update failed ', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
}

function onceTask(id) {
    developmentFunc();
}

//run
function startTask(id) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/sysSchedule/startTask",//This is the name of the file where I receive data in the background.
        data: {sysScheduleId: id},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            //alert("Request Failed");
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000}, function () {
                $('#fullScreen').hide();
            });
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    location.reload();
                });
            } else {
                layer.msg("Startup failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000}, function () {
                    location.reload();
                });
            }
            $('#fullScreen').hide();
        }
    });
}

function stopTask(id) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/sysSchedule/stopTask",//This is the name of the file where I receive data in the background.
        data: {sysScheduleId: id},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            //alert("Request Failed");
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000}, function () {
                $('#fullScreen').hide();
            });
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    location.reload();
                });
            } else {
                layer.msg("Stop failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000}, function () {
                    location.reload();
                });
            }
            $('#fullScreen').hide();
        }
    });
}

function pauseTask(id) {
    developmentFunc();
}

function resumeTask(id) {
    developmentFunc();
}

function deleteTask(id, name) {
    console.log(id);
    layer.confirm("Are you sure to delete '" + name + "' ?", {
        btn: ['confirm', 'cancel'] //button
        , title: 'Confirmation prompt'
    }, function () {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/sysSchedule/deleteTask",//This is the name of the file where I receive data in the background.
            data: {sysScheduleId: id},
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                return;
            },
            success: function (data) {//Operation after request successful
                console.log(data);
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg('Delete Success', {icon: 1, shade: 0, time: 2000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg('Delete failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    }, function () {
    });
}

function developmentFunc() {
    layer.msg("Functional development", {icon: 5, shade: 0, time: 2000}, function () {
    });
}



<|start_filename|>piflow-web/src/main/resources/static/my_js/processAndProcessGroup/processAndProcessGroupList.js<|end_filename|>
var isTableLoading = true;

function initProcessAndProcessGroupDatatablePage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({
            elem: '#' + testTableId
            , url: (web_drawingBoard + url)
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , cols: [[
                {
                    field: 'appId', title: 'ProcessGroupId', sort: true, templet: function (data) {
                        //console.log(data);
                        return ('<div name="processAppId">' + data.processType + '_' + data.appId + '</div>');
                    }
                },
                {field: 'name', title: 'Name', sort: true},
                {field: 'description', title: 'Description', sort: true},
                {
                    field: 'startTime', title: 'StartTime', sort: true, width: 170, templet: function (data) {
                        data.startTime = data.startTime ? data.startTime : "";
                        return ('<div id="' + data.id + 'startTime" name="processStartTime" >' + data.startTime + '</div>');
                    }
                },
                {
                    field: 'endTime', title: 'EndTime', sort: true, width: 170, templet: function (data) {
                        data.endTime = data.endTime ? data.endTime : "";
                        return ('<div id="' + data.id + 'endTime" name="processEndTime">' + data.endTime + '</div>');
                    }
                },
                {
                    field: 'progress', title: 'Progress', sort: true, width: 220, templet: function (data) {
                        var progressHtmlStr = '<div>' +
                            '<p id="' + data.id + 'Info">' +
                            '<progress id="' + data.id + '" max="100" value="' +
                            (data.progress ? (data.progress) : '0.00')
                            + '">' +
                            '</progress> ' +
                            (data.progress ? (data.progress + '%') : '0.00%') +
                            '</p>' +
                            '</div>';
                        return progressHtmlStr;
                    }
                },
                {
                    field: 'state', title: 'Status', sort: true, width: 120, templet: function (data) {
                        return (data.state ? data.state : '');
                    }
                },
                {
                    field: 'right', title: 'Actions', sort: true, width: 180, templet: function (data) {
                        return responseActionHandler(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });
}

//Results returned in the background
function responseActionHandler(res) {
    if (res) {
        var processType = 'TASK' == res.processType ? 'PROCESS' : 'PROCESS_GROUP';

        var openProcessBtn = '<a class="btn" ' +
            'href="javascript:void(0);" ' +
            'onclick="javascript:openProcessOrProcessGroup(\'' + res.id + '\',\'' + processType + '\');" ' +
            'style="margin-right: 2px;">' +
            '<i class="icon-share-alt icon-white"></i>' +
            '</a>';
        var runProcessBtn = '<a class="btn" ' +
            'href="javascript:void(0);" ' +
            'onclick="javascript:selectRunMode(\'' + processType + '\',\'' + res.id + '\',\'RUN\');" ' +
            'style="margin-right: 2px;">' +
            '<i class="icon-play icon-white"></i>' +
            '</a>';
        var debugProcessBtn = '<a class="btn" ' +
            'href="javascript:void(0);" ' +
            'onclick="javascript:selectRunMode(\'' + processType + '\',\'' + res.id + '\',\'DEBUG\');" ' +
            'style="margin-right: 2px;">' +
            '<i class="icon-play icon-white"></i>' +
            '</a>';
        var stopProcessBtn = '<a class="btn" ' +
            'href="javascript:void(0);" ' +
            'onclick="javascript:stopProcessOrProcessGroup(\'' + processType + '\',\'' + res.id + '\');" ' +
            'style="margin-right: 2px;">' +
            '<i class="icon-stop icon-white"></i>' +
            '</a>';
        var delProcessBtn = '<a class="btn" ' +
            'href="javascript:void(0);" ' +
            'onclick="javascript:delProcessOrProcessGroup(\'' + processType + '\',\'' + res.id + '\');" ' +
            'style="margin-right: 2px;">' +
            '<i class="icon-trash icon-white"></i>' +
            '</a>';
        var actionsHtmlStr = '<p style="width: 100%; text-align: center" >' + openProcessBtn + runProcessBtn + stopProcessBtn + delProcessBtn + '</p>';
        return actionsHtmlStr;
    }
    return "";
}

function searchMonitor(layui_table, layui_table_id, searchInputId) {
    //Perform overload
    layui_table.reload(layui_table_id, {
        page: {
            curr: 1 //Start again on page 1
        }
        , where: {param: $('#' + searchInputId).val()}
    }, 'data');
}

function processGroupListMonitoring() {
    var arrayObj = new Array();
    var processAppIds = $("div[name='processAppId']");
    var processStartTimes = $("div[name='processStartTime']");
    var processStates = $("div[name='processState']");
    if (processAppIds && processStartTimes && processStates) {
        if (processAppIds.length == processStartTimes.length && processStartTimes.length === processStates.length) {
            for (var i = 0; i < processAppIds.length; i++) {
                if (processAppIds[i].innerHTML != "") {
                    if (processStates[i].innerHTML != "No state" && processStates[i].innerHTML == "STARTED") {
                        arrayObj.push(processAppIds[i].innerHTML);
                    }
                }
                if (processStartTimes[i].innerHTML == '') {
                    arrayObj.push(processAppIds[i].innerHTML);
                }
            }
            if (processAppIds.length > 0) {
                isTableLoading = false;
            }
        }
    } else {
        isTableLoading = true;
    }
    if (isTableLoading) {
        return;
    } else {
        if (arrayObj.length == 0) {
            window.clearInterval(timer);
            return;
        }
        ajaxRequest({
            cache: true,
            type: "get",
            url: "/processGroup/getAppInfoList",
            data: {arrayObj: arrayObj},
            async: true,
            traditional: true,
            error: function (request) {
                console.log("error");
                return;
            },
            success: function (data) {
                if (null != data) {
                    var dataMap = JSON.parse(data);
                    if (200 === dataMap.code) {
                        if (arrayObj && arrayObj.length > 0) {
                            for (var i in arrayObj) {
                                var strAppID = arrayObj[i];
                                if (strAppID && '' !== strAppID) {
                                    var processGroup = dataMap[strAppID];
                                    if (processGroup && '' !== processGroup) {
                                        if (processGroup.id && '' != processGroup.id) {
                                            document.getElementById("" + processGroup.id + "").value = processGroup.progress;
                                            document.getElementById("" + processGroup.id + "Info").innerHTML = "progress:" + processGroup.progress + "%";
                                            if (processGroup.state && "" !== processGroup.state) {
                                                document.getElementById("" + processGroup.id + "state").innerHTML = processGroup.state.text;
                                            }
                                            if (processGroup.startTime && "" !== processGroup.startTime) {
                                                document.getElementById("" + processGroup.id + "startTime").innerHTML = processGroup.startTime;
                                            }
                                            if (processGroup.endTime && "" !== processGroup.endTime) {
                                                document.getElementById("" + processGroup.id + "endTime").innerHTML = processGroup.endTime;
                                            }
                                        }
                                    }

                                }
                            }
                        }
                    }
                }
            }
        });
    }
}

//Select run mode
function selectRunMode(processType, id, runMode) {
    var runModeContent = '<div style="width: 100%;"><div style="width: 210px;height: 50px;line-height: 50px;overflow: hidden;text-align: center;">';
    var onclickFunc = "runProcessOrProcessGroup('" + processType + "','" + id + "','" + runMode + "')"
    if ('RUN' === runMode) {
        runModeContent += '<button type="button" class="btn btn-default" onclick="' + onclickFunc + '">Run</button>&nbsp;'
    } else if ('DEBUG' === runMode) {
        runModeContent += '<button type="button" class="btn btn-default" onclick="' + onclickFunc + '">Debug</button>&nbsp;'
    }
    runModeContent += '<button type="button" class="btn btn-default" onclick="cancelListRunProcessGroup()">Cancel</button>';
    runModeContent += '</div></div>';
    layer.open({
        type: 1,
        title: '<span style="color: #269252;">Select Run Mode</span>',
        shadeClose: true,
        closeBtn: 1,
        shift: 7,
        //area: ['600px', '200px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: runModeContent
    });
}

function cancelListRunProcessGroup() {
    layer.closeAll();
    $('#fullScreen').hide();
    return;
}

//run
function runProcessOrProcessGroup(processType, id, runMode) {
    $('#fullScreen').show();
    var data = {};
    data.id = id;
    data.processType = processType;
    if (runMode) {
        data.runMode = runMode;
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/processAndProcessGroup/runProcessOrProcessGroup",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: data,
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            alert("Request Failed");
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            //console.log("success");
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                //alert(dataMap.errorMsg);
                window.location.reload();
                var openUrl = "/piflow-web/page/processGroup/mxGraph/index.html?drawingBoardType=PROCESS&processType=PROCESS_GROUP&load=" + dataMap.processGroupId;
                if ("PROCESS" === processType) {
                    openUrl = "/piflow-web/page/process/mxGraph/index.html?drawingBoardType=PROCESS&processType=PROCESS&load=" + dataMap.processId;
                }
                var windowOpen = window.open(openUrl);
                if (windowOpen == null || typeof (windowOpen) == 'undefined') {
                    alert('The window cannot be opened. Please check your browser settings.')
                }
            } else {
                alert("Startup Failed");
                $('#fullScreen').hide();
            }

        }
    });
}

//stop
function stopProcessOrProcessGroup(processType, id) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/processAndProcessGroup/stopProcessOrProcessGroup",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {processType: processType, id: id},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            alert("Request Failed");
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            //console.log("success");
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                alert(dataMap.errorMsg);
                window.location.reload();
            } else {
                alert("Stop Failed:" + dataMap.errorMsg);
            }
            $('#fullScreen').hide();

        }
    });
}

//remove
function delProcessOrProcessGroup(processType, id) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//get
        url: "/processAndProcessGroup/delProcessOrProcessGroup",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {processType: processType, id: id},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            alert("Request Failed");
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                alert(dataMap.errorMsg);
                window.location.reload();
            } else {
                alert("Delete Failed" + dataMap.errorMsg);
            }
            $('#fullScreen').hide();
        }
    });
}

function openProcessOrProcessGroup(loadId, processType) {
    console.log("ssss");
    console.log(processType);
    if ("PROCESS" === processType) {
        new_window_open('/page/process/mxGraph/index.html?drawingBoardType=PROCESS&processType=' + processType + '&load=' + loadId);
    } else if ("PROCESS_GROUP" === processType) {
        new_window_open('/page/processGroup/mxGraph/index.html?drawingBoardType=PROCESS&processType=' + processType + '&load=' + loadId);
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/vo/TestDataSchemaValuesVo.java<|end_filename|>
package cn.cnic.component.testData.vo;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TestDataSchemaValuesVo {

    private String id;
    private String fieldValue;
    private int dataRow;
    private TestDataSchemaVo testDataSchemaVo;

}


<|start_filename|>piflow-web/src/main/resources/static/my_js/flow/flowListImport.js<|end_filename|>
var flowTable;

function initDatatableFlowImportPage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({
            elem: '#' + testTableId
            , url: web_header_prefix + url
            , headers: {
                Authorization: ("Bearer " + localStorage.token)
            }
            , cols: [[
                {field: 'name', title: 'Name', sort: true},
                {field: 'description', title: 'Description', sort: true},
                {field: 'crtDttm', title: 'CreateTime', sort: true},
                {
                    field: 'right', title: 'Actions', sort: true, height: 100, templet: function (data) {
                        return responseHandlerFlow(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });
}

//Results returned in the background
function responseHandlerFlow(res) {
    if (res) {
        var actionsHtmlStr = '<div style="width: 100%; text-align: center" >'
            + '<input type="button" class="btn-block" onclick="importFlow(\'' + res.id + '\')" value="Import Flow"/>'
            + '</div>';
        return actionsHtmlStr;
    }
    return '';
}

function searchMonitor(layui_table, layui_table_id, searchInputId) {
    //Perform overload
    layui_table.reload(layui_table_id, {
        page: {
            curr: 1 //Start again on page 1
        }
        , where: {param: $('#' + searchInputId).val()}
    }, 'data');
}

function importFlow(flowId) {
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/flowGroup/copyFlowToGroup",
        data: {"flowId": flowId, "flowGroupId": loadId},
        async: true,
        error: function (request) {
            //alert("Jquery Ajax request error!!!");
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg('Successfully loaded', {icon: 1, shade: 0, time: 2000}, function () {
                    //loadXml(dataMap.xmlStr);
                    window.location.reload();
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/vo/StopGroupVo.java<|end_filename|>
package cn.cnic.component.stopsComponent.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Group name table
 */
@Getter
@Setter
public class StopGroupVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String groupName; // Group name

    private List<StopsTemplateVo> stopsTemplateVoList = new ArrayList<>();

}



<|start_filename|>piflow-web/src/main/java/cn/cnic/common/Eunm/StopsHubState.java<|end_filename|>
package cn.cnic.common.Eunm;

import cn.cnic.base.TextureEnumSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@JsonSerialize(using = TextureEnumSerializer.class)
public enum StopsHubState {
    MOUNT("MOUNT", "MOUNT"),
    UNMOUNT("UNMOUNT", "UNMOUNT");

    private final String value;
    private final String text;

    private StopsHubState(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public static StopsHubState selectGender(String name) {
        for (StopsHubState portType : StopsHubState.values()) {
            if (name.equalsIgnoreCase(portType.name())) {
                return portType;
            }
        }
        return null;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/vo/DebugDataResponse.java<|end_filename|>
package cn.cnic.component.process.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Setter
@Getter
public class DebugDataResponse implements Serializable {

    private static final long serialVersionUID = 1L;
    
    int lastReadLine;                            // The last number of rows read
    String lastFileName;                         // Last read file
    boolean isEnd;                               // Whether to reach the end of the file
    List<String> schema = new ArrayList<>();
    List<String> data = new ArrayList<>();

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/vo/ProcessStopVo.java<|end_filename|>
package cn.cnic.component.process.vo;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.common.Eunm.PortType;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class ProcessStopVo implements Serializable {

    private static final long serialVersionUID = 1L;
    
    private ProcessVo processVo;
    private String name;
    private String bundel;
    private String groups;
    private String owner;
    private String description;
    private String inports;
    private PortType inPortType;
    private String outports;
    private PortType outPortType;
    private String state;
    private Date startTime;
    private Date endTime;
    private String pageId;
    private String visualizationType;
    private List<ProcessStopPropertyVo> processStopPropertyVoList = new ArrayList<ProcessStopPropertyVo>();

    public String getStartTimeStr() {
        return DateUtils.dateTimesToStr(this.startTime);
    }

    public String getEndTimeStr() {
        return DateUtils.dateTimesToStr(this.endTime);
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/system/service/ISysMenuService.java<|end_filename|>
package cn.cnic.component.system.service;

import cn.cnic.base.vo.UserVo;
import cn.cnic.component.system.vo.SysMenuVo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface ISysMenuService {

    public List<SysMenuVo> getSysMenuList(UserVo currentUser);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/config/ConfigInterceptor.java<|end_filename|>
package cn.cnic.base.config;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

/**
 * Defining interceptors
 */
@Component
public class ConfigInterceptor implements HandlerInterceptor {


    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        //String contextPath = (null == SysParamsCache.SYS_CONTEXT_PATH ? "" : SysParamsCache.SYS_CONTEXT_PATH);
        //String requestURI = request.getRequestURI();
        return true;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/service/IStopsComponentManageService.java<|end_filename|>
package cn.cnic.component.stopsComponent.service;

import cn.cnic.controller.requestVo.UpdatestopsComponentIsShow;

public interface IStopsComponentManageService {
    
    /**
     * updateStopsComponentsIsShow
     * 
     * @param username
     * @param isAdmin
     * @param stopsManage
     * @return
     * @throws Exception
     */
    public String updateStopsComponentIsShow(String username, boolean isAdmin, UpdatestopsComponentIsShow stopsManage) throws Exception;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/service/impl/MxGraphServiceImpl.java<|end_filename|>
package cn.cnic.component.mxGraph.service.impl;

import cn.cnic.component.mxGraph.service.IMxGraphService;
import cn.cnic.component.mxGraph.mapper.MxGeometryMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class MxGraphServiceImpl implements IMxGraphService {

    @Resource
    private MxGeometryMapper mxGeometryMapper;

    @Override
    public int deleteMxGraphById(String username, String id) {
        return mxGeometryMapper.updateEnableFlagById(username, id);
    }

}


<|start_filename|>vue-piflow-web/src/main.js<|end_filename|>
import Vue from 'vue';
import App from './App.vue';

//引入 iview
import iView from 'view-design';
// import 'view-design/dist/styles/iview.css';
import './assets/style/my-theme.less';

import en from 'view-design/dist/locale/en-US';
import zh from 'view-design/dist/locale/zh-CN';
import VueI18n from 'vue-i18n'
Vue.use(VueI18n); // 通过插件的形式挂载
// Vue.use(iView);
Vue.use(iView, {
  i18n: function (path, options) {
    let value = i18n.t(path, options)
    if (value !== null && value !== undefined) {
      return value
    }
    return ''
  }
});
Vue.locale = () => { };

// let lang = window.sessionStorage.getItem("lang");
let lang = Cookies.get('lang');
const i18n = new VueI18n({ //this.$i18n.locale // 通过切换locale的值来实现语言切换
  locale: lang ? lang : 'en', // 语言标识
  messages: {
    'zh': Object.assign(require('./assets/language/zh-CN'), zh), // 中文语言包
    'en': Object.assign(require('./assets/language/en-US'), en) // 英文语言包
  }
});

// import './assets/style/theme_1.scss'

// 引入 Cookie
import Cookies from 'js-cookie';

// 引入echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts;

import './assets/style/gloable.scss';
import 'font-awesome/css/font-awesome.css'

import event from './utils/event';
Vue.prototype.$event = event;

import 'xe-utils'
import VXETable from 'vxe-table'
// import 'vxe-table/lib/style.css'
import './assets/style/my-vxe-table.scss';

Vue.use(VXETable)

//实例化 store
import store from './store'; // this.$store.commit("setUser", user); 

//引入axios
import axios from 'axios';
import qs from 'qs';
axios.defaults.withCredentials = false; //让ajax携带cookie
axios.interceptors.request.use(
  config => {
    // 这里的config包含每次请求的内容
    let token = store.state.variable.token;
    if (!token) {
      // token = `${window.sessionStorage.getItem("token")}`
      token = `${Cookies.get('token')}`
    }
    config.headers.Authorization = `Bearer ${token}`;
    return config;
  },
  err => {
    return Promise.reject(err);
  }
);

axios.interceptors.response.use(response => {
  if (response) {
    switch (response.data.code) {
      case 401:
        iView.Modal.warning({
          title: 'Piflow system tips',
          content: 'Authentication failed, please log in again',
          onOk:()=>{
            router.replace({
              path: '/login',
            })
          }
        });
        break;
      case 403:
        window.sessionStorage.clear();     //删除用户信息
        //如果超时就处理 ，指定要跳转的页面(登陆页)
            iView.Modal.warning({
              title: 'Piflow system tips',
              content: 'The token is invalid, please log in again!',
              onOk:()=>{
                router.replace({
                  path: '/login',
                })
              }
            });
        break;
    }
  }
  return response;
}, error => {
  return Promise.reject(error.response.data) //返回接口返回的错误信息
})


// axios.defaults.baseURL = process.env.VUE_APP_URL;
// // window.sessionStorage.setItem("basePath", process.env.VUE_APP_URL);
// Cookies.set('basePath', process.env.VUE_APP_URL);
// Vue.prototype.$url = process.env.VUE_APP_URL;
Vue.prototype.$axios = axios; //全局注册，使用方法为:this.$axios
Vue.prototype.$qs = qs; //全局注册，使用方法为:this.$qs

//全局引入模拟数据
// import mock from './mock'
// Vue.prototype.$mock = mock
// import './utils/flexible' //rem 转换

Vue.config.productionTip = false;


//引入路由文件
import router from './router';
//// 路由拦截
const whiteList = ['/task']; //不需要登录能访问的path
router.beforeEach((to, from, next) => {
  // let userInfo = JSON.parse(sessionStorage.getItem('state'));//获取缓存看是否登录过
  // let state = window.sessionStorage.getItem('state'); //获取缓存看是否登录过
  let state = Cookies.get('state'); //获取缓存看是否登录过
  // if (whiteList.indexOf(to.path) < 0) {//访问了需要登录才能访问的页面
  if (state == 'jwtok') { //登录过来直接进去
    next();
  } else {
    if (to.path == '/login') {
      next();
    } else {
      next({
        path: '/login',
        query: { redirect: to.fullPath } // 将要跳转路由的path作为参数，传递到登录页面
      });
    }
  }
  // } else {
  //   next();
  // }
});


async function startApp() {
  let API_URL;
  await axios.get('/config.json').then((res) => {
    if(process.env.NODE_ENV == 'development'){
      API_URL = res.data.DEV_URL;
    }else{
      API_URL = res.data.BASE_URL;
    }

    axios.defaults.baseURL = API_URL;
    Cookies.set('basePath', API_URL);
    Vue.prototype.$url = API_URL;
  });

  new Vue({
    i18n,
    router,
    store,
    render: h => h(App),
  }).$mount('#app');
}
startApp();


<|start_filename|>piflow-web/src/main/java/cn/cnic/common/Eunm/ScheduleState.java<|end_filename|>
package cn.cnic.common.Eunm;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cn.cnic.base.TextureEnumSerializer;

@JsonSerialize(using = TextureEnumSerializer.class)
public enum ScheduleState {
    INIT("INIT", "Init"),
    RUNNING("RUNNING", "Running"),
    SUSPEND("PAUSE", "Pause"),
    STOP("STOP", "Stop");

    private final String value;
    private final String text;

    private ScheduleState(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public static ScheduleState selectGender(String name) {
        for (ScheduleState portType : ScheduleState.values()) {
            if (name.equalsIgnoreCase(portType.name())) {
                return portType;
            }
        }
        return null;
    }
}


<|start_filename|>piflow-web/src/main/resources/static/my_js/process/processList.js<|end_filename|>
var isTableLoading = true;

function initProcessDatatablePage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({
            elem: '#' + testTableId
            , url: (web_drawingBoard + url)
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , cols: [[
                {
                    field: 'appId', title: 'ProcessId', sort: true, templet: function (data) {
                        return responseFieldHandler('appId', data);
                    }
                },
                {field: 'name', title: 'Name', sort: true},
                {field: 'description', title: 'Description', sort: true},
                {
                    field: 'startTime', title: 'StartTime', sort: true, width: 170, templet: function (data) {
                        return responseFieldHandler('startTime', data);
                    }
                },
                {
                    field: 'endTime', title: 'EndTime', sort: true, width: 170, templet: function (data) {
                        return responseFieldHandler('endTime', data);
                    }
                },
                {
                    field: 'progress', title: 'Progress', sort: true, width: 220, templet: function (data) {
                        return responseFieldHandler('progress', data);
                    }
                },
                {
                    field: 'state', title: 'Status', sort: true, width: 120, templet: function (data) {
                        return responseFieldHandler('state', data);
                    }
                },
                {
                    field: 'right', title: 'Actions', sort: true, width: 240, templet: function (data) {
                        return responseActionHandler(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });
}

function searchMonitor(layui_table, layui_table_id, searchInputId) {
    //Perform overload
    layui_table.reload(layui_table_id, {
        page: {
            curr: 1 //Start again on page 1
        }
        , where: {param: $('#' + searchInputId).val()}
    }, 'data');
}

function responseFieldHandler(fileName, data) {
    var responseShowHtml = "";
    switch (fileName) {
        case 'appId': {
            responseShowHtml = ('<div name="processAppId">' + data.appId + '</div>');
            break;
        }
        case 'startTime': {
            data.startTime = data.startTime ? data.startTime : "";
            responseShowHtml = ('<div id="' + data.id + 'startTime" name="processStartTime" >' + data.startTime + '</div>');
            break;
        }
        case 'endTime': {
            data.endTime = data.endTime ? data.endTime : "";
            responseShowHtml = ('<div id="' + data.id + 'endTime" name="processEndTime">' + data.endTime + '</div>');
            break;
        }
        case 'progress': {
            responseShowHtml = '<div>' +
                '<p id="' + data.id + 'Info">' +
                '<progress id="' + data.id + '" max="100" value="' +
                (data.progress ? (data.progress) : '0.00')
                + '">' +
                '</progress> ' +
                (data.progress ? (data.progress + '%') : '0.00%') +
                '</p>' +
                '</div>';
            break;
        }
        case 'state': {
            responseShowHtml = (null != data.state ? data.state.text : '')
            break;
        }

    }
    return responseShowHtml;
}

function responseActionHandler(data) {
    if (!data) {
        return "";
    }
    data.parentProcessId = (data.parentProcessId ? data.parentProcessId : '');
    var openProcessBtn = '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:openProcess(\'' + data.id + '\');" ' +
        'style="margin-right: 2px;">' +
        '<i class="icon-share-alt icon-white"></i>' +
        '</a>';
    var runProcessBtn = '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:getCheckpointList(\'' + data.id + '\',\'' + data.appId + '\',\'' + data.parentProcessId + '\');"' +
        'style="margin-right: 2px;">' +
        '<i class="icon-play icon-white"></i>' +
        '</a>';
    var debugProcessBtn = '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:getCheckpointList(\'' + data.id + '\',\'' + data.appId + '\',\'' + data.parentProcessId + ',\'DEBUG\');"' +
        'style="margin-right: 2px;">' +
        '<i class="fa-bug icon-white"></i>' +
        '</a>';
    var stopProcessBtn = '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:stopProcess(\'' + data.id + '\');"' +
        'style="margin-right: 2px;">' +
        '<i class="icon-stop icon-white"></i>' +
        '</a>';
    var delProcessBtn = '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:delProcess(\'' + data.id + '\');"' +
        'style="margin-right: 2px;">' +
        '<i class="icon-trash icon-white"></i>' +
        '</a>';
    return '<p style="width: 100%; text-align: center" >' + openProcessBtn + runProcessBtn + debugProcessBtn + stopProcessBtn + delProcessBtn + '</p>';
}

function processListMonitoring() {
    var arrayObj = new Array();
    var processAppIds = $("div[name='processAppId']");
    var processStartTimes = $("div[name='processStartTime']");
    var processStates = $("div[name='processState']");
    if (processAppIds && processStartTimes && processStates) {
        if (processAppIds.length == processStartTimes.length && processStartTimes.length === processStates.length) {
            for (var i = 0; i < processAppIds.length; i++) {
                if (processAppIds[i].innerHTML != "") {
                    if (processStates[i].innerHTML != "No state" && processStates[i].innerHTML == "STARTED") {
                        arrayObj.push(processAppIds[i].innerHTML);
                    }
                }
                if (processStartTimes[i].innerHTML == '') {
                    arrayObj.push(processAppIds[i].innerHTML);
                }
            }
            if (processAppIds.length > 0) {
                isTableLoading = false;
            }
        }
    } else {
        isTableLoading = true;
    }
    if (isTableLoading) {
        return;
    } else {
        if (arrayObj.length == 0) {
            window.clearInterval(timer);
            return;
        }
        ajaxRequest({
            cache: true,
            type: "get",
            url: "/process/getAppInfoList",
            data: {arrayObj: arrayObj},
            async: true,
            traditional: true,
            error: function (request) {
                console.log("error");
                return;
            },
            success: function (data) {
                if (null != data) {
                    var dataMap = JSON.parse(data);
                    if (200 === dataMap.code) {
                        if (arrayObj && arrayObj.length > 0) {
                            for (var i in arrayObj) {
                                var strAppID = arrayObj[i];
                                if (strAppID && '' !== strAppID) {
                                    var process = dataMap[strAppID];
                                    if (process && '' !== process) {
                                        if (process.id && '' != process.id) {
                                            document.getElementById("" + process.id + "").value = process.progress;
                                            document.getElementById("" + process.id + "Info").innerHTML = "progress:" + process.progress + "%";
                                            if (process.state && "" !== process.state) {
                                                document.getElementById("" + process.id + "state").innerHTML = process.state.text;
                                            }
                                            if (dataMap.startTime && "" !== process.startTime) {
                                                document.getElementById("" + process.id + "startTime").innerHTML = process.startTime;
                                            }
                                            if (dataMap.endTime && "" !== process.endTime) {
                                                document.getElementById("" + process.id + "endTime").innerHTML = process.endTime;
                                            }
                                        }
                                    }

                                }
                            }
                        }
                    }
                }
            }
        });
    }
}

//获取Checkpoint点
function getCheckpointList(id, processId, parentProcessId, runMode) {
    if (!processId) {
        alert("Error，Did not get processId");
        return;
    }
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/getCheckpointData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            pID: pID,
            parentProcessId: parentProcessId,
        },
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            alert("Request Failed");
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var checkpointsSplitArray = dataMap.checkpointsSplit;
                if (checkpointsSplitArray) {
                    var layer_open_checkpoint_top = document.createElement("div");
                    var layer_open_checkpoint_btn_div = document.createElement("div");
                    layer_open_checkpoint_btn_div.setAttribute("style", "text-align: right;");

                    var layer_open_checkpoint_btn = document.createElement("div");
                    layer_open_checkpoint_btn.type = "button";
                    layer_open_checkpoint_btn.className = "btn btn-default";
                    layer_open_checkpoint_btn.setAttribute("style", "margin-right: 10px;");
                    if (runMode && 'DEBUG' === runMode) {
                        layer_open_checkpoint_btn.textContent = "DEBUG";
                        layer_open_checkpoint_btn.setAttribute('onclick', 'listRunProcess("' + id + '","DEBUG")')
                    } else {
                        layer_open_checkpoint_btn.setAttribute('onclick', 'listRunProcess("' + id + '")');
                        layer_open_checkpoint_btn.textContent = "RUN"
                    }
                    layer_open_checkpoint_btn_div.appendChild(layer_open_checkpoint_btn);

                    var layer_open_checkpoint = document.createElement("div");
                    layer_open_checkpoint.id = "checkpointsContentDiv";

                    for (var i = 0; i < checkpointsSplitArray.length; i++) {
                        var checkpoints_content_span = document.createElement("span");

                        var checkpoints_content_span_input = document.createElement("input");
                        checkpoints_content_span_input.type = "checkbox";
                        checkpoints_content_span_input.value = "'" + checkpointsSplitArray[i] + "'";

                        var checkpoints_content_span_span = document.createElement("span");
                        checkpoints_content_span_span.textContent = checkpointsSplitArray[i];

                        var checkpoints_content_span_br = document.createElement("br");

                        checkpoints_content_span.appendChild(checkpoints_content_span_input);
                        checkpoints_content_span.appendChild(checkpoints_content_span_span);
                        checkpoints_content_span.appendChild(checkpoints_content_span_br);

                        layer_open_checkpoint.appendChild(checkpoints_content_span);

                    }

                    layer_open_checkpoint_top.appendChild(layer_open_checkpoint);
                    layer_open_checkpoint_top.appendChild(layer_open_checkpoint_btn_div);

                    openLayerWindowLoadHtml(layer_open_checkpoint_top.outerHTML, 500, 300, "Checkpoint", 0.3);
                    //$('#fullScreen').hide();
                } else {
                    listRunProcess(processId, runMode);
                }
            }
        }
    });
}

function cancelListRunProcess() {
    $('#checkpointListShow').modal('hide');
    $('#fullScreen').hide();
    return;
}

//run
function listRunProcess(id, runMode) {
    $('#checkpointListShow').modal('hide');
    var checkpointStr = '';
    $('#checkpointListContent').find("input[type='checkbox']:checked").each(function () {
        if ('' !== checkpointStr) {
            checkpointStr = (checkpointStr + ',');
        }
        checkpointStr = (checkpointStr + $(this).val());
    });
    $('#fullScreen').show();
    var data = {
        id: id,
        checkpointStr: checkpointStr
    }
    if (runMode) {
        data.runMode = runMode;
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/process/runProcess",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: data,
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            alert("Request Failed");
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            //console.log("success");
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                //alert(dataMap.errorMsg);
                //window.location.reload();
                var windowOpen = window.open("/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&processType=PROCESS&load=" + dataMap.processId);
                if (windowOpen == null || typeof (windowOpen) == 'undefined') {
                    alert('The window cannot be opened. Please check your browser settings.')
                }
            } else {
                alert("Startup Failed");
                $('#fullScreen').hide();
            }

        }
    });
}

//stop
function stopProcess(processID) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/process/stopProcess",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processID
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            alert("Request Failed");
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            //console.log("success");
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                alert(dataMap.errorMsg);
                window.location.reload();
            } else {
                alert("Stop Failed:" + dataMap.errorMsg);
            }
            $('#fullScreen').hide();

        }
    });
}

//del
function delProcess(processID) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "get",//Request for get
        url: "/process/delProcess",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processID: processID
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            alert("Request Failed");
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                alert(dataMap.errorMsg);
                window.location.reload();
            } else {
                alert("Delete Failed" + dataMap.errorMsg);
            }
            $('#fullScreen').hide();
        }
    });
}

// open
function openProcess(loadId) {
    var windowOpen = window.open('/piflow-web/mxGraph/drawingBoard?drawingBoardType=PROCESS&processType=PROCESS&load=' + loadId);
    if (windowOpen == null || typeof (windowOpen) == 'undefined') {
        alert('The window cannot be opened. Please check your browser settings.');
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/utils/ProcessStopCustomizedPropertyUtils.java<|end_filename|>
package cn.cnic.component.process.utils;

import cn.cnic.component.process.entity.ProcessStopCustomizedProperty;

import java.util.Date;

public class ProcessStopCustomizedPropertyUtils {

    public static ProcessStopCustomizedProperty processStopCustomizedPropertyNewNoId(String username) {
        ProcessStopCustomizedProperty processStopCustomizedProperty = new ProcessStopCustomizedProperty();
        // basic properties (required when creating)
        processStopCustomizedProperty.setCrtDttm(new Date());
        processStopCustomizedProperty.setCrtUser(username);
        // basic properties
        processStopCustomizedProperty.setEnableFlag(true);
        processStopCustomizedProperty.setLastUpdateUser(username);
        processStopCustomizedProperty.setLastUpdateDttm(new Date());
        processStopCustomizedProperty.setVersion(0L);
        return processStopCustomizedProperty;
    }

    public static ProcessStopCustomizedProperty initProcessStopCustomizedPropertyBasicPropertiesNoId(ProcessStopCustomizedProperty processStopCustomizedProperty, String username) {
        if (null == processStopCustomizedProperty) {
            return processStopCustomizedPropertyNewNoId(username);
        }
        // basic properties (required when creating)
        processStopCustomizedProperty.setCrtDttm(new Date());
        processStopCustomizedProperty.setCrtUser(username);
        // basic properties
        processStopCustomizedProperty.setEnableFlag(true);
        processStopCustomizedProperty.setLastUpdateUser(username);
        processStopCustomizedProperty.setLastUpdateDttm(new Date());
        processStopCustomizedProperty.setVersion(0L);
        return processStopCustomizedProperty;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/entity/TestDataSchema.java<|end_filename|>
package cn.cnic.component.testData.entity;

import java.util.ArrayList;
import java.util.List;

import cn.cnic.base.BaseHibernateModelUUIDNoCorpAgentId;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TestDataSchema extends BaseHibernateModelUUIDNoCorpAgentId {

    private static final long serialVersionUID = 1L;

    private String fieldName;
    private String fieldType;
    private String fieldDescription;
    private int fieldSoft;
    private TestData testData;
    private List<TestDataSchemaValues> schemaValuesList = new ArrayList<>();


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/utils/PropertyUtils.java<|end_filename|>

package cn.cnic.component.flow.utils;

import cn.cnic.component.flow.entity.Property;

import java.util.Date;

public class PropertyUtils {

    public static Property propertyNewNoId(String username) {

        Property property = new Property();
        // basic properties (required when creating)
        property.setCrtDttm(new Date());
        property.setCrtUser(username);
        // basic properties
        property.setEnableFlag(true);
        property.setLastUpdateUser(username);
        property.setLastUpdateDttm(new Date());
        property.setVersion(0L);
        return property;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/mapper/provider/CodeSnippetMapperProvider.java<|end_filename|>
package cn.cnic.component.livy.mapper.provider;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.livy.entity.CodeSnippet;

import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import java.util.Date;

public class CodeSnippetMapperProvider {

    private String id;
    private String lastUpdateUser;
    private String lastUpdateDttmStr;
    private long version;
    private int enableFlag;
    private String codeContent;
    private String executeId;
    private String noteBookId;
    private int codeSnippetSort;


    private boolean preventSQLInjectionCodeSnippet(CodeSnippet codeSnippet) {
        if (null == codeSnippet || StringUtils.isBlank(codeSnippet.getLastUpdateUser())) {
            return false;
        }
        // Mandatory Field
        String lastUpdateDttm = DateUtils
                .dateTimesToStr(null != codeSnippet.getLastUpdateDttm() ? codeSnippet.getLastUpdateDttm() : new Date());
        this.id = SqlUtils.preventSQLInjection(codeSnippet.getId());
        this.enableFlag = ((null != codeSnippet.getEnableFlag() && codeSnippet.getEnableFlag()) ? 1 : 0);
        this.version = (null != codeSnippet.getVersion() ? codeSnippet.getVersion() : 0L);
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttm);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(codeSnippet.getLastUpdateUser());

        // Selection field
        this.executeId = SqlUtils.preventSQLInjection(codeSnippet.getExecuteId());
        this.codeContent = SqlUtils.preventSQLInjection(codeSnippet.getCodeContent());
        String noteBookIdStr = (null != codeSnippet.getNoteBook() ? codeSnippet.getNoteBook().getId() : null);        
        this.noteBookId = SqlUtils.preventSQLInjection(noteBookIdStr);
        this.codeSnippetSort = codeSnippet.getCodeSnippetSort();

        return true;
    }

    private void resetCodeSnippet() {
        this.id = null;
        this.lastUpdateUser = null;
        this.lastUpdateDttmStr = null;
        this.version = 0L;
        this.enableFlag = 1;
        this.executeId = null;
        this.codeContent = null;
        this.noteBookId = null;
        this.codeSnippetSort = 0;
    }

    /**
     * add CodeSnippet
     * 
     * @param codeSnippet
     * @return String
     */
    public String addCodeSnippet(CodeSnippet codeSnippet) {
        String sql = "SELECT 0";
        if (preventSQLInjectionCodeSnippet(codeSnippet)) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("INSERT INTO code_snippet ");
            strBuf.append("( ");
            strBuf.append(SqlUtils.baseFieldName() + ", ");
            strBuf.append("execute_id, ");
            strBuf.append("code_content, ");
            strBuf.append("fk_note_book_id, ");
            strBuf.append("code_snippet_sort ");
            strBuf.append(") ");

            strBuf.append("values ");
            strBuf.append("(");
            strBuf.append(SqlUtils.baseFieldValues(codeSnippet) + ", ");
            strBuf.append(this.executeId + ", ");
            strBuf.append(this.codeContent + ", ");
            strBuf.append(this.noteBookId + ", ");
            strBuf.append(this.codeSnippetSort + " ");
            strBuf.append(")");
            sql = strBuf.toString();
        }
        this.resetCodeSnippet();
        return sql;
    }

    /**
     * update CodeSnippet
     * 
     * @param codeSnippet
     * @return String
     */
    public String updateCodeSnippet(CodeSnippet codeSnippet) {
        String sqlStr = "SELECT 0";
        boolean flag = preventSQLInjectionCodeSnippet(codeSnippet);
        if (flag && StringUtils.isNotBlank(this.id)) {
            SQL sql = new SQL();
            // INSERT_INTO brackets is table name
            sql.UPDATE("code_snippet");
            // The first string in the SET is the name of the field corresponding to the
            // table in the database
            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + this.enableFlag);
            sql.SET("execute_id = " + this.executeId);
            sql.SET("code_content = " + this.codeContent);
            sql.SET("code_snippet_sort = " + this.codeSnippetSort);
            sql.WHERE("version = " + this.version);
            sql.WHERE("id = " + this.id);
            sqlStr = sql.toString();
        }
        this.resetCodeSnippet();
        return sqlStr;
    }

    /**
     * update CodeSnippet enable_flag
     * 
     * @param isAdmin
     * @param username
     * @param id
     * @return String
     */
    public String delCodeSnippetById(boolean isAdmin, String username, String id){
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("UPDATE code_snippet SET enable_flag=0 WHERE ");
        stringBuffer.append("id=" + SqlUtils.preventSQLInjection(id));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }

    /**
     * search CodeSnippet List
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @return String
     */
    public String getCodeSnippetList(boolean isAdmin, String username, String param) {
        StringBuffer stringBuf = new StringBuffer();
        stringBuf.append("SELECT * FROM code_snippet WHERE enable_flag=1 ");
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            stringBuf.append("AND crt_user=" + SqlUtils.preventSQLInjection(username) + " ");
        }
        if (StringUtils.isNotBlank(param)) {
            stringBuf.append("crt_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("last_update_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("name LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("description LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
        }
        stringBuf.append("ORDER BY  code_snippet_sort ASC ");
        return stringBuf.toString();
    }

    /**
     * search CodeSnippet List
     *
     * @param noteBookId
     * @return String
     */
    public String getCodeSnippetListByNoteBookId(String noteBookId) {
        if (StringUtils.isBlank(noteBookId)) {
            return "SELECT 0";
        }
        StringBuffer stringBuf = new StringBuffer();
        stringBuf.append("SELECT * FROM code_snippet WHERE enable_flag=1 ");
        stringBuf.append("AND fk_note_book_id=" + SqlUtils.preventSQLInjection(noteBookId) + " ");
        stringBuf.append("ORDER BY  code_snippet_sort ASC ");
        return stringBuf.toString();
    }


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/mapper/MxGeometryMapper.java<|end_filename|>
package cn.cnic.component.mxGraph.mapper;

import cn.cnic.component.mxGraph.entity.MxGeometry;
import cn.cnic.component.mxGraph.mapper.provider.MxGeometryMapperProvider;
import org.apache.ibatis.annotations.*;

@Mapper
public interface MxGeometryMapper {

    /**
     * add MxGeometry
     *
     * @param mxGeometry
     * @return
     */
    @InsertProvider(type = MxGeometryMapperProvider.class, method = "addMxGeometry")
    public int addMxGeometry(MxGeometry mxGeometry);

    /**
     * update MxGeometry
     *
     * @param mxGeometry
     * @return
     */
    @UpdateProvider(type = MxGeometryMapperProvider.class, method = "updateMxGeometry")
    public int updateMxGeometry(MxGeometry mxGeometry);

    /**
     * Query MxGeometry based on id
     *
     * @param id
     * @return
     */
    @SelectProvider(type = MxGeometryMapperProvider.class, method = "getMxGeometryById")
    @Results({
            @Result(column = "mx_relative", property = "relative"),
            @Result(column = "mx_as", property = "as"),
            @Result(column = "mx_x", property = "x"),
            @Result(column = "mx_y", property = "y"),
            @Result(column = "mx_width", property = "width"),
            @Result(column = "mx_height", property = "height")
    })
    public MxGeometry getMxGeometryById(String id);

    /**
     * Query MxGeometry based on flowId
     *
     * @param flowId
     * @return
     */
    @SelectProvider(type = MxGeometryMapperProvider.class, method = "getMxGeometryByMxCellId")
    @Results({
            @Result(column = "mx_relative", property = "relative"),
            @Result(column = "mx_as", property = "as"),
            @Result(column = "mx_x", property = "x"),
            @Result(column = "mx_y", property = "y"),
            @Result(column = "mx_width", property = "width"),
            @Result(column = "mx_height", property = "height")
    })
    public MxGeometry getMxGeometryByMxCellId(String mxCellId);


    @UpdateProvider(type = MxGeometryMapperProvider.class, method = "updateEnableFlagById")
    public int updateEnableFlagById(String username, String id);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/mapper/NoteBookMapper.java<|end_filename|>
package cn.cnic.component.livy.mapper;

import cn.cnic.component.livy.entity.NoteBook;
import cn.cnic.component.livy.mapper.provider.NoteBookMapperProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface NoteBookMapper {

    /**
     * add NoteBook
     *
     * @param noteBook
     * @return Integer
     */
    @InsertProvider(type = NoteBookMapperProvider.class, method = "addNoteBook")
    public Integer addNoteBook(NoteBook noteBook);

    /**
     * update NoteBook
     *
     * @param noteBook
     * @return Integer
     */
    @UpdateProvider(type = NoteBookMapperProvider.class, method = "updateNoteBook")
    public Integer updateNoteBook(NoteBook noteBook);

    /**
     * update NoteBook enable_flag
     *
     * @param isAdmin
     * @param username
     * @param id
     * @return Integer
     */
    @UpdateProvider(type = NoteBookMapperProvider.class,method = "deleteNoteBookById")
    public Integer deleteNoteBookById(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("id") String id);

    /**
     * get NoteBook by name
     *
     * @param isAdmin
     * @param username
     * @param name
     * @return Integer
     */
    @SelectProvider(type = NoteBookMapperProvider.class,method = "checkNoteBookByName")
    public Integer checkNoteBookByName(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("name") String name);


    /**
     * get NoteBook by id
     *
     * @param isAdmin
     * @param username
     * @param id
     * @return Integer
     */
    @SelectProvider(type = NoteBookMapperProvider.class,method = "getNoteBookById")
    public NoteBook getNoteBookById(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("id") String id);

    /**
     * get NoteBook by id
     *
     * @param id
     * @return Integer
     */
    @SelectProvider(type = NoteBookMapperProvider.class,method = "adminGetNoteBookById")
    public NoteBook adminGetNoteBookById(String id);


    /**
     * search NoteBook List
     *
     * @param isAdmin
     * @param username
     * @param param
     * @return
     */
    @SelectProvider(type = NoteBookMapperProvider.class,method = "getNoteBookList")
    public List<NoteBook> getNoteBookList(boolean isAdmin, String username, String param);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/vo/StopsComponentGroupVo.java<|end_filename|>
package cn.cnic.component.stopsComponent.vo;

import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;

/**
 * Group name table
 */
@Setter
@Getter
public class StopsComponentGroupVo {

    private String id; // Group id
    private String groupName; // Group name

    private List<StopsComponentVo> stopsComponentVoList = new ArrayList<StopsComponentVo>();
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/template/mapper/provider/FlowAndStopsTemplateVoMapperProvider.java<|end_filename|>
package cn.cnic.component.template.mapper.provider;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.common.Eunm.PortType;
import cn.cnic.component.template.entity.PropertyTemplateModel;
import cn.cnic.component.template.entity.StopTemplateModel;
import cn.cnic.component.template.entity.FlowTemplate;
import cn.cnic.component.template.vo.FlowTemplateModelVo;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class FlowAndStopsTemplateVoMapperProvider {

    /**
     * Insert list<Property> Note that the method of spelling sql must use Map to connect Param content to key value.
     *
     * @param map (Content: The key is propertyList and the value is List<Property>)
     * @return
     */
    @SuppressWarnings({"unchecked", "rawtypes"})
    public String addPropertyList(Map map) {
        List<PropertyTemplateModel> propertyList = (List<PropertyTemplateModel>) map.get("propertyList");
        StringBuffer sqlStrBuffer = new StringBuffer();
        if (null != propertyList && propertyList.size() > 0) {
            sqlStrBuffer.append("insert into ");
            sqlStrBuffer.append("property_template ");
            sqlStrBuffer.append("(");
            sqlStrBuffer.append("id,");
            sqlStrBuffer.append("crt_dttm,");
            sqlStrBuffer.append("enable_flag,");
            sqlStrBuffer.append("name,");
            sqlStrBuffer.append("display_name,");
            sqlStrBuffer.append("description,");
            sqlStrBuffer.append("custom_value,");
            sqlStrBuffer.append("allowable_values,");
            sqlStrBuffer.append("property_required,");
            sqlStrBuffer.append("property_sensitive,");
            sqlStrBuffer.append("version,");
            sqlStrBuffer.append("fk_stops_id,");
            sqlStrBuffer.append("is_select,");
            sqlStrBuffer.append("crt_user");
            sqlStrBuffer.append(") ");
            sqlStrBuffer.append("values");
            int i = 0;
            for (PropertyTemplateModel property : propertyList) {
                i++;
                String id = property.getId();
                Date crtDttm = property.getCrtDttm();
                Boolean enableFlag = property.getEnableFlag();
                String name = property.getName();
                String displayName = property.getDisplayName();
                String description = "null".equals(property.getDescription()) ? null : property.getDisplayName();
                String customValue = property.getCustomValue();
                String allowableValues = property.getAllowableValues();
                Boolean required = property.getRequired();
                Boolean sensitive = property.getSensitive();
                Long version = property.getVersion();
                StopTemplateModel stops = property.getStopsVo();
                Boolean isSelect = property.getIsSelect();
                String crtUser = property.getCrtUser();
                // You can't make a mistake when you splice
                sqlStrBuffer.append("(");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace(id) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStr((crtDttm == null ? "" : DateUtils.dateTimesToStr(crtDttm))) + ",");
                sqlStrBuffer.append((enableFlag == null ? "1" : (enableFlag ? 1 : 0)) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace(name) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace(displayName) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace(description) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace(customValue) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace(allowableValues) + ",");
                sqlStrBuffer.append((required ? 1 : 0) + ",");
                sqlStrBuffer.append((sensitive ? 1 : 0) + ",");
                sqlStrBuffer.append((version == null ? "0" : version) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace((stops == null ? "" : stops.getId())) + ",");
                sqlStrBuffer.append((isSelect == null ? 0 : isSelect) + ",");
                sqlStrBuffer.append(SqlUtils.addSqlStrAndReplace(crtUser));
                if (i != propertyList.size()) {
                    sqlStrBuffer.append("),");
                } else {
                    sqlStrBuffer.append(")");
                }
            }
            sqlStrBuffer.append(";");
        }
        String sqlStr = sqlStrBuffer.toString();
        return sqlStr;
    }

    /**
     * add FlowTemplateVo
     *
     * @param flow
     * @return
     */
    public String addFlow(FlowTemplateModelVo flow) {
        String sqlStr = "";
        if (null != flow) {
            String id = flow.getId();
            String description = flow.getDescription();
            String name = flow.getName();
            SQL sql = new SQL();
            // INSERT_INTO brackets is table name
            sql.INSERT_INTO("flow_template");
            // The first string in the value is the field name corresponding to the table in the database.
            // all types except numeric fields must be enclosed in single quotes

            sql.VALUES("id", SqlUtils.addSqlStr(id));
            if (StringUtils.isNotBlank(description)) {
                sql.VALUES("description", SqlUtils.addSqlStr(description));
            }
            if (StringUtils.isNotBlank(name)) {
                sql.VALUES("name", SqlUtils.addSqlStr(name));
            }
            sqlStr = sql.toString();
        }
        return sqlStr;
    }

    /**
     * add StopTemplateVo
     *
     * @param stops
     * @return
     */
    public String addStops(StopTemplateModel stops) {
        String sqlStr = "";
        if (null != stops) {
            String id = stops.getId();
            String bundel = stops.getBundel();
            String description = stops.getDescription().equals("null") ? null : stops.getDescription();
            String name = stops.getName();
            String inports = stops.getInports();
            PortType inPortType = stops.getInPortType();
            String outports = stops.getOutports();
            PortType outPortType = stops.getOutPortType();
            String owner = stops.getOwner();
            String pageId = stops.getPageId();
            FlowTemplate flow = stops.getFlowTemplate();
            Boolean enableFlag = stops.getEnableFlag();
            Date crtDttm = stops.getCrtDttm();
            Long version = stops.getVersion();
            Boolean checkpoint = stops.getIsCheckpoint();
            String groups = stops.getGroups();
            String crtUser = stops.getCrtUser();
            SQL sql = new SQL();
            sql.INSERT_INTO("stops_template");

            //Process the required fields first
            if (null == crtDttm) {
                crtDttm = new Date();
            }
            if (null == version) {
                version = 0L;
            }
            if (null == enableFlag) {
                enableFlag = true;
            }
            sql.VALUES("id", SqlUtils.addSqlStr(id));
            String crtDttmStr = DateUtils.dateTimesToStr(crtDttm);
            sql.VALUES("crt_dttm", SqlUtils.addSqlStr(crtDttmStr));
            sql.VALUES("version", (version + 1) + "");
            int enableFlagInt = enableFlag ? 1 : 0;
            sql.VALUES("enable_flag", enableFlagInt + "");

            // handle other fields
            if (StringUtils.isNotBlank(bundel)) {
                sql.VALUES("bundel", SqlUtils.addSqlStr(bundel));
            }
            if (StringUtils.isNotBlank(description)) {
                sql.VALUES("description", SqlUtils.addSqlStr(description));
            }
            if (StringUtils.isNotBlank(name)) {
                sql.VALUES("name", SqlUtils.addSqlStr(name));
            }
            if (StringUtils.isNotBlank(inports)) {
                sql.VALUES("inports", SqlUtils.addSqlStr(inports));
            }
            if (null != inPortType) {
                sql.VALUES("in_port_type", SqlUtils.addSqlStr(inPortType.name()));
            }
            if (StringUtils.isNotBlank(outports)) {
                sql.VALUES("outports", SqlUtils.addSqlStr(outports));
            }
            if (null != outPortType) {
                sql.VALUES("out_port_type", SqlUtils.addSqlStr(outPortType.name()));
            }
            if (StringUtils.isNotBlank(owner)) {
                sql.VALUES("owner", SqlUtils.addSqlStr(owner));
            }
            if (StringUtils.isNotBlank(pageId)) {
                sql.VALUES("page_id", SqlUtils.addSqlStr(pageId));
            }
            if (StringUtils.isNotBlank(crtUser)) {
                sql.VALUES("crt_user", SqlUtils.addSqlStr(crtUser));
            }
            if (null != flow) {
                String flowId = flow.getId();
                if (StringUtils.isNotBlank(flowId)) {
                    sql.VALUES("fk_template_id", SqlUtils.addSqlStr(flowId));
                }
            }
            if (null != checkpoint) {
                sql.VALUES("is_checkpoint", (checkpoint ? 1 : 0) + "");
            }
            if (StringUtils.isNotBlank(groups)) {
                sql.VALUES("groups", SqlUtils.addSqlStr(groups));
            }

            sqlStr = sql.toString();
        }
        return sqlStr;
    }
}


<|start_filename|>vue-piflow-web/public/drawingBoard/my_js/flowGroup/flowGroupList.js<|end_filename|>
function newFlowGroup() {
    $("#buttonFlowGroup").attr("onclick", "");
    $("#buttonFlowGroup").attr("onclick", "saveOrUpdateFlowGroup()");
    $("#flowGroupId").val("");
    $("#flowGroupName").val("");
    $("#description").val("");
    layer.open({
        type: 1,
        title: '<span style="color: #269252;">create flow group</span>',
        shadeClose: true,
        closeBtn: 1,
        shift: 7,
        area: ['580px', '520px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: $("#SubmitPage")
    });
}

function initDatatableFlowGroupPage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({
            elem: '#' + testTableId
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , url: web_header_prefix + url
            , cols: [[
                {field: 'name', title: 'Name', sort: true},
                {field: 'description', title: 'Description', sort: true},
                {field: 'crtDttm', title: 'CreateTime', sort: true},
                {
                    field: 'right', title: 'Actions', sort: true, height: 100, templet: function (data) {
                        return responseActionsFlow(data);
                    }
                }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });
}

function searchMonitor(layui_table, layui_table_id, searchInputId) {
    //Perform overload
    layui_table.reload(layui_table_id, {
        page: {
            curr: 1 //Start again on page 1
        }
        , where: {param: $('#' + searchInputId).val()}
    }, 'data');
}

//Results returned in the background
function responseActionsFlow(res) {
    var actionsHtmlStr = '<div style="width: 100%; text-align: center" >' +
        '<a class="btn" ' +
        'href="javascript:void(0);"' +
        'onclick="javascript:openFlowGroup(\'' + res.id + '\'); "' +
        'style="margin-right: 2px;">' +
        '<i class="icon-share-alt icon-white"></i>' +
        '</a>' +
        '<a class="btn" ' +
        'href="javascript:void(0);"' +
        'onclick="javascript:openFlowBaseInfo(\'' + res.id + '\');" ' +
        'style="margin-right: 2px;">' +
        '<i class="icon-edit icon-white"></i>' +
        '</a>' +
        '<a class="btn" ' +
        'href="javascript:void(0);" ' +
        'onclick="javascript:listRunFlowGroup(\'' + res.id + '\');" ' +
        'style="margin-right: 2px;">' +
        '<i class="icon-play icon-white"></i>' +
        '</a>' +
        '<a class="btn" ' +
        'href="javascript:void(0);"' +
        'onclick="javascript:deleteFlowGroup(\'' + res.id + '\',\'' + res.name + '\');" ' +
        'style="margin-right: 2px;">' +
        '<i class="icon-trash icon-white"></i>' +
        '</a>' +
        '<a class="btn" ' +
        'href="javascript:void(0);"' +
        'onclick="javascript:listSaveFlowGroupTemplate(\'' + res.id + '\',\'' + res.name + '\');" ' +
        'style="margin-right: 2px;">' +
        '<i class="icon-check icon-white"></i>' +
        '</a>' +
        '</div>';
    return actionsHtmlStr;
}

function openFlowGroup(flowGroupId) {
    new_window_open('/page/flowGroup/mxGraph/index.html?drawingBoardType=GROUP&load=' + flowGroupId + '');
}

function openFlowBaseInfo(id) {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/flowGroup/queryFlowGroupData",//This is the name of the file where I receive data in the background.
        data: {load: id},
        async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.closeAll('page');
            layer.msg('request failed ', {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            layer.closeAll('page');
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var flowGroupVo = dataMap.flowGroupVo;
                $("#buttonFlowGroup").attr("onclick", "");
                $("#buttonFlowGroup").attr("onclick", "updateFlowGroup()");
                $("#flowGroupId").val(id);
                $("#flowGroupName").val(flowGroupVo.name);
                $("#description").val(flowGroupVo.description);
                layer.open({
                    type: 1,
                    title: '<span style="color: #269252;">update flow group</span>',
                    shadeClose: true,
                    closeBtn: false,
                    shift: 7,
                    closeBtn: 1,
                    area: ['580px', '520px'], //Width height
                    skin: 'layui-layer-rim', //Add borders
                    content: $("#SubmitPage")
                });
            } else {
                layer.msg('creation failed', {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

function saveOrUpdateFlowGroup() {
    var id = $("#flowGroupId").val();
    var flowGroupName = $("#flowGroupName").val();
    var description = $("#description").val();
    if (checkGroupInput(flowGroupName)) {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/flowGroup/saveOrUpdateFlowGroup",//This is the name of the file where I receive data in the background.
            data: {
                id: id,
                name: flowGroupName,
                description: description
            },
            async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.closeAll('page');
                layer.msg('creation failed ', {icon: 2, shade: 0, time: 2000});
                return;
            },
            success: function (data) {//Operation after request successful
                layer.closeAll('page');
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg('success ', {icon: 1, shade: 0, time: 2000}, function () {
                        new_window_open("/piflow-web/mxGraph/drawingBoard?drawingBoardType=GROUP&load=" + dataMap.flowGroupId);
                    });
                } else {
                    layer.msg('failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    }
}

function updateFlowGroup() {
    var id = $("#flowGroupId").val();
    var flowGroupName = $("#flowGroupName").val();
    var description = $("#description").val();
    if (checkGroupInput(flowGroupName)) {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/flowGroup/saveOrUpdateFlowGroup",//This is the name of the file where I receive data in the background.
            data: {
                id: id,
                name: flowGroupName,
                description: description
            },
            async: false,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                layer.closeAll('page');
                layer.msg('creation failed ', {icon: 2, shade: 0, time: 2000});
                return;
            },
            success: function (data) {//Operation after request successful
                layer.closeAll('page');
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg('success ', {icon: 1, shade: 0, time: 2000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg('failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    }
}

//run
function listRunFlowGroup(loadId, runMode) {
    // $('#fullScreen').show();
    window.parent.postMessage(true);
    var data = {flowGroupId: loadId}
    if (runMode) {
        data.runMode = runMode;
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/flowGroup/runFlowGroup",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: data,
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            //alert("Request Failed");
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000}, function () {
                // $('#fullScreen').hide();
                window.parent.postMessage(false);
            });

            return;
        },
        success: function (data) {//Operation after request successful
            //console.log("success");
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    new_window_open("/page/processGroup/mxGraph/index.html?drawingBoardType=PROCESS&processType=PROCESS_GROUP&load=" + dataMap.processGroupId);
                    // new_window_open("/processGroup/getProcessGroupById?parentAccessPath=grapheditor&processGroupId=" + dataMap.processGroupId);
                });
            } else {
                //alert("Startup failure：" + dataMap.errorMsg);
                layer.msg("Startup failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000}, function () {
                    location.reload();
                });
            }
            // $('#fullScreen').hide();
            window.parent.postMessage(false);
        }
    });
}

function deleteFlowGroup(id, name) {
    layer.confirm("Are you sure to delete '" + name + "' ?", {
        btn: ['confirm', 'cancel'] //button
        , title: 'Confirmation prompt'
    }, function () {
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/flowGroup/deleteFlowGroup",//This is the name of the file where I receive data in the background.
            data: {id: id},
            async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
            error: function (request) {//Operation after request failure
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg('Delete Success', {icon: 1, shade: 0, time: 2000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg('Delete failed', {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    }, function () {
    });
}

function checkGroupInput(flowName) {
    if (flowName == '') {
        layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('flowName').focus();
        return false;
    }

    /*  if (description == '') {
         layer.msg('description不能为空！', {icon: 2, shade: 0, time: 2000});
         document.getElementById('description').focus();
         return false;
     } */
    return true;
}

function listSaveFlowGroupTemplate(id, name) {
    layer.prompt({
        title: 'please enter the template name',
        formType: 0,
        btn: ['submit', 'cancel']
    }, function (text, index) {
        layer.close(index);
        ajaxRequest({
            cache: true,//Keep cached data
            type: "get",//Request type post
            url: "/flowTemplate/saveFlowTemplate",//This is the name of the file where I receive data in the background.
            data: {
                load: id,
                name: text,
                templateType: "GROUP"
            },
            async: true,
            error: function (request) {//Operation after request failure
                console.log(" save template error");
                return;
            },
            success: function (data) {//Operation after request successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    });
                } else {
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    });
}



<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/mapper/provider/TestDataSchemaValuesMapperProvider.java<|end_filename|>
package cn.cnic.component.testData.mapper.provider;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.testData.entity.TestDataSchemaValues;

public class TestDataSchemaValuesMapperProvider {

    private String id;
    private String lastUpdateUser;
    private String lastUpdateDttmStr;
    private long version;
    private int enableFlag;
    private String fieldValue;
    private int dataRow;
    private String testDataId;
    private String testDataSchemaId;

    private boolean preventSQLInjectionTestDataSchemaValues(TestDataSchemaValues testDataSchemaValues) {
        if (null == testDataSchemaValues || StringUtils.isBlank(testDataSchemaValues.getLastUpdateUser())) {
            return false;
        }
        // Mandatory Field
        String lastUpdateDttm = DateUtils.dateTimesToStr(
                null != testDataSchemaValues.getLastUpdateDttm() ? testDataSchemaValues.getLastUpdateDttm()
                        : new Date());
        this.id = SqlUtils.preventSQLInjection(testDataSchemaValues.getId());
        this.enableFlag = ((null != testDataSchemaValues.getEnableFlag() && testDataSchemaValues.getEnableFlag()) ? 1
                : 0);
        this.version = (null != testDataSchemaValues.getVersion() ? testDataSchemaValues.getVersion() : 0L);
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttm);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(testDataSchemaValues.getLastUpdateUser());

        // Selection field
        this.fieldValue = SqlUtils.preventSQLInjection(testDataSchemaValues.getFieldValue());
        this.dataRow = testDataSchemaValues.getDataRow();
        this.testDataId = SqlUtils.preventSQLInjection(null != testDataSchemaValues.getTestData() ? testDataSchemaValues.getTestData().getId(): null);
        this.testDataSchemaId = SqlUtils.preventSQLInjection(null != testDataSchemaValues.getTestDataSchema() ? testDataSchemaValues.getTestDataSchema().getId(): null);

        return true;
    }

    private void resetTestDataSchemaValues() {
        this.id = null;
        this.lastUpdateUser = null;
        this.lastUpdateDttmStr = null;
        this.version = 0L;
        this.enableFlag = 1;
        this.fieldValue = null;
        this.dataRow = 0;
        this.testDataId = null;
        this.testDataSchemaId = null;
    }

    /**
     * add TestDataSchemaValues
     * 
     * @param testDataSchemaValues
     * @return
     */
    public String addTestDataSchemaValues(TestDataSchemaValues testDataSchemaValues) {
        String sql = "SELECT 0";
        if (preventSQLInjectionTestDataSchemaValues(testDataSchemaValues)) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("INSERT INTO test_data_schema_values ");
            strBuf.append("( ");
            strBuf.append(SqlUtils.baseFieldName() + ", ");
            strBuf.append("field_value, ");
            strBuf.append("data_row, ");
            strBuf.append("fk_test_data_id, ");
            strBuf.append("fk_test_data_schema_id ");
            strBuf.append(") ");

            strBuf.append("values ");
            strBuf.append("(");
            strBuf.append(SqlUtils.baseFieldValues(testDataSchemaValues) + ", ");
            strBuf.append(this.fieldValue + ", ");
            strBuf.append(this.dataRow + ", ");
            strBuf.append(this.testDataId + ", ");
            strBuf.append(this.testDataSchemaId + " ");
            strBuf.append(")");
            sql = strBuf.toString();
        }
        this.resetTestDataSchemaValues();
        return sql;
    }

    /**
     * add TestDataSchemaValues list
     * 
     * @param testDataSchemaValuesList
     * @return
     */
    public String addTestDataSchemaValuesList(List<TestDataSchemaValues> testDataSchemaValuesList) {
        String sql = "SELECT 0";
        if (null == testDataSchemaValuesList || testDataSchemaValuesList.size() <= 0) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("INSERT INTO test_data_schema_values ");
        strBuf.append("( ");
        strBuf.append(SqlUtils.baseFieldName() + ", ");
        strBuf.append("field_value, ");
        strBuf.append("data_row, ");
        strBuf.append("fk_test_data_id, ");
        strBuf.append("fk_test_data_schema_id ");
        strBuf.append(") ");
        strBuf.append("values ");
        boolean firstFlag = true;
        for (int i = 0; i < testDataSchemaValuesList.size(); i++) {
            TestDataSchemaValues testDataSchemaValues = testDataSchemaValuesList.get(i);
            if (preventSQLInjectionTestDataSchemaValues(testDataSchemaValues)) {
                if (firstFlag) {
                    strBuf.append("(");
                } else {
                    strBuf.append(",(");
                }
                strBuf.append(SqlUtils.baseFieldValues(testDataSchemaValues) + ", ");
                strBuf.append(this.fieldValue + ", ");
                strBuf.append(this.dataRow + ", ");
                strBuf.append(this.testDataId + ", ");
                strBuf.append(this.testDataSchemaId + " ");
                strBuf.append(")");
            }
            this.resetTestDataSchemaValues();
        }
        sql = strBuf.toString();
        return sql;
    }

    /**
     * update TestDataSchemaValues
     * 
     * @param testDataSchemaValues
     * @return
     */
    public String updateTestDataSchemaValues(TestDataSchemaValues testDataSchemaValues) {
        String sqlStr = "SELECT 0";
        boolean flag = preventSQLInjectionTestDataSchemaValues(testDataSchemaValues);
        if (flag && StringUtils.isNotBlank(this.id)) {
            SQL sql = new SQL();
            // INSERT_INTO brackets is table name
            sql.UPDATE("test_data_schema_values");
            // The first string in the SET is the name of the field corresponding to the
            // table in the database
            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + this.enableFlag);
            sql.SET("field_value = " + this.fieldValue);
            sql.SET("data_row = " + this.dataRow);
            sql.SET("fk_test_data_id = " + this.testDataId);
            sql.SET("fk_test_data_schema_id = " + this.testDataSchemaId);
            sql.WHERE("version = " + this.version);
            sql.WHERE("id = " + this.id);
            sqlStr = sql.toString();
        }
        this.resetTestDataSchemaValues();
        return sqlStr;
    }

    /**
     * update TestDataSchemaValues enable_flag
     * 
     * @param isAdmin
     * @param username
     * @param testDataId
     * @return
     */
    public String delTestDataSchemaValuesByTestDataId(boolean isAdmin, String username, String testDataId){
        if (StringUtils.isBlank(testDataId)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("UPDATE test_data_schema_values SET enable_flag=0 WHERE ");
        stringBuffer.append("fk_test_data_id=" + SqlUtils.preventSQLInjection(testDataId));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }


    /**
     * update TestDataSchemaValues enable_flag
     *
     * @param isAdmin
     * @param username
     * @param schemaId
     * @return
     */
    public String delTestDataSchemaValuesBySchemaId(boolean isAdmin, String username, String schemaId){
        if (StringUtils.isBlank(schemaId)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("UPDATE test_data_schema_values SET enable_flag=0 WHERE ");
        stringBuffer.append("fk_test_data_schema_id=" + SqlUtils.preventSQLInjection(schemaId));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }

    /**
     * get TestDataSchemaValues custom list
     *
     * @param map
     * @return
     */
    public static String getTestDataSchemaValuesCustomList(@SuppressWarnings("rawtypes") Map map) {
        if (null == map) {
            return "SELECT 0";
        }
        String testDataId = (String) map.get("testDataId");
        if (StringUtils.isBlank(testDataId)) {
            return "SELECT 0";
        }
        @SuppressWarnings("unchecked")
        List<LinkedHashMap<String, String>> fieldNameList = (List<LinkedHashMap<String, String>>) map.get("fieldNameList");
        if (null == fieldNameList || fieldNameList.size() <= 0) {
            return "SELECT 0";
        }
        String condition = " ";
        boolean isAdmin = (boolean) map.get("isAdmin");
        String username = (String) map.get("username");

        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = "AND TDSV.crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("SELECT TDSV.data_row AS \"dataRow\"");
        for (Map<String, String> fieldName : fieldNameList) {
            strBuf.append(",MAX( ");
            strBuf.append("CASE TDSV.fk_test_data_schema_id WHEN ");
            strBuf.append(SqlUtils.preventSQLInjection(fieldName.get("ID")) + " ");
            strBuf.append("THEN TDSV.field_value END ");
            strBuf.append(") AS ");
            strBuf.append(SqlUtils.addSymbol(fieldName.get("FIELD_NAME"), "\"", true, true) + " ");
        }
        strBuf.append("FROM test_data_schema_values TDSV ");
        strBuf.append("WHERE TDSV.fk_test_data_id= " + SqlUtils.preventSQLInjection(testDataId) + " ");
        strBuf.append("AND TDSV.enable_flag=1 ");
        strBuf.append(condition + " ");
        strBuf.append("GROUP BY TDSV.data_row");

        return strBuf.toString();

    }

    /**
     * get testDataSchemaValuesId custom list
     * @param map
     * @return
     */
    public static String getTestDataSchemaValuesCustomListId(@SuppressWarnings("rawtypes") Map map) {
        if (null == map) {
            return "SELECT 0";
        }
        String testDataId = (String) map.get("testDataId");
        if (StringUtils.isBlank(testDataId)) {
            return "SELECT 0";
        }
        @SuppressWarnings("unchecked")
        List<LinkedHashMap<String, String>> fieldNameList = (List<LinkedHashMap<String, String>>) map.get("fieldNameList");
        if (null == fieldNameList || fieldNameList.size() <= 0) {
            return "SELECT 0";
        }
        String condition = " ";
        boolean isAdmin = (boolean) map.get("isAdmin");
        String username = (String) map.get("username");

        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = "AND TDSV.crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("SELECT TDSV.data_row AS \"dataRow\"");
        for (Map<String, String> fieldName : fieldNameList) {
            strBuf.append(",MAX( ");
            strBuf.append("CASE TDSV.fk_test_data_schema_id WHEN ");
            strBuf.append(SqlUtils.preventSQLInjection(fieldName.get("ID")) + " ");
            strBuf.append("THEN TDSV.id END ");
            strBuf.append(") AS ");
            strBuf.append(SqlUtils.addSymbol(fieldName.get("FIELD_NAME"), "\"", true, true) + " ");
        }
        strBuf.append("FROM test_data_schema_values TDSV ");
        strBuf.append("WHERE TDSV.fk_test_data_id= " + SqlUtils.preventSQLInjection(testDataId) + " ");
        strBuf.append("AND TDSV.enable_flag=1 ");
        strBuf.append(condition + " ");
        strBuf.append("GROUP BY TDSV.data_row");

        return strBuf.toString();

    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/dataSource/service/IDataSource.java<|end_filename|>
package cn.cnic.component.dataSource.service;

import cn.cnic.component.dataSource.vo.DataSourceVo;

import java.util.List;

public interface IDataSource {

    /**
     * save or update DataSource
     *
     * @param dataSourceVo
     * @return
     */
    public String saveOrUpdate(String username, boolean isAdmin, DataSourceVo dataSourceVo, boolean isSynchronize);

    /**
     * Query DataSourceVo according to ID (query contains its subtable)
     *
     * @param id
     * @return
     */
    public DataSourceVo dataSourceVoById(String username, boolean isAdmin, String id);

    /**
     * Query DataSourceVo according to ID (query contains its subtable)
     *
     * @param id
     * @return
     */
    public String getDataSourceVoById(String username, boolean isAdmin, String id);

    /**
     * getDataSourceVoList
     *
     * @param isAdmin
     * @param username
     * @return
     */
    public String getDataSourceVoList(String username, boolean isAdmin);

    /**
     * getDataSourceTemplateList
     *
     * @param
     * @return
     */
    public List<DataSourceVo> getDataSourceTemplateList();

    /**
     * Query dataSourceVoList (parameter space-time non-paging)
     *
     * @param offset
     * @param limit
     * @param param
     * @return
     */
    public String getDataSourceVoListPage(String username, boolean isAdmin, Integer offset, Integer limit, String param);

    /**
     * delete DataSource By Id
     *
     * @param id
     * @return
     */
    public String deleteDataSourceById(String username, boolean isAdmin, String id);

    public String getDataSourceInputPageData(String username, boolean isAdmin, String dataSourceId);
    
    /**
     * checkLinked
     * 
     * @param datasourceId
     * @return
     */
    public String checkLinked(String datasourceId);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/controller/requestVo/NoteBookVoRequest.java<|end_filename|>
package cn.cnic.controller.requestVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter
@ApiModel(description = "noteBook")
public class NoteBookVoRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "noteBook id")
    private String id;
    
    @ApiModelProperty(value = "noteBook name", required = true)
    private String name;
    
    @ApiModelProperty(value = "noteBook description")
    private String description;

    @ApiModelProperty(value = "noteBook code type", required = true)
    private String codeType;

    @ApiModelProperty(value = "noteBook sessions id")
    private String sessionsId;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/utils/MxGraphComponentVoUtils.java<|end_filename|>
package cn.cnic.component.mxGraph.utils;

import cn.cnic.component.mxGraph.vo.MxGraphComponentVo;

import java.util.ArrayList;
import java.util.List;

public class MxGraphComponentVoUtils {

    public static List<MxGraphComponentVo> InitDefaultGroupMxGraphComponentList() {
        List<MxGraphComponentVo> mxGraphComponentVoList = new ArrayList<>();
        mxGraphComponentVoList.add(InitGroupMxGraphComponent());
        mxGraphComponentVoList.add(InitTaskMxGraphComponent());
        mxGraphComponentVoList.add(InitTextMxGraphComponent());
        return mxGraphComponentVoList;
    }

    public static MxGraphComponentVo InitGroupMxGraphComponent() {
        MxGraphComponentVo mxGraphComponentVo = new MxGraphComponentVo();
        mxGraphComponentVo.setAddImagePaletteId("general");
        mxGraphComponentVo.setComponent_prefix("/piflow-web/img/");
        mxGraphComponentVo.setComponent_name("Group");
        List<MxGraphComponentVo.COMPONENT_GROUP> component_group_list = new ArrayList<>();
        MxGraphComponentVo.COMPONENT_GROUP component_group = new MxGraphComponentVo.COMPONENT_GROUP();
        component_group.setImg_type(".png");
        component_group.setDescription("Group component");
        component_group.setImg_name("group");
        component_group.setName("group");
        component_group_list.add(component_group);
        mxGraphComponentVo.setComponent_group(component_group_list);
        return mxGraphComponentVo;
    }

    public static MxGraphComponentVo InitTaskMxGraphComponent() {
        MxGraphComponentVo mxGraphComponentVo = new MxGraphComponentVo();
        mxGraphComponentVo.setAddImagePaletteId("general");
        mxGraphComponentVo.setComponent_prefix("/piflow-web/img/");
        mxGraphComponentVo.setComponent_name("Task");
        List<MxGraphComponentVo.COMPONENT_GROUP> component_group_list = new ArrayList<>();
        MxGraphComponentVo.COMPONENT_GROUP component_group = new MxGraphComponentVo.COMPONENT_GROUP();
        component_group.setImg_type(".png");
        component_group.setDescription("Task component");
        component_group.setImg_name("flow");
        component_group.setName("flow");
        component_group_list.add(component_group);
        mxGraphComponentVo.setComponent_group(component_group_list);
        return mxGraphComponentVo;
    }

    public static MxGraphComponentVo InitTextMxGraphComponent() {
        MxGraphComponentVo mxGraphComponentVo = new MxGraphComponentVo();
        mxGraphComponentVo.setAddImagePaletteId("general");
        mxGraphComponentVo.setComponent_prefix("/piflow-web/img/");
        mxGraphComponentVo.setComponent_name("Text");
        List<MxGraphComponentVo.COMPONENT_GROUP> component_group_list = new ArrayList<>();
        MxGraphComponentVo.COMPONENT_GROUP component_group = new MxGraphComponentVo.COMPONENT_GROUP();
        component_group.setImg_type(".png");
        component_group.setDescription("Text component");
        component_group.setImg_name("text");
        component_group.setName("text");
        component_group_list.add(component_group);
        mxGraphComponentVo.setComponent_group(component_group_list);
        return mxGraphComponentVo;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/service/ICustomizedPropertyService.java<|end_filename|>
package cn.cnic.component.flow.service;

import cn.cnic.component.flow.vo.StopsCustomizedPropertyVo;


public interface ICustomizedPropertyService {

    public String addStopCustomizedProperty(String username, StopsCustomizedPropertyVo stopsCustomizedPropertyVo);

    public String updateStopsCustomizedProperty(String username, StopsCustomizedPropertyVo stopsCustomizedPropertyVo);

    public String deleteStopsCustomizedProperty(String username, String customPropertyId);

    public String deleteRouterStopsCustomizedProperty(String username, String customPropertyId);

    public String getRouterStopsCustomizedProperty(String customPropertyId);

}


<|start_filename|>vue-piflow-web/public/drawingBoard/my_css/publicMacro.css<|end_filename|>
/*===== Top =====*/
.fixed {
    position: fixed;
    height: 48px;
    width: 100%;
    z-index: 1039;
    background: #37714b;
    padding: 0 20px;
    border-bottom: 4px solid gainsboro;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    -ms-box-sizing: border-box;
    box-sizing: border-box;
}

.top-menu {
    border-left: 1px solid #37714b;
    border-right: 1px solid #37714b;
    float: right;
    margin-right: -1px;
}

.top-menu > li {
    list-style: none;
    float: left;
    border-right: 1px solid #37714b;
    position: relative;
}

.top-menu > li > a {
    cursor: pointer;
    display: block;
    border-left: 1px solid #37714b;
    border-right: 1px solid #37714b;
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;

}

.top-menu > li > a:hover {
    background-color: #333;
    border-color: #333;
}

.top-menu > li > ul {
    width: 100%;
    top: 48px;
    left: -1px;
    border-top: 0;
}

.top-menu > li > ul > li > a {
    padding: 8px;
}


.top-menu > li > ul:after {
    content: '';
    display: inline-block;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 5px solid white;
    position: absolute;
    top: -4px;
    left: 50%;
    margin-left: -6px;
}


.user-menu {
    padding: 12px 14px;
    height: 20px;
}

.user-menu > img {
    display: inline-block;
    float: left;
    margin-right: 10px;
    margin-top: -1px;
}

.user-menu > span {
    font-size: 11px;
    margin-left: 32px;
    display: block;
    color: #ffffff;
    font-weight: bold;
    white-space: nowrap;
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/domain/CodeSnippetDomain.java<|end_filename|>
package cn.cnic.component.livy.domain;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Component
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
public class CodeSnippetDomain {

//    @Autowired
//    private CodeSnippetMapper codeSnippetMapper;

}


<|start_filename|>piflow-web/src/main/resources/static/components/load/progressLoading.js<|end_filename|>
(function() {
  $(document).ready(function() {
    return $(".bar").each(function(i, elem) {
      return $(elem).addClass('active');
    });
  });

}).call(this);


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/dashboard/mapper/StatisticMapper.java<|end_filename|>
package cn.cnic.component.dashboard.mapper;

import cn.cnic.component.dashboard.mapper.provider.StatisticProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;
import java.util.Map;

@Mapper
public interface StatisticMapper {

    /**
     * query flow progress statistic info
     *
     * @return statistic info map
     */
    @SelectProvider(type = StatisticProvider.class, method = "getFlowProcessStatisticInfo")
    public List<Map<String, String>>getFlowProcessStatisticInfo();


    /**
     * query flow count
     *
     * @return flowCount
     */
    @SelectProvider(type = StatisticProvider.class, method = "getFlowCount")
    public int getFlowCount();

    /**
     * query group progress statistic info
     *
     * @return statistic info map
     */
    @SelectProvider(type = StatisticProvider.class, method = "getGroupProcessStatisticInfo")
    public List<Map<String, String>>getGroupProcessStatisticInfo();


    /**
     * query group count
     *
     * @return groupCount
     */
    @SelectProvider(type = StatisticProvider.class, method = "getGroupCount")
    public int getGroupCount();


    /**
     * query schedule statistic info
     *
     * @return statistic info map
     */
    @SelectProvider(type = StatisticProvider.class, method = "getScheduleStatisticInfo")
    public List<Map<String, String>>getScheduleStatisticInfo();

    /**
     * query template count
     *
     * @return templateCount
     */
    @SelectProvider(type = StatisticProvider.class, method = "getTemplateCount")
    public int getTemplateCount();

    /**
     * query datasource count
     *
     * @return datasourceCount
     */
    @SelectProvider(type = StatisticProvider.class, method = "getDataSourceCount")
    public int getDataSourceCount();


    /**
     * query stops hub count
     *
     * @return stopsHubCount
     */
    @SelectProvider(type = StatisticProvider.class, method = "getStopsHubCount")
    public int getStopsHubCount();

    /**
     * query stops count
     *
     * @return stopsCount
     */
    @SelectProvider(type = StatisticProvider.class, method = "getStopsCount")
    public int getStopsCount();

    /**
     * query stops group count
     *
     * @return stopsGroupCount
     */
    @SelectProvider(type = StatisticProvider.class, method = "getStopsGroupCount")
    public int getStopsGroupCount();

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/livy/mapper/CodeSnippetMapper.java<|end_filename|>
package cn.cnic.component.livy.mapper;

import cn.cnic.component.livy.entity.CodeSnippet;
import cn.cnic.component.livy.mapper.provider.CodeSnippetMapperProvider;
import cn.cnic.component.livy.vo.CodeSnippetVo;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

@Mapper
public interface CodeSnippetMapper {


    /**
     * add CodeSnippet
     *
     * @param codeSnippet
     * @return Integer
     */
    @InsertProvider(type = CodeSnippetMapperProvider.class, method = "addCodeSnippet")
    public Integer addCodeSnippet(CodeSnippet codeSnippet);

    /**
     * update CodeSnippet
     *
     * @param codeSnippet
     * @return Integer
     */
    @UpdateProvider(type = CodeSnippetMapperProvider.class, method = "updateCodeSnippet")
    public Integer updateCodeSnippet(CodeSnippet codeSnippet);

    /**
     * update CodeSnippet enable_flag
     *
     * @param isAdmin
     * @param username
     * @param id
     * @return Integer
     */
    @UpdateProvider(type = CodeSnippetMapperProvider.class,method = "delCodeSnippetById")
    public Integer delCodeSnippetById(@Param("isAdmin") boolean isAdmin, @Param("username") String username, @Param("id") String id);

    /**
     * get CodeSnippet by id
     *
     * @param id
     * @return CodeSnippet
     */
    @Select("select * from code_snippet where enable_flag=1 and id=#{id} ")
    @Results({
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "FK_NOTE_BOOK_ID", property = "noteBook", one = @One(select = "cn.cnic.component.livy.mapper.NoteBookMapper.adminGetNoteBookById", fetchType = FetchType.LAZY))
    })
    public CodeSnippet getCodeSnippetById(String id);

    /**
     * get CodeSnippet by id, Do not perform related queries
     *
     * @param id
     * @return CodeSnippet
     */
    @Select("select * from code_snippet where enable_flag=1 and id=#{id} ")
    public CodeSnippet getCodeSnippetByIdOnly(String id);

    /**
     * get CodeSnippetVo by id
     *
     * @param id
     * @return CodeSnippetVo
     */
    @Select("select * from code_snippet where enable_flag=1 and id=#{id} ")
    public CodeSnippetVo getCodeSnippetVoById(String id);

    /**
     * search CodeSnippet List
     *
     * @param isAdmin
     * @param username
     * @param param
     * @return
     */
    @SelectProvider(type = CodeSnippetMapperProvider.class,method = "getCodeSnippetList")
    public List<CodeSnippet> getCodeSnippetList(boolean isAdmin, String username, String param);

    /**
     * search CodeSnippetVo List
     *
     * @param isAdmin
     * @param username
     * @param param
     * @return
     */
    @SelectProvider(type = CodeSnippetMapperProvider.class,method = "getCodeSnippetList")
    public List<CodeSnippetVo> getCodeSnippetVoList(boolean isAdmin, String username, String param);

    /**
     * search CodeSnippetVo List
     *
     * @param noteBookId
     * @return
     */
    @SelectProvider(type = CodeSnippetMapperProvider.class,method = "getCodeSnippetListByNoteBookId")
    public List<CodeSnippet> getCodeSnippetListByNoteBookId(String noteBookId);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/utils/StringCustomUtils.java<|end_filename|>
package cn.cnic.base.utils;

import org.apache.commons.lang3.StringUtils;

public class StringCustomUtils {

    private static String EXCLUSIVE_STR = "[PiFlow]";

    public static String replaceSpecialSymbols(String sourceStr, boolean isSaveXml) {
        if (isSaveXml) {
            return replaceSpecialSymbolsXml(sourceStr);
        }
        return replaceSpecialSymbolsPage(sourceStr);
    }

    public static String recoverSpecialSymbols(String sourceStr, boolean isSaveXml) {
        if (isSaveXml) {
            return recoverSpecialSymbolsXml(sourceStr);
        }
        return recoverSpecialSymbolsPage(sourceStr);
    }


    /**
     * Translation of special symbols(< , > , & , " , ')
     *
     * @param sourceStr
     * @return
     */
    public static String replaceSpecialSymbolsXml(String sourceStr) {
        if (StringUtils.isNotBlank(sourceStr)) {
            String translation = sourceStr;
            translation = translation.replace(EXCLUSIVE_STR, EXCLUSIVE_STR + "^_^" + EXCLUSIVE_STR);
            translation = translation.replace("&", EXCLUSIVE_STR + "&amp;" + EXCLUSIVE_STR);
            translation = translation.replace("<", EXCLUSIVE_STR + "&lt;" + EXCLUSIVE_STR);
            translation = translation.replace(">", EXCLUSIVE_STR + "&gt;" + EXCLUSIVE_STR);
            translation = translation.replace("'", EXCLUSIVE_STR + "&apos;" + EXCLUSIVE_STR);
            translation = translation.replace("\"", EXCLUSIVE_STR + "&quot;" + EXCLUSIVE_STR);
            translation = translation.replace("\n", EXCLUSIVE_STR + "&quot;n" + EXCLUSIVE_STR);
            return translation;
        }
        return sourceStr;
    }

    public static String recoverSpecialSymbolsXml(String sourceStr) {
        if (StringUtils.isNotBlank(sourceStr)) {
            String translation = sourceStr;
            translation = translation.replace(EXCLUSIVE_STR + "&amp;" + EXCLUSIVE_STR, "&");
            translation = translation.replace(EXCLUSIVE_STR + "&lt;" + EXCLUSIVE_STR, "<");
            translation = translation.replace(EXCLUSIVE_STR + "&gt;" + EXCLUSIVE_STR, ">");
            translation = translation.replace(EXCLUSIVE_STR + "&apos;" + EXCLUSIVE_STR, "'");
            translation = translation.replace(EXCLUSIVE_STR + "&quot;" + EXCLUSIVE_STR, "\"");
            translation = translation.replace(EXCLUSIVE_STR + "^_^" + EXCLUSIVE_STR, EXCLUSIVE_STR);
            translation = translation.replace(EXCLUSIVE_STR + "&quot;n" + EXCLUSIVE_STR, "\n");
            return translation;
        }
        return sourceStr;
    }

    /**
     * Translation of special symbols(< , > , & , " , ')
     *
     * @param sourceStr
     * @return
     */
    public static String replaceSpecialSymbolsPage(String sourceStr) {
        if (StringUtils.isNotBlank(sourceStr)) {
            String translation = sourceStr;
            translation = translation.replace("&", "&amp;");
            translation = translation.replace("<", "&lt;");
            translation = translation.replace(">", "&gt;");
            translation = translation.replace("'", "&apos;");
            translation = translation.replace("\"", "&quot;");
            return translation;
        }
        return sourceStr;
    }

    public static String recoverSpecialSymbolsPage(String sourceStr) {
        if (StringUtils.isNotBlank(sourceStr)) {
            String translation = sourceStr;
            translation = translation.replace("&amp;", "&");
            translation = translation.replace("&lt;", "<");
            translation = translation.replace("&gt;", ">");
            translation = translation.replace("&apos;", "'");
            translation = translation.replace("&quot;", "\"");
            return translation;
        }
        return sourceStr;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/vo/TestDataVo.java<|end_filename|>
package cn.cnic.component.testData.vo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TestDataVo {

    private String id;
    private String name;
    private String description;
    private Date crtDttm;
    private String crtDttmString;
    private Date lastUpdateDttm;
    private String lastUpdateDttmString;
    private List<TestDataSchemaVo> schemaVoList = new ArrayList<>();

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/vo/DebugDataRequest.java<|end_filename|>
package cn.cnic.component.process.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Setter
@Getter
public class DebugDataRequest implements Serializable {

    private static final long serialVersionUID = 1L;
    
    public DebugDataRequest(String appID, String stopName, String portName, String startFileName, int startLine) {
        this.appID = appID;
        this.stopName = stopName;
        this.portName = portName;
        this.startFileName = startFileName;
        this.startLine = startLine;
    }

    private String appID;
    private String stopName;
    private String portName;
    private String startFileName;
    private int startLine;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/system/service/ISysScheduleService.java<|end_filename|>
package cn.cnic.component.system.service;

import cn.cnic.component.system.vo.SysScheduleVo;
import org.springframework.stereotype.Service;


@Service
public interface ISysScheduleService {

    /**
     * Paging query schedule
     *
     * @param offset Number of pages
     * @param limit  Number of pages per page
     * @param param  search for the keyword
     * @return
     */
    public String getScheduleListPage(String username, boolean isAdmin, Integer offset, Integer limit, String param);

    /**
     * Get schedule by id
     *
     * @param username
     * @param isAdmin
     * @param scheduleId
     * @return
     */
    public String getScheduleById(String username, boolean isAdmin, String scheduleId);

    /**
     * Add SysSchedule
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleVo
     * @return
     */
    public String createJob(String username, boolean isAdmin, SysScheduleVo sysScheduleVo);

    /**
     * Run once timed task
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleId
     * @return
     */
    public String runOnce(String username, boolean isAdmin, String sysScheduleId);

    /**
     * Start timed task
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleId
     * @return
     */
    public String startJob(String username, boolean isAdmin, String sysScheduleId);

    /**
     * Stop timed task
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleId
     * @return
     */
    public String stopJob(String username, boolean isAdmin, String sysScheduleId);

    /**
     * Pause timed task
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleId
     * @return
     */
    public String pauseJob(String username, boolean isAdmin, String sysScheduleId);

    /**
     * Resume timed task
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleId
     * @return
     */
    public String resume(String username, boolean isAdmin, String sysScheduleId);

    /**
     * Update timed task
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleVo
     * @return
     */
    public String update(String username, boolean isAdmin, SysScheduleVo sysScheduleVo);

    /**
     * Delete timed task
     *
     * @param username
     * @param isAdmin
     * @param sysScheduleId
     * @return
     */
    public String deleteTask(String username, boolean isAdmin, String sysScheduleId);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/utils/MxGeometryUtils.java<|end_filename|>
package cn.cnic.component.mxGraph.utils;

import cn.cnic.component.mxGraph.entity.MxGeometry;

import java.util.Date;

public class MxGeometryUtils {

    public static MxGeometry mxGeometryNewNoId(String username) {

        MxGeometry mxGeometry = new MxGeometry();
        // basic properties (required when creating)
        mxGeometry.setCrtDttm(new Date());
        mxGeometry.setCrtUser(username);
        // basic properties
        mxGeometry.setEnableFlag(true);
        mxGeometry.setLastUpdateUser(username);
        mxGeometry.setLastUpdateDttm(new Date());
        mxGeometry.setVersion(0L);
        return mxGeometry;
    }

    public static MxGeometry initMxGeometryBasicPropertiesNoId(MxGeometry mxGeometry, String username) {
        if (null == mxGeometry) {
            return mxGeometryNewNoId(username);
        }
        // basic properties (required when creating)
        mxGeometry.setCrtDttm(new Date());
        mxGeometry.setCrtUser(username);
        // basic properties
        mxGeometry.setEnableFlag(true);
        mxGeometry.setLastUpdateUser(username);
        mxGeometry.setLastUpdateDttm(new Date());
        mxGeometry.setVersion(0L);
        return mxGeometry;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/config/jwt/RestAuthenticationAccessDeniedHandler.java<|end_filename|>
package cn.cnic.base.config.jwt;

import cn.cnic.common.Eunm.ResultCode;
import cn.cnic.base.config.jwt.common.ResultJson;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
* 权限不足处理类，返回403
 */
@Component("RestAuthenticationAccessDeniedHandler")
public class RestAuthenticationAccessDeniedHandler implements AccessDeniedHandler {
    @Override
    public void handle(HttpServletRequest httpServletRequest, HttpServletResponse response, AccessDeniedException e) throws IOException, ServletException {
        //登陆状态下，权限不足执行该方法
        System.out.println("权限不足：" + e.getMessage());
        response.setStatus(200);
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json; charset=utf-8");
        PrintWriter printWriter = response.getWriter();
        String body = ResultJson.failure(ResultCode.FORBIDDEN, e.getMessage()).toString();
        printWriter.write(body);
        printWriter.flush();
    }
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/service/IStopsHubService.java<|end_filename|>
package cn.cnic.component.stopsComponent.service;

import org.springframework.web.multipart.MultipartFile;

public interface IStopsHubService {

    /**
     * Upload jar file and save
     *
     * @param username
     * @param file
     * @return
     */
    public String uploadStopsHubFile(String username, MultipartFile file);

    /**
     * mount stopsHub
     *
     * @param username
     * @param id
     * @return
     */
    public String mountStopsHub(String username, Boolean isAdmin, String id);

    /**
     * unmount stopsHub
     *
     * @param username
     * @param id
     * @return
     */
    public String unmountStopsHub(String username, Boolean isAdmin, String id);

    /**
     * stopsHub list page
     *
     * @param username username
     * @param isAdmin  is admin
     * @param page     Number of pages
     * @param limit    Number each page
     * @param param    Search content
     * @return json
     */
    public String stopsHubListPage(String username, Boolean isAdmin, Integer page, Integer limit, String param);

    /**
     * del stopsHub
     *
     * @param username username
     * @param id       id
     * @return json
     */
    public String delStopsHub(String username, Boolean isAdmin, String id);


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/schedule/ThirdScheduleVo.java<|end_filename|>
package cn.cnic.third.vo.schedule;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

@Setter
@Getter
public class ThirdScheduleVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;
    private String createTime;
    private String cronExpression;
    private String state;
    private String startDate;
    private String endDate;
    private String updateTime;
    private List<ThirdScheduleEntryVo> entryList;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/mxGraph/vo/MxGraphVo.java<|end_filename|>
package cn.cnic.component.mxGraph.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Setter
@Getter
public class MxGraphVo implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private String loadId;

    private List<MxCellVo> mxCellVoList = new ArrayList<>();

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/base/utils/ComparedUtils.java<|end_filename|>
package cn.cnic.base.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.lang.reflect.Field;

public class ComparedUtils {

    private static String CLASS_ONE_VALUE_KEY = "class_one_value_key";
    private static String CLASS_TWO_VALUE_KEY = "class_two_value_key";

    /**
     * Get a list of two objects with the same attribute
     *
     * @param class1 object1
     * @param class2 object2
     * @return
     * @throws ClassNotFoundException
     * @throws IllegalAccessException
     */
    public static List<Map<String, Object>> compareTwoClass(Object class1, Object class2) throws ClassNotFoundException, IllegalAccessException {
        List<Map<String, Object>> list = new ArrayList<>();
        //Get the class of the object
        Class<?> clazz1 = class1.getClass();
        Class<?> clazz2 = class2.getClass();
        //Get the property list of an object
        Field[] field1 = clazz1.getDeclaredFields();
        Field[] field2 = clazz2.getDeclaredFields();
        // field1 to map
        Map<String, Field> field1Map = new HashMap<>();
        if (null != field1 && field1.length > 0) {
            //Traverse the attribute list field1
            for (int i = 0; i < field1.length; i++) {
                field1Map.put(field1[i].getName(), field1[i]);
            }
        }
        if (null != field2 && field2.length > 0) {
            //Traverse the attribute list field2
            for (int j = 0; j < field2.length; j++) {
                if (null == field2[j]) {
                    continue;
                }
                Field field1_i = field1Map.get(field2[j].getName());
                if (null == field1_i) {
                    continue;
                }
                field1_i.setAccessible(true);
                field2[j].setAccessible(true);
                //If the field1_i attribute value is different from the field2 [j] attribute value
                if (!compareTwo(field1_i.get(class1), field2[j].get(class2))) {
                    Map<String, Object> map2 = new HashMap<String, Object>();
                    map2.put("name", field1_i.getName());
                    map2.put(CLASS_ONE_VALUE_KEY, field1_i.get(class1));
                    map2.put(CLASS_TWO_VALUE_KEY, field2[j].get(class2));
                    list.add(map2);
                }
            }
        }
        return list;
    }

    //Compare whether the two data have the same content
    public static boolean compareTwo(Object object1, Object object2) {

        if (object1 == null && object2 == null) {
            return true;
        }
        if (object1 == null && object2 != null) {
            return false;
        }
        if (object1.equals(object2)) {
            return true;
        }
        return false;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/schedule/service/IScheduleService.java<|end_filename|>
package cn.cnic.component.schedule.service;

import cn.cnic.component.schedule.vo.ScheduleVo;

public interface IScheduleService {

    /**
     * Query getScheduleListPage (parameter space-time non-paging)
     *
     * @param isAdmin is admin
     * @param username   username
     * @param offset Number of pages
     * @param limit  Number each page
     * @param param  Search content
     * @return json
     */
    public String getScheduleVoListPage(boolean isAdmin, String username, Integer offset, Integer limit, String param);

    /**
     * Add schedule
     *
     * @param username   username
     * @param scheduleVo scheduleVo
     * @return json
     */
    public String addSchedule(String username, ScheduleVo scheduleVo);

    /**
     * get ScheduleVo by id
     *
     * @param isAdmin is admin
     * @param username username
     * @param id       schedule id
     * @return json
     */
    public String getScheduleVoById(boolean isAdmin, String username, String id);

    /**
     * Update schedule
     *
     * @param isAdmin is admin
     * @param username   username
     * @param scheduleVo scheduleVo
     * @return json
     */
    public String updateSchedule(boolean isAdmin, String username, ScheduleVo scheduleVo);

    /**
     * Delete schedule
     *
     * @param isAdmin is admin
     * @param username username
     * @param id       schedule id
     * @return json
     */
    public String delSchedule(boolean isAdmin, String username, String id);

    /**
     *
     * @param isAdmin is admin
     * @param username username
     * @param id schedule id
     * @return json
     */
    public String startSchedule(boolean isAdmin, String username, String id);

    /**
     *
     * @param isAdmin is admin
     * @param username username
     * @param id schedule id
     * @return json
     */
    public String stopSchedule(boolean isAdmin, String username, String id);

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/template/mapper/provider/FlowGroupTemplateMapperProvider.java<|end_filename|>
package cn.cnic.component.template.mapper.provider;

import cn.cnic.base.utils.SqlUtils;
import org.apache.commons.lang3.StringUtils;

public class FlowGroupTemplateMapperProvider {


    public String getFlowGroupTemplateVoListPage(String username, boolean isAdmin, String param) {
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("select* ");
        strBuf.append("from flow_group_template ");
        strBuf.append("where ");
        strBuf.append("enable_flag = 1 ");
        if (StringUtils.isNotBlank(param)) {
            strBuf.append("and name like CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%') ");
        }
        if (!isAdmin) {
            strBuf.append("and crt_user = " + SqlUtils.preventSQLInjection(username));
        }
        strBuf.append("order by crt_dttm desc ");
        return strBuf.toString();
    }

    public String getFlowGroupTemplateVoById(String username, boolean isAdmin, String id) {
        String sqlStr = "SELECT 0";
        if (StringUtils.isNotBlank(id)) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("select* ");
            strBuf.append("from flow_group_template ");
            strBuf.append("where ");
            strBuf.append("enable_flag = 1 ");
            strBuf.append("and ");
            strBuf.append("id = " + SqlUtils.addSqlStrAndReplace(id) + " ");
            if (!isAdmin) {
                strBuf.append("and crt_user = " + SqlUtils.preventSQLInjection(username));
            }
            sqlStr = strBuf.toString();
        }
        return sqlStr;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/common/Eunm/DrawingBoardType.java<|end_filename|>
package cn.cnic.common.Eunm;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cn.cnic.base.TextureEnumSerializer;

@JsonSerialize(using = TextureEnumSerializer.class)
public enum DrawingBoardType {

    TASK("TASK","Task"),
    GROUP("GROUP","Group"),
    FLOW("FLOW","Flow"),
    PROCESS ("PROCESS","Process");

    private final String value;
    private final String text;

    private DrawingBoardType(String value, String text) {
        this.value = value;
        this.text = text;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public static ProcessParentType selectGender(String name) {
        for (ProcessParentType portType : ProcessParentType.values()) {
            if (name.equalsIgnoreCase(portType.name())) {
                return portType;
            }
        }
        return null;
    }

}


<|start_filename|>piflow-web/src/main/resources/static/my_js/flowGroup/initFlowGroupGraph.js<|end_filename|>
// Extends EditorUi to update I/O action states based on availability of backend
var graphGlobal = null;
var thisEditor = null;
var sign = true;
var flag = 0;
var index = true;
var consumedFlag, removeGroupPaths;

function initFlowGroupDrawingBoardData(loadId, parentAccessPath) {
    $('#fullScreen').show();
    ajaxRequest({
        type: "get",
        url: "/flowGroup/drawingBoardData",
        async: false,
        data: {
            load: loadId,
            parentAccessPath: parentAccessPath
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                parentsId = dataMap.parentsId;
                xmlDate = dataMap.xmlDate;
                maxStopPageId = dataMap.maxStopPageId;
                isExample = dataMap.isExample;
                if (dataMap.mxGraphComponentList) {
                    var mxGraphComponentList = dataMap.mxGraphComponentList;
                    for (var index = 0; index < mxGraphComponentList.length; index++) {
                        var component_prefix = mxGraphComponentList[index].component_prefix
                        if (component_prefix.indexOf("/piflow-web/")>-1) {
                            component_prefix = component_prefix.replace('/piflow-web', sever_base_origin)
                        }
                        mxGraphComponentList[index].component_prefix = component_prefix
                    }
                    Sidebar.prototype.component_data = mxGraphComponentList
                }
            } else {
                window_location_href("/page/error/errorPage.html");
            }
            $('#fullScreen').hide();
        },
        error: function (request) {//Operation after request failure
            window_location_href("/page/error/errorPage.html");
            return;
        }
    });
}

function imageAjax() {
    var loading
    ajaxRequest({
        type: "post",//Request type post
        url: "/mxGraph/nodeImageList",
        data: {imageType: "TASK"},
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            return;
        },
        beforeSend: function () {
            loading = layer.load(0, {
                shade: false,
                success: function (layerContentStyle) {
                    layerContentStyle.find('.layui-layer-content').css({
                        'padding-top': '35px',
                        'text-align': 'left',
                        'width': '120px',
                    });
                },
                icon: 2,
                // time: 100*1000
            });
        },
        success: function (data) {//After the request is successful
            layer.close(loading)
            var nowimage = $("#nowimage")[0];
            nowimage.innerHTML = "";
            var nodeImageList = JSON.parse(data).nodeImageList;
            nodeImageList.forEach(item => {
                var div = document.createElement("div");
                div.className = "imgwrap";
                var image = document.createElement("img");
                image.className = "imageimg"
                image.style = "width:100%;height:100%";
                image.src = item.imageUrl;

                div.appendChild(image);
                nowimage.appendChild(div);
                div.onclick = function (e) {
                    e.stopPropagation();
                    for (var i = 0; i < imgwrap1.length; i++) {
                        imgwrap1[i].style.backgroundColor = "#fff"
                    }
                    e.toElement.style = "background-color:#009688;width:100%;height:100%"
                    imagSrc = e.toElement.src
                }
            })
            var imgwrap1 = $(".imageimg")

        }
    });
}

function updateMxGraphCellImage(cellEditor, selState, newValue, fn) {
    //   Change picture
    layui.use('upload', function () {
        var upload = layui.upload;
        var loading
        //执行实例
        var uploadInst = upload.render({
            elem: '#uploadimage' //绑定元素
            , url: '/piflow-web/mxGraph/uploadNodeImage' //上传接口
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , before: function (obj) {
                this.data = {imageType: "TASK"};
                loading = layer.load(0, {
                    shade: false,
                    success: function (layerContentStyle) {
                        layerContentStyle.find('.layui-layer-content').css({
                            'padding-top': '35px',
                            'text-align': 'left',
                            'width': '120px',
                        });
                    },
                    icon: 2,
                    // time: 100*1000
                });
            }
            , done: function (res) {
                //上传完毕回调
                console.log("upload success")
                imageAjax();
                layer.close(loading);
            }
            , error: function () {
                //请求异常回调
                console.log("upload error")
            }
        });
    });
    layer.open({
        type: 1,
        title: '',
        shadeClose: true,
        shade: 0.3,
        closeBtn: 1,
        shift: 7,
        btn: ['YES', 'NO'],
        area: ['620px', '520px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: $("#changeimage"),
        success: function () {
            imageAjax()
        },
        //YES BUTTON
        btn1: function (index, layero) {
            var newValue = imagSrc;
            imagSrc = null
            EditorUi.prototype.saveImageUpdate(cellEditor, selState, newValue, fn, 66, 66);
            layer.close(index)
            setTimeout(() => {
                saveXml(null, "MOVED")
            }, 300)

        },
        //NO BUTTON
        btn2: function (index, layero) {
            imagSrc = null
            layer.close(index)
        },
        //close function
        cancel: function (index, layero) {
            layer.close(index)
            return false;
        }
    });
}

function initFlowGroupGraph() {
    Format.prototype.isShowTextCell = true;
    Menus.prototype.customRightMenu = ['runAll'];
    Menus.prototype.customCellRightMenu = ['run'];
    EditorUi.prototype.customUpdeteImg = updateMxGraphCellImage;
    Actions.prototype.RunAll = runFlowGroup;
    Actions.prototype.RunCells = RunFlowOrFlowGroupCells;
    EditorUi.prototype.saveGraphData = saveXml;
    Format.hideSidebar(true, true);
    Format.customizeType = "GROUP";
    var editorUiInit = EditorUi.prototype.init;
    $("#right-group-wrap")[0].style.display = "block";

    EditorUi.prototype.init = function () {
        editorUiInit.apply(this, arguments);
        graphGlobal = this.editor.graph;
        thisEditor = this.editor;
        this.actions.get('export').setEnabled(false);
        //Monitoring event
        graphGlobal.addListener(mxEvent.CELLS_ADDED, function (sender, evt) {
            if (isExample) {
                prohibitEditing(evt, 'ADD');
            } else {
                addMxCellOperation(evt);
            }
        });
        graphGlobal.addListener(mxEvent.CELLS_MOVED, function (sender, evt) {
            if (isExample) {
                prohibitEditing(evt, 'MOVED');
            } else {
                movedMxCellOperation(evt);
            }
        });
        graphGlobal.addListener(mxEvent.CELLS_REMOVED, function (sender, evt) {
            if (isExample) {
                prohibitEditing(evt, 'REMOVED');
            } else {
                removeMxCellOperation(evt);
            }
        });

        graphGlobal.addListener(mxEvent.CLICK, function (sender, evt) {
            consumedFlag = evt.consumed ? true : false;
            mxEventClickFunc(evt.properties.cell, consumedFlag);
        });
        graphGlobal.addListener(mxEvent.DOUBLE_CLICK, function (sender, evt) {
            openProcessMonitor(evt);
            if (evt.properties.cell.style && (evt.properties.cell.style).indexOf("text\;") === 0) {
                if (graphGlobal.isEnabled()) {
                    graphGlobal.startEditingAtCell();
                }
            }
        });
        if (xmlDate) {
            var xml = mxUtils.parseXml(xmlDate);
            var node = xml.documentElement;
            var dec = new mxCodec(node.ownerDocument);
            dec.decode(node, graphGlobal.getModel());
            eraseRecord()
        }
    };

    // Adds required resources (disables loading of fallback properties, this can only
    // be used if we know that all keys are defined in the language specific file)
    mxResources.loadDefaultBundle = false;
    var bundle = mxResources.getDefaultBundle(RESOURCE_BASE, mxLanguage) ||
        mxResources.getSpecialBundle(RESOURCE_BASE, mxLanguage);

    // Fixes possible asynchronous requests
    mxUtils.getAll([bundle, STYLE_PATH + '/default.xml'], function (xhr) {
        // Adds bundle text to resources
        mxResources.parse(xhr[0].getText());

        // Configures the default graph theme
        var themes = new Object();
        themes[Graph.prototype.defaultThemeName] = xhr[1].getDocumentElement();

        // Main
        new EditorUi(new Editor(urlParams['chrome'] == '0', themes));
    }, function () {
        document.body.innerHTML = '<center style="margin-top:10%;">Error loading resource files. Please check browser console.</center>';
    });
    EditorUi.prototype.menubarHeight = 48;
    EditorUi.prototype.menubarShow = false;
    EditorUi.prototype.customToobar = true;
    ClickSlider();
}

//mxGraph click event
function mxEventClickFunc(cell, consumedFlag) {
    $("#flowGroup_info_inc_id").hide();
    $("#flowGroup_path_inc_id").hide();
    $("#flowGroup_property_inc_id").hide();
    if (index) {
        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        index = false
    }
    if (!consumedFlag) {
        $("#flowGroup_info_inc_id").show();
        // info
        queryFlowGroupInfo(loadId);
        return;
    }
    var cells_arr = graphGlobal.getSelectionCells();
    if (cells_arr.length !== 1) {
        $("#flowGroup_info_inc_id").show();
        // info
        queryFlowGroupInfo(loadId);
    } else {
        var selectedCell = cells_arr[0]
        if (selectedCell && (selectedCell.edge === 1 || selectedCell.edge)) {
            $("#flowGroup_path_inc_id").show();
            queryPathInfo(selectedCell.id, loadId)
        } else if (selectedCell && selectedCell.style && (selectedCell.style).indexOf("image\;") === 0) {
            $("#flowGroup_property_inc_id").show();
            queryFlowOrFlowGroupProperty(selectedCell.id, loadId);
        } else if (selectedCell && selectedCell.style && (selectedCell.style).indexOf("text\;") === 0) {
            $("#flowGroup_info_inc_id").show();
            // info
            queryFlowGroupInfo(loadId);
        }
    }
}

//Erase drawing board records
function eraseRecord() {
    thisEditor.lastSnapshot = new Date().getTime();
    thisEditor.undoManager.clear();
    thisEditor.ignoredChanges = 0;
    thisEditor.setModified(false);
}

function selectCellByPageId(pageId, isClick) {
    if (!pageId) {
        return;
    }
    var s_cell = graphGlobal.getModel().getCell(pageId);
    graphGlobal.addSelectionCell(s_cell);
    if (isClick) {
        mxEventClickFunc(s_cell, true);
    }
}

//load xml file
function loadXml(loadStr) {
    var xml = mxUtils.parseXml(loadStr);
    var node = xml.documentElement;
    var dec = new mxCodec(node.ownerDocument);
    dec.decode(node, graphGlobal.getModel());
    eraseRecord();
}

// add node
function addMxCellOperation(evt) {
    var cells = evt.properties.cells;

    var cellArrayRemove = [];
    var cellArrayAdd = [];

    cells.forEach(cellFor => {
        if (cellFor && cellFor.edge) {
            var cellForSource = cellFor.source;
            var cellForTarget = cellFor.target;

            if (!cellForSource || !cellForTarget) {
                cellArrayRemove.push(cellFor);
                return;
            }
            if (!cellForSource.style || !cellForTarget.style) {
                cellArrayRemove.push(cellFor);
                return;
            }
            if ((cellForSource.style).indexOf("text\;") === 0 || (cellForTarget.style).indexOf("text\;") === 0) {
                cellArrayRemove.push(cellFor);
                return;
            }
            cellArrayAdd.push(cellFor);
        } else {
            cellArrayAdd.push(cellFor);
        }
    });
    var mxCellArrayAdd = [];
    cellArrayAdd.forEach(cellFor => {
        var mxCellAdd = graphCellToMxCellVo(cellFor);
        if (mxCellAdd) {
            mxCellArrayAdd.push(mxCellAdd);
        }
    });
    graphGlobal.removeCells(cellArrayRemove);
    if (cells.length != cellArrayRemove.length) {
        var time, time1;
        ajaxRequest({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/mxGraph/addMxCellAndData",
            data: JSON.stringify({
                mxCellVoList: mxCellArrayAdd,
                loadId: loadId
            }),
            contentType: 'application/json;charset=utf-8',
            async: true,//Synchronous Asynchronous
            error: function (request) {//Operation after request failure
                layer.msg('Add failed, refresh page after 1 second', {icon: 2, shade: 0, time: 2000}, function () {
                    graphGlobal.removeCells(cellArrayAdd);
                    //window.location.reload();
                });
                return;
            },
            success: function (data) {//After the request is successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    var addNodeIdAndPageIdList = dataMap.addNodeIdAndPageIdList;
                    var flagA = true;
                    if (addNodeIdAndPageIdList && addNodeIdAndPageIdList.length === 1) {
                        var addNodeIdAndPageId = addNodeIdAndPageIdList[0];
                        if ("flow" === addNodeIdAndPageId.type) {
                            openNewFlowWindow(addNodeIdAndPageId.id, addNodeIdAndPageId.pageId);
                        } else if ("flowGroup" === addNodeIdAndPageId.type) {
                            openNewFlowGroupWindow(addNodeIdAndPageId.id, addNodeIdAndPageId.pageId);
                        }
                    }
                    if (flagA && graphGlobal.isEnabled()) {
                        graphGlobal.startEditingAtCell();
                    }
                    thisEditor.setModified(false);
                    console.log("Add save success");
                } else {
                    layer.msg("Add save fail", {icon: 2, shade: 0, time: 2000});
                    console.log("Add save fail");
                    $('#fullScreen').hide();
                }
            }

        });
    }
    if ('cellsAdded' == evt.name) {
        consumedFlag = evt.consumed ? true : false;
        mxEventClickFunc(evt.properties.cell, consumedFlag);
    }
}

// del node
function removeMxCellOperation(evt) {
    saveXml(null, 'REMOVED');
}

// moved node
function movedMxCellOperation(evt) {
    if (evt.properties.disconnect) {
        saveXml(null, 'MOVED');   // preservation method
    }
}

// example operation
function prohibitEditing(evt, operationType) {
    if ('ADD' === operationType || 'REMOVED' === operationType) {
        layer.msg("This is an example, you can't add, edit or delete", {
            icon: 2,
            shade: 0,
            time: 2000
        }, function () {

        });
    } else if ('MOVED' === operationType) {
        consumedFlag = evt.consumed ? true : false;
        mxEventClickFunc(evt, consumedFlag);
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/mxGraph/eraseRecord",
        data: {},
        async: true,
        error: function (request) {//Operation after request failure
            if ('ADD' === operationType || 'REMOVED' === operationType) {
                location.reload();
            }
            eraseRecord();
            return;
        },
        success: function (data) {//After the request is successful
            if ('ADD' === operationType || 'REMOVED' === operationType) {
                location.reload();
            }
            eraseRecord();
        }
    });
}

// cell to mxCellVo
function graphCellToMxCellVo(cellObject) {
    if (cellObject) {
        var mxCellVoObject = {};
        mxCellVoObject.pageId = cellObject.id;
        mxCellVoObject.parent = cellObject.parent.id;
        mxCellVoObject.style = cellObject.style;
        mxCellVoObject.value = cellObject.value;
        mxCellVoObject.vertex = cellObject.vertex;
        mxCellVoObject.edge = cellObject.edge;
        if (cellObject.source) {
            mxCellVoObject.source = cellObject.source.id;
        }
        if (cellObject.target) {
            mxCellVoObject.target = cellObject.target.id;
        }
        mxCellVoObject.mxGeometryVo = {};
        if (cellObject.geometry) {
            mxCellVoObject.mxGeometryVo.as = "geometry";
            mxCellVoObject.mxGeometryVo.x = cellObject.geometry.x;
            mxCellVoObject.mxGeometryVo.y = cellObject.geometry.y;
            mxCellVoObject.mxGeometryVo.width = cellObject.geometry.width;
            mxCellVoObject.mxGeometryVo.height = cellObject.geometry.height;
            mxCellVoObject.mxGeometryVo.relative = cellObject.geometry.relative;
        }
        return mxCellVoObject;
    }
    return;
}

//Double click event
function openProcessMonitor(evt) {
    var cellFor = evt.properties.cell;
    if (cellFor.style && (cellFor.style).indexOf("text\;") === 0) {
    } else {
        ajaxRequest({
            cache: true,
            type: "POST",
            url: "/flowGroup/findFlowByGroup",
            data: {"pageId": cellFor.id, "fId": loadId},
            async: true,
            error: function (request) {
                //alert("Jquery Ajax request error!!!");
                return;
            },
            success: function (data) {
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    if ('flow' === dataMap.nodeType) {
                        var flow_obj = dataMap.flowVo;
                        window_location_href("/page/flow/mxGraph/index.html?drawingBoardType=TASK&parentAccessPath=flowGroupList&load=" + flow_obj.id);
                    } else if ('flowGroup' === dataMap.nodeType) {
                        var flowGroup_obj = dataMap.flowGroupVo;
                        window_location_href("/page/flowGroup/mxGraph/index.html?drawingBoardType=GROUP&parentAccessPath=flowGroupList&load=" + flowGroup_obj.id);
                    }
                } else {
                    console.log(dataMap.errorMsg);
                }
            }
        });
    }
}

//Save XML file and related information
function saveXml(paths, operType) {
    var getXml = thisEditor.getGraphXml();
    var xml_outer_html = getXml.outerHTML;
    var time, time1
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/mxGraph/saveDataForGroup",
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            imageXML: xml_outer_html,
            load: loadId,
            operType: operType
        },
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//After the request is successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                console.log(operType + " save success");
                if (graphGlobal.isEnabled()) {
                    graphGlobal.startEditingAtCell();
                }
                thisEditor.setModified(false);

            } else {
                //alert(operType + " save fail");
                layer.msg(operType + " save fail", {icon: 2, shade: 0, time: 2000});
                console.log(operType + " save fail");
                $('#fullScreen').hide();
            }

        }

    });
}

//Open new Flow window
function openNewFlowWindow(id, pageId) {
    $("#input_node_flow_id").val(id);
    $("#input_node_flow_pageId").val(pageId);
    $("#flowName").val("");
    $("#description").val("");
    $("#driverMemory").val('1g');
    $("#executorNumber").val('1');
    $("#executorMemory").val('1g');
    $("#executorCores").val('1');
    layer.open({
        type: 1,
        title: '<span style="color: #269252;">Create Flow</span>',
        shadeClose: false,
        shade: 0.3,
        closeBtn: 0,
        shift: 7,
        area: ['580px', '520px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: $("#flow_SubmitPage")
    });
}

//Open new FlowGroup window
function openNewFlowGroupWindow(id, pageId) {
    $("#input_node_flowGroup_id").val(id);
    $("#input_node_flowGroup_pageId").val(pageId);
    $("#flowGroupName").val("");
    $("#flowGroup_description").val("");
    layer.open({
        type: 1,
        title: '<span style="color: #269252;">create flow group</span>',
        shadeClose: false,
        shade: 0.3,
        closeBtn: 0,
        shift: 7,
        area: ['580px', '520px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: $("#flowGroup_SubmitPage")
    });
}

//Query FlowGroup info
function queryFlowGroupInfo(loadId) {
    $("#flowGroup_info_inc_loading").show();
    $("#flowGroup_info_inc_load_fail").hide();
    $("#flowGroup_info_inc_no_data").hide();
    $("#flowGroup_info_inc_load_data").hide();
    ajaxRequest({
        data: {"load": loadId},
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/flowGroup/queryFlowGroupData",
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            $("#flowGroup_info_inc_loading").hide();
            $("#flowGroup_info_inc_load_fail").show();
            return;
        },
        success: function (data) {//After the request is successful
            $("#flowGroup_info_inc_loading").hide();
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var flowGroupVo = dataMap.flowGroupVo;
                if (flowGroupVo) {
                    $("#span_flowGroupVo_id").text(flowGroupVo.id ? flowGroupVo.id : "No content");
                    $("#span_flowGroupVo_name").text(flowGroupVo.name ? flowGroupVo.name : "No content");
                    $("#span_flowGroupVo_description").text(flowGroupVo.description ? flowGroupVo.description : "No content");
                    $("#span_flowGroupVo_crtDttmStr").text(flowGroupVo.crtDttmString ? flowGroupVo.crtDttmString : "No content");
                    $("#span_flowGroupVo_flowsCounts").text(flowGroupVo.flowVoList ? flowGroupVo.flowVoList.length : "0");
                    $("#flowGroup_info_inc_load_data").show();
                } else {
                    $("#flowGroup_info_inc_no_data").show();
                }
            } else {
                $("#flowGroup_info_inc_load_fail").show();
            }
        }
    });
}

//Query Path info
function queryPathInfo(id, loadId) {
    $('#flowGroup_path_inc_loading').show();
    $('#flowGroup_path_inc_load_data').hide();
    $('#flowGroup_path_inc_no_data').hide();
    $('#flowGroup_path_inc_load_fail').hide();
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/flowGroupPath/queryPathInfoFlowGroup",
        data: {"id": id, "fid": loadId},
        async: true,
        error: function (request) {
            //alert("Jquery Ajax request error!!!");
            $('#flowGroup_path_inc_load_fail').show();
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            console.log(dataMap);
            $('#flowGroup_path_inc_loading').hide();
            if (200 === dataMap.code) {
                //var queryInfo = dataMap.queryInfo;
                var queryInfo = dataMap.queryInfo;
                if (queryInfo) {
                    var flowGroupVo = queryInfo.flowGroupVo;
                    var flowGroupVo_name = flowGroupVo ? flowGroupVo.name : '';
                    $("#span_flowGroupPathVo_flowName").text(flowGroupVo_name);
                    $("#span_flowGroupPathVo_pageId").text(queryInfo.pageId);
                    $("#span_flowGroupPathVo_inport").text(queryInfo.inport);
                    $("#span_flowGroupPathVo_outport").text(queryInfo.outport);
                    $("#span_flowGroupPathVo_from").text(queryInfo.flowFrom);
                    $("#span_flowGroupPathVo_to").text(queryInfo.flowTo);
                    $("#span_flowGroupPathVo_crtDttmStr").text(queryInfo.crtDttmString);
                    $('#flowGroup_path_inc_load_data').show();
                } else {
                    $('#flowGroup_path_inc_no_data').show();
                }
            } else {
                $('#flowGroup_path_inc_load_fail').show();
                console.log("Path attribute query null");
            }
        }
    });
}

// Query Flow or FlowGroup property
function queryFlowOrFlowGroupProperty(pageId, loadId) {
    $('#cell_flowGroup_property_inc_loading').show();
    $('#cell_flowGroup_property_inc_load_fail').hide();
    $('#cell_flowGroup_property_inc_no_data').hide();
    $('#cell_flowGroup_property_inc_load_data').hide();
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/flowGroup/queryIdInfo",
        data: {"fId": loadId, "pageId": pageId},
        async: true,
        error: function (request) {
            $('#cell_flowGroup_property_inc_loading').hide();
            $('#cell_flowGroup_property_inc_load_fail').show();
            return;
        },
        success: function (data) {
            $('#cell_flowGroup_property_inc_loading').hide();
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var nodeType = dataMap.nodeType;
                if ("flowGroup" === nodeType) {
                    var flowGroupVo = dataMap.flowGroupVo;
                    $("#div_cell_flowVo_basicInfo_id").hide();
                    $("#div_cell_flowVo_attributeInfo_id").hide();
                    $("#div_cell_flowGroupVo_basicInfo_id").show();
                    $("#div_cell_flowGroupVo_attributeInfo_id").show();

                    // ----------------------- cell flowGroup baseInfo start -----------------------
                    $("#tr_cell_flowGroupVo_name_info").show();
                    $("#tr_cell_flowGroupVo_name_input").hide()
                    $('#input_cell_flowGroupVo_id').val(flowGroupVo.id);
                    $('#input_cell_flowGroupVo_pageId').val(flowGroupVo.pageId);
                    $('#span_cell_flowGroupVo_name').text(flowGroupVo.name);
                    $('#span_cell_flowGroupVo_description').text(flowGroupVo.description);
                    $('#span_cell_flowGroupVo_crtDttmString').text(flowGroupVo.crtDttmString);
                    $('#span_cell_flowGroupVo_flowQuantity').text(flowGroupVo.flowQuantity);
                    $('#span_cell_flowGroupVo_flowGroupQuantity').text(flowGroupVo.flowGroupQuantity);

                    if (isExample) {
                        $('#btn_show_update_group').hide();
                    }
                    // ----------------------- cell flowGroup baseInfo end   -----------------------

                    // ----------------------- cell flowGroup AttributeInfo start -----------------------
                    $('#input_cell_flowGroupVo_description').val(flowGroupVo.description);
                    $('#input_cell_flowGroupVo_description').attr("name", "description");
                    $('#input_cell_flowGroupVo_description').attr("onclick", "openUpdateCellsProperty(this ,'flowGroup')");
                    // ----------------------- cell flowGroup AttributeInfo end -----------------------

                    $('#cell_flowGroup_property_inc_load_data').show();
                } else if ("flow" === nodeType) {
                    var flowVo = dataMap.flowVo;
                    $("#div_cell_flowGroupVo_basicInfo_id").hide();
                    $("#div_cell_flowGroupVo_attributeInfo_id").hide();
                    $("#div_cell_flowVo_basicInfo_id").show();
                    $("#div_cell_flowVo_attributeInfo_id").show();

                    // ----------------------- cell flow baseInfo start -----------------------
                    $("#tr_cell_flowVo_name_info").show();
                    $("#tr_cell_flowVo_name_input").hide();
                    $('#input_cell_flowVo_id').val(flowVo.id);
                    $('#input_cell_flowVo_pageId').val(flowVo.pageId);
                    $('#span_cell_flowVo_name').text(flowVo.name);
                    $('#span_cell_flowVo_description').text(flowVo.description);
                    $('#span_cell_flowVo_driverMemory').text(flowVo.driverMemory);
                    $('#span_cell_flowVo_executorCores').text(flowVo.executorCores);
                    $('#span_cell_flowVo_executorMemory').text(flowVo.executorMemory);
                    $('#span_cell_flowVo_executorNumber').text(flowVo.executorNumber);
                    $('#span_cell_flowVo_crtDttmString').text(flowVo.crtDttmString);
                    $('#span_cell_flowVo_stopQuantity').text(flowVo.stopQuantity);
                    if (isExample) {
                        $('#btn_show_update').hide();
                    }
                    // ----------------------- cell flow baseInfo end   -----------------------

                    // ----------------------- cell flow AttributeInfo start -----------------------
                    $('#input_cell_flowVo_description').val(flowVo.description);
                    $('#input_cell_flowVo_description').attr("name", "description");
                    $('#input_cell_flowVo_description').attr("onclick", "openUpdateCellsProperty(this ,'flow')");
                    $('#input_cell_flowVo_driverMemory').val(flowVo.driverMemory);
                    $('#input_cell_flowVo_driverMemory').attr("name", "driverMemory");
                    $('#input_cell_flowVo_driverMemory').attr("onclick", "openUpdateCellsProperty(this ,'flow')");
                    $('#input_cell_flowVo_executorCores').val(flowVo.executorCores);
                    $('#input_cell_flowVo_executorCores').attr("name", "executorCores");
                    $('#input_cell_flowVo_executorCores').attr("onclick", "openUpdateCellsProperty(this ,'flow')");
                    $('#input_cell_flowVo_executorMemory').val(flowVo.executorMemory);
                    $('#input_cell_flowVo_executorMemory').attr("name", "executorMemory");
                    $('#input_cell_flowVo_executorMemory').attr("onclick", "openUpdateCellsProperty(this ,'flow')");
                    $('#input_cell_flowVo_executorNumber').val(flowVo.executorNumber);
                    $('#input_cell_flowVo_executorNumber').attr("name", "executorNumber");
                    $('#input_cell_flowVo_executorNumber').attr("onclick", "openUpdateCellsProperty(this ,'flow')");
                    // ----------------------- cell flow AttributeInfo end   -----------------------
                    $('#cell_flowGroup_property_inc_load_data').show();
                } else {
                    $('#cell_flowGroup_property_inc_no_data').show();
                }
            } else {
                $('#cell_flowGroup_property_inc_load_fail').show();
            }
        }
    });
}

//get Flow list
function getFlowList() {
    var window_width = $(window).width();//Get browser window width
    var window_height = $(window).height();//Get browser window height
    openLayerTypeIframeWindowLoadUrl("/page/flow/getFlowListImport.html", (window_width / 2), (window_height - 100), "Flows");
}

// ClickSlider
function ClickSlider() {
    $(".triggerSlider").click(function () {
        var flag = ($(".triggerSlider i:first").hasClass("fa fa-angle-right fa-2x"));
        if (flag === false)
            $(".triggerSlider i").removeClass("fa fa-angle-left fa-2x ").toggleClass("fa fa-angle-right fa-2x");
        else
            $(".triggerSlider i").removeClass("fa fa-angle-right fa-2x").toggleClass("fa fa-angle-left fa-2x");

        $(".right-group").toggleClass("open-right");
        $(".ExpandSidebar").toggleClass("ExpandSidebar-open");
        $(this).toggleClass("triggerSlider-open");
        index = !index
    });
}

function updateFlowGroupCellsNameById(selectNodesType) {
    if ('flow' === selectNodesType && $("#input_cell_flowVo_name").val() === $("#span_cell_flowVo_name").text()) {
        isShowUpdateCellsName(false, selectNodesType);
        return;
    }
    if ('flowGroup' === selectNodesType && $("#input_cell_flowGroupVo_name").val() === $("#span_cell_flowGroupVo_name").text()) {
        isShowUpdateCellsName(false, selectNodesType);
        return;
    }
    var requestDataParam = {
        parentId: loadId,
        updateType: selectNodesType
    };
    if ('flow' === selectNodesType) {
        requestDataParam.currentNodeId = $("#input_cell_flowVo_id").val();
        requestDataParam.currentNodePageId = $("#input_cell_flowVo_pageId").val();
        requestDataParam.name = $("#input_cell_flowVo_name").val();
    } else if ('flowGroup' === selectNodesType) {
        requestDataParam.currentNodeId = $("#input_cell_flowGroupVo_id").val();
        requestDataParam.currentNodePageId = $("#input_cell_flowGroupVo_pageId").val();
        requestDataParam.name = $("#input_cell_flowGroupVo_name").val();
    }
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/flowGroup/updateFlowNameById",
        data: requestDataParam,
        async: true,
        traditional: true,
        error: function (request) {
            console.log("attribute update error");
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            console.log(dataMap);
            if (200 === dataMap.code) {
                //reload xml
                loadXml(dataMap.XmlData);

                selectCellByPageId(requestDataParam.currentNodePageId, false);
                layer.msg("attribute update success", {icon: 1, shade: 0, time: 2000}, function () {
                });
                if ('flow' === selectNodesType) {
                    $("#span_cell_flowVo_name").text(dataMap.nameContent);
                } else if ('flowGroup' === selectNodesType) {
                    $("#span_cell_flowGroupVo_name").text(dataMap.nameContent);
                }
                isShowUpdateCellsName(false, selectNodesType);
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
}

//update stops name button
function isShowUpdateCellsName(flag, selectNodesType) {
    if (selectNodesType && 'flow' === selectNodesType) {
        if (flag) {
            $("#input_cell_flowVo_name").val($("#span_cell_flowVo_name").text());
            $("#tr_cell_flowVo_name_info").hide();
            $("#tr_cell_flowVo_name_input").show();
        } else {
            $("#tr_cell_flowVo_name_info").show();
            $("#tr_cell_flowVo_name_input").hide();
        }
    } else if (selectNodesType && 'flowGroup' === selectNodesType) {
        if (flag) {
            $("#input_cell_flowGroupVo_name").val($("#span_cell_flowGroupVo_name").text());
            $("#tr_cell_flowGroupVo_name_info").hide();
            $("#tr_cell_flowGroupVo_name_input").show();
        } else {
            $("#tr_cell_flowGroupVo_name_info").show();
            $("#tr_cell_flowGroupVo_name_input").hide();
        }
    }
}

//Open update cells property
function openUpdateCellsProperty(e, selectNodesType) {
    var updateCellsPropertyTemplateClone = $("#updateCellsPropertyTemplate").clone();
    updateCellsPropertyTemplateClone.find("#cellsValue").attr("id", "cellsPropertyValue");
    updateCellsPropertyTemplateClone.find("#buttonCells").attr("id", "cellsPropertyValueBtn");
    var locked = e.getAttribute('locked');
    if (isExample || 'true' == locked) {
        updateCellsPropertyTemplateClone.find("#cellsPropertyValue").attr("disabled", "disabled");
        updateCellsPropertyTemplateClone.find("#cellsPropertyValueBtn").hide();
    }
    updateCellsPropertyTemplateClone.find("#cellsPropertyValue").css("background-color", "");
    updateCellsPropertyTemplateClone.find("#cellsPropertyValue").attr('name', e.name);
    updateCellsPropertyTemplateClone.find("#cellsPropertyValue").text(e.value);

    if ("flowGroup" === selectNodesType) {
        var flowId = $("#input_cell_flowGroupVo_id").val();
        updateCellsPropertyTemplateClone.find("#cellsPropertyValueBtn").attr("onclick", ("updateFlowGroupAttributes('" + flowId + "','" + e.id + "','cellsPropertyValue',this);"));
    } else {
        var flowGroupId = $("#input_cell_flowVo_id").val();
        updateCellsPropertyTemplateClone.find("#cellsPropertyValueBtn").attr("onclick", ("updateFlowAttributes('" + flowGroupId + "','" + e.id + "','cellsPropertyValue',this)"));
    }
    var p = $(e).offset();
    var openWindowCoordinate = [(p.top + 34) + 'px', (document.body.clientWidth - 300) + 'px'];
    console.log(openWindowCoordinate);
    layer.open({
        type: 1,
        title: e.name,
        shadeClose: true,
        closeBtn: 0,
        shift: 7,
        anim: 5,//Pop up from top
        shade: 0.1,
        resize: true,//No stretching
        //move: false,//No dragging
        offset: openWindowCoordinate,//coordinate
        area: ['290px', '204px'], //Width Height
        content: updateCellsPropertyTemplateClone.html()
    });
    $("#cellsValue").focus();
    $("#cellsPropertyValue").focus();
}

// Update Flow attributes
function updateFlowAttributes(flowId, propertyId, updateContentId, e) {
    var p = $(e).offset();
    var content = document.getElementById(updateContentId).value;
    if (!content) {
        $("#" + updateContentId + "").css("background-color", "#FFD39B");
        $("#" + updateContentId + "").focus();
        return;
    }
    $('#' + propertyId).val(content);
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/flow/updateFlowBaseInfo",
        data: {
            "id": flowId,
            "description": $('#input_cell_flowVo_description').val(),
            "driverMemory": $('#input_cell_flowVo_driverMemory').val(),
            "executorCores": $('#input_cell_flowVo_executorCores').val(),
            "executorMemory": $('#input_cell_flowVo_executorMemory').val(),
            "executorNumber": $('#input_cell_flowVo_executorNumber').val()

        },
        async: true,
        traditional: true,
        error: function (request) {
            console.log("attribute update error");
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg('success', {
                    icon: 1,
                    shade: 0,
                    time: 2000,
                    offset: ['' + p.top - 30 + 'px', '' + p.left + 50 + 'px']
                }, function () {
                });
                var flowVo = dataMap.flowVo;
                $('#input_cell_flowVo_description').val(flowVo.description)
                $('#input_cell_flowVo_driverMemory').val(flowVo.driverMemory);
                $('#input_cell_flowVo_executorCores').val(flowVo.executorCores);
                $('#input_cell_flowVo_executorMemory').val(flowVo.executorMemory);
                $('#input_cell_flowVo_executorNumber').val(flowVo.executorNumber);
                //baseInfo
                $('#span_cell_flowVo_description').text(flowVo.description);
                $('#span_cell_flowVo_driverMemory').text(flowVo.driverMemory);
                $('#span_cell_flowVo_executorCores').text(flowVo.executorCores);
                $('#span_cell_flowVo_executorMemory').text(flowVo.executorMemory);
                $('#span_cell_flowVo_executorNumber').text(flowVo.executorNumber);
            } else {
                layer.msg('', {icon: 2, shade: 0, time: 2000});
            }
            layer.closeAll('page');
            console.log("attribute update success");
        }
    });
}

// Update FlowGroup attributes
function updateFlowGroupAttributes(flowGroupId, propertyId, updateContentId, e) {
    var p = $(e).offset();
    var content = document.getElementById(updateContentId).value;
    if (!content) {
        $("#" + updateContentId + "").css("background-color", "#FFD39B");
        $("#" + updateContentId + "").focus();
        return;
    }
    $('#' + propertyId).val(content);
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/flowGroup/updateFlowGroupBaseInfo",
        data: {
            "id": flowGroupId,
            "description": $("#input_cell_flowGroupVo_description").val()
        },
        async: true,
        traditional: true,
        error: function (request) {
            console.log("attribute update error");
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg('success', {
                    icon: 1,
                    shade: 0,
                    time: 2000,
                    offset: ['' + p.top - 30 + 'px', '' + p.left + 50 + 'px']
                }, function () {
                });
                var flowGroupVo = dataMap.flowGroupVo;
                $("#input_cell_flowGroupVo_description").val(flowGroupVo.description)
                //baseInfo
                $("#span_cell_flowGroupVo_description").text(flowGroupVo.description);
            } else {
                layer.msg('', {icon: 2, shade: 0, time: 2000});
            }
            layer.closeAll('page');
            console.log("attribute update success");
        }
    });
}

// check flow required
function checkFlowInput(flowName, description, driverMemory, executorNumber, executorMemory, executorCores) {
    if (flowName == '') {
        layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('flowName').focus();
        return false;
    }

    /*  if (description == '') {
         layer.msg('description不能为空！', {icon: 2, shade: 0, time: 2000});
         document.getElementById('description').focus();
         return false;
     } */
    if (driverMemory == '') {
        layer.msg('driverMemory Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('driverMemory').focus();
        return false;
    }
    if (executorNumber == '') {
        layer.msg('executorNumber Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('executorNumber').focus();
        return false;
    }
    if (executorMemory == '') {
        layer.msg('executorMemory Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('executorMemory').focus();
        return false;
    }
    if (executorCores == '') {
        layer.msg('executorCores Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('executorCores').focus();
        return false;
    }
    return true;
}

//flow Information popup-----
function saveFlow() {
    var currentId = $("#input_node_flow_id").val();
    var currentPageId = $("#input_node_flow_pageId").val();
    if (!currentId && !currentPageId) {
        //alert("Please click the close button and drag it again to create");
        layer.msg('Please click the close button and drag it again to create', {icon: 2, shade: 0, time: 2000});
        return
    }
    var flowName = $("#flowName").val();
    var description = $("#description").val();
    var driverMemory = $("#driverMemory").val();
    var executorNumber = $("#executorNumber").val();
    var executorMemory = $("#executorMemory").val();
    var executorCores = $("#executorCores").val();
    if (!checkFlowInput(flowName, description, driverMemory, executorNumber, executorMemory, executorCores)) {
        // layer.closeAll()
        // alert("flowName Can not be empty")
        layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        return;
    }
    ajaxRequest({
        cache: true,
        type: "POST",
        url: "/flow/updateFlowBaseInfo",
        data: {
            fId: loadId,
            id: currentId,
            pageId: currentPageId,
            name: flowName,
            driverMemory: driverMemory,
            executorCores: executorCores,
            executorMemory: executorMemory,
            executorNumber: executorNumber,
            description: description
        },
        async: true,
        traditional: true,
        error: function (request) {
            console.log("attribute update error");
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                $("#input_node_flow_id").val("");
                $("#input_node_flow_pageId").val("");

                //reload xml
                var xml = mxUtils.parseXml(dataMap.XmlData);
                loadXml(dataMap.XmlData);
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    selectCellByPageId(currentPageId, true);
                    queryFlowOrFlowGroupProperty(currentPageId, loadId);
                    layer.closeAll();
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    });
};

//cancel Flow
function cancelFlow() {
    $("#input_node_flow_id").val("");
    $("#input_node_pageId").val("");
    graphGlobal.removeCells(removeGroupPaths);
    layer.closeAll()
}

// check flowGroup required
function checkGroupInput(flowName) {
    if (flowName == '') {
        layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        document.getElementById('flowName').focus();
        return false;
    }
    /*  if (description == '') {
         layer.msg('description不能为空！', {icon: 2, shade: 0, time: 2000});
         document.getElementById('description').focus();
         return false;
     } */
    return true;
};

//flowGroup Information popup-----
function saveOrUpdateFlowGroup() {
    var currentId = $("#input_node_flowGroup_id").val();
    var currentPageId = $("#input_node_flowGroup_pageId").val();
    if (!currentId && !currentPageId) {
        //alert("Please click the close button and drag it again to create");
        layer.msg('Please click the close button and drag it again to create', {icon: 2, shade: 0, time: 2000});
        return;
    }
    var flowGroupName = $("#flowGroupName").val();
    var description = $("#flowGroup_description").val();
    if (!checkGroupInput(flowGroupName)) {
        layer.msg('flowName Can not be empty', {icon: 2, shade: 0, time: 2000});
        return;
    } else {
        ajaxRequest({
            cache: true,
            type: "POST",
            url: "/flowGroup/updateFlowGroupBaseInfo",
            data: {
                fId: loadId,
                id: currentId,
                pageId: currentPageId,
                description: description,
                name: flowGroupName
            },
            async: true,
            traditional: true,
            error: function (request) {
                layer.msg('request error ', {icon: 2, shade: 0, time: 2000});
                return;
            },
            success: function (data) {
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    $("#input_node_flowGroup_id").val("");
                    $("#input_node_flowGroup_pageId").val("");

                    //reload xml
                    var xml = mxUtils.parseXml(dataMap.XmlData);
                    loadXml(dataMap.XmlData);
                    layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                        selectCellByPageId(currentPageId, true);
                        queryFlowOrFlowGroupProperty(currentPageId, loadId);
                        layer.closeAll();
                    });
                } else {
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                }
                //console.log("attribute update success");
            }
        });

    }

}

//cancel Group
function cancelGroup() {
    graphGlobal.removeCells(removeGroupPaths);
    layer.closeAll()
}

// save template
function saveTemplateFun() {
    var getXml = thisEditor.getGraphXml();
    var xml_outer_html = getXml.outerHTML;
    layer.prompt({
        title: 'please enter the template name',
        formType: 0,
        btn: ['submit', 'cancel']
    }, function (text, index) {
        layer.close(index);
        ajaxRequest({
            cache: true,//Keep cached data
            type: "POST",//Request type post
            url: "/flowTemplate/saveFlowTemplate",
            data: {
                value: xml_outer_html,
                load: loadId,
                name: text,
                templateType: "GROUP"
            },
            async: true,
            error: function (request) {//Operation after request failure
                console.log(" save template error");
                return;
            },
            success: function (data) {//After the request is successful
                var dataMap = JSON.parse(data);
                if (200 === dataMap.code) {
                    layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    });
                } else {
                    layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                }
            }
        });
    });
}

// upload template
function uploadFlowGroupTemplateBtn() {
    document.getElementById("flowTemplateFile").click();
}

// upload template
function uploadTemplateFile(element) {
    if (!FileTypeCheck(element)) {
        return false;
    }
    if (url) {
        return false;
    }
    var formData = new FormData($('#uploadForm')[0]);
    ajaxRequest({
        type: 'post',
        url: '/flowTemplate/uploadXmlFile',
        data: formData,
        cache: false,
        processData: false,
        contentType: false,
    }).success(function (data) {
        var dataMap = JSON.parse(data);
        if (200 === dataMap.code) {
            layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
            });
        } else {
            layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
        }
    }).error(function () {
        layer.msg("Upload failure", {icon: 2, shade: 0, time: 2000});
    });
}

// check file type
function FileTypeCheck(element) {
    if (element.value == null || element.value == '') {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    var length = element.value.length;
    var charindex = element.value.lastIndexOf(".");
    var ExtentName = element.value.substring(charindex, charindex + 4);
    if (!(ExtentName == ".xml")) {
        layer.msg('please upload the XML file', {icon: 2, shade: 0, time: 2000});
        this.focus()
        return false;
    }
    return true;
}

function loadingXml(id, loadId) {
    var loadType = Format.customizeType;
    $('#fullScreen').show();
    ajaxRequest({
        type: 'post',
        data: {
            templateId: id,
            loadType: loadType,
            load: loadId
        },
        async: true,
        url: "/flowTemplate/loadingXmlPage",
    }).success(function (data) {
        var dataMap = JSON.parse(data);
        var icon_code = 2;
        if (200 === dataMap.code) {
            icon_code = 1;
        }
        $('#fullScreen').hide();
        layer.msg(dataMap.errorMsg, {icon: icon_code, shade: 0.7, time: 2000}, function () {
            window.location.reload();
        });
    }).error(function () {
        $('#fullScreen').hide();
    });
}

// open template list
function openTemplateList() {
    console.log("openTemplateListopenTemplateListopenTemplateListopenTemplateListopenTemplateListopenTemplateListopenTemplateList");
    if (isExample) {
        layer.msg('This is an example, you can\'t edit', {icon: 2, shade: 0, time: 2000});
        return;
    }
    var url = "";
    var functionNameStr = "";
    if ('TASK' !== Format.customizeType && 'GROUP' !== Format.customizeType) {
        return;
    }
    ajaxRequest({
        url: "/flowTemplate/flowTemplateList",
        type: "post",
        async: false,
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var temPlateList = dataMap.temPlateList;
                var showSelectDivHtml = '<div style="width: 100%;height: 146px;position: relative;">';
                var showOptionHtml = '';
                for (var i = 0; i < temPlateList.length; i++) {
                    showOptionHtml += ("<option value=" + temPlateList[i].id + " >" + temPlateList[i].name + "</option>");
                }
                var showSelectHtml = 'There is no template, please create';
                var loadTemplateBtn = '';
                if (showOptionHtml) {
                    showSelectHtml = ('<div style="width: 100%;text-align: center;">'
                        + '<select name="loadingXmlSelect" id="loadingXmlSelectNew" style="width: 80%;margin-top: 15px;">'
                        + '<option value=\'-1\' >------------please choose------------</option>'
                        + showOptionHtml
                        + '</select>'
                        + '</div>');
                    loadTemplateBtn = '<div style="position: absolute;bottom: 12px;right: 10px;">'
                        + '<input type="button" class="btn" value="Submit" onclick="loadTemplateFun()"/>'
                        + '</div>';
                }
                showSelectDivHtml += (showSelectHtml + loadTemplateBtn + '</div>');
                layer.open({
                    type: 1,
                    title: '<span style="color: #269252;">Please choose</span>',
                    shadeClose: false,
                    resize: false,
                    closeBtn: 1,
                    shift: 7,
                    area: ['500px', '200px'], //Width height
                    skin: 'layui-layer-rim', //Add borders
                    content: showSelectDivHtml
                });
            } else {
                layer.msg("No template, please create", {time: 2000});
            }
        }
    });
}

// load template
function loadTemplateFun() {
    var id = $("#loadingXmlSelectNew").val();
    if (id == '-1') {
        layer.msg('Please choose template', {icon: 2, shade: 0, time: 2000});
        return;
    }

    var name = $("#loadingXmlSelect option:selected").text();
    layer.open({
        title: 'LoadTemplate',
        content: 'Are you sure you want to load ' + name + '？',
        btn: ['submit', 'cancel'],
        yes: function (index, layero) {
            loadingXml(id, loadId);
            var oDiv = document.getElementById("divloadingXml");
            oDiv.style.display = "none";
        },
        btn2: function (index, layero) {
            var oDiv = document.getElementById("divloadingXml");
            oDiv.style.display = "none";
        }, cancel: function () {
            var oDiv = document.getElementById("divloadingXml");
            oDiv.style.display = "none";
        }
    });
}

// run cells
function RunFlowOrFlowGroupCells(includeEdges) {
    $('#fullScreen').show();
    var cells = graphGlobal.getSelectionCells();
    if (cells != null && cells.length > 1) {
        layer.msg('Multiple runs cannot be selected at the same time', {icon: 2, shade: 0, time: 2000});
        return;
    }
    ajaxRequest({
        type: "post",//Request type post
        url: "/mxGraph/groupRightRun",
        data: {pId: loadId, nodeId: cells[0].id},
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            layer.msg("Startup failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//After the request is successful
            $('#fullScreen').hide();
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    //Jump to the monitor page after starting successfully
                    if (dataMap.processGroupId) {
                        new_window_open("/page/processGroup/mxGraph/index.html?drawingBoardType=PROCESS&processType=PROCESS_GROUP&load=" + dataMap.processGroupId);
                    } else if (dataMap.processId) {
                        new_window_open("/page/process/mxGraph/index.html?drawingBoardType=PROCESS&processType=PROCESS&load=" + dataMap.processId);
                    }
                });
            } else {
                layer.msg("Startup failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
        }
    })
}

//run flowGroup
function runFlowGroup(runMode) {
    $('#fullScreen').show();
    var data = {flowGroupId: loadId}
    if (runMode) {
        data.runMode = runMode;
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/flowGroup/runFlowGroup",
        //data:$('#loginForm').serialize(),//Serialize the form
        data: data,
        async: true,//Synchronous Asynchronous
        error: function (request) {//Operation after request failure
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000}, function () {
                $('#fullScreen').hide();
            });

            return;
        },
        success: function (data) {//After the request is successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    //Jump to the monitoring page after starting successfully
                    new_window_open("/page/process/mxGraph/index.html?drawingBoardType=PROCESS&processType=PROCESS_GROUP&load=" + dataMap.processGroupId, '_blank');
                });
            } else {
                layer.msg("Startup failure：" + dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
            }
            $('#fullScreen').hide();
        }
    });
}



<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/vo/StopsCustomizedPropertyVo.java<|end_filename|>

package cn.cnic.component.flow.vo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * stop property
 */
@Getter
@Setter
public class StopsCustomizedPropertyVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;
    private String name;
    private String customValue;
    private String description;
    private String stopId;
}


<|start_filename|>vue-piflow-web/public/drawingBoard/my_js/datasource/dataSourceList.js<|end_filename|>
var newDatasourceWindow, openDatasourceId;

function initDataTablePage(testTableId, url, searchInputId) {
    var table = "";
    layui.use('table', function () {
        table = layui.table;

        //Method-level rendering
        table.render({
            elem: '#' + testTableId
            , url: (web_header_prefix + url)
            , headers: {
                Authorization: ("Bearer " + token)
            }
            , cols: [[
                {field: 'dataSourceName', title: 'Name', sort: true},
                {field: 'dataSourceDescription', title: 'Description', sort: true},
                {field: 'dataSourceType', title: 'DataSourceType', sort: true},
                // {
                //     field: 'right', title: 'Actions', sort: true, height: 100, templet: function (data) {
                //         return responseHandlerDataSource(data);
                //     }
                // }
            ]]
            , id: testTableId
            , page: true
        });
    });

    $("#" + searchInputId).bind('input propertychange', function () {
        searchMonitor(table, testTableId, searchInputId);
    });
}

// Replace the contents of the attribute
function updateSAttributes(updateHtmlStr, findType, attrName, oldContent, newContent) {
    var updateHtmlStr = $(updateHtmlStr);
    var idSelectObj = updateHtmlStr.find(findType);
    if (idSelectObj && idSelectObj.length > 0) {
        for (var i = 0; i < idSelectObj.length; i++) {
            var id_select_obj_i = idSelectObj[i];
            var id_select_obj_i_content = $(id_select_obj_i).attr(attrName);
            if (id_select_obj_i_content) {
                id_select_obj_i_content = id_select_obj_i_content.replace(new RegExp(oldContent, "gm"), newContent);
                $(id_select_obj_i).attr(attrName, id_select_obj_i_content);
            }
        }
    }
    return updateHtmlStr;
}

//Batch replacement
function replaceContent(sourceHtml, oldContent, newContent) {
    var splitArr = oldContent.split("R_R");
    var nameOldContent = splitArr.length === 2 ? splitArr[1] : splitArr[0];
    sourceHtml = updateSAttributes(sourceHtml, "div", "id", oldContent, "R_R" + newContent);
    sourceHtml = updateSAttributes(sourceHtml, "div a", "onclick", oldContent, "R_R" + newContent);
    sourceHtml = updateSAttributes(sourceHtml, "label input", "name", nameOldContent, newContent);
    sourceHtml = updateSAttributes(sourceHtml, "div input", "name", nameOldContent, newContent);
    return sourceHtml;
}

//Add a custom module
function addCustomProperty(copyId, targetId) {
    var sourceHtml = $("#" + copyId).clone();
    var targetObj = $("#" + targetId);
    var number = targetObj.children().length;
    var completedHtml = replaceContent(sourceHtml, "1Copy", number);
    $("#" + targetId).append(completedHtml.html());
}

//Delete custom module
function removeCustomModule(removeId, listId) {
    var listTotal = $("#" + listId).children().length;
    if (listTotal && listTotal > 1) {
        var number = removeId.split("R_R");
        if (number && number.length == 2) {
            $("#" + removeId).parent().remove();
            var forListTotal = listTotal;
            var currentNumber = number[1];
            while (currentNumber < forListTotal) {
                var nestNumber = currentNumber;
                var oldContentStr = "R_R" + (++nestNumber);
                var updateHtml = $("#" + number[0] + oldContentStr).parent();
                replaceContent(updateHtml, oldContentStr, currentNumber);
                currentNumber++;
            }
        } else {
            layer.msg("Incoming Id error please check！！");
        }
    } else {
        layer.msg("Please keep at least one！！");
    }
}

function dataSourceOpen(dataSourceId) {
    openDatasourceId = dataSourceId;
    newDatasourceWindow = layer.open({
        type: 2,
        title: '<span style="color: #269252;">data source</span>',
        shadeClose: true,
        closeBtn: 1,
        shift: 7,
        area: ['580px', '550px'], //Width height
        skin: 'layui-layer-rim', //Add borders
        content: (web_drawingBoard + "/page/dataSource/dataSourceInput.html")
    });
    // ajaxRequest({
    //     cache: true,//Keep cached data
    //     type: "GET",//Request type post
    //     url: "/page/dataSource/getDataSourceInputPage.html",//This is the name of the file where I receive data in the background.
    //     //data:$('#loginForm').serialize(),//Serialize the form
    //     data: {"dataSourceId": dataSourceId},
    //     async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
    //     error: function (request) {//Operation after request failure
    //         layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
    //         return;
    //     },
    //     success: function (data) {//Operation after request successful
    //         newDatasourceWindow = layer.open({
    //             type: 1,
    //             title: '<span style="color: #269252;">data source</span>',
    //             shadeClose: true,
    //             closeBtn: 1,
    //             shift: 7,
    //             area: ['580px', '550px'], //Width height
    //             skin: 'layui-layer-rim', //Add borders
    //             content: data
    //         });
    //     }
    // });

}

function searchMonitor(layui_table, layui_table_id, searchInputId) {
    //Perform overload
    layui_table.reload(layui_table_id, {
        page: {
            curr: 1 //Start again on page 1
        }
        , where: {param: $('#' + searchInputId).val()}
    }, 'data');
}

//Results returned in the background
function responseHandlerDataSource(res) {
    var dataAction = "";
    if (res) {
        var dataAction = '<a class="btn" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:dataSourceOpen(\'' + res.id + '\');" '
            + 'style="margin-right: 2px;">'
            + '<i class="icon-edit icon-white"></i>'
            + '</a>'
            + '<a class="btn" '
            + 'href="javascript:void(0);" '
            + 'onclick="javascript:delDataSource(\'' + res.id + '\');" '
            + 'title="delete template"> '
            + '<i class="icon-trash icon-white"></i>'
            + '</a>';
    }
    return dataAction;
}

function changeDataSourceType(select) {
    $('#typeId').html("");
    $('#template_type_id').val("");
    $('#template_type_div_id').hide();
    if (select.value) {
        $('#typeContentId').show();
        if ('other' === select.value) {
            $('#customOtherDatasource').show();
            var datasourcePropertyHtml = $('#customKeyValueCopy').clone().html();
            var completedHtml = replaceContent(datasourcePropertyHtml, "1Copy", 0);
            $('#custom_property_list').html(completedHtml);
            $('#template_type_id').val("other");
            $("#layui-layer" + newDatasourceWindow).css("height", "520px");
        } else {
            $('#customOtherDatasource').hide();
            loadDataSourceById(select.value);
        }
    } else {
        $("#layui-layer" + newDatasourceWindow).css("height", "580px");
        $('#typeContentId').hide();
    }
}

function loadDataSourceById(dataSourceId) {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/datasource/getDatasourceById",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {"id": dataSourceId},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var template = dataMap.data;
                var dataSourcePropertyVoList = template.dataSourcePropertyVoList;
                var datasourcePropertyHtml = '';
                if (dataSourcePropertyVoList && dataSourcePropertyVoList.length > 0) {
                    var dataSourcePropertyVoListLength = dataSourcePropertyVoList.length;
                    var newDatasourceWindow_jq_obj = $("#layui-layer" + newDatasourceWindow);
                    newDatasourceWindow_jq_obj.css("height", (dataSourcePropertyVoListLength * 43 + 427) + "px");
                    newDatasourceWindow_jq_obj.find(".layui-layer-content").css("height", (dataSourcePropertyVoListLength * 43 + 384) + "px");
                    for (var j = 0; j < dataSourcePropertyVoList.length; j++) {
                        var dataSourcePropertyVo = dataSourcePropertyVoList[j];
                        datasourcePropertyHtml += ('<div class="layui-form-item layui-form-text">'
                            + '<label class="layui-form-label">' + dataSourcePropertyVo.name + '</label>'
                            + '<input style="display:none;" '
                            + 'name="dataSourcePropertyVoList[' + j + '].name" '
                            + 'value="' + dataSourcePropertyVo.name + '" />'
                            + '<div class="layui-input-block">'
                            + '<input class="layui-input" autocomplete="off"'
                            + 'name="dataSourcePropertyVoList[' + j + '].value" '
                            + 'placeholder="please input name..." style="width: 95%;"/>'
                            + '</div>'
                            + '</div>');

                    }
                }
                $('#template_type_id').val(template.dataSourceType);
                $('#typeId').html(datasourcePropertyHtml);
            }

        }
    });
}

function saveOrUpdateDataSource(data) {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/datasource/saveOrUpdate",//This is the name of the file where I receive data in the background.
        data: data,
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 1000}, function () {
                    window.location.reload();
                    //console.log(data);
                });
            } else {
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 1000}, function () {
                });
            }
        }
    });
}

function delDataSource(datasourceId) {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/datasource/deleteDataSource",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {"dataSourceId": datasourceId},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000}, function () {
                    window.location.reload();
                });
            }

        }
    });
}

function onloadPageData() {
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/datasource/getDataSourceInputData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {"dataSourceId": openDatasourceId},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            openDatasourceId = '';
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var dataSourceVoObj = dataMap.dataSourceVo;
                var templateListObj = dataMap.templateList;
                if (dataSourceVoObj) {
                    $("#selectTypeDivId").hide();
                    $("#submitBtnSpan").text('Update');
                    $("#updateDatasourceId").val(dataSourceVoObj.id);
                    $("#template_type_id").val(dataSourceVoObj.dataSourceType);
                    $("#dataSourceName").val(dataSourceVoObj.dataSourceName);
                    $("#dataSourceDescription").val(dataSourceVoObj.dataSourceDescription);
                    var dataSourcePropertyVoList = dataSourceVoObj.dataSourcePropertyVoList
                    if (dataSourcePropertyVoList) {
                        var typeId_element = $("#typeId");
                        typeId_element.html("");
                        dataSourcePropertyVoList.forEach((dataSourcePropertyVo, index) => {
                            var html = '<div class="layui-form-item layui-form-text">' +
                                '<label class="layui-form-label">' + dataSourcePropertyVo.name + '</label>' +
                                '<input style="display: none;"' +
                                'name="dataSourcePropertyVoList[' + index + '].id"' +
                                'value="' + dataSourcePropertyVo.id + '">' +
                                '<input style="display: none;"' +
                                'name="dataSourcePropertyVoList[' + index + '].name"' +
                                'value="' + dataSourcePropertyVo.name + '">' +
                                '<div class="layui-input-block">' +
                                '<input class="layui-input"' +
                                'autocomplete="off"' +
                                'placeholder="please input name..."' +
                                'style="width: 95%;"' +
                                'name="dataSourcePropertyVoList[' + index + '].value"' +
                                'value="' + dataSourcePropertyVo.value + '"/>' +
                                '</div>' +
                                '</div>';
                            typeId_element.append(html);
                        });
                    }
                    $('#typeContentId').show();
                } else {
                    $("#selectTypeDivId").show();
                    $("#submitBtnSpan").text('Create');
                    if (templateListObj) {
                        $('#type_select_id').html("");
                        $('#type_select_id').append('<option value="">please select type...</option>');
                        templateListObj.forEach((template, index) => {
                            var htmlOption = '<option value="' + template.id + '"' + '>' + template.dataSourceName + '</option>';
                            $('#type_select_id').append(htmlOption);
                        });
                        $('#type_select_id').append('<option value="other">Other</option>');
                    }
                    $('#typeContentId').hide();
                    //please select type...
                    $("#type_select_id").val($("#type_select_id option:contains(jdbc temolate)").val());
                    $("#type_select_id").change();
                    //other
                    $("#type_select_id").val("other");
                    $("#type_select_id").change();
                }
            } else {
                layer.msg("failed " + dataMap.errorMsg, {icon: 2, shade: 0, time: 1000}, function () {
                });
            }
        }
    });
}


<|start_filename|>piflow-web/src/main/resources/static/my_js/process/processContent.js<|end_filename|>
var isLoadProcessInfo = true;
var isEnd = false;

function initProcessContentPage(nodeArr) {
    $("#runFlow").attr("onclick", "getCheckpoint(" + getCheckpointParam + ")");
    $("#debugFlow").attr("onclick", "getCheckpoint(" + getCheckpointParam + ",'DEBUG')");
    $("#run_checkpoint_new").attr("onclick", "getCheckpoint(" + getCheckpointParam + ")");
    $("#debug_checkpoint_new").attr("onclick", "getCheckpoint(" + getCheckpointParam + ",'DEBUG')");
    if ($('#runFlow')) {
        if ("COMPLETED" !== processState && "FAILED" !== processState && "KILLED" !== processState) {
            $('#runFlow').hide();
            $('#debugFlow').hide();
            $('#stopFlow').show();
            timer = window.setInterval("processMonitoring(appId)", 5000);
        } else {
            $('#runFlow').show();
            $('#debugFlow').show();
            $('#stopFlow').hide();
        }
    }
    if (nodeArr && '' != nodeArr) {
        for (var i = 0; i < nodeArr.length; i++) {
            var processStopVoInit = nodeArr[i];
            monitor(processStopVoInit.pageId, processStopVoInit.state);
        }
    }
}

//  Get Checkpoint points
function getCheckpoint(pID, parentProcessId, processId, runMode) {
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/process/getCheckpointData",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            pID: pID,
            parentProcessId: parentProcessId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#runFlow').show();
            $('#debugFlow').show();
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                var checkpointsSplitArray = dataMap.checkpointsSplit;
                if (checkpointsSplitArray) {
                    var layer_open_checkpoint_top = document.createElement("div");
                    var layer_open_checkpoint_btn_div = document.createElement("div");
                    layer_open_checkpoint_btn_div.setAttribute("style", "text-align: right;");

                    var layer_open_checkpoint_btn = document.createElement("div");
                    layer_open_checkpoint_btn.type = "button";
                    layer_open_checkpoint_btn.className = "btn btn-default";
                    layer_open_checkpoint_btn.setAttribute("style", "margin-right: 10px;");
                    if (runMode && 'DEBUG' === runMode) {
                        layer_open_checkpoint_btn.textContent = "DEBUG";
                        layer_open_checkpoint_btn.setAttribute('onclick', 'runProcess("' + processId + '","DEBUG")')
                    } else {
                        layer_open_checkpoint_btn.setAttribute('onclick', 'runProcess("' + processId + '")');
                        layer_open_checkpoint_btn.textContent = "RUN"
                    }
                    layer_open_checkpoint_btn_div.appendChild(layer_open_checkpoint_btn);

                    var layer_open_checkpoint = document.createElement("div");
                    layer_open_checkpoint.id = "checkpointsContentDiv";

                    for (var i = 0; i < checkpointsSplitArray.length; i++) {
                        var checkpoints_content_span = document.createElement("span");

                        var checkpoints_content_span_input = document.createElement("input");
                        checkpoints_content_span_input.type = "checkbox";
                        checkpoints_content_span_input.value = "'" + checkpointsSplitArray[i] + "'";

                        var checkpoints_content_span_span = document.createElement("span");
                        checkpoints_content_span_span.textContent = checkpointsSplitArray[i];

                        var checkpoints_content_span_br = document.createElement("br");

                        checkpoints_content_span.appendChild(checkpoints_content_span_input);
                        checkpoints_content_span.appendChild(checkpoints_content_span_span);
                        checkpoints_content_span.appendChild(checkpoints_content_span_br);

                        layer_open_checkpoint.appendChild(checkpoints_content_span);

                    }

                    layer_open_checkpoint_top.appendChild(layer_open_checkpoint);
                    layer_open_checkpoint_top.appendChild(layer_open_checkpoint_btn_div);

                    openLayerWindowLoadHtml(layer_open_checkpoint_top.outerHTML, 500, 300, "Checkpoint", 0.3);
                    $('#fullScreen').hide();
                } else {
                    runProcess(processId, runMode);
                }
            }
        }
    });

}

function cancelRunProcess() {
    $('#checkpointShow').modal('hide');
    $('#fullScreen').hide();
    return;
}

//run
function runProcess(processId, runMode) {
    $('#fullScreen').show();
    $('#runFlow').hide();
    $('#debugFlow').hide();
    var checkpointStr = '';
    $(".layui-layer-content").find("#checkpointContentNew").find("input[type='checkbox']:checked").each(function () {
        if ('' !== checkpointStr) {
            checkpointStr = (checkpointStr + ',');
        }
        checkpointStr = (checkpointStr + $(this).val());
    });
    var data = {
        id: processId,
        checkpointStr: checkpointStr
    };
    if (runMode) {
        data.runMode = runMode;
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/process/runProcess",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: data,
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            $('#runFlow').show();
            $('#debugFlow').show();
            //alert("Request Failed");
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            //console.log("success");
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                //alert(dataMap.errorMsg);
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000});
                window_location_href("/page/process/mxGraph/index.html?drawingBoardType=PROCESS&processType=PROCESS&load=" + dataMap.processId);
            } else {
                //alert(dataMap.errorMsg);
                layer.msg(dataMap.errorMsg, {icon: 2, shade: 0, time: 2000});
                $('#runFlow').show();
                $('#debugFlow').show();
                $('#fullScreen').hide();
            }

        }
    });
}

//stop
function stopProcess() {
    $('#stopFlow').hide();
    $('#fullScreen').show();
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/process/stopProcess",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {
            processId: processId
        },
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            stopFlow.show();
            //alert("Request Failed");
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            $('#fullScreen').hide();
            return;
        },
        success: function (data) {//Operation after request successful
            //console.log("success");
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                //alert(dataMap.errorMsg);
                layer.msg(dataMap.errorMsg, {icon: 1, shade: 0, time: 2000});
                $('#runFlow').show();
                $('#debugFlow').show();
            } else {
                //alert("Stop Failed:" + dataMap.errorMsg);
                layer.msg("Stop Failed", {icon: 2, shade: 0, time: 2000});
                stopFlow.show();
            }
            $('#fullScreen').hide();
        }
    });
}

function getLogUrl() {
    var window_width = $(window).width();//Get browser window width
    var window_height = $(window).height();//Get browser window width
    var open_window_width = (window_width > 300 ? window_width - 200 : window_width);
    var open_window_height = (window_height > 300 ? window_height - 150 : window_height);
    var logContent = '<div id="divPreId" style="height: ' + (open_window_height - 121) + 'px;width: 100%;">'
        + '<div id="preId" style="height: 100%; margin: 6px 6px 6px 6px;background-color: #f5f5f5;text-align: center;">'
        + '<span span style="font-size: 90px;margin-top: 15px;">loading....</span>'
        + '</div>'
        + '</div>';

    // + '<div style="margin-top: 5px;margin-bottom: 5px;margin-left: 10px;">'
    // + '<input type="button" class="btn btn-default" onclick="changeUrl(1)" value="stdout">'
    // + '<input type="button" class="btn btn-default" onclick="changeUrl(2)" value="stderr">'
    // + '</div>';

    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/process/getLogUrl",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {"appId": appId},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            layer.open({
                type: 1,
                title: '<span style="color: #269252;">Log Windows</span>',
                shadeClose: true,
                closeBtn: 1,
                shift: 7,
                area: [open_window_width + 'px', open_window_height + 'px'], //Width height
                skin: 'layui-layer-rim', //Add borders
                btn: ['stdout', 'stderr'], //button
                btn1: function (index, layero) {
                    changeUrl(1);
                    return false;
                },
                btn2: function (index, layero) {
                    changeUrl(2);
                    return false;
                },
                content: logContent,
                success: function (layero) {
                    layero.find('.layui-layer-btn').css('text-align', 'left');
                    var bleBtn0 = layero.find('.layui-layer-btn0');
                    var bleBtn1 = layero.find('.layui-layer-btn1');
                    bleBtn0.removeClass('layui-layer-btn0');
                    bleBtn1.removeClass('layui-layer-btn1');
                    bleBtn0.addClass('layui-layer-btn1');
                    bleBtn1.addClass('layui-layer-btn1');
                }
            });
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                stdoutLog = dataMap.stdoutLog;
                stderrLog = dataMap.stderrLog;
                changeUrl(1);
            }
        }
    });
}

function changeUrl(key) {
    var url
    switch (key) {
        case 1:
            url = stdoutLog;
            break;
        case 2:
            url = stderrLog;
            break;
        default:
            break;
    }
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/process/getLog",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: {url: url},
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            return;
        },
        success: function (data) {//Operation after request successful
            console.log("success");
            if ('' !== data) {
                var content_td = $(data).find('.content')[0].innerHTML;
                var content_td_html = (('' !== content_td) ? content_td[0] : '');
                var showLogHtml = ('<div id="preId" style="height: 100%; margin: 6px 6px 6px 6px;background-color: #f5f5f5;">') + (content_td) + ('</div>');
                $("#divPreId").html(showLogHtml);
                $(".layui-layer-content").scrollTop($(".layui-layer-content")[0].scrollHeight);
            } else {
                $("#divPreId").html('<div id="preId" style="height: 100%; margin: 6px 6px 6px 6px;background-color: #f5f5f5;text-align: center;"><span style="font-size: 90px;margin-top: 15px;">Load Log Filed</span></div>');
            }
        }
    });
}

function processMonitoring(appId) {
    if (appId === '') {
        return;
    }
    ajaxRequest({
        cache: true,
        type: "get",
        url: "/process/getAppInfo",
        data: {appid: appId},
        async: true,
        traditional: true,
        error: function (request) {
            console.log("error");
            return;
        },
        success: function (data) {
            var dataMap = JSON.parse(data);
            if (200 === dataMap.code) {
                if (dataMap.state && "" !== dataMap.state) {
                    if ("COMPLETED" === dataMap.state || "FAILED" === dataMap.state || "KILLED" === dataMap.state) {
                        window.clearInterval(timer);
                        $('#runFlow').show();
                        $('#debugFlow').show();
                        $('#stopFlow').hide();
                    }
                }
                var processVo = dataMap.processVo;
                if (processVo && '' != processVo) {
                    $("#progress").html(dataMap.progress + "%");
                    $("#processStartTimeShow").html(processVo.startTime);
                    $("#processStopTimeShow").html(processVo.endTime);
                    $("#processStateShow").html(dataMap.state);
                    $("#processProgressShow").html(dataMap.progress + "%");
                    // stop
                    var processStopVoList = processVo.processStopVoList;
                    if (processStopVoList && '' != processStopVoList) {
                        for (var i = 0; i < processStopVoList.length; i++) {
                            var processStopVo = processStopVoList[i];
                            if (processStopVo && '' != processStopVo) {
                                var sotpNameDB = processStopVo.name;
                                var sotpNameVal = $("#stopNameShow").text();
                                if (sotpNameDB === sotpNameVal) {
                                    $("#stopStartTimeShow").html(processStopVo.startTime);
                                    $("#stopStopTimeShow").html(processStopVo.endTime);
                                    $("#stopStateShow").html(processStopVo.state);
                                }
                                var pageId = processStopVo.pageId;
                                var processStopVoState = processStopVo.state;
                                monitor(pageId, processStopVoState)
                            }
                        }
                    }
                }
            }
        }
    });
}

function monitor(pageId, processStopVoState) {
    var stopFailShow = $("#stopFailShow" + pageId);
    var stopOkShow = $("#stopOkShow" + pageId);
    var stopLoadingShow = $("#stopLoadingShow" + pageId);
    var stopImgChange = $("#stopImg" + pageId);
    if (processStopVoState) {
        if (processStopVoState !== "INIT") {
            stopImgChange.attr('opacity', 1);
            if (processStopVoState && (processStopVoState === "STARTED")) {
                stopFailShow.hide();
                stopOkShow.hide();
                stopLoadingShow.show();
            } else if (processStopVoState && processStopVoState === "COMPLETED") {
                stopFailShow.hide();
                stopLoadingShow.hide();
                stopOkShow.show();
            } else if (processStopVoState && processStopVoState === "FAILED") {
                stopOkShow.hide();
                stopLoadingShow.hide();
                stopFailShow.show();
            }
        } else {
            stopImgChange.attr('opacity', 0.4);
        }
    } else {
        stopImgChange.attr('opacity', 0.4);
    }

    /*
    var stopPath = $('g[name="stopPageId' + pageId + '"]');
    if (stopPath.length > 0) {
        for (var i = 0; i < stopPath.length; i++) {
            var pathName = $(stopPath[i]).find('path[name="pathName"]');
            var arrowName = $(stopPath[i]).find('path[name="arrowName"]');
            if (processStopVoState && (processStopVoState === "STARTED")) {

            } else if (processStopVoState && processStopVoState === "COMPLETED") {
                $(pathName).attr('stroke', 'green');
                $(arrowName).attr('stroke', 'green').attr('fill', 'green');
            } else if (processStopVoState && processStopVoState === "FAILED") {
                $(pathName).attr('stroke', 'red');
                $(arrowName).attr('stroke', 'red').attr('fill', 'red');
            }
        }
    }
    */
}

function getDebugData(stopName, portName) {
    var window_width = $(window).width();//Get browser window width
    var window_height = $(window).height();//Get browser window width
    var jsonData = {"appId": appId, "stopName": stopName, "portName": portName};
    ajaxRequest({
        cache: true,//Keep cached data
        type: "POST",//Request type post
        url: "/page/process/getDebugDataHtml.html",//This is the name of the file where I receive data in the background.
        //data:$('#loginForm').serialize(),//Serialize the form
        data: jsonData,
        async: true,//Setting it to true indicates that other code can still be executed after the request has started. If this option is set to false, it means that all requests are no longer asynchronous, which also causes the browser to be locked.
        error: function (request) {//Operation after request failure
            layer.msg("Request Failed", {icon: 2, shade: 0, time: 2000});
            return;
        },
        success: function (data) {//Operation after request successful
            var open_window_width = (window_width > 300 ? window_width - 200 : window_width) + "px";
            var open_window_height = (window_height > 300 ? window_height - 200 : window_height) + "px";
            layer.open({
                type: 1,
                title: '<span style="color: #269252;">Debug Data</span>',
                shadeClose: true,
                closeBtn: 1,
                shift: 7,
                area: [open_window_width, open_window_height], //Width height
                skin: 'layui-layer-rim', //Add borders
                content: data
            });
        }
    });
}

function loadDebugData() {
    var debug_app_id = $("#debug_app_id");
    var debug_stop_name = $("#debug_stop_name");
    var debug_port_name = $("#debug_port_name");
    var debug_data_last_read_line = $("#debug_data_last_read_line");
    var debug_data_last_file_name = $("#debug_data_last_file_name");
    ajaxRequest({
        type: "POST",
        async: false,
        url: '/process/getDebugData', //Actual use, please change to the server real interface
        data: {
            "appId": debug_app_id.html(),
            "stopName": debug_stop_name.html(),
            "portName": debug_port_name.html(),
            "startFileName": debug_data_last_file_name.html(),
            "startLine": debug_data_last_read_line.html()
        },
        error: function () {
            layer.msg('An error occurred')
            return false;
        },
        success: function (rtnData) {
            var dataMap = JSON.parse(rtnData);
            if (200 === dataMap.code) {
                var div_table_list_obj = $('#div_table_list');
                var div_table_list_obj_children_length_add_1 = div_table_list_obj.children().length + 1;
                var debugData = dataMap.debugData;
                debug_data_last_read_line.html(debugData.lastReadLine);
                debug_data_last_file_name.html(debugData.lastFileName);
                isEnd = debugData.end;
                var schemaList = debugData.schema;
                var debugDataList = debugData.data;
                if (schemaList && schemaList.length > 0 && debugDataList && debugDataList.length > 0) {
                    var debug_data_table_id_obj = '<table id="debug_data_table_id_' + div_table_list_obj_children_length_add_1 + '" class="layui-table">';
                    var table_tr_th_all = '<thead><tr style="color: #1A7444;">';
                    for (var i = 0; i < schemaList.length; i++) {
                        table_tr_th_all += ('<th style="font-weight: bold;">' + schemaList[i] + '</th>');
                    }
                    table_tr_th_all += '</tr></thead>';
                    debug_data_table_id_obj += table_tr_th_all;
                    var table_tr_td_all = '';
                    for (var i = 0; i < debugDataList.length; i++) {
                        var debug_data_list_i_obj = JSON.parse(debugDataList[i]);
                        table_tr_td_all += '<tr>';
                        for (var j = 0; j < schemaList.length; j++) {
                            table_tr_td_all += ('<td>' + debug_data_list_i_obj[schemaList[j]] + '</td>');
                        }
                        table_tr_td_all += '</tr>';
                    }
                    debug_data_table_id_obj += (table_tr_td_all + '</table>');
                    div_table_list_obj.append(debug_data_table_id_obj);
                }
            }
        }
    });
}

function changePageNo(switchNo) {
    // Get all the tables under div_table_list and hide
    var div_table_list_obj = $('#div_table_list');
    var div_table_list_obj_children = div_table_list_obj.children();
    for (var i = 0; i < div_table_list_obj_children.length; i++) {
        $(div_table_list_obj_children[i]).hide();
    }
    //Find the table to switch
    var debug_data_table_id_current_obj = $("#debug_data_table_id_" + switchNo);
    // Determine whether there is content, there is content to display, otherwise request
    if (debug_data_table_id_current_obj.html()) {
        debug_data_table_id_current_obj.show();
    } else {
        loadDebugData();
    }
    // Retrieve all the tables under div_table_list
    div_table_list_obj = $('#div_table_list');

    // Find the element of the tag page for tag removal and replacement
    var current_page_obj = $('#current_page_id');
    // Whether the element of the tag page exists
    if (current_page_obj.html()) {
        var current_page_obj_em_arr = current_page_obj.find("em");
        for (var i = 0; i < current_page_obj_em_arr.length; i++) {
            var innerHTML_i = current_page_obj_em_arr[1].innerHTML;
            if (innerHTML_i) {
                current_page_obj.before('<a id="page_no_id_' + innerHTML_i + '" '
                    + 'href="javascript:changePageNo(' + innerHTML_i + ');">'
                    + innerHTML_i + '</a>');
                current_page_obj.remove();
                break;
            }
        }
    }
    if (switchNo == 1 && switchNo == div_table_list_obj.children().length && isEnd) {// Determine whether it is both the first page and the last page
        $("#debug_data_prev").attr("href", "javascript:void(0);");
        $("#debug_data_prev").addClass("layui-disabled");
        $("#debug_data_next").addClass("layui-disabled");
        $("#debug_data_next").attr("href", "javascript:void(0);");
    } else if (switchNo == 1) { // Determine if the page to be switched is the home page
        $("#debug_data_prev").attr("href", "javascript:void(0);");
        $("#debug_data_prev").addClass("layui-disabled");
        $("#debug_data_next").removeClass("layui-disabled");
        $("#debug_data_next").attr("href", "javascript:changePageNo(" + (switchNo + 1) + ");");
    } else if (switchNo == div_table_list_obj.children().length && isEnd) { // Determine if the page to be switched is the last page
        $("#debug_data_prev").removeClass("layui-disabled");
        $("#debug_data_prev").attr("href", "javascript:changePageNo(" + (switchNo - 1) + ");");
        $("#debug_data_next").addClass("layui-disabled");
        $("#debug_data_next").attr("href", "javascript:void(0);");
    } else {//When it is neither the first page nor the last page
        $("#debug_data_prev").removeClass("layui-disabled");
        $("#debug_data_prev").attr("href", "javascript:changePageNo(" + (switchNo - 1) + ");");
        $("#debug_data_next").removeClass("layui-disabled");
        $("#debug_data_next").attr("href", "javascript:changePageNo(" + (switchNo + 1) + ");");
    }
    var page_no_switch_obj = $('#page_no_id_' + switchNo);
    var current_page_no_obj = '<span id="current_page_id" class="layui-laypage-curr">'
        + '<em class="layui-laypage-em"></em>'
        + '<em>' + switchNo + '</em></span>';
    if (page_no_switch_obj.html()) {
        page_no_switch_obj.after(current_page_no_obj);
        page_no_switch_obj.remove();
    } else {
        $("#debug_data_next").before(current_page_no_obj);
    }
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/third/vo/schedule/ThirdScheduleEntryVo.java<|end_filename|>
package cn.cnic.third.vo.schedule;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class ThirdScheduleEntryVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String scheduleEntryId;
    private String scheduleEntryType;
    
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/schedule/StopComponentSync.java<|end_filename|>
package cn.cnic.schedule;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

import cn.cnic.component.stopsComponent.service.IStopGroupService;


public class StopComponentSync extends QuartzJobBean {

    @Autowired
    private IStopGroupService stopGroupServiceImpl;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        stopGroupServiceImpl.updateGroupAndStopsListByServer("systemSync");
    }
}

<|start_filename|>piflow-web/src/main/java/cn/cnic/component/schedule/mapper/provider/ScheduleMapperProvider.java<|end_filename|>
package cn.cnic.component.schedule.mapper.provider;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.schedule.entity.Schedule;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.jdbc.SQL;

import java.util.Date;

@Mapper
public class ScheduleMapperProvider {

    private String id;
    private String lastUpdateUser;
    private String lastUpdateDttmStr;
    private long version;
    private int enableFlag;
    private String scheduleId;
    private String type;
    private String statusStr;
    private String cronExpression;
    private String planStartTimeStr;
    private String planEndTimeStr;
    private String scheduleProcessTemplateId;
    private String scheduleRunTemplateId;

    private boolean preventSQLInjectionSchedule(Schedule schedule) {
        if (null == schedule || StringUtils.isBlank(schedule.getLastUpdateUser())) {
            return false;
        }
        // Mandatory Field
        String lastUpdateDttm = DateUtils.dateTimesToStr(null != schedule.getLastUpdateDttm() ? schedule.getLastUpdateDttm() : new Date());
        this.id = SqlUtils.preventSQLInjection(schedule.getId());
        this.enableFlag = ((null != schedule.getEnableFlag() && schedule.getEnableFlag()) ? 1 : 0);
        this.version = (null != schedule.getVersion() ? schedule.getVersion() : 0L);
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttm);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(schedule.getLastUpdateUser());

        // Selection field
        String planStartTime = (null != schedule.getPlanStartTime() ? DateUtils.dateTimesToStr(schedule.getPlanStartTime()) : null);
        String planEndTime = (null != schedule.getPlanEndTime() ? DateUtils.dateTimesToStr(schedule.getPlanEndTime()) : null);
        this.scheduleId = SqlUtils.preventSQLInjection(schedule.getScheduleId());
        this.type = SqlUtils.preventSQLInjection(schedule.getType());
        this.statusStr = SqlUtils.preventSQLInjection(null != schedule.getStatus() ? schedule.getStatus().name() : "INIT");
        this.cronExpression = SqlUtils.preventSQLInjection(schedule.getCronExpression());
        this.planStartTimeStr = SqlUtils.preventSQLInjection(planStartTime);
        this.planEndTimeStr = SqlUtils.preventSQLInjection(planEndTime);
        this.scheduleRunTemplateId = SqlUtils.preventSQLInjection(schedule.getScheduleRunTemplateId());
        this.scheduleProcessTemplateId = SqlUtils.preventSQLInjection(schedule.getScheduleProcessTemplateId());


        return true;
    }

    private void resetSchedule() {
        this.id = null;
        this.lastUpdateUser = null;
        this.lastUpdateDttmStr = null;
        this.version = 0L;
        this.enableFlag = 1;
        this.scheduleId = null;
        this.type = null;
        this.statusStr = null;
        this.cronExpression = null;
        this.planStartTimeStr = null;
        this.planEndTimeStr = null;
        this.scheduleProcessTemplateId = null;
        this.scheduleRunTemplateId = null;
    }

    /**
     * insert schedule
     *
     * @param schedule schedule
     * @return string sql
     */
    public String insert(Schedule schedule) {
        String sqlStr = "SELECT 0";
        boolean flag = this.preventSQLInjectionSchedule(schedule);
        if (flag) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("INSERT INTO group_schedule ");
            strBuf.append("( ");
            strBuf.append(SqlUtils.baseFieldName() + ", ");
            strBuf.append("schedule_id, ");
            strBuf.append("type, ");
            strBuf.append("status, ");
            strBuf.append("cron_expression, ");
            strBuf.append("plan_start_time, ");
            strBuf.append("plan_end_time, ");
            strBuf.append("schedule_run_template_id, ");
            strBuf.append("schedule_process_template_id ");
            strBuf.append(") ");

            strBuf.append("values ");
            strBuf.append("(");
            strBuf.append(SqlUtils.baseFieldValues(schedule) + ", ");
            strBuf.append(this.scheduleId + ", ");
            strBuf.append(this.type + ", ");
            strBuf.append(this.statusStr + ", ");
            strBuf.append(this.cronExpression + ", ");
            strBuf.append(this.planStartTimeStr + ", ");
            strBuf.append(this.planEndTimeStr + ", ");
            strBuf.append(this.scheduleRunTemplateId + ",");
            strBuf.append(this.scheduleProcessTemplateId);
            strBuf.append(")");
            this.resetSchedule();
            sqlStr = strBuf.toString() + ";";
        }
        return sqlStr;
    }

    /**
     * update schedule
     *
     * @param schedule schedule
     * @return string sql
     */
    public String update(Schedule schedule) {

        String sqlStr = "SELECT 0";
        boolean flag = this.preventSQLInjectionSchedule(schedule);
        if (flag && StringUtils.isNotBlank(this.id)) {
            SQL sql = new SQL();
            // INSERT_INTO brackets is table name
            sql.UPDATE("group_schedule");
            // The first string in the SET is the name of the field corresponding to the table in the database
            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + enableFlag);
            sql.SET("schedule_id = " + this.scheduleId);
            sql.SET("type = " + this.type);
            sql.SET("status = " + this.statusStr);
            sql.SET("cron_expression = " + this.cronExpression);
            sql.SET("plan_start_time = " + this.planStartTimeStr);
            sql.SET("plan_end_time = " + this.planEndTimeStr);
            sql.SET("schedule_run_template_id = " + this.scheduleRunTemplateId);
            sql.SET("schedule_process_template_id = " + this.scheduleProcessTemplateId);
            sql.WHERE("version = " + this.version);
            sql.WHERE("id = " + this.id);
            sqlStr = sql.toString();
        }
        this.resetSchedule();
        return sqlStr;
    }

    /**
     * get Schedule list
     *
     * @param isAdmin  is admin
     * @param username username
     * @param param    like param
     * @return sql
     */
    public String getScheduleList(boolean isAdmin, String username, String param) {
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("SELECT gs.*, CASE gs.type ");
        strBuf.append("WHEN 'FLOW' THEN f.name ");
        strBuf.append("WHEN 'FLOW_GROUP' THEN fg.name ");
        strBuf.append("END schedule_run_template_name ");
        strBuf.append("from group_schedule gs ");
        strBuf.append("LEFT JOIN flow f ON f.id = gs.schedule_run_template_id ");
        strBuf.append("LEFT JOIN flow_group fg ON fg.id = gs.schedule_run_template_id ");
        strBuf.append("where ");
        strBuf.append("gs.enable_flag = 1 ");
        if (StringUtils.isNotBlank(param)) {
            strBuf.append("and ( ");
            strBuf.append("gs.type like CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%') ");
            strBuf.append("or gs.cron_expression like CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%') ");
            strBuf.append(") ");
        }
        if (!isAdmin) {
            strBuf.append("and gs.crt_user = " + SqlUtils.preventSQLInjection(username));
        }
        strBuf.append("order by crt_dttm desc ");
        String sqlStr = strBuf.toString();
        return sqlStr;
    }

    /**
     * get Schedule by id
     *
     * @param isAdmin  is admin
     * @param username username
     * @param id       id
     * @return sql
     */
    public String getScheduleById(boolean isAdmin, String username, String id) {
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("select * ");
        strBuf.append("from group_schedule ");
        strBuf.append("where ");
        strBuf.append("enable_flag = 1 ");
        strBuf.append("and id = " + SqlUtils.preventSQLInjection(id) + " ");
        if (!isAdmin) {
            strBuf.append("and crt_user = " + SqlUtils.preventSQLInjection(username));
        }
        String sqlStr = strBuf.toString();
        return sqlStr;
    }

    /**
     * del Schedule by id
     *
     * @param isAdmin  is admin
     * @param username username
     * @param id       id
     * @return sql
     */
    public String delScheduleById(boolean isAdmin, String username, String id) {
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        if (StringUtils.isBlank(username)) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        String lastUpdateDttm = DateUtils.dateTimesToStr(new Date());
        strBuf.append("update group_schedule set ");
        strBuf.append("enable_flag = 0 , ");
        strBuf.append("last_update_user = " + SqlUtils.preventSQLInjection(username) + " , ");
        strBuf.append("last_update_dttm = " + SqlUtils.preventSQLInjection(lastUpdateDttm) + " ");
        strBuf.append("where ");
        strBuf.append("enable_flag = 1 ");
        strBuf.append("and id = " + SqlUtils.preventSQLInjection(id) + " ");
        if (!isAdmin) {
            strBuf.append("and crt_user = " + SqlUtils.preventSQLInjection(username));
        }
        String sqlStr = strBuf.toString();
        return sqlStr;
    }

    public String getScheduleIdListByStateRunning(boolean isAdmin, String username){
        if (StringUtils.isBlank(username)) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("select * from group_schedule ");
        strBuf.append("where ");
        strBuf.append("enable_flag=1 ");
        strBuf.append("and ");
        strBuf.append("status='RUNNING' ");
        if (!isAdmin) {
            strBuf.append("and crt_user = " + SqlUtils.preventSQLInjection(username));
        }
        return strBuf.toString();
    }

    public String getScheduleIdListByScheduleRunTemplateId(boolean isAdmin, String username, String scheduleRunTemplateId){
        if (StringUtils.isBlank(username) || StringUtils.isBlank(scheduleRunTemplateId)) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("select count(id) from group_schedule ");
        strBuf.append("where ");
        strBuf.append("enable_flag=1 ");
        strBuf.append("and ");
        strBuf.append("schedule_run_template_id=" + SqlUtils.preventSQLInjection(scheduleRunTemplateId));
        if (!isAdmin) {
            strBuf.append("and crt_user = " + SqlUtils.preventSQLInjection(username));
        }
        return strBuf.toString();
    }


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/vo/TestDataSchemaVo.java<|end_filename|>
package cn.cnic.component.testData.vo;

import java.util.ArrayList;
import java.util.List;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TestDataSchemaVo {

    private String id;
    private String fieldName;
    private String fieldType;
    private String fieldDescription;
    private int fieldSoft;
    private TestDataVo testDataVo;
    private List<TestDataSchemaValuesVo> schemaValuesVoList = new ArrayList<>();


}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/vo/StopsComponentVo.java<|end_filename|>
package cn.cnic.component.stopsComponent.vo;

import cn.cnic.common.Eunm.PortType;

import lombok.Getter;
import lombok.Setter;

/**
 * Stop component table
 */
@Getter
@Setter
public class StopsComponentVo {

    private String id;
    private String name;
    private String bundel;
    private String groups;
    private String owner;
    private String description;
    private String inports;
    private PortType inPortType;
    private String outports;
    private PortType outPortType;
    private String stopGroup;
    private Boolean isCustomized = false;
    private String visualizationType;
    private Boolean isShow = true;

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/mapper/provider/TestDataSchemaMapperProvider.java<|end_filename|>
package cn.cnic.component.testData.mapper.provider;

import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.base.utils.SqlUtils;
import cn.cnic.component.testData.entity.TestDataSchema;

public class TestDataSchemaMapperProvider {

    private String id;
    private String lastUpdateUser;
    private String lastUpdateDttmStr;
    private long version;
    private int enableFlag;
    private String fieldName;
    private String fieldType;
    private String fieldDescription;
    private int fieldSoft;
    private String testDataId;

    private boolean preventSQLInjectionTestDataSchema(TestDataSchema testDataSchema) {
        if (null == testDataSchema || StringUtils.isBlank(testDataSchema.getLastUpdateUser())) {
            return false;
        }
        // Mandatory Field
        String lastUpdateDttm = DateUtils.dateTimesToStr(
                null != testDataSchema.getLastUpdateDttm() ? testDataSchema.getLastUpdateDttm() : new Date());
        this.id = SqlUtils.preventSQLInjection(testDataSchema.getId());
        this.enableFlag = ((null != testDataSchema.getEnableFlag() && testDataSchema.getEnableFlag()) ? 1 : 0);
        this.version = (null != testDataSchema.getVersion() ? testDataSchema.getVersion() : 0L);
        this.lastUpdateDttmStr = SqlUtils.preventSQLInjection(lastUpdateDttm);
        this.lastUpdateUser = SqlUtils.preventSQLInjection(testDataSchema.getLastUpdateUser());

        // Selection field
        this.fieldName = SqlUtils.preventSQLInjection(testDataSchema.getFieldName());
        this.fieldType = SqlUtils.preventSQLInjection(testDataSchema.getFieldType());
        this.fieldDescription = SqlUtils.preventSQLInjection(testDataSchema.getFieldDescription());
        this.fieldSoft = testDataSchema.getFieldSoft();
        this.testDataId = SqlUtils.preventSQLInjection(
                null != testDataSchema.getTestData() ? testDataSchema.getTestData().getId() : null);

        return true;
    }

    private void resetTestDataSchema() {
        this.id = null;
        this.lastUpdateUser = null;
        this.lastUpdateDttmStr = null;
        this.version = 0L;
        this.enableFlag = 1;
        this.fieldName = null;
        this.fieldType = null;
        this.fieldDescription = null;
        this.fieldSoft = 0;
        this.testDataId = null;
    }

    /**
     * add TestDataSchema
     * 
     * @param testDataSchema
     * @return Integer
     */
    public String addTestDataSchema(TestDataSchema testDataSchema) {
        String sql = "SELECT 0";
        if (preventSQLInjectionTestDataSchema(testDataSchema)) {
            StringBuffer strBuf = new StringBuffer();
            strBuf.append("INSERT INTO test_data_schema ");
            strBuf.append("( ");
            strBuf.append(SqlUtils.baseFieldName() + ", ");
            strBuf.append("field_name, ");
            strBuf.append("field_type, ");
            strBuf.append("field_description, ");
            strBuf.append("field_soft, ");
            strBuf.append("fk_test_data_id ");
            strBuf.append(") ");

            strBuf.append("values ");
            strBuf.append("(");
            strBuf.append(SqlUtils.baseFieldValues(testDataSchema) + ", ");
            strBuf.append(this.fieldName + ", ");
            strBuf.append(this.fieldType + ", ");
            strBuf.append(this.fieldDescription + ", ");
            strBuf.append(this.fieldSoft + ", ");
            strBuf.append(this.testDataId + " ");
            strBuf.append(")");
            sql = strBuf.toString();
        }
        this.resetTestDataSchema();
        return sql;
    }

    /**
     * add TestDataSchema List
     * 
     * @param testDataSchemaList
     * @return
     */
    public String addTestDataSchemaList(List<TestDataSchema> testDataSchemaList) {
        String sql = "SELECT 0";
        if (null == testDataSchemaList || testDataSchemaList.size() <= 0) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("INSERT INTO test_data_schema ");
        strBuf.append("( ");
        strBuf.append(SqlUtils.baseFieldName() + ", ");
        strBuf.append("field_name, ");
        strBuf.append("field_type, ");
        strBuf.append("field_description, ");
        strBuf.append("field_soft, ");
        strBuf.append("fk_test_data_id ");
        strBuf.append(") ");
        strBuf.append("values ");
        boolean firstFlag = true;
        for (int i = 0; i < testDataSchemaList.size(); i++) {
            TestDataSchema testDataSchema = testDataSchemaList.get(i);
            if (preventSQLInjectionTestDataSchema(testDataSchema)) {
                if (firstFlag) {
                    strBuf.append("(");
                } else {
                    strBuf.append(",(");
                }
                strBuf.append(SqlUtils.baseFieldValues(testDataSchema) + ", ");
                strBuf.append(this.fieldName + ", ");
                strBuf.append(this.fieldType + ", ");
                strBuf.append(this.fieldDescription + ", ");
                strBuf.append(this.fieldSoft + ", ");
                strBuf.append(this.testDataId + " ");
                strBuf.append(")");
            }
            this.resetTestDataSchema();
        }
        sql = strBuf.toString();
        return sql;
    }

    /**
     * update TestDataSchema
     * 
     * @param testDataSchema
     * @return
     */
    public String updateTestDataSchema(TestDataSchema testDataSchema) {
        String sqlStr = "SELECT 0";
        boolean flag = preventSQLInjectionTestDataSchema(testDataSchema);
        if (flag && StringUtils.isNotBlank(this.id)) {
            SQL sql = new SQL();
            // INSERT_INTO brackets is table name
            sql.UPDATE("test_data_schema");
            // The first string in the SET is the name of the field corresponding to the
            // table in the database
            sql.SET("last_update_dttm = " + lastUpdateDttmStr);
            sql.SET("last_update_user = " + lastUpdateUser);
            sql.SET("version = " + (version + 1));

            // handle other fields
            sql.SET("enable_flag = " + this.enableFlag);
            sql.SET("field_name = " + this.fieldName);
            sql.SET("field_type = " + this.fieldType);
            sql.SET("field_description = " + this.fieldDescription);
            sql.SET("field_soft = " + this.fieldSoft);
            sql.SET("fk_test_data_id = " + this.testDataId);
            sql.WHERE("version = " + this.version);
            sql.WHERE("id = " + this.id);
            sqlStr = sql.toString();
        }
        this.resetTestDataSchema();
        return sqlStr;
    }

    /**
     * update TestDataSchema enable_flag
     * 
     * @param isAdmin
     * @param username
     * @param testDataId
     * @return
     */
    public String delTestDataSchemaByTestDataId(boolean isAdmin, String username, String testDataId){
        if (StringUtils.isBlank(testDataId)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("UPDATE test_data_schema SET enable_flag=0 WHERE ");
        stringBuffer.append("fk_test_data_id=" + SqlUtils.preventSQLInjection(testDataId));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }

    /**
     * update TestDataSchema enable_flag
     *
     * @param isAdmin
     * @param username
     * @param schemaId
     * @return
     */
    public String delTestDataSchemaById(boolean isAdmin, String username, String schemaId){
        if (StringUtils.isBlank(schemaId)) {
            return "SELECT 0";
        }
        String condition = "";
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            condition = " AND crt_user=" + SqlUtils.preventSQLInjection(username);
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("UPDATE test_data_schema SET enable_flag=0 WHERE ");
        stringBuffer.append("id=" + SqlUtils.preventSQLInjection(schemaId));
        stringBuffer.append(condition);
        return  stringBuffer.toString();
    }

    /**
     * get TestDataSchema by id
     * 
     * @param id
     * @return
     */
    public String getTestDataSchemaById(String id){
        if (StringUtils.isBlank(id)) {
            return "SELECT 0";
        }
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("SELECT * FROM test_data_schema WHERE enable_flag=1 ");
        stringBuffer.append("AND id=" + SqlUtils.preventSQLInjection(id));
        return  stringBuffer.toString();
    }
    
    /**
     * get TestDataSchema list by testDataId search
     * 
     * @param isAdmin
     * @param username
     * @param param
     * @param testDataId
     * @return
     */
    public String getTestDataSchemaListByTestDataIdSearch(boolean isAdmin, String username, String param, String testDataId){
        if (StringUtils.isBlank(testDataId)) {
            return "SELECT 0";
        }
        StringBuffer stringBuf = new StringBuffer();
        stringBuf.append("SELECT * FROM test_data_schema WHERE enable_flag=1 ");
        stringBuf.append("AND fk_test_data_id=" + SqlUtils.preventSQLInjection(testDataId) + " ");
        if (!isAdmin) {
            if (StringUtils.isBlank(username)) {
                return "SELECT 0";
            }
            stringBuf.append("AND crt_user=" + SqlUtils.preventSQLInjection(username) + " ");
        }
        if (StringUtils.isNotBlank(param)) {
            stringBuf.append("crt_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("last_update_dttm LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("field_name LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
            stringBuf.append("field_type LIKE CONCAT('%'," + SqlUtils.preventSQLInjection(param) + ",'%')");
        }
        stringBuf.append("ORDER BY  field_soft ASC ");
        return stringBuf.toString();
    }

}


<|start_filename|>vue-piflow-web/src/modules/variable.js<|end_filename|>
import Cookies from 'js-cookie';
const state = {
  positionIsShow:false,
  token: Cookies.get('token'),
  user:{}
}
const mutations = {
  setUser(state, data) {
    state.user = data;
  },
  setToken(state, data) {
    state.token = data;
  },
  setPositionIsShow(state, data) {
    state.positionIsShow = data;
  }
}
const actions = {
  setArtile(context, data) {
    context.commit('setArtile', data);
  }
}
const getters = {
  //获文章取条获件分页列表
  getArticleReplyPage(state) {
    return function (pageNo, pageSize) {
      let list = 0;
      return list;
    }
  }
}
export default {
  state,
  actions,
  mutations,
  getters
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/service/IProcessPathService.java<|end_filename|>
package cn.cnic.component.process.service;

import cn.cnic.component.process.vo.ProcessPathVo;

public interface IProcessPathService {

    /**
     * Query processPath based on processId and pageId
     *
     * @param processId
     * @param pageId
     * @return
     */
    public String getProcessPathVoByPageId(String processId, String pageId);

    /**
     * Query processGroupPath based on processId and pageId
     *
     * @param processGroupId
     * @param pageId
     * @return
     */
    public ProcessPathVo getProcessGroupPathVoByPageId(String processGroupId, String pageId);
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/flow/vo/StopsVo.java<|end_filename|>
package cn.cnic.component.flow.vo;

import cn.cnic.base.utils.DateUtils;
import cn.cnic.common.Eunm.PortType;
import cn.cnic.component.dataSource.vo.DataSourceVo;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Stop component table
 */
@Setter
@Getter
public class StopsVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    private FlowVo flowVo;

    private String name;

    private String bundel;

    private String groups;

    private String owner;

    private String description;

    private String pageId;

    private String inports;

    private PortType inPortType;

    private String outports;

    private PortType outPortType;

    private Boolean isCheckpoint;

    private Long version;

    private Boolean isCustomized = false;

    private Date crtDttm = new Date();

    private String language;

    private DataSourceVo dataSourceVo;

    private List<StopsPropertyVo> propertiesVo = new ArrayList<>();

    private List<StopsPropertyVo> oldPropertiesVo = new ArrayList<>();

    private List<StopsCustomizedPropertyVo> stopsCustomizedPropertyVoList = new ArrayList<>();

    public String getCrtDttmString() {
        SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN_yyyy_MM_dd_HH_MM_ss);
        return crtDttm != null ? sdf.format(crtDttm) : "";
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/stopsComponent/vo/StopsTemplateVo.java<|end_filename|>
package cn.cnic.component.stopsComponent.vo;

import cn.cnic.common.Eunm.PortType;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class StopsTemplateVo implements Serializable {
    private static final long serialVersionUID = 1L;

    private String name;

    private String bundel;

    private String groups;

    private String owner;

    private String description;

    private String inports;

    private PortType inPortType;

    private String outports;

    private PortType outPortType;

    private String stopGroup;

    private List<PropertyTemplateVo> propertiesVo = new ArrayList<>();

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/common/Eunm/ProcessType.java<|end_filename|>
package cn.cnic.common.Eunm;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import cn.cnic.base.TextureEnumSerializer;

@JsonSerialize(using = TextureEnumSerializer.class)
public enum ProcessType {
    GROUP("GROUP", "GROUP", "group"),
    TASK("TASK", "TASK", "group");

    private final String value;
    private final String text;
    private final String desc;

    private ProcessType(String text, String value, String desc) {
        this.text = text;
        this.value = value;
        this.desc = desc;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static ProcessType selectGender(String name) {
        for (ProcessType portType : ProcessType.values()) {
            if (name.equalsIgnoreCase(portType.name())) {
                return portType;
            }
        }
        return null;
    }

    public static ProcessType selectGenderByValue(String value) {
        for (ProcessType portType : ProcessType.values()) {
            if (value.equalsIgnoreCase(portType.value)) {
                return portType;
            }
        }
        return null;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/utils/TestDataSchemaValuesSaveVoUtils.java<|end_filename|>
package cn.cnic.component.testData.utils;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import cn.cnic.controller.requestVo.TestDataSchemaValuesSaveVo;
import net.sf.json.JSONObject;

public class TestDataSchemaValuesSaveVoUtils {

    public static TestDataSchemaValuesSaveVo StringToTestDataSchemaValuesSaveVo2(String json) {
        if (StringUtils.isBlank(json)) {
            return null;
        }
        // Also convert the json string to a json object, and then convert the json object to a java object, as shown below.
        JSONObject obj = JSONObject.fromObject(json);// Convert a json string to a json object
        // Needed when there is a List in jsonObj
        @SuppressWarnings("rawtypes")
        Map<String, Class> classMap = new HashMap<String, Class>();
        // Key is the name of the List in jsonObj, and the value is a generic class of list
        classMap.put("schemaValuesList", LinkedHashMap.class);
        classMap.put("schemaValuesIdList", LinkedHashMap.class);
        // Convert a json object to a java object
        Object bean = JSONObject.toBean(obj, TestDataSchemaValuesSaveVo.class, classMap);
        TestDataSchemaValuesSaveVo jb = (TestDataSchemaValuesSaveVo) bean;
        return jb;
    }

}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/testData/utils/TestDataSchemaValuesUtils.java<|end_filename|>
package cn.cnic.component.testData.utils;

import java.util.Date;

import cn.cnic.base.utils.UUIDUtils;
import cn.cnic.component.testData.entity.TestDataSchemaValues;

public class TestDataSchemaValuesUtils {

    /**
     * set TestDataSchemaValues baseInfo
     * 
     * @param testDataSchemaValues
     * @param isSetId
     * @param username
     * @return
     */
    public static TestDataSchemaValues setTestDataSchemaBasicInformation(TestDataSchemaValues testDataSchemaValues, boolean isSetId, String username) {
        if (null == testDataSchemaValues) {
            testDataSchemaValues = new TestDataSchemaValues();
        }
        if (isSetId) {
            testDataSchemaValues.setId(UUIDUtils.getUUID32());
        }
        // set MxGraphModel basic information
        testDataSchemaValues.setCrtDttm(new Date());
        testDataSchemaValues.setCrtUser(username);
        testDataSchemaValues.setLastUpdateDttm(new Date());
        testDataSchemaValues.setLastUpdateUser(username);
        testDataSchemaValues.setVersion(0L);
        return testDataSchemaValues;
    }
}


<|start_filename|>piflow-web/src/main/java/cn/cnic/component/process/mapper/provider/ProcessAndProcessGroupMapperProvider.java<|end_filename|>
package cn.cnic.component.process.mapper.provider;

import cn.cnic.base.utils.SqlUtils;
import org.apache.commons.lang3.StringUtils;

public class ProcessAndProcessGroupMapperProvider {

    public String getProcessAndProcessGroupList(String param) {
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("SELECT ");
        strBuf.append("id, ");
        strBuf.append("last_update_dttm AS lastUpdateDttm, ");
        strBuf.append("crt_dttm AS crtDttm, ");
        strBuf.append("app_id AS appId, ");
        strBuf.append("name, ");
        strBuf.append("description, ");
        strBuf.append("start_time AS startTime, ");
        strBuf.append("end_time AS endTime, ");
        strBuf.append("progress, ");
        strBuf.append("state, ");
        strBuf.append("parent_process_id AS parentProcessId, ");
        strBuf.append("processType ");
        strBuf.append("FROM ");
        strBuf.append("( ");
        strBuf.append("SELECT id,last_update_dttm,crt_dttm,app_id,name,description,start_time,end_time,progress,state,parent_process_id,'TASK' AS processType FROM flow_process ");
        strBuf.append("WHERE enable_flag=1 AND app_id IS NOT NULL AND fk_flow_process_group_id IS NULL AND (name LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR description LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR state LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') " + ") ");
        strBuf.append("UNION ALL ");
        strBuf.append("SELECT id,last_update_dttm,crt_dttm,app_id,name,description,start_time,end_time,progress,state,parent_process_id,'GROUP' AS processType FROM flow_process_group ");
        strBuf.append("WHERE enable_flag=1 AND app_id IS NOT NULL AND fk_flow_process_group_id IS NULL AND (name LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR description LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR state LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') " + ") ");
        strBuf.append(") ");
        strBuf.append("AS re ");
        return strBuf.toString();
    }

    public String getProcessAndProcessGroupListByUser(String param, String username) {
        if (StringUtils.isBlank(username)) {
            return "SELECT 0";
        }
        StringBuffer strBuf = new StringBuffer();
        strBuf.append("SELECT ");
        strBuf.append("id, ");
        strBuf.append("last_update_dttm AS lastUpdateDttm, ");
        strBuf.append("crt_dttm AS crtDttm, ");
        strBuf.append("app_id AS appId, ");
        strBuf.append("name, ");
        strBuf.append("description, ");
        strBuf.append("start_time AS startTime, ");
        strBuf.append("end_time AS endTime, ");
        strBuf.append("progress, ");
        strBuf.append("state, ");
        strBuf.append("parent_process_id AS parentProcessId, ");
        strBuf.append("processType ");
        strBuf.append("FROM ");
        strBuf.append("( ");
        strBuf.append("SELECT id,last_update_dttm,crt_dttm,app_id,name,description,start_time,end_time,progress,state,parent_process_id,'TASK' AS processType FROM flow_process ");
        strBuf.append("WHERE enable_flag=1 AND crt_user=" + SqlUtils.addSqlStrAndReplace(username) + " AND app_id IS NOT NULL AND fk_flow_process_group_id IS NULL AND (name LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR description LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR state LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') " + ") ");
        strBuf.append("UNION ALL ");
        strBuf.append("SELECT id,last_update_dttm,crt_dttm,app_id,name,description,start_time,end_time,progress,state,parent_process_id,'GROUP' AS processType FROM flow_process_group ");
        strBuf.append("WHERE enable_flag=1 AND crt_user=" + SqlUtils.addSqlStrAndReplace(username) + " AND app_id IS NOT NULL AND fk_flow_process_group_id IS NULL AND (name LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR description LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') OR state LIKE CONCAT('%'," + SqlUtils.addSqlStrAndReplace(param) + ",'%') " + ") ");
        strBuf.append(") ");
        strBuf.append("AS re");
        return strBuf.toString();
    }

}


<|start_filename|>piflow-web/src/main/resources/static/my_css/fullScreen.css<|end_filename|>
/* artificially creates a Div that occupies the entire screen with a transparency of 0.7 and a z-index of 9999 so that the previous page is pressed at the bottom and cannot be clicked*/
.fullScreen {
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    opacity: 0.7;
    background-color: black;
    z-index: 999999999;
    text-align: center;
}


<|start_filename|>piflow-web/src/main/resources/static/js/functions.js<|end_filename|>
$(function() {
	//===== Hide/show sidebar =====//
	$('.fullview').click(function(){
	    $("body").toggleClass("clean");
	    $('#sidebar').toggleClass("hide-sidebar mobile-sidebar");
	    $('#content').toggleClass("full-content");
	});



	//===== Hide/show action tabs =====//

	$('.showmenu').click(function () {
		$('.actions-wrapper').slideToggle(100);
	});



	//===== Easy tabs =====//

	$('.sidebar-tabs').easytabs({
		animationSpeed: 150,
		collapsible: false,
		tabActiveClass: "active"
	});

	$('.actions').easytabs({
		animationSpeed: 300,
		collapsible: false,
		tabActiveClass: "current"
	});

	//===== Collapsible plugin for main nav =====//
	
	$('.expand').collapsible({
		defaultOpen: 'current,third',
		cookieName: 'navAct',
		cssOpen: 'subOpened',
		cssClose: 'subClosed',
		speed: 200
	});

	//===== Datatables =====//

	oTable = $(".media-table").dataTable({
		"bJQueryUI": false,
		"bAutoWidth": false,
		"sPaginationType": "full_numbers",
		"sDom": '<"datatable-header"fl>t<"datatable-footer"ip>',
		"oLanguage": {
			"sSearch": "<span>Filter records:</span> _INPUT_",
			"sLengthMenu": "<span>Show entries:</span> _MENU_",
			"oPaginate": { "sFirst": "First", "sLast": "Last", "sNext": ">", "sPrevious": "<" }
		},
		"aoColumnDefs": [
			{ "bSortable": false, "aTargets": [ 0, 4 ] }
		]
	});


});