陈少旭 4 months ago
parent
commit
b6eaaf3ca5
3 changed files with 298 additions and 139 deletions
  1. 277 122
      controllers/sg/his_api_controller.go
  2. 4 5
      models/new_stock_models.go
  3. 17 12
      service/fj_service.go

+ 277 - 122
controllers/sg/his_api_controller.go View File

24
 	"github.com/jinzhu/gorm"
24
 	"github.com/jinzhu/gorm"
25
 	"github.com/shopspring/decimal"
25
 	"github.com/shopspring/decimal"
26
 
26
 
27
+	"github.com/go-ole/go-ole/oleutil"
27
 	"io"
28
 	"io"
28
 	"io/ioutil"
29
 	"io/ioutil"
29
 	//"math"
30
 	//"math"
38
 	"syscall"
39
 	"syscall"
39
 	"time"
40
 	"time"
40
 	"unsafe"
41
 	"unsafe"
41
-	"github.com/go-ole/go-ole"
42
-	"github.com/go-ole/go-ole/oleutil"
43
 )
42
 )
44
 
43
 
45
 type HisApiController struct {
44
 type HisApiController struct {
200
 	drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
199
 	drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
201
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
200
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
202
 	//库盘
201
 	//库盘
202
+	var errs []string
203
 	for _, drug := range drugs {
203
 	for _, drug := range drugs {
204
 		if drug.IsPc == 0 && drug.IsBg == 0 {
204
 		if drug.IsPc == 0 && drug.IsBg == 0 {
205
+			var res2 ResultSix
206
+			var res3 ResultSix
207
+
205
 			number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(drug.ID, 10) + "-" + "3501"
208
 			number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(drug.ID, 10) + "-" + "3501"
206
 			var struct3501 models.Struct3501
209
 			var struct3501 models.Struct3501
207
 			struct3501.OrgName = miConfig.OrgName
210
 			struct3501.OrgName = miConfig.OrgName
230
 			memo["pric"] = drug.Price
233
 			memo["pric"] = drug.Price
231
 			bytesData, _ := json.Marshal(memo)
234
 			bytesData, _ := json.Marshal(memo)
232
 			struct3501.Memo = string(bytesData)
235
 			struct3501.Memo = string(bytesData)
233
-			result1, result2, result3 := service.FJyb3501(struct3501)
236
+			result1, result2, _ := service.FJyb3501(struct3501)
234
 			saveLog(result1, result2, "3501", "3501")
237
 			saveLog(result1, result2, "3501", "3501")
235
 			//saveLog(result, requestLog, "2201", "挂号")
238
 			//saveLog(result, requestLog, "2201", "挂号")
236
 
239
 
237
-			fmt.Println(result1)
238
-			fmt.Println(result2)
239
-			fmt.Println(result3)
240
-
241
-			var struct3502 models.Struct3502
242
-			struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
243
-			struct3502.FixmedinsHilistId = miConfig.Code
244
-			struct3502.FixmedinsHilistName = miConfig.OrgName
245
-			struct3502.FixmedinsCode = miConfig.Code
246
-			struct3502.RxFlag = "0"
247
-			struct3502.InvChgTime = time.Now().Format("2006-01-02")
248
-			struct3502.OrgName = miConfig.OrgName
249
-			struct3501.Opter = roles.UserName
250
-			struct3502.AccessKey = miConfig.AccessKey
251
-			struct3502.RequestUrl = miConfig.Url
252
-			struct3502.SecretKey = miConfig.SecretKey
253
-			struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
254
-			struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
255
-
256
-			struct3502.Url = miConfig.Url
257
-			struct3502.AppId = miConfig.Cainfo
258
-			struct3502.AppSecret = miConfig.AppSecret
259
-			struct3502.Enckey = miConfig.EncKey
260
-			struct3502.SignKey = miConfig.SignKey
261
-			struct3502.SecretKey = miConfig.SecretKey
262
-
263
-			struct3502.Memo = ""
264
-			struct3502.InvChgType = "108"
265
-			struct3502.FixmedinsBchno = number
266
-			struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
267
-			struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
268
-			result11, result22, result33 := service.FJyb3502(struct3502)
269
-			fmt.Println(result11)
270
-			fmt.Println(result22)
271
-			fmt.Println(result33)
272
-			saveLog(result11, result22, "3502", "3502")
240
+			var respJSON2 map[string]interface{}
241
+			if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
242
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
243
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
244
+				return
245
+			}
246
+			userJSONBytes2, _ := json.Marshal(respJSON2)
247
+			if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
248
+				utils.ErrorLog("解析失败:%v", err)
249
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
250
+				return
251
+			}
273
 
252
 
253
+			if res2.Infcode != -1 {
254
+				drug.IsPc = 1
255
+				drug.Bchno = number
256
+				drug.PcDate = time.Now().Format("2006-01-02")
257
+				err := service.SaveW(drug)
258
+				if err == nil {
259
+					var struct3502 models.Struct3502
260
+					struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
261
+					struct3502.FixmedinsHilistId = miConfig.Code
262
+					struct3502.FixmedinsHilistName = miConfig.OrgName
263
+					struct3502.FixmedinsCode = miConfig.Code
264
+					struct3502.RxFlag = "0"
265
+					struct3502.InvChgTime = time.Now().Format("2006-01-02")
266
+					struct3502.OrgName = miConfig.OrgName
267
+					struct3501.Opter = roles.UserName
268
+					struct3502.AccessKey = miConfig.AccessKey
269
+					struct3502.RequestUrl = miConfig.Url
270
+					struct3502.SecretKey = miConfig.SecretKey
271
+					struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
272
+					struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
273
+					struct3502.Url = miConfig.Url
274
+					struct3502.AppId = miConfig.Cainfo
275
+					struct3502.AppSecret = miConfig.AppSecret
276
+					struct3502.Enckey = miConfig.EncKey
277
+					struct3502.SignKey = miConfig.SignKey
278
+					struct3502.SecretKey = miConfig.SecretKey
279
+					struct3502.Memo = ""
280
+					struct3502.InvChgType = "108"
281
+					struct3502.FixmedinsBchno = drug.Bchno
282
+					struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
283
+					struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
284
+					result11, result22, _ := service.FJyb3502(struct3502)
285
+					saveLog(result11, result22, "3502", "3502")
286
+
287
+					var respJSON3 map[string]interface{}
288
+					if err := json.Unmarshal([]byte(string(result11)), &respJSON3); err != nil {
289
+						utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
290
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
291
+						return
292
+					}
293
+					userJSONBytes3, _ := json.Marshal(respJSON3)
294
+					if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
295
+						utils.ErrorLog("解析失败:%v", err)
296
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
297
+						return
298
+					}
299
+					if res3.Infcode == -1 {
300
+						errs = append(errs, "变更"+drug.BaseDrugLib.DrugName+",出错:"+res3.ErrMsg)
301
+						c.ServeSuccessJSON(map[string]interface{}{
302
+							"failed_code": -10,
303
+							"msg":         res3.ErrMsg,
304
+						})
305
+					} else {
306
+						drug.IsBg = 1
307
+						service.SaveW(drug)
308
+					}
309
+				}
310
+			} else {
311
+				errs = append(errs, "盘存"+drug.BaseDrugLib.DrugName+",出错:"+res2.ErrMsg)
312
+			}
274
 
313
 
275
 		}
314
 		}
276
 		//变更
315
 		//变更
277
 		if drug.IsPc == 1 && drug.IsBg == 0 {
316
 		if drug.IsPc == 1 && drug.IsBg == 0 {
317
+			var res3 ResultSix
318
+
278
 			var struct3502 models.Struct3502
319
 			var struct3502 models.Struct3502
279
 			struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
320
 			struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
280
 			struct3502.FixmedinsHilistId = miConfig.Code
321
 			struct3502.FixmedinsHilistId = miConfig.Code
301
 			struct3502.FixmedinsBchno = drug.Bchno
342
 			struct3502.FixmedinsBchno = drug.Bchno
302
 			struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
343
 			struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
303
 			struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
344
 			struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
304
-			result1, result2, result3 := service.FJyb3502(struct3502)
345
+			result1, result2, _ := service.FJyb3502(struct3502)
305
 			saveLog(result1, result2, "3502", "3502")
346
 			saveLog(result1, result2, "3502", "3502")
306
-			fmt.Println(result1)
307
-			fmt.Println(result2)
308
-			fmt.Println(result3)
347
+			var respJSON3 map[string]interface{}
348
+			if err := json.Unmarshal([]byte(string(result1)), &respJSON3); err != nil {
349
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
350
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
351
+				return
352
+			}
353
+			userJSONBytes3, _ := json.Marshal(respJSON3)
354
+			if err := json.Unmarshal(userJSONBytes3, &res3); err != nil {
355
+				utils.ErrorLog("解析失败:%v", err)
356
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
357
+				return
358
+			}
359
+			if res3.Infcode == -1 {
360
+				errs = append(errs, "变更"+drug.BaseDrugLib.DrugName+",出错:"+res3.ErrMsg)
361
+			} else {
362
+				drug.IsBg = 1
363
+				//drug.Bchno = number
364
+				//drug.PcDate = time.Now().Format("2006-01-02")
365
+				service.SaveW(drug)
366
+			}
309
 		}
367
 		}
310
 	}
