Sfoglia il codice sorgente

11月8日库存管理

XMLWAN 3 anni fa
parent
commit
1cff966054

+ 4 - 2
controllers/dialysis_api_controller.go Vedi File

@@ -2806,8 +2806,10 @@ func (c *DialysisApiController) GetDialysisOrder() {
2806 2806
 
2807 2807
 	check, _ := service.FindDoubleCheckById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2808 2808
 
2809
-	dialysis_count, _ := service.GetDialysisOrderCount(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2810
-	patientInfo.TotalDialysis = dialysis_count
2809
+	if adminUserInfo.CurrentOrgId != 10101 {
2810
+		dialysis_count, _ := service.GetDialysisOrderCount(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
2811
+		patientInfo.TotalDialysis = dialysis_count
2812
+	}
2811 2813
 
2812 2814
 	//相关操作对应的操作人
2813 2815
 	//operators, _ := service.GetAdminUserES(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, operatorIDs)

+ 99 - 138
controllers/doctors_api_controller.go Vedi File

@@ -53,10 +53,10 @@ func DoctorApiRegistRouters() {
53 53
 	beego.Router("/api/patient/gettemplatesummaryprintdetail", &DoctorsApiController{}, "Get:GetTemplateSummaryPrintDetail")
54 54
 	beego.Router("/api/patient/updatetemplatesummary", &DoctorsApiController{}, "Post:UpdateTempalteSummary")
55 55
 	beego.Router("/api/patient/deletesummary", &DoctorsApiController{}, "Get:DeleteSummary")
56
-	beego.Router("/api/patient/hospitalsummary", &DoctorsApiController{}, "Get:HospitalSummary")
56
+	beego.Router("/api/patient/hospitalsummary", &DoctorsApiController{}, "Post:HospitalSummary")
57 57
 	beego.Router("/api/patient/gethospitalsummarylist", &DoctorsApiController{}, "Get:GetHospitalSummaryList")
58 58
 	beego.Router("/api/patient/gethospitalsummaydetail", &DoctorsApiController{}, "Get:GetHospitalSummaryDetail")
59
-	beego.Router("/api/patient/updatehospitalsummary", &DoctorsApiController{}, "Get:UpdateHospitalSummary")
59
+	beego.Router("/api/patient/updatehospitalsummary", &DoctorsApiController{}, "Post:UpdateHospitalSummary")
60 60
 	beego.Router("/api/patient/deletehospitalsummary", &DoctorsApiController{}, "Get:DeleteHospitalSummary")
61 61
 	beego.Router("/api/patient/getpatientinfo", &DoctorsApiController{}, "Get:GetPatientInfo")
62 62
 }
@@ -1009,7 +1009,7 @@ func (this *DoctorsApiController) GetTemplateSummaryList() {
1009 1009
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1010 1010
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
1011 1011
 	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
1012
-	fmt.Println("hhhhhhhhhhhhhh777777", endTime.Unix())
1012
+
1013 1013
 	list, err := service.GetTemplateSummaryList(patient_id, orgId, startTime.Unix(), endTime.Unix())
1014 1014
 	if err == nil {
1015 1015
 		this.ServeSuccessJSON(map[string]interface{}{
@@ -1064,90 +1064,50 @@ func (this *DoctorsApiController) UpdateTempalteSummary() {
1064 1064
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1065 1065
 		return
1066 1066
 	}
1067
-	id := int64(dataBody["id"].(float64))
1068
-	title := dataBody["title"].(string)
1069
-	dryWeight := dataBody["dry_weight"].(string)
1067
+
1068
+	id, _ := this.GetInt64("id")
1069
+	title := this.GetString("title")
1070
+
1071
+	dryWeight := this.GetString("dry_weight")
1070 1072
 	dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
1071
-	dialysis_count := int64(dataBody["dialysis_count"].(float64))
1072
-	hd_count := int64(dataBody["hd_count"].(float64))
1073
-	hdf_count := int64(dataBody["hdf_count"].(float64))
1074
-	hp_count := int64(dataBody["hp_count"].(float64))
1075
-	other_count := int64(dataBody["other_count"].(float64))
1076
-	dialzer_apparatus := dataBody["dialzer_apparatus"].(string)
1077
-	perfusion_apparatus := dataBody["perfusion_apparatus"].(string)
1078
-	anticoagulant := int64(dataBody["anticoagulant"].(float64))
1079
-	kaliumstr := dataBody["kalium"].(string)
1073
+	dialysis_count, _ := this.GetInt64("dialysis_count")
1074
+	hd_count, _ := this.GetInt64("hd_count")
1075
+	hdf_count, _ := this.GetInt64("hdf_count")
1076
+	hp_count, _ := this.GetInt64("hp_count")
1077
+	other_count, _ := this.GetInt64("other_count")
1078
+	dialzer_apparatus := this.GetString("dialzer_apparatus")
1079
+	perfusion_apparatus := this.GetString("perfusion_apparatus")
1080
+	anticoagulant, _ := this.GetInt64("anticoagulant")
1081
+	kaliumstr := this.GetString("kalium")
1080 1082
 	kalium, _ := strconv.ParseFloat(kaliumstr, 64)
1081
-	autunitestr := dataBody["autunite"].(string)
1083
+
1084
+	autunitestr := this.GetString("autunite")
1082 1085
 	autunite, _ := strconv.ParseFloat(autunitestr, 64)
1083
-	natriumstr := dataBody["natrium"].(string)
1086
+	natriumstr := this.GetString("natrium")
1084 1087
 	natrium, _ := strconv.ParseFloat(natriumstr, 64)
1085
-	hour := int64(dataBody["hour"].(float64))
1086
-	minute := int64(dataBody["minute"].(float64))
1087
-	beforWeight := dataBody["befor_weight"].(string)
1088
+	hour, _ := this.GetInt64("hour")
1089
+	minute, _ := this.GetInt64("minute")
1090
+	beforWeight := this.GetString("befor_weight")
1088 1091
 	befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
1089
-	afterWeight := dataBody["after_weight"].(string)
1092
+	afterWeight := this.GetString("after_weight")
1090 1093
 	after_weight, _ := strconv.ParseFloat(afterWeight, 64)
1091
-	befor_pressure := dataBody["befor_pressure"].(string)
1092
-	template_summary_content := dataBody["template_summary_content"].(string)
1093
-	template_plan_content := dataBody["template_plan_content"].(string)
1094
-	admin_user_id := int64(dataBody["admin_user_id"].(float64))
1095
-	record_time := dataBody["record_time"].(string)
1094
+	befor_pressure := this.GetString("befor_pressure")
1095
+	template_summary_content := this.GetString("template_summary_content")
1096
+	template_plan_content := this.GetString("template_plan_content")
1097
+	admin_user_id, _ := this.GetInt64("admin_user_id")
1098
+	record_time := this.GetString("record_time")
1096 1099
 	timeLayout := "2006-01-02"
1097 1100
 	loc, _ := time.LoadLocation("Local")
1098 1101
 	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
1099
-	after_pressure := dataBody["after_pressure"].(string)
1100
-	template_summary_id := int64(dataBody["template_summary_id"].(float64))
1101
-	template_plan_id := int64(dataBody["template_plan_id"].(float64))
1102
-	patient_id := int64(dataBody["patient_id"].(float64))
1102
+	after_pressure := this.GetString("after_pressure")
1103
+	template_summary_id, _ := this.GetInt64("template_summary_id")
1104
+	template_plan_id, _ := this.GetInt64("template_plan_id")
1105
+	template_inspection_id, _ := this.GetInt64("template_inspection_id")
1106
+	patient_id, _ := this.GetInt64("patient_id")
1107
+	fmt.Println("patient_id", patient_id)
1103 1108
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1104
-	inspect_date := dataBody["inspect_date"].(string)
1105
-	project_id := dataBody["project_id"].(string)
1106
-	template_inspection_id := int64(dataBody["template_inspection_id"].(float64))
1107
-
1108
-	//id, _ := this.GetInt64("id")
1109
-	//title := this.GetString("title")
1110
-	//
1111
-	//dryWeight := this.GetString("dry_weight")
1112
-	//dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
1113
-	//dialysis_count, _ := this.GetInt64("dialysis_count")
1114
-	//hd_count, _ := this.GetInt64("hd_count")
1115
-	//hdf_count, _ := this.GetInt64("hdf_count")
1116
-	//hp_count, _ := this.GetInt64("hp_count")
1117
-	//other_count, _ := this.GetInt64("other_count")
1118
-	//dialzer_apparatus := this.GetString("dialzer_apparatus")
1119
-	//perfusion_apparatus := this.GetString("perfusion_apparatus")
1120
-	//anticoagulant, _ := this.GetInt64("anticoagulant")
1121
-	//kaliumstr := this.GetString("kalium")
1122
-	//kalium, _ := strconv.ParseFloat(kaliumstr, 64)
1123
-	//
1124
-	//autunitestr := this.GetString("autunite")
1125
-	//autunite, _ := strconv.ParseFloat(autunitestr, 64)
1126
-	//natriumstr := this.GetString("natrium")
1127
-	//natrium, _ := strconv.ParseFloat(natriumstr, 64)
1128
-	//hour, _ := this.GetInt64("hour")
1129
-	//minute, _ := this.GetInt64("minute")
1130
-	//beforWeight := this.GetString("befor_weight")
1131
-	//befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
1132
-	//afterWeight := this.GetString("after_weight")
1133
-	//after_weight, _ := strconv.ParseFloat(afterWeight, 64)
1134
-	//befor_pressure := this.GetString("befor_pressure")
1135
-	//template_summary_content := this.GetString("template_summary_content")
1136
-	//template_plan_content := this.GetString("template_plan_content")
1137
-	//admin_user_id, _ := this.GetInt64("admin_user_id")
1138
-	//record_time := this.GetString("record_time")
1139
-	//timeLayout := "2006-01-02"
1140
-	//loc, _ := time.LoadLocation("Local")
1141
-	//recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
1142
-	//after_pressure := this.GetString("after_pressure")
1143
-	//template_summary_id, _ := this.GetInt64("template_summary_id")
1144
-	//template_plan_id, _ := this.GetInt64("template_plan_id")
1145
-	//template_inspection_id, _ := this.GetInt64("template_inspection_id")
1146
-	//patient_id, _ := this.GetInt64("patient_id")
1147
-	//fmt.Println("patient_id", patient_id)
1148
-	//orgId := this.GetAdminUserInfo().CurrentOrgId
1149
-	//inspect_date := this.GetString("inspect_date")
1150
-	//project_id := this.GetString("project_id")
1109
+	inspect_date := this.GetString("inspect_date")
1110
+	project_id := this.GetString("project_id")
1151 1111
 	summary := models.XtTemplateSummary{
1152 1112
 		ID:                     id,
1153 1113
 		StartYear:              0,
@@ -1213,41 +1173,42 @@ func (this *DoctorsApiController) HospitalSummary() {
1213 1173
 
1214 1174
 	timeLayout := "2006-01-02"
1215 1175
 	loc, _ := time.LoadLocation("Local")
1216
-	admission_time := this.GetString("admission_time")
1176
+
1177
+	dataBody := make(map[string]interface{}, 0)
1178
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
1179
+	fmt.Print("err", err)
1180
+	admission_time := dataBody["admission_time"].(string)
1217 1181
 	admissionTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", admission_time+" 00:00:00", loc)
1218 1182
 	admissiontime := admissionTimes.Unix()
1183
+	admitting_diagnosis := dataBody["admitting_diagnosis"].(string)
1184
+	admitting_diagnosis_id := dataBody["admitting_diagnosis_id"].(string)
1185
+	connecticut := dataBody["connecticut"].(string)
1186
+	dean := int64(dataBody["dean"].(float64))
1187
+	discharge_diagnosis := dataBody["discharge_diagnosis"].(string)
1188
+	discharge_diagnosis_id := dataBody["discharge_diagnosis_id"].(string)
1189
+	diagnosis_admission := dataBody["diagnosis_admission"].(string)
1190
+	diagnosis_admission_id := dataBody["diagnosis_admission_id"].(string)
1191
+	discharge_advice_id := dataBody["discharge_advice_id"].(string)
1192
+	discharge_advice := dataBody["discharge_advice"].(string)
1193
+	discharge_time := dataBody["discharge_time"].(string)
1219 1194
 
1220
-	admitting_diagnosis := this.GetString("admitting_diagnosis")
1221
-	admitting_diagnosis_id := this.GetString("admitting_diagnosis_id")
1222
-
1223
-	connecticut := this.GetString("connecticut")
1224
-	dean, _ := this.GetInt64("dean")
1225
-	discharge_diagnosis := this.GetString("discharge_diagnosis")
1226
-
1227
-	discharge_diagnosis_id := this.GetString("discharge_diagnosis_id")
1228
-	diagnosis_admission := this.GetString("diagnosis_admission")
1229
-	diagnosis_admission_id := this.GetString("diagnosis_admission_id")
1230
-	discharge_advice_id := this.GetString("discharge_advice_id")
1231
-	discharge_advice := this.GetString("discharge_advice")
1232
-
1233
-	discharge_time := this.GetString("discharge_time")
1234 1195
 	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", discharge_time+" 00:00:00", loc)
1235 1196
 	dischargetime := dischargeTimes.Unix()
1236
-	doctor, _ := this.GetInt64("doctor")
1237
-	illness_discharge_id := this.GetString("illness_discharge_id")
1238
-	illness_discharge := this.GetString("illness_discharge")
1239
-	nuclear_magnetic_resonance := this.GetString("nuclear_magnetic_resonance")
1240
-	pathology := this.GetString("pathology")
1241
-	record_date := this.GetString("record_date")
1197
+	doctor := int64(dataBody["doctor"].(float64))
1198
+	illness_discharge_id := dataBody["illness_discharge_id"].(string)
1199
+	illness_discharge := dataBody["illness_discharge"].(string)
1200
+	nuclear_magnetic_resonance := dataBody["nuclear_magnetic_resonance"].(string)
1201
+	pathology := dataBody["pathology"].(string)
1202
+	record_date := dataBody["record_date"].(string)
1242 1203
 	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1243 1204
 	recordtime := recordDates.Unix()
1244
-	sick_personnel := this.GetString("sick_personnel")
1245
-	title := this.GetString("title")
1246
-	treatment_id := this.GetString("treatment_id")
1247
-	treatment := this.GetString("treatment")
1248
-	ultrasound := this.GetString("ultrasound")
1249
-	xray := this.GetString("xray")
1250
-	patient_id, _ := this.GetInt64("patient_id")
1205
+	sick_personnel := dataBody["sick_personnel"].(string)
1206
+	title := dataBody["title"].(string)
1207
+	treatment_id := dataBody["treatment_id"].(string)
1208
+	treatment := dataBody["treatment"].(string)
1209
+	ultrasound := dataBody["ultrasound"].(string)
1210
+	xray := dataBody["xray"].(string)
1211
+	patient_id := int64(dataBody["patient_id"].(float64))
1251 1212
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1252 1213
 	summary := models.XtHospitalSummary{
1253 1214
 		PatientId:                patient_id,
@@ -1327,43 +1288,42 @@ func (this *DoctorsApiController) UpdateHospitalSummary() {
1327 1288
 
1328 1289
 	timeLayout := "2006-01-02"
1329 1290
 	loc, _ := time.LoadLocation("Local")
1330
-	admission_time := this.GetString("admission_time")
1291
+	dataBody := make(map[string]interface{}, 0)
1292
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
1293
+	fmt.Print("err", err)
1294
+	admission_time := dataBody["admission_time"].(string)
1331 1295
 	admissionTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", admission_time+" 00:00:00", loc)
1332 1296
 	admissiontime := admissionTimes.Unix()
1297
+	admitting_diagnosis := dataBody["admitting_diagnosis"].(string)
1298
+	admitting_diagnosis_id := dataBody["admitting_diagnosis_id"].(string)
1299
+	connecticut := dataBody["connecticut"].(string)
1300
+	dean := int64(dataBody["dean"].(float64))
1301
+	discharge_diagnosis := dataBody["discharge_diagnosis"].(string)
1302
+	discharge_diagnosis_id := dataBody["discharge_diagnosis_id"].(string)
1303
+	diagnosis_admission := dataBody["diagnosis_admission"].(string)
1304
+	diagnosis_admission_id := dataBody["diagnosis_admission_id"].(string)
1305
+	discharge_advice_id := dataBody["discharge_advice_id"].(string)
1306
+	discharge_advice := dataBody["discharge_advice"].(string)
1307
+	discharge_time := dataBody["discharge_time"].(string)
1333 1308
 
1334
-	id, _ := this.GetInt64("id")
1335
-	admitting_diagnosis := this.GetString("admitting_diagnosis")
1336
-	admitting_diagnosis_id := this.GetString("admitting_diagnosis_id")
1337
-
1338
-	connecticut := this.GetString("connecticut")
1339
-	dean, _ := this.GetInt64("dean")
1340
-	discharge_diagnosis := this.GetString("discharge_diagnosis")
1341
-
1342
-	discharge_diagnosis_id := this.GetString("discharge_diagnosis_id")
1343
-	diagnosis_admission := this.GetString("diagnosis_admission")
1344
-	diagnosis_admission_id := this.GetString("diagnosis_admission_id")
1345
-	discharge_advice_id := this.GetString("discharge_advice_id")
1346
-	discharge_advice := this.GetString("discharge_advice")
1347
-
1348
-	discharge_time := this.GetString("discharge_time")
1349 1309
 	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", discharge_time+" 00:00:00", loc)
1350 1310
 	dischargetime := dischargeTimes.Unix()
1351
-	doctor, _ := this.GetInt64("doctor")
1352
-	illness_discharge_id := this.GetString("illness_discharge_id")
1353
-	illness_discharge := this.GetString("illness_discharge")
1354
-	nuclear_magnetic_resonance := this.GetString("nuclear_magnetic_resonance")
1355
-	pathology := this.GetString("pathology")
1356
-	record_date := this.GetString("record_date")
1311
+	doctor := int64(dataBody["doctor"].(float64))
1312
+	illness_discharge_id := dataBody["illness_discharge_id"].(string)
1313
+	illness_discharge := dataBody["illness_discharge"].(string)
1314
+	nuclear_magnetic_resonance := dataBody["nuclear_magnetic_resonance"].(string)
1315
+	pathology := dataBody["pathology"].(string)
1316
+	record_date := dataBody["record_date"].(string)
1357 1317
 	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1358 1318
 	recordtime := recordDates.Unix()
1359
-	sick_personnel := this.GetString("sick_personnel")
1360
-	title := this.GetString("title")
1361
-	treatment_id := this.GetString("treatment_id")
1362
-	treatment := this.GetString("treatment")
1363
-	ultrasound := this.GetString("ultrasound")
1364
-	xray := this.GetString("xray")
1365
-	patient_id, _ := this.GetInt64("patient_id")
1366
-
1319
+	sick_personnel := dataBody["sick_personnel"].(string)
1320
+	title := dataBody["title"].(string)
1321
+	treatment_id := dataBody["treatment_id"].(string)
1322
+	treatment := dataBody["treatment"].(string)
1323
+	ultrasound := dataBody["ultrasound"].(string)
1324
+	xray := dataBody["xray"].(string)
1325
+	patient_id := int64(dataBody["patient_id"].(float64))
1326
+	id := int64(dataBody["id"].(float64))
1367 1327
 	summary := models.XtHospitalSummary{
1368 1328
 		PatientId:                patient_id,
1369 1329
 		AdmissionTime:            admissiontime,
@@ -1393,7 +1353,7 @@ func (this *DoctorsApiController) UpdateHospitalSummary() {
1393 1353
 		DeanId:                   dean,
1394 1354
 		DischargeDiagnosisId:     discharge_diagnosis_id,
1395 1355
 	}
1396
-	err := service.UpdateHospital(id, summary)
1356
+	err = service.UpdateHospital(id, summary)
1397 1357
 	if err == nil {
1398 1358
 		this.ServeSuccessJSON(map[string]interface{}{
1399 1359
 			"detail": summary,
@@ -1404,8 +1364,9 @@ func (this *DoctorsApiController) UpdateHospitalSummary() {
1404 1364
 
1405 1365
 func (this *DoctorsApiController) DeleteHospitalSummary() {
1406 1366
 
1407
-	id, _ := this.GetInt64("id")
1408
-	err := service.DeleteHospitalSummary(id)
1367
+	schIDStr := this.GetString("ids")
1368
+	idStrs := strings.Split(schIDStr, ",")
1369
+	err := service.DeleteHospitalSummary(idStrs)
1409 1370
 	fmt.Println(err)
1410 1371
 	returnData := make(map[string]interface{}, 0)
1411 1372
 	returnData["msg"] = "ok"

+ 7 - 2
controllers/mobile_api_controllers/doctor_advice_api_controller.go Vedi File

@@ -5,6 +5,8 @@ import (
5 5
 	"XT_New/models"
6 6
 	"XT_New/service"
7 7
 	"XT_New/utils"
8
+	"strconv"
9
+	"time"
8 10
 )
9 11
 
10 12
 type DoctorAdviceAPIController struct {
@@ -15,6 +17,7 @@ type DoctorAdviceAPIController struct {
15 17
 // @param date:string (yyyy-mm-dd)
16 18
 // @param advice_type:int 1长期医嘱 3临时医嘱 其他:全部
17 19
 func (this *DoctorAdviceAPIController) ScheduleAdvices() {
20
+
18 21
 	schedualDate := this.GetString("date")
19 22
 	adviceType, _ := this.GetInt("advice_type")
20 23
 	patientType, _ := this.GetInt("patient_type")
@@ -36,9 +39,12 @@ func (this *DoctorAdviceAPIController) ScheduleAdvices() {
36 39
 
37 40
 	adminInfo := this.GetMobileAdminUserInfo()
38 41
 	orgID := adminInfo.Org.Id
42
+	redis := service.RedisClient()
43
+	key := strconv.FormatInt(orgID, 10) + ":" + ":patient_list_all"
44
+	redis.Set(key, "", time.Second)
39 45
 	scheduals, err := service.MobileGetScheduleDoctorAdvicesTwo(orgID, date.Unix(), adviceType, patientType, adminInfo.AdminUser.Id, delivery_way)
40 46
 	//获取所有的患者
41
-	blood_patients, _ := service.GetAllPatientListByListTwo(orgID)
47
+	blood_patients, _ := service.GetAllPatientListByListSeven(orgID)
42 48
 	//获取透析处方
43 49
 	blood_prescriptions, _ := service.GetAllPrescriptionByListOne(orgID, date.Unix())
44 50
 	//获取上机
@@ -95,7 +101,6 @@ func (this *DoctorAdviceAPIController) ScheduleAdvices() {
95 101
 			}
96 102
 		}
97 103
 
98
-
99 104
 		//获取所有的患者
100 105
 		patients, _ := service.GetAllPatientListByListTwo(orgID)
101 106
 

+ 1 - 2
service/auto_clear_schedules_service.go Vedi File

@@ -33,8 +33,7 @@ func AutoClearSchedules() {
33 33
 	scheduleDate := utils.ZeroHourTimeOfDay(time.Now())
34 34
 	for _, item := range schedules {
35 35
 		//将今天(不包括今天)以前的的排班数据进行软删除
36
-		writeDb.
37
-			Table("xt_schedule as s").
36
+		writeDb.Table("xt_schedule as s").
38 37
 			Where("s.schedule_date < ? AND s.status = 1 AND "+
39 38
 				"s.user_org_id = ? AND "+
40 39
 				"NOT EXISTS (Select * FROM `xt_dialysis_order` as d Where  d.`status` = 1 AND"+

+ 7 - 3
service/auto_create_staff_schedule_service.go Vedi File

@@ -69,7 +69,6 @@ func AutoCreateStaffScheduleJob() {
69 69
 	// 获取所有机构信息
70 70
 	orgs, _ := GetAllOrgs()
71 71
 	for _, item := range orgs {
72
-		fmt.Println(item)
73 72
 		//查询该机构是否开启连续排班功能
74 73
 		schdule, _ := GetAutoContinueSchdule(item.ID)
75 74
 		//如果状态值未开启不生成连续排班
@@ -131,9 +130,14 @@ func GeThisWeekScheduleData(orgid int64, startime int64, endtime int64) (staffsc
131 130
 }
132 131
 
133 132
 func AddSchedules(schedule *models.StaffSchedule) error {
134
-
133
+	tx := writeDb.Begin()
135 134
 	err := XTWriteDB().Model(&schedule).Create(&schedule).Error
136
-	return err
135
+	if err != nil {
136
+		tx.Rollback()
137
+		return err
138
+	}
139
+	tx.Commit()
140
+	return nil
137 141
 }
138 142
 
139 143
 func GetNextWeekData(orgid int64, docid int64, scheduledate int64) (*models.StaffSchedule, error) {

+ 6 - 0
service/patient_service.go Vedi File

@@ -2512,6 +2512,12 @@ func GetAllTreatModeByList(orgID int64) (treatement []*models.TreatmentMode, err
2512 2512
 	}
2513 2513
 }
2514 2514
 
2515
+func GetAllPatientListByListSeven(orgID int64) (patients []*MSchedualPatientVM, err error) {
2516
+
2517
+	err = readDb.Model(&MSchedualPatientVM{}).Where("user_org_id=? and status=1 and lapseto = 1", orgID).Find(&patients).Error
2518
+	return patients, nil
2519
+}
2520
+
2515 2521
 func GetAllPatientListByListTwo(orgID int64) (patients []*MSchedualPatientVM, err error) {
2516 2522
 	redis := RedisClient()
2517 2523
 	defer redis.Close()

+ 2 - 2
service/patientmanage_service.go Vedi File

@@ -1875,7 +1875,7 @@ func UpdateHospital(id int64, summary models.XtHospitalSummary) error {
1875 1875
 	return err
1876 1876
 }
1877 1877
 
1878
-func DeleteHospitalSummary(id int64) error {
1879
-	err := XTWriteDB().Model(models.XtHospitalSummary{}).Where("id = ? and status=1", id).Updates(map[string]interface{}{"status": 0}).Error
1878
+func DeleteHospitalSummary(id []string) error {
1879
+	err := XTWriteDB().Model(models.XtHospitalSummary{}).Where("id in (?) and status=1", id).Updates(map[string]interface{}{"status": 0}).Error
1880 1880
 	return err
1881 1881
 }

+ 4 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Vedi File

@@ -59,7 +59,10 @@ func GetSchedules(orgID int64, schIDs []string) ([]*ScheduleVM, error) {
59 59
 	for _, item := range schedules {
60 60
 		dialysis_count, _ := GetDialysisOrderCount(orgID, item.PatientID, item.ScheduleDate)
61 61
 		fmt.Println(dialysis_count)
62
-		item.Patient.TotalDialysis = dialysis_count
62
+		if orgID != 10101 {
63
+			item.Patient.TotalDialysis = dialysis_count
64
+		}
65
+
63 66
 		fmt.Println(item.Patient.TotalDialysis)
64 67
 
65 68
 	}