Browse Source

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

csx 3 years ago
parent
commit
d3de5c3978
2 changed files with 42 additions and 3 deletions
  1. 40 2
      controllers/sg/his_api_controller.go
  2. 2 1
      main.go

+ 40 - 2
controllers/sg/his_api_controller.go View File

1939
 				IdCardNo = patient.IdCardNo
1939
 				IdCardNo = patient.IdCardNo
1940
 			}
1940
 			}
1941
 
1941
 
1942
+			//var insutypes []string
1943
+			//
1944
+			//var insutype string
1945
+			//var is390 int = 0
1946
+			//var is310 int = 0
1947
+			//for _, item := range res.Output.Iinfo {
1948
+			//	if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
1949
+			//		insutypes = append(insutypes, item.Insutype)
1950
+			//	}
1951
+			//}
1952
+			//if len(insutypes) == 1 {
1953
+			//	insutype = insutypes[0]
1954
+			//} else {
1955
+			//	for _, i := range insutypes {
1956
+			//		if i == "390" {
1957
+			//			is390 = 1
1958
+			//		}
1959
+			//
1960
+			//		if i == "310" {
1961
+			//			is310 = 1
1962
+			//		}
1963
+			//	}
1964
+			//}
1965
+			//if is390 == 1 {
1966
+			//	insutype = "390"
1967
+			//}
1968
+			//if is310 == 1 {
1969
+			//	insutype = "310"
1970
+			//}
1971
+			//
1972
+			//if len(insutypes) == 0 {
1973
+			//	insutype = "310"
1974
+			//}
1975
+
1976
+			var rf []*ResultFive
1977
+			json.Unmarshal([]byte(his.Iinfo), &rf)
1942
 			var insutypes []string
1978
 			var insutypes []string
1943
-
1944
 			var insutype string
1979
 			var insutype string
1945
 			var is390 int = 0
1980
 			var is390 int = 0
1946
 			var is310 int = 0
1981
 			var is310 int = 0
1947
-			for _, item := range res.Output.Iinfo {
1982
+
1983
+			for _, item := range rf {
1948
 				if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
1984
 				if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
1949
 					insutypes = append(insutypes, item.Insutype)
1985
 					insutypes = append(insutypes, item.Insutype)
1950
 				}
1986
 				}
1951
 			}
1987
 			}
1988
+
1952
 			if len(insutypes) == 1 {
1989
 			if len(insutypes) == 1 {
1953
 				insutype = insutypes[0]
1990
 				insutype = insutypes[0]
1954
 			} else {
1991
 			} else {
1965
 			if is390 == 1 {
2002
 			if is390 == 1 {
1966
 				insutype = "390"
2003
 				insutype = "390"
1967
 			}
2004
 			}
2005
+
1968
 			if is310 == 1 {
2006
 			if is310 == 1 {
1969
 				insutype = "310"
2007
 				insutype = "310"
1970
 			}
2008
 			}

+ 2 - 1
main.go View File

5
 	"fmt"
5
 	"fmt"
6
 	"gdyb/models"
6
 	"gdyb/models"
7
 	_ "gdyb/routers"
7
 	_ "gdyb/routers"
8
+	"gdyb/service"
8
 	"github.com/astaxie/beego"
9
 	"github.com/astaxie/beego"
9
 	"github.com/qiniu/api.v7/auth/qbox"
10
 	"github.com/qiniu/api.v7/auth/qbox"
10
 	"github.com/qiniu/api.v7/storage"
11
 	"github.com/qiniu/api.v7/storage"
14
 )
15
 )
15
 
16
 
16
 func init() {
17
 func init() {
17
-	//service.ConnectDB()
18
+	service.ConnectDB()
18
 	//org_id, _ := beego.AppConfig.Int64("org_id")
19
 	//org_id, _ := beego.AppConfig.Int64("org_id")
19
 	//miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
20
 	//miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
20
 	//CreateLog(miConfig)
21
 	//CreateLog(miConfig)