Selaa lähdekoodia

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

csx 4 vuotta sitten
vanhempi
commit
f9dee76609

+ 78 - 3
controllers/doctor_schedule_api_controller.go Näytä tiedosto

31
 	beego.Router("api/schedule/deletestaffschedule", &DoctorScheduleApiController{}, "Get:DeleteStaffSchedule")
31
 	beego.Router("api/schedule/deletestaffschedule", &DoctorScheduleApiController{}, "Get:DeleteStaffSchedule")
32
 	beego.Router("/api/schedule/copystaffschedule", &DoctorScheduleApiController{}, "Get:CopyStaffSchedule")
32
 	beego.Router("/api/schedule/copystaffschedule", &DoctorScheduleApiController{}, "Get:CopyStaffSchedule")
33
 	beego.Router("/api/scheudle/updatecontinusschedule", &DoctorScheduleApiController{}, "Get:UpdateContinusSchedule")
33
 	beego.Router("/api/scheudle/updatecontinusschedule", &DoctorScheduleApiController{}, "Get:UpdateContinusSchedule")
34
+	beego.Router("/api/schedule/savenursesort", &DoctorScheduleApiController{}, "Get:SaveNureSort")
35
+	beego.Router("/api/schedule/saveisschedule", &DoctorScheduleApiController{}, "Get:SaveIsSchedule")
36
+	beego.Router("/api/schedule/getscheudlelisttotal", &DoctorScheduleApiController{}, "Get:GetScheduleListTotal")
34
 }
37
 }
35
 
38
 
36
 func (this *DoctorScheduleApiController) SaveDoctorSchedules() {
39
 func (this *DoctorScheduleApiController) SaveDoctorSchedules() {
46
 	timetwo_end := this.GetString("timetwo_end")
49
 	timetwo_end := this.GetString("timetwo_end")
47
 	work_time := this.GetString("work_time")
50
 	work_time := this.GetString("work_time")
48
 	remarks := this.GetString("remarks")
51
 	remarks := this.GetString("remarks")
49
-
52
+	minute, _ := this.GetInt64("minute")
50
 	schedules := models.DoctorSchedules{
53
 	schedules := models.DoctorSchedules{
51
 		ClassName:       class_name,
54
 		ClassName:       class_name,
52
 		ClassAttributes: class_attributes,
55
 		ClassAttributes: class_attributes,
61
 		UserOrgId:       orgId,
64
 		UserOrgId:       orgId,
62
 		Status:          1,
65
 		Status:          1,
63
 		Ctime:           time.Now().Unix(),
66
 		Ctime:           time.Now().Unix(),
67
+		Minute:          minute,
64
 	}
68
 	}
65
 
69
 
66
 	//查询班种名称是否存在
70
 	//查询班种名称是否存在
153
 	work_time := this.GetString("work_time")
157
 	work_time := this.GetString("work_time")
154
 	remarks := this.GetString("remarks")
158
 	remarks := this.GetString("remarks")
155
 	user_org_id, _ := this.GetInt64("user_org_id")
159
 	user_org_id, _ := this.GetInt64("user_org_id")
156
-
160
+	minute, _ := this.GetInt64("minute")
157
 	schedules := models.DoctorSchedules{
161
 	schedules := models.DoctorSchedules{
158
 		ClassName:       class_name,
162
 		ClassName:       class_name,
159
 		ClassAttributes: class_attributes,
163
 		ClassAttributes: class_attributes,
165
 		TimetwoType:     timetwo_type,
169
 		TimetwoType:     timetwo_type,
166
 		WorkTime:        work_time,
170
 		WorkTime:        work_time,
167
 		Remarks:         remarks,
171
 		Remarks:         remarks,
172
+		Minute:          minute,
168
 	}
173
 	}
169
 
174
 
170
 	if user_org_id == 0 {
175
 	if user_org_id == 0 {
222
 	appId := this.GetAdminUserInfo().CurrentAppId
227
 	appId := this.GetAdminUserInfo().CurrentAppId
223
 	//admin_user_id := this.GetAdminUserInfo().AdminUser.Id
228
 	//admin_user_id := this.GetAdminUserInfo().AdminUser.Id
224
 	list, err := service.GetDoctorList(orgId, appId)
229
 	list, err := service.GetDoctorList(orgId, appId)
230
+
231
+	//获取所有的医生
232
+	doctorList, err := service.GetAllDoctorList(orgId, appId)
233
+
234
+	//获取所有的护士
235
+	nurseList, err := service.GetAllNurseList(orgId, appId)
225
 	if err != nil {
236
 	if err != nil {
226
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
237
 		this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
227
 		return
238
 		return
228
 	}
239
 	}
229
 
240
 
230
 	this.ServeSuccessJSON(map[string]interface{}{
241
 	this.ServeSuccessJSON(map[string]interface{}{
231
-		"list": list,
242
+		"list":       list,
243
+		"doctorlist": doctorList,
244
+		"nurselist":  nurseList,
232
 	})
245
 	})
233
 }
246
 }
234
 
247
 
491
 		"schedule": schedule,
504
 		"schedule": schedule,
492
 	})
