Преглед на файлове

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

陈少旭 преди 7 месеца
родител
ревизия
ff4d57b01c

BIN
XT_New.exe Целия файл


+ 6 - 6
controllers/base_api_controller.go Целия файл

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10666 //机构id
86
+		subscibe.OrgId = 10644 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,8 +93,8 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10666 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 12039 //4
96
+		adminUserInfo.CurrentOrgId = 10644 //机构id小英9675或4
97
+		adminUserInfo.CurrentAppId = 17634 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
100 100
 		this.SetSession("admin_user_info", &adminUserInfo)
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10666 //机构id小英9675或4
332
+		subscibe.OrgId = 10644 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,8 +339,8 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10666 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 12039 //4
342
+		adminUserInfo.CurrentOrgId = 10644 //机构id小英9675或4
343
+		adminUserInfo.CurrentAppId = 17634 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes
346 346
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 3 - 1
controllers/dialysis_api_controller.go Целия файл

@@ -2585,6 +2585,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2585 2585
 				dewater_amount = 0
2586 2586
 			}
2587 2587
 
2588
+			fmt.Println("dewater_amount----------------", dewater_amount)
2588 2589
 			// 计算透析处方的相关超滤量
2589 2590
 			schedual, _ := service.MobileGetSchedualDetailSix(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
2590 2591
 			var lastDialysisPrescribe *models.DialysisPrescription
@@ -4404,6 +4405,7 @@ func (c *DialysisApiController) GetDialysisOrder() {
4404 4405
 	nurse, err := service.FindPunctureNurse(order.PunctureNurse, adminUserInfo.CurrentAppId, adminUserInfo.CurrentOrgId)
4405 4406
 
4406 4407
 	startNuse, err := service.FindeStartNuse(order.StartNurse, adminUserInfo.CurrentAppId, adminUserInfo.CurrentOrgId)
4408
+
4407 4409
 	FinishNuse, err := service.FindeStartNuse(order.FinishNurse, adminUserInfo.CurrentAppId, adminUserInfo.CurrentOrgId)
4408 4410
 	//获取透析处方
4409 4411
 	dialysisway, err := service.FindDialysisWay(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
@@ -5440,7 +5442,7 @@ func (this *DialysisApiController) GetTodayMonitor() {
5440 5442
 			if adminInfo.CurrentOrgId == 10694 || adminInfo.CurrentOrgId == 10697 {
5441 5443
 
5442 5444
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
5443
-				ultrafiltration_rate = ultrafiltration_rate / 1000
5445
+				ultrafiltration_rate = ultrafiltration_rate
5444 5446
 			}
5445 5447
 
5446 5448
 		}

+ 47 - 7
controllers/dialysis_record_api_controller.go Целия файл

@@ -1331,6 +1331,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1331 1331
 		}
1332 1332
 
1333 1333
 		var ultrafiltration_rate float64
1334
+		var ultrafiltration_rate_one string
1334 1335
 		_, prescription := service.FindDialysisPrescriptionByReordDate(patientID, schedulestartTime, adminUserInfo.CurrentOrgId)
1335 1336
 
1336 1337
 		//获取预增水量
@@ -1383,6 +1384,12 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1383 1384
 					}
1384 1385
 				}
1385 1386
 
1387
+				if adminUserInfo.CurrentOrgId == 10693 {
1388
+					ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
1389
+					ultrafiltration_rate_one = strconv.FormatFloat(ultrafiltration_rate, 'f', -1, 64)
1390
+
1391
+				}
1392
+
1386 1393
 				if adminUserInfo.CurrentOrgId == 10694 || adminUserInfo.CurrentOrgId == 10697 {
1387 1394
 
1388 1395
 					ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
@@ -1398,13 +1405,14 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1398 1405
 			MonitoringDate:  schedulestartTime,
1399 1406
 			OperateTime:     startDate.Unix(),
1400 1407
 			// MonitoringTime:            recordTime,
1401
-			MonitoringNurse:       nurseID,
1402
-			Dispose:               tempdispose,
1403
-			UltrafiltrationRate:   ultrafiltration_rate,
1404
-			UltrafiltrationVolume: 0,
1405
-			Status:                1,
1406
-			CreatedTime:           time.Now().Unix(),
1407
-			UpdatedTime:           time.Now().Unix(),
1408
+			MonitoringNurse:        nurseID,
1409
+			Dispose:                tempdispose,
1410
+			UltrafiltrationRate:    ultrafiltration_rate,
1411
+			UltrafiltrationRateOne: ultrafiltration_rate_one,
1412
+			UltrafiltrationVolume:  0,
1413
+			Status:                 1,
1414
+			CreatedTime:            time.Now().Unix(),
1415
+			UpdatedTime:            time.Now().Unix(),
1408 1416
 		}
1409 1417
 
1410 1418
 		//只针对广慈医院
@@ -1422,6 +1430,19 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1422 1430
 			}
1423 1431
 		}
1424 1432
 
1433
+		if adminUserInfo.CurrentOrgId == 10693 {
1434
+
1435
+			// 查询病人是否有透前评估数据
1436
+			befor, errcode := service.GetAssessmentBefor(adminUserInfo.CurrentOrgId, patientID, recordDate.Unix())
1437
+			if errcode == nil {
1438
+				record.MonitorSystolicBloodPressureOne = strconv.FormatFloat(befor.SystolicBloodPressure, 'f', -1, 64)
1439
+				record.MonitorDiastolicBloodPressureOne = strconv.FormatFloat(befor.DiastolicBloodPressure, 'f', -1, 64)
1440
+				record.MonitorTemperatureOne = strconv.FormatFloat(befor.Temperature, 'f', -1, 64)
1441
+				record.BreathingRate = befor.BreathingRate
1442
+			}
1443
+
1444
+		}
1445
+
1425 1446
 		// 如果当天有插入数据,则不再往透析纪录里插入数据
1426 1447
 		if newdialysisRecord.ID > 0 {
1427 1448
 
@@ -1700,6 +1721,17 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1700 1721
 			tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
1701 1722
 		}
1702 1723
 
1724
+		//孝昌
1725
+		if adminUserInfo.CurrentOrgId == 10693 {
1726
+
1727
+			MonitorSystolicBloodPressureOne, _ := strconv.ParseFloat(endmonitorRecords.MonitorSystolicBloodPressureOne, 64)
1728
+			tempassessmentAfterDislysis.SystolicBloodPressure = MonitorSystolicBloodPressureOne
1729
+
1730
+			DiastolicBloodPressure, _ := strconv.ParseFloat(endmonitorRecords.MonitorDiastolicBloodPressureOne, 64)
1731
+
1732
+			tempassessmentAfterDislysis.DiastolicBloodPressure = DiastolicBloodPressure
1733
+		}
1734
+
1703 1735
 	}
