陈少旭 1 週間 前
コミット
d25252d8e2
共有2 個のファイルを変更した209 個の追加198 個の削除を含む
  1. 181 156
      controllers/sg/his_api_controller.go
  2. 28 42
      models/models_3501.go

+ 181 - 156
controllers/sg/his_api_controller.go ファイルの表示

@@ -34,7 +34,6 @@ import (
34 34
 	"syscall"
35 35
 	"time"
36 36
 	"unsafe"
37
-	"github.com/go-ole/go-ole"
38 37
 )
39 38
 
40 39
 type HisApiController struct {
@@ -585,9 +584,8 @@ func (c *HisApiController) Get3508() {
585 584
 	struct3508.Enddate = end_time
586 585
 	struct3508.Enddate = end_time
587 586
 
588
-
589 587
 	if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") { //广东
590
-		result1, result2 := service.Gdyb3508(struct3508,struct3508.SecretKey)
588
+		result1, result2 := service.Gdyb3508(struct3508, struct3508.SecretKey)
591 589
 		saveLog(result1, result2, "3508", "3508")
592 590
 
593 591
 		var res models.Result3508
@@ -614,7 +612,7 @@ func (c *HisApiController) Get3508() {
614 612
 			})
615 613
 		}
616 614
 
617
-	} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "350") { //广东
615
+	} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "350") {
618 616
 		result1, result2, _ := service.FJyb3508(struct3508)
619 617
 		saveLog(result1, result2, "3508", "3508")
620 618
 
@@ -644,7 +642,6 @@ func (c *HisApiController) Get3508() {
644 642
 
645 643
 	}
646 644
 
647
-
648 645
 }
649 646
 func (c *HisApiController) Get3509() {
650 647
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -674,9 +671,8 @@ func (c *HisApiController) Get3509() {
674 671
 	struct3508.Begndate = start_time
675 672
 	struct3508.Enddate = end_time
676 673
 
677
-
678 674
 	if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") { //广东
679
-		result1, result2 := service.Gdyb3509(struct3508,struct3508.SecretKey)
675
+		result1, result2 := service.Gdyb3509(struct3508, struct3508.SecretKey)
680 676
 		saveLog(result1, result2, "3509", "3509")
681 677
 
682 678
 		var res models.Result3508
@@ -703,36 +699,33 @@ func (c *HisApiController) Get3509() {
703 699
 			})
704 700
 		}
705 701
 
706
-	}
707
-
708
-
709
-
710
-
711
-	result1, result2, _ := service.FJyb3509(struct3508)
712
-	saveLog(result1, result2, "3509", "3509")
713
-
714
-	var res models.Result3509
715
-	var respJSON2 map[string]interface{}
716
-	if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
717
-		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
718
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
719
-		return
720
-	}
721
-	userJSONBytes2, _ := json.Marshal(respJSON2)
722
-	if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
723
-		utils.ErrorLog("解析失败:%v", err)
724
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
725
-		return
726
-	}
727
-	if res.Infcode == -1 {
728
-		c.ServeSuccessJSON(map[string]interface{}{
729
-			"failed_code": -10,
730
-			"msg":         res.ErrMsg,
731
-		})
732 702
 	} else {
733
-		c.ServeSuccessJSON(map[string]interface{}{
734
-			"info": res.Output,
735
-		})
703
+		result1, result2, _ := service.FJyb3509(struct3508)
704
+		saveLog(result1, result2, "3509", "3509")
705
+
706
+		var res models.Result3509
707
+		var respJSON2 map[string]interface{}
708
+		if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
709
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
710
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
711
+			return
712
+		}
713
+		userJSONBytes2, _ := json.Marshal(respJSON2)
714
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
715
+			utils.ErrorLog("解析失败:%v", err)
716
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
717
+			return
718
+		}
719
+		if res.Infcode == -1 {
720
+			c.ServeSuccessJSON(map[string]interface{}{
721
+				"failed_code": -10,
722
+				"msg":         res.ErrMsg,
723
+			})
724
+		} else {
725
+			c.ServeSuccessJSON(map[string]interface{}{
726
+				"info": res.Output,
727
+			})
728
+		}
736 729
 	}
737 730
 }
