fix: 修复工单列表展示bug。

This commit is contained in:
Mr. Lan 2020-10-09 00:58:14 +08:00
parent cc3200dfa1
commit 87ba9e8943
2 changed files with 26 additions and 15 deletions

View File

@ -143,12 +143,17 @@ func ProcessStructure(c *gin.Context, processId int, workOrderId int) (result ma
for _, stateValue := range stateList { for _, stateValue := range stateList {
for _, processNodeValue := range processStructureDetails["nodes"].([]interface{}) { for _, processNodeValue := range processStructureDetails["nodes"].([]interface{}) {
if stateValue["id"].(string) == processNodeValue.(map[string]interface{})["id"] { if stateValue["id"].(string) == processNodeValue.(map[string]interface{})["id"] {
if _, ok := stateValue["processor"]; ok {
for _, userId := range stateValue["processor"].([]interface{}) { for _, userId := range stateValue["processor"].([]interface{}) {
if int(userId.(float64)) == tools.GetUserId(c) { if int(userId.(float64)) == tools.GetUserId(c) {
workOrderInfo.CurrentState = stateValue["id"].(string) workOrderInfo.CurrentState = stateValue["id"].(string)
break breakStateTag break breakStateTag
} }
} }
} else {
err = errors.New("未查询到对应的处理人字段,请确认。")
return
}
} }
} }
} }

View File

@ -122,6 +122,9 @@ func (w *WorkOrder) WorkOrderList() (result interface{}, err error) {
authStatus bool authStatus bool
) )
if len(StateList) != 0 { if len(StateList) != 0 {
// 仅待办工单需要验证
// todo还需要找最优解决方案
if w.Classify == 1 {
structResult, err = ProcessStructure(w.GinObj, v.Process, v.Id) structResult, err = ProcessStructure(w.GinObj, v.Process, v.Id)
if err != nil { if err != nil {
return return
@ -135,6 +138,9 @@ func (w *WorkOrder) WorkOrderList() (result interface{}, err error) {
minusTotal += 1 minusTotal += 1
continue continue
} }
} else {
authStatus = true
}
processorList := make([]int, 0) processorList := make([]int, 0)
if len(StateList) > 1 { if len(StateList) > 1 {