Преглед изворни кода

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

csx пре 3 година
родитељ
комит
786fef9607
1 измењених фајлова са 91 додато и 95 уклоњено
  1. 91 95
      controllers/sg/his_api_controller.go

+ 91 - 95
controllers/sg/his_api_controller.go Прегледај датотеку

@@ -5315,7 +5315,7 @@ func (c *HisApiController) GetSettleAccounts() {
5315 5315
 
5316 5316
 			api := "http://192.168.124.4:9532/" + "hbyb/5203?psn_no=" + businessParams.PsnNo + "&mdtrt_id=" + businessParams.MdtrtId + "&setl_id=" + businessParams.SetlId +
5317 5317
 				"&org_name=" + miConfig.OrgName + "&doctor=" + baseParams.Doctor + "&fixmedins_code=" + miConfig.Code +
5318
-				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&med_type=" + order.MedType
5318
+				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
5319 5319
 			resp, requestErr := http.Get(api)
5320 5320
 			if requestErr != nil {
5321 5321
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -5324,14 +5324,14 @@ func (c *HisApiController) GetSettleAccounts() {
5324 5324
 
5325 5325
 			body, ioErr := ioutil.ReadAll(resp.Body)
5326 5326
 			if ioErr != nil {
5327
-				//utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
5328
-				//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5327
+				utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
5328
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5329 5329
 				return
5330 5330
 			}
5331 5331
 			var respJSON map[string]interface{}
5332 5332
 			if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
5333
-				//utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
5334
-				//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5333
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
5334
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5335 5335
 				return
5336 5336
 			}
5337 5337
 
@@ -5340,15 +5340,11 @@ func (c *HisApiController) GetSettleAccounts() {
5340 5340
 			fmt.Println("log")
5341 5341
 			fmt.Println(string(result))
5342 5342
 			if err := json.Unmarshal([]byte(result), &res); err != nil {
5343
-				//utils.ErrorLog("解析失败:%v", err)
5344
-				//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5343
+				utils.ErrorLog("解析失败:%v", err)
5344
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5345 5345
 				return
5346 5346
 			}
5347 5347
 
5348
-			c.ServeSuccessJSON(map[string]interface{}{
5349
-				"msg": "成功",
5350
-			})
5351
-
5352 5348
 		} else {
5353 5349
 			result := service.Gdyb5203(baseParams, businessParams)
5354 5350
 			var dat map[string]interface{}
@@ -5363,97 +5359,97 @@ func (c *HisApiController) GetSettleAccounts() {
5363 5359
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
5364 5360
 				return
5365 5361
 			}
5362
+		}
5366 5363
 
5367
-			printor_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
5368
-			charge_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, order.Creator)
5364
+		printor_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
5365
+		charge_admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, order.Creator)
5369 5366
 
5370
-			patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, order.PatientId, order.SettleAccountsDate)
5371
-			adminRole_two, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
5367
+		patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, order.PatientId, order.SettleAccountsDate)
5368
+		adminRole_two, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
5372 5369
 
5373
-			roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
5370
+		roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
5374 5371
 
5375
-			var doctor_name string
5376
-			if roles.ID == 0 {
5377
-				doctor_name = "管理员"
5378
-			} else {
5379
-				doctor_name = roles.UserName
5380
-			}
5372
+		var doctor_name string
5373
+		if roles.ID == 0 {
5374
+			doctor_name = "管理员"
5375
+		} else {
5376
+			doctor_name = roles.UserName
5377
+		}
5381 5378
 
5382
-			yiliao_leibie := ""
5379
+		yiliao_leibie := ""
5383 5380
 
