瀏覽代碼

库存流水展示

XMLWAN 1 年之前
父節點
當前提交
49a035ac89

+ 13 - 7
controllers/dialysis_api_controller.go 查看文件

@@ -655,9 +655,10 @@ func (c *DialysisApiController) PostPrescription() {
655 655
 			Module:     1,
656 656
 			RecordDate: recordDate.Unix(),
657 657
 			Sourse:     1,
658
+			PatientId:  patient,
658 659
 		}
659 660
 
660
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 1)
661
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 1, patient)
661 662
 		if dialysisFinish.ID == 0 {
662 663
 			service.CreateDialysisFinish(finish)
663 664
 		}
@@ -1537,9 +1538,10 @@ func (c *DialysisApiController) PostDouleCheck() {
1537 1538
 			Module:     5,
1538 1539
 			RecordDate: recordDate.Unix(),
1539 1540
 			Sourse:     1,
1541
+			PatientId:  id,
1540 1542
 		}
1541 1543
 
1542
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 5)
1544
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 5, id)
1543 1545
 		if dialysisFinish.ID == 0 {
1544 1546
 			service.CreateDialysisFinish(finish)
1545 1547
 		}
@@ -1737,9 +1739,10 @@ func (c *DialysisApiController) PostReceiveTreatmentAsses() {
1737 1739
 			Module:     2,
1738 1740
 			RecordDate: recordDate.Unix(),
1739 1741
 			Sourse:     1,
1742
+			PatientId:  id,
1740 1743
 		}
1741 1744
 
1742
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 2)
1745
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 2, id)
1743 1746
 		if dialysisFinish.ID == 0 {
1744 1747
 			service.CreateDialysisFinish(finish)
1745 1748
 		}
@@ -1957,9 +1960,10 @@ func (c *DialysisApiController) PostAssessmentAfterDislysis() {
1957 1960
 			Module:     9,
1958 1961
 			RecordDate: recordDate.Unix(),
1959 1962
 			Sourse:     1,
1963
+			PatientId:  patient,
1960 1964
 		}
1961 1965
 
1962
-		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 1)
1966
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 9, patient)
1963 1967
 		if dialysisFinish.ID == 0 {
1964 1968
 			service.CreateDialysisFinish(finish)
1965 1969
 		}
@@ -2230,9 +2234,10 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2230 2234
 			Module:     3,
2231 2235
 			RecordDate: recordDate.Unix(),
2232 2236
 			Sourse:     1,
2237
+			PatientId:  patient,
2233 2238
 		}
2234 2239
 
2235
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 3)
2240
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 3, patient)
2236 2241
 		if dialysisFinish.ID == 0 {
2237 2242
 			service.CreateDialysisFinish(finish)
2238 2243
 		}
@@ -2799,9 +2804,10 @@ func (c *DialysisApiController) PostTreatmentSummary() {
2799 2804
 			Module:     10,
2800 2805
 			RecordDate: recordDate.Unix(),
2801 2806
 			Sourse:     1,
2807
+			PatientId:  patient,
2802 2808
 		}
2803 2809
 
2804
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 10)
2810
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 10, patient)
2805 2811
 		if dialysisFinish.ID == 0 {
2806 2812
 			service.CreateDialysisFinish(finish)
2807 2813
 		}
@@ -6450,7 +6456,7 @@ func (this *DialysisApiController) GetDialysisInformationSetting() {
6450 6456
 
6451 6457
 	limit, _ := this.GetInt64("limit")
6452 6458
 	page, _ := this.GetInt64("page")
6453
-	informationSetting, _ := service.GetDialysisInformationSetting(orgId)
6459
+	informationSetting, _ := service.GetDialysisInformationSettingList(orgId)
6454 6460
 
6455 6461
 	//未审核
6456 6462
 	infor, total, _ := service.GetDialysisInformationIsNoCheck(orgId, limit, page, 2)

+ 6 - 3
controllers/dialysis_record_api_controller.go 查看文件

@@ -727,9 +727,10 @@ func (this *DialysisRecordAPIController) EditMonitor() {
727 727
 			Module:     7,
728 728
 			RecordDate: monitorParam.MonitoringDate,
729 729
 			Sourse:     1,
730
+			PatientId:  patientID,
730 731
 		}
731 732
 
732
-		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, monitorParam.MonitoringDate, 1)
733
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, monitorParam.MonitoringDate, 7, patientID)
733 734
 		if dialysisFinish.ID == 0 {
734 735
 			service.CreateDialysisFinish(finish)
735 736
 		}
