Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 years ago
parent
commit
80a47137ca
1 changed files with 123 additions and 22 deletions
  1. 123 22
      controllers/sg/his_api_controller.go

+ 123 - 22
controllers/sg/his_api_controller.go View File

207
 				order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
207
 				order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
208
 				order.HosplistName = subItem.BaseDrugLib.DrugName
208
 				order.HosplistName = subItem.BaseDrugLib.DrugName
209
 				order.HilistLv = "1"
209
 				order.HilistLv = "1"
210
-				order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
210
+				order.HilistPric = fmt.Sprintf("%.2f", subItem.Price)
211
 				order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
211
 				order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
212
 				order.HosplistName = subItem.BaseDrugLib.DrugName
212
 				order.HosplistName = subItem.BaseDrugLib.DrugName
213
-				order.Cnt = strconv.FormatFloat(subItem.PrescribingNumber, 'E', -1, 64)
214
-				order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
215
-				order.Sumamt = strconv.FormatFloat((subItem.Price * subItem.PrescribingNumber), 'E', -1, 64)
213
+				order.Cnt = fmt.Sprintf("%.2f", subItem.PrescribingNumber)
214
+				order.Pric = fmt.Sprintf("%.2f", subItem.Price)
215
+				order.Sumamt = fmt.Sprintf("%.2f", (subItem.PrescribingNumber * subItem.Price))
216
 				order.OwnpayAmt = ""
216
 				order.OwnpayAmt = ""
217
 				order.SelfpayAmt = ""
217
 				order.SelfpayAmt = ""
218
 				order.Spec = ""
218
 				order.Spec = ""
239
 					order.HilistCode = subItem.HisProject.MedicalCode
239
 					order.HilistCode = subItem.HisProject.MedicalCode
240
 					order.HosplistName = subItem.HisProject.ProjectName
240
 					order.HosplistName = subItem.HisProject.ProjectName
241
 					order.HilistLv = "1"
241
 					order.HilistLv = "1"
242
-					order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
242
+					order.HilistPric = fmt.Sprintf("%.2f", subItem.Price)
243
 					order.HosplistCode = subItem.HisProject.MedicalCode
243
 					order.HosplistCode = subItem.HisProject.MedicalCode
244
 					order.HosplistName = subItem.HisProject.ProjectName
244
 					order.HosplistName = subItem.HisProject.ProjectName
245
 					order.Cnt = subItem.Count
245
 					order.Cnt = subItem.Count
246
 					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
246
 					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
247
-
248
-					order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
249
-					order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
247
+					order.Pric = fmt.Sprintf("%.2f", subItem.Price)
248
+					order.Sumamt = fmt.Sprintf("%.2f", subItem.Price*cnt)
250
 					order.OwnpayAmt = ""
249
 					order.OwnpayAmt = ""
251
 					order.SelfpayAmt = ""
250
 					order.SelfpayAmt = ""
252
 					order.Spec = ""
251
 					order.Spec = ""
274
 					order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
273
 					order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
275
 					order.HosplistName = subItem.GoodInfo.GoodName
274
 					order.HosplistName = subItem.GoodInfo.GoodName
276
 					order.HilistLv = "1"
275
 					order.HilistLv = "1"
277
-					order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
276
+					order.HilistPric = fmt.Sprintf("%.2f", subItem.Price)
278
 					order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
277
 					order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
279
 					order.HosplistName = subItem.GoodInfo.GoodName
278
 					order.HosplistName = subItem.GoodInfo.GoodName
280
 					order.Cnt = subItem.Count
279
 					order.Cnt = subItem.Count
281
 					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
280
 					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
282
-					order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
283
-					order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
281
+					order.Pric = fmt.Sprintf("%.2f", subItem.Price)
282
+					order.Sumamt = fmt.Sprintf("%.2f", subItem.Price*cnt)
284
 					order.OwnpayAmt = ""
283
 					order.OwnpayAmt = ""
285
 					order.SelfpayAmt = ""
284
 					order.SelfpayAmt = ""
286
 					order.Spec = ""
285
 					order.Spec = ""
464
 	fed.MedType = order.MedType
463
 	fed.MedType = order.MedType
465
 	//处方医嘱信息
464
 	//处方医嘱信息
466
 	var orders []*models.FsiOrderDtos
465
 	var orders []*models.FsiOrderDtos