505
 	})
493
 }
506
 }
507
+
508
+func (this *DoctorScheduleApiController) SaveNureSort() {
509
+
510
+	id, _ := this.GetInt64("id")
511
+	fmt.Println("id", id)
512
+	sort, _ := this.GetInt64("sort")
513
+	fmt.Println("sort", sort)
514
+	role := models.App_Role{
515
+		Sort: sort,
516
+	}
517
+	err := service.SaveNurseSort(&role, id)
518
+	if err != nil {
519
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
520
+		return
521
+	}
522
+
523
+	this.ServeSuccessJSON(map[string]interface{}{
524
+		"role": role,
525
+	})
526
+}
527
+
528
+func (this *DoctorScheduleApiController) SaveIsSchedule() {
529
+
530
+	id, _ := this.GetInt64("id")
531
+	fmt.Println("id", id)
532
+	is_sort, _ := this.GetInt64("is_sort")
533
+	fmt.Println("is_sort", is_sort)
534
+	role := models.App_Role{
535
+		IsSort: is_sort,
536
+	}
537
+	err := service.SaveIsSchedule(id, &role)
538
+	if err != nil {
539
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
540
+		return
541
+	}
542
+
543
+	this.ServeSuccessJSON(map[string]interface{}{
544
+		"role": role,
545
+	})
546
+}
547
+
548
+func (this *DoctorScheduleApiController) GetScheduleListTotal() {
549
+
550
+	start_time, _ := this.GetInt64("start_time")
551
+	fmt.Println(start_time)
552
+	end_time, _ := this.GetInt64("end_time")
553
+	fmt.Println("end_time", end_time)
554
+	adminUserInfo := this.GetAdminUserInfo()
555
+	orgId := adminUserInfo.CurrentOrgId
556
+	//统计总工时
557
+	scheudletotal, err := service.GetScheduleListTotal(orgId, start_time, end_time)
558
+	list, err := service.GetTotalMinutes(orgId, start_time, end_time)
559
+	if err != nil {
560
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "添加设备失败")
561
+		return
562
+	}
563
+
564
+	this.ServeSuccessJSON(map[string]interface{}{
565
+		"scheudletotal": scheudletotal,
566
+		"list":          list,
567
+	})
568
+}

+ 21 - 0
models/doctor_schedule_models.go Näytä tiedosto

16
 	Status          int64  `gorm:"column:status" json:"status" form:"status"`
16
 	Status          int64  `gorm:"column:status" json:"status" form:"status"`
17
 	Ctime           int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
17
 	Ctime           int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
18
 	Mtime           int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
18
 	Mtime           int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
19
+	Minute          int64  `gorm:"column:minute" json:"minute" form:"minute"`
19
 }
20
 }
20
 
21
 
21
 func (DoctorSchedules) TableName() string {
22
 func (DoctorSchedules) TableName() string {
59
 	AdminUserId     int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
60
 	AdminUserId     int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
60
 	UserType        int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
61
 	UserType        int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
61
 	ClassAttributes int64  `gorm:"column:class_attributes" json:"class_attributes" form:"class_attributes"`
62
 	ClassAttributes int64  `gorm:"column:class_attributes" json:"class_attributes" form:"class_attributes"`
63
+	Sort            int64  `gorm:"column:sort" json:"sort" form:"sort"`
64
+	IsSort          int64  `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
65
+	WorkTime        string `gorm:"column:work_time" json:"work_time" form:"work_time"`
66
+	Minute          int64  `gorm:"column:minute" json:"minute" form:"minute"`
62
 }
67
 }
63
 
68
 
64
 type XTSgjUserAdminRole struct {
69
 type XTSgjUserAdminRole struct {
66
 	AdminUserId int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
71
 	AdminUserId int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
67
 	UserName    string `gorm:"column:user_name" json:"user_name" form:"user_name"`
72
 	UserName    string `gorm:"column:user_name" json:"user_name" form:"user_name"`
68
 	UserType    int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
73
 	UserType    int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
74
+	UserTitle   int64  `gorm:"column:user_title" json:"user_title" form:"user_title"`
75
+	Sort        int64  `gorm:"column:sort" json:"sort" form:"sort"`
76
+	IsSort      int64  `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
69
 }
77
 }