@@ -1094,9 +1095,10 @@ func (this *DialysisRecordAPIController) StartDialysis() {
1094 1095
 		Module:     6,
1095 1096
 		RecordDate: recordDate.Unix(),
1096 1097
 		Sourse:     1,
1098
+		PatientId:  patientID,
1097 1099
 	}
1098 1100
 
1099
-	dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 1)
1101
+	dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 6, patientID)
1100 1102
 	if dialysisFinish.ID == 0 {
1101 1103
 		service.CreateDialysisFinish(finish)
1102 1104
 	}
@@ -1664,9 +1666,10 @@ func (this *DialysisRecordAPIController) FinishDialysis() {
1664 1666
 		Module:     8,
1665 1667
 		RecordDate: recordDate.Unix(),
1666 1668
 		Sourse:     1,
1669
+		PatientId:  patientID,
1667 1670
 	}
1668 1671
 
1669
-	dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 8)
1672
+	dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, recordDate.Unix(), 8, patientID)
1670 1673
 	if dialysisFinish.ID == 0 {
1671 1674
 		service.CreateDialysisFinish(finish)
1672 1675
 	}

+ 80 - 16
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -724,9 +724,10 @@ func (c *DialysisAPIController) PostAtreatmentInfo() {
724 724
 			Module:     10,
725 725
 			RecordDate: recordDate.Unix(),
726 726
 			Sourse:     1,
727
+			PatientId:  id,
727 728
 		}
728 729
 
729
-		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 10)
730
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 10, id)
730 731
 		if dialysisFinish.ID == 0 {
731 732
 			service.CreateDialysisFinish(finish)
732 733
 		}
@@ -933,9 +934,10 @@ func (c *DialysisAPIController) PostDoubleCheck() {
933 934
 			Module:     5,
934 935
 			RecordDate: recordDate.Unix(),
935 936
 			Sourse:     1,
937
+			PatientId:  id,
936 938
 		}
937 939
 
938
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 5)
940
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 5, id)
939 941
 		if dialysisFinish.ID == 0 {
940 942
 			service.CreateDialysisFinish(finish)
941 943
 		}
@@ -1182,9 +1184,10 @@ func (c *DialysisAPIController) PostAcceptsAssessment() {
1182 1184
 			Module:     2,
1183 1185
 			RecordDate: recordDate.Unix(),
1184 1186
 			Sourse:     1,
1187
+			PatientId:  id,
1185 1188
 		}
1186 1189
 
1187
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 2)
1190
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 2, id)
1188 1191
 		if dialysisFinish.ID == 0 {
1189 1192
 			service.CreateDialysisFinish(finish)
1190 1193
 		}
@@ -1228,7 +1231,6 @@ func (c *DialysisAPIController) PostAcceptsAssessment() {
1228 1231
 		//清空key 值
1229 1232
 		redis.Set(key, "", time.Second)
1230 1233
 
1231
-		fmt.Println("--------------------------------", recordDateStr)
1232 1234
 		keyOne := "scheduals_" + recordDateStr + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
1233 1235
 
1234 1236
 		redis.Set(keyOne, "", time.Second)
@@ -1477,9 +1479,10 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
1477 1479
 			Module:     9,
1478 1480
 			RecordDate: recordDate.Unix(),
1479 1481
 			Sourse:     1,
1482
+			PatientId:  id,
1480 1483
 		}
1481 1484
 
1482
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 9)
1485
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 9, id)
1483 1486
 		if dialysisFinish.ID == 0 {
1484 1487
 			service.CreateDialysisFinish(finish)
1485 1488
 		}
@@ -1939,9 +1942,10 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1939 1942
 			Module:     1,
1940 1943
 			RecordDate: recordDate.Unix(),
1941 1944
 			Sourse:     1,