738 731
 func (c *HisApiController) Get3510() {
@@ -762,32 +755,65 @@ func (c *HisApiController) Get3510() {
762 755
 	struct3508.MedListCodg = drug.MedicalInsuranceNumber
763 756
 	struct3508.Begndate = start_time
764 757
 	struct3508.Enddate = end_time
765
-	result1, result2, _ := service.FJyb3510(struct3508)
766
-	saveLog(result1, result2, "3510", "3510")
767 758
 
768
-	var res models.Result3510
769
-	var respJSON2 map[string]interface{}
770
-	if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
771
-		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
772
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
773
-		return
774
-	}
775
-	userJSONBytes2, _ := json.Marshal(respJSON2)
776
-	if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
777
-		utils.ErrorLog("解析失败:%v", err)
778
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
779
-		return
780
-	}
781
-	if res.Infcode == -1 {
782
-		c.ServeSuccessJSON(map[string]interface{}{
783
-			"failed_code": -10,
784
-			"msg":         res.ErrMsg,
785
-		})
759
+	if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") { //广东
760
+		result1, result2 := service.Gdyb3510(struct3508, struct3508.SecretKey)
761
+		saveLog(result1, result2, "3510", "3510")
762
+
763
+		var res models.Result3510
764
+		var respJSON2 map[string]interface{}
765
+		if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
766
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
767
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
768
+			return
769
+		}
770
+		userJSONBytes2, _ := json.Marshal(respJSON2)
771
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
772
+			utils.ErrorLog("解析失败:%v", err)
773
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
774
+			return
775
+		}
776
+		if res.Infcode == -1 {
777
+			c.ServeSuccessJSON(map[string]interface{}{
778
+				"failed_code": -10,
779
+				"msg":         res.ErrMsg,
780
+			})
781
+		} else {
782
+			c.ServeSuccessJSON(map[string]interface{}{
783
+				"info": res.Output,
784
+			})
785
+		}
786
+
786 787
 	} else {
787
-		c.ServeSuccessJSON(map[string]interface{}{
788
-			"info": res.Output,
789
-		})
788
+
789
+		result1, result2, _ := service.FJyb3510(struct3508)
790
+		saveLog(result1, result2, "3510", "3510")
791
+
792
+		var res models.Result3510
793
+		var respJSON2 map[string]interface{}
794
+		if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
795
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
796
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
797
+			return
798
+		}
799
+		userJSONBytes2, _ := json.Marshal(respJSON2)
800
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
801
+			utils.ErrorLog("解析失败:%v", err)
802
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
803
+			return
804
+		}
805
+		if res.Infcode == -1 {
806
+			c.ServeSuccessJSON(map[string]interface{}{
807
+				"failed_code": -10,
808
+				"msg":         res.ErrMsg,
809
+			})
810
+		} else {
811
+			c.ServeSuccessJSON(map[string]interface{}{
812
+				"info": res.Output,
813
+			})
814
+		}
790 815
 	}
816
+
791 817
 }
792 818
 func (c *HisApiController) Get3511() {
793 819
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -816,32 +842,65 @@ func (c *HisApiController) Get3511() {
816 842
 	struct3508.MedListCodg = drug.MedicalInsuranceNumber
817 843
 	struct3508.Begndate = start_time
818 844
 	struct3508.Enddate = end_time
819
-	result1, result2, _ := service.FJyb3511(struct3508)
820
-	saveLog(result1, result2, "3511", "3511")
821 845
 
822
-	var res models.Result3511
823
-	var respJSON2 map[string]interface{}
824
-	if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
825
-		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
826
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
827
-		return
828
-	}
829
-	userJSONBytes2, _ := json.Marshal(respJSON2)
830
-	if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
831
-		utils.ErrorLog("解析失败:%v", err)
832
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
833
-		return
834
-	}
835
-	if res.Infcode == -1 {
836
-		c.ServeSuccessJSON(map[string]interface{}{
837
-			"failed_code": -10,
838
-			"msg":         res.ErrMsg,
839
-		})
846
+	if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") { //广东
847
+		result1, result2 := service.Gdyb3511(struct3508, struct3508.SecretKey)
848
+		saveLog(result1, result2, "3511", "3511")
849
+
850
+		var res models.Result3511
851
+		var respJSON2 map[string]interface{}
852
+		if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
853
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
854
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
855
+			return
856
+		}
857
+		userJSONBytes2, _ := json.Marshal(respJSON2)
858
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
859
+			utils.ErrorLog("解析失败:%v", err)
860
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
861
+			return
862
+		}
863
+		if res.Infcode == -1 {
864
+			c.ServeSuccessJSON(map[string]interface{}{
865
+				"failed_code": -10,
866
+				"msg":         res.ErrMsg,
867
+			})
868
+		} else {
869
+			c.ServeSuccessJSON(map[string]interface{}{
870
+				"info": res.Output,
871
+			})
872
+		}
873
+
840 874
 	} else {
841
-		c.ServeSuccessJSON(map[string]interface{}{
842
-			"info": res.Output,
843
-		})
875
+
876
+		result1, result2, _ := service.FJyb3511(struct3508)
877
+		saveLog(result1, result2, "3511", "3511")
878
+
879
+		var res models.Result3511
880
+		var respJSON2 map[string]interface{}
881
+		if err := json.Unmarshal([]byte(string(result1)), &respJSON2); err != nil {
882
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
883
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
884
+			return
885
+		}
886
+		userJSONBytes2, _ := json.Marshal(respJSON2)
887
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
888
+			utils.ErrorLog("解析失败:%v", err)
889
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
890
+			return
891
+		}
892
+		if res.Infcode == -1 {
893
+			c.ServeSuccessJSON(map[string]interface{}{
894
+				"failed_code": -10,
895
+				"msg":         res.ErrMsg,
896
+			})
897
+		} else {
898
+			c.ServeSuccessJSON(map[string]interface{}{
899
+				"info": res.Output,
900
+			})
901
+		}
844 902
 	}
