|
@@ -3180,7 +3180,7 @@ func (c *HisApiController) CreateHisPrescription() {
|
3180
|
3180
|
var adviceList []models.HisDoctorAdviceInfo
|
3181
|
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
|
3184
|
if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
|
3185
|
3185
|
prescriptions, _ := dataBody["prescriptions"].([]interface{})
|
3186
|
3186
|
|
|
@@ -3657,24 +3657,26 @@ func (c *HisApiController) CreateHisPrescription() {
|
3657
|
3657
|
timeFormat := tempTime.Format("20060102150405")
|
3658
|
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,25 +3776,27 @@ func (c *HisApiController) CreateHisPrescription() {
|
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
|
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,22 +4496,24 @@ func (c *HisApiController) CreateHisPrescription() {
|
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,24 +4633,26 @@ func (c *HisApiController) CreateHisPrescription() {
|
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
|
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
|
4658
|
service.CreateHisProjectTwo(&p)
|
|
@@ -5424,9 +5432,9 @@ func (c *HisApiController) CreateHisPrescription() {
|
5424
|
5432
|
|
5425
|
5433
|
var out_count int64
|
5426
|
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
|
5439
|
service.AddSelfDrugCount(item.DrugId, item.UserOrgId, patient_id, out_count, tx)
|
5432
|
5440
|
|