作者 tangxvhui

机会详情添加自查内容

@@ -33,6 +33,7 @@ type Chance struct { @@ -33,6 +33,7 @@ type Chance struct {
33 ApproveData string `orm:"column(approve_data);size(500);null" description:"公开数据 (公开状态 公开对象)"` 33 ApproveData string `orm:"column(approve_data);size(500);null" description:"公开数据 (公开状态 公开对象)"`
34 Code string `orm:"column(code)" description:"机会编码"` 34 Code string `orm:"column(code)" description:"机会编码"`
35 Status int8 `orm:"column(status)" description:"机会状态 1:开启 2:关闭"` 35 Status int8 `orm:"column(status)" description:"机会状态 1:开启 2:关闭"`
  36 + SelfChecks string `orm:"column(self_checks)" description:"自查内容"`
36 } 37 }
37 38
38 func (t *Chance) TableName() string { 39 func (t *Chance) TableName() string {
@@ -93,6 +94,13 @@ var ChanceStatusMap = map[int8]string{ @@ -93,6 +94,13 @@ var ChanceStatusMap = map[int8]string{
93 ChanceStatusForbid: "已关闭", 94 ChanceStatusForbid: "已关闭",
94 } 95 }
95 96
  97 +//ChanceSelfCheck chance表中SelfChecks字段的json结构
  98 +type ChanceSelfCheck struct {
  99 + ChickItem string `json:"checkItem"`
  100 + GroupId int `json:"groupId"`
  101 + Answer string `json::"answer"`
  102 +}
  103 +
96 // AddChance insert a new Chance into database and returns 104 // AddChance insert a new Chance into database and returns
97 // last inserted Id on success. 105 // last inserted Id on success.
98 func AddChance(m *Chance) (id int64, err error) { 106 func AddChance(m *Chance) (id int64, err error) {
@@ -322,6 +322,10 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64 @@ -322,6 +322,10 @@ func GetAuditList(param protocol.RequestAuditList, companyid int64, userid int64
322 return returnData, nil 322 return returnData, nil
323 } 323 }
324 324
  325 +type ChanceSelfCheckData struct {
  326 + Title string `json:"title"`
  327 + Result string `json:"result"`
  328 +}
325 type ResponseChanceInfo struct { 329 type ResponseChanceInfo struct {
326 CreateTime string `json:"create_time"` 330 CreateTime string `json:"create_time"`
327 UserName string `json:"user_name"` 331 UserName string `json:"user_name"`
@@ -333,6 +337,7 @@ type ResponseChanceInfo struct { @@ -333,6 +337,7 @@ type ResponseChanceInfo struct {
333 VideoData []models.ChanceDataVideos `json:"video_data"` 337 VideoData []models.ChanceDataVideos `json:"video_data"`
334 SpeechData []models.ChanceDataSpeechs `json:"speech_data"` 338 SpeechData []models.ChanceDataSpeechs `json:"speech_data"`
335 FlowLog []protocol.ChanceFlowLog `json:"flow_log"` 339 FlowLog []protocol.ChanceFlowLog `json:"flow_log"`
  340 + SelfCheck []ChanceSelfCheckData `json:"self_check"`
336 } 341 }
337 342
338 //机会详情 343 //机会详情
@@ -416,7 +421,7 @@ func GetChanceDetail(chanceid int64, companyid int64) (ResponseChanceInfo, error @@ -416,7 +421,7 @@ func GetChanceDetail(chanceid int64, companyid int64) (ResponseChanceInfo, error
416 log.Warn("获取获取记录失败") 421 log.Warn("获取获取记录失败")
417 } 422 }
418 returnData.FlowLog = flowlogs 423 returnData.FlowLog = flowlogs
419 - 424 + returnData.SelfCheck = getChanceSelfChecks(chanceid)
420 return returnData, nil 425 return returnData, nil
421 } 426 }
422 427
@@ -439,6 +444,11 @@ func getAuditFlowLog(chanceid int64) ([]protocol.ChanceFlowLog, error) { @@ -439,6 +444,11 @@ func getAuditFlowLog(chanceid int64) ([]protocol.ChanceFlowLog, error) {
439 return flowLogs, err 444 return flowLogs, err
440 } 445 }
441 446
  447 +func getChanceSelfChecks(chanceId int64) []ChanceSelfCheckData {
  448 + selfchecks := []ChanceSelfCheckData{}
  449 + return selfchecks
  450 +}
  451 +
442 func AllowChanceEnableStatus(chanceid int64, companyid int64) error { 452 func AllowChanceEnableStatus(chanceid int64, companyid int64) error {
443 var ( 453 var (
444 err error 454 err error