Parcourir la source

11月8日库存管理

XMLWAN il y a 3 ans
Parent
révision
1cff966054

+ 4 - 2
controllers/dialysis_api_controller.go Voir le fichier

2806
 
2806
 
2807
 	check, _ := service.FindDoubleCheckById(adminUserInfo.CurrentOrgId, patientInfo.ID, xttime)
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
 	//operators, _ := service.GetAdminUserES(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, operatorIDs)
2815
 	//operators, _ := service.GetAdminUserES(adminUserInfo.CurrentOrgId, adminUserInfo.CurrentAppId, operatorIDs)

+ 99 - 138
controllers/doctors_api_controller.go Voir le fichier

53
 	beego.Router("/api/patient/gettemplatesummaryprintdetail", &DoctorsApiController{}, "Get:GetTemplateSummaryPrintDetail")
53
 	beego.Router("/api/patient/gettemplatesummaryprintdetail", &DoctorsApiController{}, "Get:GetTemplateSummaryPrintDetail")
54
 	beego.Router("/api/patient/updatetemplatesummary", &DoctorsApiController{}, "Post:UpdateTempalteSummary")
54
 	beego.Router("/api/patient/updatetemplatesummary", &DoctorsApiController{}, "Post:UpdateTempalteSummary")
55
 	beego.Router("/api/patient/deletesummary", &DoctorsApiController{}, "Get:DeleteSummary")
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
 	beego.Router("/api/patient/gethospitalsummarylist", &DoctorsApiController{}, "Get:GetHospitalSummaryList")
57
 	beego.Router("/api/patient/gethospitalsummarylist", &DoctorsApiController{}, "Get:GetHospitalSummaryList")
58
 	beego.Router("/api/patient/gethospitalsummaydetail", &DoctorsApiController{}, "Get:GetHospitalSummaryDetail")
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
 	beego.Router("/api/patient/deletehospitalsummary", &DoctorsApiController{}, "Get:DeleteHospitalSummary")
60
 	beego.Router("/api/patient/deletehospitalsummary", &DoctorsApiController{}, "Get:DeleteHospitalSummary")
61
 	beego.Router("/api/patient/getpatientinfo", &DoctorsApiController{}, "Get:GetPatientInfo")
61
 	beego.Router("/api/patient/getpatientinfo", &DoctorsApiController{}, "Get:GetPatientInfo")
62
 }
62
 }
1009
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1009
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1010
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
1010
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
1011
 	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
1011
 	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
1012
-	fmt.Println("hhhhhhhhhhhhhh777777", endTime.Unix())
1012
+
1013
 	list, err := service.GetTemplateSummaryList(patient_id, orgId, startTime.Unix(), endTime.Unix())
1013
 	list, err := service.GetTemplateSummaryList(patient_id, orgId, startTime.Unix(), endTime.Unix())
