From 39ca54000c7d6f1dc983326d13884543d941c7ba Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Fri, 3 Jan 2025 12:03:03 +0800 Subject: [PATCH 1/8] 3.3.52 --- example/example-application/pom.xml | 2 +- example/example-domain/pom.xml | 2 +- example/example-infra-flow/pom.xml | 2 +- example/example-infra-jpa/pom.xml | 2 +- example/example-server/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- springboot-starter-data-authorization/pom.xml | 2 +- .../authorization/interceptor/DefaultSQLInterceptor.java | 5 +++++ springboot-starter-data-fast/pom.xml | 2 +- springboot-starter-flow/pom.xml | 2 +- .../springboot/flow/service/impl/FlowSubmitService.java | 2 +- springboot-starter-security/pom.xml | 2 +- springboot-starter/pom.xml | 2 +- springboot-starter/src/main/resources/banner.txt | 2 +- 15 files changed, 19 insertions(+), 14 deletions(-) diff --git a/example/example-application/pom.xml b/example/example-application/pom.xml index 0ed6b856..ad774501 100644 --- a/example/example-application/pom.xml +++ b/example/example-application/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.51 + 3.3.52 4.0.0 diff --git a/example/example-domain/pom.xml b/example/example-domain/pom.xml index f529b6b9..a5d120c1 100644 --- a/example/example-domain/pom.xml +++ b/example/example-domain/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.51 + 3.3.52 4.0.0 diff --git a/example/example-infra-flow/pom.xml b/example/example-infra-flow/pom.xml index a4ec586a..dc795804 100644 --- a/example/example-infra-flow/pom.xml +++ b/example/example-infra-flow/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.51 + 3.3.52 4.0.0 diff --git a/example/example-infra-jpa/pom.xml b/example/example-infra-jpa/pom.xml index de7e6a21..5d9c3f70 100644 --- a/example/example-infra-jpa/pom.xml +++ b/example/example-infra-jpa/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.51 + 3.3.52 4.0.0 diff --git a/example/example-server/pom.xml b/example/example-server/pom.xml index 48724f6b..e9cf9178 100644 --- a/example/example-server/pom.xml +++ b/example/example-server/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.51 + 3.3.52 4.0.0 diff --git a/example/pom.xml b/example/pom.xml index b0deee3d..15a2b706 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -17,7 +17,7 @@ springboot-example - 3.3.51 + 3.3.52 springboot-example springboot-example project for Spring Boot diff --git a/pom.xml b/pom.xml index bbd7dae8..52c93811 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ com.codingapi.springboot springboot-parent - 3.3.51 + 3.3.52 https://github.com/codingapi/springboot-framewrok springboot-parent diff --git a/springboot-starter-data-authorization/pom.xml b/springboot-starter-data-authorization/pom.xml index c4c67411..921cb5f7 100644 --- a/springboot-starter-data-authorization/pom.xml +++ b/springboot-starter-data-authorization/pom.xml @@ -6,7 +6,7 @@ com.codingapi.springboot springboot-parent - 3.3.51 + 3.3.52 springboot-starter-data-authorization diff --git a/springboot-starter-data-authorization/src/main/java/com/codingapi/springboot/authorization/interceptor/DefaultSQLInterceptor.java b/springboot-starter-data-authorization/src/main/java/com/codingapi/springboot/authorization/interceptor/DefaultSQLInterceptor.java index 8d658633..47bb18bf 100644 --- a/springboot-starter-data-authorization/src/main/java/com/codingapi/springboot/authorization/interceptor/DefaultSQLInterceptor.java +++ b/springboot-starter-data-authorization/src/main/java/com/codingapi/springboot/authorization/interceptor/DefaultSQLInterceptor.java @@ -21,6 +21,11 @@ public boolean beforeHandler(String sql) { @Override public void afterHandler(String sql, String newSql, SQLException exception) { + if(exception!=null){ + log.error("sql:{}",sql); + log.error("newSql:{}",newSql); + log.error(exception.getMessage(),exception); + } if (DataAuthorizationPropertyContext.getInstance().showSql()) { log.info("newSql:{}", newSql); } diff --git a/springboot-starter-data-fast/pom.xml b/springboot-starter-data-fast/pom.xml index 37ab37f7..7f0853d7 100644 --- a/springboot-starter-data-fast/pom.xml +++ b/springboot-starter-data-fast/pom.xml @@ -5,7 +5,7 @@ springboot-parent com.codingapi.springboot - 3.3.51 + 3.3.52 4.0.0 diff --git a/springboot-starter-flow/pom.xml b/springboot-starter-flow/pom.xml index c244c2d5..6d6fcab9 100644 --- a/springboot-starter-flow/pom.xml +++ b/springboot-starter-flow/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.51 + 3.3.52 springboot-starter-flow diff --git a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java index 38edabbf..be06d19d 100644 --- a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java +++ b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java @@ -303,7 +303,7 @@ private FlowResult submitCurrentFlow() { this.saveFlowRecord(flowRecord); this.updateFinishFlowRecord(); - this.pushEvent(flowRecord, FlowApprovalEvent.STATE_CREATE); + this.pushEvent(flowRecord, FlowApprovalEvent.STATE_FINISH); if (!nextRecords.isEmpty()) { return new FlowResult(flowWork, nextRecords.get(0)); diff --git a/springboot-starter-security/pom.xml b/springboot-starter-security/pom.xml index d0544f29..541b88ba 100644 --- a/springboot-starter-security/pom.xml +++ b/springboot-starter-security/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.51 + 3.3.52 springboot-starter-security diff --git a/springboot-starter/pom.xml b/springboot-starter/pom.xml index 54286793..e03f1fa1 100644 --- a/springboot-starter/pom.xml +++ b/springboot-starter/pom.xml @@ -5,7 +5,7 @@ com.codingapi.springboot springboot-parent - 3.3.51 + 3.3.52 springboot-starter diff --git a/springboot-starter/src/main/resources/banner.txt b/springboot-starter/src/main/resources/banner.txt index d0174009..19574909 100644 --- a/springboot-starter/src/main/resources/banner.txt +++ b/springboot-starter/src/main/resources/banner.txt @@ -1,4 +1,4 @@ ------------------------------------------------------ -CodingApi SpringBoot-Starter 3.3.51 +CodingApi SpringBoot-Starter 3.3.52 springboot version (${spring-boot.version}) ------------------------------------------------------ From b776c2168cb95c898bae5616bc2c70c44cc303a7 Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Fri, 3 Jan 2025 14:18:17 +0800 Subject: [PATCH 2/8] 3.3.53 --- example/example-application/pom.xml | 2 +- example/example-domain/pom.xml | 2 +- example/example-infra-flow/pom.xml | 2 +- example/example-infra-jpa/pom.xml | 2 +- example/example-server/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- springboot-starter-data-authorization/pom.xml | 2 +- springboot-starter-data-fast/pom.xml | 2 +- springboot-starter-flow/pom.xml | 2 +- .../com/codingapi/springboot/flow/content/FlowSession.java | 3 +++ springboot-starter-security/pom.xml | 2 +- springboot-starter/pom.xml | 2 +- springboot-starter/src/main/resources/banner.txt | 2 +- 14 files changed, 16 insertions(+), 13 deletions(-) diff --git a/example/example-application/pom.xml b/example/example-application/pom.xml index ad774501..555052a4 100644 --- a/example/example-application/pom.xml +++ b/example/example-application/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.52 + 3.3.53 4.0.0 diff --git a/example/example-domain/pom.xml b/example/example-domain/pom.xml index a5d120c1..12ae6998 100644 --- a/example/example-domain/pom.xml +++ b/example/example-domain/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.52 + 3.3.53 4.0.0 diff --git a/example/example-infra-flow/pom.xml b/example/example-infra-flow/pom.xml index dc795804..42746a13 100644 --- a/example/example-infra-flow/pom.xml +++ b/example/example-infra-flow/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.52 + 3.3.53 4.0.0 diff --git a/example/example-infra-jpa/pom.xml b/example/example-infra-jpa/pom.xml index 5d9c3f70..a9bf02e6 100644 --- a/example/example-infra-jpa/pom.xml +++ b/example/example-infra-jpa/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.52 + 3.3.53 4.0.0 diff --git a/example/example-server/pom.xml b/example/example-server/pom.xml index e9cf9178..3b10e66a 100644 --- a/example/example-server/pom.xml +++ b/example/example-server/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.52 + 3.3.53 4.0.0 diff --git a/example/pom.xml b/example/pom.xml index 15a2b706..605e35b6 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -17,7 +17,7 @@ springboot-example - 3.3.52 + 3.3.53 springboot-example springboot-example project for Spring Boot diff --git a/pom.xml b/pom.xml index 52c93811..eebd39fd 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ com.codingapi.springboot springboot-parent - 3.3.52 + 3.3.53 https://github.com/codingapi/springboot-framewrok springboot-parent diff --git a/springboot-starter-data-authorization/pom.xml b/springboot-starter-data-authorization/pom.xml index 921cb5f7..a92da431 100644 --- a/springboot-starter-data-authorization/pom.xml +++ b/springboot-starter-data-authorization/pom.xml @@ -6,7 +6,7 @@ com.codingapi.springboot springboot-parent - 3.3.52 + 3.3.53 springboot-starter-data-authorization diff --git a/springboot-starter-data-fast/pom.xml b/springboot-starter-data-fast/pom.xml index 7f0853d7..d7bceaba 100644 --- a/springboot-starter-data-fast/pom.xml +++ b/springboot-starter-data-fast/pom.xml @@ -5,7 +5,7 @@ springboot-parent com.codingapi.springboot - 3.3.52 + 3.3.53 4.0.0 diff --git a/springboot-starter-flow/pom.xml b/springboot-starter-flow/pom.xml index 6d6fcab9..f1851ce7 100644 --- a/springboot-starter-flow/pom.xml +++ b/springboot-starter-flow/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.52 + 3.3.53 springboot-starter-flow diff --git a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java index 3050e218..7096f6d7 100644 --- a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java +++ b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java @@ -189,6 +189,9 @@ public MessageResult rejectFlow() { * @return 是否为驳回状态 */ public boolean isRejectState() { + if (flowRecord == null) { + return false; + } long preId = flowRecord.getPreId(); if (preId == 0) { return false; diff --git a/springboot-starter-security/pom.xml b/springboot-starter-security/pom.xml index 541b88ba..c9ab1bdb 100644 --- a/springboot-starter-security/pom.xml +++ b/springboot-starter-security/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.52 + 3.3.53 springboot-starter-security diff --git a/springboot-starter/pom.xml b/springboot-starter/pom.xml index e03f1fa1..a12f771c 100644 --- a/springboot-starter/pom.xml +++ b/springboot-starter/pom.xml @@ -5,7 +5,7 @@ com.codingapi.springboot springboot-parent - 3.3.52 + 3.3.53 springboot-starter diff --git a/springboot-starter/src/main/resources/banner.txt b/springboot-starter/src/main/resources/banner.txt index 19574909..b650caf6 100644 --- a/springboot-starter/src/main/resources/banner.txt +++ b/springboot-starter/src/main/resources/banner.txt @@ -1,4 +1,4 @@ ------------------------------------------------------ -CodingApi SpringBoot-Starter 3.3.52 +CodingApi SpringBoot-Starter 3.3.53 springboot version (${spring-boot.version}) ------------------------------------------------------ From 3e464a83b5d985a77674cf54e3ff454ce2a19a85 Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Fri, 3 Jan 2025 16:51:38 +0800 Subject: [PATCH 3/8] fix flow button control --- admin-ui/src/components/Flow/flow/FlowButtons.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin-ui/src/components/Flow/flow/FlowButtons.tsx b/admin-ui/src/components/Flow/flow/FlowButtons.tsx index 594d682c..0aedc38e 100644 --- a/admin-ui/src/components/Flow/flow/FlowButtons.tsx +++ b/admin-ui/src/components/Flow/flow/FlowButtons.tsx @@ -21,6 +21,10 @@ const FlowButtons: React.FC = (props) => { return null; } + if(flowData.hasData() && !flowData.canHandle()){ + return null; + } + const buttons = flowData.getNodeButtons(); return ( From fc4ed8beeae08d8629be7e71b584feb9c9bf3dd0 Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Fri, 3 Jan 2025 20:08:29 +0800 Subject: [PATCH 4/8] add flow validate.ts --- admin-ui/src/api/validate.ts | 103 +++++++++++++++++++++++++++ admin-ui/src/pages/welcome/index.tsx | 68 ++++++++++++------ 2 files changed, 150 insertions(+), 21 deletions(-) create mode 100644 admin-ui/src/api/validate.ts diff --git a/admin-ui/src/api/validate.ts b/admin-ui/src/api/validate.ts new file mode 100644 index 00000000..d40f32f0 --- /dev/null +++ b/admin-ui/src/api/validate.ts @@ -0,0 +1,103 @@ +import {FormInstance} from "antd/es/form/hooks/useForm"; +import {NamePath} from "rc-field-form/es/interface"; + +// 流程表单API 提供get post的能力 +export interface FlowFormApi { + get: (url: string, params?: any) => Promise; + post: (url: string, data: any) => Promise; +} + +// 流程表单验证内容 +export class FlowFormValidateContent { + readonly value: any; + readonly form: FormInstance; + readonly api?: FlowFormApi + + constructor(value: any, form: FormInstance, api?: FlowFormApi) { + this.value = value; + this.form = form; + this.api = api; + } +} + +// 自定义验证 +export interface FlowFormCustomValidate { + name: NamePath; + validate: (content: FlowFormValidateContent) => Promise; +} + +// 流程表单API上下文 +export class FlowFormApiContext { + + private static readonly instance: FlowFormApiContext = new FlowFormApiContext(); + + private api: FlowFormApi | undefined; + + private constructor() { + this.api = undefined; + } + + public static getInstance() { + return FlowFormApiContext.instance; + } + + public setApi(api: FlowFormApi) { + this.api = api; + } + + public getApi() { + return this.api; + } +} + +// 自定义验证上下文 +export class FlowFormCustomValidateContext { + + private readonly map: Map; + + constructor() { + this.map = new Map(); + } + + public addValidate(validate: FlowFormCustomValidate) { + this.map.set(validate.name, validate); + } + + public addCustomFunctionCodeValidate(namePath:NamePath,validateFuncCode:string){ + const validateFunc = new Function('content', validateFuncCode); + this.addValidate({ + name: namePath, + validate: async (content) => { + return validateFunc(content); + } + }); + } + + public validate(form: FormInstance) { + this.map.values().forEach((validate) => { + const value = form.getFieldValue(validate.name); + const content = new FlowFormValidateContent(value, form, FlowFormApiContext.getInstance().getApi()); + validate.validate(content).then((res) => { + form.setFields( + [ + { + name: validate.name, + errors: res, + } + ] + ) + }).catch((error) => { + form.setFields( + [ + { + name: validate.name, + errors: [error], + } + ] + ) + }); + }); + } +} + + diff --git a/admin-ui/src/pages/welcome/index.tsx b/admin-ui/src/pages/welcome/index.tsx index 66665af8..80579a34 100644 --- a/admin-ui/src/pages/welcome/index.tsx +++ b/admin-ui/src/pages/welcome/index.tsx @@ -1,33 +1,59 @@ import React from 'react'; -import logo from '@/assets/logo.svg'; import './index.scss'; -import {useSelector} from "react-redux"; -import {RootState} from "@/store/Redux"; -import RoleControl from "@/utils/RoleControl"; import Page from "@/components/Layout/Page"; +import {Button, Form, Input} from "antd"; +import {FlowFormApiContext, FlowFormCustomValidateContext} from "@/api/validate"; +import * as api from "@/api" + +FlowFormApiContext.getInstance().setApi({ + get: (url: string, params?: any) => { + return api.get(url, params); + }, + post: (url: string, data: any) => { + return api.post(url, data); + } +}); const Index = () => { - const counter = useSelector((state: RootState) => state.counter.value); - const username = localStorage.getItem('username'); + const [form] = Form.useForm(); + + const context = new FlowFormCustomValidateContext(); + + const validateFuncCode = ` + if (content.value) { + return []; + } else { + return ["姓名不存在"]; + } + `; + context.addCustomFunctionCodeValidate(["user", "name"], validateFuncCode); return ( - - - - - hi {username} , Redux counter: {counter}, Roles: {RoleControl.roles().map(item => ( - {item} - ))} - - - + + + + + + + + + { + form.validateFields().then(res => { + console.log(res); + }) + }}>test1 + + { + context.validate(form); + }}>test2 + ); } From 06ae6c779341c10c5a385b62959cf8c15cfd6b20 Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Fri, 3 Jan 2025 22:06:02 +0800 Subject: [PATCH 5/8] add currentStateIsReject --- example/example-application/pom.xml | 2 +- example/example-domain/pom.xml | 2 +- example/example-infra-flow/pom.xml | 2 +- example/example-infra-jpa/pom.xml | 2 +- example/example-server/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- springboot-starter-data-authorization/pom.xml | 2 +- springboot-starter-data-fast/pom.xml | 2 +- springboot-starter-flow/pom.xml | 2 +- .../springboot/flow/content/FlowSession.java | 27 ++++++++++++++++--- springboot-starter-security/pom.xml | 2 +- springboot-starter/pom.xml | 2 +- .../src/main/resources/banner.txt | 2 +- 14 files changed, 36 insertions(+), 17 deletions(-) diff --git a/example/example-application/pom.xml b/example/example-application/pom.xml index 555052a4..f6ac635f 100644 --- a/example/example-application/pom.xml +++ b/example/example-application/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.53 + 3.3.54 4.0.0 diff --git a/example/example-domain/pom.xml b/example/example-domain/pom.xml index 12ae6998..9ea76ec1 100644 --- a/example/example-domain/pom.xml +++ b/example/example-domain/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.53 + 3.3.54 4.0.0 diff --git a/example/example-infra-flow/pom.xml b/example/example-infra-flow/pom.xml index 42746a13..bc3e2b88 100644 --- a/example/example-infra-flow/pom.xml +++ b/example/example-infra-flow/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.53 + 3.3.54 4.0.0 diff --git a/example/example-infra-jpa/pom.xml b/example/example-infra-jpa/pom.xml index a9bf02e6..b94a3435 100644 --- a/example/example-infra-jpa/pom.xml +++ b/example/example-infra-jpa/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.53 + 3.3.54 4.0.0 diff --git a/example/example-server/pom.xml b/example/example-server/pom.xml index 3b10e66a..6bf3bd19 100644 --- a/example/example-server/pom.xml +++ b/example/example-server/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.53 + 3.3.54 4.0.0 diff --git a/example/pom.xml b/example/pom.xml index 605e35b6..5d5fe69a 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -17,7 +17,7 @@ springboot-example - 3.3.53 + 3.3.54 springboot-example springboot-example project for Spring Boot diff --git a/pom.xml b/pom.xml index eebd39fd..3f7f01ff 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ com.codingapi.springboot springboot-parent - 3.3.53 + 3.3.54 https://github.com/codingapi/springboot-framewrok springboot-parent diff --git a/springboot-starter-data-authorization/pom.xml b/springboot-starter-data-authorization/pom.xml index a92da431..b49dfbd7 100644 --- a/springboot-starter-data-authorization/pom.xml +++ b/springboot-starter-data-authorization/pom.xml @@ -6,7 +6,7 @@ com.codingapi.springboot springboot-parent - 3.3.53 + 3.3.54 springboot-starter-data-authorization diff --git a/springboot-starter-data-fast/pom.xml b/springboot-starter-data-fast/pom.xml index d7bceaba..3c3212b3 100644 --- a/springboot-starter-data-fast/pom.xml +++ b/springboot-starter-data-fast/pom.xml @@ -5,7 +5,7 @@ springboot-parent com.codingapi.springboot - 3.3.53 + 3.3.54 4.0.0 diff --git a/springboot-starter-flow/pom.xml b/springboot-starter-flow/pom.xml index f1851ce7..8c6e0f90 100644 --- a/springboot-starter-flow/pom.xml +++ b/springboot-starter-flow/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.53 + 3.3.54 springboot-starter-flow diff --git a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java index 7096f6d7..c2db17e5 100644 --- a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java +++ b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java @@ -184,11 +184,10 @@ public MessageResult rejectFlow() { } /** - * 是否为驳回状态 - * - * @return 是否为驳回状态 + * 上级节点的状态是驳回状态 + * @return 上级节点的状态是驳回状态 */ - public boolean isRejectState() { + public boolean backStateIsReject() { if (flowRecord == null) { return false; } @@ -204,6 +203,26 @@ public boolean isRejectState() { return false; } + /** + * 是否来自驳回状态 + * + * @see #backStateIsReject() + */ + @Deprecated + public boolean isRejectState() { + return this.backStateIsReject(); + } + + /** + * 当前节点的状态是驳回状态 + */ + public boolean currentStateIsReject() { + if (flowRecord != null) { + return flowRecord.getFlowSourceDirection() == FlowSourceDirection.REJECT; + } + return false; + } + /** * 预提交流程 diff --git a/springboot-starter-security/pom.xml b/springboot-starter-security/pom.xml index c9ab1bdb..554707ed 100644 --- a/springboot-starter-security/pom.xml +++ b/springboot-starter-security/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.53 + 3.3.54 springboot-starter-security diff --git a/springboot-starter/pom.xml b/springboot-starter/pom.xml index a12f771c..0f080024 100644 --- a/springboot-starter/pom.xml +++ b/springboot-starter/pom.xml @@ -5,7 +5,7 @@ com.codingapi.springboot springboot-parent - 3.3.53 + 3.3.54 springboot-starter diff --git a/springboot-starter/src/main/resources/banner.txt b/springboot-starter/src/main/resources/banner.txt index b650caf6..cd5e156b 100644 --- a/springboot-starter/src/main/resources/banner.txt +++ b/springboot-starter/src/main/resources/banner.txt @@ -1,4 +1,4 @@ ------------------------------------------------------ -CodingApi SpringBoot-Starter 3.3.53 +CodingApi SpringBoot-Starter 3.3.54 springboot version (${spring-boot.version}) ------------------------------------------------------ From 382966f796567a3bdf329a6fe4ef3251bcd5ee98 Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Fri, 3 Jan 2025 22:07:13 +0800 Subject: [PATCH 6/8] add currentStateIsReject --- .../java/com/codingapi/springboot/flow/content/FlowSession.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java index c2db17e5..7d8accd4 100644 --- a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java +++ b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/content/FlowSession.java @@ -204,7 +204,7 @@ public boolean backStateIsReject() { } /** - * 是否来自驳回状态 + * 上级节点的状态是驳回状态 * * @see #backStateIsReject() */ From d9c08404ad90fd9240076f095f4bb431566b1ca4 Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Wed, 8 Jan 2025 16:31:03 +0800 Subject: [PATCH 7/8] fix trySubmitFlow bug --- example/example-application/pom.xml | 2 +- example/example-domain/pom.xml | 2 +- example/example-infra-flow/pom.xml | 2 +- example/example-infra-jpa/pom.xml | 2 +- example/example-server/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- springboot-starter-data-authorization/pom.xml | 2 +- springboot-starter-data-fast/pom.xml | 2 +- springboot-starter-flow/pom.xml | 2 +- .../codingapi/springboot/flow/service/FlowNodeService.java | 3 --- .../springboot/flow/service/impl/FlowSubmitService.java | 4 ++++ springboot-starter-security/pom.xml | 2 +- springboot-starter/pom.xml | 2 +- springboot-starter/src/main/resources/banner.txt | 2 +- 15 files changed, 17 insertions(+), 16 deletions(-) diff --git a/example/example-application/pom.xml b/example/example-application/pom.xml index f6ac635f..ea1f7fda 100644 --- a/example/example-application/pom.xml +++ b/example/example-application/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.54 + 3.3.55 4.0.0 diff --git a/example/example-domain/pom.xml b/example/example-domain/pom.xml index 9ea76ec1..28c57a17 100644 --- a/example/example-domain/pom.xml +++ b/example/example-domain/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.54 + 3.3.55 4.0.0 diff --git a/example/example-infra-flow/pom.xml b/example/example-infra-flow/pom.xml index bc3e2b88..3a9136e9 100644 --- a/example/example-infra-flow/pom.xml +++ b/example/example-infra-flow/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.54 + 3.3.55 4.0.0 diff --git a/example/example-infra-jpa/pom.xml b/example/example-infra-jpa/pom.xml index b94a3435..bfa9b24d 100644 --- a/example/example-infra-jpa/pom.xml +++ b/example/example-infra-jpa/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.54 + 3.3.55 4.0.0 diff --git a/example/example-server/pom.xml b/example/example-server/pom.xml index 6bf3bd19..f80145fe 100644 --- a/example/example-server/pom.xml +++ b/example/example-server/pom.xml @@ -5,7 +5,7 @@ springboot-example com.codingapi.springboot - 3.3.54 + 3.3.55 4.0.0 diff --git a/example/pom.xml b/example/pom.xml index 5d5fe69a..1e578b91 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -17,7 +17,7 @@ springboot-example - 3.3.54 + 3.3.55 springboot-example springboot-example project for Spring Boot diff --git a/pom.xml b/pom.xml index 3f7f01ff..0ca6ce6d 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ com.codingapi.springboot springboot-parent - 3.3.54 + 3.3.55 https://github.com/codingapi/springboot-framewrok springboot-parent diff --git a/springboot-starter-data-authorization/pom.xml b/springboot-starter-data-authorization/pom.xml index b49dfbd7..37316f1b 100644 --- a/springboot-starter-data-authorization/pom.xml +++ b/springboot-starter-data-authorization/pom.xml @@ -6,7 +6,7 @@ com.codingapi.springboot springboot-parent - 3.3.54 + 3.3.55 springboot-starter-data-authorization diff --git a/springboot-starter-data-fast/pom.xml b/springboot-starter-data-fast/pom.xml index 3c3212b3..3ccf0d75 100644 --- a/springboot-starter-data-fast/pom.xml +++ b/springboot-starter-data-fast/pom.xml @@ -5,7 +5,7 @@ springboot-parent com.codingapi.springboot - 3.3.54 + 3.3.55 4.0.0 diff --git a/springboot-starter-flow/pom.xml b/springboot-starter-flow/pom.xml index 8c6e0f90..0d0b67a3 100644 --- a/springboot-starter-flow/pom.xml +++ b/springboot-starter-flow/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.54 + 3.3.55 springboot-starter-flow diff --git a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowNodeService.java b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowNodeService.java index 4148f442..fec4c82e 100644 --- a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowNodeService.java +++ b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/FlowNodeService.java @@ -251,9 +251,6 @@ private List createNextRecord() { if (customOperatorIds != null && !customOperatorIds.isEmpty()) { operators = operators.stream() .filter(operator -> customOperatorIds.contains(operator.getUserId())).toList(); - if (operators.size() != customOperatorIds.size()) { - throw new IllegalArgumentException("operator not match."); - } } List recordList; if (operators.isEmpty()) { diff --git a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java index be06d19d..6573881d 100644 --- a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java +++ b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java @@ -369,6 +369,10 @@ public FlowSubmitResult trySubmitFlow() { this.loadNextNode(historyRecords); + while (nextNode.isCirculate()){ + flowNodeService.skipCirculate(); + } + List extends IFlowOperator> operators = flowNodeService.loadNextNodeOperators(); return new FlowSubmitResult(flowWork, nextNode, operators); } diff --git a/springboot-starter-security/pom.xml b/springboot-starter-security/pom.xml index 554707ed..1d7ccf2a 100644 --- a/springboot-starter-security/pom.xml +++ b/springboot-starter-security/pom.xml @@ -6,7 +6,7 @@ springboot-parent com.codingapi.springboot - 3.3.54 + 3.3.55 springboot-starter-security diff --git a/springboot-starter/pom.xml b/springboot-starter/pom.xml index 0f080024..55c0a4fc 100644 --- a/springboot-starter/pom.xml +++ b/springboot-starter/pom.xml @@ -5,7 +5,7 @@ com.codingapi.springboot springboot-parent - 3.3.54 + 3.3.55 springboot-starter diff --git a/springboot-starter/src/main/resources/banner.txt b/springboot-starter/src/main/resources/banner.txt index cd5e156b..18fe9b51 100644 --- a/springboot-starter/src/main/resources/banner.txt +++ b/springboot-starter/src/main/resources/banner.txt @@ -1,4 +1,4 @@ ------------------------------------------------------ -CodingApi SpringBoot-Starter 3.3.54 +CodingApi SpringBoot-Starter 3.3.55 springboot version (${spring-boot.version}) ------------------------------------------------------ From c10422b18bf076bccad50c4bd99e430891421213 Mon Sep 17 00:00:00 2001 From: lorne <1991wangliang@gmail.com> Date: Wed, 8 Jan 2025 16:46:39 +0800 Subject: [PATCH 8/8] update 3.3.55 --- .../springboot/flow/service/impl/FlowSubmitService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java index 6573881d..e1a8ce10 100644 --- a/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java +++ b/springboot-starter-flow/src/main/java/com/codingapi/springboot/flow/service/impl/FlowSubmitService.java @@ -371,6 +371,7 @@ public FlowSubmitResult trySubmitFlow() { while (nextNode.isCirculate()){ flowNodeService.skipCirculate(); + this.nextNode = flowNodeService.getNextNode(); } List extends IFlowOperator> operators = flowNodeService.loadNextNodeOperators();
- hi {username} , Redux counter: {counter}, Roles: {RoleControl.roles().map(item => ( - {item} - ))} -