|
@@ -2421,7 +2421,6 @@ func (c *DialysisAPIController) Finish() {
|
2421
|
2421
|
tempassessmentAfterDislysis.InternalFistula = lastAssessmentAfterDislysis.InternalFistula
|
2422
|
2422
|
tempassessmentAfterDislysis.Catheter = lastAssessmentAfterDislysis.Catheter
|
2423
|
2423
|
tempassessmentAfterDislysis.Complication = lastAssessmentAfterDislysis.Complication
|
2424
|
|
- tempassessmentAfterDislysis.Remark = lastAssessmentAfterDislysis.Remark
|
2425
|
2424
|
tempassessmentAfterDislysis.DialysisIntakes = lastAssessmentAfterDislysis.DialysisIntakes
|
2426
|
2425
|
tempassessmentAfterDislysis.DialysisIntakesFeed = lastAssessmentAfterDislysis.DialysisIntakesFeed
|
2427
|
2426
|
tempassessmentAfterDislysis.DialysisIntakesTransfusion = lastAssessmentAfterDislysis.DialysisIntakesTransfusion
|
|
@@ -2800,7 +2799,6 @@ func (this *DialysisAPIController) StartDialysis() {
|
2800
|
2799
|
hemoperfusion, _ := beego.AppConfig.Int64("hemoperfusion")
|
2801
|
2800
|
dialyser_sterilised, _ := beego.AppConfig.Int64("dialyser_sterilised")
|
2802
|
2801
|
filtryzer, _ := beego.AppConfig.Int64("filtryzer")
|
2803
|
|
-
|
2804
|
2802
|
dialyzers, _ := beego.AppConfig.Int64("dialyzers")
|
2805
|
2803
|
injector, _ := beego.AppConfig.Int64("injector")
|
2806
|
2804
|
bloodlines, _ := beego.AppConfig.Int64("bloodlines")
|
|
@@ -3299,7 +3297,6 @@ func (this *DialysisAPIController) StartDialysis() {
|
3299
|
3297
|
}
|
3300
|
3298
|
|
3301
|
3299
|
}
|
3302
|
|
-
|
3303
|
3300
|
if prescription.ALiquid > 0 {
|
3304
|
3301
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
3305
|
3302
|
WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
|
|
@@ -3344,7 +3341,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3344
|
3341
|
if out.ID > 0 {
|
3345
|
3342
|
|
3346
|
3343
|
if prescription.Niprocart > 0 {
|
3347
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, niprocart, prescription.Niprocart, out.WarehouseOutOrderNumber)
|
|
3344
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, niprocart, prescription.Niprocart, out.ID)
|
3348
|
3345
|
|
3349
|
3346
|
if err == gorm.ErrRecordNotFound {
|
3350
|
3347
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3404,7 +3401,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3404
|
3401
|
}
|
3405
|
3402
|
|
3406
|
3403
|
if prescription.Jms > 0 {
|
3407
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, jms, prescription.Jms, out.WarehouseOutOrderNumber)
|
|
3404
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, jms, prescription.Jms, out.ID)
|
3408
|
3405
|
|
3409
|
3406
|
if err == gorm.ErrRecordNotFound {
|
3410
|
3407
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3466,7 +3463,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3466
|
3463
|
}
|
3467
|
3464
|
|
3468
|
3465
|
if prescription.FistulaNeedleSet > 0 {
|
3469
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, fistula_needle_set, prescription.FistulaNeedleSet, out.WarehouseOutOrderNumber)
|
|
3466
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, fistula_needle_set, prescription.FistulaNeedleSet, out.ID)
|
3470
|
3467
|
|
3471
|
3468
|
if err == gorm.ErrRecordNotFound {
|
3472
|
3469
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3528,7 +3525,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3528
|
3525
|
}
|
3529
|
3526
|
|
3530
|
3527
|
if prescription.FistulaNeedleSet16 > 0 {
|
3531
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, fistula_needle_set_16, prescription.FistulaNeedleSet16, out.WarehouseOutOrderNumber)
|
|
3528
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, fistula_needle_set_16, prescription.FistulaNeedleSet16, out.ID)
|
3532
|
3529
|
|
3533
|
3530
|
if err == gorm.ErrRecordNotFound {
|
3534
|
3531
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3589,7 +3586,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3589
|
3586
|
}
|
3590
|
3587
|
|
3591
|
3588
|
if prescription.Hemoperfusion > 0 {
|
3592
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, hemoperfusion, prescription.Hemoperfusion, out.WarehouseOutOrderNumber)
|
|
3589
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, hemoperfusion, prescription.Hemoperfusion, out.ID)
|
3593
|
3590
|
|
3594
|
3591
|
if err == gorm.ErrRecordNotFound {
|
3595
|
3592
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3650,7 +3647,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3650
|
3647
|
}
|
3651
|
3648
|
|
3652
|
3649
|
if prescription.DialyserSterilised > 0 {
|
3653
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, dialyser_sterilised, prescription.DialyserSterilised, out.WarehouseOutOrderNumber)
|
|
3650
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, dialyser_sterilised, prescription.DialyserSterilised, out.ID)
|
3654
|
3651
|
|
3655
|
3652
|
if err == gorm.ErrRecordNotFound {
|
3656
|
3653
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3712,7 +3709,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3712
|
3709
|
}
|
3713
|
3710
|
|
3714
|
3711
|
if prescription.Filtryzer > 0 {
|
3715
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, filtryzer, prescription.Filtryzer, out.WarehouseOutOrderNumber)
|
|
3712
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, filtryzer, prescription.Filtryzer, out.ID)
|
3716
|
3713
|
|
3717
|
3714
|
if err == gorm.ErrRecordNotFound {
|
3718
|
3715
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3774,7 +3771,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3774
|
3771
|
}
|
3775
|
3772
|
|
3776
|
3773
|
if prescription.Dialyzers > 0 {
|
3777
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, dialyzers, prescription.Dialyzers, out.WarehouseOutOrderNumber)
|
|
3774
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, dialyzers, prescription.Dialyzers, out.ID)
|
3778
|
3775
|
|
3779
|
3776
|
if err == gorm.ErrRecordNotFound {
|
3780
|
3777
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3836,7 +3833,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3836
|
3833
|
}
|
3837
|
3834
|
|
3838
|
3835
|
if prescription.Injector > 0 {
|
3839
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, injector, prescription.Injector, out.WarehouseOutOrderNumber)
|
|
3836
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, injector, prescription.Injector, out.ID)
|
3840
|
3837
|
|
3841
|
3838
|
if err == gorm.ErrRecordNotFound {
|
3842
|
3839
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3898,7 +3895,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3898
|
3895
|
}
|
3899
|
3896
|
|
3900
|
3897
|
if prescription.Bloodlines > 0 {
|
3901
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, bloodlines, prescription.Bloodlines, out.WarehouseOutOrderNumber)
|
|
3898
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, bloodlines, prescription.Bloodlines, out.ID)
|
3902
|
3899
|
|
3903
|
3900
|
if err == gorm.ErrRecordNotFound {
|
3904
|
3901
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -3960,7 +3957,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3960
|
3957
|
}
|
3961
|
3958
|
|
3962
|
3959
|
if prescription.TubingHemodialysis > 0 {
|
3963
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, tubingHemodialysis, prescription.TubingHemodialysis, out.WarehouseOutOrderNumber)
|
|
3960
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, tubingHemodialysis, prescription.TubingHemodialysis, out.ID)
|
3964
|
3961
|
|
3965
|
3962
|
if err == gorm.ErrRecordNotFound {
|
3966
|
3963
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -4022,7 +4019,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
4022
|
4019
|
}
|
4023
|
4020
|
|
4024
|
4021
|
if prescription.Package > 0 {
|
4025
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, safe_package, prescription.Package, out.WarehouseOutOrderNumber)
|
|
4022
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, safe_package, prescription.Package, out.ID)
|
4026
|
4023
|
|
4027
|
4024
|
if err == gorm.ErrRecordNotFound {
|
4028
|
4025
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -4084,7 +4081,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
4084
|
4081
|
}
|
4085
|
4082
|
|
4086
|
4083
|
if prescription.ALiquid > 0 {
|
4087
|
|
- outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, aliquid, prescription.ALiquid, out.WarehouseOutOrderNumber)
|
|
4084
|
+ outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.Org.Id, aliquid, prescription.ALiquid, out.ID)
|
4088
|
4085
|
|
4089
|
4086
|
if err == gorm.ErrRecordNotFound {
|
4090
|
4087
|
warehouseOutInfo := &models.WarehouseOutInfo{
|
|
@@ -4381,7 +4378,6 @@ func (c *DialysisAPIController) PostSolution() {
|
4381
|
4378
|
if order.ID > 0 {
|
4382
|
4379
|
if dialysisPrescription.Niprocart != niprocart {
|
4383
|
4380
|
//不一致,先将原有的商品订单数量进行减一的操作,并将原有使用记录进行修改商品信息(根据上机的日期和商品类型id,商品id)
|
4384
|
|
-
|
4385
|
4381
|
//1.用上机透析日期查出当天的订单
|
4386
|
4382
|
_, out := service.FindStockOutOrderNumberByTime(order.DialysisDate, adminUserInfo.Org.Id)
|
4387
|
4383
|
//_, out := service.FindOldOrderInfoByGoodId(order.StartTime, adminUserInfo.Org.Id)
|
|
@@ -4811,8 +4807,6 @@ func (c *DialysisAPIController) PostSolution() {
|
4811
|
4807
|
|
4812
|
4808
|
//不一致,先将原有的商品订单数量进行减一的操作,并将原有使用记录进行修改商品信息(根据上机的日期和商品类型id,商品id)
|
4813
|
4809
|
service.UpdateOrderCount(dialyser_sterilised_good_type_id, dialysisPrescription.DialyserSterilised, out.WarehouseOutOrderNumber, adminUserInfo.Org.Id)
|
4814
|
|
- //_, out := service.FindOrderInfoByGoodId(dialyser_sterilised_good_type_id, dialysisPrescription.DialyserSterilised, order.StartTime, adminUserInfo.Org.Id)
|
4815
|
|
- //_, out := service.FindOrderInfoByGoodId(order.StartTime, adminUserInfo.Org.Id)
|
4816
|
4810
|
|
4817
|
4811
|
//判断前端更改后的商品id的出库记录在数据库中是否存在
|
4818
|
4812
|
err, newOut := service.FindOrderInfoByGoodId(dialyser_sterilised_good_type_id, dialyser_sterilised, out.WarehouseOutOrderNumber, adminUserInfo.Org.Id)
|
|
@@ -6384,3 +6378,29 @@ func (c *DialysisAPIController) GetPatientId() {
|
6384
|
6378
|
"patient": patientId,
|
6385
|
6379
|
})
|
6386
|
6380
|
}
|
|
6381
|
+
|
|
6382
|
+func (this *DialysisAPIController) GetDialysisSchedule() {
|
|
6383
|
+ schedualDate := this.GetString("date")
|
|
6384
|
+ date, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", schedualDate)
|
|
6385
|
+ if parseDateErr != nil {
|
|
6386
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
6387
|
+ return
|
|
6388
|
+ }
|
|
6389
|
+ adminInfo := this.GetMobileAdminUserInfo()
|
|
6390
|
+ orgID := adminInfo.Org.Id
|
|
6391
|
+ redis := service.RedisClient()
|
|
6392
|
+ defer redis.Close()
|
|
6393
|
+ key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
|
|
6394
|
+ scheduals, _ := service.MobileGetDialysisScheduals(orgID, date.Unix(), 0)
|
|
6395
|
+ if len(scheduals) > 0 {
|
|
6396
|
+ //缓存数据
|
|
6397
|
+ scheduals_json, err := json.Marshal(scheduals)
|
|
6398
|
+ if err == nil {
|
|
6399
|
+ redis.Set(key, scheduals_json, time.Second*30)
|
|
6400
|
+ }
|
|
6401
|
+ }
|
|
6402
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
6403
|
+ "scheduals": scheduals,
|
|
6404
|
+ })
|
|
6405
|
+
|
|
6406
|
+}
|