368
 	}
369
+
370
+	if len(errs) == 0 {
371
+		c.ServeSuccessJSON(map[string]interface{}{
372
+			"msg": "盘存变更成功",
373
+		})
374
+	} else {
375
+		c.ServeSuccessJSON(map[string]interface{}{
376
+			"failed_code": -10,
377
+			"msg":         errs,
378
+		})
379
+	}
311
 }
380
 }
312
 func (c *HisApiController) DeletePCandBG() {
381
 func (c *HisApiController) DeletePCandBG() {
313
 	ids := c.GetString("ids")
382
 	ids := c.GetString("ids")
317
 
386
 
318
 	drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
387
 	drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
319
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
388
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
389
+	var err []string
320
 	for _, item := range drugs {
390
 	for _, item := range drugs {
321
 		if item.IsPc == 1 && item.IsBg == 1 {
391
 		if item.IsPc == 1 && item.IsBg == 1 {
392
+			var res FJ3507Result
393
+			var res2 FJ3507Result
394
+
322
 			var struct3507 models.Struct3507
395
 			var struct3507 models.Struct3507
323
-			struct3507.FixmedinsBchno = ""
396
+			struct3507.FixmedinsBchno = item.Bchno
324
 			struct3507.InvDataType = "1"
397
 			struct3507.InvDataType = "1"
325
 			struct3507.Opter = roles.UserName
398
 			struct3507.Opter = roles.UserName
326
 			struct3507.OrgName = miConfig.OrgName
399
 			struct3507.OrgName = miConfig.OrgName
329
 			struct3507.SecretKey = miConfig.SecretKey
402
 			struct3507.SecretKey = miConfig.SecretKey
330
 			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
403
 			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
331
 			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
404
 			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
332
-
333
 			struct3507.Url = miConfig.Url
405
 			struct3507.Url = miConfig.Url
334
 			struct3507.AppId = miConfig.Cainfo
406
 			struct3507.AppId = miConfig.Cainfo
335
 			struct3507.AppSecret = miConfig.AppSecret
407
 			struct3507.AppSecret = miConfig.AppSecret
336
 			struct3507.Enckey = miConfig.EncKey
408
 			struct3507.Enckey = miConfig.EncKey
337
 			struct3507.SignKey = miConfig.SignKey
409
 			struct3507.SignKey = miConfig.SignKey
338
 			struct3507.SecretKey = miConfig.SecretKey
410
 			struct3507.SecretKey = miConfig.SecretKey
339
-			service.FJyb3507(struct3507)
411
+			result, result1, _ := service.FJyb3507(struct3507)
412
+			saveLog(result, result1, "3507", "3507")
340
 
413
 
341
-			var struct3507_2 models.Struct3507
342
-			struct3507_2.OrgName = miConfig.OrgName
343
-			struct3507_2.AccessKey = miConfig.AccessKey
344
-			struct3507_2.RequestUrl = miConfig.Url
345
-			struct3507_2.SecretKey = miConfig.SecretKey
346
-			struct3507_2.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
347
-			struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
414
+			var respJSON2 map[string]interface{}
415
+			if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
416
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
417
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
418
+				return
419
+			}
420
+			userJSONBytes2, _ := json.Marshal(respJSON2)
421
+			if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
422
+				utils.ErrorLog("解析失败:%v", err)
423
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
424
+				return
425
+			}
348
 
426
 
349
-			struct3507_2.Url = miConfig.Url
350
-			struct3507_2.AppId = miConfig.Cainfo
351
-			struct3507_2.AppSecret = miConfig.AppSecret
352
-			struct3507_2.Enckey = miConfig.EncKey
353
-			struct3507_2.SignKey = miConfig.SignKey
354
-			struct3507_2.SecretKey = miConfig.SecretKey
427
+			if res.Infcode != -1 {
428
+				item.IsPc = 0
429
+				err2 := service.SaveW(item)
430
+				if err2 == nil {
431
+					var struct3507_2 models.Struct3507
432
+					struct3507_2.OrgName = miConfig.OrgName
433
+					struct3507_2.AccessKey = miConfig.AccessKey
434
+					struct3507_2.RequestUrl = miConfig.Url
435
+					struct3507_2.Opter = roles.UserName
436
+					struct3507_2.SecretKey = miConfig.SecretKey
437
+					struct3507_2.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
438
+					struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
439
+					struct3507_2.Url = miConfig.Url
440
+					struct3507_2.AppId = miConfig.Cainfo
441
+					struct3507_2.AppSecret = miConfig.AppSecret
442
+					struct3507_2.Enckey = miConfig.EncKey
443
+					struct3507_2.SignKey = miConfig.SignKey
444
+					struct3507_2.SecretKey = miConfig.SecretKey
445
+					struct3507_2.FixmedinsBchno = item.Bchno
446
+					struct3507_2.InvDataType = "2"
447
+					result11, result22, _ := service.FJyb3507(struct3507_2)
448
+					saveLog(result11, result22, "3507", "3507")
449
+
450
+					var respJSON3 map[string]interface{}
451
+					if err := json.Unmarshal([]byte(string(result11)), &respJSON3); err != nil {
452
+						utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
453
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
454
+						return
455
+					}
456
+					userJSONBytes3, _ := json.Marshal(respJSON3)
457
+					if err := json.Unmarshal(userJSONBytes3, &res2); err != nil {
458
+						utils.ErrorLog("解析失败:%v", err)
459
+						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
460
+						return
461
+					}
462
+					if res2.Infcode != -1 {
463
+						item.IsBg = 0
464
+						item.Bchno = ""
465
+						item.PcDate = ""
466
+						service.SaveW(item)
467
+					} else {
468
+						err = append(err, "删除"+item.BaseDrugLib.DrugName+"变更失败,失败原因:"+res.ErrMsg)
469
+					}
470
+				}
471
+			} else {
472
+				err = append(err, "删除"+item.BaseDrugLib.DrugName+"盘存失败,失败原因:"+res.ErrMsg)
473
+			}
355
 
474
 
356
-			struct3507_2.FixmedinsBchno = ""
357
-			struct3507_2.InvDataType = "2"
358
-			service.FJyb3507(struct3507_2)
359
 		}
475
 		}
360
 		if item.IsPc == 1 && item.IsBg == 0 {
476
 		if item.IsPc == 1 && item.IsBg == 0 {
477
+
478
+			var res FJ3507Result
361
 			var struct3507 models.Struct3507
479
 			var struct3507 models.Struct3507
480
+			struct3507.FixmedinsBchno = item.Bchno
481
+			struct3507.InvDataType = "2"
482
+			struct3507.Opter = roles.UserName
362
 			struct3507.OrgName = miConfig.OrgName
483
 			struct3507.OrgName = miConfig.OrgName
363
 			struct3507.AccessKey = miConfig.AccessKey
484
 			struct3507.AccessKey = miConfig.AccessKey
364
 			struct3507.RequestUrl = miConfig.Url
485
 			struct3507.RequestUrl = miConfig.Url
365
 			struct3507.SecretKey = miConfig.SecretKey
486
 			struct3507.SecretKey = miConfig.SecretKey
366
 			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
487
 			struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
367
 			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
488
 			struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
368
-
369
 			struct3507.Url = miConfig.Url
489
 			struct3507.Url = miConfig.Url
370
 			struct3507.AppId = miConfig.Cainfo
490
 			struct3507.AppId = miConfig.Cainfo
371
 			struct3507.AppSecret = miConfig.AppSecret
491
 			struct3507.AppSecret = miConfig.AppSecret
372
 			struct3507.Enckey = miConfig.EncKey
492
 			struct3507.Enckey = miConfig.EncKey
373
 			struct3507.SignKey = miConfig.SignKey
493
 			struct3507.SignKey = miConfig.SignKey
374
 			struct3507.SecretKey = miConfig.SecretKey
494
 			struct3507.SecretKey = miConfig.SecretKey
375
-			struct3507.FixmedinsBchno = ""
376
-			struct3507.InvDataType = "1"
377
-			service.FJyb3507(struct3507)
495
+			result, result1, _ := service.FJyb3507(struct3507)
496
+			saveLog(result, result1, "3507", "3507")
497
+
498
+			var respJSON3 map[string]interface{}
499
+			if err := json.Unmarshal([]byte(string(result)), &respJSON3); err != nil {
500
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
501
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
502
+				return
503
+			}
504
+			userJSONBytes3, _ := json.Marshal(respJSON3)
505
+			if err := json.Unmarshal(userJSONBytes3, &res); err != nil {
506
+				utils.ErrorLog("解析失败:%v", err)
507
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
508
+				return
509
+			}
510
+			if res.Infcode != -1 {
511
+				item.IsBg = 0
512
+				item.Bchno = ""
513
+				item.PcDate = ""
514
+				service.SaveW(item)
515
+			} else {
516
+				err = append(err, "删除"+item.BaseDrugLib.DrugName+"变更失败,失败原因:"+res.ErrMsg)
517
+			}
378
 		}
518
 		}
379
 
519
 
380
 	}
520
 	}
