浏览代码

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

csx 4 年前
父节点
当前提交
30e0f901bd
共有 7 个文件被更改,包括 287 次插入207 次删除
  1. 2 2
      conf/app.conf
  2. 161 78
      controllers/sz/sz_his_api_controller.go
  3. 59 53
      models/drug.go
  4. 39 35
      models/his_models.go
  5. 2 0
      models/sz_his_models.go
  6. 1 2
      service/his_project_service.go
  7. 23 37
      service/sz_his_service.go

+ 2 - 2
conf/app.conf 查看文件

@@ -50,7 +50,7 @@ httpdomain = https://api.xt.kuyicloud.com
50 50
 sso_domain = https://sso.kuyicloud.com
51 51
 call_domain = https://hf.sgjyun.com
52 52
 front_end_domain = "https://xt.kuyicloud.com/#"
53
-
53
+url = "http://192.168.1.88:6666/szsi-portal/transData"
54 54
 readmysqlhost = shengws1.mysql.rds.aliyuncs.com
55 55
 readmysqlport = 3306
56 56
 readmysqluser = syh
@@ -149,7 +149,7 @@ call_domain = http://hf.szjkhd.com
149 149
 front_end_domain = "http://xt.test.sgjyun.com/#"
150 150
 
151 151
 org_id = 9538
152
-
152
+url  = "http://192.168.1.228:17001/szsi-portal/transData"
153 153
 
154 154
 readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
155 155
 readmysqlport = 3306

+ 161 - 78
controllers/sz/sz_his_api_controller.go 查看文件

