|
@@ -125,15 +125,15 @@ func (this *MobileRegistController) CreateOrg() {
|
125
|
125
|
}
|
126
|
126
|
adminUser := adminUserObj.(*models.AdminUser)
|
127
|
127
|
|
128
|
|
- if didCreateOrg, checkCreateOrgErr := service.DidAdminUserCreateOrg(adminUser.Id); checkCreateOrgErr != nil {
|
129
|
|
- this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
130
|
|
- this.ServeJSON()
|
131
|
|
- return
|
132
|
|
- } else if didCreateOrg {
|
133
|
|
- this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRepeatCreateOrg)
|
134
|
|
- this.ServeJSON()
|
135
|
|
- return
|
136
|
|
- }
|
|
128
|
+ //if didCreateOrg, checkCreateOrgErr := service.DidAdminUserCreateOrg(adminUser.Id); checkCreateOrgErr != nil {
|
|
129
|
+ // this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
130
|
+ // this.ServeJSON()
|
|
131
|
+ // return
|
|
132
|
+ //} else if didCreateOrg {
|
|
133
|
+ // this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeRepeatCreateOrg)
|
|
134
|
+ // this.ServeJSON()
|
|
135
|
+ // return
|
|
136
|
+ //}
|
137
|
137
|
|
138
|
138
|
name := this.GetString("org_name")
|
139
|
139
|
shortName := name
|
|
@@ -602,7 +602,7 @@ func InitPatientAndSchedule(org *models.Org) {
|
602
|
602
|
|
603
|
603
|
//创建两个虚拟病人本周的排班
|
604
|
604
|
//stime, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
|
605
|
|
- for _, date := range dates {
|
|
605
|
+ for week_type, date := range dates {
|
606
|
606
|
for index, id := range ids {
|
607
|
607
|
if index == 0 {
|
608
|
608
|
sch := &models.VMSchedule{
|
|
@@ -612,7 +612,7 @@ func InitPatientAndSchedule(org *models.Org) {
|
612
|
612
|
PatientId: id,
|
613
|
613
|
ScheduleDate: date,
|
614
|
614
|
ScheduleType: 1,
|
615
|
|
- ScheduleWeek: int64(time.Now().Weekday()),
|
|
615
|
+ ScheduleWeek: int64(week_type + 1),
|
616
|
616
|
ModeId: 1,
|
617
|
617
|
Status: 1,
|
618
|
618
|
CreatedTime: time.Now().Unix(),
|
|
@@ -630,7 +630,7 @@ func InitPatientAndSchedule(org *models.Org) {
|
630
|
630
|
PatientId: id,
|
631
|
631
|
ScheduleDate: date,
|
632
|
632
|
ScheduleType: 2,
|
633
|
|
- ScheduleWeek: int64(time.Now().Weekday()),
|
|
633
|
+ ScheduleWeek: int64(week_type + 1),
|
634
|
634
|
ModeId: 1,
|
635
|
635
|
Status: 1,
|
636
|
636
|
CreatedTime: time.Now().Unix(),
|
|
@@ -676,12 +676,19 @@ func InitPatientAndSchedule(org *models.Org) {
|
676
|
676
|
item.TemplateId = templaeIdOne.ID
|
677
|
677
|
item.DeviceNumberId = vmDeviceNumber1.ID
|
678
|
678
|
item.PatientId = ids[0]
|
|
679
|
+ item.Status = 1
|
|
680
|
+ item.Ctime = time.Now().Unix()
|
|
681
|
+ item.Mtime = time.Now().Unix()
|
679
|
682
|
|
680
|
683
|
} else if item.TimeType == 2 {
|
681
|
684
|
item.OrgId = org.Id
|
682
|
685
|
item.TemplateId = templaeIdOne.ID
|
683
|
686
|
item.DeviceNumberId = vmDeviceNumber2.ID
|
684
|
687
|
item.PatientId = ids[1]
|
|
688
|
+ item.Status = 1
|
|
689
|
+ item.Ctime = time.Now().Unix()
|
|
690
|
+ item.Mtime = time.Now().Unix()
|
|
691
|
+
|
685
|
692
|
}
|
686
|
693
|
|
687
|
694
|
service.CreateVMSchTemplate(item)
|