Quellcode durchsuchen

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

csx vor 2 Jahren
Ursprung
Commit
713e850b2a

+ 3 - 3
conf/app.conf Datei anzeigen

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10188
48
+org_id = 10265
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -56,7 +56,7 @@ front_end_domain = "https://xt.kuyicloud.com/#"
56 56
 #gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
57 57
 # gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
58 58
 #内蒙古
59
-# gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
59
+gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
60 60
 #韶关
61 61
 # gdyb_paasid = "sg03_prd"
62 62
 #江门
@@ -64,7 +64,7 @@ front_end_domain = "https://xt.kuyicloud.com/#"
64 64
 #珠海
65 65
 # gdyb_paasid="zh_prd_yrojyy"
66 66
 #深圳
67
-gdyb_paasid = "sz_prd_yjyy"
67
+# gdyb_paasid = "sz_prd_yjyy"
68 68
 #肇庆
69 69
 # gdyb_paasid = "zq_prd_yjyy"
70 70
 

+ 53 - 0
controllers/coordinate/coordinate_controller.go Datei anzeigen

@@ -0,0 +1,53 @@
1
+package coordinate
2
+
3
+import (
4
+	"fmt"
5
+	"gdyb/controllers"
6
+	"gdyb/service"
7
+	"github.com/astaxie/beego"
8
+)
9
+
10
+type CoordinateController struct {
11
+	controllers.BaseAuthAPIController
12
+}
13
+
14
+func CoordinateRegistRouters() {
15
+	beego.Router("/coordinate/check", &CoordinateController{}, "get:SavePatientMessageInfo")
16
+	beego.Router("/coordinate/register", &CoordinateController{}, "get:Register")
17
+	beego.Router("/coordinate/getWaitPayDetail", &CoordinateController{}, "get:GetWaitPayDetail")
18
+	beego.Router("/coordinate/opKeepAccounts", &CoordinateController{}, "get:OpKeepAccounts")
19
+	beego.Router("/coordinate/opCancelKeepAccounts", &CoordinateController{}, "get:OpCancelKeepAccounts")
20
+
21
+}
22
+
23
+func (c *CoordinateController) SavePatientMessageInfo() {
24
+	result, request_log := service.SavePatientMessageInfo()
25
+	fmt.Println(result)
26
+	fmt.Println(request_log)
27
+
28
+}
29
+
30
+func (c *CoordinateController) Register() {
31
+	result, request_log := service.SaveReg()
32
+	fmt.Println(result)
33
+	fmt.Println(request_log)
34
+
35
+}
36
+
37
+func (c *CoordinateController) GetWaitPayDetail() {
38
+	result, request_log := service.GetWaitPayDetail()
39
+	fmt.Println(result)
40
+	fmt.Println(request_log)
41
+
42
+}
43
+
44
+func (c *CoordinateController) OpKeepAccounts() {
45
+	result, request_log := service.OpKeepAccounts()
46
+	fmt.Println(result)
47
+	fmt.Println(request_log)
48
+}
49
+func (c *CoordinateController) OpCancelKeepAccounts() {
50
+	result, request_log := service.OpCancelKeepAccounts()
51
+	fmt.Println(result)
52
+	fmt.Println(request_log)
53
+}

+ 6 - 7
controllers/sg/his_api_controller.go Datei anzeigen

@@ -422,7 +422,6 @@ func (c *HisApiController) ReadCard() {
422 422
 			}
423 423
 			var status string
424 424
 			status = respJSON["data"].(map[string]interface{})["status"].(string)
425
-			fmt.Println(respJSON["data"])
426 425
 			card_type := respJSON["data"].(map[string]interface{})["type"].(string)
427 426
 			//console.log()
428 427
 			fmt.Println("type===")