521
+	if len(err) == 0 {
522
+		c.ServeSuccessJSON(map[string]interface{}{
523
+			"msg": "删除盘存变更成功",
524
+		})
525
+
526
+	} else {
527
+		c.ServeSuccessJSON(map[string]interface{}{
528
+			"failed_code": -10,
529
+			"msg":         err,
530
+		})
531
+
532
+	}
381
 
533
 
382
 }
534
 }
383
 
535
 
7606
 	//psn_record, _ := service.GetP(id)
7758
 	//psn_record, _ := service.GetP(id)
7607
 	psn_info, _ := service.GetPsnByPatientId(patient_id)
7759
 	psn_info, _ := service.GetPsnByPatientId(patient_id)
7608
 
7760
 
7609
-
7610
 	//psn_record, _ := service.GetPsnNCDSRecordById(id)
7761
 	//psn_record, _ := service.GetPsnNCDSRecordById(id)
7611
 	//
7762
 	//
7612
 	//if psn_record.ID == 0 {
7763
 	//if psn_record.ID == 0 {
7845
 			return
7996
 			return
7846
 		}
7997
 		}
7847
 
7998
 
7848
-	}  else if miConfig.MdtrtareaAdmvs == "420902" {
7999
+	} else if miConfig.MdtrtareaAdmvs == "420902" {
7849
 		p, _ := service.GetHisPatientById(patient_id)
8000
 		p, _ := service.GetHisPatientById(patient_id)
7850
 
8001
 
7851
 		api := miConfig.Url + "/hbyb/5301?psn_no=" + p.PsnNo +
8002
 		api := miConfig.Url + "/hbyb/5301?psn_no=" + p.PsnNo +
8531
 					infoStr := string(Iinfos)
8682
 					infoStr := string(Iinfos)
8532
 					idetinfoStr := string(Idetinfos)
8683
 					idetinfoStr := string(Idetinfos)
8533
 
8684
 
8534
-
8535
-
8536
-
8537
-
8538
 					var rf []*ResultFive
8685
 					var rf []*ResultFive
8539
 					json.Unmarshal([]byte(infoStr), &rf)
8686
 					json.Unmarshal([]byte(infoStr), &rf)
8540
 
8687
 
8583
 						}
