mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-12-24 08:12:55 +08:00
修复获取下一审批节点
This commit is contained in:
@@ -12,24 +12,24 @@ import (
|
||||
type FlowHistoryHandler struct {
|
||||
}
|
||||
|
||||
// @Summary 流程历史列表
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param applyId query int false "申请id"
|
||||
// @Param templateId query int false "模板id"
|
||||
// @Param applyUserId query int false "申请人id"
|
||||
// @Param applyUserNickname query string false "申请人昵称"
|
||||
// @Param approverId query int false "审批人id"
|
||||
// @Param approverNickname query string false "审批用户昵称"
|
||||
// @Param nodeId query string false "节点"
|
||||
// @Param formValue query string false "表单值"
|
||||
// @Param passStatus query int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark query string false "通过备注"
|
||||
// @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowHistoryResp}} "成功"
|
||||
// @Router /api/admin/flow/flow_history/list [get]
|
||||
// @Summary 流程历史列表
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param PageNo query int true "页码"
|
||||
// @Param PageSize query int true "每页数量"
|
||||
// @Param applyId query int false "申请id"
|
||||
// @Param templateId query int false "模板id"
|
||||
// @Param applyUserId query int false "申请人id"
|
||||
// @Param applyUserNickname query string false "申请人昵称"
|
||||
// @Param approverId query int false "审批人id"
|
||||
// @Param approverNickname query string false "审批用户昵称"
|
||||
// @Param nodeId query string false "节点"
|
||||
// @Param formValue query string false "表单值"
|
||||
// @Param passStatus query int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark query string false "通过备注"
|
||||
// @Success 200 {object} response.Response{data=response.PageResp{lists=[]FlowHistoryResp}} "成功"
|
||||
// @Router /api/admin/flow/flow_history/list [get]
|
||||
func (hd FlowHistoryHandler) List(c *gin.Context) {
|
||||
var page request.PageReq
|
||||
var listReq = FlowHistoryListReq{
|
||||
@@ -45,11 +45,11 @@ func (hd FlowHistoryHandler) List(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 流程历史列表-所有
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
|
||||
// @Router /api/admin/flow/flow_history/listAll [get]
|
||||
// @Summary 流程历史列表-所有
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
|
||||
// @Router /api/admin/flow/flow_history/listAll [get]
|
||||
func (hd FlowHistoryHandler) ListAll(c *gin.Context) {
|
||||
var listReq FlowHistoryListReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &listReq)) {
|
||||
@@ -59,13 +59,13 @@ func (hd FlowHistoryHandler) ListAll(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 流程历史详情
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id query int false "历史id"
|
||||
// @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
|
||||
// @Router /api/admin/flow/flow_history/detail [get]
|
||||
// @Summary 流程历史详情
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id query int false "历史id"
|
||||
// @Success 200 {object} response.Response{data=FlowHistoryResp} "成功"
|
||||
// @Router /api/admin/flow/flow_history/detail [get]
|
||||
func (hd FlowHistoryHandler) Detail(c *gin.Context) {
|
||||
var detailReq FlowHistoryDetailReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyQuery(c, &detailReq)) {
|
||||
@@ -75,22 +75,22 @@ func (hd FlowHistoryHandler) Detail(c *gin.Context) {
|
||||
response.CheckAndRespWithData(c, res, err)
|
||||
}
|
||||
|
||||
// @Summary 流程历史新增
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param applyId body int false "申请id"
|
||||
// @Param templateId body int false "模板id"
|
||||
// @Param applyUserId body int false "申请人id"
|
||||
// @Param applyUserNickname body string false "申请人昵称"
|
||||
// @Param approverId body int false "审批人id"
|
||||
// @Param approverNickname body string false "审批用户昵称"
|
||||
// @Param nodeId body string false "节点"
|
||||
// @Param formValue body string false "表单值"
|
||||
// @Param passStatus body int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark body string false "通过备注"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/add [post]
|
||||
// @Summary 流程历史新增
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param applyId body int false "申请id"
|
||||
// @Param templateId body int false "模板id"
|
||||
// @Param applyUserId body int false "申请人id"
|
||||
// @Param applyUserNickname body string false "申请人昵称"
|
||||
// @Param approverId body int false "审批人id"
|
||||
// @Param approverNickname body string false "审批用户昵称"
|
||||
// @Param nodeId body string false "节点"
|
||||
// @Param formValue body string false "表单值"
|
||||
// @Param passStatus body int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark body string false "通过备注"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/add [post]
|
||||
func (hd FlowHistoryHandler) Add(c *gin.Context) {
|
||||
var addReq FlowHistoryAddReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &addReq)) {
|
||||
@@ -99,23 +99,23 @@ func (hd FlowHistoryHandler) Add(c *gin.Context) {
|
||||
response.CheckAndResp(c, Service.Add(addReq))
|
||||
}
|
||||
|
||||
// @Summary 流程历史编辑
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "历史id"
|
||||
// @Param applyId body int false "申请id"
|
||||
// @Param templateId body int false "模板id"
|
||||
// @Param applyUserId body int false "申请人id"
|
||||
// @Param applyUserNickname body string false "申请人昵称"
|
||||
// @Param approverId body int false "审批人id"
|
||||
// @Param approverNickname body string false "审批用户昵称"
|
||||
// @Param nodeId body string false "节点"
|
||||
// @Param formValue body string false "表单值"
|
||||
// @Param passStatus body int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark body string false "通过备注"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/edit [post]
|
||||
// @Summary 流程历史编辑
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "历史id"
|
||||
// @Param applyId body int false "申请id"
|
||||
// @Param templateId body int false "模板id"
|
||||
// @Param applyUserId body int false "申请人id"
|
||||
// @Param applyUserNickname body string false "申请人昵称"
|
||||
// @Param approverId body int false "审批人id"
|
||||
// @Param approverNickname body string false "审批用户昵称"
|
||||
// @Param nodeId body string false "节点"
|
||||
// @Param formValue body string false "表单值"
|
||||
// @Param passStatus body int false "通过状态:0待处理,1通过,2拒绝"
|
||||
// @Param passRemark body string false "通过备注"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/edit [post]
|
||||
func (hd FlowHistoryHandler) Edit(c *gin.Context) {
|
||||
var editReq FlowHistoryEditReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &editReq)) {
|
||||
@@ -124,13 +124,13 @@ func (hd FlowHistoryHandler) Edit(c *gin.Context) {
|
||||
response.CheckAndResp(c, Service.Edit(editReq))
|
||||
}
|
||||
|
||||
// @Summary 流程历史删除
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "历史id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/del [post]
|
||||
// @Summary 流程历史删除
|
||||
// @Tags flow_history-流程历史
|
||||
// @Produce json
|
||||
// @Param Token header string true "token"
|
||||
// @Param id body int false "历史id"
|
||||
// @Success 200 {object} response.Response "成功"
|
||||
// @Router /api/admin/flow/flow_history/del [post]
|
||||
func (hd FlowHistoryHandler) Del(c *gin.Context) {
|
||||
var delReq FlowHistoryDelReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &delReq)) {
|
||||
@@ -140,8 +140,9 @@ func (hd FlowHistoryHandler) Del(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 提交申请,通过审批
|
||||
// @Tags flow_history-流程历史
|
||||
//
|
||||
// @Router /api/admin/flow_apply/pass [post]
|
||||
// @Router /api/admin/flow/flow_apply/pass [post]
|
||||
func (hd FlowHistoryHandler) Pass(c *gin.Context) {
|
||||
var pass PassReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &pass)) {
|
||||
@@ -153,7 +154,9 @@ func (hd FlowHistoryHandler) Pass(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 拒绝审批
|
||||
// @Router /api/admin/flow_apply/back [post]
|
||||
// @Tags flow_history-流程历史
|
||||
//
|
||||
// @Router /api/admin/flow/flow_apply/back [post]
|
||||
func (hd FlowHistoryHandler) Back(c *gin.Context) {
|
||||
var back BackReq
|
||||
if response.IsFailWithResp(c, util.VerifyUtil.VerifyBody(c, &back)) {
|
||||
@@ -192,7 +195,3 @@ func (hd FlowHistoryHandler) GetApprover(c *gin.Context) {
|
||||
}
|
||||
response.OkWithData(c, res)
|
||||
}
|
||||
|
||||
// 同意审批(当前nodeId)
|
||||
|
||||
// 拒绝审批,驳回审批
|
||||
|
||||
@@ -520,22 +520,22 @@ func (service flowHistoryService) GetNextNode(ApplyId int) (res []FlowTree, appl
|
||||
}
|
||||
}
|
||||
}
|
||||
var nextNodes []FlowTree
|
||||
res = DeepNextNode(nextNodes, &next, formValue)
|
||||
res = DeepNextNode(&next, formValue)
|
||||
return res, applyDetail, LastHistory, e
|
||||
}
|
||||
|
||||
// 返回节点数组,最后一个节点为用户或结束节点
|
||||
func DeepNextNode(nextNodes []FlowTree, flowTree *[]FlowTree, formValue map[string]interface{}) []FlowTree {
|
||||
func DeepNextNode(flowTree *[]FlowTree, formValue map[string]interface{}) []FlowTree {
|
||||
var nextNodes []FlowTree
|
||||
for _, v := range *flowTree {
|
||||
if v.Type == "bpmn:startEvent" {
|
||||
// nextNodes = append(nextNodes, v)
|
||||
nextNodes = append(nextNodes, v)
|
||||
|
||||
// 开始节点
|
||||
if v.Children == nil {
|
||||
break
|
||||
}
|
||||
child := DeepNextNode(nextNodes, v.Children, formValue)
|
||||
child := DeepNextNode(v.Children, formValue)
|
||||
nextNodes = append(nextNodes, child...)
|
||||
break
|
||||
} else if v.Type == "bpmn:exclusiveGateway" {
|
||||
@@ -600,7 +600,7 @@ func DeepNextNode(nextNodes []FlowTree, flowTree *[]FlowTree, formValue map[stri
|
||||
break
|
||||
}
|
||||
// 判断formValue值,决定是不是递归这个网关
|
||||
child := DeepNextNode(nextNodes, v.Children, formValue)
|
||||
child := DeepNextNode(v.Children, formValue)
|
||||
nextNodes = append(nextNodes, child...)
|
||||
break
|
||||
}
|
||||
@@ -610,7 +610,7 @@ func DeepNextNode(nextNodes []FlowTree, flowTree *[]FlowTree, formValue map[stri
|
||||
break
|
||||
}
|
||||
// 系统服务
|
||||
child := DeepNextNode(nextNodes, v.Children, formValue)
|
||||
child := DeepNextNode(v.Children, formValue)
|
||||
nextNodes = append(nextNodes, child...)
|
||||
} else if v.Type == "bpmn:userTask" {
|
||||
//用户节点
|
||||
|
||||
Reference in New Issue
Block a user