审批验证

This commit is contained in:
xiangheng
2024-01-03 01:18:51 +08:00
parent 00415bace3
commit 91366071cd
5 changed files with 33 additions and 22 deletions

View File

@@ -12,7 +12,7 @@
<br>
## 体验
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=3owvxQhAsj6oJ6_aJKuARd-GK6dDbMdu&jump_from=webapi&authKey=c989fefqSydvK0yM5uw+y5UIPy1WfMR/OlLPnubNW9ixVp9lKsTXXth07K7zOYOH"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="x_admin后台管理系统" title="x_admin后台管理系统"></a>
本仓库演示地址http://likeadmin.adtk.cn <br>
原仓库演示地址https://go-admin.likeadmin.cn <br>
@@ -20,7 +20,7 @@
## 开发部署文档
0. [使用](./docs/0.使用.md)
1. [打包部署](./docs/1.go-打包部署)
1. [打包部署](./docs/1.go-打包部署.md)
2. [nginx配置.md](./docs/2.nginx配置.md)
@@ -44,11 +44,13 @@
- 代码生成器:一键生成前后端业务代码
- 审批流:基于`LogicFlow``VForm 3`,整体流程已实现,需要细化
![](./docs/assets/menu.png)
<img border="0" src="./docs/assets/menu.png" height="1000px" alt="alipay" title="alipay"/>
![](./docs/assets/genCode.png)
![](./docs/assets/flow.png)
# 支持
<img border="0" src="./docs/assets/alipay.jpg" height="400px" alt="alipay" title="alipay">
<img border="0" src="./docs/assets/weixinpay.png" height="400px" alt="weixin" title="weixin" style="margin:0 60px">
<img border="0" src="./docs/assets/group.jpg" height="400px" alt="group" title="group">
# QQ群<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=3owvxQhAsj6oJ6_aJKuARd-GK6dDbMdu&jump_from=webapi&authKey=c989fefqSydvK0yM5uw+y5UIPy1WfMR/OlLPnubNW9ixVp9lKsTXXth07K7zOYOH">点击链接或扫码加入(目前没人)</a>
<img border="0" src="./docs/assets/group.jpg" height="400px" alt="group" title="group">

View File

@@ -15,7 +15,7 @@
"@highlightjs/vue-plugin": "^2.1.0",
"@logicflow/core": "^1.2.18",
"@logicflow/extension": "^1.2.19",
"@vue/shared": "^3.3.13",
"@vue/shared": "^3.4.3",
"@vueuse/core": "^10.7.1",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
@@ -30,7 +30,7 @@
"nprogress": "^0.2.0",
"pinia": "^2.1.7",
"vform3-builds": "^3.0.10",
"vue": "^3.3.13",
"vue": "^3.4.3",
"vue-clipboard3": "^2.0.0",
"vue-echarts": "^6.6.8",
"vue-router": "^4.2.5",
@@ -40,22 +40,22 @@
"devDependencies": {
"@rushstack/eslint-patch": "^1.6.1",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.10.1",
"@types/node": "^20.10.6",
"@types/nprogress": "^0.2.3",
"@vitejs/plugin-vue": "^4.5.0",
"@vitejs/plugin-vue": "^5.0.2",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.4.0",
"@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.16",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.19.0",
"eslint-plugin-vue": "^9.19.2",
"execa": "^8.0.1",
"fs-extra": "^11.2.0",
"postcss": "^8.4.32",
"prettier": "^3.1.1",
"rollup-plugin-visualizer": "^5.9.3",
"sass": "^1.69.5",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.69.6",
"tailwindcss": "^3.4.0",
"typescript": "~5.3.3",
"unplugin-auto-import": "^0.17.3",

BIN
docs/assets/flow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View File

@@ -1,6 +1,7 @@
package flow_history
import (
"fmt"
"x_admin/core/request"
"x_admin/core/response"
"x_admin/util"
@@ -148,6 +149,7 @@ func (hd FlowHistoryHandler) Pass(c *gin.Context) {
return
}
err := Service.Pass(pass)
fmt.Println(err)
response.CheckAndResp(c, err)
}
@@ -159,6 +161,7 @@ func (hd FlowHistoryHandler) Back(c *gin.Context) {
return
}
err := Service.Back(back)
fmt.Println(err)
response.CheckAndResp(c, err)
}

View File

@@ -270,7 +270,10 @@ func (Service flowHistoryService) Pass(pass PassReq) (e error) {
if err != nil {
return err
}
isEnd := false // 是否是最后一个节点
// nextNodes必须包含审批节点或结束节点否则流程抛出异常
isUserTask := false //是否有用户节点
isEndTask := false // 是否是最后一个节点
FormValue := applyDetail.FormValue
if LastHistory.Id != 0 {
@@ -306,16 +309,19 @@ func (Service flowHistoryService) Pass(pass PassReq) (e error) {
flow.PassStatus = 1 //1待处理,异步任务可以失败
// 发邮件之类的,待完善
} else if v.Type == "bpmn:userTask" {
isUserTask = true
flow.ApproverId = pass.NextNodeAdminId
flow.PassStatus = 1 //1待处理
} else if v.Type == "bpmn:endEvent" {
isEnd = true
isEndTask = true
flow.ApproverId = 0
flow.PassStatus = 2 //2通过
}
flows = append(flows, flow)
}
if !isUserTask && !isEndTask {
return errors.New("必须包含审批节点或者结束节点")
}
err = Service.db.Transaction(func(tx *gorm.DB) error {
// 在事务中执行一些 db 操作(从这里开始,您应该使用 'tx' 而不是 'db'
if err := tx.Create(&flows).Error; err != nil {
@@ -333,9 +339,9 @@ func (Service flowHistoryService) Pass(pass PassReq) (e error) {
}
// 待提交或者有结束节点,修改申请状态
if applyDetail.Status == 1 || isEnd {
if applyDetail.Status == 1 || isEndTask {
status := 2 //审批中
if isEnd {
if isEndTask {
status = 3 //审批通过
}
err = tx.Model(&model.FlowApply{}).Where(model.FlowApply{