XMLWAN преди 4 години
родител
ревизия
515c610c46

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

3030
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
3030
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
3031
 		return
3031
 		return
3032
 	}
3032
 	}
3033
-
3033
+	fmt.Println("丰管业配置", data.SealingFluidDispose)
3034
 	assessment, _ := service.FindAssessmentAfterDislysisById(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
3034
 	assessment, _ := service.FindAssessmentAfterDislysisById(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
3035
 	assessment.DialysisOrderId = data.DialysisOrderId
3035
 	assessment.DialysisOrderId = data.DialysisOrderId
3036
 	assessment.Evaluator = adminUserInfo.AdminUser.Id
3036
 	assessment.Evaluator = adminUserInfo.AdminUser.Id
3171
 	dialysis_interphase := c.GetString("dialysis_interphase")
3171
 	dialysis_interphase := c.GetString("dialysis_interphase")
3172
 	symptom_before_dialysis := c.GetString("symptom_before_dialysis")
3172
 	symptom_before_dialysis := c.GetString("symptom_before_dialysis")
3173
 	bloodAccessPartOperaId, _ := c.GetInt64("blood_access_part_opera_id", 0)
3173
 	bloodAccessPartOperaId, _ := c.GetInt64("blood_access_part_opera_id", 0)
3174
-	bloodAccessPartId, _ := c.GetInt64("blood_access_part_id", 0)
3174
+	//bloodAccessPartId, _ := c.GetInt64("blood_access_part_id", 0)
3175
+	bloodAccessPartId := c.GetString("blood_access_part_id")
3175
 	internalFistula := c.GetString("internal_fistula")
3176
 	internalFistula := c.GetString("internal_fistula")
3176
 	internal_fistula_skin := c.GetString("internal_fistula_skin")
3177
 	internal_fistula_skin := c.GetString("internal_fistula_skin")
3177
 	catheter := c.GetString("catheter")
3178
 	catheter := c.GetString("catheter")

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

802
 	dialysis_during, _ := c.GetInt64("dialysis_during", 0)
802
 	dialysis_during, _ := c.GetInt64("dialysis_during", 0)
803
 	stroke_volume, _ := c.GetInt64("stroke_volume", 0)
803
 	stroke_volume, _ := c.GetInt64("stroke_volume", 0)
804
 	blood_flow, _ := c.GetInt64("blood_flow", 0)
804
 	blood_flow, _ := c.GetInt64("blood_flow", 0)
805
-	sealing_fluid_dispose, _ := c.GetInt64("sealing_fluid_dispose", 0)
805
+	//sealing_fluid_dispose, _ := c.GetInt64("sealing_fluid_dispose", 0)
806
+	sealing_fluid_dispose := c.GetString("sealing_fluid_dispose")
806
 	sealing_fluid_special := c.GetString("sealing_fluid_special")
807
 	sealing_fluid_special := c.GetString("sealing_fluid_special")
807
 	dosage_of_anticoagulants, _ := c.GetFloat("dosage_of_anticoagulants")
808
 	dosage_of_anticoagulants, _ := c.GetFloat("dosage_of_anticoagulants")
808
 	supine_systolic_blood_pressure := c.GetString("supine_systolic_blood_pressure")
809
 	supine_systolic_blood_pressure := c.GetString("supine_systolic_blood_pressure")

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

1524
 		evaluation.MachineType = machine_type
1524
 		evaluation.MachineType = machine_type
1525
 	}
1525
 	}
1526
 
1526
 
1527
-	if dataBody["blood_access_part_id"] != nil && reflect.TypeOf(dataBody["blood_access_part_id"]).String() == "float64" {
1528
-		blood_access_part_id := int64(dataBody["blood_access_part_id"].(float64))
1527
+	if dataBody["blood_access_part_id"] != nil && reflect.TypeOf(dataBody["blood_access_part_id"]).String() == "string" {
1528
+		blood_access_part_id := dataBody["blood_access_part_id"].(string)
1529
 		evaluation.BloodAccessPartId = blood_access_part_id
1529
 		evaluation.BloodAccessPartId = blood_access_part_id
1530
 	}
1530
 	}
