|
@@ -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
|
|
@@ -588,7 +588,7 @@ func InitPatientAndSchedule(org *models.Org) {
|
588
|
588
|
|
589
|
589
|
//创建两个虚拟病人本周的排班
|
590
|
590
|
//stime, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
|
591
|
|
- for _, date := range dates {
|
|
591
|
+ for week_type, date := range dates {
|
592
|
592
|
for index, id := range ids {
|
593
|
593
|
if index == 0 {
|
594
|
594
|
sch := &models.VMSchedule{
|
|
@@ -598,7 +598,7 @@ func InitPatientAndSchedule(org *models.Org) {
|
598
|
598
|
PatientId: id,
|
599
|
599
|
ScheduleDate: date,
|
600
|
600
|
ScheduleType: 1,
|
601
|
|
- ScheduleWeek: int64(time.Now().Weekday()),
|
|
601
|
+ ScheduleWeek: int64(week_type + 1),
|
602
|
602
|
ModeId: 1,
|
603
|
603
|
Status: 1,
|
604
|
604
|
CreatedTime: time.Now().Unix(),
|
|
@@ -616,7 +616,7 @@ func InitPatientAndSchedule(org *models.Org) {
|
616
|
616
|
PatientId: id,
|
617
|
617
|
ScheduleDate: date,
|
618
|
618
|
ScheduleType: 2,
|
619
|
|
- ScheduleWeek: int64(time.Now().Weekday()),
|
|
619
|
+ ScheduleWeek: int64(week_type + 1),
|
620
|
620
|
ModeId: 1,
|
621
|
621
|
Status: 1,
|
622
|
622
|
CreatedTime: time.Now().Unix(),
|
|
@@ -662,12 +662,19 @@ func InitPatientAndSchedule(org *models.Org) {
|
662
|
662
|
item.TemplateId = templaeIdOne.ID
|
663
|
663
|
item.DeviceNumberId = vmDeviceNumber1.ID
|
664
|
664
|
item.PatientId = ids[0]
|
|
665
|
+ item.Status = 1
|
|
666
|
+ item.Ctime = time.Now().Unix()
|
|
667
|
+ item.Mtime = time.Now().Unix()
|
665
|
668
|
|
666
|
669
|
} else if item.TimeType == 2 {
|
667
|
670
|
item.OrgId = org.Id
|
668
|
671
|
item.TemplateId = templaeIdOne.ID
|
669
|
672
|
item.DeviceNumberId = vmDeviceNumber2.ID
|
670
|
673
|
item.PatientId = ids[1]
|
|
674
|
+ item.Status = 1
|
|
675
|
+ item.Ctime = time.Now().Unix()
|
|
676
|
+ item.Mtime = time.Now().Unix()
|
|
677
|
+
|
671
|
678
|
}
|
672
|
679
|
|
673
|
680
|
service.CreateVMSchTemplate(item)
|