466
+	//for _, item := range prescriptions {
467
+	//	for _, subItem := range item.HisDoctorAdviceInfo {
468
+	//		var order models.FsiOrderDtos
469
+	//		order.RxID = strconv.FormatInt(item.ID, 10)
470
+	//		order.Rxno = strconv.FormatInt(item.ID, 10)
471
+	//		order.LongDrordFlag = "0"
472
+	//		order.HilistType = "1"
473
+	//		order.ChrgType = "1"
474
+	//		order.DrordBhvr = "-"
475
+	//		order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
476
+	//		order.HosplistName = subItem.BaseDrugLib.DrugName
477
+	//		order.HilistLv = "1"
478
+	//		order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
479
+	//		order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
480
+	//		order.HosplistName = subItem.BaseDrugLib.DrugName
481
+	//		order.Cnt = strconv.FormatFloat(subItem.PrescribingNumber, 'E', -1, 64)
482
+	//		order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
483
+	//		order.Sumamt = strconv.FormatFloat((subItem.Price * subItem.PrescribingNumber), 'E', -1, 64)
484
+	//		order.OwnpayAmt = ""
485
+	//		order.SelfpayAmt = ""
486
+	//		order.Spec = ""
487
+	//		order.SpecUnt = ""
488
+	//		order.DrordBegnDate = s_tm
489
+	//		order.DrordStopDate = ""
490
+	//		order.DrordDrCodg = "1"
491
+	//		order.DrordDeptName = department.Name
492
+	//		order.DrordDrCodg = "1"
493
+	//		order.DrordDrName = doctor_info.UserName
494
+	//		order.DrordDrProfttl = ""
495
+	//		order.CurrDrordFlag = "1"
496
+	//		orders = append(orders, &order)
497
+	//	}
498
+	//	for _, subItem := range item.HisPrescriptionProject {
499
+	//		if subItem.Type == 2 {
500
+	//			var order models.FsiOrderDtos
501
+	//			order.RxID = strconv.FormatInt(item.ID, 10)
502
+	//			order.Rxno = strconv.FormatInt(item.ID, 10)
503
+	//			order.LongDrordFlag = "0"
504
+	//			order.HilistType = "1"
505
+	//			order.ChrgType = "1"
506
+	//			order.DrordBhvr = "-"
507
+	//			order.HilistCode = subItem.HisProject.MedicalCode
508
+	//			order.HosplistName = subItem.HisProject.ProjectName
509
+	//			order.HilistLv = "1"
510
+	//			order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
511
+	//			order.HosplistCode = subItem.HisProject.MedicalCode
512
+	//			order.HosplistName = subItem.HisProject.ProjectName
513
+	//			order.Cnt = subItem.Count
514
+	//			cnt, _ := strconv.ParseFloat(subItem.Count, 64)
515
+	//
516
+	//			order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
517
+	//			order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
518
+	//			order.OwnpayAmt = ""
519
+	//			order.SelfpayAmt = ""
520
+	//			order.Spec = ""
521
+	//			order.SpecUnt = ""
522
+	//			order.DrordBegnDate = s_tm
523
+	//			order.DrordStopDate = ""
524
+	//			order.DrordDrCodg = "1"
525
+	//			order.DrordDeptName = department.Name
526
+	//			order.DrordDrCodg = "1"
527
+	//			order.DrordDrName = doctor_info.UserName
528
+	//			order.DrordDrProfttl = ""
529
+	//			order.CurrDrordFlag = "1"
530
+	//			orders = append(orders, &order)
531
+	//
532
+	//		}
533
+	//		if subItem.Type == 3 {
534
+	//
535
+	//			var order models.FsiOrderDtos
536
+	//			order.RxID = strconv.FormatInt(item.ID, 10)
537
+	//			order.Rxno = strconv.FormatInt(item.ID, 10)
538
+	//			order.LongDrordFlag = "0"
539
+	//			order.HilistType = "1"
540
+	//			order.ChrgType = "1"
541
+	//			order.DrordBhvr = "-"
542
+	//			order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
543
+	//			order.HosplistName = subItem.GoodInfo.GoodName
544
+	//			order.HilistLv = "1"
545
+	//			order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
546
+	//			order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
547
+	//			order.HosplistName = subItem.GoodInfo.GoodName
548
+	//			order.Cnt = subItem.Count
549
+	//			cnt, _ := strconv.ParseFloat(subItem.Count, 64)
550
+	//			order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
551
+	//			order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
552
+	//			order.OwnpayAmt = ""
553
+	//			order.SelfpayAmt = ""
554
+	//			order.Spec = ""
555
+	//			order.SpecUnt = ""
556
+	//			order.DrordBegnDate = s_tm
557
+	//			order.DrordStopDate = ""
558
+	//			order.DrordDrCodg = "1"
559
+	//			order.DrordDeptName = department.Name
560
+	//			order.DrordDrCodg = "1"
561
+	//			order.DrordDrName = doctor_info.UserName
562
+	//			order.DrordDrProfttl = ""
563
+	//			order.CurrDrordFlag = "1"
564
+	//			orders = append(orders, &order)
565
+	//
566
+	//		}
567
+	//	}
568
+	//}
467
 	for _, item := range prescriptions {
569
 	for _, item := range prescriptions {
468
 		for _, subItem := range item.HisDoctorAdviceInfo {
570
 		for _, subItem := range item.HisDoctorAdviceInfo {
469
 			var order models.FsiOrderDtos
571
 			var order models.FsiOrderDtos
476
 			order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
578
 			order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
477
 			order.HosplistName = subItem.BaseDrugLib.DrugName
579
 			order.HosplistName = subItem.BaseDrugLib.DrugName
478
 			order.HilistLv = "1"
580
 			order.HilistLv = "1"
479
-			order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
581
+			order.HilistPric = fmt.Sprintf("%.2f", subItem.Price)
480
 			order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
582
 			order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
481
 			order.HosplistName = subItem.BaseDrugLib.DrugName
583
 			order.HosplistName = subItem.BaseDrugLib.DrugName
482
-			order.Cnt = strconv.FormatFloat(subItem.PrescribingNumber, 'E', -1, 64)
483
-			order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
484
-			order.Sumamt = strconv.FormatFloat((subItem.Price * subItem.PrescribingNumber), 'E', -1, 64)
584
+			order.Cnt = fmt.Sprintf("%.2f", subItem.PrescribingNumber)
585
+			order.Pric = fmt.Sprintf("%.2f", subItem.Price)
586
+			order.Sumamt = fmt.Sprintf("%.2f", (subItem.PrescribingNumber * subItem.Price))
485
 			order.OwnpayAmt = ""
587
 			order.OwnpayAmt = ""
486
 			order.SelfpayAmt = ""
588
 			order.SelfpayAmt = ""
487
 			order.Spec = ""
589
 			order.Spec = ""
508
 				order.HilistCode = subItem.HisProject.MedicalCode
610
 				order.HilistCode = subItem.HisProject.MedicalCode
509
 				order.HosplistName = subItem.HisProject.ProjectName
611
 				order.HosplistName = subItem.HisProject.ProjectName
510
 				order.HilistLv = "1"
612
 				order.HilistLv = "1"
511
-				order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
613
+				order.HilistPric = fmt.Sprintf("%.2f", subItem.Price)
512
 				order.HosplistCode = subItem.HisProject.MedicalCode
614
 				order.HosplistCode = subItem.HisProject.MedicalCode
513
 				order.HosplistName = subItem.HisProject.ProjectName
615
 				order.HosplistName = subItem.HisProject.ProjectName
514
 				order.Cnt = subItem.Count
616
 				order.Cnt = subItem.Count
515
 				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
617
 				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
516
-
517
-				order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
518
-				order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
618
+				order.Pric = fmt.Sprintf("%.2f", subItem.Price)
619
+				order.Sumamt = fmt.Sprintf("%.2f", subItem.Price*cnt)
519
 				order.OwnpayAmt = ""
620
 				order.OwnpayAmt = ""
520
 				order.SelfpayAmt = ""
621
 				order.SelfpayAmt = ""
521
 				order.Spec = ""
622
 				order.Spec = ""
543
 				order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
644
 				order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
544
 				order.HosplistName = subItem.GoodInfo.GoodName
645
 				order.HosplistName = subItem.GoodInfo.GoodName
545
 				order.HilistLv = "1"
646
 				order.HilistLv = "1"
546
-				order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
647
+				order.HilistPric = fmt.Sprintf("%.2f", subItem.Price)
547
 				order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
648
 				order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
548
 				order.HosplistName = subItem.GoodInfo.GoodName
649
 				order.HosplistName = subItem.GoodInfo.GoodName
549
 				order.Cnt = subItem.Count
650
 				order.Cnt = subItem.Count
550
 				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
651
 				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
551
-				order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
552
-				order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
652
+				order.Pric = fmt.Sprintf("%.2f", subItem.Price)
653
+				order.Sumamt = fmt.Sprintf("%.2f", subItem.Price*cnt)
553
 				order.OwnpayAmt = ""
654
 				order.OwnpayAmt = ""
554
 				order.SelfpayAmt = ""
655
 				order.SelfpayAmt = ""
555
 				order.Spec = ""
656
 				order.Spec = ""