1704 1736
 
1705 1737
 	if adminUserInfo.CurrentOrgId == 9583 {
@@ -1812,6 +1844,10 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1812 1844
 			pre := models.PredialysisEvaluation{
1813 1845
 				SystolicBloodPressure: fmonitorRecords.SystolicBloodPressure,
1814 1846
 			}
1847
+			if adminUserInfo.CurrentOrgId == 10693 {
1848
+				SystolicBloodPressureOne, _ := strconv.ParseFloat(fmonitorRecords.MonitorSystolicBloodPressureOne, 64)
1849
+				evaluation.SystolicBloodPressure = SystolicBloodPressureOne
1850
+			}
1815 1851
 			fmt.Println("prew", pre)
1816 1852
 			getNurseErr := service.UpdatePredialysisEvaluation(&pre, evaluation.ID)
1817 1853
 			key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
@@ -1843,6 +1879,10 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1843 1879
 			press := models.PredialysisEvaluation{
1844 1880
 				PulseFrequency: evaluation.PulseFrequency,
1845 1881
 			}
1882
+			if adminUserInfo.CurrentOrgId == 10693 {
1883
+				DiastolicBloodPressureOne, _ := strconv.ParseFloat(fmonitorRecords.MonitorDiastolicBloodPressureOne, 64)
1884
+				evaluation.DiastolicBloodPressure = DiastolicBloodPressureOne
1885
+			}
1846 1886
 			getNurseErr := service.UpdatePredialysisEvaluationThree(&press, evaluation.ID)
1847 1887
 			key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patientID, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
1848 1888
 

+ 81 - 1
controllers/doctor_schedule_api_controller.go Целия файл

@@ -41,6 +41,12 @@ func DoctorScheduleRouters() {
41 41
 
42 42
 	beego.Router("/api/deletestaffschedulebyid", &DoctorScheduleApiController{}, "Get:DeleteStaffScheduleById")
43 43
 
44
+	beego.Router("/api/staff/savescheduleremark", &DoctorScheduleApiController{}, "Get:SaveStaffScheduleRemark")
45
+
46
+	beego.Router("/api/staff/changestaffremark", &DoctorScheduleApiController{}, "Get:ChangeStaffRemark")
47
+
48
+	beego.Router("/api/staff/getstaffscheduleremarklist", &DoctorScheduleApiController{}, "Get:GetStaffScheduleRemarkList")
49
+
44 50
 }
45 51
 
46 52
 func (this *DoctorScheduleApiController) SaveDoctorSchedules() {
@@ -309,7 +315,6 @@ func (this *DoctorScheduleApiController) AddSchedule() {
309 315
 	}
310 316
 
311 317
 	_, errcode := service.GetScheduleListDetail(doctor_id, orgId, schedule_date)
312
-	fmt.Println("errcode-----", errcode)
313 318
 	if errcode == gorm.ErrRecordNotFound {
314 319
 		err := service.AddSchedule(&schedule)
315 320
 		if err != nil {
@@ -667,3 +672,78 @@ func (this *DoctorScheduleApiController) DeleteStaffScheduleById() {
667 672
 		"msg": "ok",
668 673
 	})
669 674
 }
675
+
676
+func (this *DoctorScheduleApiController) SaveStaffScheduleRemark() {
677
+
678
+	orgId := this.GetAdminUserInfo().CurrentOrgId
679
+	admin_user_id, _ := this.GetInt64("admin_user_id")
680
+	start_time, _ := this.GetInt64("start_time")
681
+	end_time, _ := this.GetInt64("end_time")
682
+	content := this.GetString("content")
683
+	schedule := models.StaffSchedule{
684
+		DoctorId:  admin_user_id,
685
+		UserOrgId: orgId,
686
+		StartTime: start_time,
687
+		EndTime:   end_time,
688
+		Remark:    content,
689
+	}
690
+
691
+	service.UpdateSgjAdminUser(orgId, admin_user_id, content)
692
+
693
+	service.SaveStaffScheduleRemark(schedule)
694
+	this.ServeSuccessJSON(map[string]interface{}{
695
+		"msg": "ok",
696
+	})
697
+
698
+}
699
+
700
+func (this *DoctorScheduleApiController) ChangeStaffRemark() {
701
+
702
+	org_id := this.GetAdminUserInfo().CurrentOrgId
703
+
704
+	content := this.GetString("content")
705
+
706
+	start_time, _ := this.GetInt64("start_time")
707
+
708
+	end_time, _ := this.GetInt64("end_time")
709
+
710
+	scheduleRemark, _ := service.GetStaffScheduleRemark(org_id, start_time, end_time)
711
+
712
+	remark := models.XtStaffScheduleRemark{
713
+		ID:        scheduleRemark.ID,
714
+		StartTime: start_time,
715
+		EndTime:   end_time,
716
+		Remark:    content,
717
+		UserOrgId: org_id,
718
+		Status:    1,
719
+		Ctime:     0,
720
+		Mtime:     0,
721
+	}
722
+
723
+	if scheduleRemark.ID == 0 {
724
+		service.CreateStaffScheduleRemark(remark)
725
+	}
726
+
727
+	if scheduleRemark.ID > 0 {
728
+		service.SaveStaffScheduleRemarkOne(remark)
729
+	}
730
+
731
+	this.ServeSuccessJSON(map[string]interface{}{
732
+		"msg": "ok",
733
+	})
734
+}
735
+
736
+func (this *DoctorScheduleApiController) GetStaffScheduleRemarkList() {
737
+
738
+	org_id := this.GetAdminUserInfo().CurrentOrgId
739
+
740
+	start_time, _ := this.GetInt64("start_time")
741
+
742
+	end_time, _ := this.GetInt64("end_time")
743
+
744
+	scheduleRemark, _ := service.GetStaffScheduleRemark(org_id, start_time, end_time)
745
+
746
+	this.ServeSuccessJSON(map[string]interface{}{
747
+		"scheduleRemark": scheduleRemark,
748
+	})
749
+}

+ 5 - 2
controllers/manager_center_api_controller.go Целия файл

@@ -1843,9 +1843,12 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1843 1843
 	err, goodInfos := service.ModifyGoodInfo(&goodInfo)
1844 1844
 
1845 1845
 	list, _ := service.GetHisPrescripionProjectList(good_id, adminUserInfo.CurrentOrgId)
1846
-	for _, item := range list {
1847
-		service.UpdateHisPrescriptionProjectList(item.ID, sell_price)
1846
+	if len(list) > 0 {
1847
+		for _, item := range list {
1848
+			service.UpdateHisPrescriptionProjectList(item.ID, sell_price)
1849
+		}
1848 1850
 	}
1851
+
1849 1852
 	if err == nil {
1850 1853
 		c.ServeSuccessJSON(map[string]interface{}{
1851 1854
 			"goodInfo": goodInfos,

+ 87 - 2
controllers/mobile_api_controllers/dialysis_api_controller.go Целия файл

@@ -2572,6 +2572,7 @@ func (c *DialysisAPIController) Finish() {
2572 2572
 
2573 2573
 	// 获取当天的第一条透析纪录
2574 2574
 	fmonitorRecords, getMonitorRecordsErr := service.MobileGetMonitorRecordFirst(adminUserInfo.Org.Id, id, recordDate.Unix())
2575
+
2575 2576
 	if getMonitorRecordsErr != nil {
2576 2577
 		c.ErrorLog("获取透析监测记录失败:%v", getMonitorRecordsErr)
2577 2578
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -2686,12 +2687,43 @@ func (c *DialysisAPIController) Finish() {
2686 2687
 			tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume / 1000
2687 2688
 		}
2688 2689
 
2690
+		//孝康
2691
+		if adminUserInfo.Org.Id == 10693 {
2692
+			MonitorSystolicBloodPressureOne, _ := strconv.ParseFloat(endmonitorRecords.MonitorSystolicBloodPressureOne, 64)
2693
+			tempassessmentAfterDislysis.SystolicBloodPressure = MonitorSystolicBloodPressureOne
2694
+			DiastolicBloodPressure, _ := strconv.ParseFloat(endmonitorRecords.MonitorDiastolicBloodPressureOne, 64)
2695
+			tempassessmentAfterDislysis.DiastolicBloodPressure = DiastolicBloodPressure
2696
+			tempassessmentAfterDislysis.BreathingRate = endmonitorRecords.BreathingRate
2697
+
2698
+			pulseFrequency, _ := strconv.ParseFloat(endmonitorRecords.MonitorPulseFrequencyOne, 64)
2699
+			tempassessmentAfterDislysis.PulseFrequency = pulseFrequency
2700
+
2701
+			DisplacementQuantityOne, _ := strconv.ParseFloat(endmonitorRecords.DisplacementQuantityOne, 64)
2702
+			tempassessmentAfterDislysis.ActualDisplacement = DisplacementQuantityOne
2703
+
2704
+			UltrafiltrationVolumeOne, _ := strconv.ParseFloat(endmonitorRecords.UltrafiltrationVolumeOne, 64)
2705
+			tempassessmentAfterDislysis.ActualUltrafiltration = UltrafiltrationVolumeOne
2706
+
2707
+		}
2708
+
2709
+		if adminUserInfo.Org.Id == 10697 {
2710
+			lastWeightAfter, _ := service.GetLastWeightAfter(tempassessmentAfterDislysis.PatientId, tempassessmentAfterDislysis.AssessmentDate, adminUserInfo.Org.Id)
2711
+			floatAfeter := strconv.FormatFloat(lastWeightAfter.WeightAfter, 'f', -1, 64)
2712
+			lastWeightAfter.LastAfterWeight = floatAfeter
2713
+		}
2714
+
2689 2715
 	}
2690 2716
 
2691
-	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 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 || adminUserInfo.Org.Id == 10469 {
2717
+	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 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 10693 {
2692 2718
 		evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
2693 2719
 		if evaluation.SystolicBloodPressure == 0 {
2694 2720
 			evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
2721
+
2722
+			if adminUserInfo.Org.Id == 10693 {
2723
+				SystolicBloodPressureOne, _ := strconv.ParseFloat(fmonitorRecords.MonitorSystolicBloodPressureOne, 64)
2724
+				evaluation.SystolicBloodPressure = SystolicBloodPressureOne
2725
+			}
2726
+
2695 2727
 			pre := models.PredialysisEvaluation{
2696 2728
 				SystolicBloodPressure: evaluation.SystolicBloodPressure,
2697 2729
 			}
@@ -2709,9 +2741,15 @@ func (c *DialysisAPIController) Finish() {
2709 2741
 
2710 2742
 		if evaluation.DiastolicBloodPressure == 0 {
2711 2743
 			evaluation.DiastolicBloodPressure = fmonitorRecords.DiastolicBloodPressure
2744
+
2745
+			if adminUserInfo.Org.Id == 10693 {
2746
+				DiastolicBloodPressureOne, _ := strconv.ParseFloat(fmonitorRecords.MonitorDiastolicBloodPressureOne, 64)
2747
+				evaluation.DiastolicBloodPressure = DiastolicBloodPressureOne
2748
+			}
2712 2749
 			pres := models.PredialysisEvaluation{
2713 2750
 				DiastolicBloodPressure: evaluation.DiastolicBloodPressure,
2714 2751
 			}
2752
+
2715 2753
 			getNurseErr := service.UpdatePredialysisEvaluationTwo(&pres, evaluation.ID)
2716 2754
 			key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
2717 2755
 
@@ -2725,6 +2763,11 @@ func (c *DialysisAPIController) Finish() {
2725 2763
 		}
2726 2764
 		if evaluation.PulseFrequency == 0 {
2727 2765
 			evaluation.PulseFrequency = fmonitorRecords.PulseFrequency
2766
+
2767
+			if adminUserInfo.Org.Id == 10693 {
2768
+				pulseFrequency, _ := strconv.ParseFloat(endmonitorRecords.MonitorPulseFrequencyOne, 64)
2769
+				evaluation.PulseFrequency = pulseFrequency
2770
+			}
2728 2771
 			press := models.PredialysisEvaluation{
2729 2772
 				PulseFrequency: evaluation.PulseFrequency,
2730 2773
 			}
@@ -2913,6 +2956,33 @@ func (c *DialysisAPIController) Finish() {
2913 2956
 	if dialysisFinish.ID == 0 {
2914 2957
 		service.CreateDialysisFinish(finish)
2915 2958
 	}
2959
+
2960
+	//孝康
2961
+	if adminUserInfo.Org.Id == 10693 {
2962
+		MonitorSystolicBloodPressureOne, _ := strconv.ParseFloat(endmonitorRecords.MonitorSystolicBloodPressureOne, 64)
2963
+		tempassessmentAfterDislysis.SystolicBloodPressure = MonitorSystolicBloodPressureOne
2964
+
2965
+		DiastolicBloodPressure, _ := strconv.ParseFloat(endmonitorRecords.MonitorDiastolicBloodPressureOne, 64)
2966
+
2967
+		tempassessmentAfterDislysis.DiastolicBloodPressure = DiastolicBloodPressure
2968
+
2969
+		MonitorPulseFrequencyOne, _ := strconv.ParseFloat(endmonitorRecords.MonitorPulseFrequencyOne, 64)
2970
+
2971
+		tempassessmentAfterDislysis.PulseFrequency = MonitorPulseFrequencyOne
2972
+
2973
+		DisplacementQuantityOne, _ := strconv.ParseFloat(endmonitorRecords.DisplacementQuantityOne, 64)
2974
+		tempassessmentAfterDislysis.ActualDisplacement = DisplacementQuantityOne
2975
+
2976
+		UltrafiltrationVolumeOne, _ := strconv.ParseFloat(endmonitorRecords.UltrafiltrationVolumeOne, 64)
2977
+		tempassessmentAfterDislysis.ActualUltrafiltration = UltrafiltrationVolumeOne
2978
+	}
2979
+
2980
+	if adminUserInfo.Org.Id == 10697 {
2981
+		lastWeightAfter, _ := service.GetLastWeightAfter(tempassessmentAfterDislysis.PatientId, tempassessmentAfterDislysis.AssessmentDate, adminUserInfo.Org.Id)
2982
+		floatAfeter := strconv.FormatFloat(lastWeightAfter.WeightAfter, 'f', -1, 64)
2983
+		lastWeightAfter.LastAfterWeight = floatAfeter
2984
+	}
2985
+
2916 2986
 	err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)
2917 2987
 
2918 2988
 	key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_after_dislysis"
@@ -3558,6 +3628,7 @@ func (this *DialysisAPIController) StartDialysis() {
3558 3628
 				ultrafiltration_rate = ultrafiltration_rate / 1000
3559 3629
 			}
3560 3630
 
3631
+			//孝昌
3561 3632
 			if adminUserInfo.Org.Id == 10693 {
3562 3633
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3563 3634
 				ultrafiltration_rate = ultrafiltration_rate
@@ -3570,7 +3641,7 @@ func (this *DialysisAPIController) StartDialysis() {
3570 3641
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3571 3642
 				ultrafiltration_rate = ultrafiltration_rate / 1000
3572 3643
 			}
3573
-			fmt.Println("oooooooooooooooooooooooooooooo", adminUserInfo.Org.Id)
3644
+
3574 3645
 			if adminUserInfo.Org.Id == 10702 {
3575 3646
 				ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
3576 3647
 				ultrafiltration_rate = ultrafiltration_rate / 1000
@@ -3611,6 +3682,20 @@ func (this *DialysisAPIController) StartDialysis() {
3611 3682
 		}
3612 3683
 	}
3613 3684
 
3685
+	//孝昌
3686
+	if adminUserInfo.Org.Id == 10693 {
3687
+		// 查询病人是否有透前评估数据
3688
+		befor, errcode := service.GetAssessmentBefor(adminUserInfo.Org.Id, patientID, recordDate.Unix())
3689
+
3690
+		//如果有数据就插入
3691
+		if errcode == nil {
3692
+			record.MonitorSystolicBloodPressureOne = strconv.FormatFloat(befor.SystolicBloodPressure, 'f', -1, 64)
3693
+			record.MonitorDiastolicBloodPressureOne = strconv.FormatFloat(befor.DiastolicBloodPressure, 'f', -1, 64)
3694
+			record.MonitorTemperatureOne = strconv.FormatFloat(befor.Temperature, 'f', -1, 64)
3695
+			record.BreathingRate = befor.BreathingRate
3696
+		}
3697
+	}
3698
+
3614 3699
 	// 如果当天有插入数据,则不再往透析纪录里插入数据
3615 3700
 	if newdialysisRecord.ID > 0 {
3616 3701
 		if adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 {

+ 95 - 93
controllers/mobile_api_controllers/patient_api_controller.go Целия файл

@@ -1477,6 +1477,8 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1477 1477
 					}
1478 1478
 				}
1479 1479
 
1480
+				fmt.Println("total_count-------------------------------", total_count)
1481
+				fmt.Println("drug_count-------------------------------", drug_count)
1480 1482
 				if total_count == drug_count {
1481 1483
 					advice, _ := service.FindHisDoctorAdviceByIdTwo(adminInfo.Org.Id, item.ID, tx)
1482 1484
 					tx.Commit()
@@ -1495,7 +1497,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1495 1497
 
1496 1498
 				//保存处方出库
1497 1499
 				config, _ := service.GetDrugOpenConfigOne(adminInfo.Org.Id)
1498
-
1500
+				fmt.Println("config============================================")
1499 1501
 				if config.IsOpen != 1 {
1500 1502
 					//查询该药品是否有库存
1501 1503
 					houseConfig, _ := service.GetAllStoreHouseConfig(advice.UserOrgId)
@@ -1813,98 +1815,98 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1813 1815
 				}
1814 1816
 
1815 1817
 				//针对异常未出库问题的脚本
1816
-				//if adminInfo.Org.Id == 10402 {
1817
-				//
1818
-				//	newadviceInfo := &models.HisDoctorAdviceInfo{
1819
-				//		ID:                    advice.ID,
1820
-				//		UserOrgId:             advice.UserOrgId,
1821
-				//		PatientId:             advice.PatientId,
1822
-				//		HisPatientId:          advice.HisPatientId,
1823
-				//		AdviceType:            advice.AdviceType,
1824
-				//		AdviceDate:            advice.AdviceDate,
1825
-				//		StartTime:             advice.StartTime,
1826
-				//		AdviceName:            advice.AdviceName,
1827
-				//		AdviceDesc:            advice.AdviceDesc,
1828
-				//		ReminderDate:          advice.ReminderDate,
1829
-				//		SingleDose:            advice.SingleDose,
1830
-				//		SingleDoseUnit:        advice.SingleDoseUnit,
1831
-				//		PrescribingNumber:     advice.PrescribingNumber,
1832
-				//		PrescribingNumberUnit: advice.PrescribingNumberUnit,
1833
-				//		DeliveryWay:           advice.DeliveryWay,
1834
-				//		ExecutionFrequency:    advice.ExecutionFrequency,
1835
-				//		AdviceDoctor:          advice.AdviceDoctor,
1836
-				//		Status:                advice.Status,
1837
-				//		CreatedTime:           advice.CreatedTime,
1838
-				//		UpdatedTime:           advice.UpdatedTime,
1839
-				//		AdviceAffirm:          advice.AdviceAffirm,
1840
-				//		Remark:                advice.Remark,
1841
-				//		StopTime:              advice.StopTime,
1842
-				//		StopReason:            advice.StopReason,
1843
-				//		StopDoctor:            advice.StopDoctor,
1844
-				//		StopState:             advice.StopState,
1845
-				//		ParentId:              advice.ParentId,
1846
-				//		ExecutionTime:         advice.ExecutionTime,
1847
-				//		ExecutionStaff:        advice.ExecutionStaff,
1848
-				//		ExecutionState:        advice.ExecutionState,
1849
-				//		Checker:               advice.Checker,
1850
-				//		RecordDate:            advice.RecordDate,
1851
-				//		DialysisOrderId:       advice.DialysisOrderId,
1852
-				//		CheckTime:             advice.CheckTime,
1853
-				//		CheckState:            advice.CheckState,
1854
-				//		DrugSpec:              advice.DrugSpec,
1855
-				//		DrugSpecUnit:          advice.DrugSpecUnit,
1856
-				//		Groupno:               advice.Groupno,
1857
-				//		RemindType:            advice.RemindType,
1858
-				//		FrequencyType:         advice.FrequencyType,
1859
-				//		DayCount:              advice.DayCount,
1860
-				//		WeekDay:               advice.WeekDay,
1861
-				//		TemplateId:            advice.TemplateId,
1862
-				//		Modifier:              advice.Modifier,
1863
-				//		DrugId:                advice.DrugId,
1864
-				//		Price:                 advice.Price,
1865
-				//		PrescriptionId:        advice.PrescriptionId,
1866
-				//		MedListCodg:           advice.MedListCodg,
1867
-				//		FeedetlSn:             advice.FeedetlSn,
1868
-				//		Day:                   advice.DayCount,
1869
-				//		ChildDoctorAdvice:     nil,
1870
-				//		Drug:                  models.Drug{},
1871
-				//		Diagnosis:             advice.Diagnosis,
1872
-				//		Way:                   advice.Way,
1873
-				//		HospApprFlag:          advice.HospApprFlag,
1874
-				//		LmtUsedFlag:           advice.LmtUsedFlag,
1875
-				//		HisOrderInfo:          models.HisOrderInfo{},
1876
-				//		IsMedicine:            advice.IsMedicine,
1877
-				//		ExecutionFrequencyId:  advice.ExecutionFrequencyId,
1878
-				//		Child:                 nil,
1879
-				//		IsSettle:              advice.IsSettle,
1880
-				//		IsMobile:              advice.IsMobile,
1881
-				//		IsSelfDrug:            advice.IsSelfDrug,
1882
-				//		DrugWayCount:          advice.DrugWayCount,
1883
-				//	}
1884
-				//	outListExport, _ := service.GetWarehouseOutListExport(advice.DrugId, advice.PatientId, advice.AdviceDate, advice.ID)
1885
-				//
1886
-				//	var out_count int64
1887
-				//	if len(outListExport) > 0 {
1888
-				//		for _, item := range outListExport {
1889
-				//			if item.CountUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
1890
-				//				out_count = item.Count * medical.MinNumber
1891
-				//			}
1892
-				//			if item.CountUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
1893
-				//				out_count = item.Count
1894
-				//			}
1895
-				//			if item.CountUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
1896
-				//				out_count = item.Count * medical.MinNumber
1897
-				//			}
1898
-				//
1899
-				//		}
1900
-				//	}
1901
-				//	//按最小单位出库
1902
-				//	var cha_count = prescribing_number_total - out_count
1903
-				//
1904
-				//	newadviceInfo.PrescribingNumber = float64(cha_count)
1905
-				//	newadviceInfo.PrescribingNumberUnit = medical.MinUnit
1906
-				//	service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
1907
-				//}
1818
+				if adminInfo.Org.Id == 10598 {
1819
+
1820
+					newadviceInfo := &models.HisDoctorAdviceInfo{
1821
+						ID:                    advice.ID,
1822
+						UserOrgId:             advice.UserOrgId,
1823
+						PatientId:             advice.PatientId,
1824
+						HisPatientId:          advice.HisPatientId,
1825
+						AdviceType:            advice.AdviceType,
1826
+						AdviceDate:            advice.AdviceDate,
1827
+						StartTime:             advice.StartTime,
1828
+						AdviceName:            advice.AdviceName,
1829
+						AdviceDesc:            advice.AdviceDesc,
1830
+						ReminderDate:          advice.ReminderDate,
1831
+						SingleDose:            advice.SingleDose,
1832
+						SingleDoseUnit:        advice.SingleDoseUnit,
1833
+						PrescribingNumber:     advice.PrescribingNumber,
1834
+						PrescribingNumberUnit: advice.PrescribingNumberUnit,
1835
+						DeliveryWay:           advice.DeliveryWay,
1836
+						ExecutionFrequency:    advice.ExecutionFrequency,
1837
+						AdviceDoctor:          advice.AdviceDoctor,
1838
+						Status:                advice.Status,
1839
+						CreatedTime:           advice.CreatedTime,
1840
+						UpdatedTime:           advice.UpdatedTime,
1841
+						AdviceAffirm:          advice.AdviceAffirm,
1842
+						Remark:                advice.Remark,
1843
+						StopTime:              advice.StopTime,
1844
+						StopReason:            advice.StopReason,
1845
+						StopDoctor:            advice.StopDoctor,
1846
+						StopState:             advice.StopState,
1847
+						ParentId:              advice.ParentId,
1848
+						ExecutionTime:         advice.ExecutionTime,
1849
+						ExecutionStaff:        advice.ExecutionStaff,
1850
+						ExecutionState:        advice.ExecutionState,
1851
+						Checker:               advice.Checker,
1852
+						RecordDate:            advice.RecordDate,
1853
+						DialysisOrderId:       advice.DialysisOrderId,
1854
+						CheckTime:             advice.CheckTime,
1855
+						CheckState:            advice.CheckState,
1856
+						DrugSpec:              advice.DrugSpec,
1857
+						DrugSpecUnit:          advice.DrugSpecUnit,
1858
+						Groupno:               advice.Groupno,
1859
+						RemindType:            advice.RemindType,
1860
+						FrequencyType:         advice.FrequencyType,
1861
+						DayCount:              advice.DayCount,
1862
+						WeekDay:               advice.WeekDay,
1863
+						TemplateId:            advice.TemplateId,
1864
+						Modifier:              advice.Modifier,
1865
+						DrugId:                advice.DrugId,
1866
+						Price:                 advice.Price,
1867
+						PrescriptionId:        advice.PrescriptionId,
1868
+						MedListCodg:           advice.MedListCodg,
1869
+						FeedetlSn:             advice.FeedetlSn,
1870
+						Day:                   advice.DayCount,
1871
+						ChildDoctorAdvice:     nil,
1872
+						Drug:                  models.Drug{},
1873
+						Diagnosis:             advice.Diagnosis,
1874
+						Way:                   advice.Way,
1875
+						HospApprFlag:          advice.HospApprFlag,
1876
+						LmtUsedFlag:           advice.LmtUsedFlag,
1877
+						HisOrderInfo:          models.HisOrderInfo{},
1878
+						IsMedicine:            advice.IsMedicine,
1879
+						ExecutionFrequencyId:  advice.ExecutionFrequencyId,
1880
+						Child:                 nil,
1881
+						IsSettle:              advice.IsSettle,
1882
+						IsMobile:              advice.IsMobile,
1883
+						IsSelfDrug:            advice.IsSelfDrug,
1884
+						DrugWayCount:          advice.DrugWayCount,
1885
+					}
1886
+					outListExport, _ := service.GetWarehouseOutListExport(advice.DrugId, advice.PatientId, advice.AdviceDate, advice.ID)
1887
+
1888
+					var out_count int64
1889
+					if len(outListExport) > 0 {
1890
+						for _, item := range outListExport {
1891
+							if item.CountUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
1892
+								out_count = item.Count * medical.MinNumber
1893
+							}
1894
+							if item.CountUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
1895
+								out_count = item.Count
1896
+							}
1897
+							if item.CountUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
1898
+								out_count = item.Count * medical.MinNumber
1899
+							}
1900
+
1901
+						}
1902
+					}
1903
+					//按最小单位出库
1904
+					var cha_count = total_count - out_count
1905
+					fmt.Println("cha_count--------------------------------------", cha_count)
1906
+					newadviceInfo.PrescribingNumber = float64(cha_count)
1907
+					newadviceInfo.PrescribingNumberUnit = medical.MinUnit
1908
+					service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
1909
+				}
1908 1910
 
1909 1911
 			}
1910 1912
 		}

+ 5 - 2
controllers/new_mobile_api_controllers/dialysis_parameter_api_controller.go Целия файл

@@ -1,12 +1,13 @@
1 1
 package new_mobile_api_controllers
2 2
 
3 3
 import (
4
+	"fmt"
5
+	"time"
6
+
4 7
 	"XT_New/controllers/mobile_api_controllers"
5 8
 	"XT_New/enums"
6 9
 	"XT_New/service"
7
-	"fmt"
8 10
 	"github.com/jinzhu/gorm"
9
-	"time"
10 11
 )
11 12
 
12 13
 type DialysisParamerterApiController struct {
@@ -49,6 +50,7 @@ func (this *DialysisParamerterApiController) GetMobileDialysisParameters() {
49 50
 			prescription, _ := service.GetDialysisPrescriptionList(item.PatientId, orgid, theTime.Unix())
50 51
 			vlist = append(vlist, prescription)
51 52
 			dialysis, _ := service.GetAssessmentBeforDialysisByStartime(item.PatientId, orgid, theTime.Unix())
53
+
52 54
 			elist = append(elist, dialysis)
53 55
 			if err == nil {
54 56
 				this.ServeSuccessJSON(map[string]interface{}{
@@ -72,6 +74,7 @@ func (this *DialysisParamerterApiController) GetMobileDialysisParameters() {
72 74
 			prescription, _ := service.GetDialysisPrescriptionList(item.PatientId, orgid, theTime.Unix())
73 75
 			vlist = append(vlist, prescription)
74 76
 			dialysis, _ := service.GetAssessmentBeforDialysisByStartime(item.PatientId, orgid, theTime.Unix())
77
+			fmt.Println("dialysis-------------------------------------------", dialysis)
75 78
 			elist = append(elist, dialysis)
76 79
 		}
77 80
 		if err == nil {

+ 1 - 0
models/dialysis.go Целия файл

@@ -1105,6 +1105,7 @@ type SgjUserAdminRole struct {
1105 1105
 	OrgLogo       string `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
1106 1106
 	Creator       int64  `gorm:"column:creator" json:"creator" form:"creator"`
1107 1107
 	JobNumber     string `gorm:"column:job_number" json:"job_number" form:"job_number"`
1108
+	Remark        string `gorm:"column:remark" json:"remark" form:"remark"`
1108 1109
 }
1109 1110
 
1110 1111
 func (SgjUserAdminRole) TableName() string {

+ 29 - 12
models/doctor_schedule_models.go Целия файл

@@ -24,18 +24,19 @@ func (DoctorSchedules) TableName() string {
24 24
 }
25 25
 
26 26
 type StaffSchedule struct {
27
-	ID           int64 `gorm:"column:id" json:"id" form:"id"`
28
-	DoctorId     int64 `gorm:"column:doctor_id" json:"doctor_id" form:"doctor_id"`
29
-	DoctorType   int64 `gorm:"column:doctor_type" json:"doctor_type" form:"doctor_type"`
30
-	ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
31
-	ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
32
-	UserOrgId    int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
33
-	StartTime    int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
34
-	EndTime      int64 `gorm:"column:end_time" json:"end_time" form:"end_time"`
35
-	Status       int64 `gorm:"column:status" json:"status" form:"status"`
36
-	Ctime        int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
37
-	Mtime        int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
38
-	ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
27
+	ID           int64  `gorm:"column:id" json:"id" form:"id"`
28
+	DoctorId     int64  `gorm:"column:doctor_id" json:"doctor_id" form:"doctor_id"`
29
+	DoctorType   int64  `gorm:"column:doctor_type" json:"doctor_type" form:"doctor_type"`
30
+	ScheduleType int64  `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
31
+	ScheduleWeek int64  `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
32
+	UserOrgId    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
33
+	StartTime    int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
34
+	EndTime      int64  `gorm:"column:end_time" json:"end_time" form:"end_time"`
35
+	Status       int64  `gorm:"column:status" json:"status" form:"status"`
36
+	Ctime        int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
37
+	Mtime        int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
38
+	ScheduleDate int64  `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
39
+	Remark       string `gorm:"column:remark" json:"remark" form:"remark"`
39 40
 }
40 41
 
41 42
 func (StaffSchedule) TableName() string {
@@ -64,6 +65,7 @@ type XtStaffSchedule struct {
64 65
 	IsSort          int64  `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
65 66
 	WorkTime        string `gorm:"column:work_time" json:"work_time" form:"work_time"`
66 67
 	Minute          int64  `gorm:"column:minute" json:"minute" form:"minute"`
68
+	Remark          string `gorm:"column:remark" json:"remark" form:"remark"`
67 69
 }
68 70
 
69 71
 type XTSgjUserAdminRole struct {
@@ -106,3 +108,18 @@ type CountStaffSchedule struct {
106 108
 	TotalMininute int64 `gorm:"column:totalminute" json:"totalminute" form:"totalminute"`
107 109
 	WorkMinute    int64 `gorm:"column:workminute" json:"workminute" form:"workminute"`
108 110
 }
111
+
112
+type XtStaffScheduleRemark struct {
113
+	ID        int64  `gorm:"column:id" json:"id" form:"id"`
114
+	StartTime int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
115
+	EndTime   int64  `gorm:"column:end_time" json:"end_time" form:"end_time"`
116
+	Remark    string `gorm:"column:remark" json:"remark" form:"remark"`
117
+	UserOrgId int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
118
+	Status    int64  `gorm:"column:status" json:"status" form:"status"`
119
+	Ctime     int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
120
+	Mtime     int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
121
+}
122
+
123
+func (XtStaffScheduleRemark) TableName() string {
124
+	return "xt_staff_schedule_remark"
125
+}

+ 1 - 0
models/new_monitor.go Целия файл

@@ -132,6 +132,7 @@ type VMMonitoringRecord struct {
132 132
 	Symptom                          string  `gorm:"column:symptom" json:"symptom" form:"symptom"`
133 133
 	Dispose                          string  `gorm:"column:dispose" json:"dispose" form:"dispose"`
134 134
 	Result                           string  `gorm:"column:result" json:"result" form:"result"`
135
+	Ktv                              float64 `gorm:"column:ktv" json:"ktv" form:"ktv"`
135 136
 }
136 137
 
137 138
 func (VMMonitoringRecord) TableName() string {

+ 1 - 0
models/stock_models.go Целия файл

@@ -1343,6 +1343,7 @@ type PatientWarehouseInfo struct {
1343 1343
 	PackingUnit       string `gorm:"column:packing_unit" json:"packing_unit" form:"packing_unit"`
1344 1344
 	Remark            string `gorm:"column:remark" json:"remark" form:"remark"`
1345 1345
 	OrgId             int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
1346
+	StockCount        int64  `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
1346 1347
 }
1347 1348
 
1348 1349
 func (PatientWarehouseInfo) TableName() string {

+ 1 - 1
service/dialysis_service.go Целия файл

@@ -655,7 +655,7 @@ func FindDialysisMacher(orgid int64, patientid int64, dialysisDate int64) (model
655 655
 	db := readDb.Table("xt_dialysis_order as o").Where("o.status = 1")
656 656
 	table := readDb.Table("xt_device_number as n")
657 657
 	fmt.Print("table", table)
658
-	err := db.Select("o.id,o.dialysis_date,o.user_org_id,o.patient_id,o.prescription_id,o.stage,remark,o.bed_id,o.start_nurse,o.finish_nurse,o.status,o.created_time,o.updated_time,o.start_time,o.end_time,o.puncture_nurse,o.creator,o.modifier,o.finish_creator,o.finish_modifier,o.schedual_type,o.quality_nurse_id,o.blood_drawing,n.number,r.user_name").Joins("left join xt_device_number as n on n.id = o.bed_id").Joins("left join sgj_users.sgj_user_admin_role  as r on r.admin_user_id = o.start_nurse").Where("o.user_org_id = ? and o.patient_id = ? and o.dialysis_date =?", orgid, patientid, dialysisDate).Scan(&orders).Error
658
+	err := db.Select("o.id,o.dialysis_date,o.user_org_id,o.patient_id,o.prescription_id,o.stage,o.remark,o.bed_id,o.start_nurse,o.finish_nurse,o.status,o.created_time,o.updated_time,o.start_time,o.end_time,o.puncture_nurse,o.creator,o.modifier,o.finish_creator,o.finish_modifier,o.schedual_type,o.quality_nurse_id,o.blood_drawing,n.number,r.user_name").Joins("left join xt_device_number as n on n.id = o.bed_id").Joins("left join sgj_users.sgj_user_admin_role  as r on r.admin_user_id = o.start_nurse").Where("o.user_org_id = ? and o.patient_id = ? and o.dialysis_date =?", orgid, patientid, dialysisDate).Scan(&orders).Error
659 659
 	return orders, err
660 660
 }
661 661
 func FindPunctureNurse(adminid int64, appid int64, orgid int64) (models.App_Roles, error) {

+ 53 - 4
service/doctor_schedule_service.go Целия файл

@@ -1,10 +1,11 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"XT_New/models"
5 4
 	"fmt"
6
-	"github.com/jinzhu/gorm"
7 5
 	"time"
6
+
7
+	"XT_New/models"
8
+	"github.com/jinzhu/gorm"
8 9
 )
9 10
 
10 11
 func GetClassName(orgid int64, class_name string) (*models.DoctorSchedules, error) {
@@ -145,7 +146,10 @@ func GetStaffScheduleList(orgid int64, startime int64, endtime int64) (schedule
145 146
 	if orgid > 0 {
146 147
 		db = db.Where("x.user_org_id = ?", orgid)
147 148
 	}
148
-	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.admin_user_id,r.user_type,s.class_attributes,r.sort,r.is_sort,s.work_time,s.minute").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ? and s.status = 1 and r.is_sort = 1", orgid, orgid).Scan(&schedule).Error
149
+	if orgid > 0 {
150
+		db = db.Where("r.org_id =?", orgid)
151
+	}
152
+	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,x.remark,r.user_name,s.class_name,r.admin_user_id,r.user_type,s.class_attributes,r.sort,r.is_sort,s.work_time,s.minute").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ? and s.status = 1 and r.is_sort = 1", orgid, orgid).Scan(&schedule).Error
149 153
 	return schedule, err
150 154
 }
151 155
 
@@ -179,13 +183,16 @@ func GetScheduleByDoctorId(doctorid int64, startime int64, endtime int64, orgid
179 183
 	if orgid > 0 {
180 184
 		db = db.Where("x.user_org_id = ?", orgid)
181 185
 	}
186
+	if orgid > 0 {
187
+		db = db.Where("r.org_id = ?", orgid)
188
+	}
182 189
 	if doctorid == 0 {
183 190
 		db = db.Where("x.doctor_type = 2 or x.doctor_type = 3")
184 191
 	}
185 192
 	if doctorid > 0 {
186 193
 		db = db.Where("x.doctor_type = ?", doctorid)
187 194
 	}
188
-	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.admin_user_id,s.class_attributes,r.sort,r.is_sort").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ?", orgid, orgid).Scan(&schedule).Error
195
+	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.admin_user_id,s.class_attributes,r.sort,r.is_sort,r.remark").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ?", orgid, orgid).Scan(&schedule).Error
189 196
 	return schedule, err
190 197
 }
191 198
 
@@ -691,6 +698,7 @@ func DeleteScheduleByPatientId(patient_id int64, schedule_date int64, user_org_i
691 698
 	schedules := models.XtSchedules{}
692 699
 	err := XTWriteDB().Model(&schedules).Where("patient_id = ? and schedule_date = ? and user_org_id = ?", patient_id, schedule_date, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
693 700
 	return schedules, err
701
+
694 702
 }
695 703
 
696 704
 func GetSearchPatient(keywords string, orgid int64, startime int64) (schedule []*models.Schedule, err error) {
@@ -843,3 +851,44 @@ func DeleteStaffScheduleById(id int64, user_org_id int64) (err error) {
843 851
 	err = XTWriteDB().Model(&schedule).Where("id = ? and user_org_id =? and status=1", id, user_org_id).Updates(map[string]interface{}{"status": 0}).Error
844 852
 	return err
845 853
 }
854
+
855
+func SaveStaffScheduleRemark(schedule models.StaffSchedule) error {
856
+
857
+	staffSchedule := models.StaffSchedule{}
858
+
859
+	err := XTWriteDB().Model(&staffSchedule).Where("doctor_id = ? and status= 1 and start_time>=? and end_time<=? and user_org_id = ?", schedule.DoctorId, schedule.StartTime, schedule.EndTime, schedule.UserOrgId).Updates(map[string]interface{}{"remark": schedule.Remark}).Error
860
+
861
+	return err
862
+}
863
+
864
+func UpdateSgjAdminUser(org_id int64, admin_user_id int64, content string) (models.SgjUserAdminRole, error) {
865
+
866
+	adminRole := models.SgjUserAdminRole{}
867
+
868
+	err := UserWriteDB().Model(&adminRole).Where("org_id = ? and admin_user_id = ? and status=1", org_id, admin_user_id).Updates(map[string]interface{}{"remark": content}).Error
869
+
870
+	return adminRole, err
871
+}
872
+
873
+func GetStaffScheduleRemark(org_id int64, start_time int64, end_time int64) (models.XtStaffScheduleRemark, error) {
874
+
875
+	scheduleRemark := models.XtStaffScheduleRemark{}
876
+
877
+	err := XTReadDB().Where("user_org_id = ? and start_time >=? and end_time<=? and status=1", org_id, start_time, end_time).Find(&scheduleRemark).Error
878
+
879
+	return scheduleRemark, err
880
+}
881
+
882
+func CreateStaffScheduleRemark(remark models.XtStaffScheduleRemark) error {
883
+
884
+	err := XTWriteDB().Create(&remark).Error
885
+
886
+	return err
887
+}
888
+
889
+func SaveStaffScheduleRemarkOne(remark models.XtStaffScheduleRemark) error {
890
+
891
+	err := XTWriteDB().Save(&remark).Error
892
+
893
+	return err
894
+}

+ 1 - 1
service/gobal_config_service.go Целия файл

@@ -1149,7 +1149,7 @@ func GetPrescriptionList(patient_id int64, schedule_date int64, user_org_id int6
1149 1149
 func GetLastMonitorRecordList(patient_id int64, schedule_date int64, user_org_id int64) (models.MonitoringRecord, error) {
1150 1150
 
1151 1151
 	record := models.MonitoringRecord{}
1152
-	err := XTReadDB().Where("patient_id =? and monitoring_date = ? and user_org_id = ? and status = 1", patient_id, schedule_date, user_org_id).Last(&record).Error
1152
+	err := XTReadDB().Where("patient_id =? and monitoring_date = ? and user_org_id = ? and status = 1", patient_id, schedule_date, user_org_id).Order("operate_time desc").Last(&record).Error
1153 1153
 	return record, err
1154 1154
 }
1155 1155
 

Файловите разлики са ограничени, защото са твърде много
+ 188 - 188
service/mobile_dialysis_service.go


+ 1 - 1
service/pharmacy_service.go Целия файл

@@ -453,7 +453,7 @@ func DispensingDetailsList(stime, etime, orgid, page, limit int64, keyword strin
453 453
 		}
454 454
 		dbone = dbone.Where("patient_id in (?)", tmp_ids)
455 455
 	}
456
-	fmt.Println("fenye=============================", fenye)
456
+
457 457
 	//查询出分页用的数据
458 458
 	err = dbone.Count(&total).Offset(offset).Order("mtime desc").Limit(limit).Find(&fenye).Error
459 459
 	if err != nil {

+ 1 - 1
service/self_drug_service.go Целия файл

@@ -1243,7 +1243,7 @@ func GetDamageByDrugId(drugid int64, warhousingorder string, drugtype int64) (dr
1243 1243
 
1244 1244
 func GetInventoryModeList(orgid int64) (info []*models.PatientDrugWarehouseInfo, err error) {
1245 1245
 
1246
-	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1")
1246
+	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1 and (x.stock_max_number>0 or x.stock_min_number>0)")
1247 1247
 	table := XTReadDB().Table("xt_base_drug as t").Where("t.status = 1")
1248 1248
 	fmt.Println(table)
1249 1249
 	if orgid > 0 {

+ 2 - 2
service/smart_sch.go Целия файл

@@ -8,10 +8,10 @@ import (
8 8
 )
9 9
 
10 10
 func GetSmartSchPatientByKeyWord(orgID int64, keywords string) (patient []*models.SmartSchPatient, err error) {
11
-	db := readDb.Model(&models.SmartSchPatient{}).Where("user_org_id=? and status=1", orgID)
11
+	db := readDb.Model(&models.SmartSchPatient{}).Where("user_org_id=? and status=1 and  lapseto !=3", orgID)
12 12
 	if len(keywords) > 0 {
13 13
 		likekey := "%" + keywords + "%"
14
-		err = db.Where("name LIKE ? OR dialysis_no LIKE ? and lapseto =1", likekey, likekey).Find(&patient).Error
14
+		err = db.Where("name LIKE ? OR dialysis_no LIKE ?", likekey, likekey).Find(&patient).Error
15 15
 	} else {
16 16
 		err = db.Find(&patient).Error
17 17
 	}

+ 1 - 1
service/stock_service.go Целия файл

@@ -6886,7 +6886,7 @@ func UpdatedGoodInfo(info models.GoodInfo, goodid int64) error {
6886 6886
 
6887 6887
 func GetInventoryExportList(orgid int64) (info []*models.PatientWarehouseInfo, err error) {
6888 6888
 
6889
-	db := XTReadDB().Table("xt_warehouse_info as x").Where("x.status = 1")
6889
+	db := XTReadDB().Table("xt_warehouse_info as x").Where("x.status = 1 and x.stock_count>0")
6890 6890
 	table := XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
6891 6891
 	fmt.Println(table)
6892 6892
 	if orgid > 0 {