commit
db8b5faf0e
@ -143,11 +143,16 @@ 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"] {
|
||||||
for _, userId := range stateValue["processor"].([]interface{}) {
|
if _, ok := stateValue["processor"]; ok {
|
||||||
if int(userId.(float64)) == tools.GetUserId(c) {
|
for _, userId := range stateValue["processor"].([]interface{}) {
|
||||||
workOrderInfo.CurrentState = stateValue["id"].(string)
|
if int(userId.(float64)) == tools.GetUserId(c) {
|
||||||
break breakStateTag
|
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
|
authStatus bool
|
||||||
)
|
)
|
||||||
if len(StateList) != 0 {
|
if len(StateList) != 0 {
|
||||||
structResult, err = ProcessStructure(w.GinObj, v.Process, v.Id)
|
// 仅待办工单需要验证
|
||||||
if err != nil {
|
// todo:还需要找最优解决方案
|
||||||
return
|
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)
|
authStatus, err = JudgeUserAuthority(w.GinObj, v.Id, structResult["workOrder"].(WorkOrderData).CurrentState)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !authStatus {
|
if !authStatus {
|
||||||
minusTotal += 1
|
minusTotal += 1
|
||||||
continue
|
continue
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
authStatus = true
|
||||||
}
|
}
|
||||||
|
|
||||||
processorList := make([]int, 0)
|
processorList := make([]int, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user