|
@@ -8,7 +8,7 @@ import (
|
|
|
"hongze/hongze_mobile_admin/models/roadshow"
|
|
|
"hongze/hongze_mobile_admin/models/tables/admin"
|
|
|
"hongze/hongze_mobile_admin/services"
|
|
|
- roadshowService "hongze/hongze_mobile_admin/services/roadshow"
|
|
|
+ "hongze/hongze_mobile_admin/services/rs"
|
|
|
"hongze/hongze_mobile_admin/utils"
|
|
|
"strconv"
|
|
|
"strings"
|
|
@@ -22,7 +22,7 @@ type CalendarController struct {
|
|
|
|
|
|
// @Title 新增路演活动接口
|
|
|
// @Description 新增路演活动接口
|
|
|
-// @Param request body roadshow.AddActivityReq true "type json string"
|
|
|
+// @Param request body rs.AddActivityReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /add [post]
|
|
|
func (this *CalendarController) Add() {
|
|
@@ -128,11 +128,11 @@ func (this *CalendarController) Add() {
|
|
|
this.FailWithMessage("研究员异常", "获取研究员异常,Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
- _ = roadshowService.SyncCalendarFromShanghai(researcherInfo.Mobile, v.StartDate, v.EndDate)
|
|
|
+ _ = rs.SyncCalendarFromShanghai(researcherInfo.Mobile, v.StartDate, v.EndDate)
|
|
|
|
|
|
//校验事项时间冲突
|
|
|
{
|
|
|
- matterCount, err := roadshowService.CheckMatters(startDateTime, endDateTime, v.ResearcherId, 0)
|
|
|
+ matterCount, err := rs.CheckMatters(startDateTime, endDateTime, v.ResearcherId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckMattersCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -144,7 +144,7 @@ func (this *CalendarController) Add() {
|
|
|
|
|
|
//校验活动时间冲突
|
|
|
{
|
|
|
- calendarCount, err := roadshowService.CheckCalendar(startDateTime, endDateTime, "1,2", v.ResearcherId, 0)
|
|
|
+ calendarCount, err := rs.CheckCalendar(startDateTime, endDateTime, "1,2", v.ResearcherId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendar!Err:"+err.Error())
|
|
|
return
|
|
@@ -211,7 +211,7 @@ func (this *CalendarController) Add() {
|
|
|
}
|
|
|
rsCalendar.RsCalendarId = int(rsCalendarId)
|
|
|
researcher.RsCalendarResearcherId = int(rsCalendarResearcherId)
|
|
|
- go roadshowService.CalendarToSH(*rsCalendar, *researcher)
|
|
|
+ go rs.CalendarToSH(*rsCalendar, *researcher)
|
|
|
|
|
|
//模板消息通知
|
|
|
{
|
|
@@ -249,7 +249,7 @@ func (this *CalendarController) Add() {
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Param Status query int true "1:待接受,2:包含,已接受,已拒绝,已删除"
|
|
|
-// @Success 200 {object} roadshow.CalendarListResp
|
|
|
+// @Success 200 {object} rs.CalendarListResp
|
|
|
// @router /calendar/list [get]
|
|
|
func (this *CalendarController) CalendarList() {
|
|
|
adminItem := this.AdminWx
|
|
@@ -305,7 +305,7 @@ func (this *CalendarController) CalendarList() {
|
|
|
|
|
|
// Accept
|
|
|
// @Description 接受路演活动接口
|
|
|
-// @Param request body roadshow.AcceptReq true "type json string"
|
|
|
+// @Param request body rs.AcceptReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /accept [post]
|
|
|
func (this *CalendarController) Accept() {
|
|
@@ -385,7 +385,7 @@ func (this *CalendarController) Accept() {
|
|
|
|
|
|
// @Title 拒绝路演活动接口
|
|
|
// @Description 拒绝路演活动接口
|
|
|
-// @Param request body roadshow.RefuseReq true "type json string"
|
|
|
+// @Param request body rs.RefuseReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /refuse [post]
|
|
|
func (this *CalendarController) Refuse() {
|
|
@@ -445,7 +445,7 @@ func (this *CalendarController) Refuse() {
|
|
|
}
|
|
|
|
|
|
// 拒绝后需要删除上海的日程
|
|
|
- go roadshowService.DeleteSHCalendar(req.RsCalendarResearcherId)
|
|
|
+ go rs.DeleteSHCalendar(req.RsCalendarResearcherId)
|
|
|
|
|
|
//模板消息通知
|
|
|
{
|
|
@@ -473,7 +473,7 @@ func (this *CalendarController) Refuse() {
|
|
|
// @Description 日历详情接口
|
|
|
// @Param RsCalendarId query int true "路演活动id"
|
|
|
// @Param RsCalendarResearcherId query int true "活动研究员id"
|
|
|
-// @Success 200 {object} roadshow.CalendarDetailResp
|
|
|
+// @Success 200 {object} rs.CalendarDetailResp
|
|
|
// @router /calendar/detail [get]
|
|
|
func (this *CalendarController) CalendarDetail() {
|
|
|
//adminItem:=this.AdminWx
|
|
@@ -538,7 +538,7 @@ func (this *CalendarController) CalendarDetail() {
|
|
|
// @Description 事项列表接口
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
-// @Success 200 {object} roadshow.MattersListResp
|
|
|
+// @Success 200 {object} rs.MattersListResp
|
|
|
// @router /matters/list [get]
|
|
|
func (this *CalendarController) MattersList() {
|
|
|
sysUser := this.AdminWx
|
|
@@ -587,7 +587,7 @@ func (this *CalendarController) MattersList() {
|
|
|
|
|
|
// @Title 新增事项接口
|
|
|
// @Description 新增事项接口
|
|
|
-// @Param request body roadshow.AddMattersReq true "type json string"
|
|
|
+// @Param request body rs.AddMattersReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /matters/add [post]
|
|
|
func (this *CalendarController) MattersAdd() {
|
|
@@ -649,7 +649,7 @@ func (this *CalendarController) MattersAdd() {
|
|
|
endDateTime := req.EndDate + " " + req.EndTime
|
|
|
//校验事项时间冲突
|
|
|
{
|
|
|
- matterCount, err := roadshowService.CheckMatters(startDateTime, endDateTime, sysUser.AdminId, 0)
|
|
|
+ matterCount, err := rs.CheckMatters(startDateTime, endDateTime, sysUser.AdminId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckMattersCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -662,7 +662,7 @@ func (this *CalendarController) MattersAdd() {
|
|
|
|
|
|
//校验活动时间冲突--待接受
|
|
|
{
|
|
|
- calendarCount, err := roadshowService.CheckCalendar(startDateTime, endDateTime, "1", sysUser.AdminId, 0)
|
|
|
+ calendarCount, err := rs.CheckCalendar(startDateTime, endDateTime, "1", sysUser.AdminId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendarResearcherCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -675,7 +675,7 @@ func (this *CalendarController) MattersAdd() {
|
|
|
|
|
|
//校验活动时间冲突--已接受
|
|
|
{
|
|
|
- calendarCount, err := roadshowService.CheckCalendar(startDateTime, endDateTime, "2", sysUser.AdminId, 0)
|
|
|
+ calendarCount, err := rs.CheckCalendar(startDateTime, endDateTime, "2", sysUser.AdminId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendarResearcherCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -723,13 +723,13 @@ func (this *CalendarController) MattersAdd() {
|
|
|
return
|
|
|
}
|
|
|
item.RsMattersId = int(id)
|
|
|
- go roadshowService.MatterToSH(*item)
|
|
|
+ go rs.MatterToSH(*item)
|
|
|
this.OkDetailed(nil, "保存成功")
|
|
|
}
|
|
|
|
|
|
// @Title 修改事项接口
|
|
|
// @Description 修改事项接口
|
|
|
-// @Param request body roadshow.UpdateMattersReq true "type json string"
|
|
|
+// @Param request body rs.UpdateMattersReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /matters/update [post]
|
|
|
func (this *CalendarController) MattersUpdate() {
|
|
@@ -839,7 +839,7 @@ func (this *CalendarController) MattersUpdate() {
|
|
|
matterItem.EndDate != req.EndDate ||
|
|
|
matterItem.EndTime != req.EndTime) {
|
|
|
|
|
|
- matterCount, err := roadshowService.CheckMatters(startDateTime, endDateTime, sysUser.AdminId, matterItem.RsMattersId)
|
|
|
+ matterCount, err := rs.CheckMatters(startDateTime, endDateTime, sysUser.AdminId, matterItem.RsMattersId)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckMattersCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -853,7 +853,7 @@ func (this *CalendarController) MattersUpdate() {
|
|
|
|
|
|
//校验活动时间冲突--待接受
|
|
|
{
|
|
|
- calendarCount, err := roadshowService.CheckCalendar(startDateTime, endDateTime, "1", sysUser.AdminId, 0)
|
|
|
+ calendarCount, err := rs.CheckCalendar(startDateTime, endDateTime, "1", sysUser.AdminId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendarResearcherCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -865,7 +865,7 @@ func (this *CalendarController) MattersUpdate() {
|
|
|
}
|
|
|
//校验活动时间冲突--待接受
|
|
|
{
|
|
|
- calendarCount, err := roadshowService.CheckCalendar(startDateTime, endDateTime, "2", sysUser.AdminId, 0)
|
|
|
+ calendarCount, err := rs.CheckCalendar(startDateTime, endDateTime, "2", sysUser.AdminId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendarResearcherCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -887,13 +887,13 @@ func (this *CalendarController) MattersUpdate() {
|
|
|
this.FailWithMessage("保存失败!", "保存失败!UpdateRsMatters:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
- go roadshowService.UpdateSHCalendarByMatter(req)
|
|
|
+ go rs.UpdateSHCalendarByMatter(req)
|
|
|
this.OkDetailed(nil, "保存成功")
|
|
|
}
|
|
|
|
|
|
// @Title 删除事项接口
|
|
|
// @Description 删除事项接口
|
|
|
-// @Param request body roadshow.DeleteMattersReq true "type json string"
|
|
|
+// @Param request body rs.DeleteMattersReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /matters/delete [post]
|
|
|
func (this *CalendarController) MattersDelete() {
|
|
@@ -920,7 +920,7 @@ func (this *CalendarController) MattersDelete() {
|
|
|
this.FailWithMessage("保存失败", "保存失败!DeleteRsMatters:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
- go roadshowService.DeleteSHMatter(req.RsMattersId)
|
|
|
+ go rs.DeleteSHMatter(req.RsMattersId)
|
|
|
this.OkDetailed(nil, "删除成功")
|
|
|
}
|
|
|
|
|
@@ -943,7 +943,7 @@ func getTitle(activityType, roadshowType, activityCategory, roadshowPlatform, pr
|
|
|
|
|
|
// @Title 编辑路演活动接口
|
|
|
// @Description编辑路演活动接口
|
|
|
-// @Param request body roadshow.EditActivityReq true "type json string"
|
|
|
+// @Param request body rs.EditActivityReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /edit [post]
|
|
|
func (this *CalendarController) Edit() {
|
|
@@ -1084,7 +1084,7 @@ func (this *CalendarController) Edit() {
|
|
|
this.FailWithMessage("研究员异常!", "研究员异常")
|
|
|
return
|
|
|
}
|
|
|
- _ = roadshowService.SyncCalendarFromShanghai(researcherInfo.Mobile, v.StartDate, v.EndDate)
|
|
|
+ _ = rs.SyncCalendarFromShanghai(researcherInfo.Mobile, v.StartDate, v.EndDate)
|
|
|
|
|
|
//校验事项时间冲突
|
|
|
{
|
|
@@ -1093,7 +1093,7 @@ func (this *CalendarController) Edit() {
|
|
|
rsCalendarResearcherItem.EndDate != v.EndDate ||
|
|
|
rsCalendarResearcherItem.EndTime != v.EndTime)) {
|
|
|
|
|
|
- matterCount, err := roadshowService.CheckMatters(startDateTime, endDateTime, v.ResearcherId, 0)
|
|
|
+ matterCount, err := rs.CheckMatters(startDateTime, endDateTime, v.ResearcherId, 0)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckMattersCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -1111,7 +1111,7 @@ func (this *CalendarController) Edit() {
|
|
|
rsCalendarResearcherItem.EndDate != v.EndDate ||
|
|
|
rsCalendarResearcherItem.EndTime != v.EndTime)) {
|
|
|
|
|
|
- calendarCount, err := roadshowService.CheckCalendar(startDateTime, endDateTime, "1,2", v.ResearcherId, rsCalendarResearcherId)
|
|
|
+ calendarCount, err := rs.CheckCalendar(startDateTime, endDateTime, "1,2", v.ResearcherId, rsCalendarResearcherId)
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendarResearcherCount!Err:"+err.Error())
|
|
|
return
|
|
@@ -1192,7 +1192,7 @@ func (this *CalendarController) Edit() {
|
|
|
return
|
|
|
}
|
|
|
//newResearcherMap := make(map[int]string)
|
|
|
- go roadshowService.UpdateSHCalendar(req)
|
|
|
+ go rs.UpdateSHCalendar(req)
|
|
|
|
|
|
existList, err := roadshow.GetRsCalendarResearcherByCalendarId(req.RsCalendarId)
|
|
|
if err != nil {
|
|
@@ -1332,7 +1332,7 @@ func (this *CalendarController) Edit() {
|
|
|
// ResearcherList
|
|
|
// @Title 研究员列表
|
|
|
// @Description 研究员列表接口
|
|
|
-// @Success 200 {object} roadshow.ResearcherGroup
|
|
|
+// @Success 200 {object} rs.ResearcherGroup
|
|
|
// @router /researcher/list [get]
|
|
|
func (this *CalendarController) ResearcherList() {
|
|
|
sysUser := this.AdminWx
|
|
@@ -1370,7 +1370,7 @@ func (this *CalendarController) ResearcherList() {
|
|
|
|
|
|
// @Title 撤回路演活动接口
|
|
|
// @Description 撤回路演活动接口
|
|
|
-// @Param request body roadshow.AcceptReq true "type json string"
|
|
|
+// @Param request body rs.AcceptReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /back [post]
|
|
|
func (this *CalendarController) Back() {
|
|
@@ -1428,7 +1428,7 @@ func (this *CalendarController) Back() {
|
|
|
err = roadshow.UpdateCalendarResearcher(whereParams, updateParams)
|
|
|
|
|
|
//撤回后,需要删除该日程
|
|
|
- go roadshowService.DeleteSHCalendar(req.RsCalendarResearcherId)
|
|
|
+ go rs.DeleteSHCalendar(req.RsCalendarResearcherId)
|
|
|
|
|
|
if err != nil {
|
|
|
this.FailWithMessage("保存失败", "保存失败!UpdateCalendarResearcher:"+err.Error())
|
|
@@ -1439,7 +1439,7 @@ func (this *CalendarController) Back() {
|
|
|
|
|
|
// @Title 删除路演活动接口
|
|
|
// @Description 删除路演活动接口
|
|
|
-// @Param request body roadshow.DeleteReq true "type json string"
|
|
|
+// @Param request body rs.DeleteReq true "type json string"
|
|
|
// @Success Ret=200 保存成功
|
|
|
// @router /delete [post]
|
|
|
func (this *CalendarController) Delete() {
|
|
@@ -1499,7 +1499,7 @@ func (this *CalendarController) Delete() {
|
|
|
//`status` int(11) DEFAULT '0' COMMENT '1:待接受,2:已接受,3:已拒绝,4:已删除,5:已撤回,6:已结束',
|
|
|
//待接受、已接受的情况,需要同步删除上海那边的日程
|
|
|
if rsCalendarResearcherItem.Status == 1 || rsCalendarResearcherItem.Status == 2 {
|
|
|
- go roadshowService.DeleteSHCalendar(rsCalendarResearcherItem.RsCalendarResearcherId)
|
|
|
+ go rs.DeleteSHCalendar(rsCalendarResearcherItem.RsCalendarResearcherId)
|
|
|
}
|
|
|
//模板消息通知
|
|
|
{
|
|
@@ -1525,3 +1525,24 @@ func (this *CalendarController) Delete() {
|
|
|
}
|
|
|
this.OkDetailed(nil, "删除成功")
|
|
|
}
|
|
|
+
|
|
|
+// ResearcherList
|
|
|
+// @Title 获取报告电话会类型
|
|
|
+// @Description 获取报告电话会类型接口
|
|
|
+// @Success 200 {object} rs.ResearcherGroup
|
|
|
+// @router /activity/type/list [get]
|
|
|
+func (this *CalendarController) ActivityTypeList() {
|
|
|
+ sysUser := this.AdminWx
|
|
|
+ if sysUser == nil {
|
|
|
+ this.FailWithMessage("请登录", "请登录,SysUser Is Empty")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 获取所有的分类
|
|
|
+
|
|
|
+ list, err := rs.GetAllActivityType()
|
|
|
+ if err != nil {
|
|
|
+ this.FailWithMessage("获取活动类型列表失败", "获取活动类型列表失败,Err:"+err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.OkDetailed(list, "获取成功")
|
|
|
+}
|