1531
+	//if dataBody["blood_access_part_id"] != nil && reflect.TypeOf(dataBody["blood_access_part_id"]).String() == "float64" {
1532
+	//	blood_access_part_id := int64(dataBody["blood_access_part_id"].(float64))
1533
+	//	evaluation.BloodAccessPartId = blood_access_part_id
1534
+	//}
1531
 	if dataBody["blood_access_part_opera_id"] != nil && reflect.TypeOf(dataBody["blood_access_part_opera_id"]).String() == "float64" {
1535
 	if dataBody["blood_access_part_opera_id"] != nil && reflect.TypeOf(dataBody["blood_access_part_opera_id"]).String() == "float64" {
1532
 		blood_access_part_opera_id := int64(dataBody["blood_access_part_opera_id"].(float64))
1536
 		blood_access_part_opera_id := int64(dataBody["blood_access_part_opera_id"].(float64))
1533
 		evaluation.BloodAccessPartOperaId = blood_access_part_opera_id
1537
 		evaluation.BloodAccessPartOperaId = blood_access_part_opera_id

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

172
 	userTitle := this.GetString("title")
172
 	userTitle := this.GetString("title")
173
 	user_type, _ := this.GetInt("user_type", 0)
173
 	user_type, _ := this.GetInt("user_type", 0)
174
 	user_title, _ := this.GetInt("user_title", 0)
174
 	user_title, _ := this.GetInt("user_title", 0)
175
-
175
+	sort, _ := this.GetInt64("sort")
176
 	if len(mobile) == 0 || len(name) == 0 || len(role_ids) <= 0 {
176
 	if len(mobile) == 0 || len(name) == 0 || len(role_ids) <= 0 {
177
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
177
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
178
 		return
178
 		return
185
 		return
185
 		return
186
 	} else {
186
 	} else {
187
 		if adminUser == nil { //新增账号和用户
187
 		if adminUser == nil { //新增账号和用户
188
-			_, password, createErr := service.CreateGeneralAdminUser(adminUserInfo.Org.Id, adminUserInfo.App.Id, mobile, name, userTitle, role_ids, user_type, user_title)
188
+			_, password, createErr := service.CreateGeneralAdminUser(adminUserInfo.Org.Id, adminUserInfo.App.Id, mobile, name, userTitle, role_ids, user_type, user_title, sort)
189
 			if createErr != nil {
189
 			if createErr != nil {
190
 				//beego.Error("创建管理员失败:", createErr)
190
 				//beego.Error("创建管理员失败:", createErr)
191
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)
191
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)

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

237
 	CreatedTime                 int64   `gorm:"column:created_time" json:"created_time"`
237
 	CreatedTime                 int64   `gorm:"column:created_time" json:"created_time"`
238
 	UpdatedTime                 int64   `gorm:"column:updated_time" json:"updated_time"`
238
 	UpdatedTime                 int64   `gorm:"column:updated_time" json:"updated_time"`
239
 	Modifier                    int64   `gorm:"column:modifier" json:"modifier"`
239
 	Modifier                    int64   `gorm:"column:modifier" json:"modifier"`
240
-	BloodAccessPartId           int64   `gorm:"column:blood_access_part_id" json:"blood_access_part_id"`
240
+	BloodAccessPartId           string  `gorm:"column:blood_access_part_id" json:"blood_access_part_id"`
241
 	BloodAccessPartOperaId      int64   `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id"`
241
 	BloodAccessPartOperaId      int64   `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id"`
242
 	IsHemorrhage                int64   `gorm:"column:is_hemorrhage" json:"is_hemorrhage"`
242
 	IsHemorrhage                int64   `gorm:"column:is_hemorrhage" json:"is_hemorrhage"`
243
 	Hemorrhage                  string  `gorm:"column:hemorrhage" json:"hemorrhage"`
243
 	Hemorrhage                  string  `gorm:"column:hemorrhage" json:"hemorrhage"`
560
 	StrokeVolume                    int64   `gorm:"column:stroke_volume" json:"stroke_volume" form:"stroke_volume"`
560
 	StrokeVolume                    int64   `gorm:"column:stroke_volume" json:"stroke_volume" form:"stroke_volume"`
561
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
561
 	Channel                         int64   `gorm:"column:channel" json:"channel" form:"channel"`
562
 	BloodFlow                       int64   `gorm:"column:blood_flow" json:"blood_flow" form:"blood_flow"`
562
 	BloodFlow                       int64   `gorm:"column:blood_flow" json:"blood_flow" form:"blood_flow"`
563
-	SealingFluidDispose             int64   `gorm:"column:sealing_fluid_dispose" json:"sealing_fluid_dispose" form:"sealing_fluid_dispose"`
563
+	SealingFluidDispose             string  `gorm:"column:sealing_fluid_dispose" json:"sealing_fluid_dispose" form:"sealing_fluid_dispose"`
564
 	SealingFluidSpecial             string  `gorm:"column:sealing_fluid_special" json:"sealing_fluid_special" form:"sealing_fluid_special"`
564
 	SealingFluidSpecial             string  `gorm:"column:sealing_fluid_special" json:"sealing_fluid_special" form:"sealing_fluid_special"`
565
 	DosageOfAnticoagulants          float64 `gorm:"column:dosage_of_anticoagulants" json:"dosage_of_anticoagulants" form:"dosage_of_anticoagulants"`
565
 	DosageOfAnticoagulants          float64 `gorm:"column:dosage_of_anticoagulants" json:"dosage_of_anticoagulants" form:"dosage_of_anticoagulants"`
566
 	SupineSystolicBloodPressure     string  `gorm:"column:supine_systolic_blood_pressure" json:"supine_systolic_blood_pressure" form:"supine_systolic_blood_pressure"`
566
 	SupineSystolicBloodPressure     string  `gorm:"column:supine_systolic_blood_pressure" json:"supine_systolic_blood_pressure" form:"supine_systolic_blood_pressure"`

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

59
 	Message         string `gorm:"column:message" json:"message" form:"message"`
59
 	Message         string `gorm:"column:message" json:"message" form:"message"`
60
 	Sex             int64  `gorm:"column:sex" json:"sex" form:"sex"`
60
 	Sex             int64  `gorm:"column:sex" json:"sex" form:"sex"`
61
 	Birthday        int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
61
 	Birthday        int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
62
+	Sort            int64  `gorm:"column:sort" json:"sort" form:"sort"`
62
 }
63
 }
63
 
64
 
64
 func (App_Role) TableName() string {
65
 func (App_Role) TableName() string {

+ 2 - 2
service/print_data_service/schedule_dialysis/print_schedule_dialysis_models.go Целия файл

229
 	Creater                        int64   `gorm:"column:creater" json:"creater"`
229
 	Creater                        int64   `gorm:"column:creater" json:"creater"`
230
 	Remark                         string  `gorm:"column:remark" json:"remark"`
230
 	Remark                         string  `gorm:"column:remark" json:"remark"`
231
 	Modifier                       int64   `gorm:"column:modifier" json:"modifier"`
231
 	Modifier                       int64   `gorm:"column:modifier" json:"modifier"`
232
-	BloodAccessPartId              int64   `gorm:"column:blood_access_part_id" json:"blood_access_part_id"`
232
+	BloodAccessPartId              string  `gorm:"column:blood_access_part_id" json:"blood_access_part_id"`
233
 	BloodAccessPartOperaId         int64   `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id"`
233
 	BloodAccessPartOperaId         int64   `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id"`
234
 	IsHemorrhage                   int64   `gorm:"column:is_hemorrhage" json:"is_hemorrhage"`
234
 	IsHemorrhage                   int64   `gorm:"column:is_hemorrhage" json:"is_hemorrhage"`
235
 	Hemorrhage                     string  `gorm:"column:hemorrhage" json:"hemorrhage"`
235
 	Hemorrhage                     string  `gorm:"column:hemorrhage" json:"hemorrhage"`
334
 	DialysisDuring                  int64   `gorm:"column:dialysis_during" json:"dialysis_during" form:"dialysis_during"`
334
 	DialysisDuring                  int64   `gorm:"column:dialysis_during" json:"dialysis_during" form:"dialysis_during"`
335
 	StrokeVolume                    int64   `gorm:"column:stroke_volume" json:"stroke_volume" form:"stroke_volume"`
335
 	StrokeVolume                    int64   `gorm:"column:stroke_volume" json:"stroke_volume" form:"stroke_volume"`
336
 	BloodFlow                       int64   `gorm:"column:blood_flow" json:"blood_flow" form:"blood_flow"`
336
 	BloodFlow                       int64   `gorm:"column:blood_flow" json:"blood_flow" form:"blood_flow"`
337
-	SealingFluidDispose             int64   `gorm:"column:sealing_fluid_dispose" json:"sealing_fluid_dispose" form:"sealing_fluid_dispose"`
337
+	SealingFluidDispose             string  `gorm:"column:sealing_fluid_dispose" json:"sealing_fluid_dispose" form:"sealing_fluid_dispose"`
338
 	SealingFluidSpecial             string  `gorm:"column:sealing_fluid_special" json:"sealing_fluid_special" form:"sealing_fluid_special"`
338
 	SealingFluidSpecial             string  `gorm:"column:sealing_fluid_special" json:"sealing_fluid_special" form:"sealing_fluid_special"`
339
 }
339
 }
340
 
340
 

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

130
 	TitleName       string `gorm:"-" json:"title_name"`
130
 	TitleName       string `gorm:"-" json:"title_name"`
131
 	IsSubSuperAdmin bool   `gorm:"-" json:"is_sub_super_admin"`
131
 	IsSubSuperAdmin bool   `gorm:"-" json:"is_sub_super_admin"`
132
 	//mobile          string `gorm:"-" json:"mobile"`
132
 	//mobile          string `gorm:"-" json:"mobile"`
133
+	Sort int `gorm:"sort" json:"sort"`
133
 }
134
 }
134
 
135
 
135
 func GetAdminUsersAndLoginInfo(orgID int64, appID int64, page int, count int) ([]*AdminUserManageViewModel, int, error) {
136
 func GetAdminUsersAndLoginInfo(orgID int64, appID int64, page int, count int) ([]*AdminUserManageViewModel, int, error) {
140
 		page = 1
141
 		page = 1
141
 	}
142
 	}
142
 	var viewModels []*AdminUserManageViewModel = make([]*AdminUserManageViewModel, 0)
143
 	var viewModels []*AdminUserManageViewModel = make([]*AdminUserManageViewModel, 0)
143
-	rows, err := readUserDb.Raw("SELECT u_a_r.admin_user_id, u_a_r.user_name, u_a_r.user_title, u_l.ip, u_l.ctime, u_a_r.status,u_a_r.avatar,u_a_r.role_ids FROM sgj_user_admin_role AS u_a_r  LEFT JOIN (SELECT * FROM (SELECT admin_user_id, org_id, app_id, ip, ctime FROM sgj_user_admin_login_log WHERE org_id = ? AND app_id = ?  ORDER BY ctime DESC) AS t GROUP BY admin_user_id) AS u_l ON u_a_r.org_id = u_l.org_id AND u_a_r.app_id = u_l.app_id AND u_a_r.admin_user_id = u_l.admin_user_id WHERE u_a_r.org_id = ? AND u_a_r.app_id = ? GROUP BY u_a_r.admin_user_id LIMIT ? OFFSET ?;", orgID, appID, orgID, appID, count, (page-1)*count).Rows()
144
+	rows, err := readUserDb.Raw("SELECT u_a_r.admin_user_id, u_a_r.user_name, u_a_r.user_title, u_l.ip, u_l.ctime, u_a_r.status,u_a_r.avatar,u_a_r.role_ids,u_a_r.sort FROM sgj_user_admin_role AS u_a_r   LEFT JOIN (SELECT * FROM (SELECT admin_user_id, org_id, app_id, ip, ctime FROM sgj_user_admin_login_log WHERE org_id = ? AND app_id = ?  ORDER BY ctime DESC) AS t GROUP BY admin_user_id) AS u_l  ON u_a_r.org_id = u_l.org_id AND u_a_r.app_id = u_l.app_id AND u_a_r.admin_user_id = u_l.admin_user_id WHERE u_a_r.org_id = ? AND u_a_r.app_id = ? GROUP BY u_a_r.admin_user_id order by u_a_r.sort LIMIT ? OFFSET ?;", orgID, appID, orgID, appID, count, (page-1)*count).Rows()
144
 	defer rows.Close()
145
 	defer rows.Close()
145
 	if err != nil {
146
 	if err != nil {
146
 		if err == gorm.ErrRecordNotFound {
147
 		if err == gorm.ErrRecordNotFound {
308
 	return user.IsSuperAdmin, nil
309
 	return user.IsSuperAdmin, nil
309
 }
310
 }
310
 
311
 
311
-func CreateGeneralAdminUser(orgID int64, appID int64, mobile string, name string, userTitle string, roleIds string, user_type int, user_title int) (*models.AdminUser, string, error) {
312
+func CreateGeneralAdminUser(orgID int64, appID int64, mobile string, name string, userTitle string, roleIds string, user_type int, user_title int, sort int64) (*models.AdminUser, string, error) {
312
 	now := time.Now().Unix()
313
 	now := time.Now().Unix()
313
 	tx := writeUserDb.Begin()
314
 	tx := writeUserDb.Begin()
314
 	var adminUser models.AdminUser
315
 	var adminUser models.AdminUser
344
 		CreateTime:    now,
345
 		CreateTime:    now,
345
 		ModifyTime:    now,
346
 		ModifyTime:    now,
346
 		RoleIds:       roleIds,
347
 		RoleIds:       roleIds,
348
+		Sort:          sort,
347
 	}
349
 	}
348
 	if createApp_RoleErr := tx.Create(&app_role).Error; createApp_RoleErr != nil {
350
 	if createApp_RoleErr := tx.Create(&app_role).Error; createApp_RoleErr != nil {
349
 		tx.Rollback()
351
 		tx.Rollback()

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

35
 	DryWeight                 float64                   `gorm:"column:dry_weight" json:"dry_weight"`
35
 	DryWeight                 float64                   `gorm:"column:dry_weight" json:"dry_weight"`
36
 	WeighingBefore            float64                   `gorm:"column:weighing_before" json:"weighing_before"`
36
 	WeighingBefore            float64                   `gorm:"column:weighing_before" json:"weighing_before"`
37
 	WeightBefore              float64                   `gorm:"column:weight_before" json:"weight_before"`
37
 	WeightBefore              float64                   `gorm:"column:weight_before" json:"weight_before"`
38
-	BloodAccessPartId         int64                     `gorm:"column:blood_access_part_id" json:"blood_access_part_id"`
38
+	BloodAccessPartId         string                    `gorm:"column:blood_access_part_id" json:"blood_access_part_id"`
39
 	VMAssessmentAfterDislysis VMAssessmentAfterDislysis `gorm:"ForeignKey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,AssessmentDate" json:"after"`
39
 	VMAssessmentAfterDislysis VMAssessmentAfterDislysis `gorm:"ForeignKey:PatientId,AssessmentDate;AssociationForeignKey:PatientId,AssessmentDate" json:"after"`
40
 	VMPatients                VMPatients                `gorm:"ForeignKey:ID;AssociationForeignKey:PatientId" json:"patient"`
40
 	VMPatients                VMPatients                `gorm:"ForeignKey:ID;AssociationForeignKey:PatientId" json:"patient"`
41
 	LastAfterWeight           float64                   `gorm:"-" json:"last_after_weight"`
41
 	LastAfterWeight           float64                   `gorm:"-" json:"last_after_weight"`