8730
 						}
8584
 					}
8731
 					}
8585
 
8732
 
8586
-
8587
-
8588
-
8589
-
8590
-
8591
 					psn := &models.HisPsn{
8733
 					psn := &models.HisPsn{
8592
 						PsnNo: res.Output.Baseinfo.PsnNo,
8734
 						PsnNo: res.Output.Baseinfo.PsnNo,
8593
 
8735
 
8594
-						PatientId: patient.ID,
8595
-						Certno:    res.Output.Baseinfo.Certno,
8596
-						Gend:        res.Output.Baseinfo.Gend,
8597
-						Naty:        res.Output.Baseinfo.Naty,
8598
-						PsnCertType: res.Output.Baseinfo.PsnCertType,
8599
-						PsnName:     res.Output.Baseinfo.PsnName,
8600
-						Idetinfo:    idetinfoStr,
8601
-						Insuinfo:    infoStr,
8602
-						UserOrgId:   c.GetAdminUserInfo().CurrentOrgId,
8736
+						PatientId:     patient.ID,
8737
+						Certno:        res.Output.Baseinfo.Certno,
8738
+						Gend:          res.Output.Baseinfo.Gend,
8739
+						Naty:          res.Output.Baseinfo.Naty,
8740
+						PsnCertType:   res.Output.Baseinfo.PsnCertType,
8741
+						PsnName:       res.Output.Baseinfo.PsnName,
8742
+						Idetinfo:      idetinfoStr,
8743
+						Insuinfo:      infoStr,
8744
+						UserOrgId:     c.GetAdminUserInfo().CurrentOrgId,
8603
 						InsuplcAdmdvs: insuplc_admdvs,
8745
 						InsuplcAdmdvs: insuplc_admdvs,
8604
-
8605
 					}
8746
 					}
8606
 					service.CreateHisPsn(psn)
8747
 					service.CreateHisPsn(psn)
8607
 
8748
 
