Bläddra i källkod

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

XMLWAN 4 år sedan
förälder
incheckning
8e7158c7a9
2 ändrade filer med 1055 tillägg och 180 borttagningar
  1. 996 160
      controllers/sz/sz_his_api_controller.go
  2. 59 20
      service/sz_his_service.go

Filskillnaden har hållits tillbaka eftersom den är för stor
+ 996 - 160
controllers/sz/sz_his_api_controller.go


+ 59 - 20
service/sz_his_service.go Visa fil

@@ -13,17 +13,24 @@ import (
13 13
 	_ "unsafe"
14 14
 )
15 15
 
16
-func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_code string, account string, verify_code string, serial_number string, mz_number string, version_code string, custom_code string, project_name string, price float64) string {
16
+func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_code string, account string, verify_code string, serial_number string, mz_number string, version_code string, custom_code string, project_name string, price float64, medical_care int64) string {
17 17
 	// 生成输入报文
18 18
 	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
19 19
 	inputData := make(map[string]interface{})
20 20
 	inputMessage["transType"] = "MZ002"         // 交易编码
21 21
 	inputMessage["transVersion"] = version_code // 交易编码
22 22
 
23
+	if medical_care == 11 {
24
+		inputData["aka130"] = "11"
25
+	} else if medical_care == 13 {
26
+		inputData["aka130"] = "13"
27
+	} else {
28
+		inputData["aka130"] = fmt.Sprintf("%d", medical_care)
29
+	}
30
+
23 31
 	inputData["akc190"] = mz_number
24 32
 	inputData["aaz500"] = account
25 33
 	inputData["bzz269"] = "000000"
26
-	inputData["aka130"] = "11"
27 34
 	inputData["akf001"] = dept_code
28 35
 	inputData["akc264"] = price
29 36
 	inputData["bke384"] = inputMessage["serialNumber"]
@@ -56,7 +63,9 @@ func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_co
56 63
 			return err.Error()
57 64
 		}
58 65
 		reader := bytes.NewReader(bytesData)
59
-		url := "http://192.168.1.228:17001/szsi-portal/transData"
66
+		//url := "http://192.168.1.228:17001/szsi-portal/transData"
67
+		url := "http://192.168.1.88:6666/szsi-portal/transData"
68
+
60 69
 		request, err := http.NewRequest("POST", url, reader)
61 70
 		if err != nil {
62 71
 			fmt.Println(err.Error())
@@ -100,7 +109,9 @@ func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_co
100 109
 			return err.Error()
101 110
 		}
102 111
 		reader := bytes.NewReader(bytesData)
103
-		url := "http://192.168.1.228:17001/szsi-portal/transData"
112
+		//url := "http://192.168.1.228:17001/szsi-portal/transData"
113
+		url := "http://192.168.1.88:6666/szsi-portal/transData"
114
+
104 115
 		request, err := http.NewRequest("POST", url, reader)