1945
+			PatientId:  id,
1942 1946
 		}
1943 1947
 
1944
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 1)
1948
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 1, id)
1945 1949
 		if dialysisFinish.ID == 0 {
1946 1950
 			service.CreateDialysisFinish(finish)
1947 1951
 		}
@@ -2159,6 +2163,23 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
2159 2163
 
2160 2164
 		err := service.UpDateDialysisPrescription(&prescription)
2161 2165
 
2166
+		finish := models.XtDialysisFinish{
2167
+			IsFinish:   1,
2168
+			UserOrgId:  adminUserInfo.Org.Id,
2169
+			Status:     1,
2170
+			Ctime:      time.Now().Unix(),
2171
+			Mtime:      0,
2172
+			Module:     1,
2173
+			RecordDate: recordDate.Unix(),
2174
+			Sourse:     1,
2175
+			PatientId:  id,
2176
+		}
2177
+
2178
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 1, id)
2179
+		if dialysisFinish.ID == 0 {
2180
+			service.CreateDialysisFinish(finish)
2181
+		}
2182
+
2162 2183
 		//修改处方
2163 2184
 		if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
2164 2185
 			// 患者的临时医嘱里查找是否有抗凝剂临时医嘱
@@ -2558,6 +2579,22 @@ func (c *DialysisAPIController) Finish() {
2558 2579
 
2559 2580
 	}
2560 2581
 
2582
+	finish := models.XtDialysisFinish{
2583
+		IsFinish:   1,
2584
+		UserOrgId:  adminUserInfo.Org.Id,
2585
+		Status:     1,
2586
+		Ctime:      time.Now().Unix(),
2587
+		Mtime:      0,
2588
+		Module:     9,
2589
+		RecordDate: tempassessmentAfterDislysis.AssessmentDate,
2590
+		Sourse:     1,
2591
+		PatientId:  tempassessmentAfterDislysis.PatientId,
2592
+	}
2593
+
2594
+	dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, tempassessmentAfterDislysis.AssessmentDate, 9, tempassessmentAfterDislysis.PatientId)
2595
+	if dialysisFinish.ID == 0 {
2596
+		service.CreateDialysisFinish(finish)
2597
+	}
2561 2598
 	err := service.UpdateAssessmentAfterDislysisRecord(&tempassessmentAfterDislysis)
2562 2599
 
2563 2600
 	key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_after_dislysis"
@@ -2595,9 +2632,10 @@ func (c *DialysisAPIController) Finish() {
2595 2632
 			Module:     8,
2596 2633
 			RecordDate: recordDate.Unix(),
2597 2634
 			Sourse:     1,
2635
+			PatientId:  id,
2598 2636
 		}
2599 2637
 
2600
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 8)
2638
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 8, id)
2601 2639
 		if dialysisFinish.ID == 0 {
2602 2640
 			service.CreateDialysisFinish(finish)
2603 2641
 		}
@@ -2765,7 +2803,7 @@ func (c *DialysisAPIController) GetSchedualPatientsList() {
2765 2803
 func (this *DialysisAPIController) StartDialysis() {
2766 2804
 	patientID, _ := this.GetInt64("patient_id")
2767 2805
 	recordDateStr := this.GetString("record_date")
2768
-	nurseID, _ := this.GetInt64("nurse")
2806
+	nurseID, _ := this.GetInt64("start_nurse")
2769 2807
 	puncture_nurse, _ := this.GetInt64("puncture_nurse")
2770 2808
 	blood_drawing, _ := this.GetInt64("blood_drawing")
2771 2809
 	schedual_type, _ := this.GetInt64("schedual_type")
@@ -2781,7 +2819,7 @@ func (this *DialysisAPIController) StartDialysis() {
2781 2819
 	puncture_way := this.GetString("puncture_way")
2782 2820
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
2783 2821
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
2784
-	blood_access_id, _ := this.GetInt64("blood_access_id")
2822
+	blood_access_id, _ := this.GetInt64("blood_access_part_opera_id")
2785 2823
 	zone_id, _ := this.GetInt64("zone_id")
2786 2824
 	elecsign := this.GetString("url")
2787 2825
 	nuclein_date_str := this.GetString("nuclein_date_str")
@@ -2998,9 +3036,10 @@ func (this *DialysisAPIController) StartDialysis() {
2998 3036
 			Module:     6,
2999 3037
 			RecordDate: recordDate.Unix(),
3000 3038
 			Sourse:     1,
3039
+			PatientId:  patientID,
3001 3040
 		}
3002 3041
 
3003
-		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 6)
3042
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 6, patientID)
3004 3043
 		if dialysisFinish.ID == 0 {
3005 3044
 			service.CreateDialysisFinish(finish)
3006 3045
 		}
@@ -3214,9 +3253,10 @@ func (this *DialysisAPIController) StartDialysis() {
3214 3253
 			Module:     7,
3215 3254
 			RecordDate: recordDate.Unix(),
3216 3255
 			Sourse:     1,
3256
+			PatientId:  patientID,
3217 3257
 		}
3218 3258
 
3219
-		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 7)
3259
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 7, patientID)
3220 3260
 		if dialysisFinish.ID == 0 {
3221 3261
 			service.CreateDialysisFinish(finish)
3222 3262
 		}
