#
Junjie
2024-10-17 d835d1b51f832889929cdf69010034a30ef44d02
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/asrs/controller/FlowController.java
@@ -1,11 +1,12 @@
package com.zy.asrs.wcs.asrs.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.wcs.asrs.entity.FlowGraph;
import com.zy.asrs.wcs.asrs.entity.param.FlowLogicCodeParam;
import com.zy.asrs.wcs.asrs.service.FlowGraphService;
import com.zy.asrs.wcs.core.thread.FlowExecute;
import com.zy.asrs.wcs.asrs.execute.FlowExecute;
import com.zy.asrs.wcs.system.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -72,11 +73,10 @@
            flowGraph.setStatus(0);
        }
        flowGraph.setName(param.get("name").toString());
        flowGraph.setMemo(param.get("memo").toString());
        flowGraph.setMemo(param.get("memo") == null ? "" : param.get("memo").toString());
        flowGraph.setOriginData(param.get("originData").toString());
        flowGraph.setProcessData(JSON.toJSONString(list));
        flowGraph.setProcessData(JSON.toJSONString(param.get("data")));
        flowGraph.setUpdateTime(new Date());
        flowGraph.setHostId(getHostId());
        flowGraphService.saveOrUpdate(flowGraph);
        return R.ok();
@@ -91,7 +91,8 @@
        //开始模拟执行
        String processData = flowGraph.getProcessData();
        List<FlowLogicCodeParam> list = JSON.parseArray(processData, FlowLogicCodeParam.class);
//        List<FlowLogicCodeParam> list = JSON.parseArray(processData, FlowLogicCodeParam.class);
        List<JSONObject> list = JSON.parseArray(processData, JSONObject.class);
        boolean execute = flowExecute.execute(list);
        return R.ok().add(execute);
    }