5384
-			switch order.MedType {
5385
-			case "11":
5386
-				yiliao_leibie = "普通门诊"
5387
-				break
5388
-			case "12":
5389
-				yiliao_leibie = "门诊挂号"
5390
-				break
5391
-			case "13":
5392
-				yiliao_leibie = "急诊"
5393
-				break
5394
-			case "14":
5395
-				yiliao_leibie = "门诊特殊病"
5396
-				break
5397
-			case "15":
5398
-				yiliao_leibie = "门诊统筹"
5399
-				break
5400
-			case "16":
5401
-				yiliao_leibie = "门诊慢性病"
5402
-				break
5403
-			case "21":
5404
-				yiliao_leibie = "普通住院"
5405
-				break
5406
-			}
5407
-			departments, _ := service.GetDepartMentDetail(patientPrescription.Departments)
5381
+		switch order.MedType {
5382
+		case "11":
5383
+			yiliao_leibie = "普通门诊"
5384
+			break
5385
+		case "12":
5386
+			yiliao_leibie = "门诊挂号"
5387
+			break
5388
+		case "13":
5389
+			yiliao_leibie = "急诊"
5390
+			break
5391
+		case "14":
5392
+			yiliao_leibie = "门诊特殊病"
5393
+			break
5394
+		case "15":
5395
+			yiliao_leibie = "门诊统筹"
5396
+			break
5397
+		case "16":
5398
+			yiliao_leibie = "门诊慢性病"
5399
+			break
5400
+		case "21":
5401
+			yiliao_leibie = "普通住院"
5402
+			break
5403
+		}
5404
+		departments, _ := service.GetDepartMentDetail(patientPrescription.Departments)
5408 5405
 