903
+
845 904
 }
846 905
 func (c *HisApiController) Get3512() {
847 906
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -873,9 +932,8 @@ func (c *HisApiController) Get3512() {
873 932
 	struct3508.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
874 933
 	struct3508.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
875 934
 
876
-
877 935
 	if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") { //广东
878
-		result1, result2 := service.Gdyb3512(struct3508,struct3508.SecretKey)
936
+		result1, result2 := service.Gdyb3512(struct3508, struct3508.SecretKey)
879 937
 		saveLog(result1, result2, "3512", "3512")
880 938
 
881 939
 		var res models.Result3512
@@ -902,8 +960,7 @@ func (c *HisApiController) Get3512() {
902 960
 			})
903 961
 		}
904 962
 
905
-	}else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "350"){
906
-
963
+	} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "350") {
907 964
 
908 965
 		result1, result2, _ := service.FJyb3512(struct3508)
909 966
 		saveLog(result1, result2, "3512", "3512")
@@ -932,10 +989,8 @@ func (c *HisApiController) Get3512() {
932 989
 			})
933 990
 		}
934 991
 
935
-
936 992
 	}
937 993
 
938
-
939 994
 }
940 995
 func (c *HisApiController) Get3513() {
941 996
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -967,7 +1022,7 @@ func (c *HisApiController) Get3513() {
967 1022
 	struct3508.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
968 1023
 	struct3508.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
969 1024
 	if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") { //广东
970
-		result1, result2 := service.Gdyb3513(struct3508,struct3508.SecretKey)
1025
+		result1, result2 := service.Gdyb3513(struct3508, struct3508.SecretKey)
971 1026
 		saveLog(result1, result2, "3513", "3513")
972 1027
 
973 1028
 		var res models.Result3513
@@ -994,7 +1049,7 @@ func (c *HisApiController) Get3513() {
994 1049
 			})
995 1050
 		}
996 1051
 
997
-	}else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "350"){
1052
+	} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "350") {
998 1053
 
999 1054
 		result1, result2, _ := service.FJyb3513(struct3508)
1000 1055
 		saveLog(result1, result2, "3513", "3513")
@@ -1023,17 +1078,8 @@ func (c *HisApiController) Get3513() {
1023 1078
 			})
1024 1079
 		}
1025 1080
 
1026
-
1027 1081
 	}
1028 1082
 
1029
-
1030
-
1031
-
1032
-
1033
-
1034
-
1035
-
1036
-
1037 1083
 }
