|
@@ -62,8 +62,10 @@ public class OaApprovalGeneration {
|
|
|
public void addGenerate(OaFormDefinition oaFormDefinition) {
|
|
|
// 新增流程数据
|
|
|
OaFlow oaFlow = new OaFlow();
|
|
|
+ oaFlow.setFormId(oaFormDefinition.getId());
|
|
|
oaFlow.setFlowName(oaFormDefinition.getFormName() + "的流程");
|
|
|
oaFlow.setDocType(oaFormDefinition.getFormSign());
|
|
|
+ oaFlow.setDescription(oaFormDefinition.getFormExplain());
|
|
|
oaFlow.setCreateBy(oaFormDefinition.getCreateBy());
|
|
|
oaFlow.setCreateTime(oaFormDefinition.getCreateTime());
|
|
|
oaFlow.setDeptId(oaFormDefinition.getDeptId());
|
|
@@ -134,6 +136,16 @@ public class OaApprovalGeneration {
|
|
|
|
|
|
@Async
|
|
|
public void updateGenerate(OaFormDefinition oaFormDefinition) {
|
|
|
+ Integer formId = oaFormDefinition.getId();
|
|
|
+ OaFlow flow = oaFlowMapper.selectOne(Wrappers.lambdaQuery(OaFlow.class).eq(OaFlow::getFormId, formId));
|
|
|
+ Integer flowId = flow.getId();
|
|
|
+
|
|
|
+ flow.setFlowName(oaFormDefinition.getFormName() + "的流程");
|
|
|
+ flow.setDescription(oaFormDefinition.getFormExplain());
|
|
|
+ flow.setUpdateBy(oaFormDefinition.getUpdateBy());
|
|
|
+ flow.setUpdateTime(oaFormDefinition.getUpdateTime());
|
|
|
+ oaFlowMapper.updateById(flow);
|
|
|
+
|
|
|
String flowInfo = oaFormDefinition.getFlowInfo();
|
|
|
JSONObject jsonObject = JSONObject.parseObject(flowInfo);
|
|
|
if (jsonObject.containsKey("node")) {
|
|
@@ -152,10 +164,15 @@ public class OaApprovalGeneration {
|
|
|
|
|
|
switch (nodeScope) {
|
|
|
case 0:
|
|
|
- case 1:
|
|
|
case 2:
|
|
|
proposer = node.getString("appointApprover");
|
|
|
break;
|
|
|
+ case 1:
|
|
|
+ Long deptLeader = getDeptLeader();
|
|
|
+ if (deptLeader != null) {
|
|
|
+ proposer = deptLeader.toString();
|
|
|
+ }
|
|
|
+ break;
|
|
|
case 3:
|
|
|
deptId2 = node.getInteger("deptId");
|
|
|
break;
|
|
@@ -174,7 +191,7 @@ public class OaApprovalGeneration {
|
|
|
oaNode.setDeptId(deptId2);
|
|
|
oaNode.setJobId(jobId);
|
|
|
oaNode.setParentId(lastNodeId);
|
|
|
- oaNodeMapper.update(oaNode, new LambdaQueryWrapper<OaNode>().eq(OaNode::getNodeNo, nodeNo));
|
|
|
+ oaNodeMapper.update(oaNode, new LambdaQueryWrapper<OaNode>().eq(OaNode::getFlowId, flowId).eq(OaNode::getNodeNo, nodeNo));
|
|
|
lastNodeId = oaNode.getId();
|
|
|
}
|
|
|
}
|