8608
-
8609
 					for _, item := range rf {
8749
 					for _, item := range rf {
8610
 						if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
8750
 						if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
8611
 							insutypes = append(insutypes, item)
8751
 							insutypes = append(insutypes, item)
10351
 						PatientId: patient.ID,
10491
 						PatientId: patient.ID,
10352
 						Certno:    res.Output.Baseinfo.Certno,
10492
 						Certno:    res.Output.Baseinfo.Certno,
10353
 
10493
 
10354
-						Gend:        res.Output.Baseinfo.Gend,
10355
-						Naty:        res.Output.Baseinfo.Naty,
10356
-						PsnCertType: res.Output.Baseinfo.PsnCertType,
10357
-						PsnName:     res.Output.Baseinfo.PsnName,
10358
-						Idetinfo:    idetinfoStr,
10359
-						Insuinfo:    infoStr,
10360
-						UserOrgId:   c.GetAdminUserInfo().CurrentOrgId,
10494
+						Gend:          res.Output.Baseinfo.Gend,
10495
+						Naty:          res.Output.Baseinfo.Naty,
10496
+						PsnCertType:   res.Output.Baseinfo.PsnCertType,
10497
+						PsnName:       res.Output.Baseinfo.PsnName,
10498
+						Idetinfo:      idetinfoStr,
10499
+						Insuinfo:      infoStr,
10500
+						UserOrgId:     c.GetAdminUserInfo().CurrentOrgId,
10361
 						InsuplcAdmdvs: insuplc_admdvs,
10501
 						InsuplcAdmdvs: insuplc_admdvs,
10362
 					}
10502
 					}
10363
 					service.CreateHisPsn(psn)
10503
 					service.CreateHisPsn(psn)
11913
 						}
12053
 						}
11914
 					}
12054
 					}
11915
 					psn := &models.HisPsn{
12055
 					psn := &models.HisPsn{
11916
-						PsnNo: res.Output.Baseinfo.PsnNo,
11917
-						PatientId: patient.ID,
11918
-						Certno:    res.Output.Baseinfo.Certno,
11919
-						Gend:        res.Output.Baseinfo.Gend,
11920
-						Naty:        res.Output.Baseinfo.Naty,
11921
-						PsnCertType: res.Output.Baseinfo.PsnCertType,
11922
-						PsnName:     res.Output.Baseinfo.PsnName,
11923
-						Idetinfo:    idetinfoStr,
11924
-						Insuinfo:    infoStr,
11925
-						UserOrgId:   c.GetAdminUserInfo().CurrentOrgId,
12056
+						PsnNo:         res.Output.Baseinfo.PsnNo,
12057
+						PatientId:     patient.ID,
12058
+						Certno:        res.Output.Baseinfo.Certno,
12059
+						Gend:          res.Output.Baseinfo.Gend,
12060
+						Naty:          res.Output.Baseinfo.Naty,
12061
+						PsnCertType:   res.Output.Baseinfo.PsnCertType,
12062
+						PsnName:       res.Output.Baseinfo.PsnName,
12063
+						Idetinfo:      idetinfoStr,
12064
+						Insuinfo:      infoStr,
12065
+						UserOrgId:     c.GetAdminUserInfo().CurrentOrgId,
11926
 						InsuplcAdmdvs: insuplc_admdvs,
12066
 						InsuplcAdmdvs: insuplc_admdvs,
11927
 					}
12067
 					}
11928
 					service.CreateHisPsn(psn)
12068
 					service.CreateHisPsn(psn)
17085
 	Signtype    interface{} `json:"signtype"`
17225
 	Signtype    interface{} `json:"signtype"`
17086
 	WarnMsg     interface{} `json:"warn_msg"`
17226
 	WarnMsg     interface{} `json:"warn_msg"`
17087
 }
17227
 }
17228
+
17229
+type FJ3507Result struct {
17230
+	Cainfo      interface{} `json:"cainfo"`
17231
+	ErrMsg      string      `json:"err_msg"`
17232
+	InfRefmsgid string      `json:"inf_refmsgid"`
17233
+	Infcode     int64       `json:"infcode"`
17234
+	Output      struct {
17235
+		retRslt string `json:"retRslt"`
17236
+		msgRslt string `json:"msgRslt"`
17237
+	} `json:"output"`
17238
+	RefmsgTime  string      `json:"refmsg_time"`
17239
+	RespondTime string      `json:"respond_time"`
17240
+	Signtype    interface{} `json:"signtype"`
17241
+	WarnMsg     interface{} `json:"warn_msg"`
17242
+}
17243
+
17088
 type Result2406 struct {
17244
 type Result2406 struct {
17089
 	Cainfo      interface{} `json:"cainfo"`
17245
 	Cainfo      interface{} `json:"cainfo"`
17090
 	ErrMsg      string      `json:"err_msg"`
17246
 	ErrMsg      string      `json:"err_msg"`
19358
 				}
19514
 				}
19359
 				infocode = resThree.Infcode
19515
 				infocode = resThree.Infcode
19360
 
19516
 
19361
-			}  else if miConfig.MdtrtareaAdmvs == "420902" {
19517
+			} else if miConfig.MdtrtareaAdmvs == "420902" {
19362
 				hb_doctor_info, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, patientPrescription.DoctorId)
19518
 				hb_doctor_info, _ := service.GetAdminUserInfoByID(adminInfo.CurrentOrgId, patientPrescription.DoctorId)
19363
 				//if strings.Contains(insuplc_admdvs_temp, "4202") {
19519
 				//if strings.Contains(insuplc_admdvs_temp, "4202") {
19364
 				//	insuplc_admdvs_temp =
19520
 				//	insuplc_admdvs_temp =
19375
 				utils.ErrorLog("解析失败:%v", hb_doctor_info.DoctorNumber)
19531
 				utils.ErrorLog("解析失败:%v", hb_doctor_info.DoctorNumber)
19376
 				utils.ErrorLog("解析失败:%v", PsnNo)
19532
 				utils.ErrorLog("解析失败:%v", PsnNo)
19377
 
19533
 
19378
-				utils.ErrorLog("解析失败:%v", department.Number )
19379
-				utils.ErrorLog("解析失败:%v", department.Name )
19380
-				utils.ErrorLog("解析失败:%v",  roles.UserName)
19381
-
19534
+				utils.ErrorLog("解析失败:%v", department.Number)
19535
+				utils.ErrorLog("解析失败:%v", department.Name)
19536
+				utils.ErrorLog("解析失败:%v", roles.UserName)
19382
 
