浏览代码

2024/6/17

28169 9 个月前
父节点
当前提交
c166130221
共有 4 个文件被更改,包括 75 次插入67 次删除
  1. 二进制
      XT_New.exe
  2. 1 1
      conf/app.conf
  3. 10 10
      controllers/base_api_controller.go
  4. 64 56
      controllers/his_api_controller.go

二进制
XT_New.exe 查看文件


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

1
 appname = 血透
1
 appname = 血透
2
 httpport = 9531
2
 httpport = 9531
3
-runmode = dev
3
+runmode = prod
4
 #dev/prod
4
 #dev/prod
5
 
5
 
6
 #
6
 #

+ 10 - 10
controllers/base_api_controller.go 查看文件

72
 	this.BaseAPIController.Prepare()
72
 	this.BaseAPIController.Prepare()
73
 	if this.GetAdminUserInfo() == nil {
73
 	if this.GetAdminUserInfo() == nil {
74
 		var userAdmin models.AdminUser
74
 		var userAdmin models.AdminUser
75
-		userAdmin.Id = 1448
75
+		userAdmin.Id = 4745
76
 		userAdmin.Mobile = "13318599895"
76
 		userAdmin.Mobile = "13318599895"
77
 
77
 
78
-		userAdmin.Id = 1 //4,809
78
+		userAdmin.Id = 4745 //4,809
79
 		userAdmin.Mobile = "12222222222"
79
 		userAdmin.Mobile = "12222222222"
80
 		userAdmin.IsSuperAdmin = true
80
 		userAdmin.IsSuperAdmin = true
81
 		userAdmin.Status = 1
81
 		userAdmin.Status = 1
83
 		userAdmin.ModifyTime = 1530786071
83
 		userAdmin.ModifyTime = 1530786071
84
 		var subscibe models.ServeSubscibe
84
 		var subscibe models.ServeSubscibe
85
 		subscibe.ID = 11
85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10702 //机构id
86
+		subscibe.OrgId = 10495 //机构id
87
 		subscibe.PeriodStart = 1547447814
87
 		subscibe.PeriodStart = 1547447814
88
 		subscibe.PeriodEnd = 1550039814
88
 		subscibe.PeriodEnd = 1550039814
89
 		subscibe.State = 1
89
 		subscibe.State = 1
93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94
 		subscibes[4] = &subscibe
94
 		subscibes[4] = &subscibe
95
 		var adminUserInfo service.AdminUserInfo
95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10702 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 3244  //4
96
+		adminUserInfo.CurrentOrgId = 10495 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 17513 //4
98
 		adminUserInfo.AdminUser = &userAdmin
98
 		adminUserInfo.AdminUser = &userAdmin
99
 		adminUserInfo.Subscibes = subscibes
99
 		adminUserInfo.Subscibes = subscibes
100
 		this.SetSession("admin_user_info", &adminUserInfo)
100
 		this.SetSession("admin_user_info", &adminUserInfo)
318
 	this.BaseAPIController.Prepare()
318
 	this.BaseAPIController.Prepare()
319
 	if this.GetAdminUserInfo() == nil {
319
 	if this.GetAdminUserInfo() == nil {
320
 		var userAdmin models.AdminUser
320
 		var userAdmin models.AdminUser
321
-		userAdmin.Id = 1448
321
+		userAdmin.Id = 4745
322
 		userAdmin.Mobile = "13318599895"
322
 		userAdmin.Mobile = "13318599895"
323
 
323
 
324
-		userAdmin.Id = 1 //4,809
324
+		userAdmin.Id = 4745 //4,809
325
 		userAdmin.Mobile = "12222222222"
325
 		userAdmin.Mobile = "12222222222"
326
 		userAdmin.IsSuperAdmin = false
326
 		userAdmin.IsSuperAdmin = false
327
 		userAdmin.Status = 1
327
 		userAdmin.Status = 1
329
 		userAdmin.ModifyTime = 1530786071
329
 		userAdmin.ModifyTime = 1530786071
330
 		var subscibe models.ServeSubscibe
330
 		var subscibe models.ServeSubscibe
331
 		subscibe.ID = 11
331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10702 //机构id小英9675或4
332
+		subscibe.OrgId = 10495 //机构id小英9675或4
333
 		subscibe.PeriodStart = 1538035409
333
 		subscibe.PeriodStart = 1538035409
334
 		subscibe.PeriodEnd = 1569571409
334
 		subscibe.PeriodEnd = 1569571409
335
 		subscibe.State = 1
335
 		subscibe.State = 1
339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340
 		subscibes[4] = &subscibe
340
 		subscibes[4] = &subscibe
341
 		var adminUserInfo service.AdminUserInfo
341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10702 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 3244  //4
342
+		adminUserInfo.CurrentOrgId = 10495 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 17513 //4
344
 		adminUserInfo.AdminUser = &userAdmin
344
 		adminUserInfo.AdminUser = &userAdmin
345
 		adminUserInfo.Subscibes = subscibes
345
 		adminUserInfo.Subscibes = subscibes
346
 		this.SetSession("admin_user_info", &adminUserInfo)
346
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 64 - 56
controllers/his_api_controller.go 查看文件

3180
 	var adviceList []models.HisDoctorAdviceInfo
3180
 	var adviceList []models.HisDoctorAdviceInfo
3181
 	var projectList []models.HisPrescriptionProject
3181
 	var projectList []models.HisPrescriptionProject
3182
 
3182
 
3183
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 {
3183
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 {
3184
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3184
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3185
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3185
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3186
 
3186
 
3657
 								timeFormat := tempTime.Format("20060102150405")
3657
 								timeFormat := tempTime.Format("20060102150405")
3658
 								s.FeedetlSn = timeFormat + strconv.FormatInt(int64(randNum), 10) + "-" + "1" + "-" + strconv.FormatInt(s.ID, 10)
3658
 								s.FeedetlSn = timeFormat + strconv.FormatInt(int64(randNum), 10) + "-" + "1" + "-" + strconv.FormatInt(s.ID, 10)
3659
 
3659
 
3660
-								if s.ID == 0 {
3661
-									//查询改药品是否已经停用
3662
-									base, _ := service.GetBasedrugById(s.DrugId, s.UserOrgId)
3660
+								if s.UserOrgId != 10206 {
3661
+									if s.ID == 0 {
3662
+										//查询改药品是否已经停用
3663
+										base, _ := service.GetBasedrugById(s.DrugId, s.UserOrgId)
3663
 
3664
 
3664
-									if base.ID > 0 {
3665
-										tx.Rollback()
3666
-										c.ServeDynamicFailJsonSend(base.DrugName + "已停用!请更换其他药品")
3667
-										return
3665
+										if base.ID > 0 {
3666
+											tx.Rollback()
3667
+											c.ServeDynamicFailJsonSend(base.DrugName + "已停用!请更换其他药品")
3668
+											return
3668
 
3669
 
3669
-									}
3670
+										}
3670
 
3671
 
3671
-									drugMedical, _ := service.GetBaseDrugMedical(s.DrugId)
3672
+										drugMedical, _ := service.GetBaseDrugMedical(s.DrugId)
3672
 
3673
 
3673
-									if drugMedical.SumCount == 0 {
3674
-										tx.Rollback()
3675
-										c.ServeDynamicFailJsonSend(drugMedical.DrugName + "库存不足,保存失败!")
3676
-										return
3674
+										if drugMedical.SumCount == 0 {
3675
+											tx.Rollback()
3676
+											c.ServeDynamicFailJsonSend(drugMedical.DrugName + "库存不足,保存失败!")
3677
+											return
3677
 
3678
 
3679
+										}
3678
 									}
3680
 									}
3679
 								}
3681
 								}
3680
 
3682
 
3774
 
3776
 
3775
 								}
3777
 								}
3776
 
3778
 
3777
-								if p.Type == 3 {
3779
+								if adminInfo.CurrentOrgId != 10206 {
3780
+									if p.Type == 3 {
3781
+
3782
+										if p.ID == 0 {
3783
+											//查询该耗材是否停用
3784
+											goodInfoSeven, _ := service.GetGoodByIdIsStop(p.ProjectId, adminInfo.CurrentOrgId)
3785
+											//表示该耗材已经停用,不能保存
3786
+											if goodInfoSeven.ID == 0 {
3787
+												goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3788
+												c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材已经停用,保存失败!")
3789
+												return
3790
+											}
3778
 
3791
 
3779
-									if p.ID == 0 {
3780
-										//查询该耗材是否停用
3781
-										goodInfoSeven, _ := service.GetGoodByIdIsStop(p.ProjectId, adminInfo.CurrentOrgId)
3782
-										//表示该耗材已经停用,不能保存
3783
-										if goodInfoSeven.ID == 0 {
3784
 											goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3792
 											goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3785
-											c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材已经停用,保存失败!")
3786
-											return
3793
+											if goodInfoOne.SumCount == 0 {
3794
+												c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材无库存,保存失败!")
3795
+												return
3796
+											}
3787
 										}
3797
 										}
3788
 
3798
 
3789
-										goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
3790
-										if goodInfoOne.SumCount == 0 {
3791
-											c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材无库存,保存失败!")
3792
-											return
3793
-										}
3794
 									}
3799
 									}
3795
-
3796
 								}
3800
 								}
3797
 
3801
 
3798
 								//查询保存耗材出库开关是否打开
3802
 								//查询保存耗材出库开关是否打开
4492
 									}
4496
 									}
4493
 								}
4497
 								}
