|
@@ -1,5 +1,6 @@
|
|
|
package com.fjhx.flow.service.flow.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.flow.entity.flow.dto.FlowDefinitionDto;
|
|
@@ -119,4 +120,22 @@ public class FlowDefinitionServiceImpl extends ServiceImpl<FlowDefinitionMapper,
|
|
|
flowDefinitionNodeService.saveBatch(flowDefinitionNodeList);
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void updateVersion(Long flowDefinitionId) {
|
|
|
+ if (ObjectUtil.isEmpty(flowDefinitionId)) {
|
|
|
+ throw new ServiceException("租户流程id不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ FlowDefinition flowDefinition = getById(flowDefinitionId);
|
|
|
+ flowDefinition.setCurrentVersion(StatusConstant.YES);
|
|
|
+
|
|
|
+ update(q -> q
|
|
|
+ .eq(FlowDefinition::getFlowInfoId, flowDefinition.getFlowInfoId())
|
|
|
+ .eq(FlowDefinition::getTenantId, flowDefinition.getTenantId())
|
|
|
+ .set(FlowDefinition::getCurrentVersion, StatusConstant.NO)
|
|
|
+ );
|
|
|
+ updateById(flowDefinition);
|
|
|
+ }
|
|
|
+
|
|
|
}
|