|
@@ -327,7 +327,6 @@ func (this *CalendarController) CalendarList() {
|
|
|
this.OkDetailed(resp, "获取成功")
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// CalendarList
|
|
|
// @Title 内部会议和报告电话会日历列表
|
|
|
// @Description 内部会议和报告电话会日历列表
|
|
@@ -1045,7 +1044,7 @@ func (this *CalendarController) Edit() {
|
|
|
}()
|
|
|
if !utils.Rc.SetNX(cacheKey, 1, 3*time.Second) {
|
|
|
deleteCache = false
|
|
|
- this.FailWithMessage("系统处理中,请稍后重试!", "系统处理中,请稍后重试!" + sysUser.RealName + ";data:" + string(this.Ctx.Input.RequestBody))
|
|
|
+ this.FailWithMessage("系统处理中,请稍后重试!", "系统处理中,请稍后重试!"+sysUser.RealName+";data:"+string(this.Ctx.Input.RequestBody))
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1113,7 +1112,7 @@ func (this *CalendarController) Edit() {
|
|
|
}
|
|
|
|
|
|
if realName, ok := researcherMap[v.ResearcherId]; ok {
|
|
|
- this.FailWithMessage("研究员:" + realName + " 被重复选择", "研究员:" + realName + " 被重复选择")
|
|
|
+ this.FailWithMessage("研究员:"+realName+" 被重复选择", "研究员:"+realName+" 被重复选择")
|
|
|
return
|
|
|
}
|
|
|
researcherMap[v.ResearcherId] = v.ResearcherName
|
|
@@ -1150,7 +1149,7 @@ func (this *CalendarController) Edit() {
|
|
|
if err.Error() == utils.ErrNoRow() {
|
|
|
isAdd = true
|
|
|
} else {
|
|
|
- this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarResearcherByRsCalendarIdAndResearcherId:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarResearcherByRsCalendarIdAndResearcherId:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -1164,7 +1163,7 @@ func (this *CalendarController) Edit() {
|
|
|
//同步上海数据
|
|
|
researcherInfo, err := admin.GetAdminById(v.ResearcherId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("研究员异常!", "研究员异常,Err:" + err.Error())
|
|
|
+ this.FailWithMessage("研究员异常!", "研究员异常,Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
_ = rs.SyncCalendarFromShanghai(researcherInfo.Mobile, v.StartDate, v.EndDate)
|
|
@@ -1178,7 +1177,7 @@ func (this *CalendarController) Edit() {
|
|
|
|
|
|
matterCount, err := rs.CheckMatters(startDateTime, endDateTime, v.ResearcherId, 0)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckMattersCount!Err:" + err.Error())
|
|
|
+ this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckMattersCount!Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
if matterCount > 0 {
|
|
@@ -1189,7 +1188,7 @@ func (this *CalendarController) Edit() {
|
|
|
|
|
|
calendarCount, err := rs.CheckCalendar(startDateTime, endDateTime, "1,2", v.ResearcherId, rsCalendarResearcherId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendarResearcherCount!Err:" + err.Error())
|
|
|
+ this.FailWithMessage("时间冲突检测失败!", "时间冲突检测失败-CheckCalendarResearcherCount!Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
if calendarCount > 0 {
|
|
@@ -1198,18 +1197,18 @@ func (this *CalendarController) Edit() {
|
|
|
}
|
|
|
|
|
|
if len(checkIsAdd) > 0 {
|
|
|
- this.FailWithMessage(strings.Join(checkIsAdd, ",") + "时间已被占用!", "时间冲突检测失败-CheckMattersCount!")
|
|
|
+ this.FailWithMessage(strings.Join(checkIsAdd, ",")+"时间已被占用!", "时间冲突检测失败-CheckMattersCount!")
|
|
|
return
|
|
|
}
|
|
|
|
|
|
rsCalendarItem, err := roadshow.GetRsCalendarById(req.RsCalendarId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarById:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarById:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
|
if rsCalendarItem == nil {
|
|
|
- this.FailWithMessage("保存失败!","获取数据失败!GetRsCalendarById:" + err.Error())
|
|
|
+ this.FailWithMessage("保存失败!", "获取数据失败!GetRsCalendarById:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1262,12 +1261,12 @@ func (this *CalendarController) Edit() {
|
|
|
calendarUpdateParams["title"] = getTitle(req.ActivityType, req.RoadshowType, req.ActivityCategory, req.RoadshowPlatform, req.Province, req.City)
|
|
|
err = roadshow.UpdateRsCalendar(calendarWhereParams, calendarUpdateParams)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("保存失败!","保存失败!UpdateRsCalendar:" + err.Error())
|
|
|
+ this.FailWithMessage("保存失败!", "保存失败!UpdateRsCalendar:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
existList, err := roadshow.GetRsCalendarResearcherByCalendarId(req.RsCalendarId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("保存失败!","保存失败!GetRsCalendarResearcherByCalendarId:" + err.Error())
|
|
|
+ this.FailWithMessage("保存失败!", "保存失败!GetRsCalendarResearcherByCalendarId:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
existResearcherMap := make(map[int]string)
|
|
@@ -1282,7 +1281,7 @@ func (this *CalendarController) Edit() {
|
|
|
for k, v := range req.ResearcherList {
|
|
|
rsCalendarResearcherItem, err := roadshow.GetRsCalendarResearcherById(req.RsCalendarResearcherId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!","获取数据失败!GetRsCalendarResearcherById:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarResearcherById:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1313,7 +1312,7 @@ func (this *CalendarController) Edit() {
|
|
|
|
|
|
err = roadshow.UpdateCalendarResearcher(calendarResearcherWhereParams, calendarResearcherUpdateParams)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("保存失败!","保存失败!UpdateCalendarResearcher:" + err.Error())
|
|
|
+ this.FailWithMessage("保存失败!", "保存失败!UpdateCalendarResearcher:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
//上海新增(因为在驳回的时候,就把上海该时间段的日程给删除了,所以修改的时候,需要重新调用新增接口)
|
|
@@ -1364,13 +1363,13 @@ func (this *CalendarController) Edit() {
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("GetRsCalendarResearcherByCalendarId err: ", err)
|
|
|
fmt.Println(err)
|
|
|
- this.FailWithMessage("保存失败!","获取数据失败,GetRsCalendarResearcherByCalendarId:" + err.Error())
|
|
|
+ this.FailWithMessage("保存失败!", "获取数据失败,GetRsCalendarResearcherByCalendarId:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
//先删后增
|
|
|
err = roadshow.DeleteRsCalendarResearcher(req.RsCalendarId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("保存失败!","保存失败!DeleteRsCalendarResearcher:" + err.Error())
|
|
|
+ this.FailWithMessage("保存失败!", "保存失败!DeleteRsCalendarResearcher:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1399,7 +1398,7 @@ func (this *CalendarController) Edit() {
|
|
|
}
|
|
|
rsCalendarResearcherId, err := roadshow.AddRsCalendarResearcher(researcher)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("保存失败!","保存日历活动-研究员信息失败!Err:" + err.Error())
|
|
|
+ this.FailWithMessage("保存失败!", "保存日历活动-研究员信息失败!Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1564,34 +1563,34 @@ func (this *CalendarController) Delete() {
|
|
|
var req roadshow.DeleteReq
|
|
|
err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("参数解析异常!", "参数解析失败,Err:" + err.Error())
|
|
|
+ this.FailWithMessage("参数解析异常!", "参数解析失败,Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
|
if req.RsCalendarId <= 0 || req.RsCalendarResearcherId <= 0 {
|
|
|
- this.FailWithMessage("参数错误!", "参数错误!RsCalendarId:" + strconv.Itoa(req.RsCalendarId) + ";RsCalendarResearcherId:" + strconv.Itoa(req.RsCalendarResearcherId))
|
|
|
+ this.FailWithMessage("参数错误!", "参数错误!RsCalendarId:"+strconv.Itoa(req.RsCalendarId)+";RsCalendarResearcherId:"+strconv.Itoa(req.RsCalendarResearcherId))
|
|
|
return
|
|
|
}
|
|
|
rsCalendarItem, err := roadshow.GetRsCalendarById(req.RsCalendarId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarById:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarById:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
|
rsCalendarResearcherItem, err := roadshow.GetRsCalendarResearcherById(req.RsCalendarResearcherId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarResearcherById:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败!GetRsCalendarResearcherById:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
|
if rsCalendarItem.ActivityType == "报告电话会" || rsCalendarItem.ActivityType == "内部会议" {
|
|
|
err = roadshow.DeleteCalendar(req.RsCalendarId, req.RsCalendarResearcherId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("删除失败!", "删除失败!DeleteCalendar:" + err.Error())
|
|
|
+ this.FailWithMessage("删除失败!", "删除失败!DeleteCalendar:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
|
- if req.DeleteReason=="" {
|
|
|
+ if req.DeleteReason == "" {
|
|
|
this.FailWithMessage("删除失败,请输入删除理由!", "删除失败!请输入删除理由")
|
|
|
return
|
|
|
}
|
|
@@ -1608,7 +1607,7 @@ func (this *CalendarController) Delete() {
|
|
|
|
|
|
err = roadshow.UpdateCalendarResearcher(whereParams, updateParams)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("删除失败!", "删除失败!UpdateCalendarResearcher:" + err.Error())
|
|
|
+ this.FailWithMessage("删除失败!", "删除失败!UpdateCalendarResearcher:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -1717,13 +1716,13 @@ func (this *CalendarController) ResearcherCalendarDetail() {
|
|
|
|
|
|
calendarList, err := roadshow.GetCalendarDetailList(condition, pars)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!", "获取数据失败,GetCalendarDetailList Err:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败,GetCalendarDetailList Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
|
matterList, err := roadshow.GetRsMattersList(startDate, endDate, researcherId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!","获取数据失败,GetRsMattersList Err:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败,GetRsMattersList Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1757,7 +1756,7 @@ func (this *CalendarController) MyCalendarDetail() {
|
|
|
startDate := this.GetString("StartDate")
|
|
|
endDate := this.GetString("EndDate")
|
|
|
if startDate == "" || endDate == "" {
|
|
|
- this.FailWithMessage("参数错误!","参数错误 StartDate:"+startDate+" EndDate:"+endDate)
|
|
|
+ this.FailWithMessage("参数错误!", "参数错误 StartDate:"+startDate+" EndDate:"+endDate)
|
|
|
return
|
|
|
}
|
|
|
var condition string
|
|
@@ -1801,13 +1800,13 @@ func (this *CalendarController) MyCalendarDetail() {
|
|
|
|
|
|
calendarList, err := roadshow.GetCalendarDetailList(condition, pars)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!","获取数据失败,GetCalendarDetailList Err:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败,GetCalendarDetailList Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
|
matterList, err := roadshow.GetRsMattersList(startDate, endDate, sysUser.AdminId)
|
|
|
if err != nil {
|
|
|
- this.FailWithMessage("获取数据失败!","获取数据失败,GetRsMattersList Err:" + err.Error())
|
|
|
+ this.FailWithMessage("获取数据失败!", "获取数据失败,GetRsMattersList Err:"+err.Error())
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1815,4 +1814,4 @@ func (this *CalendarController) MyCalendarDetail() {
|
|
|
resp.CalendarList = calendarList
|
|
|
resp.RsMattersList = matterList
|
|
|
this.OkDetailed(resp, "删除成功")
|
|
|
-}
|
|
|
+}
|