@@ -4594,12 +4593,12 @@ func (c *HisApiController) GetUploadInfo() {
4594 4593
 		} else {
4595 4594
 			his.Diagnosis = diagnosis_id
4596 4595
 			his.SickType = sickConfig.ID
4597
-			var p_type int64
4598
-			if reg_type == 1111 || reg_type == 1112 {
4599
-				p_type = 11
4600
-
4601
-			}
4602
-			his.PType = fmt.Sprintf("%d", p_type)
4596
+			//var p_type int64
4597
+			//if reg_type == 1111 || reg_type == 1112 {
4598
+			//	p_type = 11
4599
+			//
4600
+			//}
4601
+			his.PType = fmt.Sprintf("%d", reg_type)
4603 4602
 			service.UpdateHisPatientThree(&his)
4604 4603
 
4605 4604
 			data := make(map[string]interface{})

+ 7 - 7
main.go Datei anzeigen

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

+ 1 - 0
routers/router.go Datei anzeigen

@@ -29,5 +29,6 @@ func init() {
29 29
 	//sz.SZHisManagerApiRegistRouters()
30 30
 	zh.ZHHisManagerApiRegistRouters()
31 31
 	js.JSybRegistRouters()
32
+	//coordinate.CoordinateRegistRouters()
32 33
 
33 34
 }

+ 288 - 0
service/coordinate_service.go Datei anzeigen

@@ -0,0 +1,288 @@
1
+package service
2
+
3
+import (
4
+	"bytes"
5
+	"encoding/json"
6
+	"fmt"
7
+	"io/ioutil"
8
+	"net/http"
9
+)
10
+
11
+func SavePatientMessageInfo() (string, string) {
12
+
13
+	//input := make(map[string]interface{})
14
+	inputData := make(map[string]interface{})
15
+
16
+	inputData["patType"] = "1"                  // 就诊凭证编号
17
+	inputData["patIdNo"] = "441701195808152845" // 开始时间
18
+	inputData["patName"] = "罗秀云"                // 人员姓名
19
+
20
+	inputData["patMobile"] = "13535547901" // 人员姓名
21
+	inputData["patSex"] = "M"              // 人员姓名
22
+	inputData["patMarriage"] = "1"         // 人员姓名
23
+	inputData["birthday"] = "1992-10-23"   // 人员姓名
24
+	inputData["patAddress"] = "11111"      // 人员姓名
25
+	inputData["thirdPartyID"] = "16"       // 人员姓名
26
+	inputData["patAge"] = "11"             // 人员姓名
27
+	//input["req"] = inputData
28
+
29
+	var inputLog string
30
+	bytesData, err := json.Marshal(inputData)
31
+	inputLog = string(bytesData)
32
+	fmt.Println(string(bytesData))
33
+	if err != nil {
34
+		fmt.Println(err.Error())
35
+		return err.Error(), ""
36
+	}
37
+	reader := bytes.NewReader(bytesData)
38
+	var url string
39
+	gdyb_url := "http://218.104.146.179:9091/esb/listener/savePatientMessageInfo"
40
+	url = gdyb_url
41
+
42
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
43
+	request, err := http.NewRequest("GET", url, reader)
44
+	if err != nil {
45
+		fmt.Println(err.Error())
46
+		return err.Error(), ""
47
+	}
48
+
49
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
50
+	request.Header.Set("code", "Xmrjyy")
51
+
52
+	client := http.Client{}
53
+	resp, err := client.Do(request)
54
+	if err != nil {
55
+		fmt.Println(err.Error())
56
+		return err.Error(), ""
57
+	}
58
+	respBytes, err := ioutil.ReadAll(resp.Body)
59
+	if err != nil {
60
+		fmt.Println(err.Error())
61
+		return err.Error(), ""
62
+	}
63
+	fmt.Println(string(respBytes))
64
+	str := string(respBytes)
65
+	return str, inputLog
66
+
67
+}
68
+func SaveReg() (string, string) {
69
+
70
+	//input := make(map[string]interface{})
71
+	inputData := make(map[string]interface{})
72
+
73
+	inputData["deptId"] = "01"     // 就诊凭证编号
74
+	inputData["clinicUnitId"] = "" // 开始时间
75
+	inputData["healthCardNo"] = "" // 人员姓名
76
+
77
+	inputData["patientId"] = "701822660170096645" // 人员姓名
78
+	inputData["patientName"] = "罗秀云"              // 人员姓名
79
+	inputData["idCardNo"] = ""                    // 人员姓名
80
+	inputData["phone"] = ""                       // 人员姓名
81
+	inputData["doctorId"] = "01"                  // 人员姓名
82
+	inputData["doctorLevelCode"] = ""             // 人员姓名
83
+	inputData["regDate"] = "2022-05-10"           // 人员姓名
84
+
85
+	inputData["shiftCode"] = "" // 人员姓名
86
+	inputData["startTime"] = "" // 人员姓名
87
+	inputData["endTime"] = ""   // 人员姓名
88
+
89
+	inputData["scheduleId"] = "" // 人员姓名
90
+	inputData["periodId"] = ""   // 人员姓名
91
+
92
+	inputData["svObjectId"] = "" // 人员姓名
93
+	inputData["diseaseId"] = ""  // 人员姓名
94
+	inputData["regFee"] = "0.00" // 人员姓名
95
+
96
+	inputData["treatFee"] = "0.00"    // 人员姓名
97
+	inputData["operatorId"] = "admin" // 人员姓名
98
+	inputData["remark"] = ""          // 人员姓名
99
+
100
+	inputData["orderType"] = ""  // 人员姓名
101
+	inputData["clinicCode"] = "" // 人员姓名
102
+	inputData["infoSeq"] = ""    // 人员姓名
103
+
104
+	//input["Request"] = inputData
105
+
106
+	var inputLog string
107
+	bytesData, err := json.Marshal(inputData)
108
+	inputLog = string(bytesData)
109
+	fmt.Println(string(bytesData))
110
+	if err != nil {
111
+		fmt.Println(err.Error())
112
+		return err.Error(), ""
113
+	}
114
+	reader := bytes.NewReader(bytesData)
115
+	var url string
116
+	gdyb_url := "http://218.104.146.179:9091/esb/listener/saveReg"
117
+	url = gdyb_url
118
+
119
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
120
+	request, err := http.NewRequest("POST", url, reader)
121
+	if err != nil {
122
+		fmt.Println(err.Error())
123
+		return err.Error(), ""
124
+	}
125
+
126
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
127
+	request.Header.Set("code", "Xmrjyy")
128
+
129
+	client := http.Client{}
130
+	resp, err := client.Do(request)
131
+	if err != nil {
132
+		fmt.Println(err.Error())
133
+		return err.Error(), ""
134
+	}
135
+	respBytes, err := ioutil.ReadAll(resp.Body)
136
+	if err != nil {
137
+		fmt.Println(err.Error())
138
+		return err.Error(), ""
139
+	}
140
+	fmt.Println(string(respBytes))
141
+	str := string(respBytes)
142
+	return str, inputLog
143
+
144
+}
145
+func GetWaitPayDetail() (string, string) {
146
+
147
+	//input := make(map[string]interface{})
148
+	inputData := make(map[string]interface{})
149
+
150
+	inputData["clinicSeq"] = "30445"              // 就诊凭证编号
151
+	inputData["prescriptionId"] = ""              // 开始时间
152
+	inputData["patientId"] = "701822660170096645" // 人员姓名
153
+
154
+	var inputLog string
155
+	bytesData, err := json.Marshal(inputData)
156
+	inputLog = string(bytesData)
157
+	fmt.Println(string(bytesData))
158
+	if err != nil {
159
+		fmt.Println(err.Error())
160
+		return err.Error(), ""
161
+	}
162
+	reader := bytes.NewReader(bytesData)
163
+	var url string
164
+	gdyb_url := "http://218.104.146.179:9091/esb/listener/getWaitPayDetail"
165
+	url = gdyb_url
166
+
167
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
168
+	request, err := http.NewRequest("POST", url, reader)
169
+	if err != nil {
170
+		fmt.Println(err.Error())
171
+		return err.Error(), ""
172
+	}
173
+
174
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
175
+	request.Header.Set("code", "Xmrjyy")
176
+
177
+	client := http.Client{}
178
+	resp, err := client.Do(request)
179
+	if err != nil {
180
+		fmt.Println(err.Error())
181
+		return err.Error(), ""
182
+	}
183
+	respBytes, err := ioutil.ReadAll(resp.Body)
184
+	if err != nil {
185
+		fmt.Println(err.Error())
186
+		return err.Error(), ""
187
+	}
188
+	fmt.Println(string(respBytes))
189
+	str := string(respBytes)
190
+	return str, inputLog
191
+
192
+}
193
+func OpKeepAccounts() (string, string) {
194
+
195
+	inputData := make(map[string]interface{})
196
+	inputData["inNo"] = "30445"             // 就诊凭证编号
197
+	inputData["itemCode"] = "240300013-000" // 开始时间
198
+	inputData["num"] = "1"                  // 人员姓名
199
+
200
+	var inputLog string
201
+	bytesData, err := json.Marshal(inputData)
202
+	inputLog = string(bytesData)
203
+	fmt.Println(string(bytesData))
204
+	if err != nil {
205
+		fmt.Println(err.Error())
206
+		return err.Error(), ""
207
+	}
208
+	reader := bytes.NewReader(bytesData)
209
+	var url string
210
+	gdyb_url := "http://218.104.146.179:9091/esb/listener/opKeepAccounts"
211
+	url = gdyb_url
212
+
213
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
214
+	request, err := http.NewRequest("POST", url, reader)
215
+	if err != nil {
216
+		fmt.Println(err.Error())
217
+		return err.Error(), ""
218
+	}
219
+
220
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
221
+	request.Header.Set("code", "Xmrjyy")
222
+
223
+	client := http.Client{}
224
+	resp, err := client.Do(request)
225
+	if err != nil {
226
+		fmt.Println(err.Error())
227
+		return err.Error(), ""
228
+	}
229
+	respBytes, err := ioutil.ReadAll(resp.Body)
230
+	if err != nil {
231
+		fmt.Println(err.Error())
232
+		return err.Error(), ""
233
+	}
234
+	fmt.Println(string(respBytes))
235
+	str := string(respBytes)
236
+	return str, inputLog
237
+
238
+}
239
+func OpCancelKeepAccounts() (string, string) {
240
+
241
+	input := make(map[string]interface{})
242
+	inputData := make(map[string]interface{})
243
+
244
+	inputData["docId"] = ""    // 就诊凭证编号
245
+	inputData["operCode"] = "" // 开始时间
246
+	inputData["operName"] = "" // 人员姓名
247
+
248
+	input["req"] = inputData
249
+
250
+	var inputLog string
251
+	bytesData, err := json.Marshal(input)
252
+	inputLog = string(bytesData)
253
+	fmt.Println(string(bytesData))
254
+	if err != nil {
255
+		fmt.Println(err.Error())
256
+		return err.Error(), ""
257
+	}
258
+	reader := bytes.NewReader(bytesData)
259
+	var url string
260
+	gdyb_url := "http://218.104.146.179:9091/esb/listener/opCancelKeepAccounts"
261
+	url = gdyb_url
262
+
263
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
264
+	request, err := http.NewRequest("POST", url, reader)
265
+	if err != nil {
266
+		fmt.Println(err.Error())
267
+		return err.Error(), ""
268
+	}
269
+
270
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
271
+	request.Header.Set("code", "Xmrjyy")
272
+
273
+	client := http.Client{}
274
+	resp, err := client.Do(request)
275
+	if err != nil {
276
+		fmt.Println(err.Error())
277
+		return err.Error(), ""
278
+	}
279
+	respBytes, err := ioutil.ReadAll(resp.Body)
280
+	if err != nil {
281
+		fmt.Println(err.Error())
282
+		return err.Error(), ""
283
+	}
284
+	fmt.Println(string(respBytes))
285
+	str := string(respBytes)
286
+	return str, inputLog
287
+
288
+}