作者 tangxvhui

机会详情添加自查内容

... ... @@ -33,6 +33,7 @@ type Chance struct {
ApproveData string `orm:"column(approve_data);size(500);null" description:"公开数据 (公开状态 公开对象)"`
Code string `orm:"column(code)" description:"机会编码"`
Status int8 `orm:"column(status)" description:"机会状态 1:开启 2:关闭"`
SelfChecks string `orm:"column(self_checks)" description:"自查内容"`
}
func (t *Chance) TableName() string {
... ... @@ -93,6 +94,13 @@ var ChanceStatusMap = map[int8]string{
ChanceStatusForbid: "已关闭",
}
//ChanceSelfCheck chance表中SelfChecks字段的json结构
type ChanceSelfCheck struct {
ChickItem string `json:"checkItem"`
GroupId int `json:"groupId"`
Answer string `json::"answer"`
}
// AddChance insert a new Chance into database and returns
// last inserted Id on success.
func AddChance(m *Chance) (id int64, err error) {
... ...
... ... @@ -322,6 +322,10 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
return returnData, nil
}
type ChanceSelfCheckData struct {
Title string `json:"title"`
Result string `json:"result"`
}
type ResponseChanceInfo struct {
CreateTime string `json:"create_time"`
UserName string `json:"user_name"`
... ... @@ -333,6 +337,7 @@ type ResponseChanceInfo struct {
VideoData []models.ChanceDataVideos `json:"video_data"`
SpeechData []models.ChanceDataSpeechs `json:"speech_data"`
FlowLog []protocol.ChanceFlowLog `json:"flow_log"`
SelfCheck []ChanceSelfCheckData `json:"self_check"`
}
//机会详情
... ... @@ -416,7 +421,7 @@ func GetChanceDetail(chanceid int64, companyid int64) (ResponseChanceInfo, error
log.Warn("获取获取记录失败")
}
returnData.FlowLog = flowlogs
returnData.SelfCheck = getChanceSelfChecks(chanceid)
return returnData, nil
}
... ... @@ -439,6 +444,11 @@ func getAuditFlowLog(chanceid int64) ([]protocol.ChanceFlowLog, error) {
return flowLogs, err
}
func getChanceSelfChecks(chanceId int64) []ChanceSelfCheckData {
selfchecks := []ChanceSelfCheckData{}
return selfchecks
}
func AllowChanceEnableStatus(chanceid int64, companyid int64) error {
var (
err error
... ...