|
@@ -871,14 +871,19 @@ func (p *CokeInventoryProcessor) ProcessResponse(data string) ([]models.FenWeiNe
|
|
|
}
|
|
|
|
|
|
var value float64
|
|
|
- if data.InventoryIndex != 0 {
|
|
|
- value = data.InventoryIndex
|
|
|
- } else {
|
|
|
+ if data.InventoryIndex != nil && data.InventoryIndex != "" {
|
|
|
+ switch v := data.InventoryIndex.(type) {
|
|
|
+ case string:
|
|
|
+ value, _ = strconv.ParseFloat(v, 64)
|
|
|
+ case float64:
|
|
|
+ value = v
|
|
|
+ }
|
|
|
+ } else if data.Stock != nil && data.Stock != "" {
|
|
|
switch v := data.Stock.(type) {
|
|
|
case string:
|
|
|
value, _ = strconv.ParseFloat(v, 64)
|
|
|
case float64:
|
|
|
- value = float64(v)
|
|
|
+ value = v
|
|
|
}
|
|
|
}
|
|
|
|