|
@@ -1577,7 +1577,7 @@ func (this *CalendarController) Delete() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- rsCalendarResearcherItem, err := roadshow.GetRsCalendarResearcherById(req.RsCalendarResearcherId)
|
|
|
+ rsCalendarResearcherItemList, err := roadshow.GetRsCalendarResearcherListById(req.RsCalendarResearcherId)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarResearcherById:"+err.Error())
|
|
|
return
|
|
@@ -1590,6 +1590,13 @@ func (this *CalendarController) Delete() {
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
|
+ //只获取一条路演数据
|
|
|
+ rsCalendarResearcherItemList, err = roadshow.GetRsCalendarResearcherListByCalendarResearcherId(req.RsCalendarResearcherId)
|
|
|
+ if err != nil {
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarResearcherById:"+err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if req.DeleteReason == "" {
|
|
|
this.FailWithMessage("删除失败,请输入删除理由!", "删除失败!请输入删除理由")
|
|
|
return
|
|
@@ -1612,31 +1619,34 @@ func (this *CalendarController) Delete() {
|
|
|
}
|
|
|
}
|
|
|
//`status` int(11) DEFAULT '0' COMMENT '1:待接受,2:已接受,3:已拒绝,4:已删除,5:已撤回,6:已结束',
|
|
|
- //待接受、已接受的情况,需要同步删除上海那边的日程
|
|
|
- if rsCalendarResearcherItem.Status == 1 || rsCalendarResearcherItem.Status == 2 {
|
|
|
- go rs.DeleteSHCalendar(rsCalendarResearcherItem.RsCalendarResearcherId)
|
|
|
- }
|
|
|
- //模板消息通知
|
|
|
- {
|
|
|
- go func() {
|
|
|
- if rsCalendarItem != nil && rsCalendarResearcherItem != nil {
|
|
|
- sysAdmin, _ := admin.GetAdminById(rsCalendarResearcherItem.ResearcherId)
|
|
|
- if sysAdmin != nil && sysAdmin.Mobile != "" {
|
|
|
- first := "【" + sysUser.RealName + "】删除了你的【路演】安排"
|
|
|
- var keyword1 string
|
|
|
- if rsCalendarItem.ActivityType == "路演" {
|
|
|
- keyword1 = rsCalendarItem.CompanyName + "," + rsCalendarItem.RoadshowType + rsCalendarItem.ActivityType
|
|
|
- } else {
|
|
|
- keyword1 = rsCalendarItem.Theme + "," + rsCalendarItem.RoadshowType + rsCalendarItem.ActivityType
|
|
|
+ for _, rsCalendarResearcherItem := range rsCalendarResearcherItemList {
|
|
|
+ //待接受、已接受的情况,需要同步删除上海那边的日程
|
|
|
+ if rsCalendarResearcherItem.Status == 1 || rsCalendarResearcherItem.Status == 2 {
|
|
|
+ go rs.DeleteSHCalendar(rsCalendarResearcherItem.RsCalendarResearcherId)
|
|
|
+ }
|
|
|
+ //模板消息通知
|
|
|
+ {
|
|
|
+ go func() {
|
|
|
+ if rsCalendarItem != nil && rsCalendarResearcherItem != nil {
|
|
|
+ sysAdmin, _ := admin.GetAdminById(rsCalendarResearcherItem.ResearcherId)
|
|
|
+ if sysAdmin != nil && sysAdmin.Mobile != "" {
|
|
|
+ first := "【" + sysUser.RealName + "】删除了你的【路演】安排"
|
|
|
+ var keyword1 string
|
|
|
+ if rsCalendarItem.ActivityType == "路演" {
|
|
|
+ keyword1 = rsCalendarItem.CompanyName + "," + rsCalendarItem.RoadshowType + rsCalendarItem.ActivityType
|
|
|
+ } else {
|
|
|
+ keyword1 = rsCalendarItem.Theme + "," + rsCalendarItem.RoadshowType + rsCalendarItem.ActivityType
|
|
|
+ }
|
|
|
+ keyword2 := "已删除"
|
|
|
+ remark := req.DeleteReason
|
|
|
+ wxAppPath := "pages-approve/activity/detail?RsCalendarId=" + strconv.Itoa(rsCalendarItem.RsCalendarId) + "&RsCalendarResearcherId=" + strconv.Itoa(rsCalendarResearcherItem.RsCalendarResearcherId)
|
|
|
+ go services.SendWxMsgWithRoadshowDeleteNotice(first, keyword1, keyword2, remark, wxAppPath, sysAdmin.Mobile)
|
|
|
}
|
|
|
- keyword2 := "已删除"
|
|
|
- remark := req.DeleteReason
|
|
|
- wxAppPath := "pages-approve/activity/detail?RsCalendarId=" + strconv.Itoa(rsCalendarItem.RsCalendarId) + "&RsCalendarResearcherId=" + strconv.Itoa(rsCalendarResearcherItem.RsCalendarResearcherId)
|
|
|
- go services.SendWxMsgWithRoadshowDeleteNotice(first, keyword1, keyword2, remark, wxAppPath, sysAdmin.Mobile)
|
|
|
}
|
|
|
- }
|
|
|
- }()
|
|
|
+ }()
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
this.OkDetailed(nil, "删除成功")
|
|
|
}
|
|
|
|