5409
-			if res.Infcode == 0 {
5410
-				c.ServeSuccessJSON(map[string]interface{}{
5411
-					"diagnosis":                                   name,
5412
-					"order_infos":                                 orderInfos,
5413
-					"number":                                      order.MdtrtId,
5414
-					"date":                                        order.SettleAccountsDate,
5415
-					"charge_admin":                                charge_admin,
5416
-					"printor_admin":                               printor_admin,
5417
-					"info":                                        res.Output.Setlinfo,
5418
-					"bedCostTotal":                                bedCostTotal,
5419
-					"bedCostSelfTotal":                            bedCostSelfTotal,
5420
-					"bedCostPartSelfTotal":                        bedCostPartSelfTotal,
5421
-					"operationCostTotal":                          operationCostTotal,
5422
-					"operationCostSelfTotal":                      operationCostSelfTotal,
5423
-					"operationCostPartSelfTotal":                  operationCostPartSelfTotal,
5424
-					"otherCostTotal":                              otherCostTotal,
5425
-					"otherCostSelfTotal":                          otherCostSelfTotal,
5426
-					"otherCostPartSelfTotal":                      otherCostPartSelfTotal,
5427
-					"materialCostTotal":                           materialCostTotal,
5428
-					"materialCostSelfTotal":                       materialCostSelfTotal,
5429
-					"materialCostPartSelfTotal":                   materialCostPartSelfTotal,
5430
-					"westernMedicineCostTotal":                    westernMedicineCostTotal,
5431
-					"westernMedicineCostSelfTotal":                westernMedicineCostSelfTotal,
5432
-					"westernMedicineCostPartSelfTotal":            westernMedicineCostPartSelfTotal,
5433
-					"chineseTraditionalMedicineCostTotal":         chineseTraditionalMedicineCostTotal,
5434
-					"chineseTraditionalMedicineCostSelfTotal":     chineseTraditionalMedicineCostSelfTotal,
5435
-					"chineseTraditionalMedicineCostPartSelfTotal": chineseTraditionalMedicineCostPartSelfTotal,
5436
-					"checkCostTotal":                              checkCostTotal,
5437
-					"checkCostSelfTotal":                          checkCostSelfTotal,
5438
-					"checkCostPartSelfTotal":                      checkCostPartSelfTotal,
5439
-					"laboratoryCostTotal":                         laboratoryCostTotal,
5440
-					"laboratoryCostSelfTotal":                     laboratoryCostSelfTotal,
5441
-					"laboratoryCostPartSelfTotal":                 laboratoryCostPartSelfTotal,
5442
-					"treatCostTotal":                              treatCostTotal,
5443
-					"treatCostSelfTotal":                          treatCostSelfTotal,
5444
-					"treatCostPartSelfTotal":                      treatCostPartSelfTotal,
5445
-					"doctor_code":                                 adminRole_two.DoctorCode,
5446
-					"doctor_name":                                 doctor_name,
5447
-					"health_card_no":                              order.PsnNo,
5448
-					"department":                                  departments.Name,
5449
-					"yiliao_leibie":                               yiliao_leibie,
5450
-					"after_money":                                 order.AccountPrice,
5451
-					"patient":                                     patient,
5452
-					"org_name":                                    miConfig.OrgName,
5453
-					"org_code":                                    miConfig.Code,
5454
-					"order_number":                                order.Number,
5455
-				})
5456
-			}
5406
+		if res.Infcode == 0 {
5407
+			c.ServeSuccessJSON(map[string]interface{}{
5408
+				"diagnosis":                                   name,
5409
+				"order_infos":                                 orderInfos,
5410
+				"number":                                      order.MdtrtId,
5411
+				"date":                                        order.SettleAccountsDate,
5412
+				"charge_admin":                                charge_admin,
5413
+				"printor_admin":                               printor_admin,
5414
+				"info":                                        res.Output.Setlinfo,
5415
+				"bedCostTotal":                                bedCostTotal,
5416
+				"bedCostSelfTotal":                            bedCostSelfTotal,
5417
+				"bedCostPartSelfTotal":                        bedCostPartSelfTotal,
5418
+				"operationCostTotal":                          operationCostTotal,
5419
+				"operationCostSelfTotal":                      operationCostSelfTotal,
5420
+				"operationCostPartSelfTotal":                  operationCostPartSelfTotal,
5421
+				"otherCostTotal":                              otherCostTotal,
5422
+				"otherCostSelfTotal":                          otherCostSelfTotal,
5423
+				"otherCostPartSelfTotal":                      otherCostPartSelfTotal,
5424
+				"materialCostTotal":                           materialCostTotal,
5425
+				"materialCostSelfTotal":                       materialCostSelfTotal,
5426
+				"materialCostPartSelfTotal":                   materialCostPartSelfTotal,
5427
+				"westernMedicineCostTotal":                    westernMedicineCostTotal,
5428
+				"westernMedicineCostSelfTotal":                westernMedicineCostSelfTotal,
5429
+				"westernMedicineCostPartSelfTotal":            westernMedicineCostPartSelfTotal,
5430
+				"chineseTraditionalMedicineCostTotal":         chineseTraditionalMedicineCostTotal,
5431
+				"chineseTraditionalMedicineCostSelfTotal":     chineseTraditionalMedicineCostSelfTotal,
5432
+				"chineseTraditionalMedicineCostPartSelfTotal": chineseTraditionalMedicineCostPartSelfTotal,
5433
+				"checkCostTotal":                              checkCostTotal,
5434
+				"checkCostSelfTotal":                          checkCostSelfTotal,
5435
+				"checkCostPartSelfTotal":                      checkCostPartSelfTotal,
5436
+				"laboratoryCostTotal":                         laboratoryCostTotal,
5437
+				"laboratoryCostSelfTotal":                     laboratoryCostSelfTotal,
5438
+				"laboratoryCostPartSelfTotal":                 laboratoryCostPartSelfTotal,
5439
+				"treatCostTotal":                              treatCostTotal,
5440
+				"treatCostSelfTotal":                          treatCostSelfTotal,
5441
+				"treatCostPartSelfTotal":                      treatCostPartSelfTotal,
5442
+				"doctor_code":                                 adminRole_two.DoctorCode,
5443
+				"doctor_name":                                 doctor_name,
5444
+				"health_card_no":                              order.PsnNo,
5445
+				"department":                                  departments.Name,
5446
+				"yiliao_leibie":                               yiliao_leibie,
5447
+				"after_money":                                 order.AccountPrice,
5448
+				"patient":                                     patient,
5449
+				"org_name":                                    miConfig.OrgName,
5450
+				"org_code":                                    miConfig.Code,
5451
+				"order_number":                                order.Number,
5452
+			})
5457 5453
 		}
5458 5454
 	}
5459 5455