ソースを参照

修改redis清除数据时间

csx 4 年 前
コミット
ef8dab4438

+ 3 - 3
conf/app.conf ファイルの表示

143
 [dev]
143
 [dev]
144
 mobile_token_expiration_second = 3600
144
 mobile_token_expiration_second = 3600
145
 httpdomain = http://new_mobile.xt.api.sgjyun.com
145
 httpdomain = http://new_mobile.xt.api.sgjyun.com
146
-sso_domain = http://testsso.sgjyun.com
146
+sso_domain = http://localhost:8081
147
 front_end_domain = "http://xt.test.sgjyun.com/#"
147
 front_end_domain = "http://xt.test.sgjyun.com/#"
148
 
148
 
149
 readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
149
 readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
215
 
215
 
216
 
216
 
217
 #redishost = 120.77.235.13
217
 #redishost = 120.77.235.13
218
-redishost = 112.74.16.180
219
-# redishost = localhost
218
+#redishost = 112.74.16.180
219
+redishost = localhost
220
 redisport = 6379
220
 redisport = 6379
221
 redispasswrod = 123456
221
 redispasswrod = 123456
222
 redisdb = 0
222
 redisdb = 0

+ 13 - 14
controllers/dialysis_record_api_controller.go ファイルの表示

1231
 				if out.ID > 0 {
1231
 				if out.ID > 0 {
1232
 
1232
 
1233
 					if prescription.Niprocart > 0 {
1233
 					if prescription.Niprocart > 0 {
1234
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, niprocart, prescription.Niprocart, out.WarehouseOutOrderNumber)
1234
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, niprocart, prescription.Niprocart, out.ID)
1235
 
1235
 
1236
 						if err == gorm.ErrRecordNotFound {
1236
 						if err == gorm.ErrRecordNotFound {
1237
 							warehouseOutInfo := &models.WarehouseOutInfo{
1237
 							warehouseOutInfo := &models.WarehouseOutInfo{
1291
 					}
1291
 					}
1292
 
1292
 
1293
 					if prescription.Jms > 0 {
1293
 					if prescription.Jms > 0 {
1294
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, jms, prescription.Jms, out.WarehouseOutOrderNumber)
1294
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, jms, prescription.Jms, out.ID)
1295
 
1295
 
1296
 						if err == gorm.ErrRecordNotFound {
1296
 						if err == gorm.ErrRecordNotFound {
1297
 							warehouseOutInfo := &models.WarehouseOutInfo{
1297
 							warehouseOutInfo := &models.WarehouseOutInfo{
1353
 					}
1353
 					}
1354
 
1354
 
1355
 					if prescription.FistulaNeedleSet > 0 {
1355
 					if prescription.FistulaNeedleSet > 0 {
1356
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, fistula_needle_set, prescription.FistulaNeedleSet, out.WarehouseOutOrderNumber)
1356
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, fistula_needle_set, prescription.FistulaNeedleSet, out.ID)
1357
 
1357
 
1358
 						if err == gorm.ErrRecordNotFound {
1358
 						if err == gorm.ErrRecordNotFound {
1359
 							warehouseOutInfo := &models.WarehouseOutInfo{
1359
 							warehouseOutInfo := &models.WarehouseOutInfo{
1415
 					}
1415
 					}
1416
 
1416
 
1417
 					if prescription.FistulaNeedleSet16 > 0 {
1417
 					if prescription.FistulaNeedleSet16 > 0 {
1418
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, fistula_needle_set_16, prescription.FistulaNeedleSet16, out.WarehouseOutOrderNumber)
1418
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, fistula_needle_set_16, prescription.FistulaNeedleSet16, out.ID)
1419
 
1419
 
1420
 						if err == gorm.ErrRecordNotFound {
1420
 						if err == gorm.ErrRecordNotFound {
1421
 							warehouseOutInfo := &models.WarehouseOutInfo{
1421
 							warehouseOutInfo := &models.WarehouseOutInfo{
1476
 					}
1476
 					}
1477
 
1477
 
1478
 					if prescription.Hemoperfusion > 0 {
1478
 					if prescription.Hemoperfusion > 0 {
1479
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, hemoperfusion, prescription.Hemoperfusion, out.WarehouseOutOrderNumber)
1479
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, hemoperfusion, prescription.Hemoperfusion, out.ID)
1480
 
1480
 
1481
 						if err == gorm.ErrRecordNotFound {
1481
 						if err == gorm.ErrRecordNotFound {
1482
 							warehouseOutInfo := &models.WarehouseOutInfo{
1482
 							warehouseOutInfo := &models.WarehouseOutInfo{
1537
 					}
1537
 					}
1538
 
1538
 
1539
 					if prescription.DialyserSterilised > 0 {
1539
 					if prescription.DialyserSterilised > 0 {
1540
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, dialyser_sterilised, prescription.DialyserSterilised, out.WarehouseOutOrderNumber)
1540
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, dialyser_sterilised, prescription.DialyserSterilised, out.ID)
1541
 
1541
 
1542
 						if err == gorm.ErrRecordNotFound {
1542
 						if err == gorm.ErrRecordNotFound {
1543
 							warehouseOutInfo := &models.WarehouseOutInfo{
1543
 							warehouseOutInfo := &models.WarehouseOutInfo{
1599
 					}
1599
 					}
1600
 
1600
 
1601
 					if prescription.Filtryzer > 0 {
1601
 					if prescription.Filtryzer > 0 {
1602
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, filtryzer, prescription.Filtryzer, out.WarehouseOutOrderNumber)
1602
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, filtryzer, prescription.Filtryzer, out.ID)
1603
 
1603
 
1604
 						if err == gorm.ErrRecordNotFound {
1604
 						if err == gorm.ErrRecordNotFound {
1605
 							warehouseOutInfo := &models.WarehouseOutInfo{
1605
 							warehouseOutInfo := &models.WarehouseOutInfo{
1661
 					}
1661
 					}
1662
 
1662
 
1663
 					if prescription.Dialyzers > 0 {
1663
 					if prescription.Dialyzers > 0 {
1664
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, dialyzers, prescription.Dialyzers, out.WarehouseOutOrderNumber)
1664
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, dialyzers, prescription.Dialyzers, out.ID)
1665
 
1665
 
1666
 						if err == gorm.ErrRecordNotFound {
1666
 						if err == gorm.ErrRecordNotFound {
1667
 							warehouseOutInfo := &models.WarehouseOutInfo{
1667
 							warehouseOutInfo := &models.WarehouseOutInfo{
1723
 					}
1723
 					}
1724
 
1724
 
1725
 					if prescription.Injector > 0 {
1725
 					if prescription.Injector > 0 {
1726
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, injector, prescription.Injector, out.WarehouseOutOrderNumber)
1726
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, injector, prescription.Injector, out.ID)
1727
 
1727
 
1728
 						if err == gorm.ErrRecordNotFound {
1728
 						if err == gorm.ErrRecordNotFound {
1729
 							warehouseOutInfo := &models.WarehouseOutInfo{
1729
 							warehouseOutInfo := &models.WarehouseOutInfo{
1785
 					}
1785
 					}
1786
 
1786
 
1787
 					if prescription.Bloodlines > 0 {
1787
 					if prescription.Bloodlines > 0 {
1788
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, bloodlines, prescription.Bloodlines, out.WarehouseOutOrderNumber)
1788
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, bloodlines, prescription.Bloodlines, out.ID)
1789
 
1789
 
1790
 						if err == gorm.ErrRecordNotFound {
1790
 						if err == gorm.ErrRecordNotFound {
1791
 							warehouseOutInfo := &models.WarehouseOutInfo{
1791
 							warehouseOutInfo := &models.WarehouseOutInfo{
1847
 					}
1847
 					}
1848
 
1848
 
1849
 					if prescription.TubingHemodialysis > 0 {
1849
 					if prescription.TubingHemodialysis > 0 {
1850
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, tubingHemodialysis, prescription.TubingHemodialysis, out.WarehouseOutOrderNumber)
1850
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, tubingHemodialysis, prescription.TubingHemodialysis, out.ID)
1851
 
1851
 
1852
 						if err == gorm.ErrRecordNotFound {
1852
 						if err == gorm.ErrRecordNotFound {
1853
 							warehouseOutInfo := &models.WarehouseOutInfo{
1853
 							warehouseOutInfo := &models.WarehouseOutInfo{
1909
 					}
1909
 					}
1910
 
1910
 
1911
 					if prescription.Package > 0 {
1911
 					if prescription.Package > 0 {
1912
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, safe_package, prescription.Package, out.WarehouseOutOrderNumber)
1912
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, safe_package, prescription.Package, out.ID)
1913
 
1913
 
1914
 						if err == gorm.ErrRecordNotFound {
1914
 						if err == gorm.ErrRecordNotFound {
1915
 							warehouseOutInfo := &models.WarehouseOutInfo{
1915
 							warehouseOutInfo := &models.WarehouseOutInfo{
1971
 					}
1971
 					}
1972
 
1972
 
1973
 					if prescription.ALiquid > 0 {
1973
 					if prescription.ALiquid > 0 {
1974
-						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, aliquid, prescription.ALiquid, out.WarehouseOutOrderNumber)
1974
+						outInfo, err := service.FindStockOutInfoByTypeId(adminUserInfo.CurrentOrgId, aliquid, prescription.ALiquid, out.ID)
1975
 
1975
 
1976
 						if err == gorm.ErrRecordNotFound {
1976
 						if err == gorm.ErrRecordNotFound {
1977
 							warehouseOutInfo := &models.WarehouseOutInfo{
1977
 							warehouseOutInfo := &models.WarehouseOutInfo{
2342
 		tempassessmentAfterDislysis.InternalFistula = lastAssessmentAfterDislysis.InternalFistula
2342
 		tempassessmentAfterDislysis.InternalFistula = lastAssessmentAfterDislysis.InternalFistula
2343
 		tempassessmentAfterDislysis.Catheter = lastAssessmentAfterDislysis.Catheter
2343
 		tempassessmentAfterDislysis.Catheter = lastAssessmentAfterDislysis.Catheter
2344
 		tempassessmentAfterDislysis.Complication = lastAssessmentAfterDislysis.Complication
2344
 		tempassessmentAfterDislysis.Complication = lastAssessmentAfterDislysis.Complication
2345
-		tempassessmentAfterDislysis.Remark = lastAssessmentAfterDislysis.Remark
2346
 		tempassessmentAfterDislysis.DialysisIntakes = lastAssessmentAfterDislysis.DialysisIntakes
2345
 		tempassessmentAfterDislysis.DialysisIntakes = lastAssessmentAfterDislysis.DialysisIntakes
2347
 		tempassessmentAfterDislysis.DialysisIntakesFeed = lastAssessmentAfterDislysis.DialysisIntakesFeed
2346
 		tempassessmentAfterDislysis.DialysisIntakesFeed = lastAssessmentAfterDislysis.DialysisIntakesFeed
2348
 		tempassessmentAfterDislysis.DialysisIntakesTransfusion = lastAssessmentAfterDislysis.DialysisIntakesTransfusion
2347
 		tempassessmentAfterDislysis.DialysisIntakesTransfusion = lastAssessmentAfterDislysis.DialysisIntakesTransfusion

+ 6 - 6
controllers/mobile_api_controllers/check_weight_api_controller.go ファイルの表示

332
 
332
 
333
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
333
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
334
 
334
 
335
-	if template.TemplateId == 22 {
335
+	if template.TemplateId == 22 || template.TemplateId == 17 {
336
 		dewater_amount = dewater_amount * 1000
336
 		dewater_amount = dewater_amount * 1000
337
 	}
337
 	}
338
 
338
 
949
 	}
949
 	}
950
 
950
 
951
 	c.ServeSuccessJSON(map[string]interface{}{
951
 	c.ServeSuccessJSON(map[string]interface{}{
952
-		"dialysistype": dialysistype,
953
-		"patient":      dialysisinfo,
954
-		"schedule":     sc,
955
-		"dryweight":    dry_weight,
956
-		"after_dry_weight":    after_dry_weight,
952
+		"dialysistype":     dialysistype,
953
+		"patient":          dialysisinfo,
954
+		"schedule":         sc,
955
+		"dryweight":        dry_weight,
956
+		"after_dry_weight": after_dry_weight,
957
 	})
957
 	})
958
 	return
958
 	return
959
 }
959
 }

+ 39 - 19
controllers/mobile_api_controllers/dialysis_api_controller.go ファイルの表示

2421
 		tempassessmentAfterDislysis.InternalFistula = lastAssessmentAfterDislysis.InternalFistula
2421
 		tempassessmentAfterDislysis.InternalFistula = lastAssessmentAfterDislysis.InternalFistula
2422
 		tempassessmentAfterDislysis.Catheter = lastAssessmentAfterDislysis.Catheter
2422
 		tempassessmentAfterDislysis.Catheter = lastAssessmentAfterDislysis.Catheter
2423
 		tempassessmentAfterDislysis.Complication = lastAssessmentAfterDislysis.Complication
2423
 		tempassessmentAfterDislysis.Complication = lastAssessmentAfterDislysis.Complication
2424
-		tempassessmentAfterDislysis.Remark = lastAssessmentAfterDislysis.Remark
2425
 		tempassessmentAfterDislysis.DialysisIntakes = lastAssessmentAfterDislysis.DialysisIntakes
2424
 		tempassessmentAfterDislysis.DialysisIntakes = lastAssessmentAfterDislysis.DialysisIntakes
2426
 		tempassessmentAfterDislysis.DialysisIntakesFeed = lastAssessmentAfterDislysis.DialysisIntakesFeed
2425
 		tempassessmentAfterDislysis.DialysisIntakesFeed = lastAssessmentAfterDislysis.DialysisIntakesFeed
2427
 		tempassessmentAfterDislysis.DialysisIntakesTransfusion = lastAssessmentAfterDislysis.DialysisIntakesTransfusion
2426
 		tempassessmentAfterDislysis.DialysisIntakesTransfusion = lastAssessmentAfterDislysis.DialysisIntakesTransfusion
2800
 		hemoperfusion, _ := beego.AppConfig.Int64("hemoperfusion")
2799
 		hemoperfusion, _ := beego.AppConfig.Int64("hemoperfusion")
2801
 		dialyser_sterilised, _ := beego.AppConfig.Int64("dialyser_sterilised")
2800
 		dialyser_sterilised, _ := beego.AppConfig.Int64("dialyser_sterilised")
2802
 		filtryzer, _ := beego.AppConfig.Int64("filtryzer")
2801
 		filtryzer, _ := beego.AppConfig.Int64("filtryzer")
2803
-
2804
 		dialyzers, _ := beego.AppConfig.Int64("dialyzers")
2802
 		dialyzers, _ := beego.AppConfig.Int64("dialyzers")
2805
 		injector, _ := beego.AppConfig.Int64("injector")
2803
 		injector, _ := beego.AppConfig.Int64("injector")
2806
 		bloodlines, _ := beego.AppConfig.Int64("bloodlines")
2804
 		bloodlines, _ := beego.AppConfig.Int64("bloodlines")
3299
 						}
3297
 						}
3300
 
3298
 
3301
 					}
3299
 					}
3302
-
3303
 					if prescription.ALiquid > 0 {
3300
 					if prescription.ALiquid > 0 {
3304
 						warehouseOutInfo := &models.WarehouseOutInfo{
3301
 						warehouseOutInfo := &models.WarehouseOutInfo{
3305
 							WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
3302
 							WarehouseOutOrderNumber: warehouseOut.WarehouseOutOrderNumber,
3344
 				if out.ID > 0 {
3341
 				if out.ID > 0 {
3345
 
3342
 
3346
 					if prescription.Niprocart > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3346
 						if err == gorm.ErrRecordNotFound {
3350
 							warehouseOutInfo := &models.WarehouseOutInfo{
3347
 							warehouseOutInfo := &models.WarehouseOutInfo{
3404
 					}
3401
 					}
3405
 
3402
 
3406
 					if prescription.Jms > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3406
 						if err == gorm.ErrRecordNotFound {
3410
 							warehouseOutInfo := &models.WarehouseOutInfo{
3407
 							warehouseOutInfo := &models.WarehouseOutInfo{
3466
 					}
3463
 					}
3467
 
3464
 
3468
 					if prescription.FistulaNeedleSet > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3468
 						if err == gorm.ErrRecordNotFound {
3472
 							warehouseOutInfo := &models.WarehouseOutInfo{
3469
 							warehouseOutInfo := &models.WarehouseOutInfo{
3528
 					}
3525
 					}
3529
 
3526
 
3530
 					if prescription.FistulaNeedleSet16 > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3530
 						if err == gorm.ErrRecordNotFound {
3534
 							warehouseOutInfo := &models.WarehouseOutInfo{
3531
 							warehouseOutInfo := &models.WarehouseOutInfo{
3589
 					}
3586
 					}
3590
 
3587
 
3591
 					if prescription.Hemoperfusion > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3591
 						if err == gorm.ErrRecordNotFound {
3595
 							warehouseOutInfo := &models.WarehouseOutInfo{
3592
 							warehouseOutInfo := &models.WarehouseOutInfo{
3650
 					}
3647
 					}
3651
 
3648
 
3652
 					if prescription.DialyserSterilised > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3652
 						if err == gorm.ErrRecordNotFound {
3656
 							warehouseOutInfo := &models.WarehouseOutInfo{
3653
 							warehouseOutInfo := &models.WarehouseOutInfo{
3712
 					}
3709
 					}
3713
 
3710
 
3714
 					if prescription.Filtryzer > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3714
 						if err == gorm.ErrRecordNotFound {
3718
 							warehouseOutInfo := &models.WarehouseOutInfo{
3715
 							warehouseOutInfo := &models.WarehouseOutInfo{
3774
 					}
3771
 					}
3775
 
3772
 
3776
 					if prescription.Dialyzers > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3776
 						if err == gorm.ErrRecordNotFound {
3780
 							warehouseOutInfo := &models.WarehouseOutInfo{
3777
 							warehouseOutInfo := &models.WarehouseOutInfo{
3836
 					}
3833
 					}
3837
 
3834
 
3838
 					if prescription.Injector > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3838
 						if err == gorm.ErrRecordNotFound {
3842
 							warehouseOutInfo := &models.WarehouseOutInfo{
3839
 							warehouseOutInfo := &models.WarehouseOutInfo{
3898
 					}
3895
 					}
3899
 
3896
 
3900
 					if prescription.Bloodlines > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3900
 						if err == gorm.ErrRecordNotFound {
3904
 							warehouseOutInfo := &models.WarehouseOutInfo{
3901
 							warehouseOutInfo := &models.WarehouseOutInfo{
3960
 					}
3957
 					}
3961
 
3958
 
3962
 					if prescription.TubingHemodialysis > 0 {
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
 						if err == gorm.ErrRecordNotFound {
3962
 						if err == gorm.ErrRecordNotFound {
3966
 							warehouseOutInfo := &models.WarehouseOutInfo{
3963
 							warehouseOutInfo := &models.WarehouseOutInfo{
4022
 					}
4019
 					}
4023
 
4020
 
4024
 					if prescription.Package > 0 {
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
 						if err == gorm.ErrRecordNotFound {
4024
 						if err == gorm.ErrRecordNotFound {
4028
 							warehouseOutInfo := &models.WarehouseOutInfo{
4025
 							warehouseOutInfo := &models.WarehouseOutInfo{
4084
 					}
4081
 					}
4085
 
4082
 
4086
 					if prescription.ALiquid > 0 {
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
 						if err == gorm.ErrRecordNotFound {
4086
 						if err == gorm.ErrRecordNotFound {
4090
 							warehouseOutInfo := &models.WarehouseOutInfo{
4087
 							warehouseOutInfo := &models.WarehouseOutInfo{
4381
 				if order.ID > 0 {
4378
 				if order.ID > 0 {
4382
 					if dialysisPrescription.Niprocart != niprocart {
4379
 					if dialysisPrescription.Niprocart != niprocart {
4383
 						//不一致,先将原有的商品订单数量进行减一的操作,并将原有使用记录进行修改商品信息(根据上机的日期和商品类型id,商品id)
4380
 						//不一致,先将原有的商品订单数量进行减一的操作,并将原有使用记录进行修改商品信息(根据上机的日期和商品类型id,商品id)
4384
-
4385
 						//1.用上机透析日期查出当天的订单
4381
 						//1.用上机透析日期查出当天的订单
4386
 						_, out := service.FindStockOutOrderNumberByTime(order.DialysisDate, adminUserInfo.Org.Id)
4382
 						_, out := service.FindStockOutOrderNumberByTime(order.DialysisDate, adminUserInfo.Org.Id)
4387
 						//_, out := service.FindOldOrderInfoByGoodId(order.StartTime, adminUserInfo.Org.Id)
4383
 						//_, out := service.FindOldOrderInfoByGoodId(order.StartTime, adminUserInfo.Org.Id)
4811
 
4807
 
4812
 						//不一致,先将原有的商品订单数量进行减一的操作,并将原有使用记录进行修改商品信息(根据上机的日期和商品类型id,商品id)
4808
 						//不一致,先将原有的商品订单数量进行减一的操作,并将原有使用记录进行修改商品信息(根据上机的日期和商品类型id,商品id)
4813
 						service.UpdateOrderCount(dialyser_sterilised_good_type_id, dialysisPrescription.DialyserSterilised, out.WarehouseOutOrderNumber, adminUserInfo.Org.Id)
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
 						//判断前端更改后的商品id的出库记录在数据库中是否存在
4811
 						//判断前端更改后的商品id的出库记录在数据库中是否存在
4818
 						err, newOut := service.FindOrderInfoByGoodId(dialyser_sterilised_good_type_id, dialyser_sterilised, out.WarehouseOutOrderNumber, adminUserInfo.Org.Id)
4812
 						err, newOut := service.FindOrderInfoByGoodId(dialyser_sterilised_good_type_id, dialyser_sterilised, out.WarehouseOutOrderNumber, adminUserInfo.Org.Id)
6384
 		"patient": patientId,
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
+}

+ 2 - 2
controllers/mobile_api_controllers/login_api_controller.go ファイルの表示

32
 		return
32
 		return
33
 	}
33
 	}
34
 	ip := utils.GetIP(this.Ctx.Request)
34
 	ip := utils.GetIP(this.Ctx.Request)
35
-	ssoDomain := beego.AppConfig.String("sso_domain")
36
-	//ssoDomain := "http://localhost:8091"
35
+	//ssoDomain := beego.AppConfig.String("sso_domain")
36
+	ssoDomain := "http://localhost:8091"
37
 	api := ssoDomain + "/m/login/pwd"
37
 	api := ssoDomain + "/m/login/pwd"
38
 	values := make(url.Values)
38
 	values := make(url.Values)
39
 	values.Set("mobile", mobile)
39
 	values.Set("mobile", mobile)

+ 2 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go ファイルの表示

114
 
114
 
115
 	beego.Router("/m/api/patient/search", &PatientApiController{}, "Get:GetSearchPatient")
115
 	beego.Router("/m/api/patient/search", &PatientApiController{}, "Get:GetSearchPatient")
116
 
116
 
117
+	beego.Router("/m/api/dialysis/schedule", &DialysisAPIController{}, "Get:GetDialysisSchedule")
118
+
117
 }
119
 }

+ 0 - 1
controllers/patient_api_controller.go ファイルの表示

3801
 				patient.DryWeight = dry_weights
3801
 				patient.DryWeight = dry_weights
3802
 
3802
 
3803
 			}
3803
 			}
3804
-
3805
 			patient.CreatedTime = time.Now().Unix()
3804
 			patient.CreatedTime = time.Now().Unix()
3806
 			patient.UpdatedTime = time.Now().Unix()
3805
 			patient.UpdatedTime = time.Now().Unix()
3807
 			patient.Status = 1
3806
 			patient.Status = 1

+ 102 - 5
controllers/schedule_api_controller.go ファイルの表示

645
 
645
 
646
 func (this *ScheduleApiController) SearchSchedulePatients() {
646
 func (this *ScheduleApiController) SearchSchedulePatients() {
647
 	keywords := this.GetString("keywords")
647
 	keywords := this.GetString("keywords")
648
-	adminUserInfo := this.GetAdminUserInfo()
649
-	list, _ := service.GetSchedualPatientsByKeywords(keywords, adminUserInfo.CurrentOrgId)
650
-	this.ServeSuccessJSON(map[string]interface{}{
651
-		"schdules": list,
652
-	})
648
+	week_type, _ := this.GetInt64("week_type", 0)
649
+
650
+	thisTime1 := time.Now()
651
+	thisTime2 := time.Now()
652
+
653
+	thisTime1 = thisTime1.AddDate(0, 0, 7)
654
+	thisTime2 = thisTime2.AddDate(0, 0, 14)
655
+
656
+	var start_time string
657
+	var end_time string
658
+
659
+	switch week_type {
660
+	case 1:
661
+
662
+		adminUserInfo := this.GetAdminUserInfo()
663
+		list, _ := service.GetSchedualPatientsByKeywords(keywords, adminUserInfo.CurrentOrgId)
664
+		this.ServeSuccessJSON(map[string]interface{}{
665
+			"schdules": list,
666
+		})
667
+
668
+		break
669
+	case 2:
670
+		days := make([]string, 0)
671
+
672
+		weekDay1 := int(thisTime1.Weekday())
673
+		if weekDay1 == 0 {
674
+			weekDay1 = 7
675
+		}
676
+		weekEnd1 := 7 - weekDay1
677
+		weekStart1 := weekEnd1 - 6
678
+		for index := weekStart1; index <= weekEnd1; index++ {
679
+			theDay := thisTime1.AddDate(0, 0, index)
680
+			days = append(days, theDay.Format("2006-01-02"))
681
+			if index == 0 {
682
+				start_time = theDay.Format("2006-01-02")
683
+			}
684
+
685
+			end_time = theDay.Format("2006-01-02")
686
+		}
687
+
688
+		timeLayout := "2006-01-02"
689
+		loc, _ := time.LoadLocation("Local")
690
+
691
+		var theStartTime int64
692
+		if len(start_time) > 0 {
693
+			theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
694
+			theStartTime = theTime.Unix()
695
+		}
696
+		var theEndtTime int64
697
+		if len(end_time) > 0 {
698
+			theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
699
+			theEndtTime = theTime.Unix()
700
+		}
701
+
702
+		adminUserInfo := this.GetAdminUserInfo()
703
+		list, _ := service.GetSchedualPatientsByKeywordsAndWeek(keywords, adminUserInfo.CurrentOrgId, theStartTime, theEndtTime)
704
+		this.ServeSuccessJSON(map[string]interface{}{
705
+			"schdules": list,
706
+		})
707
+
708
+		break
709
+	case 3:
710
+		days := make([]string, 0)
711
+
712
+		weekDay2 := int(thisTime2.Weekday())
713
+		if weekDay2 == 0 {
714
+			weekDay2 = 7
715
+		}
716
+		weekEnd2 := 7 - weekDay2
717
+		weekStart2 := weekEnd2 - 6
718
+		for index := weekStart2; index <= weekEnd2; index++ {
719
+			theDay := thisTime2.AddDate(0, 0, index)
720
+			days = append(days, theDay.Format("2006-01-02"))
721
+			if index == 0 {
722
+				start_time = theDay.Format("2006-01-02")
723
+			}
724
+
725
+			end_time = theDay.Format("2006-01-02")
726
+		}
727
+
728
+		timeLayout := "2006-01-02"
729
+		loc, _ := time.LoadLocation("Local")
730
+
731
+		var theStartTime int64
732
+		if len(start_time) > 0 {
733
+			theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
734
+			theStartTime = theTime.Unix()
735
+		}
736
+		var theEndtTime int64
737
+		if len(end_time) > 0 {
738
+			theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
739
+			theEndtTime = theTime.Unix()
740
+		}
741
+
742
+		adminUserInfo := this.GetAdminUserInfo()
743
+		list, _ := service.GetSchedualPatientsByKeywordsAndWeek(keywords, adminUserInfo.CurrentOrgId, theStartTime, theEndtTime)
744
+		this.ServeSuccessJSON(map[string]interface{}{
745
+			"schdules": list,
746
+		})
747
+
748
+		break
749
+	}
653
 
750
 
654
 }
751
 }
655
 
752
 

+ 1 - 1
routers/router.go ファイルの表示

35
 	controllers.ScheduleApiRegistRouters()
35
 	controllers.ScheduleApiRegistRouters()
36
 	controllers.SignWeighAPIControllerRegistRouters()
36
 	controllers.SignWeighAPIControllerRegistRouters()
37
 	controllers.InvoiceApiRegistRouters()
37
 	controllers.InvoiceApiRegistRouters()
38
-	//controllers.StockApiRegistRouters()
38
+	controllers.StockApiRegistRouters()
39
 	controllers.StockGoodApiRegistRouters()
39
 	controllers.StockGoodApiRegistRouters()
40
 	controllers.StockManagerApiRegistRouters()
40
 	controllers.StockManagerApiRegistRouters()
41
 	controllers.PatientScheduleTemplateAPIControllerRegistRouters()
41
 	controllers.PatientScheduleTemplateAPIControllerRegistRouters()

+ 1 - 1
service/patient_service.go ファイルの表示

291
 
291
 
292
 func EditPatientLapseto(patient *models.Patients, lapseto *models.PatientLapseto) (err error) {
292
 func EditPatientLapseto(patient *models.Patients, lapseto *models.PatientLapseto) (err error) {
293
 	utx := writeDb.Begin()
293
 	utx := writeDb.Begin()
294
-	err = utx.Model(&models.Patients{}).Where("id=?", patient.ID).Update(map[string]interface{}{"Lapseto": patient.Lapseto}).Error
294
+	err = utx.Model(&models.Patients{}).Where("id=?", patient.ID).Update(map[string]interface{}{"lapseto": patient.Lapseto}).Error
295
 	//err = utx.Model(&models.PatientLapseto{}).Where("id=?", patient.ID).Update(map[string]interface{}{"lapseto_type": patient.Lapseto, "lapseto_time": time.Now().Unix(), "updated_time": time.Now().Unix()}).Error
295
 	//err = utx.Model(&models.PatientLapseto{}).Where("id=?", patient.ID).Update(map[string]interface{}{"lapseto_type": patient.Lapseto, "lapseto_time": time.Now().Unix(), "updated_time": time.Now().Unix()}).Error
296
 	if err != nil {
296
 	if err != nil {
297
 		utx.Rollback()
297
 		utx.Rollback()

+ 17 - 0
service/schedule_service.go ファイルの表示

213
 // 	return nil
213
 // 	return nil
214
 // }
214
 // }
215
 
215
 
216
+func GetSchedualPatientsByKeywordsAndWeek(keywords string, org_id int64, start_time int64, end_time int64) (schedule []*models.Schedule, err error) {
217
+	likeKey := "%" + keywords + "%"
218
+	err = readDb.
219
+		Table("xt_schedule as s").
220
+		Preload("PatientInfectiousDiseases", "status = 1 ").
221
+		Preload("DeviceZone", "status = 1 ").
222
+		Preload("DeviceNumber", "status = 1 ").
223
+		Preload("TreatmentMode", "status = 1 ").
224
+		Joins("JOIN xt_patients as p ON p.id = s.patient_id AND (p.name LIKE ? OR p.dialysis_no LIKE ?)", likeKey, likeKey).
225
+		Where("s.user_org_id=? and s.schedule_date >= ? and s.schedule_date <= ? and s.status=1", org_id, start_time, end_time).
226
+		Select("s.id, s.user_org_id, s.partition_id, s.bed_id, s.patient_id, s.schedule_date, s.schedule_type, s.schedule_week, s.mode_id, s.status, s.created_time, s.updated_time, p.name as patient").
227
+		Order("schedule_date asc").
228
+		Find(&schedule).Error
229
+	return
230
+
231
+}
232
+
216
 func GetSchedualPatientsByKeywords(keywords string, org_id int64) (schedule []*models.Schedule, err error) {
233
 func GetSchedualPatientsByKeywords(keywords string, org_id int64) (schedule []*models.Schedule, err error) {
217
 	likeKey := "%" + keywords + "%"
234
 	likeKey := "%" + keywords + "%"
218
 
235
 

+ 2 - 2
service/stock_service.go ファイルの表示

1215
 
1215
 
1216
 }
1216
 }
1217
 
1217
 
1218
-func FindStockOutInfoByTypeId(org_id int64, good_type_id int64, good_id int64, number string) (out models.WarehouseOutInfo, err error) {
1219
-	err = readDb.Model(&models.WarehouseOutInfo{}).Where("status = 1 AND org_id = ? AND good_type_id = ? AND good_id = ? AND is_sys = 1 AND  warehouse_out_order_number = ?", org_id, good_type_id, good_id, number).First(&out).Error
1218
+func FindStockOutInfoByTypeId(org_id int64, good_type_id int64, good_id int64, out_id int64) (out models.WarehouseOutInfo, err error) {
1219
+	err = readDb.Model(&models.WarehouseOutInfo{}).Where("status = 1 AND org_id = ? AND good_type_id = ? AND good_id = ? AND is_sys = 1 AND  warehouse_out_id = ?", org_id, good_type_id, good_id, out_id).First(&out).Error
1220
 	return
1220
 	return
1221
 }
1221
 }
1222
 
1222