19537
 
19383
 				api := miConfig.Url + "hbyb/2201?psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + Certno + "&ipt_otp_no=" + ipt_otp_no +
19538
 				api := miConfig.Url + "hbyb/2201?psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + Certno + "&ipt_otp_no=" + ipt_otp_no +
19384
 					"&org_name=" + miConfig.OrgName + "&doctor=" + hb_doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
19539
 					"&org_name=" + miConfig.OrgName + "&doctor=" + hb_doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
20445
 				return
20600
 				return
20446
 			}
20601
 			}
20447
 
20602
 
20448
-		}else if miConfig.MdtrtareaAdmvs == "421182" {
20603
+		} else if miConfig.MdtrtareaAdmvs == "421182" {
20449
 
20604
 
20450
 			data := make(map[string]interface{})
20605
 			data := make(map[string]interface{})
20451
 			client := &http.Client{}
20606
 			client := &http.Client{}
20944
 						return
21099
 						return
20945
 					}
21100
 					}
20946
 
21101
 
20947
-				}  else if miConfig.MdtrtareaAdmvs == "420902" {
21102
+				} else if miConfig.MdtrtareaAdmvs == "420902" {
20948
 
21103
 
20949
 					bytesData, _ := json.Marshal(data)
21104
 					bytesData, _ := json.Marshal(data)
20950
 					req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
21105
 					req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
20973
 						return
21128
 						return
20974
 					}
21129
 					}
20975
 
21130
 
20976
-				}else if miConfig.MdtrtareaAdmvs == "421182" {
21131
+				} else if miConfig.MdtrtareaAdmvs == "421182" {
20977
 
21132
 
20978
 					bytesData, _ := json.Marshal(data)
21133
 					bytesData, _ := json.Marshal(data)
20979
 					req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
21134
 					req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
21585
 								reg_type = 110104
21740
 								reg_type = 110104
21586
 							}
21741
 							}
21587
 
21742
 
21588
-							api := miConfig.Url+ "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
21743
+							api := miConfig.Url + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
21589
 								his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
21744
 								his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
21590
 								"&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
21745
 								"&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
21591
 								"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
21746
 								"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
21640
 
21795
 
21641
 							}
21796
 							}
21642
 
21797
 
21643
-						}  else if miConfig.MdtrtareaAdmvs == "421182" {
21798
+						} else if miConfig.MdtrtareaAdmvs == "421182" {
21644
 							if reg_type == 11 && his.Insutype == "390" {
21799
 							if reg_type == 11 && his.Insutype == "390" {
21645
 								reg_type = 110104
21800
 								reg_type = 110104
21646
 							}
21801
 							}
22605
 					return
22760
 					return
22606
 				}
22761
 				}
22607
 
22762
 
22608
-			}else if miConfig.MdtrtareaAdmvs == "420902" {
22763
+			} else if miConfig.MdtrtareaAdmvs == "420902" {
22609
 				if reg_type == 11 && his.Insutype == "390" {
22764
 				if reg_type == 11 && his.Insutype == "390" {
22610
 					reg_type = 110104
22765
 					reg_type = 110104
22611
 				}
22766
 				}
24378
 					return
24533
 					return
24379
 				}
24534
 				}
24380
 
24535
 
24381
-			}else if miConfig.MdtrtareaAdmvs == "420902" {
24536
+			} else if miConfig.MdtrtareaAdmvs == "420902" {
24382
 				bytesData, _ := json.Marshal(data)
24537
 				bytesData, _ := json.Marshal(data)
24383
 				req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
24538
 				req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
24384
 				resp, _ := client.Do(req)
24539
 				resp, _ := client.Do(req)
24406
 					return
24561
 					return
24407
 				}
24562
 				}
24408
 
24563
 
24409
-			}  else if miConfig.MdtrtareaAdmvs == "421182" {
24564
+			} else if miConfig.MdtrtareaAdmvs == "421182" {
24410
 				bytesData, _ := json.Marshal(data)
24565
 				bytesData, _ := json.Marshal(data)
24411
 				req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
24566
 				req, _ := http.NewRequest("POST", miConfig.Url+"hbyb/2204", bytes.NewReader(bytesData))
24412
 				resp, _ := client.Do(req)
24567
 				resp, _ := client.Do(req)
26299
 				return
26454
 				return
26300
 			}
26455
 			}
26301
 
26456
 
26302
-		}  else if miConfig.MdtrtareaAdmvs == "421182" {
26457
+		} else if miConfig.MdtrtareaAdmvs == "421182" {
26303
 			api3 := miConfig.Url + "hbyb/2208?psn_no=" + order.PsnNo +
26458
 			api3 := miConfig.Url + "hbyb/2208?psn_no=" + order.PsnNo +
26304
 				"&mdtrt_id=" + order.MdtrtId + "&setl_id=" + order.SetlId + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
26459
 				"&mdtrt_id=" + order.MdtrtId + "&setl_id=" + order.SetlId + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
26305
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
26460
 				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
28409
 				AcctPay:          acct_pay,
28564
 				AcctPay:          acct_pay,
28410
 				FixmedinsSetlCnt: fixmedins_setl_cnt,
28565
 				FixmedinsSetlCnt: fixmedins_setl_cnt,
28411
 			}
28566
 			}
28412
-			result, requestLog, err_msg := service.FJyb3201(baseParams, businessParams, fmt.Sprintf("%.4f", medfee_sumamt), fmt.Sprintf("%.4f", fund_pay_sumamt),fmt.Sprintf("%.4f", acct_pay))
28567
+			result, requestLog, err_msg := service.FJyb3201(baseParams, businessParams, fmt.Sprintf("%.4f", medfee_sumamt), fmt.Sprintf("%.4f", fund_pay_sumamt), fmt.Sprintf("%.4f", acct_pay))
28413
 			fmt.Println(requestLog)