1038 1084
 func (c *HisApiController) Get35081() {
1039 1085
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -1159,9 +1205,9 @@ func (c *HisApiController) FJ3501AND3502() {
1159 1205
 	var errs []string
1160 1206
 	for _, drug := range drugs {
1161 1207
 		if drug.IsPc == 0 {
1162
-			if len(drug.DrugCode) > 0{
1208
+			if len(drug.DrugCode) > 0 {
1163 1209
 				codes := strings.Split(drug.DrugCode, ",")
1164
-				for _, code := range codes{
1210
+				for _, code := range codes {
1165 1211
 					if len(code) > 0 {
1166 1212
 						if len(code) != 20 {
1167 1213
 							errs = append(errs, drug.BaseDrugLib.DrugName+" 溯源码"+code+"位数不是20位")
@@ -1171,10 +1217,9 @@ func (c *HisApiController) FJ3501AND3502() {
1171 1217
 						}
1172 1218
 					}
1173 1219
 				}
1174
-				}
1175 1220
 			}
1176 1221
 		}
1177
-
1222
+	}
1178 1223
 
1179 1224
 	if len(errs) > 0 {
1180 1225
 		c.ServeSuccessJSON(map[string]interface{}{
@@ -1184,7 +1229,6 @@ func (c *HisApiController) FJ3501AND3502() {
1184 1229
 		return
1185 1230
 	}
1186 1231
 
1187
-
1188 1232
 	//库盘
1189 1233
 
1190 1234
 	for _, drug := range drugs {
@@ -1381,7 +1425,7 @@ func (c *HisApiController) FJ3501AND3502() {
1381 1425
 				drug.IsPc = 1
1382 1426
 				drug.Bchno = number
1383 1427
 				drug.PcDate = time.Now().Unix()
1384
-			   service.SaveW(drug)
1428
+				service.SaveW(drug)
1385 1429
 				//if err == nil {
1386 1430
 				//	bg_number := strconv.FormatInt(time.Now().Unix(), 10) + "-" + strconv.FormatInt(drug.ID, 10) + "-" + "3502"
1387 1431
 				//	var struct3502 models.Struct3502
@@ -1574,9 +1618,9 @@ func (c *HisApiController) FJ3501AND3502() {
1574 1618
 				//		service.SaveW(drug)
1575 1619
 				//	}
1576 1620
 				//}
1577
-			//} else {
1621
+				//} else {
1578 1622
 
1579
-			}else{
1623
+			} else {
1580 1624
 				errs = append(errs, "盘存"+drug.BaseDrugLib.DrugName+",出错:"+res2.ErrMsg)
1581 1625
 			}
1582 1626
 		}
@@ -1643,7 +1687,7 @@ func (c *HisApiController) DeletePCandBG() {
1643 1687
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1644 1688
 					return
1645 1689
 				}
1646
-			}else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") {
1690
+			} else if strings.HasPrefix(miConfig.MdtrtareaAdmvs[0:3], "440") {
1647 1691
 				result1, result2 := service.Gdyb3507(struct3507, struct3507.SecretKey)
1648 1692
 				saveLog(result2, result1, "3507", "3507")
1649 1693
 				var respJSON2 map[string]interface{}
@@ -1710,7 +1754,6 @@ func (c *HisApiController) DeletePCandBG() {
1710 1754
 
1711 1755
 		}
1712 1756
 
1713
-
1714 1757
 	}
1715 1758
 	if len(err) == 0 {
1716 1759
 		c.ServeSuccessJSON(map[string]interface{}{
@@ -3541,38 +3584,37 @@ func (c *HisApiController) ChangeDrugFive() {
3541 3584
 		//roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
3542 3585
 		//miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
3543 3586
 		for _, item := range flows {
3544
-				prescription := service.GetHisPrescriptionByID(item.HisDoctorAdviceInfo.PrescriptionId)
3545
-				if prescription.OrderStatus != 2 {
3546
-					// 将时间戳转换为time.Time类型
3547
-					t := time.Unix(item.HisDoctorAdviceInfo.RecordDate, 0) // 注意第二个参数是纳秒,这里是0
3548
-					patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, item.HisDoctorAdviceInfo.PatientId)
3587
+			prescription := service.GetHisPrescriptionByID(item.HisDoctorAdviceInfo.PrescriptionId)
3588
+			if prescription.OrderStatus != 2 {
3589
+				// 将时间戳转换为time.Time类型
3590
+				t := time.Unix(item.HisDoctorAdviceInfo.RecordDate, 0) // 注意第二个参数是纳秒,这里是0
3591
+				patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, item.HisDoctorAdviceInfo.PatientId)
3549 3592
 
3550
-					errs = append(errs, patient.Name + "的" + t.Format("2006-01-02") +" 的"+item.HisDoctorAdviceInfo.BaseDrugLib.DrugName+"医嘱没结算无法上传")
3593
+				errs = append(errs, patient.Name+"的"+t.Format("2006-01-02")+" 的"+item.HisDoctorAdviceInfo.BaseDrugLib.DrugName+"医嘱没结算无法上传")
3551 3594
 
3552
-				}
3553
-				if len(item.HisDoctorAdviceInfo.DrugCode) > 0{
3554
-					t := time.Unix(item.HisDoctorAdviceInfo.RecordDate, 0) // 注意第二个参数是纳秒,这里是0
3555
-					patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, item.HisDoctorAdviceInfo.PatientId)
3595
+			}
3596
+			if len(item.HisDoctorAdviceInfo.DrugCode) > 0 {
3597
+				t := time.Unix(item.HisDoctorAdviceInfo.RecordDate, 0) // 注意第二个参数是纳秒,这里是0
3598
+				patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, item.HisDoctorAdviceInfo.PatientId)
3556 3599
 
3557
-					codes := strings.Split(item.HisDoctorAdviceInfo.DrugCode, ",")
3558
-					for _, code := range codes{
3559
-						if len(code) > 0 {
3560
-							if len(code) != 20 {
3600
+				codes := strings.Split(item.HisDoctorAdviceInfo.DrugCode, ",")
3601
+				for _, code := range codes {
3602
+					if len(code) > 0 {
3603
+						if len(code) != 20 {
3561 3604
 
3562
-								errs = append(errs,patient.Name + "的" + t.Format("2006-01-02") +" 的" + item.HisDoctorAdviceInfo.BaseDrugLib.DrugName+" 溯源码"+code+"位数不是20位")
3563
-							}
3564
-							if IsDigit(code) == false {
3565
-								errs = append(errs,patient.Name + "的" + t.Format("2006-01-02") +" 的" + item.HisDoctorAdviceInfo.BaseDrugLib.DrugName+" 溯源码"+code+"不是纯数字")
3566
-							}
3605
+							errs = append(errs, patient.Name+"的"+t.Format("2006-01-02")+" 的"+item.HisDoctorAdviceInfo.BaseDrugLib.DrugName+" 溯源码"+code+"位数不是20位")
3606
+						}
3607
+						if IsDigit(code) == false {
3608
+							errs = append(errs, patient.Name+"的"+t.Format("2006-01-02")+" 的"+item.HisDoctorAdviceInfo.BaseDrugLib.DrugName+" 溯源码"+code+"不是纯数字")
3567 3609
 						}
3568 3610
 					}
3569 3611
 				}
3570
-
3612
+			}
3571 3613
 
3572 3614
 		}
3573 3615
 	}
3574 3616
 
3575
-		utils.ErrorLog("接口返回数据解析JSON失败: %v", errs)
3617
+	utils.ErrorLog("接口返回数据解析JSON失败: %v", errs)
3576 3618
 	if len(errs) > 0 {
3577 3619
 		c.ServeSuccessJSON(map[string]interface{}{
3578 3620
 			"failed_code": -10,
@@ -3581,7 +3623,6 @@ func (c *HisApiController) ChangeDrugFive() {
3581 3623
 		return
3582 3624
 	}
3583 3625
 
3584
-
3585 3626
 	for _, value := range ids {
3586 3627
 		intValue, _ := strconv.ParseInt(value, 10, 64)
3587 3628
 		//file := strconv.FormatInt(int64(num), 10)
@@ -25390,7 +25431,7 @@ type ResultSeven10633Two struct {
25390 25431
 	Infcode     string `json:"infcode"`
25391 25432
 	Output      struct {
25392 25433
 		Setlinfo struct {
25393
-			AcctMulaidPay   float64  `json:"acct_mulaid_pay"`
25434
+			AcctMulaidPay   float64 `json:"acct_mulaid_pay"`
25394 25435
 			AcctPay         float64 `json:"acct_pay"`
25395 25436
 			ActPayDedc      float64 `json:"act_pay_dedc"`
25396 25437
 			Age             float64 `json:"age"`
@@ -25407,7 +25448,7 @@ type ResultSeven10633Two struct {
25407 25448
 			HifesPay        float64 `json:"hifes_pay"`
25408 25449
 			HifmiPay        float64 `json:"hifmi_pay"`
25409 25450
 			HifpPay         float64 `json:"hifp_pay"`
25410
-			HospPartAmt     float64  `json:"hosp_part_amt"`
25451
+			HospPartAmt     float64 `json:"hosp_part_amt"`
25411 25452
 			InscpScpAmt     float64 `json:"inscp_scp_amt"`
25412 25453
 			Insutype        string  `json:"insutype"`
25413 25454
 			MafPay          float64 `json:"maf_pay"`
@@ -25421,7 +25462,7 @@ type ResultSeven10633Two struct {
25421 25462
 			Naty            string  `json:"naty"`
25422 25463
 			OthPay          float64 `json:"oth_pay"`
25423 25464
 			OverlmtSelfpay  float64 `json:"overlmt_selfpay"`
25424
-			PoolPropSelfpay float64  `json:"pool_prop_selfpay"`
25465
+			PoolPropSelfpay float64 `json:"pool_prop_selfpay"`
25425 25466
 			PreselfpayAmt   float64 `json:"preselfpay_amt"`
25426 25467
 			PsnCashPay      float64 `json:"psn_cash_pay"`
25427 25468
 			PsnCertType     string  `json:"psn_cert_type"`
@@ -25440,8 +25481,6 @@ type ResultSeven10633Two struct {
25440 25481
 	WarnMsg     interface{} `json:"warn_msg"`
25441 25482
 }
25442 25483
 
25443
-
25444
-
25445 25484
 type ResultSeven10633Three struct {
25446 25485
 	Cainfo      string `json:"cainfo"`
25447 25486
 	ErrMsg      string `json:"err_msg"`
@@ -25499,7 +25538,6 @@ type ResultSeven10633Three struct {
25499 25538
 	WarnMsg     interface{} `json:"warn_msg"`
25500 25539
 }
25501 25540
 
25502
-
25503 25541
 type GZResultSeven10265Two struct {
25504 25542
 	Cainfo      string `json:"cainfo"`
25505 25543
 	ErrMsg      string `json:"err_msg"`
@@ -32884,7 +32922,6 @@ func (c *HisApiController) GetPreUploadInfo() {
32884 32922
 		data["config"] = config
32885 32923
 		bytesData, _ := json.Marshal(data)
32886 32924
 
32887
-
32888 32925
 		var req *http.Request
32889 32926
 		if miConfig.MdtrtareaAdmvs == "320830" {
32890 32927
 			req, _ = http.NewRequest("POST", miConfig.AppSecret+"jsyb/2203", bytes.NewReader(bytesData))
@@ -34463,7 +34500,6 @@ func (c *HisApiController) GetPreUploadInfo() {
34463 34500
 
34464 34501
 					var resSeven10633Three ResultSeven10633Three
34465 34502
 
34466
-
34467 34503
 					var gzresSeven10265Two GZResultSeven10265Two
34468 34504
 
34469 34505
 					if miConfig.MdtrtareaAdmvs == "421300" {
@@ -34752,9 +34788,9 @@ func (c *HisApiController) GetPreUploadInfo() {
34752 34788
 
34753 34789
 								} else {
34754 34790
 
34755
-									if miConfig.MdtrtareaAdmvs == "320830"{
34791
+									if miConfig.MdtrtareaAdmvs == "320830" {
34756 34792
 
34757
-										if strings.HasPrefix(his.InsuplcAdmdvs[0:3], "320") && !strings.HasPrefix(his.InsuplcAdmdvs[0:4], "3208"){
34793
+										if strings.HasPrefix(his.InsuplcAdmdvs[0:3], "320") && !strings.HasPrefix(his.InsuplcAdmdvs[0:4], "3208") {
34758 34794
 
34759 34795
 											if err := json.Unmarshal([]byte(result), &resSeven10633Three); err != nil {
34760 34796
 												utils.ErrorLog("解析失败:%v", err)
@@ -34823,8 +34859,7 @@ func (c *HisApiController) GetPreUploadInfo() {
34823 34859
 											infocode, _ := strconv.ParseInt(resSeven10633Three.Infcode, 10, 64)
34824 34860
 											res.Infcode = infocode
34825 34861
 
34826
-
34827
-										}else {
34862
+										} else {
34828 34863
 
34829 34864
 											if err := json.Unmarshal([]byte(result), &resSeven10265Two); err != nil {
34830 34865
 												utils.ErrorLog("解析失败:%v", err)
@@ -34856,7 +34891,6 @@ func (c *HisApiController) GetPreUploadInfo() {
34856 34891
 											res.Output.Setlinfo.HifmiPay = resSeven10265Two.Output.Setlinfo.HifmiPay
34857 34892
 											res.Output.Setlinfo.HifpPay = resSeven10265Two.Output.Setlinfo.HifpPay
34858 34893
 
34859
-
34860 34894
 											res.Output.Setlinfo.InscpScpAmt = resSeven10265Two.Output.Setlinfo.InscpScpAmt
34861 34895
 											res.Output.Setlinfo.Insutype = resSeven10265Two.Output.Setlinfo.Insutype
34862 34896
 											res.Output.Setlinfo.MafPay = resSeven10265Two.Output.Setlinfo.MafPay
@@ -34892,8 +34926,7 @@ func (c *HisApiController) GetPreUploadInfo() {
34892 34926
 										}
34893 34927
 									} else {
34894 34928
 
34895
-
34896
-										if strings.HasPrefix(his.InsuplcAdmdvs[0:3], "320") && !strings.HasPrefix(his.InsuplcAdmdvs[0:4], "3209"){
34929
+										if strings.HasPrefix(his.InsuplcAdmdvs[0:3], "320") && !strings.HasPrefix(his.InsuplcAdmdvs[0:4], "3209") {
34897 34930
 
34898 34931
 											if err := json.Unmarshal([]byte(result), &resSeven10633Three); err != nil {
34899 34932
 												utils.ErrorLog("解析失败:%v", err)
@@ -34962,8 +34995,7 @@ func (c *HisApiController) GetPreUploadInfo() {
34962 34995
 											infocode, _ := strconv.ParseInt(resSeven10633Three.Infcode, 10, 64)
34963 34996
 											res.Infcode = infocode
34964 34997
 
34965
-
34966
-										}else {
34998
+										} else {
34967 34999
 
34968 35000
 											if err := json.Unmarshal([]byte(result), &resSeven10265Two); err != nil {
34969 35001
 												utils.ErrorLog("解析失败:%v", err)
@@ -34995,7 +35027,6 @@ func (c *HisApiController) GetPreUploadInfo() {
34995 35027
 											res.Output.Setlinfo.HifmiPay = resSeven10265Two.Output.Setlinfo.HifmiPay
34996 35028
 											res.Output.Setlinfo.HifpPay = resSeven10265Two.Output.Setlinfo.HifpPay
34997 35029
 
34998
-
34999 35030
 											res.Output.Setlinfo.InscpScpAmt = resSeven10265Two.Output.Setlinfo.InscpScpAmt
35000 35031
 											res.Output.Setlinfo.Insutype = resSeven10265Two.Output.Setlinfo.Insutype
35001 35032
 											res.Output.Setlinfo.MafPay = resSeven10265Two.Output.Setlinfo.MafPay
@@ -35028,16 +35059,10 @@ func (c *HisApiController) GetPreUploadInfo() {
35028 35059
 											infocode, _ := strconv.ParseInt(resSeven10265Two.Infcode, 10, 64)
35029 35060
 											res.Infcode = infocode
35030 35061
 
35031
-
35032
-
35033 35062
 										}
35034 35063
 
35035
-
35036
-
35037 35064
 									}
35038 35065
 
35039
-
35040
-
35041 35066
 								}
35042 35067
 
35043 35068
 							}
@@ -38329,7 +38354,7 @@ func (c *HisApiController) RefundDetail() {
38329 38354
 			var api3 string
38330 38355
 			if miConfig.MdtrtareaAdmvs == "320830" {
38331 38356
 				api3 = miConfig.AppSecret + "jsyb/2205?psn_no=" + order.PsnNo +
38332
-					"&mdtrt_id=" + order.MdtrtId + "&chrg_bchno=" +"0000" + "&doctor=" + patientPrescription.Doctor + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
38357
+					"&mdtrt_id=" + order.MdtrtId + "&chrg_bchno=" + "0000" + "&doctor=" + patientPrescription.Doctor + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
38333 38358
 					"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&cainfo=" + miConfig.Cainfo
38334 38359
 
38335 38360
 				//req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/2204", bytes.NewReader(bytesData))

+ 28 - 42
models/models_3501.go ファイルの表示

@@ -32,9 +32,8 @@ type Struct3501 struct {
32 32
 	AppSecret           string
33 33
 	SignKey             string
34 34
 	Enckey              string
35
-	DrugTracCodg		string
36
-	Code		string
37
-
35
+	DrugTracCodg        string
36
+	Code                string
38 37
 }
39 38
 type Struct3502 struct {
40 39
 	MedListCodg         string
@@ -66,10 +65,8 @@ type Struct3502 struct {
66 65
 	AppSecret           string
67 66
 	SignKey             string
68 67
 	Enckey              string
69
-	DrugTracCodg		string
70
-	Code		string
71
-
72
-
68
+	DrugTracCodg        string
69
+	Code                string
73 70
 }
74 71
 type Struct3503 struct {
75 72
 	MedListCodg         string
@@ -107,10 +104,8 @@ type Struct3503 struct {
107 104
 	AppSecret           string
108 105
 	SignKey             string
109 106
 	Enckey              string
110
-	DrugTracCodg		string
111
-	Code		string
112
-
113
-
107
+	DrugTracCodg        string
108
+	Code                string
114 109
 }
115 110
 type Struct3504 struct {
116 111
 	MedListCodg         string
@@ -144,10 +139,8 @@ type Struct3504 struct {
144 139
 	AppSecret           string
145 140
 	SignKey             string
146 141
 	Enckey              string
147
-	DrugTracCodg		string
148
-	Code		string
149
-
150
-
142
+	DrugTracCodg        string
143
+	Code                string
151 144
 }
152 145
 type Struct3505 struct {
153 146
 	MedListCodg         string
@@ -201,9 +194,7 @@ type Struct3505 struct {
201 194
 	AppSecret           string
202 195
 	SignKey             string
203 196
 	Enckey              string
204
-	Code		string
205
-
206
-
197
+	Code                string
207 198
 }
208 199
 type Struct3506 struct {
209 200
 	MedListCodg         string
@@ -242,10 +233,8 @@ type Struct3506 struct {
242 233
 	AppSecret           string
243 234
 	SignKey             string
244 235
 	Enckey              string
245
-	DrugTracCodg		string
246
-	Code		string
247
-
248
-
236
+	DrugTracCodg        string
237
+	Code                string
249 238
 }
250 239
 type Struct3507 struct {
251 240
 	FixmedinsBchno string
@@ -264,10 +253,8 @@ type Struct3507 struct {
264 253
 	AppSecret      string
265 254
 	SignKey        string
266 255
 	Enckey         string
267
-	DrugTracCodg		string
268
-	Code		string
269
-
270
-
256
+	DrugTracCodg   string
257
+	Code           string
271 258
 }
272 259
 
273 260
 type XtDrugInventory struct {
@@ -744,27 +731,27 @@ type Result3511 struct {
744 731
 }
745 732
 
746 733
 type Struct3512 struct {
747
-	FixmedinsCode  string `json:"fixmedins_code" validate:"required"` // 定点医药机构编号
748
-	MedinsListCodg string `json:"medins_list_codg,omitempty"`         // 医药机构目录编码
749
-	FixmedinsBchno string `json:"fixmedins_bchno,omitempty"`          // 定点医药机构批次流水号
750
-	Begndate       string `json:"begndate" validate:"required"`       // 开始日期
751
-	Enddate        string `json:"enddate" validate:"required"`        // 结束日期
752
-	MedListCodg    string `json:"med_list_codg,omitempty"`            // 医疗目录编码
753
-	DrugTracCodg   string `json:"drug_trac_codg,omitempty"`           // 药品追溯码
734
+	FixmedinsCode  string // 定点医药机构编号
735
+	MedinsListCodg string // 医药机构目录编码
736
+	FixmedinsBchno string // 定点医药机构批次流水号
737
+	Begndate       string // 开始日期
738
+	Enddate        string // 结束日期
739
+	MedListCodg    string // 医疗目录编码
740
+	DrugTracCodg   string // 药品追溯码
754 741
 	InsuplcAdmdvs  string
755 742
 	MdtrtareaAdmvs string
756 743
 	OrgName        string
757 744
 	Opter          string
758 745
 	SecretKey      string
759 746
 
760
-	RequestUrl     string
761
-	AccessKey      string
762
-	Cainfo         string
763
-	Url            string
764
-	AppId          string
765
-	AppSecret      string
766
-	SignKey        string
767
-	Enckey         string
747
+	RequestUrl string
748
+	AccessKey  string
749
+	Cainfo     string
750
+	Url        string
751
+	AppId      string
752
+	AppSecret  string
753
+	SignKey    string
754
+	Enckey     string
768 755
 }
769 756
 
770 757
 type Result3512 struct {
@@ -784,7 +771,6 @@ type Result3512 struct {
784 771
 		CrterName      string
785 772
 		CrterId        string
786 773
 		OptinsNo       string
787
-
788 774
 	} `json:"output"`
789 775
 	RefmsgTime  string      `json:"refmsg_time"`
790 776
 	RespondTime string      `json:"respond_time"`