70
 
78
 
71
 func (XTSgjUserAdminRole) TableName() string {
79
 func (XTSgjUserAdminRole) TableName() string {
84
 func (ContinueSchedule) TableName() string {
92
 func (ContinueSchedule) TableName() string {
85
 	return "xt_continue_schedule"
93
 	return "xt_continue_schedule"
86
 }
94
 }
95
+
96
+type CountStaffSchedule struct {
97
+	ID            int64  `gorm:"column:id" json:"id" form:"id"`
98
+	DoctorId      int64  `gorm:"column:doctor_id" json:"doctor_id" form:"doctor_id"`
99
+	StartTime     int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
100
+	EndTime       int64  `gorm:"column:end_time" json:"end_time" form:"end_time"`
101
+	ScheduleDate  int64  `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
102
+	UserName      string `gorm:"column:user_name" json:"user_name" form:"user_name"`
103
+	ClassName     string `gorm:"column:class_name" json:"class_name" form:"class_name"`
104
+	Sort          int64  `gorm:"column:sort" json:"sort" form:"sort"`
105
+	Count         int64
106
+	TotalMininute int64 `gorm:"column:totalminute" json:"totalminute" form:"totalminute"`
107
+}

+ 1 - 0
models/role_models.go Näytä tiedosto

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
 	Sort            int64  `gorm:"column:sort" json:"sort" form:"sort"`
63
+	IsSort          int64  `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
63
 }
64
 }
64
 
65
 
65
 func (App_Role) TableName() string {
66
 func (App_Role) TableName() string {

+ 1 - 1
service/data.go Näytä tiedosto

228
 
228
 
229
 func BatchInsertDoctorSchedule(orgid int64) (err error) {
229
 func BatchInsertDoctorSchedule(orgid int64) (err error) {
230
 
230
 
231
-	err = readDb.Exec("INSERT INTO sgj_xt.xt_doctor_schedules(user_org_id,class_name,class_attributes,timeone_start,timeone_type,timeone_end,timetwo_start,timetwo_type,timetwo_end,work_time,remarks,status,ctime) SELECT ?, class_name,class_attributes,timeone_start,timeone_type,timeone_end,timetwo_start,timetwo_type,timetwo_end,work_time,remarks,status,ctime FROM xt_doctor_schedules WHERE user_org_id = 0", orgid).Error
231
+	err = readDb.Exec("INSERT INTO sgj_xt.xt_doctor_schedules(user_org_id,class_name,class_attributes,timeone_start,timeone_type,timeone_end,timetwo_start,timetwo_type,timetwo_end,work_time,remarks,status,ctime,minute) SELECT ?, class_name,class_attributes,timeone_start,timeone_type,timeone_end,timetwo_start,timetwo_type,timetwo_end,work_time,remarks,status,ctime,minute FROM xt_doctor_schedules WHERE user_org_id = 0", orgid).Error
232
 	return
232
 	return
233
 }
233
 }
234
 
234
 

+ 61 - 5
service/doctor_schedule_service.go Näytä tiedosto

58
 
58
 
59
 func UpdateScheduleList(id int64, schedules *models.DoctorSchedules) error {
59
 func UpdateScheduleList(id int64, schedules *models.DoctorSchedules) error {
60
 
60
 
61
-	err := XTReadDB().Model(&schedules).Where("id=?", id).Updates(map[string]interface{}{"class_name": schedules.ClassName, "class_attributes": schedules.ClassAttributes, "timeone_start": schedules.TimeoneStart, "timeone_type": schedules.TimeoneType, "timeone_end": schedules.TimeoneEnd, "timetwo_start": schedules.TimetwoStart, "timetwo_type": schedules.TimetwoType, "timetwo_end": schedules.TimetwoEnd, "work_time": schedules.WorkTime, "remarks": schedules.Remarks, "mtime": time.Now().Unix()}).Error
61
+	err := XTReadDB().Model(&schedules).Where("id=?", id).Updates(map[string]interface{}{"class_name": schedules.ClassName, "class_attributes": schedules.ClassAttributes, "timeone_start": schedules.TimeoneStart, "timeone_type": schedules.TimeoneType, "timeone_end": schedules.TimeoneEnd, "timetwo_start": schedules.TimetwoStart, "timetwo_type": schedules.TimetwoType, "timetwo_end": schedules.TimetwoEnd, "work_time": schedules.WorkTime, "remarks": schedules.Remarks, "minute": schedules.Minute, "mtime": time.Now().Unix()}).Error
62
 	return err
62
 	return err
63
 }
63
 }
64
 
64
 
82
 
82
 
83
 func GetDoctorList(orgid int64, appid int64) (role []*models.XTSgjUserAdminRole, err error) {
83
 func GetDoctorList(orgid int64, appid int64) (role []*models.XTSgjUserAdminRole, err error) {
84
 
84
 
85
-	err = UserReadDB().Model(&role).Where("org_id = ? and app_id = ? and status = 1 ", orgid, appid).Order("user_type desc").Find(&role).Error
85
+	err = UserReadDB().Model(&role).Where("org_id = ? and app_id = ? and (user_type = 2 or user_type = 3) and status = 1 and is_sort = 1", orgid, appid).Order("user_type desc").Find(&role).Error
86
+	return role, err
87
+}
88
+
89
+func GetAllDoctorList(orgid int64, appid int64) (role []*models.XTSgjUserAdminRole, err error) {
90
+
91
+	err = UserReadDB().Model(&role).Where("org_id =? and app_id = ? and user_type = 2 and status = 1", orgid, appid).Order("sort desc").Find(&role).Error
92
+	return role, err
93
+}
94
+
95
+func GetAllNurseList(orgid int64, appid int64) (role []*models.XTSgjUserAdminRole, err error) {
96
+
97
+	err = UserReadDB().Model(&role).Where("org_id = ? and app_id = ? and user_type =3 and status =1", orgid, appid).Order("sort desc").Find(&role).Error
86
 	return role, err
98
 	return role, err
87
 }
99
 }
88
 
100
 
127
 	if orgid > 0 {
139
 	if orgid > 0 {
128
 		db = db.Where("x.user_org_id = ?", orgid)
140
 		db = db.Where("x.user_org_id = ?", orgid)
129
 	}
141
 	}
130
-	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.admin_user_id,r.user_type,s.class_attributes").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ? and s.status = 1", orgid, orgid).Scan(&schedule).Error
142
+	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.admin_user_id,r.user_type,s.class_attributes,r.sort,r.is_sort,s.work_time,s.minute").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ? and s.status = 1", orgid, orgid).Scan(&schedule).Error
131
 	return schedule, err
143
 	return schedule, err
132
 }
