添加流程修改相关代码
parent
19b1e27d19
commit
55c1cf864b
@ -1,12 +1,36 @@
|
||||
package com.supervision.knowsub.service;
|
||||
|
||||
import com.supervision.knowsub.dto.flow.SystemFlowRuleDTO;
|
||||
import com.supervision.knowsub.vo.flow.NodeInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FlowRuleManageService {
|
||||
|
||||
/**
|
||||
* 保存流程规则
|
||||
* @param flowId 规则id
|
||||
* @param nodeInfoList 规则节点信息
|
||||
* @return
|
||||
*/
|
||||
boolean saveFlowRule(String flowId, List<NodeInfo> nodeInfoList);
|
||||
|
||||
|
||||
void saveFlowRule(List<SystemFlowRuleDTO> systemFlowRuleDTOList);
|
||||
|
||||
|
||||
void updateFlowRule(List<SystemFlowRuleDTO> systemFlowRuleDTOList);
|
||||
|
||||
/**
|
||||
* 更新流程规则
|
||||
* @param flowId 规则id
|
||||
* @param nodeInfoList 规则节点信息
|
||||
* @return
|
||||
*/
|
||||
boolean updateFlowRule(String flowId, List<NodeInfo> nodeInfoList);
|
||||
|
||||
List<NodeInfo> listFlowRule(String flowId);
|
||||
|
||||
|
||||
void deleteFlowRuleByRuleIds(List<String> ruleIdList);
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package com.supervision.knowsub.dto.flow;
|
||||
|
||||
import com.supervision.knowsub.model.SystemFlowRule;
|
||||
import com.supervision.knowsub.model.SystemFlowRuleUser;
|
||||
import com.supervision.knowsub.vo.flow.NodeInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SystemFlowRuleDTO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String flowId;
|
||||
|
||||
private String ruleName;
|
||||
|
||||
private Integer ruleOrder;
|
||||
|
||||
private List<SystemFlowRuleUser> userList;
|
||||
|
||||
public SystemFlowRuleDTO() {
|
||||
}
|
||||
|
||||
public SystemFlowRule toSystemFlowRule() {
|
||||
SystemFlowRule systemFlowRule = new SystemFlowRule();
|
||||
systemFlowRule.setId(id);
|
||||
systemFlowRule.setFlowId(flowId);
|
||||
systemFlowRule.setRuleName(ruleName);
|
||||
systemFlowRule.setRuleOrder(ruleOrder);
|
||||
return systemFlowRule;
|
||||
}
|
||||
|
||||
public List<SystemFlowRuleUser> toSystemFlowRuleUserList() {
|
||||
return userList;
|
||||
}
|
||||
|
||||
public static SystemFlowRuleDTO builderWithNodeInfo(String flowId, NodeInfo nodeInfo) {
|
||||
SystemFlowRuleDTO systemFlowRuleDTO = new SystemFlowRuleDTO();
|
||||
systemFlowRuleDTO.setId(nodeInfo.getId());
|
||||
systemFlowRuleDTO.setRuleName(nodeInfo.getNodeName());
|
||||
|
||||
List<SystemFlowRuleUser> ruleUserList = nodeInfo.getUserIdList().stream().map(userId -> {
|
||||
SystemFlowRuleUser flowRuleUser = new SystemFlowRuleUser();
|
||||
flowRuleUser.setFlowId(flowId);
|
||||
flowRuleUser.setRuleId(nodeInfo.getId());
|
||||
flowRuleUser.setUserId(userId);
|
||||
return flowRuleUser;
|
||||
}).toList();
|
||||
systemFlowRuleDTO.setUserList(ruleUserList);
|
||||
return systemFlowRuleDTO;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue