|
@@ -3,11 +3,13 @@ package roadshow
|
|
|
import (
|
|
|
"context"
|
|
|
"github.com/beego/beego/v2/client/orm"
|
|
|
+ "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
type RsCalendarResearcherQuestion struct {
|
|
|
RsCalendarResearcherQuestionId int `orm:"column(rs_calendar_researcher_question_id);pk"`
|
|
|
+ RsCalendarId int `description:"路演日历ID"`
|
|
|
RsCalendarResearcherId int `description:"路演研究员记录ID"`
|
|
|
QuestionContent string `description:"提问内容"`
|
|
|
ReplyContent string `description:"回复内容"`
|
|
@@ -51,6 +53,7 @@ func RoadShowQuestionSave(req *RoadShowQuestionSaveReq) (err error) {
|
|
|
list := make([]*RsCalendarResearcherQuestion, 0)
|
|
|
for _, v := range req.QuestionList {
|
|
|
item := new(RsCalendarResearcherQuestion)
|
|
|
+ item.RsCalendarId = req.RsCalendarId
|
|
|
item.RsCalendarResearcherId = req.RsCalendarResearcherId
|
|
|
item.QuestionContent = v.QuestionContent
|
|
|
item.ReplyContent = v.ReplyContent
|
|
@@ -62,9 +65,103 @@ func RoadShowQuestionSave(req *RoadShowQuestionSaveReq) (err error) {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-func GetRoadShowQuestionList(rsCalendarResearcherId int) (item []*RsCalendarResearcherQuestion, err error) {
|
|
|
+func GetRoadShowQuestionList(condition string, pars []interface{}) (item []*RsCalendarResearcherQuestion, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT * FROM rs_calendar_researcher_question WHERE rs_calendar_researcher_id = ? ORDER BY create_time DESC `
|
|
|
- _, err = o.Raw(sql, rsCalendarResearcherId).QueryRows(&item)
|
|
|
+ sql := `SELECT * FROM rs_calendar_researcher_question WHERE 1=1 `
|
|
|
+ if condition != "" {
|
|
|
+ sql += condition
|
|
|
+ }
|
|
|
+ sql += ` ORDER BY create_time DESC `
|
|
|
+ _, err = o.Raw(sql, pars).QueryRows(&item)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+type QuestionSummary struct {
|
|
|
+ RsCalendarId int `orm:"column(rs_calendar_id);pk"`
|
|
|
+ SysUserId int `description:"创建人id"`
|
|
|
+ SysUserRealName string `description:"创建人名称"`
|
|
|
+ ActivityType string `description:"活动类型"`
|
|
|
+ RoadshowType string `description:"路演形式"`
|
|
|
+ RoadshowPlatform string `description:"路演平台"`
|
|
|
+ CompanyId int `description:"客户id"`
|
|
|
+ CompanyName string `description:"客户名称"`
|
|
|
+ RsCalendarResearcherId int `description:"活动研究员id"`
|
|
|
+ ResearcherId string `description:"研究员id"`
|
|
|
+ ResearcherName string `description:"研究员名称"`
|
|
|
+ StartDate string `description:"开始日期"`
|
|
|
+ EndDate string `description:"结束日期"`
|
|
|
+ StartTime string `description:"开始时间"`
|
|
|
+ EndTime string `description:"结束时间"`
|
|
|
+ StartWeek string `description:"开始日期对应周"`
|
|
|
+ EndWeek string `description:"结束日期对应周"`
|
|
|
+ Status int `description:"状态:1:待接受,2:已接受,3:已拒绝,4:已删除,5:已撤回,6:已结束"`
|
|
|
+ RefuseReason string `description:"拒绝理由"`
|
|
|
+ RefuseTime string `description:"拒绝时间"`
|
|
|
+ DeleteReason string `description:"删除原因"`
|
|
|
+ Province string `description:"省"`
|
|
|
+ ProvinceCode string `description:"省编码"`
|
|
|
+ City string `description:"市"`
|
|
|
+ CityCode string `description:"市编码"`
|
|
|
+ District string `description:"区"`
|
|
|
+ Theme string `description:"会议主题"`
|
|
|
+ CooperationName string `description:"合作方名称"`
|
|
|
+ ActivityCategory string `description:"活动类别"`
|
|
|
+ Source int `description:"来源,0:自系统,1:上海方的"`
|
|
|
+ Title string `description:"日历展示标题"`
|
|
|
+ CompanyStatus string `description:"新增客户状态"`
|
|
|
+ UnionCode string `description:"公开会议联合编码"`
|
|
|
+ EnglishCompany int `description:"是否为英文客户: 0-否; 1-是"`
|
|
|
+ EnglishCountry string `description:"英文客户-国家"`
|
|
|
+ EnglishViewTotal int `description:"英文客户-累计点击量"`
|
|
|
+ SubmitButton bool `description:"提交按钮是否展示"`
|
|
|
+ ViewButton bool `description:"查看按钮是否展示"`
|
|
|
+ EditButton bool `description:"修改按钮是否展示"`
|
|
|
+ CompanyIndustry string `description:"客户行业"`
|
|
|
+ CompanyClassify string `description:"客户分类"`
|
|
|
+ QuestionStatus int `description:"问答状态:0-未填写;1-已填写"`
|
|
|
+ QuestionMsgStatus int `description:"问答模板消息:0-未发送;1-已发送"`
|
|
|
+}
|
|
|
+
|
|
|
+type QuestionSummaryListResp struct {
|
|
|
+ Paging *paging.PagingItem
|
|
|
+ List []*QuestionSummary
|
|
|
+}
|
|
|
+
|
|
|
+func GetQuestionSummaryListCount(condition string, pars []interface{}) (count int, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT COUNT(1) AS count FROM(SELECT COUNT(1) AS count
|
|
|
+ FROM rs_calendar AS a
|
|
|
+ INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
|
|
|
+ WHERE 1=1 `
|
|
|
+ if condition != "" {
|
|
|
+ sql += condition
|
|
|
+ }
|
|
|
+ sql += ` GROUP BY a.rs_calendar_id ) AS t `
|
|
|
+ err = o.Raw(sql, pars).QueryRow(&count)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetQuestionSummaryList(condition string, pars []interface{}, startSize, pageSize int) (list []*QuestionSummary, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := ` SELECT a.rs_calendar_id,a.activity_type,a.roadshow_type,a.activity_category,a.roadshow_platform,b.create_time,a.district,
|
|
|
+ b.modify_time,GROUP_CONCAT(b.researcher_id ORDER BY researcher_sort ASC) AS researcher_id,GROUP_CONCAT(b.researcher_name ORDER BY researcher_sort ASC) AS researcher_name,
|
|
|
+ b.rs_calendar_researcher_id,b.start_date,
|
|
|
+ b.end_date,b.start_time,b.end_time,b.start_week,b.end_week,b.status,b.refuse_reason,b.refuse_time,
|
|
|
+ b.delete_reason,a.sys_user_real_name,a.city,a.province,a.company_name,a.company_id,
|
|
|
+ a.cooperation_name,a.theme,a.activity_category,a.english_company,
|
|
|
+ b.question_status,b.question_msg_status,
|
|
|
+ GROUP_CONCAT(b.company_industry) AS company_industry,
|
|
|
+ GROUP_CONCAT(b.company_classify) AS company_classify
|
|
|
+ FROM rs_calendar AS a
|
|
|
+ INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
|
|
|
+ WHERE 1=1
|
|
|
+ `
|
|
|
+ if condition != "" {
|
|
|
+ sql += condition
|
|
|
+ }
|
|
|
+ sql += ` GROUP BY a.rs_calendar_id
|
|
|
+ ORDER BY b.create_time DESC LIMIT ?,? `
|
|
|
+
|
|
|
+ _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&list)
|
|
|
return
|
|
|
}
|