fix: 修复会签bug,fix #82

This commit is contained in:
Mr. Lan 2020-11-04 00:48:04 +08:00
parent 536a4c5686
commit 7133e91552

View File

@ -101,6 +101,17 @@ func (h *Handle) Countersign(c *gin.Context) (err error) {
if err != nil { if err != nil {
return return
} }
// 如果是跳转到结束节点,则需要修改节点状态
if h.targetStateValue["clazz"] == "end" {
err = h.tx.Model(&process.WorkOrderInfo{}).
Where("id = ?", h.workOrderId).
Update("is_end", 1).Error
if err != nil {
h.tx.Rollback()
return
}
}
} }
return return
} }
@ -619,16 +630,8 @@ func (h *Handle) HandleWorkOrder(
stateValue["processor"] = []int{} stateValue["processor"] = []int{}
stateValue["process_method"] = "" stateValue["process_method"] = ""
h.updateValue["state"] = []map[string]interface{}{stateValue} h.updateValue["state"] = []map[string]interface{}{stateValue}
err = h.circulation() err = h.commonProcessing(c)
if err != nil { if err != nil {
h.tx.Rollback()
return
}
err = h.tx.Model(&process.WorkOrderInfo{}).
Where("id = ?", h.workOrderId).
Update("is_end", 1).Error
if err != nil {
h.tx.Rollback()
return return
} }
} }
@ -656,6 +659,7 @@ func (h *Handle) HandleWorkOrder(
if writeTplId == t["tplId"] { // 可写 if writeTplId == t["tplId"] { // 可写
// 是否隐藏,隐藏的模版无法修改数据 // 是否隐藏,隐藏的模版无法修改数据
if hideTplList, hideOK := h.stateValue["hideTpls"]; hideOK { if hideTplList, hideOK := h.stateValue["hideTpls"]; hideOK {
if hideTplList != nil && len(hideTplList.([]interface{})) > 0 {
for _, hideTplId := range hideTplList.([]interface{}) { for _, hideTplId := range hideTplList.([]interface{}) {
if hideTplId == t["tplId"] { // 隐藏的 if hideTplId == t["tplId"] { // 隐藏的
updateStatus = false updateStatus = false
@ -667,6 +671,9 @@ func (h *Handle) HandleWorkOrder(
} else { } else {
updateStatus = true updateStatus = true
} }
} else {
updateStatus = true
}
} }
} }
} else { } else {