Commit 233c24ab by 谢海旭

模板下发门店接口 增加节点不可跳过校验

1 parent e7b50c93
......@@ -6,6 +6,10 @@ import javax.persistence.Table;
@Table(name = "sop_tpl_node")
public class SopTplNode {
public static final byte NODE_SKIPABLE_NO = 0;
public static final byte NODE_SKIPABLE_YES = 1;
/**
* 节点id
*/
......
......@@ -322,7 +322,7 @@ public class SopInstService {
//克隆节点
List<SopInstNode> sopInstNodes = new ArrayList<>();
nodes.forEach(sopTplNode -> {
for (SopTplNode sopTplNode : nodes) {
SopInstNode sopInstNode = sopTplNodeConverter.tpl2inst(sopTplNode);
sopInstNode.setInstId(instId);
sopInstNode.setNodeStatus(SopInstNode.NODE_STATUS_NORMAL);
......@@ -332,9 +332,15 @@ public class SopInstService {
//页面选择是否跳过处理
SopInstNode sopInstNodeTemp = customNodesMap.get(sopInstNode.getNodeId());
if (!Objects.isNull(sopInstNodeTemp)
&& sopInstNodeTemp.getNodeSkip().equals(SopInstNode.NODE_SKIP_TRUE)
&& sopTplNode.getNodeSkipable().equals(SopTplNode.NODE_SKIPABLE_NO)) {
throw ResultException.create(SystemMessage.ARGS_ERROR.getCode(), String.format("节点 %s 不可跳过", sopInstNode.getNodeName()));
}
sopInstNode.setNodeSkip(!Objects.isNull(sopInstNodeTemp) ? sopInstNodeTemp.getNodeSkip() : SopInstNode.NODE_SKIP_FALSE);
sopInstNodes.add(sopInstNode);
});
}
sopInstNodeMapper.insertList(sopInstNodes);
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!