|
@@ -1606,23 +1606,30 @@ func (c *ScheduleApiController) ChangeSchedule() {
|
1606
|
1606
|
var DialysisMachineName string
|
1607
|
1607
|
if filedRecordOne.IsShow == 1 {
|
1608
|
1608
|
DialysisMachineName = so.DialysisDialyszers
|
|
1609
|
+ fmt.Println("1111")
|
|
1610
|
+ fmt.Println(DialysisMachineName)
|
|
1611
|
+
|
1609
|
1612
|
}
|
1610
|
1613
|
if filedRecordThree.IsShow == 1 {
|
1611
|
1614
|
if len(schedule.DialysisMachineName) > 0 {
|
1612
|
|
- DialysisMachineName = schedule.DialysisMachineName + "," + so.DialyzerPerfusionApparatus
|
1613
|
|
-
|
|
1615
|
+ DialysisMachineName = DialysisMachineName + "," + so.DialyzerPerfusionApparatus
|
|
1616
|
+ fmt.Println("22222")
|
|
1617
|
+ fmt.Println(DialysisMachineName)
|
1614
|
1618
|
} else {
|
1615
|
1619
|
DialysisMachineName = so.DialyzerPerfusionApparatus
|
1616
|
|
-
|
|
1620
|
+ fmt.Println("333333")
|
|
1621
|
+ fmt.Println(DialysisMachineName)
|
1617
|
1622
|
}
|
1618
|
1623
|
}
|
1619
|
1624
|
if filedRecordTwo.IsShow == 1 {
|
1620
|
1625
|
if len(DialysisMachineName) > 0 {
|
1621
|
|
- DialysisMachineName = schedule.DialysisMachineName + "," + so.DialysisIrrigation
|
1622
|
|
-
|
|
1626
|
+ DialysisMachineName = DialysisMachineName + "," + so.DialysisIrrigation
|
|
1627
|
+ fmt.Println("55555555")
|
|
1628
|
+ fmt.Println(DialysisMachineName)
|
1623
|
1629
|
} else {
|
1624
|
1630
|
DialysisMachineName = so.DialysisIrrigation
|
1625
|
|
-
|
|
1631
|
+ fmt.Println("66666666")
|
|
1632
|
+ fmt.Println(DialysisMachineName)
|
1626
|
1633
|
}
|
1627
|
1634
|
}
|
1628
|
1635
|
schedule.DialysisMachineName = DialysisMachineName
|
|
@@ -2549,7 +2556,7 @@ func (this *ScheduleApiController) ExportSchedule() {
|
2549
|
2556
|
}
|
2550
|
2557
|
if filedRecordTwo.IsShow == 1 {
|
2551
|
2558
|
if len(DialysisMachineName) > 0 {
|
2552
|
|
- DialysisMachineName = sch.DialysisMachineName + "," + so.DialysisIrrigation
|
|
2559
|
+ DialysisMachineName = DialysisMachineName + "," + so.DialysisIrrigation
|
2553
|
2560
|
|
2554
|
2561
|
} else {
|
2555
|
2562
|
DialysisMachineName = so.DialysisIrrigation
|
|
@@ -4094,6 +4101,9 @@ func (c *ScheduleApiController) SynchroSchedule() {
|
4094
|
4101
|
//根据模板ID获取模板数据
|
4095
|
4102
|
list, _ := service.GetTemplateListByTemplateId(template_id, orgId)
|
4096
|
4103
|
|
|
4104
|
+ //数据去重操作
|
|
4105
|
+ list = RemoveRepeatedScheduleTemplate(list)
|
|
4106
|
+
|
4097
|
4107
|
recordDateStr := time.Now().Format("2006-01-02")
|
4098
|
4108
|
recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
4099
|
4109
|
nowtime := recordDate.Unix()
|
|
@@ -4306,3 +4316,20 @@ func (c *ScheduleApiController) GetSolutionSchedule() {
|
4306
|
4316
|
})
|
4307
|
4317
|
return
|
4308
|
4318
|
}
|
|
4319
|
+
|
|
4320
|
+func RemoveRepeatedScheduleTemplate(arr []*models.VmPatientScheduleTemplateItem) (newArr []*models.VmPatientScheduleTemplateItem) {
|
|
4321
|
+ newArr = make([]*models.VmPatientScheduleTemplateItem, 0)
|
|
4322
|
+ for i := 0; i < len(arr); i++ {
|
|
4323
|
+ repeat := false
|
|
4324
|
+ for j := i + 1; j < len(arr); j++ {
|
|
4325
|
+ if arr[i].TemplateID == arr[j].TemplateID && arr[i].PatientID == arr[j].PatientID && arr[i].Weekday == arr[j].Weekday && arr[i].DeviceNumberID == arr[j].DeviceNumberID && arr[i].TimeType == arr[j].TimeType {
|
|
4326
|
+ repeat = true
|
|
4327
|
+ break
|
|
4328
|
+ }
|
|
4329
|
+ }
|
|
4330
|
+ if !repeat {
|
|
4331
|
+ newArr = append(newArr, arr[i])
|
|
4332
|
+ }
|
|
4333
|
+ }
|
|
4334
|
+ return
|
|
4335
|
+}
|