28568
 			fmt.Println(requestLog)
28414
 			fmt.Println(result)
28569
 			fmt.Println(result)
28415
 			fmt.Println(err_msg)
28570
 			fmt.Println(err_msg)
28495
 				AcctPay:          acct_pay,
28650
 				AcctPay:          acct_pay,
28496
 				FixmedinsSetlCnt: fixmedins_setl_cnt,
28651
 				FixmedinsSetlCnt: fixmedins_setl_cnt,
28497
 			}
28652
 			}
28498
-			result, requestLog, err_msg := service.FJyb3201(baseParams, businessParams, fmt.Sprintf("%.4f", medfee_sumamt), fmt.Sprintf("%.4f", fund_pay_sumamt),fmt.Sprintf("%.4f", acct_pay))
28653
+			result, requestLog, err_msg := service.FJyb3201(baseParams, businessParams, fmt.Sprintf("%.4f", medfee_sumamt), fmt.Sprintf("%.4f", fund_pay_sumamt), fmt.Sprintf("%.4f", acct_pay))
28499
 			fmt.Println(requestLog)
28654
 			fmt.Println(requestLog)
28500
 			fmt.Println(result)
28655
 			fmt.Println(result)
28501
 			fmt.Println(err_msg)
28656
 			fmt.Println(err_msg)
29844
 				return
29999
 				return
29845
 			}
30000
 			}
29846
 
30001
 
