test_user 1 month ago
parent
commit
5aa0f46220
4 changed files with 2193 additions and 2190 deletions
  1. 913 911
      controllers/sg/his_api_controller.go
  2. 1256 1255
      service/auto_create_week_schedules_service.go
  3. 2 2
      service/gdyb_service.go
  4. 22 22
      service/nm_service.go

File diff suppressed because it is too large
+ 913 - 911
controllers/sg/his_api_controller.go


File diff suppressed because it is too large
+ 1256 - 1255
service/auto_create_week_schedules_service.go


+ 2 - 2
service/gdyb_service.go View File

9
 	"fmt"
9
 	"fmt"
10
 	"gdyb/models"
10
 	"gdyb/models"
11
 
11
 
12
-	//"strings"
12
+	"strings"
13
 	//"gdyb/utils"
13
 	//"gdyb/utils"
14
 	"github.com/astaxie/beego"
14
 	"github.com/astaxie/beego"
15
 	"github.com/axgle/mahonia"
15
 	"github.com/axgle/mahonia"
8402
 	// 生成输入报文
8402
 	// 生成输入报文
8403
 	//inputMessage := SetInputMessage(timestamp, struct3501.OrgName, struct3501.Opter, struct3501.FixmedinsHilistId, struct3501.InsuplcAdmdvs, struct3501.MdtrtareaAdmvs, struct3501.Cainfo,"")
8403
 	//inputMessage := SetInputMessage(timestamp, struct3501.OrgName, struct3501.Opter, struct3501.FixmedinsHilistId, struct3501.InsuplcAdmdvs, struct3501.MdtrtareaAdmvs, struct3501.Cainfo,"")
8404
 	sign := GetSignInInfo(struct3501.FixmedinsCode)
8404
 	sign := GetSignInInfo(struct3501.FixmedinsCode)
8405
-	inputMessage := SetInputMessage(nonce, timestamp, struct3501.OrgName, struct3501.Opter, struct3501.FixmedinsCode, struct3501.InsuplcAdmdvs, struct3501.MdtrtareaAdmvs, sign)
8405
+	inputMessage := SetGZInputMessage(nonce, timestamp, struct3501.OrgName, struct3501.Opter, struct3501.FixmedinsCode, struct3501.InsuplcAdmdvs, struct3501.MdtrtareaAdmvs, sign)
8406
 
8406
 
8407
 	input := make(map[string]interface{})
8407
 	input := make(map[string]interface{})
8408
 	inputData := make(map[string]interface{})
8408
 	inputData := make(map[string]interface{})

+ 22 - 22
service/nm_service.go View File

1341
 	fmt.Println(string(bytesData))
1341
 	fmt.Println(string(bytesData))
1342
 	if err != nil {
1342
 	if err != nil {
1343
 		fmt.Println(err.Error())
1343
 		fmt.Println(err.Error())
1344
-		return err.Error()
1344
+		return err.Error(),""
1345
 	}
1345
 	}
1346
 	reader := bytes.NewReader(bytesData)
1346
 	reader := bytes.NewReader(bytesData)
1347
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1347
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1636
 	fmt.Println(string(bytesData))
1636
 	fmt.Println(string(bytesData))
1637
 	if err != nil {
1637
 	if err != nil {
1638
 		fmt.Println(err.Error())
1638
 		fmt.Println(err.Error())
1639
-		return err.Error()
1639
+		return err.Error(),""
1640
 	}
1640
 	}
1641
 	reader := bytes.NewReader(bytesData)
1641
 	reader := bytes.NewReader(bytesData)
1642
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1642
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1647
 	request, err := http.NewRequest("POST", url, reader)
1647
 	request, err := http.NewRequest("POST", url, reader)
1648
 	if err != nil {
1648
 	if err != nil {
1649
 		fmt.Println(err.Error())
1649
 		fmt.Println(err.Error())
1650
-		return err.Error()
1650
+		return err.Error(),""
1651
 	}
1651
 	}
1652
 
1652
 
1653
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1653
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1660
 	resp, err := client.Do(request)
1660
 	resp, err := client.Do(request)
