diff --git a/bin/clean.bat b/bin/clean.bat
deleted file mode 100644
index 5c2a3b2..0000000
--- a/bin/clean.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-@echo off
-echo.
-echo [信息] 清理生成路径。
-echo.
-
-%~d0
-cd %~dp0
-
-cd ..
-call mvn clean
-
-pause
\ No newline at end of file
diff --git a/bin/package.bat b/bin/package.bat
deleted file mode 100644
index c693ec0..0000000
--- a/bin/package.bat
+++ /dev/null
@@ -1,12 +0,0 @@
-@echo off
-echo.
-echo [信息] 打包Web工程,生成war/jar包文件。
-echo.
-
-%~d0
-cd %~dp0
-
-cd ..
-call mvn clean package -Dmaven.test.skip=true
-
-pause
\ No newline at end of file
diff --git a/bin/run.bat b/bin/run.bat
deleted file mode 100644
index 90073a8..0000000
--- a/bin/run.bat
+++ /dev/null
@@ -1,14 +0,0 @@
-@echo off
-echo.
-echo [信息] 运行Web工程。
-echo.
-
-cd %~dp0
-cd ../ruoyi-admin/target
-
-set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
-
-java -jar %JAVA_OPTS% ruoyi-admin.jar
-
-cd bin
-pause
\ No newline at end of file
diff --git a/doc/鑻ヤ緷鐜浣跨敤鎵嬪唽.docx b/doc/鑻ヤ緷鐜浣跨敤鎵嬪唽.docx
deleted file mode 100644
index 9e4daef..0000000
Binary files a/doc/鑻ヤ緷鐜浣跨敤鎵嬪唽.docx and /dev/null differ
diff --git a/doc/璇峰亣娴佺▼.bpmn20.xml b/doc/璇峰亣娴佺▼.bpmn20.xml
deleted file mode 100644
index ba3ec44..0000000
--- a/doc/璇峰亣娴佺▼.bpmn20.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
- Flow_00tfp5n
-
-
-
- Flow_00tfp5n
- Flow_0fp5q3o
-
-
-
- Flow_0fp5q3o
- Flow_0gz6m5h
-
-
- Flow_0gz6m5h
- Flow_0xr8cyx
- Flow_1q0104d
-
-
-
- ${day>='5'}
-
-
- Flow_0xr8cyx
- Flow_0tsugrj
-
-
- ${day<'5'}
-
-
- Flow_1q0104d
- Flow_0lp4wbb
-
-
- Flow_0lp4wbb
- Flow_0tsugrj
- Flow_1gzuxun
-
-
-
-
-
- Flow_1gzuxun
- Flow_1lheo5z
-
-
- Flow_1lheo5z
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProjectController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProjectController.java
index 91b844a..b76f9c9 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProjectController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProjectController.java
@@ -1,6 +1,7 @@
package com.ruoyi.web.controller.system;
import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.base.BaseIntOption;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -9,6 +10,8 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysProject;
import com.ruoyi.system.service.ISysProjectService;
+import org.eclipse.collections.api.list.MutableList;
+import org.eclipse.collections.impl.factory.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -39,6 +42,20 @@ public class SysProjectController extends BaseController
List list = sysProjectService.selectSysProjectList(sysProject);
return getDataTable(list);
}
+ /**
+ * 鏌ヨ椤圭洰鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('system:project:list')")
+ @GetMapping("/option")
+ public AjaxResult option()
+ {
+ startPage();
+ List list = sysProjectService.selectSysProjectList(new SysProject());
+ MutableList collect = Lists.adapt(list)
+ .collect(e -> new BaseIntOption().label(e.getName())
+ .value(e.getProjectId()));
+ return AjaxResult.success(collect);
+ }
/**
* 瀵煎嚭椤圭洰鍒楄〃
diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml
index bc2327c..22cd72e 100644
--- a/ruoyi-common/pom.xml
+++ b/ruoyi-common/pom.xml
@@ -118,7 +118,19 @@
javax.servlet
javax.servlet-api
-
+
+ org.projectlombok
+ lombok
+
+
+ org.eclipse.collections
+ eclipse-collections
+ 11.1.0
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+
\ No newline at end of file
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/base/BaseIntOption.java b/ruoyi-common/src/main/java/com/ruoyi/common/base/BaseIntOption.java
new file mode 100644
index 0000000..b03365a
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/base/BaseIntOption.java
@@ -0,0 +1,31 @@
+package com.ruoyi.common.base;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@Accessors(fluent = true)
+public class BaseIntOption implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private Long value;
+ private String label;
+
+ public Long getValue() {
+ return value;
+ }
+
+ public void setValue(Long value) {
+ this.value = value;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+}
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
index 28e5a68..88ea656 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
@@ -77,6 +77,15 @@ public class AjaxResult extends HashMap
{
return AjaxResult.success("鎿嶄綔鎴愬姛", data);
}
+ /**
+ * 杩斿洖鎴愬姛鏁版嵁
+ *
+ * @return 鎴愬姛娑堟伅
+ */
+ public static AjaxResult data(String data)
+ {
+ return AjaxResult.success("鎿嶄綔鎴愬姛", data);
+ }
/**
* 杩斿洖鎴愬姛娑堟伅
diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowDefinitionController.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowDefinitionController.java
index e6000a8..ae6fdf6 100644
--- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowDefinitionController.java
+++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowDefinitionController.java
@@ -188,5 +188,12 @@ public class FlowDefinitionController {
List list = sysRoleService.selectRoleList(role);
return AjaxResult.success(list);
}
+ @ApiOperation(value = "鑾峰彇鏈鏂版祦绋媔d")
+ @GetMapping("/getLatestIdByKey/{procKey}")
+ public AjaxResult getLatestIdByKey(@PathVariable("procKey") String procKey) {
+
+ String id = flowDefinitionService.getLatestIdByKey(procKey);
+ return AjaxResult.data(id);
+ }
}
\ No newline at end of file
diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowDefinitionService.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowDefinitionService.java
index 391cc53..b0bdd7c 100644
--- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowDefinitionService.java
+++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowDefinitionService.java
@@ -27,12 +27,19 @@ public interface IFlowDefinitionService {
Page list(String name,Integer pageNum, Integer pageSize);
/**
- * 瀵煎叆娴佺▼鏂囦欢
- *
- * @param name
- * @param category
- * @param in
+ * 鑾峰彇鏈鏂扮殑娴佺▼id
+ * @param key 娴佺▼key锛屽畬鍏ㄥ尮閰
+ * @return
*/
+ String getLatestIdByKey(String key);
+
+ /**
+ * 瀵煎叆娴佺▼鏂囦欢
+ *
+ * @param name
+ * @param category
+ * @param in
+ */
void importFile(String name, String category, InputStream in);
/**
diff --git a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java
index 2f8b98e..f78a5dd 100644
--- a/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java
+++ b/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java
@@ -3,6 +3,8 @@ package com.ruoyi.flowable.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
+import com.ruoyi.common.constant.HttpStatus;
+import com.ruoyi.common.exception.CustomException;
import com.ruoyi.flowable.common.constant.ProcessConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
@@ -121,6 +123,27 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
return page;
}
+ /**
+ * 娴佺▼瀹氫箟鍒楄〃
+ *
+ * @param key 娴佺▼鏍囪瘑锛坘ey锛
+ * @return 娴佺▼瀹氫箟鍒嗛〉鍒楄〃鏁版嵁
+ */
+ @Override
+ public String getLatestIdByKey(String key) {
+// // 娴佺▼瀹氫箟鍒楄〃鏁版嵁鏌ヨ
+ ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
+ .processDefinitionKey(key)
+ .latestVersion()
+ .singleResult();
+ if (Objects.isNull(processDefinition)) {
+
+ throw new CustomException("鑾峰彇娴佺▼淇℃伅寮傚父锛屾祦绋 涓嶅瓨鍦", HttpStatus.UNAUTHORIZED);
+
+ }
+ return processDefinition.getId();
+ }
+
/**
* 瀵煎叆娴佺▼鏂囦欢
diff --git a/ruoyi-flowable/src/test/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImplTest.java b/ruoyi-flowable/src/test/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImplTest.java
new file mode 100644
index 0000000..e627224
--- /dev/null
+++ b/ruoyi-flowable/src/test/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImplTest.java
@@ -0,0 +1,29 @@
+package com.ruoyi.flowable.service.impl;
+
+import com.ruoyi.flowable.service.IFlowDefinitionService;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.SpringBootConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.web.WebAppConfiguration;
+
+import javax.annotation.Resource;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@ContextConfiguration
+@WebAppConfiguration
+@SpringBootConfiguration
+class FlowDefinitionServiceImplTest {
+
+ @Resource
+ private IFlowDefinitionService iFlowDefinitionService;
+ @Test
+ void getLatestIdByKey() {
+ final String oa_project_flow = iFlowDefinitionService.getLatestIdByKey("oa_project_flow");
+ }
+}
\ No newline at end of file