@@ -330,8 +330,6 @@ func SZHisManagerApiRegistRouters() {
330 330
 	beego.Router("/sz/api/register/get", &SZHisApiController{}, "get:GetRegisterInfo")
331 331
 	//上传明细,预结算
332 332
 	//beego.Router("/sz/api/upload/get", &SZHisApiController{}, "get:GetUploadInfo")
333
-	//获取个人信息
334
-	//beego.Router("/sz/api/info/get", &SZHisApiController{}, /**/"get:GetInfo")
335 333
 
336 334
 	//结算
337 335
 	beego.Router("/sz/api/settle/get", &SZHisApiController{}, "get:GetSettleInfo")
@@ -3378,8 +3376,6 @@ func (c *SZHisApiController) GetDrugList() {
3378 3376
 	orgId := adminUserInfo.CurrentOrgId
3379 3377
 	admin_user_id, _ := c.GetInt64("admin_user_id")
3380 3378
 	roles, _ := service.GetAdminUserInfoByID(orgId, admin_user_id)
3381
-	fmt.Println("222222222222", roles)
3382
-	fmt.Println("rolessssssss", roles.UserName)
3383 3379
 	ids := c.GetString("ids")
3384 3380
 
3385 3381
 	stringarr := strings.Split(ids, ",")
@@ -3395,14 +3391,6 @@ func (c *SZHisApiController) GetDrugList() {
3395 3391
 
3396 3392
 	//获取药品剂型
3397 3393
 	drugs, _ := service.GetDrugDosageForm(orgId)
3398
-	for _, item := range list {
3399
-
3400
-		for _, it := range drugs {
3401
-			if item.DrugDosageForm == it.Value {
3402
-				item.DrugDosageName = it.Name
3403
-			}
3404
-		}
3405
-	}
3406 3394
 	miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
3407 3395
 	var doctor_name string
3408 3396
 	var doctor_code string
@@ -3411,12 +3399,13 @@ func (c *SZHisApiController) GetDrugList() {
3411 3399
 	doctor_code = "1001"
3412 3400
 
3413 3401
 	var isSuccess bool = true
3414
-
3402
+	timeLayout := "20060102"
3415 3403
 	//这里就可以查看开始和结束了
3416 3404
 	for _, item := range list {
3417
-		detail := &models.DrugDetail{
3405
+		recordDate := time.Unix(item.RecordDate, 0).Format(timeLayout)
3418 3406
 
3419
-			MedicalInsuranceNumber: item.MedicalInsuranceNumber,
3407
+		detail := &models.DrugDetail{
3408
+			MedicalInsuranceNumber: item.SocialSecurityDirectoryCode,
3420 3409
 			Code:             item.Code,
3421 3410
 			DrugName:         item.DrugName,
3422 3411
 			DrugSpec:         item.DrugSpec,
@@ -3426,6 +3415,14 @@ func (c *SZHisApiController) GetDrugList() {
3426 3415
 			RetailPrice:      item.RetailPrice,
3427 3416
 			LastPrice:        item.LastPrice,
3428 3417
 			LimitRemark:      item.LimitRemark,
3418
+			PrescriptionMark: strconv.FormatInt(item.PrescriptionMark, 10),
3419
+			RecordDate:       recordDate,
3420
+		}
3421
+
3422
+		for _, it := range drugs {
3423
+			if item.DrugDosageForm == it.Value {
3424
+				detail.DrugDosageName = it.Code
3425
+			}
3429 3426
 		}
3430 3427
 
3431 3428
 		result := service.SzybML008(doctor_name, doctor_code, miConfig.Code, detail)
@@ -3462,11 +3459,17 @@ func (c *SZHisApiController) GetDrugList() {
3462 3459
 			return
3463 3460
 		}
3464 3461
 		fmt.Println(isSuccess)
3462
+
3463
+		c.ServeSuccessJSON(map[string]interface{}{
3464
+			"failed_code": -10,
3465
+			"msg":         res.Transreturnmessage,
3466
+		})
3467
+		return
3465 3468
 	}
3466 3469
 }
3467 3470
 
3468 3471
 func (c *SZHisApiController) GetTreatmentProject() {
3469
-	fmt.Println("触发了吗2222222222")
3472
+
3470 3473
 	adminUserInfo := c.GetAdminUserInfo()
3471 3474
 	orgId := adminUserInfo.CurrentOrgId
3472 3475
 
@@ -3480,28 +3483,33 @@ func (c *SZHisApiController) GetTreatmentProject() {
3480 3483
 		id := int64(itemsss)
3481 3484
 		idss = append(idss, id)
3482 3485
 	}
3483
-	fmt.Println("idsss", idss)
3486
+
3484 3487
 	//获取项目库数据
3485
-	//list, _ := service.GetMyPorjecgList(orgId)
3488
+
3486 3489
 	list, _ := service.GetBathchMyPorjecgList(idss)
3487
-	fmt.Println("list2222222222", list)
3490
+
3488 3491
 	miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
3489 3492
 	var doctor_name string
3490 3493
 	var doctor_code string
3491 3494
 	doctor_name = roles.UserName
3492 3495
 	doctor_code = "1001"
3493 3496
 	var isSuccess bool = true
3497
+
3494 3498
 	for _, item := range list {
3499
+
3495 3500
 		detail := &models.MyHisProject{
3496 3501
 			MedicalCode: item.MedicalCode, //社保目录
3497 3502
 			ProjectName: item.ProjectName,
3498 3503
 			Price:       item.Price,
3499 3504
 			Category:    item.Category,
3500 3505
 			Remark:      item.Remark,
3506
+			SocialSecurityDirectoryCode: item.SocialSecurityDirectoryCode,
3507
+			SpecailProject:              item.SpecailProject,
3508
+			RecordDate:                  item.RecordDate,
3501 3509
 		}
3502 3510
 
3503 3511
 		result := service.SzybML009(doctor_name, doctor_code, miConfig.Code, detail)
3504
-		fmt.Println("reuslt9999999999999999", result)
3512
+
3505 3513
 		var dat map[string]interface{}
3506 3514
 		if err := json.Unmarshal([]byte(result), &dat); err == nil {
3507 3515
 			fmt.Println(dat)
@@ -3523,7 +3531,7 @@ func (c *SZHisApiController) GetTreatmentProject() {
3523 3531
 		if res.Transreturncode == "00000000" {
3524 3532
 			//备案成功返回状态值
3525 3533
 			_, err := service.UpdateProjectById(item.ID)
3526
-			fmt.Println("err22222", err)
3534
+			fmt.Println("err", err)
3527 3535
 		} else {
3528 3536
 			isSuccess = false
3529 3537
 			//失败
@@ -3534,6 +3542,11 @@ func (c *SZHisApiController) GetTreatmentProject() {
3534 3542
 			return
3535 3543
 		}
3536 3544
 		fmt.Println(isSuccess)
3545
+		c.ServeSuccessJSON(map[string]interface{}{
3546
+			"failed_code": -10,
3547
+			"msg":         res.Transreturnmessage,
3548
+		})
3549
+		return
3537 3550
 	}
3538 3551
 
3539 3552
 }
@@ -3548,7 +3561,7 @@ func (c *SZHisApiController) GetRevocation() {
3548 3561
 	//用来区分是药品的撤销还是耗材的撤销  1.药品  2.诊疗项目 3.材料 5.辅助器具项目
3549 3562
 	is_mark, _ := c.GetInt64("is_mark")
3550 3563
 	type_id, _ := c.GetInt64("type_id")
3551
-	fmt.Println("type_id2222222", type_id)
3564
+
3552 3565
 	if type_id == 1 {
3553 3566
 		//撤销
3554 3567
 		if is_mark == 1 {
@@ -3585,7 +3598,7 @@ func (c *SZHisApiController) GetRevocation() {
3585 3598
 				fmt.Println(list[start-1 : stop])
3586 3599
 				var customs []*models.DrugDetail
3587 3600
 				for _, item := range list {
3588
-					fmt.Println("医疗机构编码", item.MedicalInsuranceNumber, item.Code)
3601
+
3589 3602
 					detail := &models.DrugDetail{
3590 3603
 
3591 3604
 						SocialSecurityDirectoryCode: item.MedicalInsuranceNumber, //社保目录
@@ -3623,7 +3636,7 @@ func (c *SZHisApiController) GetRevocation() {
3623 3636
 				if res.Transreturncode == "00000000" {
3624 3637
 					//撤销成功
3625 3638
 					_, err := service.UpdateDrugByIdDetail(id)
3626
-					fmt.Println("err22222", err)
3639
+					fmt.Println("err", err)
3627 3640
 				} else {
3628 3641
 					isSuccess = false
3629 3642
 					//失败
@@ -3635,6 +3648,11 @@ func (c *SZHisApiController) GetRevocation() {
3635 3648
 					return
3636 3649
 				}
3637 3650
 				fmt.Println(isSuccess)
3651
+				c.ServeSuccessJSON(map[string]interface{}{
3652
+					"failed_code": -10,
3653
+					"msg":         res.Transreturnmessage,
3654
+				})
3655
+				return
3638 3656
 			}
3639 3657
 
3640 3658
 		}
@@ -3644,21 +3662,12 @@ func (c *SZHisApiController) GetRevocation() {
3644 3662
 
3645 3663
 			adminUserInfo := c.GetAdminUserInfo()
3646 3664
 			orgId := adminUserInfo.CurrentOrgId
3647
-			fmt.Println(orgId)
3665
+
3648 3666
 			//获取药品库数据
3649 3667
 			list, _ := service.GetDrugListByDetail(orgId, id)
3650 3668
 			//获取药品剂型
3651 3669
 			drugs, _ := service.GetDrugDosageForm(orgId)
3652
-			for _, item := range list {
3653
-				fmt.Println(item.DrugDosageForm)
3654
-				for _, it := range drugs {
3655 3670
 
3656
-					if item.DrugDosageForm == it.Value {
3657
-						item.DrugDosageName = it.Name
3658
-					}
3659
-				}
3660
-			}
3661
-			fmt.Print("长度", len(list))
3662 3671
 			miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
3663 3672
 			var doctor_name string
3664 3673
 			var doctor_code string
@@ -3670,7 +3679,7 @@ func (c *SZHisApiController) GetRevocation() {
3670 3679
 
3671 3680
 			//这里就可以查看开始和结束了
3672 3681
 			for _, item := range list {
3673
-				fmt.Print("长度", item.MedicalInsuranceNumber, item.Code)
3682
+
3674 3683
 				detail := &models.DrugDetail{
3675 3684
 					MedicalInsuranceNumber:      item.MedicalInsuranceNumber,
3676 3685
 					SocialSecurityDirectoryCode: item.MedicalInsuranceNumber,
@@ -3685,6 +3694,13 @@ func (c *SZHisApiController) GetRevocation() {
3685 3694
 					LimitRemark:      item.LimitRemark,
3686 3695
 				}
3687 3696
 
3697
+				for _, it := range drugs {
3698
+
3699
+					if item.DrugDosageForm == it.Value {
3700
+						detail.DrugDosageName = it.Code
3701
+					}
3702
+				}
3703
+
3688 3704
 				result := service.SzybML008(doctor_name, doctor_code, miConfig.Code, detail)
3689 3705
 
3690 3706
 				var dat map[string]interface{}
@@ -3712,13 +3728,18 @@ func (c *SZHisApiController) GetRevocation() {
3712 3728
 					fmt.Println("err", err)
3713 3729
 				}
3714 3730
 				fmt.Println(isSuccess)
3731
+				c.ServeSuccessJSON(map[string]interface{}{
3732
+					"failed_code": -10,
3733
+					"msg":         res.Transreturnmessage,
3734
+				})
3735
+				return
3715 3736
 			}
3716 3737
 
3717 3738
 		}
3718 3739
 	}
3719 3740
 
3720 3741
 	if type_id == 2 {
3721
-		fmt.Println("222222222222222q2")
3742
+
3722 3743
 		//撤销
3723 3744
 		if is_mark == 1 {
3724 3745
 			//获取药品库数据
@@ -3794,9 +3815,14 @@ func (c *SZHisApiController) GetRevocation() {
3794 3815
 					return
3795 3816
 				}
3796 3817
 				fmt.Println(isSuccess)
3818
+				c.ServeSuccessJSON(map[string]interface{}{
3819
+					"failed_code": -10,
3820
+					"msg":         res.Transreturnmessage,
3821
+				})
3822
+				return
3797 3823
 			}
3798 3824
 		}
3799
-		fmt.Println("is_marke", is_mark)
3825
+
3800 3826
 		//备案
3801 3827
 		if is_mark == 0 {
3802 3828
 
@@ -3822,7 +3848,7 @@ func (c *SZHisApiController) GetRevocation() {
3822 3848
 				}
3823 3849
 
3824 3850
 				result := service.SzybML009(doctor_name, doctor_code, miConfig.Code, detail)
3825
-				fmt.Println("reuslt9999999999999999", result)
3851
+				fmt.Println("reuslt", result)
3826 3852
 				var dat map[string]interface{}
3827 3853
 				if err := json.Unmarshal([]byte(result), &dat); err == nil {
3828 3854
 					fmt.Println(dat)
@@ -3844,7 +3870,7 @@ func (c *SZHisApiController) GetRevocation() {
3844 3870
 				if res.Transreturncode == "00000000" {
3845 3871
 					//备案成功返回状态值
3846 3872
 					_, err := service.UpdateProjectById(item.ID)
3847
-					fmt.Println("err22222", err)
3873
+					fmt.Println("err", err)
3848 3874
 				} else {
3849 3875
 					isSuccess = false
3850 3876
 					//失败
@@ -3856,6 +3882,11 @@ func (c *SZHisApiController) GetRevocation() {
3856 3882
 					return
3857 3883
 				}
3858 3884
 				fmt.Println(isSuccess)
3885
+				c.ServeSuccessJSON(map[string]interface{}{
3886
+					"failed_code": -10,
3887
+					"msg":         res.Transreturnmessage,
3888
+				})
3889
+				return
3859 3890
 			}
3860 3891
 		}
3861 3892
 	}
@@ -3936,6 +3967,11 @@ func (c *SZHisApiController) GetRevocation() {
3936 3967
 					return
3937 3968
 				}
3938 3969
 				fmt.Println(isSuccess)
3970
+				c.ServeSuccessJSON(map[string]interface{}{
3971
+					"failed_code": -10,
3972
+					"msg":         res.Transreturnmessage,
3973
+				})
3974
+				return
3939 3975
 			}
3940 3976
 		}
3941 3977
 		//备案
@@ -3943,10 +3979,10 @@ func (c *SZHisApiController) GetRevocation() {
3943 3979
 
3944 3980
 			adminUserInfo := c.GetAdminUserInfo()
3945 3981
 			orgId := adminUserInfo.CurrentOrgId
3946
-			fmt.Println("3344555555555", orgId)
3982
+
3947 3983
 			//获取所有耗材信息
3948 3984
 			list, _ := service.GetGoodListByDetail(orgId, id)
3949
-			fmt.Println("list22222", list)
3985
+
3950 3986
 			//获取单位
3951 3987
 			miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
3952 3988
 			var doctor_name string
@@ -3957,7 +3993,7 @@ func (c *SZHisApiController) GetRevocation() {
3957 3993
 
3958 3994
 			var isSuccess bool = true
3959 3995
 			for _, item := range list {
3960
-				fmt.Println("生产厂商", item.ManufacturerName)
3996
+
3961 3997
 				detail := &models.XtGoodInformation{
3962 3998
 					GoodName:                    item.GoodName,
3963 3999
 					SocialSecurityDirectoryCode: item.SocialSecurityDirectoryCode,
@@ -3971,7 +4007,7 @@ func (c *SZHisApiController) GetRevocation() {
3971 4007
 				}
3972 4008
 
3973 4009
 				result := service.SzybYML007(doctor_name, doctor_code, miConfig.Code, detail)
3974
-				fmt.Println("reuslt8888", result)
4010
+				fmt.Println("reuslt", result)
3975 4011
 				var dat map[string]interface{}
3976 4012
 				if err := json.Unmarshal([]byte(result), &dat); err == nil {
3977 4013
 					fmt.Println(dat)
@@ -3984,22 +4020,33 @@ func (c *SZHisApiController) GetRevocation() {
3984 4020
 				var res Result
3985 4021
 				if err := json.Unmarshal(userJSONBytes, &res); err != nil {
3986 4022
 					utils.ErrorLog("解析失败:%v", err)
3987
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4023
+					c.ServeSuccessJSON(map[string]interface{}{
4024
+						"failed_code": -10,
4025
+						"msg":         res.Transreturnmessage,
4026
+					})
3988 4027
 					return
3989 4028
 				}
3990 4029
 				if res.Transreturncode == "00000000" {
3991 4030
 
3992 4031
 					//备案成功返回状态
3993 4032
 					_, err := service.UpdateGoodInformaitonByDetail(item.ID)
3994
-					fmt.Println("err2222222", err)
4033
+					fmt.Println("err", err)
3995 4034
 				} else {
3996 4035
 					isSuccess = false
3997 4036
 					//失败
3998 4037
 
3999
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugPreSettleFaildParamWrong)
4038
+					c.ServeSuccessJSON(map[string]interface{}{
4039
+						"failed_code": -10,
4040
+						"msg":         res.Transreturnmessage,
4041
+					})
4000 4042
 					return
4001 4043
 				}
4002 4044
 				fmt.Println(isSuccess)
4045
+				c.ServeSuccessJSON(map[string]interface{}{
4046
+					"failed_code": -10,
4047
+					"msg":         res.Transreturnmessage,
4048
+				})
4049
+				return
4003 4050
 			}
4004 4051
 		}
4005 4052
 
@@ -4011,9 +4058,9 @@ func (c *SZHisApiController) GetDoctorList() {
4011 4058
 
4012 4059
 	adminUserInfo := c.GetAdminUserInfo()
4013 4060
 	orgid := adminUserInfo.CurrentOrgId
4014
-	fmt.Println("or3gi", orgid)
4061
+
4015 4062
 	ids := c.GetString("ids")
4016
-	fmt.Println("ids2222222222", ids)
4063
+
4017 4064
 	admin_user_id, _ := c.GetInt64("admin_user_id")
4018 4065
 	roles, _ := service.GetAdminUserInfoByID(orgid, admin_user_id)
4019 4066
 	stringarr := strings.Split(ids, ",")
@@ -4027,7 +4074,7 @@ func (c *SZHisApiController) GetDoctorList() {
4027 4074
 	//list, _ := service.GetDoctorList(orgid)
4028 4075
 	//批量查询
4029 4076
 	list, _ := service.GetBatchDoctorList(idss)
4030
-	fmt.Println("list22222222222", list)
4077
+
4031 4078
 	//获取所有角色名称
4032 4079
 	roleList, _ := service.GetRoleList(orgid)
4033 4080
 
@@ -4048,7 +4095,7 @@ func (c *SZHisApiController) GetDoctorList() {
4048 4095
 	var isSuccess bool = true
4049 4096
 
4050 4097
 	for _, item := range list {
4051
-		fmt.Println("医护类别", item.StudyMajorName)
4098
+
4052 4099
 		detail := &models.DocDetail{
4053 4100
 			UserName:                     item.UserName,                               //医护姓名
4054 4101
 			RoleId:                       item.Name,                                   //医护人员类别
@@ -4057,7 +4104,7 @@ func (c *SZHisApiController) GetDoctorList() {
4057 4104
 			IdCard:                       item.IdCard,                                 //证件号码
4058 4105
 			Phone:                        item.Mobile,                                 //联系电话
4059 4106
 			WorkMajorName:                item.WorkMajorName,                          // 现从事专业名称
4060
-			Nation:                       item.Nation,                                 //民族
4107
+			Nation:                       "1",                                         //民族
4061 4108
 			BirthDay:                     20201022,                                    // 出生日期
4062 4109
 			WorkTime:                     20201022,                                    //参加工作日期
4063 4110
 			Education:                    strconv.FormatInt(item.Education, 10),       //学历
@@ -4092,7 +4139,7 @@ func (c *SZHisApiController) GetDoctorList() {
4092 4139
 		}
4093 4140
 
4094 4141
 		result := service.SzybYS001(doctor_name, doctor_code, miConfig.Code, detail)
4095
-		fmt.Println("reuslt9999999999999999", result)
4142
+		fmt.Println("reuslt", result)
4096 4143
 		var dat map[string]interface{}
4097 4144
 		if err := json.Unmarshal([]byte(result), &dat); err == nil {
4098 4145
 			fmt.Println(dat)
@@ -4105,13 +4152,16 @@ func (c *SZHisApiController) GetDoctorList() {
4105 4152
 		var res Result
4106 4153
 		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4107 4154
 			utils.ErrorLog("解析失败:%v", err)
4108
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4155
+			c.ServeSuccessJSON(map[string]interface{}{
4156
+				"failed_code": -10,
4157
+				"msg":         res.Transreturnmessage,
4158
+			})
4109 4159
 			return
4110 4160
 		}
4111 4161
 		if res.Transreturncode == "00000000" {
4112 4162
 			//批量插入数据
4113 4163
 			_, err := service.UpdateAdminUserRoleById(item.AdminUserId, orgid)
4114
-			fmt.Println("err2222", err)
4164
+			fmt.Println("err", err)
4115 4165
 		} else {
4116 4166
 			isSuccess = false
4117 4167
 			//失败
@@ -4123,6 +4173,11 @@ func (c *SZHisApiController) GetDoctorList() {
4123 4173
 			return
4124 4174
 		}
4125 4175
 		fmt.Println(isSuccess)
4176
+		c.ServeSuccessJSON(map[string]interface{}{
4177
+			"failed_code": -10,
4178
+			"msg":         res.Transreturnmessage,
4179
+		})
4180
+		return
4126 4181
 	}
4127 4182
 
4128 4183
 }
@@ -4133,14 +4188,14 @@ func (c *SZHisApiController) GetMedicalList() {
4133 4188
 	orgId := adminUserInfo.CurrentOrgId
4134 4189
 
4135 4190
 	id, _ := c.GetInt64("id")
4136
-	fmt.Println("id22222222", id)
4191
+
4137 4192
 	is_mark, _ := c.GetInt64("is_mark")
4138 4193
 	admin_user_id, _ := c.GetInt64("admin_user_id")
4139 4194
 	roles, _ := service.GetAdminUserInfoByID(orgId, admin_user_id)
4140 4195
 	//去登记
4141 4196
 	if is_mark == 0 {
4142 4197
 		list, _ := service.GetDoctorListByDetail(orgId, id)
4143
-		fmt.Println("list22222222222", list)
4198
+
4144 4199
 		//获取所有角色名称
4145 4200
 		roleList, _ := service.GetRoleList(orgId)
4146 4201
 
@@ -4161,7 +4216,6 @@ func (c *SZHisApiController) GetMedicalList() {
4161 4216
 		var isSuccess bool = true
4162 4217
 
4163 4218
 		for _, item := range list {
4164
-			fmt.Println("医护类别", item.Mobile)
4165 4219
 
4166 4220
 			detail := &models.DocDetail{
4167 4221
 				UserName:                     item.UserName,                               //医护姓名
@@ -4205,7 +4259,7 @@ func (c *SZHisApiController) GetMedicalList() {
4205 4259
 				EndTime:                                 0,                                                                   // 结束日期
4206 4260
 			}
4207 4261
 			result := service.SzybYS001(doctor_name, doctor_code, miConfig.Code, detail)
4208
-			fmt.Println("reuslt9999999999999999", result)
4262
+
4209 4263
 			var dat map[string]interface{}
4210 4264
 			if err := json.Unmarshal([]byte(result), &dat); err == nil {
4211 4265
 				fmt.Println(dat)
@@ -4218,7 +4272,10 @@ func (c *SZHisApiController) GetMedicalList() {
4218 4272
 			var res Result
4219 4273
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4220 4274
 				utils.ErrorLog("解析失败:%v", err)
4221
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4275
+				c.ServeSuccessJSON(map[string]interface{}{
4276
+					"failed_code": -10,
4277
+					"msg":         res.Transreturnmessage,
4278
+				})
4222 4279
 				return
4223 4280
 			}
4224 4281
 			if res.Transreturncode == "00000000" {
@@ -4236,6 +4293,11 @@ func (c *SZHisApiController) GetMedicalList() {
4236 4293
 				return
4237 4294
 			}
4238 4295
 			fmt.Println(isSuccess)
4296
+			c.ServeSuccessJSON(map[string]interface{}{
4297
+				"failed_code": -10,
4298
+				"msg":         res.Transreturnmessage,
4299
+			})
4300
+			return
4239 4301
 		}
4240 4302
 	}
4241 4303
 
@@ -4262,7 +4324,6 @@ func (c *SZHisApiController) GetMedicalList() {
4262 4324
 
4263 4325
 		var isSuccess bool = true
4264 4326
 		for _, item := range list {
4265
-			fmt.Println("医护类别", item.Name)
4266 4327
 			detail := &models.DocDetail{
4267 4328
 				UserName:                     item.UserName,                               //医护姓名
4268 4329
 				RoleId:                       item.Name,                                   //医护人员类别
@@ -4305,7 +4366,7 @@ func (c *SZHisApiController) GetMedicalList() {
4305 4366
 				EndTime:                                 0,                                                                   // 结束日期
4306 4367
 			}
4307 4368
 			result := service.SzybYS002(doctor_name, doctor_code, miConfig.Code, detail)
4308
-			fmt.Println("reuslt9999999999999999", result)
4369
+
4309 4370
 			var dat map[string]interface{}
4310 4371
 			if err := json.Unmarshal([]byte(result), &dat); err == nil {
4311 4372
 				fmt.Println(dat)
@@ -4318,7 +4379,10 @@ func (c *SZHisApiController) GetMedicalList() {
4318 4379
 			var res Result
4319 4380
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4320 4381
 				utils.ErrorLog("解析失败:%v", err)
4321
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4382
+				c.ServeSuccessJSON(map[string]interface{}{
4383
+					"failed_code": -10,
4384
+					"msg":         res.Transreturnmessage,
4385
+				})
4322 4386
 				return
4323 4387
 			}
4324 4388
 			if res.Transreturncode == "00000000" {
@@ -4335,6 +4399,11 @@ func (c *SZHisApiController) GetMedicalList() {
4335 4399
 				return
4336 4400
 			}
4337 4401
 			fmt.Println(isSuccess)
4402
+			c.ServeSuccessJSON(map[string]interface{}{
4403
+				"failed_code": -10,
4404
+				"msg":         res.Transreturnmessage,
4405
+			})
4406
+			return
4338 4407
 
4339 4408
 		}
4340 4409
 	}
@@ -4387,7 +4456,7 @@ func (c *SZHisApiController) GetUpdateMedicalList() {
4387 4456
 		fmt.Println(list[start-1 : stop])
4388 4457
 		var customs []*models.DocDetail
4389 4458
 		for _, item := range list {
4390
-			fmt.Println("医护类别", item.Name)
4459
+
4391 4460
 			detail := &models.DocDetail{
4392 4461
 				StaffCode:                    "",            //医护人员编码
4393 4462
 				UserName:                     item.UserName, //医护人员姓名
@@ -4399,7 +4468,7 @@ func (c *SZHisApiController) GetUpdateMedicalList() {
4399 4468
 				WorkMajorName:                "",            //现从事专业名称
4400 4469
 				Nation:                       "",            //民族
4401 4470
 				BirthDay:                     20201022,      //出生日期
4402
-				WorkTime:                     12,            //参加工作日期
4471
+				WorkTime:                     20201022,      //参加工作日期
4403 4472
 				Education:                    "",            //学历
4404 4473
 				StudyMajorName:               "",            //所学的专业名称
4405 4474
 				CertificateCode:              "",            //证书编码
@@ -4423,17 +4492,17 @@ func (c *SZHisApiController) GetUpdateMedicalList() {
4423 4492
 				PostName:                     "",            //职位名称
4424 4493
 				TechnicalJobLevelCode:        "",            //专业技术职务级别编码
4425 4494
 				IsActive:                     "",            //在职与否
4426
-				PrescriptionQualificationIdentification: "",   //处方资格标识
4427
-				IdentificationOutpatients:               "",   //门诊大病医师标识
4428
-				OutpatientIllnessCategory:               "",   //门诊大病类别
4429
-				StartTime:                               1233, //开始日期
4430
-				EndTime:                                 123333,
4495
+				PrescriptionQualificationIdentification: "",       //处方资格标识
4496
+				IdentificationOutpatients:               "",       //门诊大病医师标识
4497
+				OutpatientIllnessCategory:               "",       //门诊大病类别
4498
+				StartTime:                               20201022, //开始日期
4499
+				EndTime:                                 20201022,
4431 4500
 			}
4432 4501
 			customs = append(customs, detail)
4433 4502
 		}
4434 4503
 
4435 4504
 		result := service.SzybYS003(doctor_name, doctor_code, miConfig.Code, customs)
4436
-		fmt.Println("reuslt9999999999999999", result)
4505
+
4437 4506
 		var dat map[string]interface{}
4438 4507
 		if err := json.Unmarshal([]byte(result), &dat); err == nil {
4439 4508
 			fmt.Println(dat)
@@ -4446,7 +4515,10 @@ func (c *SZHisApiController) GetUpdateMedicalList() {
4446 4515
 		var res Result
4447 4516
 		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4448 4517
 			utils.ErrorLog("解析失败:%v", err)
4449
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4518
+			c.ServeSuccessJSON(map[string]interface{}{
4519
+				"failed_code": -10,
4520
+				"msg":         res.Transreturnmessage,
4521
+			})
4450 4522
 			return
4451 4523
 		}
4452 4524
 		if res.Transreturncode == "00000000" {
@@ -4455,11 +4527,18 @@ func (c *SZHisApiController) GetUpdateMedicalList() {
4455 4527
 			isSuccess = false
4456 4528
 			//失败
4457 4529
 
4458
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugPreSettleFaildParamWrong)
4530
+			c.ServeSuccessJSON(map[string]interface{}{
4531
+				"failed_code": -10,
4532
+				"msg":         res.Transreturnmessage,
4533
+			})
4459 4534
 			return
4460 4535
 		}
4461 4536
 		fmt.Println(isSuccess)
4462
-
4537
+		c.ServeSuccessJSON(map[string]interface{}{
4538
+			"failed_code": -10,
4539
+			"msg":         res.Transreturnmessage,
4540
+		})
4541
+		return
4463 4542
 	}
4464 4543
 }
4465 4544
 
@@ -4469,7 +4548,7 @@ func (c *SZHisApiController) GetGoodsList() {
4469 4548
 	orgId := adminUserInfo.CurrentOrgId
4470 4549
 
4471 4550
 	ids := c.GetString("ids")
4472
-	fmt.Println("ids2222222222", ids)
4551
+
4473 4552
 	admin_user_id, _ := c.GetInt64("admin_user_id")
4474 4553
 	roles, _ := service.GetAdminUserInfoByID(orgId, admin_user_id)
4475 4554
 	stringarr := strings.Split(ids, ",")
@@ -4481,7 +4560,7 @@ func (c *SZHisApiController) GetGoodsList() {
4481 4560
 	}
4482 4561
 	//批量获取所有耗材信息
4483 4562
 	list, _ := service.GetBatchGoodInformationList(idss)
4484
-	fmt.Println("list22222", list)
4563
+
4485 4564
 	//获取单位
4486 4565
 	miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
4487 4566
 	var doctor_name string
@@ -4492,7 +4571,6 @@ func (c *SZHisApiController) GetGoodsList() {
4492 4571
 
4493 4572
 	var isSuccess bool = true
4494 4573
 	for _, item := range list {
4495
-		fmt.Println("生产厂商", item.ManufacturerName)
4496 4574
 		detail := &models.XtGoodInformation{
4497 4575
 			GoodName:                    item.GoodName,
4498 4576
 			SocialSecurityDirectoryCode: item.SocialSecurityDirectoryCode,
@@ -4506,7 +4584,7 @@ func (c *SZHisApiController) GetGoodsList() {
4506 4584
 		}
4507 4585
 
4508 4586
 		result := service.SzybYML007(doctor_name, doctor_code, miConfig.Code, detail)
4509
-		fmt.Println("reuslt8888", result)
4587
+		fmt.Println("reuslt", result)
4510 4588
 		var dat map[string]interface{}
4511 4589
 		if err := json.Unmarshal([]byte(result), &dat); err == nil {
4512 4590
 			fmt.Println(dat)
@@ -4526,7 +4604,7 @@ func (c *SZHisApiController) GetGoodsList() {
4526 4604
 
4527 4605
 			//备案成功返回状态
4528 4606
 			_, err := service.UpdateGoodInformaitonByDetail(item.ID)
4529
-			fmt.Println("err2222222", err)
4607
+			fmt.Println("err", err)
4530 4608
 		} else {
4531 4609
 			isSuccess = false
4532 4610
 			//失败
@@ -4538,6 +4616,11 @@ func (c *SZHisApiController) GetGoodsList() {
4538 4616
 			return
4539 4617
 		}
4540 4618
 		fmt.Println(isSuccess)
4619
+		c.ServeSuccessJSON(map[string]interface{}{
4620
+			"failed_code": -10,
4621
+			"msg":         res.Transreturnmessage,
4622
+		})
4623
+		return
4541 4624
 	}
4542 4625
 }
4543 4626
 

+ 59 - 53
models/drug.go 查看文件

@@ -99,59 +99,65 @@ func (MedicineInsurancePercentage) TableName() string {
99 99
 }
100 100
 
101 101
 type BaseDrugList struct {
102
-	ID                     int64   `gorm:"column:id" json:"id" form:"id"`
103
-	DrugName               string  `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
104
-	Pinyin                 string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
105
-	Wubi                   string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
106
-	DrugAlias              string  `gorm:"column:drug_alias" json:"drug_alias" form:"drug_alias"`
107
-	DrugAliasPinyin        string  `gorm:"column:drug_alias_pinyin" json:"drug_alias_pinyin" form:"drug_alias_pinyin"`
108
-	DrugAliasWubi          string  `gorm:"column:drug_alias_wubi" json:"drug_alias_wubi" form:"drug_alias_wubi"`
109
-	DrugCategory           int64   `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
110
-	DrugSpec               string  `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
111
-	DrugType               int64   `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
112
-	DrugStockLimit         string  `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
113
-	DrugOriginPlace        string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
114
-	DrugDosageForm         int64   `gorm:"column:drug_dosage_form" json:"drug_dosage_form" form:"drug_dosage_form"`
115
-	MedicalInsuranceLevel  int64   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
116
-	MaxUnit                string  `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
117
-	MinUnit                string  `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
118
-	UnitMatrixing          string  `gorm:"column:unit_matrixing" json:"unit_matrixing" form:"unit_matrixing"`
119
-	RetailPrice            float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
120
-	LastPrice              float64 `gorm:"column:last_price" json:"last_price" form:"last_price"`
121
-	DrugControl            int64   `gorm:"column:drug_control" json:"drug_control" form:"drug_control"`
122
-	Number                 string  `gorm:"column:number" json:"number" form:"number"`
123
-	DrugClassify           string  `gorm:"column:drug_classify" json:"drug_classify" form:"drug_classify"`
124
-	DrugDose               float64 `gorm:"column:drug_dose" json:"drug_dose" form:"drug_dose"`
125
-	DrugDoseUnit           int64   `gorm:"column:drug_dose_unit" json:"drug_dose_unit" form:"drug_dose_unit"`
126
-	MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
127
-	Manufacturer           int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
128
-	PharmacologyCategory   int64   `gorm:"column:pharmacology_category" json:"pharmacology_category" form:"pharmacology_category"`
129
-	StatisticsCategory     int64   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
130
-	Code                   string  `gorm:"column:code" json:"code" form:"code"`
131
-	IsSpecialDiseases      int64   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
132
-	IsRecord               int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
133
-	Agent                  string  `gorm:"column:agent" json:"agent" form:"agent"`
134
-	DrugStatus             string  `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
135
-	LimitRemark            string  `gorm:"column:limit_remark" json:"limit_remark" form:"limit_remark"`
136
-	DeliveryWay            string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
137
-	ExecutionFrequency     string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
138
-	SingleDose             float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
139
-	PrescribingNumber      float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
140
-	Label                  int64   `gorm:"column:label" json:"label" form:"label"`
141
-	Sort                   int64   `gorm:"column:sort" json:"sort" form:"sort"`
142
-	IsUseDoctorAdvice      int64   `gorm:"column:is_use_doctor_advice" json:"is_use_doctor_advice" form:"is_use_doctor_advice"`
143
-	IsDefault              int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
144
-	IsChargePredict        int64   `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
145
-	IsStatisticsWork       int64   `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
146
-	IsChargeUse            int64   `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
147
-	Status                 int64   `gorm:"column:status" json:"status" form:"status"`
148
-	Ctime                  int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
149
-	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
150
-	OrgId                  int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
151
-	DrugCode               string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
152
-	Dealer                 int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
153
-	ManufacturerName       string  `gorm:"column:manufacturer_name" json:"manufacturer_name" form:"manufacturer_name"`
154
-	DrugDosageName         string
102
+	ID                          int64   `gorm:"column:id" json:"id" form:"id"`
103
+	DrugName                    string  `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
104
+	Pinyin                      string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
105
+	Wubi                        string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
106
+	DrugAlias                   string  `gorm:"column:drug_alias" json:"drug_alias" form:"drug_alias"`
107
+	DrugAliasPinyin             string  `gorm:"column:drug_alias_pinyin" json:"drug_alias_pinyin" form:"drug_alias_pinyin"`
108
+	DrugAliasWubi               string  `gorm:"column:drug_alias_wubi" json:"drug_alias_wubi" form:"drug_alias_wubi"`
109
+	DrugCategory                int64   `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
110
+	DrugSpec                    string  `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
111
+	DrugType                    int64   `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
112
+	DrugStockLimit              string  `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
113
+	DrugOriginPlace             string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
114
+	DrugDosageForm              int64   `gorm:"column:drug_dosage_form" json:"drug_dosage_form" form:"drug_dosage_form"`
115
+	MedicalInsuranceLevel       int64   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
116
+	MaxUnit                     string  `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
117
+	MinUnit                     string  `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
118
+	UnitMatrixing               string  `gorm:"column:unit_matrixing" json:"unit_matrixing" form:"unit_matrixing"`
119
+	RetailPrice                 float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
120
+	LastPrice                   float64 `gorm:"column:last_price" json:"last_price" form:"last_price"`
121
+	DrugControl                 int64   `gorm:"column:drug_control" json:"drug_control" form:"drug_control"`
122
+	Number                      string  `gorm:"column:number" json:"number" form:"number"`
123
+	DrugClassify                string  `gorm:"column:drug_classify" json:"drug_classify" form:"drug_classify"`
124
+	DrugDose                    float64 `gorm:"column:drug_dose" json:"drug_dose" form:"drug_dose"`
125
+	DrugDoseUnit                int64   `gorm:"column:drug_dose_unit" json:"drug_dose_unit" form:"drug_dose_unit"`
126
+	MedicalInsuranceNumber      string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
127
+	Manufacturer                int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
128
+	PharmacologyCategory        int64   `gorm:"column:pharmacology_category" json:"pharmacology_category" form:"pharmacology_category"`
129
+	StatisticsCategory          int64   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
130
+	Code                        string  `gorm:"column:code" json:"code" form:"code"`
131
+	IsSpecialDiseases           int64   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
132
+	IsRecord                    int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
133
+	Agent                       string  `gorm:"column:agent" json:"agent" form:"agent"`
134
+	DrugStatus                  string  `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
135
+	LimitRemark                 string  `gorm:"column:limit_remark" json:"limit_remark" form:"limit_remark"`
136
+	DeliveryWay                 string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
137
+	ExecutionFrequency          string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
138
+	SingleDose                  float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
139
+	PrescribingNumber           float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
140
+	Label                       int64   `gorm:"column:label" json:"label" form:"label"`
141
+	Sort                        int64   `gorm:"column:sort" json:"sort" form:"sort"`
142
+	IsUseDoctorAdvice           int64   `gorm:"column:is_use_doctor_advice" json:"is_use_doctor_advice" form:"is_use_doctor_advice"`
143
+	IsDefault                   int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
144
+	IsChargePredict             int64   `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
145
+	IsStatisticsWork            int64   `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
146
+	IsChargeUse                 int64   `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
147
+	Status                      int64   `gorm:"column:status" json:"status" form:"status"`
148
+	Ctime                       int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
149
+	Mtime                       int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
150
+	OrgId                       int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
151
+	DrugCode                    string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
152
+	Dealer                      int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
153
+	ManufacturerName            string  `gorm:"column:manufacturer_name" json:"manufacturer_name" form:"manufacturer_name"`
154
+	DrugDosageName              string
155
+	PrescriptionMark            int64  `gorm:"column:prescription_mark" json:"prescription_mark" form:"prescription_mark"`
156
+	RecordDate                  int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
157
+	DrugRemark                  string `gorm:"column:drug_remark" json:"drug_remark" form:"drug_remark"`
158
+	SocialSecurityDirectoryCode string `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
159
+	DoseCode                    string `gorm:"column:dose_code" json:"dose_code" form:"dose_code"`
160
+	IsMark                      int64  `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
155 161
 }
156 162
 
157 163
 type XtGoodInformation struct {

+ 39 - 35
models/his_models.go 查看文件

@@ -1027,6 +1027,7 @@ type XtDrugDataConfig struct {
1027 1027
 	Title          string    `gorm:"column:title" json:"title" form:"title"`
1028 1028
 	Content        string    `gorm:"column:content" json:"content" form:"content"`
1029 1029
 	Orders         int64     `gorm:"column:orders" json:"orders" form:"orders"`
1030
+	Code           string    `gorm:"column:code" json:"code" form:"code"`
1030 1031
 }
1031 1032
 
1032 1033
 func (XtDrugDataConfig) TableName() string {
@@ -1054,41 +1055,44 @@ func (XtRole) TableName() string {
1054 1055
 }
1055 1056
 
1056 1057
 type MyHisProject struct {
1057
-	ID                        int64   `gorm:"column:id" json:"id" form:"id"`
1058
-	ProjectName               string  `gorm:"column:project_name" json:"project_name" form:"project_name"`
1059
-	Pinyin                    string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
1060
-	Wubi                      string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
1061
-	Price                     float64 `gorm:"column:price" json:"price" form:"price"`
1062
-	Unit                      string  `gorm:"column:unit" json:"unit" form:"unit"`
1063
-	CostClassify              int64   `gorm:"column:cost_classify" json:"cost_classify" form:"cost_classify"`
1064
-	ExecutiveSection          int64   `gorm:"column:executive_section" json:"executive_section" form:"executive_section"`
1065
-	MedicalCoverage           int64   `gorm:"column:medical_coverage" json:"medical_coverage" form:"medical_coverage"`
1066
-	StatisticalClassification int64   `gorm:"column:statistical_classification" json:"statistical_classification" form:"statistical_classification"`
1067
-	DiseaseDirectory          int64   `gorm:"column:disease_directory" json:"disease_directory" form:"disease_directory"`
1068
-	IsRecord                  int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
1069
-	MedicalCode               string  `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
1070
-	TubeColor                 int64   `gorm:"column:tube_color" json:"tube_color" form:"tube_color"`
1071
-	MedicalStatus             int64   `gorm:"column:medical_status" json:"medical_status" form:"medical_status"`
1072
-	Remark                    string  `gorm:"column:remark" json:"remark" form:"remark"`
1073
-	Sign                      int64   `gorm:"column:sign" json:"sign" form:"sign"`
1074
-	DefaultNumber             string  `gorm:"column:default_number" json:"default_number" form:"default_number"`
1075
-	IsDefault                 int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
1076
-	IsCharge                  int64   `gorm:"column:is_charge" json:"is_charge" form:"is_charge"`
1077
-	IsEstimate                int64   `gorm:"column:is_estimate" json:"is_estimate" form:"is_estimate"`
1078
-	IsWorkload                int64   `gorm:"column:is_workload" json:"is_workload" form:"is_workload"`
1079
-	Sort                      string  `gorm:"column:sort" json:"sort" form:"sort"`
1080
-	DoctorAdvice              int64   `gorm:"column:doctor_advice" json:"doctor_advice" form:"doctor_advice"`
1081
-	UserOrgId                 int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1082
-	Status                    int64   `gorm:"column:status" json:"status" form:"status"`
1083
-	CreatedTime               int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
1084
-	UpdatedTime               int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
1085
-	SingleDose                string  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1086
-	ExecutionFrequency        string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1087
-	DeliveryWay               string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1088
-	NumberDays                string  `gorm:"column:number_days" json:"number_days" form:"number_days"`
1089
-	Total                     string  `gorm:"column:total" json:"total" form:"total"`
1090
-	Category                  int64   `gorm:"column:category" json:"category" form:"category"`
1091
-	IsMark                    int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
1058
+	ID                          int64   `gorm:"column:id" json:"id" form:"id"`
1059
+	ProjectName                 string  `gorm:"column:project_name" json:"project_name" form:"project_name"`
1060
+	Pinyin                      string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
1061
+	Wubi                        string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
1062
+	Price                       float64 `gorm:"column:price" json:"price" form:"price"`
1063
+	Unit                        string  `gorm:"column:unit" json:"unit" form:"unit"`
1064
+	CostClassify                int64   `gorm:"column:cost_classify" json:"cost_classify" form:"cost_classify"`
1065
+	ExecutiveSection            int64   `gorm:"column:executive_section" json:"executive_section" form:"executive_section"`
1066
+	MedicalCoverage             int64   `gorm:"column:medical_coverage" json:"medical_coverage" form:"medical_coverage"`
1067
+	StatisticalClassification   int64   `gorm:"column:statistical_classification" json:"statistical_classification" form:"statistical_classification"`
1068
+	DiseaseDirectory            int64   `gorm:"column:disease_directory" json:"disease_directory" form:"disease_directory"`
1069
+	IsRecord                    int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
1070
+	MedicalCode                 string  `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
1071
+	TubeColor                   int64   `gorm:"column:tube_color" json:"tube_color" form:"tube_color"`
1072
+	MedicalStatus               int64   `gorm:"column:medical_status" json:"medical_status" form:"medical_status"`
1073
+	Remark                      string  `gorm:"column:remark" json:"remark" form:"remark"`
1074
+	Sign                        int64   `gorm:"column:sign" json:"sign" form:"sign"`
1075
+	DefaultNumber               string  `gorm:"column:default_number" json:"default_number" form:"default_number"`
1076
+	IsDefault                   int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
1077
+	IsCharge                    int64   `gorm:"column:is_charge" json:"is_charge" form:"is_charge"`
1078
+	IsEstimate                  int64   `gorm:"column:is_estimate" json:"is_estimate" form:"is_estimate"`
1079
+	IsWorkload                  int64   `gorm:"column:is_workload" json:"is_workload" form:"is_workload"`
1080
+	Sort                        string  `gorm:"column:sort" json:"sort" form:"sort"`
1081
+	DoctorAdvice                int64   `gorm:"column:doctor_advice" json:"doctor_advice" form:"doctor_advice"`
1082
+	UserOrgId                   int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1083
+	Status                      int64   `gorm:"column:status" json:"status" form:"status"`
1084
+	CreatedTime                 int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
1085
+	UpdatedTime                 int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
1086
+	SingleDose                  string  `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1087
+	ExecutionFrequency          string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1088
+	DeliveryWay                 string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1089
+	NumberDays                  string  `gorm:"column:number_days" json:"number_days" form:"number_days"`
1090
+	Total                       string  `gorm:"column:total" json:"total" form:"total"`
1091
+	Category                    int64   `gorm:"column:category" json:"category" form:"category"`
1092
+	IsMark                      int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
1093
+	SpecailProject              int64   `gorm:"column:specail_project" json:"specail_project" form:"specail_project"`
1094
+	SocialSecurityDirectoryCode string  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
1095
+	RecordDate                  int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
1092 1096
 }
1093 1097
 
1094 1098
 func (MyHisProject) TableName() string {

+ 2 - 0
models/sz_his_models.go 查看文件

@@ -31,6 +31,8 @@ type DrugDetail struct {
31 31
 	LastPrice                   float64 // 药品进货价格
32 32
 	LimitRemark                 string  //药品备注
33 33
 	SocialSecurityDirectoryCode string  //社保目录编码
34
+	RecordDate                  string  //备案日期
35
+	PrescriptionMark            string
34 36
 }
35 37
 type DocDetail struct {
36 38
 	UserName                                string //医护姓名

+ 1 - 2
service/his_project_service.go 查看文件

@@ -706,13 +706,12 @@ func GetBatchDrugList(idss []int64) (drug []*models.BaseDrugList, err error) {
706 706
 	db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1")
707 707
 	table := XTReadDB().Table("xt_manufacturer as m")
708 708
 	fmt.Print(table)
709
-	fmt.Println("长度22222222", len(idss))
710 709
 	if len(idss) == 1 {
711 710
 		db = db.Where("x.id = ?", idss[0])
712 711
 	} else {
713 712
 		db = db.Where("x.id IN(?)", idss)
714 713
 	}
715
-	err = db.Select("x.id,x.medical_insurance_number,x.code,x.drug_name,x.drug_spec,x.drug_type,x.min_unit,x.last_price,x.retail_price,x.limit_remark,x.drug_dosage_form,m.manufacturer_name").Joins("left join xt_manufacturer as m on m.id = x.manufacturer").Scan(&drug).Error
714
+	err = db.Select("x.id,x.medical_insurance_number,x.code,x.drug_name,x.drug_spec,x.drug_type,x.min_unit,x.last_price,x.retail_price,x.limit_remark,x.drug_dosage_form,x.social_security_directory_code,m.manufacturer_name").Joins("left join xt_manufacturer as m on m.id = x.manufacturer").Scan(&drug).Error
716 715
 
717 716
 	return drug, err
718 717
 }

+ 23 - 37
service/sz_his_service.go 查看文件

@@ -5,6 +5,7 @@ import (
5 5
 	"encoding/json"
6 6
 	"fmt"
7 7
 	"gdyb/models"
8
+	"github.com/astaxie/beego"
8 9
 	"io/ioutil"
9 10
 	"math/rand"
10 11
 	"net/http"
@@ -671,10 +672,7 @@ func msToTime(ms int64) string {
671 672
 func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedrug *models.DrugDetail) string {
672 673
 	//生成输入报文
673 674
 	inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
674
-
675 675
 	inputData := make(map[string]interface{})
676
-	inputMessage["transType"] = "JY003" // 交易编码
677
-
678 676
 	inputData["listsize"] = 1
679 677
 	inputMessage["transType"] = "ML008" // 交易编码S
680 678
 	feedetail := make([]map[string]interface{}, 0)
@@ -685,13 +683,12 @@ func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedru
685 683
 	feedetailInfo["ake006"] = basedrug.DrugName
686 684
 	feedetailInfo["aka074"] = basedrug.DrugSpec
687 685
 	feedetailInfo["aka070"] = basedrug.DrugDosageName
688
-	//feedetailInfo["aka070"] = "片"
689 686
 	feedetailInfo["aka067"] = basedrug.MinUnit
690 687
 	feedetailInfo["bka053"] = basedrug.ManufacturerName
691 688
 	feedetailInfo["aka064"] = "1"
692 689
 	feedetailInfo["bka505"] = basedrug.LastPrice
693 690
 	feedetailInfo["bka506"] = basedrug.RetailPrice
694
-	feedetailInfo["aae030"] = 20210406
691
+	feedetailInfo["aae030"], _ = strconv.ParseInt(basedrug.RecordDate, 10, 64)
695 692
 	feedetailInfo["aae013"] = basedrug.LimitRemark
696 693
 	feedetail = append(feedetail, feedetailInfo)
697 694
 
@@ -705,9 +702,8 @@ func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedru
705 702
 		return err.Error()
706 703
 	}
707 704
 	reader := bytes.NewReader(bytesData)
708
-	//url := "http://192.168.1.99:10000"
709
-	//url := "http://192.168.1.228:17001/szsi-portal/transData"
710
-	url := "http://192.168.1.88:6666/szsi-portal/transData"
705
+
706
+	url := beego.AppConfig.String("url")
711 707
 
712 708
 	request, err := http.NewRequest("POST", url, reader)
713 709
 	if err != nil {
@@ -761,7 +757,7 @@ func SetSZDrugMessage(doctor string, doctor_code string, fixmedins_code string)
761 757
 	inputMessage["serialNumber"] = fixmedins_code + year + month + day +
762 758
 		fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000)) // 定点协议机构编码(5位)+日期(8位)+流水号(7位)
763 759
 	//inputMessage["serialNumber"] = "G554020210406" + fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000)) // 定点协议机构编码(5位)+日期(8位)+流水号(7位)
764
-	//inputMessage["verifyCode"] = "000000|8ec5b7745a5cc45b631f23b4bf1e417e"
760
+	inputMessage["verifyCode"] = "000000|8ec5b7745a5cc45b631f23b4bf1e417e"
765 761
 
766 762
 	inputMessage["transReturnCode"] = ""                                           //
767 763
 	inputMessage["transReturnMessage"] = ""                                        //
@@ -773,26 +769,28 @@ func SetSZDrugMessage(doctor string, doctor_code string, fixmedins_code string)
773 769
 }
774 770
 
775 771
 func SzybML009(doctor string, doctor_code string, fixmedins_code string, pro *models.MyHisProject) string {
772
+	timeLayout := "20060102"
773
+	record_date := time.Unix(pro.RecordDate, 0).Format(timeLayout)
774
+	recordDate, _ := strconv.ParseInt(record_date, 10, 64)
776 775
 	//生成输入报文
777 776
 	inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
778 777
 
779 778
 	inputData := make(map[string]interface{})
780
-
779
+	inputData["listsize"] = 1
781 780
 	inputMessage["transType"] = "ML009" // 交易编码
782 781
 	feedetail := make([]map[string]interface{}, 0)
783 782
 
784 783
 	feedetailInfo := make(map[string]interface{})
785
-	feedetailInfo["ake001"] = pro.MedicalCode //社保目录编码
786
-	feedetailInfo["ake005"] = pro.MedicalCode //协议机构内部目录编码
787
-	feedetailInfo["ake006"] = pro.ProjectName // 协议机构内部目录名称
788
-	feedetailInfo["bkf131"] = pro.Category    //协议机构项目类别
789
-	feedetailInfo["bkm062"] = "0"             // 门诊特检项目标识
790
-	feedetailInfo["bka506"] = pro.Price       // 协议机构内部项目收费价格
791
-	feedetailInfo["aae030"] = 20210407        // 备案日期
792
-	feedetailInfo["aae013"] = pro.Remark      // 备注
784
+	feedetailInfo["ake001"] = pro.SocialSecurityDirectoryCode           //社保目录编码
785
+	feedetailInfo["ake005"] = pro.SocialSecurityDirectoryCode           //协议机构内部目录编码
786
+	feedetailInfo["ake006"] = pro.ProjectName                           // 协议机构内部目录名称
787
+	feedetailInfo["bkf131"] = pro.Category                              //协议机构项目类别
788
+	feedetailInfo["bkm062"] = strconv.FormatInt(pro.SpecailProject, 10) // 门诊特检项目标识
789
+	feedetailInfo["bka506"] = pro.Price                                 // 协议机构内部项目收费价格
790
+	feedetailInfo["aae030"] = recordDate                                // 备案日期
791
+	feedetailInfo["aae013"] = pro.Remark                                // 备注
793 792
 	feedetail = append(feedetail, feedetailInfo)
794 793
 
795
-	fmt.Println("feeedDetal2333333333", feedetail)
796 794
 	inputData["inputlist"] = feedetail
797 795
 	inputMessage["transBody"] = inputData
798 796
 
@@ -803,9 +801,7 @@ func SzybML009(doctor string, doctor_code string, fixmedins_code string, pro *mo
803 801
 		return err.Error()
804 802
 	}
805 803
 	reader := bytes.NewReader(bytesData)
806
-	//url := "http://192.168.1.99:10000"
807
-	//url := "http://192.168.1.228:17001/szsi-portal/transData"
808
-	url := "http://192.168.1.88:6666/szsi-portal/transData"
804
+	url := beego.AppConfig.String("url")
809 805
 
810 806
 	request, err := http.NewRequest("POST", url, reader)
811 807
 	if err != nil {
@@ -921,9 +917,7 @@ func SzybML010(doctor string, doctor_code string, fixmedins_code string, datas [
921 917
 		return err.Error()
922 918
 	}
923 919
 	reader := bytes.NewReader(bytesData)
924
-	//url := "http://192.168.1.99:10000"
925
-	//url := "http://192.168.1.228:17001/szsi-portal/transData"
926
-	url := "http://192.168.1.88:6666/szsi-portal/transData"
920
+	url := beego.AppConfig.String("url")
927 921
 
928 922
 	request, err := http.NewRequest("POST", url, reader)
929 923
 	if err != nil {
@@ -1010,9 +1004,7 @@ func SzybYS001(doctor string, doctor_code string, fixmedins_code string, doc *mo
1010 1004
 		return err.Error()
1011 1005
 	}
1012 1006
 	reader := bytes.NewReader(bytesData)
1013
-	//url := "http://192.168.1.99:10000"
1014
-	//url := "http://192.168.1.228:17001/szsi-portal/transData"
1015
-	url := "http://192.168.1.88:6666/szsi-portal/transData"
1007
+	url := beego.AppConfig.String("url")
1016 1008
 
1017 1009
 	request, err := http.NewRequest("POST", url, reader)
1018 1010
 	if err != nil {
@@ -1156,9 +1148,7 @@ func SzybYS002(doctor string, doctor_code string, fixmedins_code string, datas *
1156 1148
 		return err.Error()
1157 1149
 	}
1158 1150
 	reader := bytes.NewReader(bytesData)
1159
-	//url := "http://192.168.1.99:10000"
1160
-	//url := "http://192.168.1.228:17001/szsi-portal/transData"
1161
-	url := "http://192.168.1.88:6666/szsi-portal/transData"
1151
+	url := beego.AppConfig.String("url")
1162 1152
 
1163 1153
 	request, err := http.NewRequest("POST", url, reader)
1164 1154
 	if err != nil {
@@ -1249,9 +1239,7 @@ func SzybYS003(doctor string, doctor_code string, fixmedins_code string, datas [
1249 1239
 		return err.Error()
1250 1240
 	}
1251 1241
 	reader := bytes.NewReader(bytesData)
1252
-	//url := "http://192.168.1.99:10000"
1253
-	//url := "http://192.168.1.228:17001/szsi-portal/transData"
1254
-	url := "http://192.168.1.88:6666/szsi-portal/transData"
1242
+	url := beego.AppConfig.String("url")
1255 1243
 
1256 1244
 	request, err := http.NewRequest("POST", url, reader)
1257 1245
 	if err != nil {
@@ -1312,9 +1300,7 @@ func SzybYML007(doctor string, doctor_code string, fixmedins_code string, infor
1312 1300
 		return err.Error()
1313 1301
 	}
1314 1302
 	reader := bytes.NewReader(bytesData)
1315
-	//url := "http://192.168.1.99:10000"
1316
-	//url := "http://192.168.1.228:17001/szsi-portal/transData"
1317
-	url := "http://192.168.1.88:6666/szsi-portal/transData"
1303
+	url := beego.AppConfig.String("url")
1318 1304
 
1319 1305
 	request, err := http.NewRequest("POST", url, reader)
1320 1306
 	if err != nil {