|
|
@ -2104,14 +2104,33 @@ func (impl *ShipOrderServiceImplement) PermitTrough(workPlaceConfig *baseModel.W |
|
|
|
ErrorCode int `json:"ErrorCode"` |
|
|
|
Content interface{} `json:"Content"` |
|
|
|
} |
|
|
|
plcData, ok := response.Data.(PLCData) |
|
|
|
plcData, ok := response.Data.(map[string]interface{}) |
|
|
|
if !ok { |
|
|
|
log.Error("发运plc放行调用后台失败, 后台返回data格式不正确, 后台数据:" + string(boday)) |
|
|
|
return grmi.NewBusinessError("plc管理后台返回数据格式不正确") |
|
|
|
} |
|
|
|
if !plcData.IsSuccess { |
|
|
|
successInterface, exist := plcData["IsSuccess"] |
|
|
|
if !exist { |
|
|
|
log.Error("发运plc放行调用后台失败, 后台返回data格式不正确, 后台数据:" + string(boday)) |
|
|
|
return grmi.NewBusinessError("plc管理后台返回数据格式不正确") |
|
|
|
} |
|
|
|
success, ok := successInterface.(bool) |
|
|
|
if !ok { |
|
|
|
log.Error("发运plc放行调用后台失败, 后台返回data格式不正确, 后台数据:" + string(boday)) |
|
|
|
return grmi.NewBusinessError("plc管理后台返回数据格式不正确") |
|
|
|
} |
|
|
|
if !success { |
|
|
|
log.Error("发运plc放行调用后台失败, 后台plc执行失败, 后台数据:" + string(boday)) |
|
|
|
return grmi.NewBusinessError("plc执行失败, error:" + plcData.Message) |
|
|
|
var message string |
|
|
|
messageInterface, exist := plcData["Message"] |
|
|
|
if !exist { |
|
|
|
message = "未返回错误信息" |
|
|
|
} |
|
|
|
message, ok = messageInterface.(string) |
|
|
|
if !ok { |
|
|
|
message = "未返回错误信息" |
|
|
|
} |
|
|
|
return grmi.NewBusinessError("plc执行失败, error:" + message) |
|
|
|
} |
|
|
|
return nil |
|
|
|
} |