fix: 修复工单列表展示bug。
This commit is contained in:
parent
cc3200dfa1
commit
87ba9e8943
@ -143,11 +143,16 @@ func ProcessStructure(c *gin.Context, processId int, workOrderId int) (result ma
|
||||
for _, stateValue := range stateList {
|
||||
for _, processNodeValue := range processStructureDetails["nodes"].([]interface{}) {
|
||||
if stateValue["id"].(string) == processNodeValue.(map[string]interface{})["id"] {
|
||||
for _, userId := range stateValue["processor"].([]interface{}) {
|
||||
if int(userId.(float64)) == tools.GetUserId(c) {
|
||||
workOrderInfo.CurrentState = stateValue["id"].(string)
|
||||
break breakStateTag
|
||||
if _, ok := stateValue["processor"]; ok {
|
||||
for _, userId := range stateValue["processor"].([]interface{}) {
|
||||
if int(userId.(float64)) == tools.GetUserId(c) {
|
||||
workOrderInfo.CurrentState = stateValue["id"].(string)
|
||||
break breakStateTag
|
||||
}
|
||||
}
|
||||
} else {
|
||||
err = errors.New("未查询到对应的处理人字段,请确认。")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,18 +122,24 @@ func (w *WorkOrder) WorkOrderList() (result interface{}, err error) {
|
||||
authStatus bool
|
||||
)
|
||||
if len(StateList) != 0 {
|
||||
structResult, err = ProcessStructure(w.GinObj, v.Process, v.Id)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// 仅待办工单需要验证
|
||||
// todo:还需要找最优解决方案
|
||||
if w.Classify == 1 {
|
||||
structResult, err = ProcessStructure(w.GinObj, v.Process, v.Id)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
authStatus, err = JudgeUserAuthority(w.GinObj, v.Id, structResult["workOrder"].(WorkOrderData).CurrentState)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !authStatus {
|
||||
minusTotal += 1
|
||||
continue
|
||||
authStatus, err = JudgeUserAuthority(w.GinObj, v.Id, structResult["workOrder"].(WorkOrderData).CurrentState)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !authStatus {
|
||||
minusTotal += 1
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
authStatus = true
|
||||
}
|
||||
|
||||
processorList := make([]int, 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user