@@ -3716,9 +3756,10 @@ func (c *DialysisAPIController) PostSolution() {
3716 3756
 		Module:     1,
3717 3757
 		RecordDate: recordDate.Unix(),
3718 3758
 		Sourse:     1,
3759
+		PatientId:  id,
3719 3760
 	}
3720 3761
 
3721
-	dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 1)
3762
+	dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 1, id)
3722 3763
 	if dialysisFinish.ID == 0 {
3723 3764
 		service.CreateDialysisFinish(finish)
3724 3765
 	}
@@ -3827,6 +3868,7 @@ func (c *DialysisAPIController) PostSolution() {
3827 3868
 		} else {
3828 3869
 			if anticoagulant == 3 || anticoagulant == 6 || anticoagulant == 7 {
3829 3870
 				advice.AdviceName = "低分子肝素钠注射液"
3871
+
3830 3872
 				service.CreateDoctorAdvice(&advice)
3831 3873
 			}
3832 3874
 
@@ -4129,7 +4171,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4129 4171
 
4130 4172
 func (this *DialysisAPIController) ModifyStartDialysisOrder() {
4131 4173
 	record_id, _ := this.GetInt64("id")
4132
-	nurseID, _ := this.GetInt64("nurse")
4174
+	nurseID, _ := this.GetInt64("start_nurse")
4133 4175
 	puncture_nurse, _ := this.GetInt64("puncture_nurse")
4134 4176
 	bedID, _ := this.GetInt64("bed")
4135 4177
 	start_time := this.GetString("start_time")
@@ -4145,7 +4187,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
4145 4187
 	puncture_way := this.GetString("puncture_way")
4146 4188
 	dialysis_dialyszers := this.GetString("dialysis_dialyszers")
4147 4189
 	dialysis_irrigation := this.GetString("dialysis_irrigation")
4148
-	blood_access_id, _ := this.GetInt64("blood_access_id")
4190
+	blood_access_id, _ := this.GetInt64("blood_access_part_opera_id")
4149 4191
 	nuclein_date_str := this.GetString("nuclein_date_str")
4150 4192
 	order_remark := this.GetString("order_remark")
4151 4193
 	schedule_remark := this.GetString("schedule_remark")
@@ -5080,6 +5122,23 @@ func (c *DialysisAPIController) CreateRemindDoctorAdvice() {
5080 5122
 
5081 5123
 	if len(advices) > 0 {
5082 5124
 
5125
+		finish := models.XtDialysisFinish{
5126
+			IsFinish:   1,
5127
+			UserOrgId:  adminUserInfo.Org.Id,
5128
+			Status:     1,
5129
+			Ctime:      time.Now().Unix(),
5130
+			Mtime:      0,
5131
+			Module:     4,
5132
+			RecordDate: AdviceDate,
5133
+			Sourse:     1,
5134
+			PatientId:  patient,
5135
+		}
5136
+
5137
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, AdviceDate, 4, patient)
5138
+		if dialysisFinish.ID == 0 {
5139
+			service.CreateDialysisFinish(finish)
5140
+		}
5141
+
5083 5142
 		list, err := service.CreateMGroupAdvice(adminUserInfo.Org.Id, advices, groupNo)
5084 5143
 		key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient, 10) + ":" + strconv.FormatInt(RecordDate, 10) + ":doctor_advices"
5085 5144
 		redis := service.RedisClient()
@@ -7064,9 +7123,10 @@ func (c *DialysisAPIController) CreateOtherStockOutInfo() {
7064 7123
 		Module:     11,
7065 7124
 		RecordDate: record_time,
7066 7125
 		Sourse:     1,
7126
+		PatientId:  patient_id,
7067 7127
 	}
7068 7128
 
7069
-	dialysisFinish, err := service.GetDialysisFinish(adminInfo.Org.Id, record_time, 11)
7129
+	dialysisFinish, _ := service.GetDialysisFinish(adminInfo.Org.Id, record_time, 11, patient_id)
7070 7130
 	if dialysisFinish.ID == 0 {
7071 7131
 		service.CreateDialysisFinish(finish)
7072 7132
 	}
@@ -8843,12 +8903,16 @@ func (this *DialysisAPIController) CheckSchedule() {
8843 8903
 
8844 8904
 	patientID, _ := this.GetInt64("patient_id")
8845 8905
 	recordDateStr := this.GetString("record_date")
8846
-	nurseID, _ := this.GetInt64("nurse")
8906
+	nurseID, _ := this.GetInt64("start_nurse")
8847 8907
 	schedual_type, _ := this.GetInt64("schedual_type")
8848 8908
 
8849 8909
 	bedID, _ := this.GetInt64("bed")
8850 8910
 	start_time := this.GetString("start_time")
8851 8911
 
8912
+	fmt.Println("patientID", patientID)
8913
+	fmt.Println("recordDateStr", recordDateStr)
8914
+	fmt.Println("nurseID", nurseID)
8915
+	fmt.Println("schedual_type------", schedual_type)
8852 8916
 	if patientID <= 0 || len(recordDateStr) == 0 || nurseID <= 0 || bedID <= 0 {
8853 8917
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
8854 8918
 		return

+ 2 - 1
controllers/mobile_api_controllers/dialysis_api_controller_extend.go 查看文件

@@ -212,9 +212,10 @@ func (this *DialysisAPIController) AddMonitorRecord() {
212 212
 		Module:     7,
213 213
 		RecordDate: record.MonitoringDate,
214 214
 		Sourse:     1,
215
+		PatientId:  patientID,
215 216
 	}
216 217
 
217
-	dialysisFinish, err := service.GetDialysisFinish(record.UserOrgId, record.MonitoringDate, 7)
218
+	dialysisFinish, err := service.GetDialysisFinish(record.UserOrgId, record.MonitoringDate, 7, patientID)
218 219
 	if dialysisFinish.ID == 0 {
219 220
 		service.CreateDialysisFinish(finish)
220 221
 	}

+ 5 - 3
controllers/mobile_api_controllers/patient_api_controller.go 查看文件

@@ -2683,9 +2683,10 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2683 2683
 		Module:     3,
2684 2684
 		RecordDate: evaluation.AssessmentDate,
2685 2685
 		Sourse:     1,
2686
+		PatientId:  id,
2686 2687
 	}
2687 2688
 
2688
-	dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, evaluation.AssessmentDate, 3)
2689
+	dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, evaluation.AssessmentDate, 3, id)
2689 2690
 	if dialysisFinish.ID == 0 {
2690 2691
 		service.CreateDialysisFinish(finish)
2691 2692
 	}
@@ -4321,7 +4322,7 @@ func (c *PatientApiController) CreateGroupAdvice() {
4321 4322
 
4322 4323
 			//今日的日期减去设置的日期
4323 4324
 			cha_time = timeNewDate.Unix() - infor.WeekDay*86400
4324
-			fmt.Println("RecordDate------------------", Startdate)
4325
+
4325 4326
 			if cha_time >= Startdate {
4326 4327
 				//查询审核是否允许
4327 4328
 				infor, _ := service.GetDialysisInformationByRecordDate(patient, Startdate, adminUserInfo.Org.Id)
@@ -4344,9 +4345,10 @@ func (c *PatientApiController) CreateGroupAdvice() {
4344 4345
 			Module:     4,
4345 4346
 			RecordDate: advicedateunix,
4346 4347
 			Sourse:     1,
4348
+			PatientId:  patient,
4347 4349
 		}
4348 4350
 
4349
-		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, advicedateunix, 4)
4351
+		dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, advicedateunix, 4, patient)
4350 4352
 		if dialysisFinish.ID == 0 {
4351 4353
 			service.CreateDialysisFinish(finish)
4352 4354
 		}

+ 20 - 1
controllers/patient_api_controller.go 查看文件

@@ -1319,6 +1319,24 @@ func (c *PatientApiController) CreateGroupAdvice() {
1319 1319
 		advice.AdviceDoctor = adminUserInfo.AdminUser.Id
1320 1320
 		advice.IsSettle = 2
1321 1321
 
1322
+		//创建步骤表
1323
+		finish := models.XtDialysisFinish{
1324
+			IsFinish:   1,
1325
+			UserOrgId:  adminUserInfo.CurrentOrgId,
1326
+			Status:     1,
1327
+			Ctime:      time.Now().Unix(),
1328
+			Mtime:      0,
1329
+			Module:     4,
1330
+			RecordDate: advice.RecordDate,
1331
+			Sourse:     1,
1332
+			PatientId:  patient,
1333
+		}
1334
+
1335
+		dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, advice.RecordDate, 4, patient)
1336
+		if dialysisFinish.ID == 0 {
1337
+			service.CreateDialysisFinish(finish)
1338
+		}
1339
+
1322 1340
 		// 查询信息规挡的设置天数
1323 1341
 
1324 1342
 		infor, _ := service.GetDialysisInformationSetting(adminUserInfo.CurrentOrgId)
@@ -1742,9 +1760,10 @@ func (c *PatientApiController) CreateDoctorAdvice() {
1742 1760
 		Module:     4,
1743 1761
 		RecordDate: advice.AdviceDate,
1744 1762
 		Sourse:     1,
1763
+		PatientId:  patient,
1745 1764
 	}
1746 1765
 
1747
-	dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, advice.AdviceDate, 1)
1766
+	dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.CurrentOrgId, advice.AdviceDate, 1, patient)
1748 1767
 	if dialysisFinish.ID == 0 {
1749 1768
 		service.CreateDialysisFinish(finish)
1750 1769
 	}