1014
 	if err == nil {
1014
 	if err == nil {
1015
 		this.ServeSuccessJSON(map[string]interface{}{
1015
 		this.ServeSuccessJSON(map[string]interface{}{
1064
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1064
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1065
 		return
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
 	dry_weight, _ := strconv.ParseFloat(dryWeight, 64)
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
 	kalium, _ := strconv.ParseFloat(kaliumstr, 64)
1082
 	kalium, _ := strconv.ParseFloat(kaliumstr, 64)
1081
-	autunitestr := dataBody["autunite"].(string)
1083
+
1084
+	autunitestr := this.GetString("autunite")
1082
 	autunite, _ := strconv.ParseFloat(autunitestr, 64)
1085
 	autunite, _ := strconv.ParseFloat(autunitestr, 64)
1083
-	natriumstr := dataBody["natrium"].(string)
1086
+	natriumstr := this.GetString("natrium")
1084
 	natrium, _ := strconv.ParseFloat(natriumstr, 64)
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
 	befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
1091
 	befor_weight, _ := strconv.ParseFloat(beforWeight, 64)
1089
-	afterWeight := dataBody["after_weight"].(string)
1092
+	afterWeight := this.GetString("after_weight")
1090
 	after_weight, _ := strconv.ParseFloat(afterWeight, 64)
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
 	timeLayout := "2006-01-02"
1099
 	timeLayout := "2006-01-02"
1097
 	loc, _ := time.LoadLocation("Local")
1100
 	loc, _ := time.LoadLocation("Local")
1098
 	recordTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_time, loc)
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
 	orgId := this.GetAdminUserInfo().CurrentOrgId
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
 	summary := models.XtTemplateSummary{
1111
 	summary := models.XtTemplateSummary{
1152
 		ID:                     id,
1112
 		ID:                     id,
1153
 		StartYear:              0,
1113
 		StartYear:              0,
1213
 
1173
 
1214
 	timeLayout := "2006-01-02"
1174
 	timeLayout := "2006-01-02"
1215
 	loc, _ := time.LoadLocation("Local")
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
 	admissionTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", admission_time+" 00:00:00", loc)
1181
 	admissionTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", admission_time+" 00:00:00", loc)
1218
 	admissiontime := admissionTimes.Unix()
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
 	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", discharge_time+" 00:00:00", loc)
1195
 	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", discharge_time+" 00:00:00", loc)
1235
 	dischargetime := dischargeTimes.Unix()
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
 	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1203
 	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1243
 	recordtime := recordDates.Unix()
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
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1212
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1252
 	summary := models.XtHospitalSummary{
1213
 	summary := models.XtHospitalSummary{
1253
 		PatientId:                patient_id,
1214
 		PatientId:                patient_id,
1327
 
1288
 
1328
 	timeLayout := "2006-01-02"
1289
 	timeLayout := "2006-01-02"
1329
 	loc, _ := time.LoadLocation("Local")
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
 	admissionTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", admission_time+" 00:00:00", loc)
1295
 	admissionTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", admission_time+" 00:00:00", loc)
1332
 	admissiontime := admissionTimes.Unix()
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
 	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", discharge_time+" 00:00:00", loc)
1309
 	dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", discharge_time+" 00:00:00", loc)
1350
 	dischargetime := dischargeTimes.Unix()
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
 	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1317
 	recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
1358
 	recordtime := recordDates.Unix()
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
 	summary := models.XtHospitalSummary{
1327
 	summary := models.XtHospitalSummary{
1368
 		PatientId:                patient_id,
1328
 		PatientId:                patient_id,
1369
 		AdmissionTime:            admissiontime,
1329
 		AdmissionTime:            admissiontime,
1393
 		DeanId:                   dean,
1353
 		DeanId:                   dean,
1394
 		DischargeDiagnosisId:     discharge_diagnosis_id,
1354
 		DischargeDiagnosisId:     discharge_diagnosis_id,
1395
 	}
1355
 	}
1396
-	err := service.UpdateHospital(id, summary)
1356
+	err = service.UpdateHospital(id, summary)
1397
 	if err == nil {
1357
 	if err == nil {
1398
 		this.ServeSuccessJSON(map[string]interface{}{
1358
 		this.ServeSuccessJSON(map[string]interface{}{
1399
 			"detail": summary,
1359
 			"detail": summary,
1404
 
1364
 
1405
 func (this *DoctorsApiController) DeleteHospitalSummary() {
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
 	fmt.Println(err)
1370
 	fmt.Println(err)
1410
 	returnData := make(map[string]interface{}, 0)
1371
 	returnData := make(map[string]interface{}, 0)
1411
 	returnData["msg"] = "ok"
1372
 	returnData["msg"] = "ok"

+ 7 - 2
controllers/mobile_api_controllers/doctor_advice_api_controller.go Voir le fichier

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

+ 1 - 2
service/auto_clear_schedules_service.go Voir le fichier

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

+ 7 - 3
service/auto_create_staff_schedule_service.go Voir le fichier

69
 	// 获取所有机构信息
69
 	// 获取所有机构信息
70
 	orgs, _ := GetAllOrgs()
70
 	orgs, _ := GetAllOrgs()
71
 	for _, item := range orgs {
71
 	for _, item := range orgs {
72
-		fmt.Println(item)
73
 		//查询该机构是否开启连续排班功能
72
 		//查询该机构是否开启连续排班功能
74
 		schdule, _ := GetAutoContinueSchdule(item.ID)
73
 		schdule, _ := GetAutoContinueSchdule(item.ID)
75
 		//如果状态值未开启不生成连续排班
74
 		//如果状态值未开启不生成连续排班
131
 }
130
 }
132
 
131
 
133
 func AddSchedules(schedule *models.StaffSchedule) error {
132
 func AddSchedules(schedule *models.StaffSchedule) error {
134
-
133
+	tx := writeDb.Begin()
135
 	err := XTWriteDB().Model(&schedule).Create(&schedule).Error
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
 func GetNextWeekData(orgid int64, docid int64, scheduledate int64) (*models.StaffSchedule, error) {
143
 func GetNextWeekData(orgid int64, docid int64, scheduledate int64) (*models.StaffSchedule, error) {

+ 6 - 0
service/patient_service.go Voir le fichier

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
 func GetAllPatientListByListTwo(orgID int64) (patients []*MSchedualPatientVM, err error) {
2521
 func GetAllPatientListByListTwo(orgID int64) (patients []*MSchedualPatientVM, err error) {
2516
 	redis := RedisClient()
2522
 	redis := RedisClient()
2517
 	defer redis.Close()
2523
 	defer redis.Close()

+ 2 - 2
service/patientmanage_service.go Voir le fichier

1875
 	return err
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
 	return err
1880
 	return err
1881
 }
1881
 }

+ 4 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Voir le fichier

59
 	for _, item := range schedules {
59
 	for _, item := range schedules {
60
 		dialysis_count, _ := GetDialysisOrderCount(orgID, item.PatientID, item.ScheduleDate)
60
 		dialysis_count, _ := GetDialysisOrderCount(orgID, item.PatientID, item.ScheduleDate)
61
 		fmt.Println(dialysis_count)
61
 		fmt.Println(dialysis_count)
62
-		item.Patient.TotalDialysis = dialysis_count
62
+		if orgID != 10101 {
63
+			item.Patient.TotalDialysis = dialysis_count
64
+		}
65
+
63
 		fmt.Println(item.Patient.TotalDialysis)
66
 		fmt.Println(item.Patient.TotalDialysis)
64
 
67
 
65
 	}
68
 	}