4494
 
4498
 
4495
-								if s.ID == 0 {
4496
-									//查询改药品是否已经停用
4497
-									base, _ := service.GetBasedrugById(s.DrugId, s.UserOrgId)
4499
+								if adminInfo.CurrentOrgId != 10206 {
4500
+									if s.ID == 0 {
4501
+										//查询改药品是否已经停用
4502
+										base, _ := service.GetBasedrugById(s.DrugId, s.UserOrgId)
4498
 
4503
 
4499
-									if base.ID > 0 {
4500
-										c.ServeDynamicFailJsonSend(base.DrugName + "已停用!请更换其他药品")
4501
-										return
4504
+										if base.ID > 0 {
4505
+											c.ServeDynamicFailJsonSend(base.DrugName + "已停用!请更换其他药品")
4506
+											return
4502
 
4507
 
4503
-									}
4508
+										}
4504
 
4509
 
4505
-									drugMedical, _ := service.GetBaseDrugMedical(s.DrugId)
4510
+										drugMedical, _ := service.GetBaseDrugMedical(s.DrugId)
4506
 
4511
 
4507
-									if drugMedical.SumCount == 0 {
4508
-										c.ServeDynamicFailJsonSend(drugMedical.DrugName + "库存不足,保存失败!")
4509
-										return
4512
+										if drugMedical.SumCount == 0 {
4513
+											c.ServeDynamicFailJsonSend(drugMedical.DrugName + "库存不足,保存失败!")
4514
+											return
4510
 
4515
 
4516
+										}
4511
 									}
4517
 									}
4512
 								}
4518
 								}