1661
 	if err != nil {
1661
 	if err != nil {
1662
 		fmt.Println(err.Error())
1662
 		fmt.Println(err.Error())
1663
-		return err.Error()
1663
+		return err.Error(),""
1664
 	}
1664
 	}
1665
 	respBytes, err := ioutil.ReadAll(resp.Body)
1665
 	respBytes, err := ioutil.ReadAll(resp.Body)
1666
 	if err != nil {
1666
 	if err != nil {
1667
 		fmt.Println(err.Error())
1667
 		fmt.Println(err.Error())
1668
-		return err.Error()
1668
+		return err.Error(),""
1669
 	}
1669
 	}
1670
 	str := string(respBytes)
1670
 	str := string(respBytes)
1671
 	fmt.Println(str)
1671
 	fmt.Println(str)
1720
 	fmt.Println(string(bytesData))
1720
 	fmt.Println(string(bytesData))
1721
 	if err != nil {
1721
 	if err != nil {
1722
 		fmt.Println(err.Error())
1722
 		fmt.Println(err.Error())
1723
-		return err.Error()
1723
+		return err.Error(),""
1724
 	}
1724
 	}
1725
 	reader := bytes.NewReader(bytesData)
1725
 	reader := bytes.NewReader(bytesData)
1726
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1726
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1731
 	request, err := http.NewRequest("POST", url, reader)
1731
 	request, err := http.NewRequest("POST", url, reader)
1732
 	if err != nil {
1732
 	if err != nil {
1733
 		fmt.Println(err.Error())
1733
 		fmt.Println(err.Error())
1734
-		return err.Error()
1734
+		return err.Error(),""
1735
 	}
1735
 	}
1736
 
1736
 
1737
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1737
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1744
 	resp, err := client.Do(request)
1744
 	resp, err := client.Do(request)
1745
 	if err != nil {
1745
 	if err != nil {
1746
 		fmt.Println(err.Error())
1746
 		fmt.Println(err.Error())
1747
-		return err.Error()
1747
+		return err.Error(),""
1748
 	}
1748
 	}
1749
 	respBytes, err := ioutil.ReadAll(resp.Body)
1749
 	respBytes, err := ioutil.ReadAll(resp.Body)
1750
 	if err != nil {
1750
 	if err != nil {
1751
 		fmt.Println(err.Error())
1751
 		fmt.Println(err.Error())
1752
-		return err.Error()
1752
+		return err.Error(),""
1753
 	}
1753
 	}
1754
 	str := string(respBytes)
1754
 	str := string(respBytes)
1755
 	fmt.Println(str)
1755
 	fmt.Println(str)
1756
-	return str,,string(bytesData)
1756
+	return str,string(bytesData)
1757
 }
1757
 }
