|
@@ -50,6 +50,32 @@ func (this *BusinessTrip) BusinessTripCalendar() {
|
|
|
groupLen := len(groupList)
|
|
|
|
|
|
fmt.Println("groupLen:", groupLen)
|
|
|
+ //获取当天周日期
|
|
|
+ nowWeekStart := utils.GetNowWeekMonday().AddDate(0, 0, -2)
|
|
|
+ //nowWeekEnd := utils.GetNowWeekLastDay()
|
|
|
+ //获取下周日期
|
|
|
+ nextWeekStart := utils.GetNextWeekMonday().AddDate(0, 0, -2)
|
|
|
+ nextWeekEnd := utils.GetNextWeekLastDay().AddDate(0, 0, -2)
|
|
|
+
|
|
|
+ //获取出差信息
|
|
|
+ businessTripList, err := business_trip.GetBusinessTripList(adminId, nowWeekStart.Format(utils.FormatDate), nextWeekEnd.Format(utils.FormatDate))
|
|
|
+ if err != nil {
|
|
|
+ this.FailWithMessage("获取信息失败!", "获取路演信息失败!,GetBusinessTripList Err:"+err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ btMap := make(map[int][]*business_trip.BusinessApplyView)
|
|
|
+
|
|
|
+ for _, v := range businessTripList {
|
|
|
+ if findVals, ok := btMap[v.ApplyAdminId]; ok {
|
|
|
+ findVals = append(findVals, v)
|
|
|
+ btMap[v.ApplyAdminId] = findVals
|
|
|
+ } else {
|
|
|
+ items := make([]*business_trip.BusinessApplyView, 0)
|
|
|
+ items = append(items, v)
|
|
|
+ btMap[v.ApplyAdminId] = items
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
for i := 0; i < groupLen; i++ {
|
|
|
group := groupList[i]
|
|
@@ -61,33 +87,6 @@ func (this *BusinessTrip) BusinessTripCalendar() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- //获取当天周日期
|
|
|
- nowWeekStart := utils.GetNowWeekMonday().AddDate(0, 0, -2)
|
|
|
- //nowWeekEnd := utils.GetNowWeekLastDay()
|
|
|
- //获取下周日期
|
|
|
- nextWeekStart := utils.GetNextWeekMonday().AddDate(0, 0, -2)
|
|
|
- nextWeekEnd := utils.GetNextWeekLastDay().AddDate(0, 0, -2)
|
|
|
-
|
|
|
- //获取出差信息
|
|
|
- businessTripList, err := business_trip.GetBusinessTripList(adminId, nowWeekStart.Format(utils.FormatDate), nextWeekEnd.Format(utils.FormatDate))
|
|
|
- if err != nil {
|
|
|
- this.FailWithMessage("获取信息失败!", "获取路演信息失败!,GetBusinessTripList Err:"+err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- btMap := make(map[int][]*business_trip.BusinessApplyView)
|
|
|
-
|
|
|
- for _, v := range businessTripList {
|
|
|
- if findVals, ok := btMap[v.ApplyAdminId]; ok {
|
|
|
- findVals = append(findVals, v)
|
|
|
- btMap[v.ApplyAdminId] = findVals
|
|
|
- } else {
|
|
|
- items := make([]*business_trip.BusinessApplyView, 0)
|
|
|
- items = append(items, v)
|
|
|
- btMap[v.ApplyAdminId] = items
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
setAdminList := make([]*business_trip.BusinessTripCalendarAdmin, 0)
|
|
|
|
|
|
for _, v := range adminList {
|
|
@@ -103,6 +102,7 @@ func (this *BusinessTrip) BusinessTripCalendar() {
|
|
|
if r != nil && (newDay.Equal(startDateT) || (newDay.Equal(endDateT)) || (newDay.Before(endDateT) && newDay.After(startDateT))) {
|
|
|
tripItem.City = r.City
|
|
|
tripItem.BusinessApplyId = r.BusinessApplyId
|
|
|
+ tripItem.Status = r.Status
|
|
|
}
|
|
|
}
|
|
|
tripItem.WeekDate = weekDate
|
|
@@ -121,6 +121,7 @@ func (this *BusinessTrip) BusinessTripCalendar() {
|
|
|
if r != nil && (newDay.Equal(startDateT) || (newDay.Equal(endDateT)) || (newDay.Before(endDateT) && newDay.After(startDateT))) {
|
|
|
tripItem.City = r.City
|
|
|
tripItem.BusinessApplyId = r.BusinessApplyId
|
|
|
+ tripItem.Status = r.Status
|
|
|
}
|
|
|
}
|
|
|
tripItem.WeekDate = weekDate
|