test_user 3 weeks ago
parent
commit
287aaa1075
2 changed files with 27 additions and 16 deletions
  1. 19 13
      controllers/sg/his_api_controller.go
  2. 8 3
      service/hn_service.go

+ 19 - 13
controllers/sg/his_api_controller.go View File

108
 
108
 
109
 	beego.Router("/api/readele", &HisApiController{}, "get:ReadEleToken")
109
 	beego.Router("/api/readele", &HisApiController{}, "get:ReadEleToken")
110
 
110
 
111
-	beego.Router("/api/2505", &HisApiController{}, "get:Get2505")
111
+	//beego.Router("/api/2505", &HisApiController{}, "get:Get2505")
112
 
112
 
113
 	beego.Router("/api/4201A", &HisApiController{}, "get:Get4201A")
113
 	beego.Router("/api/4201A", &HisApiController{}, "get:Get4201A")
114
 	beego.Router("/api/4202", &HisApiController{}, "get:Get4202")
114
 	beego.Router("/api/4202", &HisApiController{}, "get:Get4202")
176
 
176
 
177
 	beego.Router("/api/2406", &HisApiController{}, "get:Get2406")
177
 	beego.Router("/api/2406", &HisApiController{}, "get:Get2406")
178
 
178
 
179
-	beego.Router("/api/2503", &HisApiController{}, "get:Get2503")
179
+	//beego.Router("/api/2503", &HisApiController{}, "get:Get2503")
180
 
180
 
181
 	beego.Router("/api/1318", &HisApiController{}, "get:Get1318")
181
 	beego.Router("/api/1318", &HisApiController{}, "get:Get1318")
182
 
182
 
9120
 	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
9120
 	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
9121
 	result, requestLog := service.Gdyb3103(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, warm_type, warm_ids, fk_state, desc)
9121
 	result, requestLog := service.Gdyb3103(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, warm_type, warm_ids, fk_state, desc)
9122
 	saveLog(result, requestLog, "3103", "反馈")
9122
 	saveLog(result, requestLog, "3103", "反馈")
9123
-	var res2 ResultSix
9123
+	var res2 ResultSix3103
9124
 	var respJSON2 map[string]interface{}
9124
 	var respJSON2 map[string]interface{}
9125
 	if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
9125
 	if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
9126
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
9126
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
9148
 	}
9148
 	}
9149
 }
9149
 }
9150
 
9150
 
9151
-func (c *HisApiController) Get3103() {
9152
-	admin_user_id, _ := c.GetInt64("admin_user_id")
9153
-	miConfig, _ := service.FindMedicalInsuranceInfo(10375)
9154
-	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
9155
 
9151
 
9156
-	service.Gdyb2505("45000000000008100145868008", curRoles.UserName, miConfig.OrgName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, "2024-01-12 09:00:00", "2026-12-31 23:00:00", admin_user_id)
9157
-}
9158
 
9152
 
9159
 func (c *HisApiController) Get4201A() {
9153
 func (c *HisApiController) Get4201A() {
9160
 	order_id, _ := c.GetInt64("order_id")
9154
 	order_id, _ := c.GetInt64("order_id")
23807
 	WarnMsg     interface{} `json:"warn_msg"`
23801
 	WarnMsg     interface{} `json:"warn_msg"`
23808
 }
23802
 }
23809
 
23803
 
23804
+type ResultSix3103 struct {
23805
+	Cainfo      interface{} `json:"cainfo"`
23806
+	ErrMsg      string      `json:"err_msg"`
23807
+	InfRefmsgid string      `json:"inf_refmsgid"`
23808
+	Infcode     int64       `json:"infcode"`
23809
+
23810
+	RefmsgTime  string      `json:"refmsg_time"`
23811
+	RespondTime string      `json:"respond_time"`
23812
+	Signtype    interface{} `json:"signtype"`
23813
+	WarnMsg     interface{} `json:"warn_msg"`
23814
+}
23815
+
23810
 type FJ3507Result struct {
23816
 type FJ3507Result struct {
23811
 	Cainfo      interface{} `json:"cainfo"`
23817
 	Cainfo      interface{} `json:"cainfo"`
23812
 	ErrMsg      string      `json:"err_msg"`
23818
 	ErrMsg      string      `json:"err_msg"`
27005
 										"failed_code": -10,
27011
 										"failed_code": -10,
27006
 										"failed_type": 100,
27012
 										"failed_type": 100,
27007
 										"warm_type":   1,
27013
 										"warm_type":   1,
27008
-										"msg":         res3101.Output.Result,
27014
+										"msg":         res3101,
27009
 									})