1758
 func NMyb3511(struct3511 models.Struct3511, secret_key string) (string,string) {
1758
 func NMyb3511(struct3511 models.Struct3511, secret_key string) (string,string) {
1759
 	// 生成签名
1759
 	// 生成签名
1804
 	fmt.Println(string(bytesData))
1804
 	fmt.Println(string(bytesData))
1805
 	if err != nil {
1805
 	if err != nil {
1806
 		fmt.Println(err.Error())
1806
 		fmt.Println(err.Error())
1807
-		return err.Error()
1807
+		return err.Error(),""
1808
 	}
1808
 	}
1809
 	reader := bytes.NewReader(bytesData)
1809
 	reader := bytes.NewReader(bytesData)
1810
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1810
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1815
 	request, err := http.NewRequest("POST", url, reader)
1815
 	request, err := http.NewRequest("POST", url, reader)
1816
 	if err != nil {
1816
 	if err != nil {
1817
 		fmt.Println(err.Error())
1817
 		fmt.Println(err.Error())
1818
-		return err.Error()
1818
+		return err.Error(),""
1819
 	}
1819
 	}
1820
 
1820
 
1821
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1821
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1828
 	resp, err := client.Do(request)
1828
 	resp, err := client.Do(request)
1829
 	if err != nil {
1829
 	if err != nil {
1830
 		fmt.Println(err.Error())
1830
 		fmt.Println(err.Error())
1831
-		return err.Error()
1831
+		return err.Error(),""
1832
 	}
1832
 	}
1833
 	respBytes, err := ioutil.ReadAll(resp.Body)
1833
 	respBytes, err := ioutil.ReadAll(resp.Body)
1834
 	if err != nil {
1834
 	if err != nil {
1835
 		fmt.Println(err.Error())
1835
 		fmt.Println(err.Error())
1836
-		return err.Error()
1836
+		return err.Error(),""
1837
 	}
1837
 	}
1838
 	str := string(respBytes)
1838
 	str := string(respBytes)
1839
 	fmt.Println(str)
1839
 	fmt.Println(str)
1887
 	fmt.Println(string(bytesData))
1887
 	fmt.Println(string(bytesData))
1888
 	if err != nil {
1888
 	if err != nil {
1889
 		fmt.Println(err.Error())
1889
 		fmt.Println(err.Error())
1890
-		return err.Error()
1890
+		return err.Error(),""
1891
 	}
1891
 	}
1892
 	reader := bytes.NewReader(bytesData)
1892
 	reader := bytes.NewReader(bytesData)
1893
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1893
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1898
 	request, err := http.NewRequest("POST", url, reader)
1898
 	request, err := http.NewRequest("POST", url, reader)
1899
 	if err != nil {
1899
 	if err != nil {
1900
 		fmt.Println(err.Error())
1900
 		fmt.Println(err.Error())
1901
-		return err.Error()
1901
+		return err.Error(),""
1902
 	}
1902
 	}
1903
 
1903
 
1904
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1904
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1911
 	resp, err := client.Do(request)
1911
 	resp, err := client.Do(request)
1912
 	if err != nil {
1912
 	if err != nil {
1913
 		fmt.Println(err.Error())
1913
 		fmt.Println(err.Error())
1914
-		return err.Error()
1914
+		return err.Error(),""
1915
 	}
1915
 	}
1916
 	respBytes, err := ioutil.ReadAll(resp.Body)
1916
 	respBytes, err := ioutil.ReadAll(resp.Body)
1917
 	if err != nil {
1917
 	if err != nil {
1918
 		fmt.Println(err.Error())
1918
 		fmt.Println(err.Error())
1919
-		return err.Error()
1919
+		return err.Error(),""
1920
 	}
1920
 	}
1921
 	str := string(respBytes)
1921
 	str := string(respBytes)
1922
 	fmt.Println(str)
1922
 	fmt.Println(str)
1972
 	fmt.Println(string(bytesData))
1972
 	fmt.Println(string(bytesData))
1973
 	if err != nil {
1973
 	if err != nil {
1974
 		fmt.Println(err.Error())
1974
 		fmt.Println(err.Error())
1975
-		return err.Error()
1975
+		return err.Error(),""
1976
 	}
1976
 	}
1977
 	reader := bytes.NewReader(bytesData)
1977
 	reader := bytes.NewReader(bytesData)
1978
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1978
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/5301"
1983
 	request, err := http.NewRequest("POST", url, reader)
1983
 	request, err := http.NewRequest("POST", url, reader)
1984
 	if err != nil {
1984
 	if err != nil {
1985
 		fmt.Println(err.Error())
1985
 		fmt.Println(err.Error())
1986
-		return err.Error()
1986
+		return err.Error(),""
1987
 	}
1987
 	}
1988
 
1988
 
1989
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1989
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1996
 	resp, err := client.Do(request)
1996
 	resp, err := client.Do(request)
1997
 	if err != nil {
1997
 	if err != nil {
1998
 		fmt.Println(err.Error())
1998
 		fmt.Println(err.Error())
1999
-		return err.Error()
1999
+		return err.Error(),""
2000
 	}
2000
 	}
2001
 	respBytes, err := ioutil.ReadAll(resp.Body)
2001
 	respBytes, err := ioutil.ReadAll(resp.Body)
2002
 	if err != nil {
2002
 	if err != nil {
2003
 		fmt.Println(err.Error())
2003
 		fmt.Println(err.Error())
2004
-		return err.Error()
2004
+		return err.Error(),""
2005
 	}
2005
 	}
2006
 	str := string(respBytes)
2006
 	str := string(respBytes)
2007
 	fmt.Println(str)
2007
 	fmt.Println(str)