疯狂的狮子Li
2024-07-23 05580deaa9f1d1f2c2aef2ffa850771a95a59870
ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/ActProcessDefinitionServiceImpl.java
@@ -9,6 +9,7 @@
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
@@ -55,6 +56,7 @@
 *
 * @author may
 */
@Slf4j
@RequiredArgsConstructor
@Service
public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionService {
@@ -208,7 +210,7 @@
            wfNodeConfigService.deleteByDefIds(processDefinitionIds);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e.getMessage(), e);
            throw new ServiceException(e.getMessage());
        }
    }
@@ -233,7 +235,7 @@
            }
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e.getMessage(), e);
            throw new ServiceException("操作失败:" + e.getMessage());
        }
    }
@@ -262,6 +264,7 @@
                .migrateProcessInstances(fromProcessDefinitionId);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            throw new ServiceException(e.getMessage());
        }
    }
@@ -291,7 +294,7 @@
            }
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e.getMessage(), e);
            throw new ServiceException(e.getMessage());
        }
    }
@@ -347,8 +350,7 @@
            initWfDefConfig();
        } else {
            String originalFilename = file.getOriginalFilename();
            String bpmnResourceSuffix = ResourceNameUtil.BPMN_RESOURCE_SUFFIXES[0];
            if (originalFilename.contains(bpmnResourceSuffix)) {
            if (StringUtils.containsAny(originalFilename, ResourceNameUtil.BPMN_RESOURCE_SUFFIXES)) {
                // 文件名 = 流程名称-流程key
                String[] splitFilename = originalFilename.substring(0, originalFilename.lastIndexOf(".")).split("-");
                if (splitFilename.length < 2) {