Commit 6b1352c7 by 谢海旭

实例开启时,增加前置动作:更新 更新客户阶段的sql

1 parent 434c6d60
...@@ -2,6 +2,7 @@ package cn.com.glsx.process.modules.assembler; ...@@ -2,6 +2,7 @@ package cn.com.glsx.process.modules.assembler;
import cn.com.glsx.process.common.sysenum.ResultEnum; import cn.com.glsx.process.common.sysenum.ResultEnum;
import cn.com.glsx.process.exception.AdminException; import cn.com.glsx.process.exception.AdminException;
import cn.com.glsx.process.modules.converter.SopInstConverter;
import cn.com.glsx.process.modules.converter.SopTplNodeProtoConverter; import cn.com.glsx.process.modules.converter.SopTplNodeProtoConverter;
import cn.com.glsx.process.modules.entity.*; import cn.com.glsx.process.modules.entity.*;
import cn.com.glsx.process.modules.mapper.SopInstNodeMapper; import cn.com.glsx.process.modules.mapper.SopInstNodeMapper;
...@@ -283,11 +284,13 @@ public class KeHuLvChengAssembler { ...@@ -283,11 +284,13 @@ public class KeHuLvChengAssembler {
Integer sourceId = lastLink.getSourceId(); Integer sourceId = lastLink.getSourceId();
SopInstNode updateStageNode = nodes.stream().filter(node -> node.getNodeId().equals(sourceId)).findFirst().get(); SopInstNode updateStageNode = nodes.stream().filter(node -> node.getNodeId().equals(sourceId)).findFirst().get();
// TODO 获取阶段更新的sql // 获取阶段更新的sql
SopInst sopInst = SopInstConverter.INSTANCE.dto2do(instDTO);
Map<String, String> stageSqlMap = sopDataService.parseSQL(sopInst);
String updateSql = String.join("\n", stageSqlMap.values());
String nodeContent = updateStageNode.getNodeContent(); String nodeContent = updateStageNode.getNodeContent();
Map<String, Object> nodeContentMap = JSON.parseObject(nodeContent, Map.class); Map<String, Object> nodeContentMap = JSON.parseObject(nodeContent, Map.class);
String updateSql = nodeContentMap.get("source").toString();
nodeContentMap.put("source", updateSql); nodeContentMap.put("source", updateSql);
sopInstNodeMapper.updateNodeContentById(updateStageNode.getInstNodeId(), JSON.toJSONString(nodeContentMap)); sopInstNodeMapper.updateNodeContentById(updateStageNode.getInstNodeId(), JSON.toJSONString(nodeContentMap));
} }
......
...@@ -11,7 +11,7 @@ public interface SopInstConverter { ...@@ -11,7 +11,7 @@ public interface SopInstConverter {
SopInstConverter INSTANCE = Mappers.getMapper(SopInstConverter.class); SopInstConverter INSTANCE = Mappers.getMapper(SopInstConverter.class);
SopInst do2do(SopInst sopInst); SopInst dto2do(SopInstDTO sopInstDTO);
SopInstDTO do2dto(SopInst sopInst); SopInstDTO do2dto(SopInst sopInst);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!