+ 17 - 12
go.mod 查看文件

@@ -3,28 +3,33 @@ module XT_New
3 3
 go 1.19
4 4
 
5 5
 require (
6
-	github.com/astaxie/beego v1.12.3 // indirect
6
+	github.com/astaxie/beego v1.12.3
7
+	github.com/go-redis/redis v6.15.9+incompatible
8
+	github.com/jinzhu/gorm v1.9.16
9
+	github.com/robfig/cron v1.2.0
10
+	github.com/shopspring/decimal v1.3.1
11
+	golang.org/x/sync v0.1.0
12
+)
13
+
14
+require (
7 15
 	github.com/beorn7/perks v1.0.1 // indirect
8 16
 	github.com/cespare/xxhash/v2 v2.1.1 // indirect
9
-	github.com/go-redis/redis v6.15.9+incompatible // indirect
10 17
 	github.com/go-sql-driver/mysql v1.7.0 // indirect
11
-	github.com/golang/protobuf v1.4.2 // indirect
18
+	github.com/golang/protobuf v1.5.0 // indirect
12 19
 	github.com/hashicorp/golang-lru v0.5.4 // indirect
13
-	github.com/jinzhu/gorm v1.9.16 // indirect
14 20
 	github.com/jinzhu/inflection v1.0.0 // indirect
21
+	github.com/kr/text v0.2.0 // indirect
15 22
 	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
16 23
 	github.com/prometheus/client_golang v1.7.0 // indirect
17 24
 	github.com/prometheus/client_model v0.2.0 // indirect
18 25
 	github.com/prometheus/common v0.10.0 // indirect
19 26
 	github.com/prometheus/procfs v0.1.3 // indirect
20
-	github.com/robfig/cron v1.2.0 // indirect
21 27
 	github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
22
-	github.com/shopspring/decimal v1.3.1 // indirect
23
-	golang.org/x/crypto v0.7.0 // indirect
24
-	golang.org/x/net v0.8.0 // indirect
25
-	golang.org/x/sync v0.1.0 // indirect
26
-	golang.org/x/sys v0.6.0 // indirect
27
-	golang.org/x/text v0.8.0 // indirect
28
-	google.golang.org/protobuf v1.23.0 // indirect
28
+	github.com/stretchr/testify v1.8.2 // indirect
29
+	golang.org/x/crypto v0.9.0 // indirect
30
+	golang.org/x/net v0.10.0 // indirect
31
+	golang.org/x/sys v0.8.0 // indirect
32
+	golang.org/x/text v0.9.0 // indirect
33
+	google.golang.org/protobuf v1.30.0 // indirect
29 34
 	gopkg.in/yaml.v2 v2.2.8 // indirect
30 35
 )