4513
 
4519
 
4627
 
4633
 
4628
 								}
4634
 								}
4629
 
4635
 
4630
-								if p.Type == 3 {
4631
-									if p.ID == 0 {
4632
-										//查询该耗材是否停用
4633
-										goodInfoSeven, _ := service.GetGoodByIdIsStop(p.ProjectId, adminInfo.CurrentOrgId)
4634
-										//表示该耗材已经停用,不能保存
4635
-										if goodInfoSeven.ID == 0 {
4636
+								if adminInfo.CurrentOrgId != 10206 {
4637
+									if p.Type == 3 {
4638
+										if p.ID == 0 {
4639
+											//查询该耗材是否停用
4640
+											goodInfoSeven, _ := service.GetGoodByIdIsStop(p.ProjectId, adminInfo.CurrentOrgId)
4641
+											//表示该耗材已经停用,不能保存
4642
+											if goodInfoSeven.ID == 0 {
4643
+												goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
4644
+												c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材已经停用,保存失败!")
4645
+												return
4646
+											}
4647
+
4636
 											goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
4648
 											goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
4637
-											c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材已经停用,保存失败!")
4638
-											return
4649
+											if goodInfoOne.SumCount == 0 {
4650
+												c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材无库存,保存失败!")
4651
+												return
4652
+											}
4639
 										}
4653
 										}
4640
 
4654
 
4641
-										goodInfoOne, _ := service.GetGoodInformationByGoodIdOne(p.ProjectId)
4642
-										if goodInfoOne.SumCount == 0 {
4643
-											c.ServeDynamicFailJsonSend(goodInfoOne.GoodName + "耗材无库存,保存失败!")
4644
-											return
4645
-										}
4646
 									}
4655
 									}
4647
-
4648
 								}
4656
 								}
4649
 
4657
 
4650
 								service.CreateHisProjectTwo(&p)
4658
 								service.CreateHisProjectTwo(&p)
5424
 
5432
 
5425
 									var out_count int64
5433
 									var out_count int64
5426
 									out_count = in_count - total_count
5434
 									out_count = in_count - total_count
5427
-
5428
-									fmt.Println("in_count------------------", in_count)
5429
-									fmt.Println("total_count------------------", total_count)
5435
+									//
5436
+									//fmt.Println("in_count------------------", in_count)
5437
+									//fmt.Println("total_count------------------", total_count)
5430
 									//添加出库数量
5438
 									//添加出库数量
5431
 									service.AddSelfDrugCount(item.DrugId, item.UserOrgId, patient_id, out_count, tx)
5439
 									service.AddSelfDrugCount(item.DrugId, item.UserOrgId, patient_id, out_count, tx)
5432
 
5440