瀏覽代碼

供应商接口id判空

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

+ 1 - 3
service/supply_service.go 查看文件

@@ -43,7 +43,7 @@ func UpdateSupplyAndContact(thisStockIn []interface{}, suid, orgId, supplierType
43 43
 	for _, item := range thisStockIn {
44 44
 		items := item.(map[string]interface{})
45 45
 		//查询是否
46
-		if items["id"] == "" {
46
+		if items["id"] == "" || items["id"] == 0 {
47 47
 			var tmp float64 = 0
48 48
 			items["id"] = tmp
49 49
 		}
@@ -193,7 +193,6 @@ func SaveSupplyAndContact(thisStockIn []interface{}, orgId, supplierType, tcreat
193 193
 		if isfirst == 1 {
194 194
 			var spconid []*models.SpSupplierContacts
195 195
 			spconid, err = SaveContactsId(tx)
196
-
197 196
 			if err != nil {
198 197
 				return err
199 198
 			}
@@ -219,7 +218,6 @@ func SaveSupplyAndContact(thisStockIn []interface{}, orgId, supplierType, tcreat
219 218
 			if err != nil {
220 219
 				return err
221 220
 			}
222
-
223 221
 		}
224 222
 		if err != nil {
225 223
 			return err