+ 44 - 14
go.sum 查看文件

@@ -24,13 +24,18 @@ github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h
24 24
 github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U=
25 25
 github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c=
26 26
 github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
27
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
27 28
 github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
28 29
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
30
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
29 31
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
32
+github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM=
30 33
 github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
31 34
 github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
32 35
 github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
36
+github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
33 37
 github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
38
+github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
34 39
 github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
35 40
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
36 41
 github.com/glendc/gopher-json v0.0.0-20170414221815-dc4743023d0c/go.mod h1:Gja1A+xZ9BoviGJNA2E9vFkPjjsl+CoJxSXiQM1UXtw=
@@ -46,6 +51,7 @@ github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ
46 51
 github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
47 52
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
48 53
 github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
54
+github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
49 55
 github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
50 56
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
51 57
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -55,22 +61,27 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x
55 61
 github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
56 62
 github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
57 63
 github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
58
-github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
59 64
 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
65
+github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
66
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
60 67
 github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
61 68
 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
62 69
 github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
63 70
 github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
64 71
 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
65 72
 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
73
+github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
74
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
66 75
 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
67 76
 github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
68 77
 github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
78
+github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
69 79
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
70 80
 github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
71 81
 github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
72 82
 github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
73 83
 github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
84
+github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
74 85
 github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