144
 }
133
 
145
 
167
 	if doctorid > 0 {
179
 	if doctorid > 0 {
168
 		db = db.Where("x.doctor_type = ?", doctorid)
180
 		db = db.Where("x.doctor_type = ?", doctorid)
169
 	}
181
 	}
170
-	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.admin_user_id,s.class_attributes").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ?", orgid, orgid).Scan(&schedule).Error
182
+	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.admin_user_id,s.class_attributes,r.sort,r.is_sort").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ?", orgid, orgid).Scan(&schedule).Error
171
 	return schedule, err
183
 	return schedule, err
172
 }
184
 }
173
 
185
 
186
 	//if(doctorid >0){
198
 	//if(doctorid >0){
187
 	//  db = db.Where("x.doctor_id = ?", doctorid)
199
 	//  db = db.Where("x.doctor_id = ?", doctorid)
188
 	//}
200
 	//}
189
-	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.schedule_date,x.end_time,r.user_type,r.user_name,s.class_name,r.admin_user_id,s.class_attributes").Joins("left join sgj_users.sgj_user_admin_role AS r ON r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type and s.user_org_id = ?", orgid).Where("r.org_id = ? and r.status = 1  and r.user_name like ?", orgid, likeKey).Scan(&schedule).Error
201
+	err = db.Group("x.id").Select("x.id,x.doctor_id,x.doctor_type,x.schedule_type,x.schedule_week,x.user_org_id,x.start_time,x.schedule_date,x.end_time,r.user_type,r.user_name,s.class_name,r.admin_user_id,s.class_attributes,r.sort,r.is_sort").Joins("left join sgj_users.sgj_user_admin_role AS r ON r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type and s.user_org_id = ?", orgid).Where("r.org_id = ? and r.status = 1  and r.user_name like ?", orgid, likeKey).Scan(&schedule).Error
190
 	return schedule, err
