Quellcode durchsuchen

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

XMLWAN vor 4 Jahren
Ursprung
Commit
be99e67de1

+ 61 - 59
controllers/base_api_controller.go Datei anzeigen

@@ -2,6 +2,8 @@ package controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
+	"XT_New/models"
6
+
5 7
 	//"XT_New/models"
6 8
 	"XT_New/service"
7 9
 	"strconv"
@@ -64,36 +66,36 @@ type BaseAuthAPIController struct {
64 66
 func (this *BaseAuthAPIController) Prepare() {
65 67
 	this.BaseAPIController.Prepare()
66 68
 	if this.GetAdminUserInfo() == nil {
67
-		//var userAdmin models.AdminUser
68
-		//userAdmin.Id = 558
69
-		//userAdmin.Mobile = "13318464649"
70
-		//
71
-		////userAdmin.Id = 597
72
-		////userAdmin.Mobile = "19874122664"
73
-		//userAdmin.IsSuperAdmin = false
74
-		//userAdmin.Status = 1
75
-		//userAdmin.CreateTime = 1530786071
76
-		//userAdmin.ModifyTime = 1530786071
77
-		//var subscibe models.ServeSubscibe
78
-		//subscibe.ID = 1
79
-		//subscibe.OrgId = 4
80
-		//subscibe.PeriodStart = 1538035409
81
-		//subscibe.PeriodEnd = 1569571409
82
-		//subscibe.State = 1
83
-		//subscibe.Status = 1
84
-		//subscibe.CreatedTime = 1538035409
85
-		//subscibe.UpdatedTime = 1538035409
86
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
87
-		//subscibes[4] = &subscibe
88
-		//var adminUserInfo service.AdminUserInfo
89
-		//adminUserInfo.CurrentOrgId = 4
90
-		//adminUserInfo.CurrentAppId = 18
91
-		//adminUserInfo.AdminUser = &userAdmin
92
-		//adminUserInfo.Subscibes = subscibes
93
-		//this.SetSession("admin_user_info", &adminUserInfo)
94
-
95
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
96
-		this.StopRun()
69
+		var userAdmin models.AdminUser
70
+		userAdmin.Id = 558
71
+		userAdmin.Mobile = "13318464649"
72
+
73
+		//userAdmin.Id = 597
74
+		//userAdmin.Mobile = "19874122664"
75
+		userAdmin.IsSuperAdmin = false
76
+		userAdmin.Status = 1
77
+		userAdmin.CreateTime = 1530786071
78
+		userAdmin.ModifyTime = 1530786071
79
+		var subscibe models.ServeSubscibe
80
+		subscibe.ID = 1
81
+		subscibe.OrgId = 4
82
+		subscibe.PeriodStart = 1538035409
83
+		subscibe.PeriodEnd = 1569571409
84
+		subscibe.State = 1
85
+		subscibe.Status = 1
86
+		subscibe.CreatedTime = 1538035409
87
+		subscibe.UpdatedTime = 1538035409
88
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
89
+		subscibes[4] = &subscibe
90
+		var adminUserInfo service.AdminUserInfo
91
+		adminUserInfo.CurrentOrgId = 4
92
+		adminUserInfo.CurrentAppId = 18
93
+		adminUserInfo.AdminUser = &userAdmin
94
+		adminUserInfo.Subscibes = subscibes
95
+		this.SetSession("admin_user_info", &adminUserInfo)
96
+
97
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
98
+		//this.StopRun()
97 99
 
98 100
 	}
99 101
 
@@ -306,35 +308,35 @@ type BaseServeAPIController struct {
306 308
 func (this *BaseServeAPIController) Prepare() {
307 309
 	this.BaseAPIController.Prepare()
308 310
 	if this.GetAdminUserInfo() == nil {
309
-		//var userAdmin models.AdminUser
310
-		//userAdmin.Id = 558
311
-		//userAdmin.Mobile = "13535547901"
312
-		////userAdmin.Id = 597
313
-		////userAdmin.Mobile = "19874122664"
314
-		//userAdmin.IsSuperAdmin = false
315
-		//userAdmin.Status = 1
316
-		//userAdmin.CreateTime = 1530786071
317
-		//userAdmin.ModifyTime = 1530786071
318
-		//var subscibe models.ServeSubscibe
319
-		//subscibe.ID = 1
320
-		//subscibe.OrgId = 4
321
-		//subscibe.PeriodStart = 1538035409
322
-		//subscibe.PeriodEnd = 1569571409
323
-		//subscibe.State = 1
324
-		//subscibe.Status = 1
325
-		//subscibe.CreatedTime = 1538035409
326
-		//subscibe.UpdatedTime = 1538035409
327
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
328
-		//subscibes[4] = &subscibe
329
-		//var adminUserInfo service.AdminUserInfo
330
-		//adminUserInfo.CurrentOrgId = 4
331
-		//adminUserInfo.CurrentAppId = 18
332
-		//adminUserInfo.AdminUser = &userAdmin
333
-		//adminUserInfo.Subscibes = subscibes
334
-		//this.SetSession("admin_user_info", &adminUserInfo)
335
-
336
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
337
-		this.StopRun()
311
+		var userAdmin models.AdminUser
312
+		userAdmin.Id = 558
313
+		userAdmin.Mobile = "13535547901"
314
+		//userAdmin.Id = 597
315
+		//userAdmin.Mobile = "19874122664"
316
+		userAdmin.IsSuperAdmin = false
317
+		userAdmin.Status = 1
318
+		userAdmin.CreateTime = 1530786071
319
+		userAdmin.ModifyTime = 1530786071
320
+		var subscibe models.ServeSubscibe
321
+		subscibe.ID = 1
322
+		subscibe.OrgId = 4
323
+		subscibe.PeriodStart = 1538035409
324
+		subscibe.PeriodEnd = 1569571409
325
+		subscibe.State = 1
326
+		subscibe.Status = 1
327
+		subscibe.CreatedTime = 1538035409
328
+		subscibe.UpdatedTime = 1538035409
329
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
330
+		subscibes[4] = &subscibe
331
+		var adminUserInfo service.AdminUserInfo
332
+		adminUserInfo.CurrentOrgId = 4
333
+		adminUserInfo.CurrentAppId = 18
334
+		adminUserInfo.AdminUser = &userAdmin
335
+		adminUserInfo.Subscibes = subscibes
336
+		this.SetSession("admin_user_info", &adminUserInfo)
337
+
338
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
339
+		//this.StopRun()
338 340
 	}
339 341
 
340 342
 	//if adminUserInfo.AppRole != nil {

+ 94 - 94
controllers/manage_api_controller.go Datei anzeigen

@@ -1165,35 +1165,35 @@ func (this *MachineApiController) SaveInformation() {
1165 1165
 			Date:  startdate,
1166 1166
 			Class: classtype,
1167 1167
 			//	Zone:                  zone,
1168
-			BedNumber:             bednumber,
1169
-			PatientId:             patient_time,
1170
-			Contagion:             contagion,
1171
-			DialysisMode:          dialysis_mode,
1172
-			StartTime:             startDate.Unix(),
1173
-			EndTime:               endDate.Unix(),
1174
-			DialysisHour:          dialysis_time,
1175
-			Hyperfiltratio:        hyperfiletration,
1176
-			WeightLoss:            weight_loss,
1177
-			WarningValue:          warining_value,
1178
-			UserTotal:             user_total,
1179
-			Move:                  run,
1180
-			FailureStage:          failure_stage,
1181
-			FaultDescription:      falult_desciription,
1182
-			CodeInformation:       code_information,
1183
-			DisinfectantType:      disinfectant_type,
1184
-			DisinfectType:         disinfect_type,
1185
-			Disinfection:          disinfection,
1186
-			MachineRun:            machine_run,
1187
-			FluidPath:             fluid_path,
1188
-			Disinfectant:          disinfectant,
1189
-			DisinfectionStatus:    disinfection_status,
1190
-			DisinfectionResidue:   disinfection_residue,
1191
-			LongTime:              longtime,
1192
-			DisinfecStartime:      start_Date.Unix(),
1193
-			DisinfecEndtime:       end_Date.Unix(),
1194
-			DialysisChecked:       dialysis_checked,
1195
-			DialysisName:          dialysis_name,
1196
-			Norms:                 norms,
1168
+			BedNumber:           bednumber,
1169
+			PatientId:           patient_time,
1170
+			Contagion:           contagion,
1171
+			DialysisMode:        dialysis_mode,
1172
+			StartTime:           startDate.Unix(),
1173
+			EndTime:             endDate.Unix(),
1174
+			DialysisHour:        dialysis_time,
1175
+			Hyperfiltratio:      hyperfiletration,
1176
+			WeightLoss:          weight_loss,
1177
+			WarningValue:        warining_value,
1178
+			UserTotal:           user_total,
1179
+			Move:                run,
1180
+			FailureStage:        failure_stage,
1181
+			FaultDescription:    falult_desciription,
1182
+			CodeInformation:     code_information,
1183
+			DisinfectantType:    disinfectant_type,
1184
+			DisinfectType:       disinfect_type,
1185
+			Disinfection:        disinfection,
1186
+			MachineRun:          machine_run,
1187
+			FluidPath:           fluid_path,
1188
+			Disinfectant:        disinfectant,
1189
+			DisinfectionStatus:  disinfection_status,
1190
+			DisinfectionResidue: disinfection_residue,
1191
+			LongTime:            longtime,
1192
+			DisinfecStartime:    start_Date.Unix(),
1193
+			DisinfecEndtime:     end_Date.Unix(),
1194
+			DialysisChecked:     dialysis_checked,
1195
+			DialysisName:        dialysis_name,
1196
+			Norms:               norms,
1197 1197
 			DialysisConcentration: dialysis_concentration,
1198 1198
 			GermChecked:           germ_checked,
1199 1199
 			GermName:              germ_name,
@@ -1214,38 +1214,38 @@ func (this *MachineApiController) SaveInformation() {
1214 1214
 		})
1215 1215
 	} else if errinfor == nil {
1216 1216
 		infor := models.DeviceInformation{
1217
-			Date:                  startdate,
1218
-			Class:                 classtype,
1219
-			Zone:                  zone,
1220
-			BedNumber:             bednumber,
1221
-			PatientId:             patient_time,
1222
-			Contagion:             contagion,
1223
-			DialysisMode:          dialysis_mode,
1224
-			StartTime:             startDate.Unix(),
1225
-			EndTime:               endDate.Unix(),
1226
-			DialysisHour:          dialysis_time,
1227
-			Hyperfiltratio:        hyperfiletration,
1228
-			WeightLoss:            weight_loss,
1229
-			WarningValue:          warining_value,
1230
-			UserTotal:             user_total,
1231
-			Move:                  run,
1232
-			FailureStage:          failure_stage,
1233
-			FaultDescription:      falult_desciription,
1234
-			CodeInformation:       code_information,
1235
-			DisinfectantType:      disinfectant_type,
1236
-			DisinfectType:         disinfect_type,
1237
-			Disinfection:          disinfection,
1238
-			MachineRun:            machine_run,
1239
-			FluidPath:             fluid_path,
1240
-			Disinfectant:          disinfectant,
1241
-			DisinfectionStatus:    disinfection_status,
1242
-			DisinfectionResidue:   disinfection_residue,
1243
-			LongTime:              longtime,
1244
-			DisinfecStartime:      start_Date.Unix(),
1245
-			DisinfecEndtime:       end_Date.Unix(),
1246
-			DialysisChecked:       dialysis_checked,
1247
-			DialysisName:          dialysis_name,
1248
-			Norms:                 norms,
1217
+			Date:                startdate,
1218
+			Class:               classtype,
1219
+			Zone:                zone,
1220
+			BedNumber:           bednumber,
1221
+			PatientId:           patient_time,
1222
+			Contagion:           contagion,
1223
+			DialysisMode:        dialysis_mode,
1224
+			StartTime:           startDate.Unix(),
1225
+			EndTime:             endDate.Unix(),
1226
+			DialysisHour:        dialysis_time,
1227
+			Hyperfiltratio:      hyperfiletration,
1228
+			WeightLoss:          weight_loss,
1229
+			WarningValue:        warining_value,
1230
+			UserTotal:           user_total,
1231
+			Move:                run,
1232
+			FailureStage:        failure_stage,
1233
+			FaultDescription:    falult_desciription,
1234
+			CodeInformation:     code_information,
1235
+			DisinfectantType:    disinfectant_type,
1236
+			DisinfectType:       disinfect_type,
1237
+			Disinfection:        disinfection,
1238
+			MachineRun:          machine_run,
1239
+			FluidPath:           fluid_path,
1240
+			Disinfectant:        disinfectant,
1241
+			DisinfectionStatus:  disinfection_status,
1242
+			DisinfectionResidue: disinfection_residue,
1243
+			LongTime:            longtime,
1244
+			DisinfecStartime:    start_Date.Unix(),
1245
+			DisinfecEndtime:     end_Date.Unix(),
1246
+			DialysisChecked:     dialysis_checked,
1247
+			DialysisName:        dialysis_name,
1248
+			Norms:               norms,
1249 1249
 			DialysisConcentration: dialysis_concentration,
1250 1250
 			GermChecked:           germ_checked,
1251 1251
 			GermName:              germ_name,
@@ -2404,37 +2404,37 @@ func (this *MachineApiController) UpdateForm() {
2404 2404
 	err = service.UpdatedZoneID(bednumber, orgid, &deviceNumber)
2405 2405
 	fmt.Println("更新区号失败", err)
2406 2406
 	information := models.DeviceInformation{
2407
-		Date:                  startdate,
2408
-		Class:                 classtype,
2409
-		Zone:                  zone,
2410
-		BedNumber:             bednumber,
2411
-		Contagion:             contagion,
2412
-		DialysisMode:          dialysis_mode,
2413
-		StartTime:             startDate.Unix(),
2414
-		EndTime:               endDate.Unix(),
2415
-		DialysisHour:          dialysis_time,
2416
-		Hyperfiltratio:        hyperfiletration,
2417
-		WeightLoss:            weight_loss,
2418
-		WarningValue:          warining_value,
2419
-		UserTotal:             user_total,
2420
-		Move:                  run,
2421
-		FailureStage:          failure_stage,
2422
-		FaultDescription:      falult_desciription,
2423
-		CodeInformation:       code_information,
2424
-		DisinfectantType:      disinfectant_type,
2425
-		DisinfectType:         disinfect_type,
2426
-		Disinfection:          disinfection,
2427
-		MachineRun:            machine_run,
2428
-		FluidPath:             fluid_path,
2429
-		Disinfectant:          disinfectant,
2430
-		DisinfectionStatus:    disinfection_status,
2431
-		DisinfectionResidue:   disinfection_residue,
2432
-		LongTime:              longtime,
2433
-		DisinfecStartime:      distartime,
2434
-		DisinfecEndtime:       diendtime,
2435
-		DialysisChecked:       dialysis_checked,
2436
-		DialysisName:          dialysis_name,
2437
-		Norms:                 norms,
2407
+		Date:                startdate,
2408
+		Class:               classtype,
2409
+		Zone:                zone,
2410
+		BedNumber:           bednumber,
2411
+		Contagion:           contagion,
2412
+		DialysisMode:        dialysis_mode,
2413
+		StartTime:           startDate.Unix(),
2414
+		EndTime:             endDate.Unix(),
2415
+		DialysisHour:        dialysis_time,
2416
+		Hyperfiltratio:      hyperfiletration,
2417
+		WeightLoss:          weight_loss,
2418
+		WarningValue:        warining_value,
2419
+		UserTotal:           user_total,
2420
+		Move:                run,
2421
+		FailureStage:        failure_stage,
2422
+		FaultDescription:    falult_desciription,
2423
+		CodeInformation:     code_information,
2424
+		DisinfectantType:    disinfectant_type,
2425
+		DisinfectType:       disinfect_type,
2426
+		Disinfection:        disinfection,
2427
+		MachineRun:          machine_run,
2428
+		FluidPath:           fluid_path,
2429
+		Disinfectant:        disinfectant,
2430
+		DisinfectionStatus:  disinfection_status,
2431
+		DisinfectionResidue: disinfection_residue,
2432
+		LongTime:            longtime,
2433
+		DisinfecStartime:    distartime,
2434
+		DisinfecEndtime:     diendtime,
2435
+		DialysisChecked:     dialysis_checked,
2436
+		DialysisName:        dialysis_name,
2437
+		Norms:               norms,
2438 2438
 		DialysisConcentration: dialysis_concentration,
2439 2439
 		GermChecked:           germ_checked,
2440 2440
 		GermName:              germ_name,
@@ -2944,9 +2944,9 @@ func (this *MachineApiController) SaveMode() {
2944 2944
 	if errcode == gorm.ErrRecordNotFound {
2945 2945
 		err = service.SaveMode(&mode)
2946 2946
 	} else if errcode == nil {
2947
-		fmt.Print("设备型号已存在")
2947
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)
2948
+		return
2948 2949
 	} else {
2949
-		fmt.Print("设备型号已存在")
2950 2950
 	}
2951 2951
 	if err != nil {
2952 2952
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateConfig)

+ 0 - 10
controllers/mobile_api_controllers/login_api_controller.go Datei anzeigen

@@ -7,7 +7,6 @@ import (
7 7
 	"XT_New/utils"
8 8
 	"encoding/json"
9 9
 	"fmt"
10
-	"github.com/jinzhu/gorm"
11 10
 	"io/ioutil"
12 11
 	"net/http"
13 12
 	"net/url"
@@ -200,15 +199,6 @@ func (this *LoginAPIController) LoginByPwd() {
200 199
 			utils.ErrorLog("字段批量插入失败:%v", requestErr)
201 200
 		}
202 201
 
203
-		//查询该机构是否存在医护排班
204
-		_, errcode := service.GetDoctorScheduleByOrgId(org.Id)
205
-		//如果没有就插入
206
-		if errcode == gorm.ErrRecordNotFound {
207
-			err = service.BatchInsertDoctorSchedule(org.Id)
208
-		} else {
209
-			utils.ErrorLog("医护排班默认数据插入失败:%v", err)
210
-		}
211
-
212 202
 		this.ServeSuccessJSON(map[string]interface{}{
213 203
 			"admin": adminUser,
214 204
 			"user":  appRole,

+ 7 - 2
controllers/mobile_api_controllers/patient_api_controller.go Datei anzeigen

@@ -2072,9 +2072,14 @@ func predialysisEvaluationFormData(evaluation *models.PredialysisEvaluation, dat
2072 2072
 		internal_fistula_skin := dataBody["internal_fistula_skin"].(string)
2073 2073
 		evaluation.InternalFistulaSkin = internal_fistula_skin
2074 2074
 	}
2075
+	if dataBody["is_hemorrhage"] != nil && reflect.TypeOf(dataBody["is_hemorrhage"]).String() == "string" {
2076
+		ishemorrhage, _ := dataBody["is_hemorrhage"].(string)
2077
+		is_hemorrhage, _ := strconv.ParseInt(ishemorrhage, 10, 64)
2078
+		evaluation.IsHemorrhage = is_hemorrhage
2075 2079
 
2076
-	if dataBody["is_hemorrhage"] != nil && reflect.TypeOf(dataBody["is_hemorrhage"]).String() == "float64" {
2077
-		is_hemorrhage := int64(dataBody["is_hemorrhage"].(float64))
2080
+		//if dataBody["is_hemorrhage"] != nil && reflect.TypeOf(dataBody["is_hemorrhage"]).String() == "float64" {
2081
+		//	is_hemorrhage := int64(dataBody["is_hemorrhage"].(float64))
2082
+		//	fmt.Println("is_hemorrhage2222222222222222",is_hemorrhage)
2078 2083
 		if is_hemorrhage != 1 && is_hemorrhage != 2 {
2079 2084
 			is_hemorrhage = 0
2080 2085
 		}

+ 63 - 4
controllers/new_mobile_api_controllers/common_api_controller.go Datei anzeigen

@@ -220,7 +220,7 @@ func (this *CommonApiController) GetConfigurationDetail() {
220 220
 		}
221 221
 		this.ServeSuccessJSON(map[string]interface{}{
222 222
 			"configurationdetail": detail,
223
-			"vid":                 vid,
223
+			"vid": vid,
224 224
 		})
225 225
 	} else {
226 226
 		itemId, err := service.GetIdByItemId(detail.InspectionMinor, orgId)
@@ -230,7 +230,7 @@ func (this *CommonApiController) GetConfigurationDetail() {
230 230
 		}
231 231
 		this.ServeSuccessJSON(map[string]interface{}{
232 232
 			"configurationdetail": detail,
233
-			"vid":                 itemId.ID,
233
+			"vid": itemId.ID,
234 234
 		})
235 235
 	}
236 236
 
@@ -544,11 +544,10 @@ func (this *CommonApiController) GetTotalLapseCount() {
544 544
 	startime := this.GetString("startime")
545 545
 	startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
546 546
 	startnunix := startTimes.Unix()
547
-	fmt.Println("开始时间---------------", startnunix)
548 547
 	endtime := this.GetString("endtime")
549 548
 	endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
550 549
 	endunix := endtimes.Unix()
551
-	fmt.Println("endunix==========", endunix)
550
+
552 551
 	//统计该机构的转出人数
553 552
 	patients, err := service.GetTotalRollOutPatients(orgid, startnunix, endunix)
554 553
 	//统计该机构转出病人
@@ -558,10 +557,14 @@ func (this *CommonApiController) GetTotalLapseCount() {
558 557
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
559 558
 		return
560 559
 	}
560
+
561
+	//统计当前机构转出的人数
562
+	rollout, err := service.GetCountRollout(orgid, startnunix, endunix)
561 563
 	this.ServeSuccessJSON(map[string]interface{}{
562 564
 		"patients":   patients,
563 565
 		"count":      count,
564 566
 		"patienttwo": patienttwo,
567
+		"rollout":    rollout,
565 568
 	})
566 569
 }
567 570
 
@@ -2059,3 +2062,59 @@ func (this *CommonApiController) GetIdsListTwo() {
2059 2062
 	})
2060 2063
 
2061 2064
 }
2065
+
2066
+func (this *CommonApiController) GetTreatModeList() {
2067
+
2068
+	start_time, _ := this.GetInt64("start_time")
2069
+	end_time, _ := this.GetInt64("end_time")
2070
+	adminUserInfo := this.GetAdminUserInfo()
2071
+	orgId := adminUserInfo.CurrentOrgId
2072
+	list, err := service.GetTreatModeList(start_time, end_time, orgId)
2073
+	if err != nil {
2074
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2075
+		return
2076
+	}
2077
+	this.ServeSuccessJSON(map[string]interface{}{
2078
+		"list": list,
2079
+	})
2080
+}
2081
+
2082
+func (this *CommonApiController) GetCountModeId() {
2083
+
2084
+	start_time, _ := this.GetInt64("start_time")
2085
+	end_time, _ := this.GetInt64("end_time")
2086
+	mode_id, _ := this.GetInt64("mode_id")
2087
+	adminUserInfo := this.GetAdminUserInfo()
2088
+	orgId := adminUserInfo.CurrentOrgId
2089
+	fmt.Println("start_time", start_time)
2090
+	fmt.Println("end_time", end_time)
2091
+	fmt.Println("mode_id", mode_id)
2092
+
2093
+	modeCount, err := service.GetCountModeId(start_time, end_time, mode_id, orgId)
2094
+	if err != nil {
2095
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2096
+		return
2097
+	}
2098
+	this.ServeSuccessJSON(map[string]interface{}{
2099
+		"modeCount": modeCount,
2100
+	})
2101
+}
2102
+
2103
+func (this *CommonApiController) GetRolloutCount() {
2104
+
2105
+	start_time, _ := this.GetInt64("start_time")
2106
+	end_time, _ := this.GetInt64("end_time")
2107
+	adminUserInfo := this.GetAdminUserInfo()
2108
+	orgId := adminUserInfo.CurrentOrgId
2109
+
2110
+	//统计当前机构转出的人数
2111
+	rollout, err := service.GetCountRollout(orgId, start_time, end_time)
2112
+
2113
+	if err != nil {
2114
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2115
+		return
2116
+	}
2117
+	this.ServeSuccessJSON(map[string]interface{}{
2118
+		"rollout": rollout,
2119
+	})
2120
+}

+ 3 - 0
controllers/new_mobile_api_controllers/common_api_router.go Datei anzeigen

@@ -56,4 +56,7 @@ func CommonApiControllersRegisterRouters() {
56 56
 	beego.Router("/com/api/getbloodpressurelist", &CommonApiController{}, "Get:GetBloodPressureList")
57 57
 	beego.Router("/com/api/getmonthbloodlist", &CommonApiController{}, "Get:GetMonthBloodList")
58 58
 	beego.Router("/com/api/getidslist", &CommonApiController{}, "Post:GetIdsListTwo")
59
+	beego.Router("/com/api/getreatmodelist", &CommonApiController{}, "Get:GetTreatModeList")
60
+	beego.Router("/com/api/getcountmodeid", &CommonApiController{}, "Get:GetCountModeId")
61
+	beego.Router("/com/api/getrolloutcount", &CommonApiController{}, "Get:GetRolloutCount")
59 62
 }

+ 3 - 3
controllers/new_mobile_api_controllers/dialysis_parameter_api_controller.go Datei anzeigen

@@ -45,7 +45,7 @@ func (this *DialysisParamerterApiController) GetMobileDialysisParameters() {
45 45
 	theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
46 46
 	if len(keywords) > 0 {
47 47
 
48
-		dialysisSchedule, err, total := service.GetDialysisParametersByKeyword(orgid, keywords, scheduleType, partitionType, page, limit, theTime.Unix())
48
+		//dialysisSchedule, err, total := service.GetDialysisParametersByKeyword(orgid, keywords, scheduleType, partitionType, page, limit, theTime.Unix())
49 49
 		//查询今日排班的病人
50 50
 		patient, err := service.GetDialysisTodaySchedulePatient(orgid, theTime.Unix(), page, limit, keywords)
51 51
 		var vlist []interface{}
@@ -57,8 +57,8 @@ func (this *DialysisParamerterApiController) GetMobileDialysisParameters() {
57 57
 			elist = append(elist, dialysis)
58 58
 			if err == nil {
59 59
 				this.ServeSuccessJSON(map[string]interface{}{
60
-					"schedule":     dialysisSchedule,
61
-					"total":        total,
60
+					//"schedule":     dialysisSchedule,
61
+					//"total":        total,
62 62
 					"prescription": vlist,
63 63
 					"dialysbefor":  elist,
64 64
 					"patient":      patient,

+ 75 - 0
controllers/new_mobile_api_controllers/new_common_api_controller.go Datei anzeigen

@@ -2059,3 +2059,78 @@ func (this *NewCommonApiController) GetSystolicBloodNoStand() {
2059 2059
 		"recoredtwo":    recoredtwo,
2060 2060
 	})
2061 2061
 }
2062
+
2063
+func (this *NewCommonApiController) GetMobileTreatModeList() {
2064
+
2065
+	timeLayout := "2006-01-02"
2066
+	loc, _ := time.LoadLocation("Local")
2067
+	startime := this.GetString("start_time")
2068
+	endtime := this.GetString("end_time")
2069
+	startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
2070
+	startimes := startTimes.Unix()
2071
+
2072
+	endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
2073
+	endtimeData := endtimes.Unix()
2074
+	adminUserInfo := this.GetMobileAdminUserInfo()
2075
+	orgid := adminUserInfo.Org.Id
2076
+	list, err := service.GetTreatModeList(startimes, endtimeData, orgid)
2077
+	if err != nil {
2078
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2079
+		return
2080
+	}
2081
+	this.ServeSuccessJSON(map[string]interface{}{
2082
+		"list": list,
2083
+	})
2084
+}
2085
+
2086
+func (this *NewCommonApiController) GetMobileCountModeId() {
2087
+
2088
+	timeLayout := "2006-01-02"
2089
+	loc, _ := time.LoadLocation("Local")
2090
+	startime := this.GetString("start_time")
2091
+	endtime := this.GetString("end_time")
2092
+	startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
2093
+	startimes := startTimes.Unix()
2094
+
2095
+	endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
2096
+	endtimeData := endtimes.Unix()
2097
+	mode_id, _ := this.GetInt64("mode_id")
2098
+
2099
+	adminUserInfo := this.GetMobileAdminUserInfo()
2100
+	orgId := adminUserInfo.Org.Id
2101
+
2102
+	modeCount, err := service.GetCountModeId(startimes, endtimeData, mode_id, orgId)
2103
+	if err != nil {
2104
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2105
+		return
2106
+	}
2107
+	this.ServeSuccessJSON(map[string]interface{}{
2108
+		"modeCount": modeCount,
2109
+	})
2110
+}
2111
+
2112
+func (this *NewCommonApiController) GetMobileRolloutCount() {
2113
+
2114
+	timeLayout := "2006-01-02"
2115
+	loc, _ := time.LoadLocation("Local")
2116
+	startime := this.GetString("start_time")
2117
+	endtime := this.GetString("end_time")
2118
+	startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
2119
+	startimes := startTimes.Unix()
2120
+
2121
+	endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
2122
+	endtimeData := endtimes.Unix()
2123
+
2124
+	adminUserInfo := this.GetMobileAdminUserInfo()
2125
+	orgId := adminUserInfo.Org.Id
2126
+	//统计当前机构转出的人数
2127
+	rollout, err := service.GetCountRollout(orgId, startimes, endtimeData)
2128
+
2129
+	if err != nil {
2130
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
2131
+		return
2132
+	}
2133
+	this.ServeSuccessJSON(map[string]interface{}{
2134
+		"rollout": rollout,
2135
+	})
2136
+}

+ 3 - 0
controllers/new_mobile_api_controllers/new_common_api_router.go Datei anzeigen

@@ -42,4 +42,7 @@ func NewCommonApiControllersRegisterRouters() {
42 42
 	beego.Router("/m/api/getsystolicbloodstand", &NewCommonApiController{}, "Get:GetSystolicBloodStand")
43 43
 	beego.Router("/m/api/getmobileidslist", &NewCommonApiController{}, "post:GetMobileIdsList")
44 44
 	beego.Router("/m/api/getsystolicbloodnostand", &NewCommonApiController{}, "Get:GetSystolicBloodNoStand")
45
+	beego.Router("/m/api/getmobiletreatmodelist", &NewCommonApiController{}, "Get:GetMobileTreatModeList")
46
+	beego.Router("/m/api/getmobileCountModeId", &NewCommonApiController{}, "Get:GetMobileCountModeId")
47
+	beego.Router("/m/api/getmobilerolloutcount", &NewCommonApiController{}, "Get:GetMobileRolloutCount")
45 48
 }

+ 2 - 0
controllers/verify_login_controller.go Datei anzeigen

@@ -218,6 +218,8 @@ func (this *VerifyUserLoginAPIController) VerifyToken() {
218 218
 			if len(curAppUrlfors) == 0 {
219 219
 				if adminUser.Id == curOrg.Creator { //超级管理员
220 220
 					urlfors, _, _ := service.GetSuperAdminUsersPurviewTreeAndUrlfors(3)
221
+					urlforss, _, _ := service.GetSuperAdminUsersPurviewTreeAndUrlfors(8)
222
+					urlfors = append(urlfors, urlforss...)
221 223
 					didRegistedForSCRM = true
222 224
 					didRegistedForCDM = true
223 225
 					didRegistedForMall = true

+ 13 - 0
models/common_models.go Datei anzeigen

@@ -580,3 +580,16 @@ type BloodDialysisModeIdCount struct {
580 580
 	ModeId    int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
581 581
 	Count     int64
582 582
 }
583
+
584
+type BloodTreateModeIdCount struct {
585
+	ModeId       int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
586
+	Count        int64
587
+	DialysisDate int64 `gorm:"column:dialysis_date" json:"dialysis_date" form:"dialysis_date"`
588
+}
589
+
590
+type BloodLapsetoCount struct {
591
+	ID          int64 `gorm:"column:id" json:"id" form:"id"`
592
+	Count       int64
593
+	LapsetoTime int64 `gorm:"column:lapseto_time" json:"lapseto_time" form:"lapseto_time"`
594
+	LapsetoType int64 `gorm:"column:lapseto_type" json:"lapseto_type" form:"lapseto_type"`
595
+}

+ 36 - 0
models/dialysis_parameter_models.go Datei anzeigen

@@ -112,3 +112,39 @@ func (XtScheduleTwo) TableName() string {
112 112
 
113 113
 	return "xt_schedule"
114 114
 }
115
+
116
+type DialysisPrescriptionParameter struct {
117
+	ID                         int64   `gorm:"column:id" json:"id" form:"id"`
118
+	UserOrgId                  int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
119
+	PatientId                  int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
120
+	Anticoagulant              int64   `gorm:"column:anticoagulant" json:"anticoagulant" form:"anticoagulant"`
121
+	AnticoagulantShouji        float64 `gorm:"column:anticoagulant_shouji" json:"anticoagulant_shouji" form:"anticoagulant_shouji"`
122
+	AnticoagulantWeichi        float64 `gorm:"column:anticoagulant_weichi" json:"anticoagulant_weichi" form:"anticoagulant_weichi"`
123
+	AnticoagulantZongliang     float64 `gorm:"column:anticoagulant_zongliang" json:"anticoagulant_zongliang" form:"anticoagulant_zongliang"`
124
+	ModeId                     int64   `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
125
+	TargetUltrafiltration      float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration" form:"target_ultrafiltration"`
126
+	BloodFlowVolume            float64 `gorm:"column:blood_flow_volume" json:"blood_flow_volume" form:"blood_flow_volume"`
127
+	DialyzerPerfusionApparatus string  `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus" form:"dialyzer_perfusion_apparatus"`
128
+}
129
+
130
+func (DialysisPrescriptionParameter) TableName() string {
131
+
132
+	return "xt_dialysis_prescription"
133
+}
134
+
135
+type PredialysisEvaluationParameter struct {
136
+	ID                          int64   `gorm:"column:id" json:"id"`
137
+	UserOrgId                   int64   `gorm:"column:user_org_id" json:"user_org_id"`
138
+	PatientId                   int64   `gorm:"column:patient_id" json:"patient_id"`
139
+	DryWeight                   float64 `gorm:"column:dry_weight" json:"dry_weight"`
140
+	WeightAfterLastTransparency float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency"`
141
+	WeighingBefore              float64 `gorm:"column:weighing_before" json:"weighing_before"`
142
+	AdditionalWeight            float64 `gorm:"column:additional_weight" json:"additional_weight"`
143
+	WeightBefore                float64 `gorm:"column:weight_before" json:"weight_before"`
144
+	SymptomBeforeDialysis       string  `gorm:"column:symptom_before_dialysis" json:"symptom_before_dialysis"`
145
+	SystolicBloodPressure       float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure"`
146
+}
147
+
148
+func (PredialysisEvaluationParameter) TableName() string {
149
+	return "xt_assessment_before_dislysis"
150
+}

+ 1 - 0
models/patient_models.go Datei anzeigen

@@ -348,6 +348,7 @@ type PatientDialysisRecord struct {
348 348
 	AssessmentAfterDislysis AssessmentAfterDislysis `json:"assessment_after_dislysis" gorm:"foreignkey:AssessmentDate;AssociationForeignKey:DialysisDate;"`
349 349
 	TreatmentSummary        TreatmentSummary        `json:"treatment_summary" gorm:"foreignkey:AssessmentDate;AssociationForeignKey:DialysisDate;"`
350 350
 	Device                  DeviceNumber            `json:"device" gorm:"foreignkey:ID;AssociationForeignKey:BedID;"`
351
+	MonitoringRecord        []MonitoringRecord      `json:"monitoring_record" gorm:"foreignkey:MonitoringDate;AssociationForeignKey:DialysisDate;"`
351 352
 }
352 353
 
353 354
 type DialysisPrescriptionAddtional struct {

+ 53 - 0
service/common_service.go Datei anzeigen

@@ -3336,3 +3336,56 @@ func GetModeIdCount(startime int64, endtime int64, orgid int64, page int64, limi
3336 3336
 	err = db.Group(" s.patient_id,s.mode_id").Select("s.mode_id,	s.patient_id,	count(o.id) as count").Joins("left join xt_schedule as s on s.patient_id = o.patient_id").Where("s.schedule_date = o.dialysis_date and s.status =1 ").Scan(&order).Error
3337 3337
 	return order, err
3338 3338
 }
3339
+
3340
+func GetTreatModeList(startime int64, endtime int64, orgid int64) (order []*models.BloodDialysisModeIdCount, err error) {
3341
+
3342
+	table := XTReadDB().Table("xt_schedule as s")
3343
+	fmt.Println("table", table)
3344
+	db := XTReadDB().Table("xt_dialysis_order as o")
3345
+	if orgid > 0 {
3346
+		db = db.Where("o.user_org_id = ?", orgid)
3347
+	}
3348
+	if startime > 0 {
3349
+		db = db.Where("o.dialysis_date>=?", startime)
3350
+	}
3351
+	if endtime > 0 {
3352
+		db = db.Where("o.dialysis_date<=?", endtime)
3353
+	}
3354
+	err = db.Group("s.mode_id").Select("s.mode_id,	s.patient_id").Joins("left join xt_schedule as s on s.patient_id = o.patient_id").Where("s.schedule_date = o.dialysis_date and s.status =1 ").Scan(&order).Error
3355
+	return order, err
3356
+
3357
+}
3358
+
3359
+func GetCountModeId(startime int64, endtime int64, modeid int64, orgid int64) (order []*models.BloodTreateModeIdCount, err error) {
3360
+
3361
+	table := XTReadDB().Table("xt_schedule as s")
3362
+	fmt.Println("table", table)
3363
+	db := XTReadDB().Table("xt_dialysis_order as o")
3364
+	if orgid > 0 {
3365
+		db = db.Where("o.user_org_id = ?", orgid)
3366
+	}
3367
+	if startime > 0 {
3368
+		db = db.Where("o.dialysis_date>=?", startime)
3369
+	}
3370
+	if endtime > 0 {
3371
+		db = db.Where("o.dialysis_date<=?", endtime)
3372
+	}
3373
+	err = db.Group("o.dialysis_date,s.mode_id").Select("s.mode_id,	count(s.mode_id) as count,o.dialysis_date").Joins("left join xt_schedule as s on s.patient_id = o.patient_id").Where("s.schedule_date = o.dialysis_date and s.status =1 and s.mode_id = ? and o.dialysis_date <> ''", modeid).Scan(&order).Error
3374
+	return order, err
3375
+
3376
+}
3377
+
3378
+func GetCountRollout(orgid int64, startime int64, endtime int64) (lapseto []*models.BloodLapsetoCount, err error) {
3379
+
3380
+	table := XTReadDB().Table("xt_patients as s")
3381
+	fmt.Println(table)
3382
+	db := XTReadDB().Table("xt_patient_lapseto as x").Where("x.status = 1")
3383
+	if startime > 0 {
3384
+		db = db.Where("x.lapseto_time >=?", startime)
3385
+	}
3386
+	if endtime > 0 {
3387
+		db = db.Where("x.lapseto_time<=?", endtime)
3388
+	}
3389
+	err = db.Group("x.lapseto_time,x.lapseto_type").Select("count(x.id) as count,x.lapseto_type,x.lapseto_time").Joins("left join xt_patients as s  on s.id = x.patient_id").Where("s.user_org_id = ?", orgid).Scan(&lapseto).Error
3390
+	return lapseto, err
3391
+}

+ 4 - 4
service/dialysis_parameter_service.go Datei anzeigen

@@ -325,15 +325,15 @@ func GetLastAssessmentBeforDialysis(patientid int64, orgid int64) (models.Predia
325 325
 	return evaluation, err
326 326
 }
327 327
 
328
-func GetDialysisPrescriptionList(patientid int64, orgid int64, startime int64) (models.XtDialysisPrescription, error) {
329
-	prescription := models.XtDialysisPrescription{}
328
+func GetDialysisPrescriptionList(patientid int64, orgid int64, startime int64) (models.DialysisPrescriptionParameter, error) {
329
+	prescription := models.DialysisPrescriptionParameter{}
330 330
 	err := XTReadDB().Model(&prescription).Where("patient_id = ? and user_org_id = ? and status = 1 and record_date = ?", patientid, orgid, startime).Find(&prescription).Error
331 331
 	return prescription, err
332 332
 }
333 333
 
334
-func GetTodayAssessmentBeforDialysis(patientid int64, orgid int64, startime int64) (*models.PredialysisEvaluation, error) {
334
+func GetTodayAssessmentBeforDialysis(patientid int64, orgid int64, startime int64) (*models.PredialysisEvaluationParameter, error) {
335 335
 
336
-	evaluation := models.PredialysisEvaluation{}
336
+	evaluation := models.PredialysisEvaluationParameter{}
337 337
 	err := XTReadDB().Model(&evaluation).Where("patient_id = ? and user_org_id = ? and assessment_date = ? and status = 1", patientid, orgid, startime).Find(&evaluation).Error
338 338
 	if err == gorm.ErrRecordNotFound {
339 339
 		return nil, err

+ 1 - 0
service/patientmanage_service.go Datei anzeigen

@@ -841,6 +841,7 @@ func GetDialysisrecord(patientID int64, start int64, end int64, limit int64, pag
841 841
 	var orders []*models.PatientDialysisRecord
842 842
 
843 843
 	db := readDb.Table("xt_dialysis_order as do").
844
+		Preload("MonitoringRecord", "patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).
844 845
 		Preload("DialysisPrescription", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
845 846
 		Preload("PredialysisEvaluation", "patient_id=? and user_org_id=? and status=1", patientID, orgID).
846 847
 		Preload("DialysisPrescription", func(db *gorm.DB) *gorm.DB {