75 86
 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
76 87
 github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -80,10 +91,14 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
80 91
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
81 92
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
82 93
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
94
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
95
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
83 96
 github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
84 97
 github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
98
+github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
85 99
 github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
86 100
 github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
101
+github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
87 102
 github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
88 103
 github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
89 104
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
@@ -92,9 +107,12 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
92 107
 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
93 108
 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
94 109
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
110
+github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
95 111
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
96 112
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
113
+github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU=
97 114
 github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
115
+github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=
98 116
 github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
99 117
 github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
100 118
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
@@ -102,6 +120,7 @@ github.com/peterh/liner v1.0.1-0.20171122030339-3681c2a91233/go.mod h1:xIteQHvHu
102 120
 github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
103 121
 github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
104 122
 github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
123
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
105 124
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
106 125
 github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
107 126
 github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
@@ -132,9 +151,15 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
132 151
 github.com/ssdb/gossdb v0.0.0-20180723034631-88f6b59b84ec/go.mod h1:QBvMkMya+gXctz3kmljlUCu/yB3GZ6oee+dUozsezQE=
133 152
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
134 153
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
154
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
155
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
135 156
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
136 157
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
137 158
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
159
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
160
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
161
+github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
162
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
138 163
 github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
139 164
 github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
140 165
 github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
@@ -143,22 +168,20 @@ github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29Xrm
143 168
 golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
144 169
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
145 170
 golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
146
-golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
147 171
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
148 172
 golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
149
-golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
150
-golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
173
+golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
174
+golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
151 175
 golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
152 176
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
153 177
 golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
154 178
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
155 179
 golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
156
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
157 180
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
158 181
 golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
159 182
 golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
160
-golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
161
-golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
183
+golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
184
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
162 185
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
163 186
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
164 187
 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -174,28 +197,32 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