27015
 									})
27010
 									return
27016
 									return
27011
 								} else {
27017
 								} else {
30561
 									"failed_code": -10,
30567
 									"failed_code": -10,
30562
 									"failed_type": 100,
30568
 									"failed_type": 100,
30563
 									"warm_type":   2,
30569
 									"warm_type":   2,
30564
-									"msg":         result3101.Output.Result,
30570
+									"msg":         result3101,
30565
 								})
30571
 								})
30566
 								return
30572
 								return
30567
 							}
30573
 							}
32515
 										"failed_code": -10,
32521
 										"failed_code": -10,
32516
 										"failed_type": 100,
32522
 										"failed_type": 100,
32517
 										"warm_type":   1,
32523
 										"warm_type":   1,
32518
-										"msg":         result3101.Output.Result,
32524
+										"msg":         result3101,
32519
 									})
32525
 									})
32520
 									return
32526
 									return
32521
 								} else {
32527
 								} else {
33926
 											"failed_code": -10,
33932
 											"failed_code": -10,
33927
 											"failed_type": 100,
33933
 											"failed_type": 100,
33928
 											"warm_type":   2,
33934
 											"warm_type":   2,
33929
-											"msg":         result3101.Output.Result,
33935
+											"msg":         result3101,
33930
 										})
33936
 										})
33931
 										return
33937
 										return
33932
 									} else {
33938
 									} else {

+ 8 - 3
service/hn_service.go View File

411
 	//timestamp := time.Now().Unix()
411
 	//timestamp := time.Now().Unix()
412
 	//timestamp := time.Now().Unix()
412
 	//timestamp := time.Now().Unix()
413
 
413
 
414
-	timestamp2 := time.Now().Unix()
414
+	//timestamp2 := time.Now().Unix()
415
+
415
 
416
 
416
-	tempTime := time.Unix(timestamp2, 0)
417
-	timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
418
 	var customs []*Custom
417
 	var customs []*Custom
419
 	for _, item := range hisPrescription {
418
 	for _, item := range hisPrescription {
420
 		//tm := time.Unix(item.PreTime, 0)
419
 		//tm := time.Unix(item.PreTime, 0)
421
 
420
 
422
 		if item.Type == 1 { //药品
421
 		if item.Type == 1 { //药品
423
 			for _, subItem := range item.HisDoctorAdviceInfo {
422
 			for _, subItem := range item.HisDoctorAdviceInfo {
423
+				tempTime := time.Unix(subItem.StartTime, 0)
424
+				timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
424
 				if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
425
 				if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
425
 					//var randNum int
426
 					//var randNum int
426
 					//randNum = rand.Intn(10000) + 1000
427
 					//randNum = rand.Intn(10000) + 1000
449
 
450
 
450
 		if item.Type == 2 { //项目
451
 		if item.Type == 2 { //项目
451
 			for _, subItem := range item.HisPrescriptionProject {
452
 			for _, subItem := range item.HisPrescriptionProject {
453
+				tempTime := time.Unix(subItem.StartTime, 0)
454
+				timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
452
 				//var randNum int
455
 				//var randNum int
453
 				//randNum = rand.Intn(10000) + 1000
456
 				//randNum = rand.Intn(10000) + 1000
454
 				if subItem.Type == 2 {
457
 				if subItem.Type == 2 {
471
 					}
474
 					}
472
 
475
 
473
 				} else if subItem.Type == 3 {
476
 				} else if subItem.Type == 3 {
477
+					tempTime := time.Unix(subItem.StartTime, 0)
478
+					timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
474
 					if len(subItem.GoodInfo.MedicalInsuranceNumber) > 0 {
479
 					if len(subItem.GoodInfo.MedicalInsuranceNumber) > 0 {
475
 						cnt, _ := strconv.ParseFloat(subItem.Count, 64)
480
 						cnt, _ := strconv.ParseFloat(subItem.Count, 64)
476
 
481