202
 	return schedule, err
191
 }
203
 }
192
 
204
 
224
 	err := XTWriteDB().Model(&schedule).Where("user_org_id = ? and status = 1", orgid).Updates(map[string]interface{}{"is_status": schedule.IsStatus, "mtime": time.Now().Unix()}).Error
236
 	err := XTWriteDB().Model(&schedule).Where("user_org_id = ? and status = 1", orgid).Updates(map[string]interface{}{"is_status": schedule.IsStatus, "mtime": time.Now().Unix()}).Error
225
 	return err
237
 	return err
226
 }
238
 }
239
+
240
+func SaveNurseSort(role *models.App_Role, id int64) error {
241
+
242
+	err := UserWriteDB().Model(&role).Where("id = ?", id).Updates(map[string]interface{}{"sort": role.Sort}).Error
243
+	return err
244
+}
245
+
246
+func SaveIsSchedule(id int64, role *models.App_Role) error {
247
+
248
+	err := UserWriteDB().Model(&role).Where("id=?", id).Updates(map[string]interface{}{"is_sort": role.IsSort}).Error
249
+	return err
250
+}
251
+
252
+func GetScheduleListTotal(orgid int64, startime int64, endtime int64) (schedule []*models.CountStaffSchedule, err error) {
253
+
254
+	db := XTReadDB().Table("xt_staff_schedule as x").Where("x.status = 1")
255
+	if startime > 0 {
256
+		db = db.Where("x.start_time >=?", startime)
257
+	}
258
+	if endtime > 0 {
259
+		db = db.Where("x.end_time <=?", endtime)
260
+	}
261
+	if orgid > 0 {
262
+		db = db.Where("x.user_org_id = ?", orgid)
263
+	}
264
+	err = db.Group("x.doctor_id,x.schedule_type").Select("x.doctor_id,x.schedule_type,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.sort,r.is_sort,count(s.class_name) as count").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ? and s.status = 1", orgid, orgid).Scan(&schedule).Error
265
+	return schedule, err
266
+}
267
+
268
+func GetTotalMinutes(orgid int64, startime int64, endtime int64) (schedule []*models.CountStaffSchedule, err error) {
269
+
270
+	db := XTReadDB().Table("xt_staff_schedule as x").Where("x.status = 1")
271
+	if startime > 0 {
272
+		db = db.Where("x.start_time >=?", startime)
273
+	}
274
+	if endtime > 0 {
275
+		db = db.Where("x.end_time <=?", endtime)
276
+	}
277
+	if orgid > 0 {
278
+		db = db.Where("x.user_org_id = ?", orgid)
279
+	}
280
+	err = db.Group("x.doctor_id").Select("x.doctor_id,x.schedule_type,x.start_time,x.end_time,x.schedule_date,r.user_name,s.class_name,r.sort,r.is_sort,sum(s.minute) as totalminute").Joins("left join sgj_users.sgj_user_admin_role as r on r.admin_user_id = x.doctor_id").Joins("left join xt_doctor_schedules as s on s.id = x.schedule_type").Where("r.org_id = ? and r.status = 1 and s.user_org_id = ? and s.status = 1", orgid, orgid).Scan(&schedule).Error
281
+	return schedule, err
282
+}

+ 1 - 0
service/role_service.go Näytä tiedosto

345
 		CreateTime:    now,
345
 		CreateTime:    now,
346
 		ModifyTime:    now,
346
 		ModifyTime:    now,
347
 		RoleIds:       roleIds,
347
 		RoleIds:       roleIds,
348
+		IsSort:        1,
348
 	}
349
 	}
349
 	if createApp_RoleErr := tx.Create(&app_role).Error; createApp_RoleErr != nil {
350
 	if createApp_RoleErr := tx.Create(&app_role).Error; createApp_RoleErr != nil {
350
 		tx.Rollback()
351
 		tx.Rollback()