174 197
 golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
175 198
 golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
176 199
 golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
177
-golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80=
178 200
 golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
179
-golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
180
-golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
181
-golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
201
+golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
202
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
182 203
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
183
-golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
184
-golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
204
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
205
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
206
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
185 207
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
186 208
 google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
187 209
 google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
188 210
 google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
189 211
 google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
190 212
 google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
191
-google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
192 213
 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
214
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
215
+google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
216
+google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
193 217
 gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
194 218
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
195 219
 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
220
+gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
196 221
 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
222
+gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
197 223
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
198 224
 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
225
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
199 226
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
200 227
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
201 228
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -203,3 +230,6 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
203 230
 gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
204 231
 gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
205 232
 gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
233
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
234
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
235
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

+ 12 - 12
models/dialysis.go 查看文件

@@ -1475,18 +1475,18 @@ func (NewAssessmentAfterDislysis) TableName() string {
1475 1475
 	return "xt_assessment_after_dislysis"
1476 1476
 }
1477 1477
 
1478
-type XtDialysisInformaitonSetting struct {
1479
-	ID        int64 `gorm:"column:id" json:"id" form:"id"`
1480
-	WeekDay   int64 `gorm:"column:week_day" json:"week_day" form:"week_day"`
1481
-	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1482
-	Status    int64 `gorm:"column:status" json:"status" form:"status"`
1483
-	Ctime     int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
1484
-	Mtime     int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
1485
-}
1486
-
1487
-func (XtDialysisInformaitonSetting) TableName() string {
1488
-	return "xt_dialysis_informaiton_setting"
1489
-}
1478
+//type XtDialysisInformaitonSetting struct {
1479
+//	ID        int64 `gorm:"column:id" json:"id" form:"id"`
1480
+//	WeekDay   int64 `gorm:"column:week_day" json:"week_day" form:"week_day"`
1481
+//	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1482
+//	Status    int64 `gorm:"column:status" json:"status" form:"status"`
1483
+//	Ctime     int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
1484
+//	Mtime     int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
1485
+//}
1486
+//
1487
+//func (XtDialysisInformaitonSetting) TableName() string {
1488
+//	return "xt_dialysis_informaiton_setting"
1489
+//}
1490 1490
 
1491 1491
 type DialysisInformation struct {
1492 1492
 	ID                int64  `gorm:"column:id" json:"id" form:"id"`

+ 3 - 3
service/dialysis_service.go 查看文件

@@ -2101,11 +2101,11 @@ func UpdateLastMonitorRecordToday(accumulated_blood_volume float64, id int64) er
2101 2101
 	return err
2102 2102
 }
2103 2103
 
2104
-func GetDialysisFinish(user_org_id int64, record_date int64, module int64) (models.XtDialysisFinish, error) {
2104
+func GetDialysisFinish(user_org_id int64, record_date int64, module int64, patient_id int64) (models.XtDialysisFinish, error) {
2105 2105
 
2106 2106
 	finish := models.XtDialysisFinish{}
2107 2107
 
2108
-	err := XTReadDB().Where("user_org_id = ? and record_date = ? and status =1 and module = ?", user_org_id, record_date, module).Find(&finish).Error
2108
+	err := XTReadDB().Where("user_org_id = ? and record_date = ? and status =1 and module = ? and patient_id = ?", user_org_id, record_date, module, patient_id).Find(&finish).Error
2109 2109
 	return finish, err
2110 2110
 }
2111 2111
 
@@ -2176,7 +2176,7 @@ func GetInformationSettingByOrgId(user_org_id int64) (models.XtDialysisInformait
2176 2176
 	return setting, err
2177 2177
 }
2178 2178
 
2179
-func GetDialysisInformationSetting(user_org_id int64) (infor []*models.XtDialysisInformaitonSetting, err error) {
2179
+func GetDialysisInformationSettingList(user_org_id int64) (infor []*models.XtDialysisInformaitonSetting, err error) {
2180 2180
 
2181 2181
 	err = XTReadDB().Where("user_org_id = ? and status =1", user_org_id).Find(&infor).Error
2182 2182