105 116
 		if err != nil {
106 117
 			fmt.Println(err.Error())
@@ -173,7 +184,7 @@ func SzybFY001(doctor string, doctor_code string, fixmedins_code string, datas [
173 184
 		return err.Error()
174 185
 	}
175 186
 	reader := bytes.NewReader(bytesData)
176
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
187
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
177 188
 	request, err := http.NewRequest("POST", url, reader)
178 189
 	if err != nil {
179 190
 		fmt.Println(err.Error())
@@ -227,7 +238,8 @@ func SzybFY002(doctor string, doctor_code string, fixmedins_code string, datas [
227 238
 	}
228 239
 	reader := bytes.NewReader(bytesData)
229 240
 	//url := "http://192.168.1.99:10000"
230
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
241
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
242
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
231 243
 
232 244
 	request, err := http.NewRequest("POST", url, reader)
233 245
 	if err != nil {
@@ -276,7 +288,8 @@ func SzybFY004(doctor string, doctor_code string, fixmedins_code string, total f
276 288
 	}
277 289
 	reader := bytes.NewReader(bytesData)
278 290
 	//url := "http://192.168.1.99:10000"
279
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
291
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
292
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
280 293
 
281 294
 	request, err := http.NewRequest("POST", url, reader)
282 295
 	if err != nil {
@@ -301,7 +314,7 @@ func SzybFY004(doctor string, doctor_code string, fixmedins_code string, total f
301 314
 	str := string(respBytes)
302 315
 	return str
303 316
 }
304
-func SzybFY005(doctor string, doctor_code string, fixmedins_code string, total float64, account string, verify_code string, serial_number string, mz_number string, version_code string, drug_doctor string, drug_doctor_name string) string {
317
+func SzybFY005(doctor string, doctor_code string, fixmedins_code string, total float64, account string, verify_code string, serial_number string, mz_number string, version_code string, drug_doctor string, drug_doctor_name string, medical_care int64) string {
305 318
 	// 生成输入报文
306 319
 	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
307 320
 	inputData := make(map[string]interface{})
@@ -309,10 +322,17 @@ func SzybFY005(doctor string, doctor_code string, fixmedins_code string, total f
309 322
 
310 323
 	inputMessage["transVersion"] = version_code // 交易编码
311 324
 
325
+	if medical_care == 11 {
326
+		inputData["aka130"] = "11"
327
+	} else if medical_care == 13 {
328
+		inputData["aka130"] = "13"
329
+		inputData["cka303"] = "Z99.2"
330
+	} else {
331
+		inputData["aka130"] = fmt.Sprintf("%d", medical_care)
332
+	}
312 333
 	inputData["aaz500"] = account
313 334
 	inputData["bzz269"] = "000000"
314 335
 	inputData["akc190"] = mz_number
315
-	inputData["aka130"] = "11"
316 336
 	inputData["bkc320"] = drug_doctor
317 337
 	inputData["ckc350"] = drug_doctor_name
318 338
 	inputData["aka030"] = "12"
@@ -330,7 +350,8 @@ func SzybFY005(doctor string, doctor_code string, fixmedins_code string, total f
330 350
 	}
331 351
 	reader := bytes.NewReader(bytesData)
332 352
 	//url := "http://192.168.1.99:10000"
333
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
353
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
354
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
334 355
 
335 356
 	request, err := http.NewRequest("POST", url, reader)
336 357
 	if err != nil {
@@ -374,7 +395,8 @@ func SzybJY001(doctor string, doctor_code string, fixmedins_code string, setl_nu
374 395
 	}
375 396
 	reader := bytes.NewReader(bytesData)
376 397
 	//url := "http://192.168.1.99:10000"
377
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
398
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
399
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
378 400
 
379 401
 	request, err := http.NewRequest("POST", url, reader)
380 402
 	if err != nil {
@@ -418,7 +440,8 @@ func SzybJY002(doctor string, doctor_code string, fixmedins_code string, setl_nu
418 440
 	}
419 441
 	reader := bytes.NewReader(bytesData)
420 442
 	//url := "http://192.168.1.99:10000"
421
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
443
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
444
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
422 445
 
423 446
 	request, err := http.NewRequest("POST", url, reader)
424 447
 	if err != nil {
@@ -464,7 +487,8 @@ func SzybJY003(doctor string, doctor_code string, fixmedins_code string, setl_nu
464 487
 	}
465 488
 	reader := bytes.NewReader(bytesData)
466 489
 	//url := "http://192.168.1.99:10000"
467
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
490
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
491
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
468 492
 
469 493
 	request, err := http.NewRequest("POST", url, reader)
470 494
 	if err != nil {
@@ -638,7 +662,8 @@ func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedru
638 662
 	}
639 663
 	reader := bytes.NewReader(bytesData)
640 664
 	//url := "http://192.168.1.99:10000"
641
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
665
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
666
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
642 667
 
643 668
 	request, err := http.NewRequest("POST", url, reader)
644 669
 	if err != nil {
@@ -735,7 +760,8 @@ func SzybML009(doctor string, doctor_code string, fixmedins_code string, pro *mo
735 760
 	}
736 761
 	reader := bytes.NewReader(bytesData)
737 762
 	//url := "http://192.168.1.99:10000"
738
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
763
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
764
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
739 765
 
740 766
 	request, err := http.NewRequest("POST", url, reader)
741 767
 	if err != nil {
@@ -852,7 +878,8 @@ func SzybML010(doctor string, doctor_code string, fixmedins_code string, datas [
852 878
 	}
853 879
 	reader := bytes.NewReader(bytesData)
854 880
 	//url := "http://192.168.1.99:10000"
855
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
881
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
882
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
856 883
 
857 884
 	request, err := http.NewRequest("POST", url, reader)
858 885
 	if err != nil {
@@ -940,7 +967,8 @@ func SzybYS001(doctor string, doctor_code string, fixmedins_code string, doc *mo
940 967
 	}
941 968
 	reader := bytes.NewReader(bytesData)
942 969
 	//url := "http://192.168.1.99:10000"
943
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
970
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
971
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
944 972
 
945 973
 	request, err := http.NewRequest("POST", url, reader)
946 974
 	if err != nil {
@@ -1085,7 +1113,8 @@ func SzybYS002(doctor string, doctor_code string, fixmedins_code string, datas *
1085 1113
 	}
1086 1114
 	reader := bytes.NewReader(bytesData)
1087 1115
 	//url := "http://192.168.1.99:10000"
1088
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
1116
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
1117
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
1089 1118
 
1090 1119
 	request, err := http.NewRequest("POST", url, reader)
1091 1120
 	if err != nil {
@@ -1177,7 +1206,8 @@ func SzybYS003(doctor string, doctor_code string, fixmedins_code string, datas [
1177 1206
 	}
1178 1207
 	reader := bytes.NewReader(bytesData)
1179 1208
 	//url := "http://192.168.1.99:10000"
1180
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
1209
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
1210
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
1181 1211
 
1182 1212
 	request, err := http.NewRequest("POST", url, reader)
1183 1213
 	if err != nil {
@@ -1239,7 +1269,8 @@ func SzybYML007(doctor string, doctor_code string, fixmedins_code string, infor
1239 1269
 	}
1240 1270
 	reader := bytes.NewReader(bytesData)
1241 1271
 	//url := "http://192.168.1.99:10000"
1242
-	url := "http://192.168.1.228:17001/szsi-portal/transData"
1272
+	//url := "http://192.168.1.228:17001/szsi-portal/transData"
1273
+	url := "http://192.168.1.88:6666/szsi-portal/transData"
1243 1274
 
1244 1275
 	request, err := http.NewRequest("POST", url, reader)
1245 1276
 	if err != nil {
@@ -1400,3 +1431,11 @@ func UpdateAdminUserRoleById(id int64) (models.MySgjUserAdminRole, error) {
1400 1431
 	err = UserWriteDB().Model(&role).Where("admin_user_id = ?", id).Updates(map[string]interface{}{"is_mark = ?": 1}).Error
1401 1432
 	return role, err
1402 1433
 }
1434
+
1435
+func UpdataOrderInfoStatus(id int64, number string, user_org_id int64) {
1436
+	err = writeDb.Model(&models.HisOrder{}).Where("status = 1 AND id = ? AND user_org_id = ?", id, user_org_id).Updates(map[string]interface{}{"mtime": time.Now().Unix(), "status": 0}).Error
1437
+	err = writeDb.Model(&models.HisOrderInfo{}).Where("status = 1 AND user_org_id = ? AND order_number = ?", user_org_id, number).Updates(map[string]interface{}{"mtime": time.Now().Unix(), "status": 0}).Error
1438
+
1439
+	return
1440
+
1441
+}