瀏覽代碼

供应商模块保存和更改接口改动

mainqaq 3 年之前
父節點
當前提交
bfd03ae0b8
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      service/supply_service.go

+ 6 - 5
service/supply_service.go 查看文件

@@ -3,7 +3,6 @@ package service
3 3
 import (
4 4
 	"XT_New/models"
5 5
 	"github.com/jinzhu/gorm"
6
-	"strconv"
7 6
 	"time"
8 7
 )
9 8
 
@@ -53,13 +52,15 @@ func UpdateSupplyAndContact(thisStockIn []interface{}, suid, orgId, supplierType
53 52
 		items := item.(map[string]interface{})
54 53
 		//查询是否
55 54
 		if items["id"] == "" {
56
-			items["id"] = "0"
55
+			var tmp float64 = 0
56
+			items["id"] = tmp
57 57
 		}
58
-		id, _ := strconv.ParseInt(items["id"].(string), 10, 64)
58
+		//id, _ := strconv.ParseInt(items["id"].(string), 10, 64)
59
+		id := int64(items["id"].(float64))
59 60
 		name := items["name"].(string)
60 61
 		phone := items["phone"].(string)
61 62
 		address := items["address"].(string)
62
-		isfirst, _ := strconv.ParseInt(items["isfirst"].(string), 10, 64)
63
+		isfirst := int64(items["isfirst"].(int))
63 64
 		updatecontacts := models.SpSupplierContacts{
64 65
 			ID:           id,
65 66
 			Name:         name,
@@ -183,7 +184,7 @@ func SaveSupplyAndContact(thisStockIn []interface{}, orgId, supplierType, tcreat
183 184
 		name := items["name"].(string)
184 185
 		phone := items["phone"].(string)
185 186
 		address := items["address"].(string)
186
-		isfirst, _ := strconv.ParseInt(items["isfirst"].(string), 10, 64)
187
+		isfirst := int64(items["isfirst"].(int))
187 188
 
188 189
 		spcontacts := models.SpSupplierContacts{
189 190
 			Name:         name,