29847
-		}else if miConfig.MdtrtareaAdmvs == "421182" {
30002
+		} else if miConfig.MdtrtareaAdmvs == "421182" {
29848
 
30003
 
29849
 			api := miConfig.Url + "hbyb/5203?psn_no=" + businessParams.PsnNo + "&mdtrt_id=" + businessParams.MdtrtId + "&setl_id=" + businessParams.SetlId +
30004
 			api := miConfig.Url + "hbyb/5203?psn_no=" + businessParams.PsnNo + "&mdtrt_id=" + businessParams.MdtrtId + "&setl_id=" + businessParams.SetlId +
29850
 				"&org_name=" + miConfig.OrgName + "&doctor=" + baseParams.Doctor + "&fixmedins_code=" + miConfig.Code +
30005
 				"&org_name=" + miConfig.OrgName + "&doctor=" + baseParams.Doctor + "&fixmedins_code=" + miConfig.Code +

+ 4 - 5
models/new_stock_models.go View File

261
 	SecondWarehouseInfoId     int64  `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
261
 	SecondWarehouseInfoId     int64  `gorm:"column:second_warehouse_info_id" json:"second_warehouse_info_id" form:"second_warehouse_info_id"`
262
 	IsCheck                   int64  `gorm:"column:is_check" json:"is_check" form:"is_check"`
262
 	IsCheck                   int64  `gorm:"column:is_check" json:"is_check" form:"is_check"`
263
 
263
 
264
-	IsPc int64 `gorm:"column:is_pc" json:"is_pc" form:"is_pc"`
265
-	IsBg int64 `gorm:"column:is_bg" json:"is_bg" form:"is_bg"`
266
-	Bchno string `gorm:"column:bchno" json:"bchno" form:"bchno"`
267
-
268
-
264
+	IsPc   int64  `gorm:"column:is_pc" json:"is_pc" form:"is_pc"`
265
+	IsBg   int64  `gorm:"column:is_bg" json:"is_bg" form:"is_bg"`
266
+	Bchno  string `gorm:"column:bchno" json:"bchno" form:"bchno"`
267
+	PcDate string `gorm:"column:pc_date" json:"pc_date" form:"pc_date"`
269
 }
268
 }
270
 
269
 
271
 func (NewDrugWarehouseInfo) TableName() string {
270
 func (NewDrugWarehouseInfo) TableName() string {

+ 17 - 12
service/fj_service.go View File

1006
 }
1006
 }
1007
 
1007
 
1008
 // 医药机构费用结算对总账 func Gdyb3201( org_name string, doctor string, secret_key string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string) string {
1008
 // 医药机构费用结算对总账 func Gdyb3201( org_name string, doctor string, secret_key string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string) string {
1009
-func FJyb3201(baseParams models.BaseParams, businessParams models.BusinessParams, med string, fund string,acct string) (string, string, string) {
1009
+func FJyb3201(baseParams models.BaseParams, businessParams models.BusinessParams, med string, fund string, acct string) (string, string, string) {
1010
 
1010
 
1011
 	fmt.Println(baseParams)
1011
 	fmt.Println(baseParams)
1012
 	fmt.Println(businessParams)
1012
 	fmt.Println(businessParams)
1040
 	inputData["stmt_enddate"] = businessParams.StmtEnddate            //对帐结束时间
1040
 	inputData["stmt_enddate"] = businessParams.StmtEnddate            //对帐结束时间
1041
 	inputData["medfee_sumamt"] = med                                  //医疗费总额
1041
 	inputData["medfee_sumamt"] = med                                  //医疗费总额
1042
 	inputData["fund_pay_sumamt"] = fund                               //基金支付总额
1042
 	inputData["fund_pay_sumamt"] = fund                               //基金支付总额
1043
-	inputData["acct_pay"] = acct                    //个人账户支付金额
1043
+	inputData["acct_pay"] = acct                                      //个人账户支付金额
1044
 	inputData["fixmedins_setl_cnt"] = businessParams.FixmedinsSetlCnt //定点医药机构结算笔数
1044
 	inputData["fixmedins_setl_cnt"] = businessParams.FixmedinsSetlCnt //定点医药机构结算笔数
1045
 	inputData["refd_setl_flag"] = "0"                                 // 就诊 ID(来自2201接口返回)
1045
 	inputData["refd_setl_flag"] = "0"                                 // 就诊 ID(来自2201接口返回)
1046
 
1046
 
3069
 	input := make(map[string]interface{})
3069
 	input := make(map[string]interface{})
3070
 	inputData := make(map[string]interface{})
3070
 	inputData := make(map[string]interface{})
3071
 	druginputData := make(map[string]interface{})
3071
 	druginputData := make(map[string]interface{})
3072
-	inputMessage["infno"] = "3502"                      // 交易编码
3073
-	inputData["med_list_codg"] = struct3502.MedListCodg // 定点医药机构目录编号
3074
-	inputData["inv_chg_type"] = struct3502.InvChgType   // 定点医药机构目录编号
3072
+	inputMessage["infno"] = "3502"                              // 交易编码
3073
+	inputData["med_list_codg"] = struct3502.MedListCodg         // 定点医药机构目录编号
3074
+	inputData["inv_chg_type"] = struct3502.InvChgType           // 定点医药机构目录编号
3075
 	inputData["fixmedins_hilist_id"] = struct3502.FixmedinsCode // 定点医药机构目录编号
3075
 	inputData["fixmedins_hilist_id"] = struct3502.FixmedinsCode // 定点医药机构目录编号
3076
 	inputData["fixmedins_hilist_name"] = struct3502.OrgName     // 定点医药机构目录名称
3076
 	inputData["fixmedins_hilist_name"] = struct3502.OrgName     // 定点医药机构目录名称
3077
 	inputData["fixmedins_bchno"] = struct3502.FixmedinsBchno    // 人员编号 (来自1101接口返回)
3077
 	inputData["fixmedins_bchno"] = struct3502.FixmedinsBchno    // 人员编号 (来自1101接口返回)
3078
 	inputData["pric"] = struct3502.Pric                         // 人员编号 (来自1101接口返回)
3078
 	inputData["pric"] = struct3502.Pric                         // 人员编号 (来自1101接口返回)
3079
 	inputData["cnt"] = struct3502.Cnt                           // 人员编号 (来自1101接口返回)
3079
 	inputData["cnt"] = struct3502.Cnt                           // 人员编号 (来自1101接口返回)
3080
 	inputData["rx_flag"] = struct3502.RxFlag                    //
3080
 	inputData["rx_flag"] = struct3502.RxFlag                    //
3081
-	inputData["inv_chg_time"] = struct3502.InvChgTime // 人员编号 (来自1101接口返回)
3082
-	inputData["inv_chg_opter_name"] = ""              // 人员编号 (来自1101接口返回)
3083
-	inputData["memo"] = struct3502.Memo               // 人员编号 (来自1101接口返回)
3084
-	inputData["trdn_flag"] = ""                       // 人员编号 (来自1101接口返回)
3081
+	inputData["inv_chg_time"] = struct3502.InvChgTime           // 人员编号 (来自1101接口返回)
3082
+	inputData["inv_chg_opter_name"] = ""                        // 人员编号 (来自1101接口返回)
3083
+	inputData["memo"] = struct3502.Memo                         // 人员编号 (来自1101接口返回)
3084
+	inputData["trdn_flag"] = ""                                 // 人员编号 (来自1101接口返回)
3085
 	druginputData["drug_trac_codg"] = "12345678912345678901"
3085
 	druginputData["drug_trac_codg"] = "12345678912345678901"
3086
 	inputData["drug_trac_info"] = druginputData
3086
 	inputData["drug_trac_info"] = druginputData
3087
 	input["invinfo"] = inputData
3087
 	input["invinfo"] = inputData
3246
 	inputMessage := SetFjInputMessage(nonce, timestamp, struct3507.OrgName, struct3507.Opter, struct3507.FixmedinsCode, struct3507.InsuplcAdmdvs, struct3507.MdtrtareaAdmvs, struct3507.Url, struct3507.AppId, struct3507.AppSecret, struct3507.SignKey, struct3507.Enckey)
3246
 	inputMessage := SetFjInputMessage(nonce, timestamp, struct3507.OrgName, struct3507.Opter, struct3507.FixmedinsCode, struct3507.InsuplcAdmdvs, struct3507.MdtrtareaAdmvs, struct3507.Url, struct3507.AppId, struct3507.AppSecret, struct3507.SignKey, struct3507.Enckey)
3247
 	input := make(map[string]interface{})
3247
 	input := make(map[string]interface{})
3248
 	inputData := make(map[string]interface{})
3248
 	inputData := make(map[string]interface{})
3249
-	inputMessage["infno"] = "3507"                          // 交易编码
3250
-	inputData["fixmedins_bchno"] = struct3507.FixmedinsCode // 人员编号 (来自1101接口返回)
3251
-	inputData["inv_data_type"] = struct3507.InvDataType     // 人员编号 (来自1101接口返回)
3249
+	inputMessage["infno"] = "3507"                           // 交易编码
3250
+	inputData["fixmedins_bchno"] = struct3507.FixmedinsBchno // 人员编号 (来自1101接口返回)
3251
+	inputData["inv_data_type"] = struct3507.InvDataType      // 人员编号 (来自1101接口返回)
3252
 
3252
 
3253
 	input["data"] = inputData
3253
 	input["data"] = inputData
3254
 	inputMessage["input"] = input //交易输入
3254
 	inputMessage["input"] = input //交易输入
3268
 	return output, requestLog, err_msg
3268
 	return output, requestLog, err_msg
3269
 
3269
 
3270
 }
3270
 }
3271
+
3272
+func SaveW(w *models.NewDrugWarehouseInfo) (err error) {
3273
+	err = writeDb.Save(&w).Error
3274
+	return
3275
+}