Browse Source

修改redis清除数据时间

csx 4 years ago
parent
commit
ef8dab4438

+ 3 - 3
conf/app.conf View File

@@ -143,7 +143,7 @@ aliquid = 83
143 143
 [dev]
144 144
 mobile_token_expiration_second = 3600
145 145
 httpdomain = http://new_mobile.xt.api.sgjyun.com
146
-sso_domain = http://testsso.sgjyun.com
146
+sso_domain = http://localhost:8081
147 147
 front_end_domain = "http://xt.test.sgjyun.com/#"
148 148
 
149 149
 readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
@@ -215,8 +215,8 @@ writesgjpatientmysqlname = sgj_patient
215 215
 
216 216
 
217 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 220
 redisport = 6379
221 221
 redispasswrod = 123456
222 222
 redisdb = 0

+ 13 - 14
controllers/dialysis_record_api_controller.go View File

@@ -1231,7 +1231,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1231 1231
 				if out.ID > 0 {
1232 1232
 
1233 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 1236
 						if err == gorm.ErrRecordNotFound {
1237 1237
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1291,7 +1291,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1291 1291
 					}
1292 1292
 
1293 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 1296
 						if err == gorm.ErrRecordNotFound {
1297 1297
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1353,7 +1353,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1353 1353
 					}
1354 1354
 
1355 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 1358
 						if err == gorm.ErrRecordNotFound {
1359 1359
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1415,7 +1415,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1415 1415
 					}
1416 1416
 
1417 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 1420
 						if err == gorm.ErrRecordNotFound {
1421 1421
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1476,7 +1476,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1476 1476
 					}
1477 1477
 
1478 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 1481
 						if err == gorm.ErrRecordNotFound {
1482 1482
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1537,7 +1537,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1537 1537
 					}
1538 1538
 
1539 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 1542
 						if err == gorm.ErrRecordNotFound {
1543 1543
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1599,7 +1599,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1599 1599
 					}
1600 1600
 
1601 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 1604
 						if err == gorm.ErrRecordNotFound {
1605 1605
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1661,7 +1661,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1661 1661
 					}
1662 1662
 
1663 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 1666
 						if err == gorm.ErrRecordNotFound {
1667 1667
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1723,7 +1723,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1723 1723
 					}
1724 1724
 
1725 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 1728
 						if err == gorm.ErrRecordNotFound {
1729 1729
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1785,7 +1785,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1785 1785
 					}
1786 1786
 
1787 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 1790
 						if err == gorm.ErrRecordNotFound {
1791 1791
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1847,7 +1847,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1847 1847
 					}
1848 1848
 
1849 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 1852
 						if err == gorm.ErrRecordNotFound {
1853 1853
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1909,7 +1909,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1909 1909
 					}
1910 1910
 
1911 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 1914
 						if err == gorm.ErrRecordNotFound {
1915 1915
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -1971,7 +1971,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1971 1971
 					}
1972 1972
 
1973 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 1976
 						if err == gorm.ErrRecordNotFound {
1977 1977
 							warehouseOutInfo := &models.WarehouseOutInfo{
@@ -2342,7 +2342,6 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
2342 2342
 		tempassessmentAfterDislysis.InternalFistula = lastAssessmentAfterDislysis.InternalFistula
2343 2343
 		tempassessmentAfterDislysis.Catheter = lastAssessmentAfterDislysis.Catheter
2344 2344
 		tempassessmentAfterDislysis.Complication = lastAssessmentAfterDislysis.Complication
2345
-		tempassessmentAfterDislysis.Remark = lastAssessmentAfterDislysis.Remark
2346 2345
 		tempassessmentAfterDislysis.DialysisIntakes = lastAssessmentAfterDislysis.DialysisIntakes
2347 2346
 		tempassessmentAfterDislysis.DialysisIntakesFeed = lastAssessmentAfterDislysis.DialysisIntakesFeed
2348 2347
 		tempassessmentAfterDislysis.DialysisIntakesTransfusion = lastAssessmentAfterDislysis.DialysisIntakesTransfusion

+ 6 - 6
controllers/mobile_api_controllers/check_weight_api_controller.go View File

@@ -332,7 +332,7 @@ func (c *CheckWeightApiController) SavePatientInfoDialysis() {
332 332
 
333 333
 	template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
334 334
 
335
-	if template.TemplateId == 22 {
335
+	if template.TemplateId == 22 || template.TemplateId == 17 {
336 336
 		dewater_amount = dewater_amount * 1000
337 337
 	}
338 338
 
@@ -949,11 +949,11 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
949 949
 	}
950 950
 
951 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 958
 	return
959 959
 }

+ 39 - 19
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -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
+}

+ 2 - 2
controllers/mobile_api_controllers/login_api_controller.go View File

@@ -32,8 +32,8 @@ func (this *LoginAPIController) LoginByPwd() {
32 32
 		return
33 33
 	}
34 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 37
 	api := ssoDomain + "/m/login/pwd"
38 38
 	values := make(url.Values)
39 39
 	values.Set("mobile", mobile)

+ 2 - 0
controllers/mobile_api_controllers/mobile_api_router_register.go View File

@@ -114,4 +114,6 @@ func MobileAPIControllersRegisterRouters() {
114 114
 
115 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 View File

@@ -3801,7 +3801,6 @@ func (c *PatientApiController) ExportPatients() {
3801 3801
 				patient.DryWeight = dry_weights
3802 3802
 
3803 3803
 			}
3804
-
3805 3804
 			patient.CreatedTime = time.Now().Unix()
3806 3805
 			patient.UpdatedTime = time.Now().Unix()
3807 3806
 			patient.Status = 1

+ 102 - 5
controllers/schedule_api_controller.go View File

@@ -645,11 +645,108 @@ func (this *ScheduleApiController) UrgentScheduleData() {
645 645
 
646 646
 func (this *ScheduleApiController) SearchSchedulePatients() {
647 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 View File

@@ -35,7 +35,7 @@ func init() {
35 35
 	controllers.ScheduleApiRegistRouters()
36 36
 	controllers.SignWeighAPIControllerRegistRouters()
37 37
 	controllers.InvoiceApiRegistRouters()
38
-	//controllers.StockApiRegistRouters()
38
+	controllers.StockApiRegistRouters()
39 39
 	controllers.StockGoodApiRegistRouters()
40 40
 	controllers.StockManagerApiRegistRouters()
41 41
 	controllers.PatientScheduleTemplateAPIControllerRegistRouters()

+ 1 - 1
service/patient_service.go View File

@@ -291,7 +291,7 @@ func CreatePatientsNew(patientsNew *models.XtPatientsNew) error {
291 291
 
292 292
 func EditPatientLapseto(patient *models.Patients, lapseto *models.PatientLapseto) (err error) {
293 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 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 296
 	if err != nil {
297 297
 		utx.Rollback()

+ 17 - 0
service/schedule_service.go View File

@@ -213,6 +213,23 @@ func GetPrinitWeekSchedules(orgID int64, start, end int64) ([]*WeekSchedulePrint
213 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 233
 func GetSchedualPatientsByKeywords(keywords string, org_id int64) (schedule []*models.Schedule, err error) {
217 234
 	likeKey := "%" + keywords + "%"
218 235
 

+ 2 - 2
service/stock_service.go View File

@@ -1215,8 +1215,8 @@ func AddSigleAutoReduceRecordInfo(detail *models.AutomaticReduceDetail) error {
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 1220
 	return
1221 1221
 }
1222 1222