rev:流程引擎维护;todo:节点功能开发
This commit is contained in:
@@ -16,7 +16,8 @@ import java.util.Map;
|
||||
@AllArgsConstructor
|
||||
public enum StatusEnum {
|
||||
//单据状态库类型
|
||||
FORM_STATUS(MapOf.of("生成", "10", "执行中", "20","完成", "99"));
|
||||
FORM_STATUS(MapOf.of("生成", "10", "执行中", "20","完成", "99")),
|
||||
FLOW_STATUS(MapOf.of("启动", "10", "执行中", "20","暂停", "30","完成", "99"));
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
|
||||
@@ -64,13 +64,18 @@ public class CodeGenerator {
|
||||
// 包配置
|
||||
PackageConfig pc = new PackageConfig();
|
||||
// pc.setModuleName("");
|
||||
if (moduleName.equals("1")){
|
||||
moduleName="";
|
||||
}else {
|
||||
moduleName = "."+moduleName;
|
||||
}
|
||||
pc.setParent("org.nl."+menusName);
|
||||
pc.setController("controller." + moduleName);
|
||||
pc.setMapper("service."+moduleName+".dao.mapper");
|
||||
pc.setService("service." + moduleName);
|
||||
pc.setServiceImpl("service." + moduleName + ".impl");
|
||||
pc.setEntity("service." + moduleName + ".dao");
|
||||
pc.setXml("service." + moduleName + ".dao.mapper.xml");
|
||||
pc.setController("controller" + moduleName);
|
||||
pc.setMapper("service"+moduleName+".dao.mapper");
|
||||
pc.setService("service" + moduleName);
|
||||
pc.setServiceImpl("service" + moduleName + ".impl");
|
||||
pc.setEntity("service" + moduleName + ".dao");
|
||||
pc.setXml("service" + moduleName + ".dao.mapper.xml");
|
||||
mpg.setPackageInfo(pc);
|
||||
// // 自定义配置
|
||||
InjectionConfig cfg = new InjectionConfig() {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.nl.wms.flow_manage.flow.framework;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequence.SequenceFlow;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:00
|
||||
*/
|
||||
@Data
|
||||
public class BpmnModel {
|
||||
|
||||
/**
|
||||
* 触发启动的表单类型
|
||||
*/
|
||||
private String startFormType;
|
||||
|
||||
private FlowNode startEvent;
|
||||
/**
|
||||
* 所有节点
|
||||
*/
|
||||
protected Map<String, FlowNode> processes = new HashMap<>();
|
||||
/**
|
||||
* 流程线集合
|
||||
*/
|
||||
protected List<SequenceFlow> sequenceFlow = new ArrayList<>();
|
||||
/**
|
||||
* 节点集合
|
||||
*/
|
||||
protected List<String> nodeFlow = new ArrayList<>();
|
||||
/**
|
||||
* 自动节点集合
|
||||
*/
|
||||
protected List<String> passNode = new ArrayList<>();
|
||||
/**
|
||||
* 节点配置集合
|
||||
*/
|
||||
protected Map<String, JSONObject> nodeProperties = new HashMap<>();
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.config;
|
||||
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.CommandExecutor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.interceptor.CommandInterceptor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.interceptor.impl.InvokeCommandInterceptor;
|
||||
@@ -8,6 +9,7 @@ import org.nl.wms.flow_manage.flow.framework.process.nodeType.TypeHandler;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.*;
|
||||
|
||||
/*
|
||||
@@ -19,11 +21,14 @@ public class InitFlowConfig {
|
||||
|
||||
@Autowired
|
||||
private Map<String,TypeHandler> handlerMap;
|
||||
@Autowired
|
||||
private Map<String, FlowNodeActivityBehavior> activityBehaviorMap = new HashMap<>();
|
||||
|
||||
public void initConfig(){
|
||||
@Autowired
|
||||
public void initConfig(CommandExecutor commandExecutor){
|
||||
CommandInterceptor first = initCommandInterceptor();
|
||||
CommandExecutor commandExecutor = new CommandExecutor();
|
||||
commandExecutor.setInterceptor(first);
|
||||
CommandExecutor.activityBehaviorMap=activityBehaviorMap;
|
||||
TypeHandler.HANDLER_MAP=handlerMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.impl.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:06
|
||||
*/
|
||||
@Service
|
||||
public class BpmnJSONConverter {
|
||||
|
||||
private static ConcurrentHashMap<String,BpmnModel> BpmnModel_Cache= new ConcurrentHashMap();
|
||||
private static Map<String, BaseNodeConverter> Node_Converter= new HashMap<>();
|
||||
static {
|
||||
Node_Converter.put("form",new FormConverter());
|
||||
Node_Converter.put("startEvent",new StartEventConverter());
|
||||
Node_Converter.put("endEvent",new EndEventConverter());
|
||||
Node_Converter.put("gateWay",new GatewayConverter());
|
||||
Node_Converter.put("serverTask",new ServerTaskConverter());
|
||||
Node_Converter.put("sequenceFlow",new SequenceFlowConverter());
|
||||
Node_Converter.put("sendMsg",new SendMsgConverter());
|
||||
}
|
||||
|
||||
public BpmnModel convertToBpmnModel(String model,String version,JSONObject model_json) {
|
||||
//内存中获取
|
||||
BpmnModel bpmnModel = BpmnModel_Cache.get(model + "_" + version);
|
||||
if (bpmnModel!=null){
|
||||
return bpmnModel;
|
||||
}
|
||||
bpmnModel = new BpmnModel();
|
||||
//节点解析:
|
||||
JSONArray nodes = model_json.getJSONArray("nodes");
|
||||
for (int i = 0; i < nodes.size(); i++) {
|
||||
JSONObject node = nodes.getJSONObject(i);
|
||||
Node_Converter.get(node.getString("type")).convertToBpmnModel(node,bpmnModel);
|
||||
}
|
||||
JSONArray edges = model_json.getJSONArray("edges");
|
||||
for (int i = 0; i < edges.size(); i++) {
|
||||
JSONObject edge = edges.getJSONObject(i);
|
||||
Node_Converter.get("sequenceFlow").convertToBpmnModel(edge,bpmnModel);
|
||||
}
|
||||
return bpmnModel;
|
||||
//流程线
|
||||
// JSONArray edges = model_json.getJSONArray("edges");
|
||||
// model.setStartEventFormTypes(startEventFormTypes);
|
||||
// model.setUserTaskFormTypes(userTaskFormTypes);
|
||||
// try {
|
||||
// Process activeProcess = new Process();
|
||||
// List<SubProcess> activeSubProcessList = new ArrayList<>();
|
||||
// while (xtr.hasNext()) {
|
||||
// try {
|
||||
// xtr.next();
|
||||
// } catch (Exception e) {
|
||||
// LOGGER.debug("Error reading XML document", e);
|
||||
// throw new XMLException("Error reading XML", e);
|
||||
// }
|
||||
//
|
||||
// if (xtr.isEndElement() && (ELEMENT_SUBPROCESS.equals(xtr.getLocalName()) ||
|
||||
// ELEMENT_TRANSACTION.equals(xtr.getLocalName()) ||
|
||||
// ELEMENT_ADHOC_SUBPROCESS.equals(xtr.getLocalName()))) {
|
||||
//
|
||||
// activeSubProcessList.remove(activeSubProcessList.size() - 1);
|
||||
// }
|
||||
//
|
||||
// if (!xtr.isStartElement()) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// if (ELEMENT_DEFINITIONS.equals(xtr.getLocalName())) {
|
||||
// definitionsParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_RESOURCE.equals(xtr.getLocalName())) {
|
||||
// resourceParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_SIGNAL.equals(xtr.getLocalName())) {
|
||||
// signalParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_MESSAGE.equals(xtr.getLocalName())) {
|
||||
// messageParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_ERROR.equals(xtr.getLocalName())) {
|
||||
//
|
||||
// if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_ID))) {
|
||||
// model.addError(xtr.getAttributeValue(null, ATTRIBUTE_ID), xtr.getAttributeValue(null, ATTRIBUTE_ERROR_CODE));
|
||||
// }
|
||||
//
|
||||
// } else if (ELEMENT_ESCALATION.equals(xtr.getLocalName())) {
|
||||
//
|
||||
// if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_ID))) {
|
||||
// model.addEscalation(xtr.getAttributeValue(null, ATTRIBUTE_ID), xtr.getAttributeValue(null, ATTRIBUTE_ESCALATION_CODE),
|
||||
// xtr.getAttributeValue(null, ATTRIBUTE_NAME));
|
||||
// }
|
||||
//
|
||||
// } else if (ELEMENT_IMPORT.equals(xtr.getLocalName())) {
|
||||
// importParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_ITEM_DEFINITION.equals(xtr.getLocalName())) {
|
||||
// itemDefinitionParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_DATA_STORE.equals(xtr.getLocalName())) {
|
||||
// dataStoreParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_INTERFACE.equals(xtr.getLocalName())) {
|
||||
// interfaceParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_IOSPECIFICATION.equals(xtr.getLocalName())) {
|
||||
// ioSpecificationParser.parseChildElement(xtr, activeProcess, model);
|
||||
//
|
||||
// } else if (ELEMENT_PARTICIPANT.equals(xtr.getLocalName())) {
|
||||
// participantParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_MESSAGE_FLOW.equals(xtr.getLocalName())) {
|
||||
// messageFlowParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_PROCESS.equals(xtr.getLocalName())) {
|
||||
//
|
||||
// Process process = processParser.parse(xtr, model);
|
||||
// if (process != null) {
|
||||
// activeProcess = process;
|
||||
// // copy over anything already parsed
|
||||
// process.setAttributes(activeProcess.getAttributes());
|
||||
// process.setDocumentation(activeProcess.getDocumentation());
|
||||
// process.setExtensionElements(activeProcess.getExtensionElements());
|
||||
// }
|
||||
//
|
||||
// } else if (ELEMENT_POTENTIAL_STARTER.equals(xtr.getLocalName())) {
|
||||
// potentialStarterParser.parse(xtr, activeProcess);
|
||||
//
|
||||
// } else if (ELEMENT_LANE.equals(xtr.getLocalName())) {
|
||||
// laneParser.parse(xtr, activeProcess, model);
|
||||
//
|
||||
// } else if (ELEMENT_DOCUMENTATION.equals(xtr.getLocalName())) {
|
||||
//
|
||||
// BaseElement parentElement = null;
|
||||
// if (!activeSubProcessList.isEmpty()) {
|
||||
// parentElement = activeSubProcessList.get(activeSubProcessList.size() - 1);
|
||||
// } else if (activeProcess != null) {
|
||||
// parentElement = activeProcess;
|
||||
// }
|
||||
// documentationParser.parseChildElement(xtr, parentElement, model);
|
||||
//
|
||||
// } else if (activeProcess == null && ELEMENT_TEXT_ANNOTATION.equals(xtr.getLocalName())) {
|
||||
// String elementId = xtr.getAttributeValue(null, ATTRIBUTE_ID);
|
||||
// TextAnnotation textAnnotation = (TextAnnotation) new TextAnnotationXMLConverter().convertXMLToElement(xtr, model);
|
||||
// textAnnotation.setId(elementId);
|
||||
// model.getGlobalArtifacts().add(textAnnotation);
|
||||
//
|
||||
// } else if (activeProcess == null && ELEMENT_ASSOCIATION.equals(xtr.getLocalName())) {
|
||||
// String elementId = xtr.getAttributeValue(null, ATTRIBUTE_ID);
|
||||
// Association association = (Association) new AssociationXMLConverter().convertXMLToElement(xtr, model);
|
||||
// association.setId(elementId);
|
||||
// model.getGlobalArtifacts().add(association);
|
||||
//
|
||||
// } else if (ELEMENT_EXTENSIONS.equals(xtr.getLocalName())) {
|
||||
// extensionElementsParser.parse(xtr, activeSubProcessList, activeProcess, model);
|
||||
//
|
||||
// } else if (ELEMENT_SUBPROCESS.equals(xtr.getLocalName()) || ELEMENT_TRANSACTION.equals(xtr.getLocalName()) || ELEMENT_ADHOC_SUBPROCESS.equals(xtr.getLocalName())) {
|
||||
// subProcessParser.parse(xtr, activeSubProcessList, activeProcess);
|
||||
//
|
||||
// } else if (ELEMENT_COMPLETION_CONDITION.equals(xtr.getLocalName())) {
|
||||
// if (!activeSubProcessList.isEmpty()) {
|
||||
// SubProcess subProcess = activeSubProcessList.get(activeSubProcessList.size() - 1);
|
||||
// if (subProcess instanceof AdhocSubProcess) {
|
||||
// AdhocSubProcess adhocSubProcess = (AdhocSubProcess) subProcess;
|
||||
// adhocSubProcess.setCompletionCondition(xtr.getElementText());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// } else if (ELEMENT_DI_SHAPE.equals(xtr.getLocalName())) {
|
||||
// bpmnShapeParser.parse(xtr, model);
|
||||
//
|
||||
// } else if (ELEMENT_DI_EDGE.equals(xtr.getLocalName())) {
|
||||
// bpmnEdgeParser.parse(xtr, model);
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// if (!activeSubProcessList.isEmpty() && ELEMENT_MULTIINSTANCE.equalsIgnoreCase(xtr.getLocalName())) {
|
||||
// multiInstanceParser.parseChildElement(xtr, activeSubProcessList.get(activeSubProcessList.size() - 1), model);
|
||||
//
|
||||
// } else if (convertersToBpmnMap.containsKey(xtr.getLocalName())) {
|
||||
// if (activeProcess != null) {
|
||||
// BaseBpmnXMLConverter converter = convertersToBpmnMap.get(xtr.getLocalName());
|
||||
// converter.convertToBpmnModel(xtr, model, activeProcess, activeSubProcessList);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (Process process : model.getProcesses()) {
|
||||
// for (Pool pool : model.getPools()) {
|
||||
// if (process.getId().equals(pool.getProcessRef())) {
|
||||
// pool.setExecutable(process.isExecutable());
|
||||
// }
|
||||
// }
|
||||
// processFlowElements(process.getFlowElements(), process);
|
||||
// }
|
||||
//
|
||||
// } catch (XMLException e) {
|
||||
// throw e;
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// LOGGER.error("Error processing BPMN document", e);
|
||||
// throw new XMLException("Error processing BPMN document", e);
|
||||
// }
|
||||
// return model;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:07
|
||||
*/
|
||||
public abstract class BaseNodeConverter {
|
||||
public abstract void convertToBpmnModel(JSONObject node, BpmnModel model);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.EventNode.EndEvent;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:08
|
||||
*/
|
||||
public class EndEventConverter extends BaseNodeConverter {
|
||||
@Override
|
||||
public void convertToBpmnModel(JSONObject node, BpmnModel model) {
|
||||
JSONObject properties = node.getJSONObject("properties");
|
||||
String type = node.getString("type");
|
||||
Boolean pass = properties.getBoolean("pass");
|
||||
EndEvent end = new EndEvent();
|
||||
end.setId(node.getString("id"));
|
||||
end.setType(node.getString("type"));
|
||||
end.setName(properties.getString("name"));
|
||||
end.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
end.setExecutionListeners(null);
|
||||
end.setSkipExpression(properties.getString("skipExpression"));
|
||||
if (pass){
|
||||
model.getPassNode().add(type);
|
||||
}
|
||||
model.getNodeFlow().add(type);
|
||||
model.getNodeProperties().put(type,properties);
|
||||
|
||||
model.getProcesses().put(end.getId(),end);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.EventNode.StartEvent;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.Form;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:08
|
||||
*/
|
||||
public class FormConverter extends BaseNodeConverter {
|
||||
@Override
|
||||
public void convertToBpmnModel(JSONObject node, BpmnModel model) {
|
||||
JSONObject properties = node.getJSONObject("properties");
|
||||
String type = node.getString("type");
|
||||
Boolean pass = properties.getBoolean("pass");
|
||||
Form form = new Form();
|
||||
form.setPassNode(pass);
|
||||
form.setId(node.getString("id"));
|
||||
form.setType(node.getString("type"));
|
||||
form.setName(properties.getString("name"));
|
||||
form.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
form.setExecutionListeners(null);
|
||||
form.getSkipExpression().add(properties.getString("skipExpression"));
|
||||
if (pass!=null && pass){
|
||||
model.getPassNode().add(type);
|
||||
}
|
||||
model.getNodeFlow().add(type);
|
||||
model.getNodeProperties().put(type,properties);
|
||||
|
||||
model.getProcesses().put(form.getId(),form);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.gateway.GateWay;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.ServerTask;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:08
|
||||
*/
|
||||
public class GatewayConverter extends BaseNodeConverter {
|
||||
@Override
|
||||
public void convertToBpmnModel(JSONObject node, BpmnModel model) {
|
||||
JSONObject properties = node.getJSONObject("properties");
|
||||
String type = node.getString("type");
|
||||
Boolean pass = properties.getBoolean("pass");
|
||||
GateWay gateWay = new GateWay();
|
||||
gateWay.setPassNode(pass);
|
||||
gateWay.setId(node.getString("id"));
|
||||
gateWay.setType(node.getString("type"));
|
||||
gateWay.setName(properties.getString("name"));
|
||||
gateWay.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
gateWay.setExecutionListeners(null);
|
||||
gateWay.setSkipExpression(properties.getString("skipExpression"));
|
||||
if (pass){
|
||||
model.getPassNode().add(type);
|
||||
}
|
||||
model.getNodeFlow().add(type);
|
||||
model.getNodeProperties().put(type,properties);
|
||||
|
||||
model.getProcesses().put(gateWay.getId(),gateWay);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.gateway.GateWay;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.SendMsg;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:08
|
||||
*/
|
||||
public class SendMsgConverter extends BaseNodeConverter {
|
||||
@Override
|
||||
public void convertToBpmnModel(JSONObject node, BpmnModel model) {
|
||||
JSONObject properties = node.getJSONObject("properties");
|
||||
String type = node.getString("type");
|
||||
Boolean pass = properties.getBoolean("pass");
|
||||
SendMsg msg = new SendMsg();
|
||||
msg.setPassNode(pass);
|
||||
msg.setId(node.getString("id"));
|
||||
msg.setType(node.getString("type"));
|
||||
msg.setName(properties.getString("name"));
|
||||
msg.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
msg.setExecutionListeners(null);
|
||||
msg.setSkipExpression(properties.getString("skipExpression"));
|
||||
if (pass){
|
||||
model.getPassNode().add(type);
|
||||
}
|
||||
model.getNodeFlow().add(type);
|
||||
model.getNodeProperties().put(type,properties);
|
||||
|
||||
model.getProcesses().put(msg.getId(),msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequence.SequenceFlow;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:08
|
||||
* 流程线处理:衔接所有流程
|
||||
*/
|
||||
public class SequenceFlowConverter extends BaseNodeConverter {
|
||||
@Override
|
||||
public void convertToBpmnModel(JSONObject node, BpmnModel model) {
|
||||
JSONObject properties = node.getJSONObject("properties");
|
||||
SequenceFlow sequenceFlow = new SequenceFlow();
|
||||
sequenceFlow.setId(node.getString("id"));
|
||||
sequenceFlow.setType(node.getString("type"));
|
||||
sequenceFlow.setName(properties.getString("name"));
|
||||
sequenceFlow.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
sequenceFlow.setExecutionListeners(null);
|
||||
sequenceFlow.setSkipExpression(properties.getString("skipExpression"));
|
||||
|
||||
FlowNode sourceNode = model.getProcesses().get(node.getString("sourceNodeId"));
|
||||
sourceNode.getOutgoingFlows().add(sequenceFlow);
|
||||
FlowNode targetNode = model.getProcesses().get(node.getString("targetNodeId"));
|
||||
targetNode.getIncomingFlows().add(sequenceFlow);
|
||||
sequenceFlow.setSourceFlowElement(sourceNode);
|
||||
sequenceFlow.setTargetFlowElement(targetNode);
|
||||
|
||||
model.getSequenceFlow().add(sequenceFlow);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.Form;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.ServerTask;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:08
|
||||
*/
|
||||
public class ServerTaskConverter extends BaseNodeConverter {
|
||||
@Override
|
||||
public void convertToBpmnModel(JSONObject node, BpmnModel model) {
|
||||
JSONObject properties = node.getJSONObject("properties");
|
||||
String type = node.getString("type");
|
||||
Boolean pass = properties.getBoolean("pass");
|
||||
ServerTask form = new ServerTask();
|
||||
form.setId(node.getString("id"));
|
||||
form.setType(node.getString("type"));
|
||||
form.setName(properties.getString("name"));
|
||||
form.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
form.setExecutionListeners(null);
|
||||
form.setSkipExpression(properties.getString("skipExpression"));
|
||||
if (pass!=null){
|
||||
form.setPassNode(pass);
|
||||
model.getPassNode().add(type);
|
||||
}
|
||||
model.getNodeFlow().add(type);
|
||||
model.getNodeProperties().put(type,properties);
|
||||
|
||||
model.getProcesses().put(form.getId(),form); }
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.converter.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.node.BaseNodeConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.EventNode.StartEvent;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/4/26 11:08
|
||||
*/
|
||||
public class StartEventConverter extends BaseNodeConverter {
|
||||
@Override
|
||||
public void convertToBpmnModel(JSONObject node, BpmnModel model) {
|
||||
JSONObject properties = node.getJSONObject("properties");
|
||||
String type = node.getString("type");
|
||||
Boolean pass = properties.getBoolean("pass");
|
||||
StartEvent start = new StartEvent();
|
||||
start.setId(node.getString("id"));
|
||||
start.setType(node.getString("type"));
|
||||
start.setName(properties.getString("name"));
|
||||
start.setDocumentation(properties.getString("documentation"));
|
||||
//设置触发事件
|
||||
start.setPassNode(true);
|
||||
start.setExecutionListeners(null);
|
||||
start.setSkipExpression(properties.getString("skipExpression"));
|
||||
|
||||
model.getPassNode().add(type);
|
||||
model.getNodeFlow().add(type);
|
||||
model.getNodeProperties().put(type,properties);
|
||||
model.setStartFormType(properties.getString("form_type"));
|
||||
model.setStartEvent(start);
|
||||
model.getProcesses().put(start.getId(),start);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,21 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.CommandExecutor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.operation.impl.SequenceFlowOperation;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.nl.wms.flow_manage.flow.service.history.IActHiExecutionService;
|
||||
import org.nl.wms.flow_manage.flow.service.history.dao.ActHiExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
@@ -10,14 +24,55 @@ import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
*/
|
||||
public abstract class FlowNodeActivityBehavior<T> {
|
||||
|
||||
public void execute(ExecutionEntity<T> execution) {
|
||||
leave(execution);
|
||||
@Autowired
|
||||
public IActRuExecutionService iActRuExecutionService;
|
||||
|
||||
@Autowired
|
||||
public IActHiExecutionService history;
|
||||
|
||||
public final void activity(ExecutionEntity<T> entity) {
|
||||
try {
|
||||
this.execute(entity);
|
||||
this.leaveActivity(entity);
|
||||
}catch (Exception ex){
|
||||
ActRuExecution execution = new ActRuExecution();
|
||||
execution.setProc_inst_id(entity.getProc_inst_id());
|
||||
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
||||
.eq("proc_inst_id",entity.getProc_inst_id())
|
||||
.set("status", StatusEnum.FLOW_STATUS.code("暂停"))
|
||||
.set("remark","流程节点:"+entity.getActivityId()+"执行错误"+ex.getMessage()));
|
||||
}
|
||||
}
|
||||
private final void leaveActivity(ExecutionEntity<T> entity) {
|
||||
String now = DateUtil.now();
|
||||
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
||||
.eq("proc_inst_id",entity.getProc_inst_id())
|
||||
.set("form_type", entity.getForm_type())
|
||||
.set("form_id", entity.getForm_id())
|
||||
.set("update_time", now));
|
||||
//TODO:存储流程处理历史数据;判断是否自动执行下一个流程
|
||||
ActHiExecution historyEntity = new ActHiExecution();
|
||||
historyEntity.setProc_inst_id(entity.getProc_inst_id());
|
||||
historyEntity.setActivity_id(entity.getActivityId());
|
||||
historyEntity.setActivity_name(entity.getActivityName());
|
||||
historyEntity.setForm_type(entity.getForm_type());
|
||||
historyEntity.setForm_id(entity.getForm_id());
|
||||
historyEntity.setForm_data(new JSONObject(MapOf.of("item",entity.getT())));
|
||||
historyEntity.setUpdate_time(now);
|
||||
history.save(historyEntity);
|
||||
|
||||
this.leave(entity);
|
||||
|
||||
FlowNode currentFlowElement = (FlowNode)entity.getCurrentFlowElement();
|
||||
if (currentFlowElement.getPassNode()){
|
||||
CommandExecutor.getAgenda().planOperation(new SequenceFlowOperation(entity));
|
||||
}
|
||||
}
|
||||
|
||||
public void execute(ExecutionEntity<T> execution) {}
|
||||
|
||||
/**
|
||||
* Default way of leaving a BPMN 2.0 activity: evaluate the conditions on the outgoing sequence flow and take those that evaluate to true.
|
||||
*/
|
||||
public void leave(ExecutionEntity<T> execution) {
|
||||
leave(execution);
|
||||
}
|
||||
public void leave(ExecutionEntity<T> execution) { }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
* 源:UserTask
|
||||
*/
|
||||
@Service("endEvent")
|
||||
public class EndEventActivityBehavior extends FlowNodeActivityBehavior {
|
||||
|
||||
@Autowired
|
||||
IActReProcdefService deploymentService;
|
||||
|
||||
@Override
|
||||
public void execute(ExecutionEntity entity) {
|
||||
/*
|
||||
* 1.创建实例对象
|
||||
* 2.创建当前activity_id
|
||||
* 3.保存当前表单信息
|
||||
* 4.跳转到下一个流程FormTask
|
||||
* 5.离开节点的时进行squeaflow表达式判断
|
||||
* */
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leave(ExecutionEntity entity) {
|
||||
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
||||
.eq("proc_inst_id",entity.getProc_inst_id())
|
||||
.set("status", StatusEnum.FLOW_STATUS.code("完成")));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.FormTask;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.Form;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -12,18 +12,18 @@ import org.springframework.stereotype.Service;
|
||||
* @Date 2024/3/18 13:17
|
||||
* 源:UserTask
|
||||
*/
|
||||
@Service
|
||||
public class FormTaskActivityBehavior extends FlowNodeActivityBehavior<PmFormData> {
|
||||
@Service("form")
|
||||
public class FormActivityBehavior extends FlowNodeActivityBehavior<PmFormData> {
|
||||
|
||||
@Override
|
||||
public void execute(ExecutionEntity<PmFormData> execution) {
|
||||
FlowElement flowElement = execution.getCurrentFlowElement();
|
||||
String type = flowElement.getType();
|
||||
if (flowElement instanceof FormTask){
|
||||
if (flowElement instanceof Form){
|
||||
//根据当前表单配置生成当前节点表单数据
|
||||
FormTask formTask = (FormTask) flowElement;
|
||||
Form formTask = (Form) flowElement;
|
||||
}
|
||||
PmFormData sourceForm = execution.getT();
|
||||
// PmFormData sourceForm = execution.getT();
|
||||
//TODO:获取不同的类型执行器.处理该节点:获取当前表单
|
||||
//获取表单配置表
|
||||
}
|
||||
@@ -1,12 +1,19 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
*/
|
||||
@Service
|
||||
@Service("gateWay")
|
||||
public class GateWayActivityBehavior extends FlowNodeActivityBehavior {
|
||||
|
||||
@Override
|
||||
public void execute(ExecutionEntity execution) {
|
||||
System.out.println(execution.getCurrentFlowElement().getType());
|
||||
super.execute(execution);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.FormTask;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.Form;
|
||||
import org.nl.wms.flow_manage.flow.framework.process.nodeType.TypeHandler;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.PmFormDataDto;
|
||||
import org.nl.wms.stor_manage.service.in.iostor.IStIvtIostorinvInService;
|
||||
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
确认有没有自定义字段:如果有则创建自定义字段
|
||||
生成出入库单单据
|
||||
*/
|
||||
@Service
|
||||
@Service("iostorIn")
|
||||
public class IostorInActivityBehavior extends FlowNodeActivityBehavior<PmFormDataDto> {
|
||||
@Autowired
|
||||
IBmFormStrucService iBmFormStrucService;
|
||||
@@ -42,9 +42,9 @@ public class IostorInActivityBehavior extends FlowNodeActivityBehavior<PmFormDat
|
||||
@Override
|
||||
public void execute(ExecutionEntity<PmFormDataDto> execution) {
|
||||
FlowElement flowElement = execution.getCurrentFlowElement();
|
||||
if (flowElement instanceof FormTask){
|
||||
if (flowElement instanceof Form){
|
||||
//根据当前表单配置生成当前节点表单数据
|
||||
FormTask formTask = (FormTask) flowElement;
|
||||
Form formTask = (Form) flowElement;
|
||||
PmFormDataDto sourceData = execution.getT();
|
||||
BmFormStruc formStruc = iBmFormStrucService.getOne(new QueryWrapper<BmFormStruc>()
|
||||
.eq("form_type", formTask.getForm_type()));
|
||||
@@ -53,7 +53,7 @@ public class IostorInActivityBehavior extends FlowNodeActivityBehavior<PmFormDat
|
||||
}
|
||||
//处理自定义参数:
|
||||
if (formTask.getSkipExpression()!=null || formTask.getSkipExpression().size()>0){
|
||||
TypeHandler<JSONObject,PmFormDataDto> typeHandler = TypeHandler.HANDLER_MAP.get(formTask.getTask_type());
|
||||
TypeHandler<JSONObject,PmFormDataDto> typeHandler = TypeHandler.HANDLER_MAP.get(formTask.getCategory());
|
||||
if (typeHandler==null){
|
||||
throw new BadRequestException("【flow】当前节点处理类型未定义");
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.FormTask;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl.Form;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -12,16 +12,16 @@ import org.springframework.stereotype.Service;
|
||||
* @Date 2024/3/18 13:17
|
||||
* 源:UserTask
|
||||
*/
|
||||
@Service
|
||||
@Service("iostorOut")
|
||||
public class IostorOutActivityBehavior extends FlowNodeActivityBehavior<PmFormData> {
|
||||
|
||||
@Override
|
||||
public void execute(ExecutionEntity<PmFormData> execution) {
|
||||
FlowElement flowElement = execution.getCurrentFlowElement();
|
||||
String type = flowElement.getType();
|
||||
if (flowElement instanceof FormTask){
|
||||
if (flowElement instanceof Form){
|
||||
//根据当前表单配置生成当前节点表单数据
|
||||
FormTask formTask = (FormTask) flowElement;
|
||||
Form formTask = (Form) flowElement;
|
||||
}
|
||||
PmFormData sourceForm = execution.getT();
|
||||
//TODO:获取不同的类型执行器.处理该节点:获取当前表单
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
*/
|
||||
@Service
|
||||
public class ScriptTaskActivityBehavior extends FlowNodeActivityBehavior {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
*/
|
||||
@Service("sendMsg")
|
||||
public class SendMsgActivityBehavior extends FlowNodeActivityBehavior {
|
||||
|
||||
@Override
|
||||
public void execute(ExecutionEntity execution) {
|
||||
System.out.println(execution.getCurrentFlowElement().getType());
|
||||
super.execute(execution);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,6 @@ import org.springframework.stereotype.Service;
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
*/
|
||||
@Service
|
||||
@Service("serverTask")
|
||||
public class ServerTaskActivityBehavior extends FlowNodeActivityBehavior {
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.engine.behavior.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBehavior;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.CommandExecutor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.operation.impl.ContinuOperation;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.operation.impl.SequenceFlowOperation;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequen.SequenceFlow;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||
@@ -17,45 +16,44 @@ import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 13:17
|
||||
* 源:UserTask
|
||||
*/
|
||||
@Service
|
||||
@Service("startEvent")
|
||||
public class StartEventActivityBehavior extends FlowNodeActivityBehavior {
|
||||
|
||||
@Autowired
|
||||
IActRuExecutionService executionService;
|
||||
@Autowired
|
||||
IActReProcdefService deploymentService;
|
||||
|
||||
@Override
|
||||
public void execute(ExecutionEntity execution) {
|
||||
FlowNode flowNode = (FlowNode)execution.getCurrentFlowElement();
|
||||
String type = flowNode.getType();
|
||||
public void execute(ExecutionEntity entity) {
|
||||
/*
|
||||
* 1.创建实例对象
|
||||
* 2.创建当前activity_id
|
||||
* 3.保存当前表单信息
|
||||
* 4.跳转到下一个流程FormTask
|
||||
* 5.离开节点的时进行squeaflow表达式判断
|
||||
* 5.离开节点的时进行squeaflow表/api/mdGruopDick/达式判断
|
||||
* */
|
||||
ActReProcdef deployment = deploymentService.getById(execution.getDeploymentId());
|
||||
ActReProcdef deployment = deploymentService.getById(entity.getDeploymentId());
|
||||
if (deployment==null){throw new BadRequestException("当前部署的流程状态异常");}
|
||||
ActRuExecution actRuExecution = new ActRuExecution();
|
||||
actRuExecution.setActivity_id(execution.getActivityId());
|
||||
actRuExecution.setDeployment_id(deployment.getDeployment_id());
|
||||
actRuExecution.setProc_inst_id(IdUtil.getStringId());
|
||||
executionService.save(actRuExecution);
|
||||
this.leave(execution);
|
||||
//创建流程实例:
|
||||
ActRuExecution execution = new ActRuExecution();
|
||||
execution.setProc_inst_id(IdUtil.getStringId());
|
||||
execution.setDeployment_id(deployment.getDeployment_id());
|
||||
execution.setForm_type(entity.getForm_type());
|
||||
execution.setForm_id(entity.getForm_id());
|
||||
execution.setActivity_id(entity.getActivityId());
|
||||
execution.setCreate_time(DateUtil.now());
|
||||
execution.setStatus(StatusEnum.FLOW_STATUS.code("启动"));
|
||||
iActRuExecutionService.save(execution);
|
||||
entity.setProc_inst_id(execution.getProc_inst_id());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leave(ExecutionEntity execution) {
|
||||
CommandExecutor.getAgenda().planOperation(new SequenceFlowOperation(execution));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.nl.wms.flow_manage.flow.framework.engine.behavior.FlowNodeActivityBeh
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.interceptor.CommandInterceptor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.unify.Command;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -11,10 +11,10 @@ import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
* @Date 2024/3/19 17:57
|
||||
*/
|
||||
public class StartInstanceCmd implements Command {
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEntity entity) {
|
||||
//获取当前流程版本信息:
|
||||
FlowElement currentFlowElement = entity.getCurrentFlowElement();
|
||||
CommandExecutor.getAgenda().planOperation(new ContinuOperation(entity));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.nl.wms.flow_manage.flow.framework.engine.operation.AbstractOperation;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequen.SequenceFlow;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequence.SequenceFlow;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
@@ -28,8 +28,13 @@ public class ContinuOperation extends AbstractOperation {
|
||||
if (currentFlowElement instanceof FlowNode) {
|
||||
//TODO:执行监听器
|
||||
//处理当前节点业务,更新当前流程执行id:获取当前流程节点对应的处理器
|
||||
CommandExecutor.activityBehaviorMap.get(currentFlowElement.getType()).execute(execution);
|
||||
// continueThroughFlowNode((FlowNode) currentFlowElement);
|
||||
try {
|
||||
CommandExecutor.activityBehaviorMap.get(currentFlowElement.getType()).activity(execution);
|
||||
}catch (Exception ex){
|
||||
//如果节点处理错误需要更新当前流程实例信息
|
||||
System.out.println(ex.getMessage());
|
||||
throw new BadRequestException(ex.getMessage());
|
||||
}
|
||||
} else if (currentFlowElement instanceof SequenceFlow) {
|
||||
SequenceFlow sequenceFlow = (SequenceFlow) currentFlowElement;
|
||||
//判断当前流程表达式是否中断或者跳过:跳过则执行下一个流程
|
||||
|
||||
@@ -5,7 +5,8 @@ import org.nl.wms.flow_manage.flow.framework.engine.operation.AbstractOperation;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequen.SequenceFlow;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequence.SequenceFlow;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,13 +27,14 @@ public class SequenceFlowOperation extends AbstractOperation {
|
||||
if (flowElement instanceof FlowNode){
|
||||
FlowNode flowNode = (FlowNode) flowElement;
|
||||
List<SequenceFlow> outgoingFlows = flowNode.getOutgoingFlows();
|
||||
for (SequenceFlow sequenceFlow : outgoingFlows) {
|
||||
String skipExpression = sequenceFlow.getSkipExpression();
|
||||
//流程线的脚本判断获取当下一个节点
|
||||
execution.setCurrentFlowElement(sequenceFlow.getTargetFlowElement());
|
||||
if (!CollectionUtils.isEmpty(outgoingFlows)){
|
||||
for (SequenceFlow sequenceFlow : outgoingFlows) {
|
||||
String skipExpression = sequenceFlow.getSkipExpression();
|
||||
//TODO:流程线的脚本判断获取当下一个节点:当前节点或者下个节点
|
||||
execution.setCurrentFlowElement(sequenceFlow.getTargetFlowElement());
|
||||
}
|
||||
CommandExecutor.getAgenda().planOperation(new ContinuOperation(execution));
|
||||
}
|
||||
//
|
||||
CommandExecutor.getAgenda().planOperation(new ContinuOperation(execution));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
|
||||
@@ -12,16 +13,40 @@ import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
public class ExecutionEntity<T> {
|
||||
protected FlowElement currentFlowElement;
|
||||
//用于获取当前流程实例对象
|
||||
protected String processDefinitionId;
|
||||
protected String proc_inst_id;
|
||||
//当前流程id=currentFlowElement.getId()
|
||||
protected String startActivityId;
|
||||
protected String activityId;
|
||||
protected String activityName;
|
||||
protected String deploymentId;
|
||||
protected String form_type;
|
||||
protected String form_id;
|
||||
protected T t;
|
||||
|
||||
public void setCurrentFlowElement(FlowElement currentFlowElement) {
|
||||
this.currentFlowElement = currentFlowElement;
|
||||
this.activityId = currentFlowElement.getId();
|
||||
this.activityName = currentFlowElement.getName();
|
||||
}
|
||||
|
||||
public void setProc_inst_id(String proc_inst_id) {
|
||||
this.proc_inst_id = proc_inst_id;
|
||||
}
|
||||
|
||||
public void setStartActivityId(String startActivityId) {
|
||||
this.startActivityId = startActivityId;
|
||||
}
|
||||
|
||||
public void setDeploymentId(String deploymentId) {
|
||||
this.deploymentId = deploymentId;
|
||||
}
|
||||
|
||||
public void setForm_type(String form_type) {
|
||||
this.form_type = form_type;
|
||||
}
|
||||
|
||||
public void setForm_id(String form_id) {
|
||||
this.form_id = form_id;
|
||||
}
|
||||
|
||||
public void setT(T t) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.Map;
|
||||
@Data
|
||||
public class BaseElement {
|
||||
protected String id;
|
||||
//目前是基于json不是xml这几个字段暂时不用
|
||||
protected int xmlRowNumber;
|
||||
protected int xmlColumnNumber;
|
||||
protected Map<String, List<ExtensionElement>> extensionElements = new LinkedHashMap<>();
|
||||
|
||||
@@ -24,6 +24,10 @@ public abstract class FlowElement extends BaseElement {
|
||||
protected String type;
|
||||
protected String name;
|
||||
protected String documentation;
|
||||
/**
|
||||
* 是否自动触发下个节点
|
||||
*/
|
||||
|
||||
protected List<Map> executionListeners = new ArrayList<>();
|
||||
|
||||
// protected FlowElementsContainer parentContainer;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.entity.node.base.impl;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequen.SequenceFlow;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequence.SequenceFlow;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -20,6 +20,7 @@ public abstract class FlowNode extends FlowElement {
|
||||
private boolean asynchronous;
|
||||
private boolean asynchronousLeave;
|
||||
private boolean notExclusive;
|
||||
protected Boolean passNode = Boolean.FALSE;
|
||||
|
||||
private List<SequenceFlow> incomingFlows = new ArrayList<>();
|
||||
private List<SequenceFlow> outgoingFlows = new ArrayList<>();
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.wms.flow_manage.flow.framework.entity.node.impl.EventNode;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EndEvent extends FlowNode {
|
||||
|
||||
protected String conditionExpression;
|
||||
protected String skipExpression;
|
||||
|
||||
protected FlowElement sourceFlowElement;
|
||||
|
||||
/**
|
||||
* Graphical information: a list of waypoints: x1, y1, x2, y2, x3, y3, ..
|
||||
*
|
||||
* Added during parsing of a process definition.
|
||||
*/
|
||||
protected List<Integer> waypoints = new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.wms.flow_manage.flow.framework.entity.node.impl.EventNode;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
|
||||
|
||||
@Data
|
||||
public class StartEvent extends FlowNode {
|
||||
|
||||
protected String skipExpression;
|
||||
protected FlowElement targetFlowElement;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -10,10 +10,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequen;
|
||||
package org.nl.wms.flow_manage.flow.framework.entity.node.impl.Sequence;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowElement;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -24,9 +25,9 @@ public class SequenceFlow extends FlowElement {
|
||||
protected String conditionExpression;
|
||||
protected String skipExpression;
|
||||
|
||||
protected FlowElement sourceFlowElement;
|
||||
protected FlowNode sourceFlowElement;
|
||||
|
||||
protected FlowElement targetFlowElement;
|
||||
protected FlowNode targetFlowElement;
|
||||
|
||||
/**
|
||||
* Graphical information: a list of waypoints: x1, y1, x2, y2, x3, y3, ..
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.entity.node.impl.gateway;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.poi.hpsf.CustomProperty;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.base.impl.FlowNode;
|
||||
|
||||
@@ -10,6 +11,7 @@ import java.util.*;
|
||||
* @Date 2024/3/18 11:30
|
||||
* 源:UserTask
|
||||
*/
|
||||
@Data
|
||||
public class GateWay extends FlowNode {
|
||||
protected String assignee;
|
||||
protected String owner;
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.poi.hpsf.CustomProperty;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.ExecuteTask;
|
||||
|
||||
import java.util.*;
|
||||
@@ -12,31 +13,67 @@ import java.util.*;
|
||||
* 源:UserTask
|
||||
*/
|
||||
@Data
|
||||
public class FormTask extends ExecuteTask {
|
||||
private String assignee;
|
||||
private String task_type;
|
||||
private List<String> skipExpression;
|
||||
private String owner;
|
||||
private String priority;
|
||||
private String form_type;
|
||||
private boolean sameDeployment = true;
|
||||
private String dueDate;
|
||||
private String businessCalendarName;
|
||||
private String category;
|
||||
private String extensionId;
|
||||
private List<String> candidateUsers = new ArrayList<>();
|
||||
private List<String> candidateGroups = new ArrayList<>();
|
||||
// private List<FormProperty> formProperties = new ArrayList<>();
|
||||
// private List<FlowableListener> taskListeners = new ArrayList<>();
|
||||
public class Form extends ExecuteTask {
|
||||
/**
|
||||
* 规则:支持多级别
|
||||
* 表单类型
|
||||
*/
|
||||
private String form_type;
|
||||
/**
|
||||
* 表单处理类别
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 处理表达式
|
||||
*/
|
||||
private List<String> skipExpression = new ArrayList<>();
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
private String priority;
|
||||
/**
|
||||
* 表单自定义参数
|
||||
*/
|
||||
private List<BmFormStruc> customProperties = new ArrayList<>();
|
||||
/**
|
||||
* 表单验证字段
|
||||
*/
|
||||
|
||||
private String validateFormFields;
|
||||
/**
|
||||
* 变量名称
|
||||
*/
|
||||
private String taskIdVariableName;
|
||||
|
||||
/**
|
||||
* 单据受让人跟归属人:这个节点的数据谁能看
|
||||
* 暂时不用
|
||||
*/
|
||||
@Deprecated
|
||||
private String assignee;
|
||||
@Deprecated
|
||||
private String owner;
|
||||
/**
|
||||
* 用于同一部署判断:父子流程使用:暂时不用
|
||||
*/
|
||||
@Deprecated
|
||||
private boolean sameDeployment = true;
|
||||
/**
|
||||
* 表单类型:自定义表达类型
|
||||
*/
|
||||
@Deprecated
|
||||
private String dueDate;
|
||||
@Deprecated
|
||||
private String businessCalendarName;
|
||||
@Deprecated
|
||||
private String extensionId;
|
||||
/**
|
||||
* 表单处理中的候选人信息
|
||||
*/
|
||||
@Deprecated
|
||||
private List<String> candidateUsers = new ArrayList<>();
|
||||
@Deprecated
|
||||
private Map<String, Set<String>> customUserIdentityLinks = new HashMap<>();
|
||||
@Deprecated
|
||||
private List<String> candidateGroups = new ArrayList<>();
|
||||
@Deprecated
|
||||
private Map<String, Set<String>> customGroupIdentityLinks = new HashMap<>();
|
||||
|
||||
private List<CustomProperty> customProperties = new ArrayList<>();
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
package org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.impl;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.node.impl.task.ExecuteTask;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/18 11:30
|
||||
*/
|
||||
public class ScriptExecuteTask extends ExecuteTask {
|
||||
protected String scriptFormat;
|
||||
protected String script;
|
||||
protected String resultVariable;
|
||||
@Data
|
||||
public class SendMsg extends ExecuteTask {
|
||||
protected String category;
|
||||
protected String skipExpression;
|
||||
protected boolean autoStoreVariables;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.flow_manage.flow.service.deployment.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.sql.Blob;
|
||||
import java.io.Serializable;
|
||||
@@ -24,6 +25,7 @@ public class ActReProcdef implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String deployment_id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package org.nl.wms.flow_manage.flow.service.execution;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dto.StartProcessInstanceVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: flow
|
||||
* @description: 表单流程操作类
|
||||
@@ -11,5 +14,7 @@ import org.nl.wms.flow_manage.flow.service.execution.dto.StartProcessInstanceVo;
|
||||
**/
|
||||
public interface IFlowOperationService {
|
||||
|
||||
Boolean startFormFlow(StartProcessInstanceVo params) ;
|
||||
Boolean startUp(String form_type, JSONObject mst,List<JSONObject> items);
|
||||
|
||||
Boolean startFormFlow(StartProcessInstanceVo params);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
|
||||
/**
|
||||
* <p>
|
||||
* 流程实例表
|
||||
* TODO:需要保存实例数据
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
@@ -73,12 +74,12 @@ public class ActRuExecution implements Serializable {
|
||||
/**
|
||||
* 业务主键
|
||||
*/
|
||||
private Integer buss_key;
|
||||
private String form_id;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private Integer buss_type;
|
||||
private String form_type;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,28 @@
|
||||
package org.nl.wms.flow_manage.flow.service.execution.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.flow_manage.flow.framework.BpmnModel;
|
||||
import org.nl.wms.flow_manage.flow.framework.converter.BpmnJSONConverter;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.CommandExecutor;
|
||||
import org.nl.wms.flow_manage.flow.framework.engine.cmd.unify.impl.StartInstanceCmd;
|
||||
import org.nl.wms.flow_manage.flow.framework.entity.ExecutionEntity;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.IActReProcdefService;
|
||||
import org.nl.wms.flow_manage.flow.service.deployment.dao.ActReProcdef;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IFlowOperationService;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.dto.StartProcessInstanceVo;
|
||||
import org.nl.wms.flow_manage.flow.service.model.IActDeModelService;
|
||||
import org.nl.wms.flow_manage.flow.service.model.dao.ActDeModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2024/3/19 16:48
|
||||
@@ -23,6 +34,36 @@ public class FlowOperationServiceImpl implements IFlowOperationService {
|
||||
IActDeModelService actDeModelService;
|
||||
@Autowired
|
||||
IActReProcdefService actReProcdefService;
|
||||
@Autowired
|
||||
BpmnJSONConverter bpmnJSONConverter;
|
||||
@Autowired
|
||||
IActRuExecutionService iActRuExecutionService;
|
||||
@Autowired
|
||||
private CommandExecutor commandExecutor;
|
||||
|
||||
@Override
|
||||
public Boolean startUp(String form_type, JSONObject mst,List<JSONObject> items) {
|
||||
ActReProcdef deployment = actReProcdefService.getOne(new LambdaUpdateWrapper<ActReProcdef>().eq(ActReProcdef::getModel_key, form_type));
|
||||
if (deployment==null){
|
||||
throw new BadRequestException("当前单据类型未配置业务流程");
|
||||
}
|
||||
String model_json_string = deployment.getModel_editor_json();
|
||||
//转流程实例:
|
||||
JSONObject model_json = JSONObject.parseObject(model_json_string);
|
||||
BpmnModel bpmnModel = bpmnJSONConverter.convertToBpmnModel(deployment.getModel_key(), deployment.getVersion(), model_json);
|
||||
System.out.println(bpmnModel.getNodeFlow().size());
|
||||
|
||||
//创建流程参数ExecutionEntity:执行流程
|
||||
ExecutionEntity entity = new ExecutionEntity();
|
||||
entity.setCurrentFlowElement(bpmnModel.getStartEvent());
|
||||
entity.setT(items);
|
||||
entity.setForm_type(mst.getString("form_type"));
|
||||
entity.setForm_id(mst.getString("form_id"));
|
||||
entity.setStartActivityId(entity.getActivityId());
|
||||
entity.setDeploymentId(deployment.getDeployment_id());
|
||||
commandExecutor.execute(new StartInstanceCmd(),entity);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean startFormFlow(StartProcessInstanceVo params) {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.flow_manage.flow.service.history;
|
||||
|
||||
import org.nl.wms.flow_manage.flow.service.history.dao.ActHiExecution;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程历史处理表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-28
|
||||
*/
|
||||
public interface IActHiExecutionService extends IService<ActHiExecution> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.nl.wms.flow_manage.flow.service.history.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程历史处理表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "act_hi_execution",autoResultMap = true)
|
||||
public class ActHiExecution implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
private String proc_inst_id;
|
||||
|
||||
/**
|
||||
* 当前实例执行节点id
|
||||
*/
|
||||
private String activity_id;
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String activity_name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 业务主键
|
||||
*/
|
||||
private String form_id;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
private String form_type;
|
||||
|
||||
/**
|
||||
* 业务数据
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
private JSONObject form_data;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.flow_manage.flow.service.history.dao.mapper;
|
||||
|
||||
import org.nl.wms.flow_manage.flow.service.history.dao.ActHiExecution;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程历史处理表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-28
|
||||
*/
|
||||
public interface ActHiExecutionMapper extends BaseMapper<ActHiExecution> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.flow_manage.flow.service.history.dao.mapper.ActHiExecutionMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.nl.wms.flow_manage.flow.service.history.impl;
|
||||
|
||||
import org.nl.wms.flow_manage.flow.service.history.dao.ActHiExecution;
|
||||
import org.nl.wms.flow_manage.flow.service.history.dao.mapper.ActHiExecutionMapper;
|
||||
import org.nl.wms.flow_manage.flow.service.history.IActHiExecutionService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流程历史处理表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-28
|
||||
*/
|
||||
@Service
|
||||
public class ActHiExecutionServiceImpl extends ServiceImpl<ActHiExecutionMapper, ActHiExecution> implements IActHiExecutionService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package org.nl.wms.md_manage.group_dick.controller;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.utils.RedissonUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/mdGruopDick")
|
||||
public class MdGruopDickController {
|
||||
|
||||
@Autowired
|
||||
private IMdGruopDickService iMdGruopDickService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询组盘表")
|
||||
public ResponseEntity<Object> queryBygroup(GroupDickQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(iMdGruopDickService.queryAll(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/updategroup")
|
||||
@Log("修改桶记录表")
|
||||
//("查询桶记录表")
|
||||
public ResponseEntity<Object> updategroup(@RequestBody JSONObject whereJson) {
|
||||
if (whereJson!=null){
|
||||
MdGruopDick gruopDick = whereJson.toJavaObject(MdGruopDick.class);
|
||||
gruopDick.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
gruopDick.setUpdate_time(DateUtil.now());
|
||||
iMdGruopDickService.updateById(gruopDick);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@DeleteMapping
|
||||
@Log("删除桶记录表")
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids != null && ids.length >0){
|
||||
iMdGruopDickService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/excelImport")
|
||||
@Log("导入组盘信息")
|
||||
//("查询桶记录表")
|
||||
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
|
||||
RedissonUtils.lock(() -> {
|
||||
iMdGruopDickService.excelImport(file, request, response);
|
||||
}, "组盘信息导入", null);
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("人工组盘入库")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> groupDick(@RequestBody List<JSONObject> dicks) {
|
||||
iMdGruopDickService.saveBatch(dicks);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.md_manage.group_dick.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
public interface IMdGruopDickService extends IService<MdGruopDick> {
|
||||
|
||||
|
||||
Object queryAll(GroupDickQuery query, PageQuery page);
|
||||
|
||||
void saveBatch(List<JSONObject> form);
|
||||
|
||||
/**
|
||||
* 导入组盘信息
|
||||
* @param file
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
void excelImport(MultipartFile file, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "md_gruop_dick",autoResultMap = true)
|
||||
public class MdGruopDick implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
/**
|
||||
* 子否含有子载具
|
||||
*/
|
||||
private Boolean has_child;
|
||||
|
||||
/**
|
||||
* 组盘状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 父载具
|
||||
*/
|
||||
private String parent_vehicle_code;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
private String material_pcsn;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 自定义字段
|
||||
*/
|
||||
@TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
private JSONObject form_data;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
public interface MdGruopDickMapper extends BaseMapper<MdGruopDick> {
|
||||
|
||||
List<MdGruopDick> query(@Param("query") GroupDickQuery query);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.md_manage.group_dick.service.dao.mapper.MdGruopDickMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick">
|
||||
<result property="id" column="id"/>
|
||||
<result property="vehicle_code" column="vehicle_code"/>
|
||||
<result property="has_child" column="has_child"/>
|
||||
<result property="parent_vehicle_code" column="parent_vehicle_code"/>
|
||||
<result property="material_id" column="material_id"/>
|
||||
<result property="material_code" column="material_code"/>
|
||||
<result property="material_name" column="material_name"/>
|
||||
<result property="material_pcsn" column="material_pcsn"/>
|
||||
<result property="pcsn" column="pcsn"/>
|
||||
<result property="qty_unit_id" column="qty_unit_id"/>
|
||||
<result property="qty_unit_name" column="qty_unit_name"/>
|
||||
<result property="qty" column="qty"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="update_name" column="update_name"/>
|
||||
<result property="update_time" column="update_time"/>
|
||||
<result property="form_data" column="form_data" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
|
||||
<result property="status" column="status"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="query" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
child.*
|
||||
FROM
|
||||
md_gruop_dick child
|
||||
<where>
|
||||
has_child = false
|
||||
<if test="query.material_code != null and query.material_code != ''">
|
||||
and material_code = #{query.material_code}
|
||||
</if>
|
||||
<if test="query.vehicle_code != null and query.vehicle_code != ''">
|
||||
and vehicle_code = #{query.vehicle_code}
|
||||
</if>
|
||||
<if test="query.pcsn != null and query.pcsn != ''">
|
||||
and pcsn = #{query.pcsn}
|
||||
</if>
|
||||
<if test="query.form_query != null and query.form_query.size() > 0">
|
||||
<foreach collection="query.form_query" item="value" index="key" >
|
||||
<if test="value != null and value != ''">
|
||||
and JSON_CONTAINS(child.form_data, '{"${key}":"${value}"}')
|
||||
</if>
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.entity.BaseQuery;
|
||||
import org.nl.common.domain.entity.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.system_manage.service.coderule.dao.SysCodeRule;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class GroupDickQuery extends BaseQuery<MdGruopDick> {
|
||||
|
||||
private String vehicle_code;
|
||||
private String material_code;
|
||||
private String pcsn;
|
||||
private Map<String,String> form_query;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.nl.wms.md_manage.group_dick.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.flow_manage.flow.service.execution.IFlowOperationService;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.MdGruopDick;
|
||||
import org.nl.wms.md_manage.group_dick.service.dao.mapper.MdGruopDickMapper;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.md_manage.group_dick.service.dto.GroupDickQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具物料组盘表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGruopDick> implements IMdGruopDickService {
|
||||
|
||||
@Autowired
|
||||
private IFlowOperationService iFlowOperationService;
|
||||
|
||||
@Override
|
||||
public Object queryAll(GroupDickQuery query, PageQuery pageQuery) {
|
||||
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("create_time DESC");
|
||||
List<MdGruopDick> mstDetail = this.baseMapper.query(query);
|
||||
TableDataInfo<MdGruopDick> build = TableDataInfo.build(mstDetail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<JSONObject> forms) {
|
||||
//TEST:iFlowOperationService.startUp("GROUP_DICK",forms.get(0),forms);
|
||||
|
||||
if (!CollectionUtils.isEmpty(forms)){
|
||||
for (JSONObject item : forms) {
|
||||
MdGruopDick dick = item.toJavaObject(MdGruopDick.class);
|
||||
dick.setId(IdUtil.getStringId());
|
||||
dick.setUpdate_time(DateUtil.now());
|
||||
dick.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
this.save(dick);
|
||||
}
|
||||
//TODO:触发流程,都是formTask开始,这里先手动触发
|
||||
//数据转formDataDto
|
||||
|
||||
iFlowOperationService.startUp("GROUP_DICK",forms.get(0),forms);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void excelImport(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.sync_manage.service.field_mapping.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -29,6 +30,7 @@ public class BmExternalFieldMapping implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.sync_manage.service.form_mapping.dao;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -27,6 +28,7 @@ public class SyncFormMapping implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user