Bladeren bron

库存调拨修改

28169 2 jaren geleden
bovenliggende
commit
cf2e8a1ccc

+ 2 - 3
controllers/dialysis_api_controller.go Bestand weergeven

@@ -3120,7 +3120,6 @@ func (c *DialysisApiController) GetDialysisOrder() {
3120 3120
 
3121 3121
 }
3122 3122
 
3123
-//
3124 3123
 func (c *DialysisApiController) GetLongAdvice() {
3125 3124
 	patient_id, _ := c.GetInt64("patient_id")
3126 3125
 	adminUserInfo := c.GetAdminUserInfo()
@@ -3862,7 +3861,7 @@ func (this *DialysisApiController) GetTodayMonitor() {
3862 3861
 			}
3863 3862
 
3864 3863
 			//长沙南雅
3865
-			if adminInfo.CurrentOrgId == 10395 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10340 || adminInfo.CurrentOrgId == 10432 || adminInfo.CurrentOrgId == 10441 || adminInfo.CurrentOrgId == 10445 {
3864
+			if adminInfo.CurrentOrgId == 10395 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10340 || adminInfo.CurrentOrgId == 10432 || adminInfo.CurrentOrgId == 10441 || adminInfo.CurrentOrgId == 10445 || adminInfo.CurrentOrgId == 9829 {
3866 3865
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / 1000 / float64(totalMin) * 1000)
3867 3866
 
3868 3867
 				record.UltrafiltrationRate = ultrafiltration_rate
@@ -4349,7 +4348,7 @@ func (c *DialysisApiController) GetInitPrintDataOne() {
4349 4348
 	}
4350 4349
 }
4351 4350
 
4352
-//新接口
4351
+// 新接口
4353 4352
 func (this *DialysisApiController) GetPatientDialysisSolutionGroupList() {
4354 4353
 
4355 4354
 	keyword := this.GetString("keywords")

+ 13 - 1
controllers/dialysis_record_api_controller.go Bestand weergeven

@@ -1181,6 +1181,12 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1181 1181
 				record.BreathingRate = "20"
1182 1182
 			}
1183 1183
 
1184
+			//针对蓬安济民
1185
+			if adminUserInfo.CurrentOrgId == 9829 {
1186
+				record.Temperature = 36.5
1187
+				record.PulseFrequency = 80
1188
+			}
1189
+
1184 1190
 			//针对兰溪人民医院的需求
1185 1191
 			if adminUserInfo.CurrentOrgId == 10432 {
1186 1192
 				befor, _ := service.GetAssessmentBefor(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
@@ -1375,6 +1381,12 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1375 1381
 		if adminUserInfo.CurrentOrgId == 10447 || adminUserInfo.CurrentOrgId == 9675 {
1376 1382
 			tempassessmentAfterDislysis.Temperature = endmonitorRecords.Temperature
1377 1383
 		}
1384
+
1385
+		//针对蓬安
1386
+		if adminUserInfo.CurrentOrgId == 9829 {
1387
+			tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
1388
+			tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
1389
+		}
1378 1390
 	}
1379 1391
 
1380 1392
 	if adminUserInfo.CurrentOrgId == 9583 {
@@ -1458,7 +1470,7 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1458 1470
 
1459 1471
 	err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)
1460 1472
 
1461
-	if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10340 || adminUserInfo.CurrentOrgId == 10414 || adminUserInfo.CurrentOrgId == 10432 || adminUserInfo.CurrentOrgId == 10445 {
1473
+	if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 9675 || adminUserInfo.CurrentOrgId == 10164 || adminUserInfo.CurrentOrgId == 10340 || adminUserInfo.CurrentOrgId == 10414 || adminUserInfo.CurrentOrgId == 10432 || adminUserInfo.CurrentOrgId == 10445 || adminUserInfo.CurrentOrgId == 9829 {
1462 1474
 
1463 1475
 		evaluation, _ := service.MobileGetPredialysisEvaluationTwo(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1464 1476
 		if evaluation.SystolicBloodPressure == 0 {

+ 22 - 9
controllers/mobile_api_controllers/dialysis_api_controller.go Bestand weergeven

@@ -1898,7 +1898,7 @@ func (c *DialysisAPIController) Finish() {
1898 1898
 
1899 1899
 	}
1900 1900
 
1901
-	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 {
1901
+	if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 {
1902 1902
 		evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
1903 1903
 		if evaluation.SystolicBloodPressure == 0 {
1904 1904
 			evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
@@ -1995,6 +1995,11 @@ func (c *DialysisAPIController) Finish() {
1995 1995
 		tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
1996 1996
 	}
1997 1997
 
1998
+	if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 9829 {
1999
+		tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
2000
+		tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
2001
+	}
2002
+
1998 2003
 	if lastAssessmentAfterDislysis != nil {
1999 2004
 		tempassessmentAfterDislysis.BloodPressureType = lastAssessmentAfterDislysis.BloodPressureType
2000 2005
 
@@ -2548,6 +2553,11 @@ func (this *DialysisAPIController) StartDialysis() {
2548 2553
 			record.DiastolicBloodPressure = befor.DiastolicBloodPressure
2549 2554
 			record.BreathingRate = befor.BreathingRate
2550 2555
 		}
2556
+
2557
+		if adminUserInfo.Org.Id == 9829 {
2558
+			record.PulseFrequency = 80
2559
+			record.Temperature = 36.5
2560
+		}
2551 2561
 		err := service.CreateMonitor(&record)
2552 2562
 
2553 2563
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":monitor_records"
@@ -3164,7 +3174,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
3164 3174
 				record.UltrafiltrationRate = ultrafiltration_rate
3165 3175
 			}
3166 3176
 
3167
-			if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 {
3177
+			if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 {
3168 3178
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / 1000 / float64(totalMin) * 1000)
3169 3179
 				record.UltrafiltrationRate = ultrafiltration_rate
3170 3180
 			}
@@ -3402,11 +3412,9 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
3402 3412
 		ScheduleRemark:         schedule_remark,
3403 3413
 	}
3404 3414
 
3415
+	//修改床位号需要重新消毒
3405 3416
 	if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10445 {
3406
-
3407
-		if tempDialysisRecord.BedID != bedID {
3408
-			service.UpdateDeviceInformation(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
3409
-		}
3417
+		service.UpdateDeviceInformation(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
3410 3418
 	}
3411 3419
 
3412 3420
 	updateErr := service.ModifyStartDialysisOrder(dialysisRecord)
@@ -4790,6 +4798,10 @@ func (c *DialysisAPIController) CreateStockOutInfo() {
4790 4798
 				for _, item := range consumables {
4791 4799
 					//出库
4792 4800
 					err := service.ConsumablesGoodDelivery(item.UserOrgId, patient_id, record_time, item, &warehouseOut, item.Count)
4801
+
4802
+					//err := service.ConsumableMobileDelivery(item.UserOrgId, patient_id, record_time, item, &warehouseOut, adminInfo.AdminUser.Id, item.Count)
4803
+					//fmt.Println("item----------------------------------count", item.Count)
4804
+
4793 4805
 					if err == nil {
4794 4806
 						goodErrcode := models.XtGoodErrcode{
4795 4807
 							UserOrgId:      adminInfo.Org.Id,
@@ -4940,6 +4952,8 @@ func (c *DialysisAPIController) CreateStockOutInfo() {
4940 4952
 			for _, item := range consumables {
4941 4953
 				//出库
4942 4954
 				err := service.ConsumablesGoodDelivery(item.UserOrgId, patient_id, record_time, item, &out, item.Count)
4955
+				//err := service.ConsumableMobileDelivery(item.UserOrgId, patient_id, record_time, item, &out, adminInfo.AdminUser.Id, item.Count)
4956
+				//fmt.Println("item----------------------------------count", item.Count)
4943 4957
 				if err != nil {
4944 4958
 					goodErrcode := models.XtGoodErrcode{
4945 4959
 						UserOrgId:      adminInfo.Org.Id,
@@ -5213,6 +5227,7 @@ func (c *DialysisAPIController) EditConsumables() {
5213 5227
 
5214 5228
 				fmt.Println("退库长度", len(cancelbefor))
5215 5229
 				fmt.Println("出库长度", len(outbefor))
5230
+
5216 5231
 				//退库
5217 5232
 				for _, item := range cancelbefor {
5218 5233
 					warehouseOut, _ := service.FindStockOutByIsSys(adminInfo.Org.Id, 1, record_time)
@@ -5258,7 +5273,6 @@ func (c *DialysisAPIController) EditConsumables() {
5258 5273
 					warehouseOutInfo.LicenseNumber = stockInInfo.LicenseNumber
5259 5274
 					warehouseOutInfo.WarehouseInfotId = stockInInfo.ID
5260 5275
 					//查找当天是否存在出库记录
5261
-
5262 5276
 					_, errcod := service.GetWarehouseOutInfoIsExistOne(item.GoodId, patient_id, record_time, 0)
5263 5277
 
5264 5278
 					if errcod == gorm.ErrRecordNotFound {
@@ -5358,6 +5372,7 @@ func (c *DialysisAPIController) EditConsumables() {
5358 5372
 							StorehouseId:            houseConfig.StorehouseOutInfo,
5359 5373
 						}
5360 5374
 						exsit, errflows := service.GetStockFlowIsExsit(warehouseOutInfos.WarehouseInfotId, patient_id, record_time, item.GoodId)
5375
+
5361 5376
 						if errflows == gorm.ErrRecordNotFound {
5362 5377
 							//创建流水表
5363 5378
 							service.CreateStockFlowOne(stockFlow)
@@ -5478,8 +5493,6 @@ func (c *DialysisAPIController) EditConsumables() {
5478 5493
 
5479 5494
 					}
5480 5495
 
5481
-					//比较剩余库存 和 当前相差的数量,库存剩余量大于则正常出库
5482
-
5483 5496
 					//查询该耗材的总库存
5484 5497
 					wareinfo, _ := service.GetStockGoodCount(item.GoodId)
5485 5498
 					// 如果库存差大于剩余库存则提示库存不足