作者 yangfu

修改 机会详情返回部门信息/保存草稿(非必填部门)

@@ -649,6 +649,7 @@ type ChanceItem struct { @@ -649,6 +649,7 @@ type ChanceItem struct {
649 Videos []Video `json:"videos"` 649 Videos []Video `json:"videos"`
650 650
651 PublicStatus int `json:"-"` //publicStatus 651 PublicStatus int `json:"-"` //publicStatus
  652 + RelatedDepartmentId int64 `json:"relatedDepartments" valid:"Required"` //关联部门编号
652 RelatedDepartmentInfo *Dep `json:"relatedDepartment,omitempty"` 653 RelatedDepartmentInfo *Dep `json:"relatedDepartment,omitempty"`
653 } 654 }
654 type ChanceData struct { 655 type ChanceData struct {
@@ -2013,7 +2013,8 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail @@ -2013,7 +2013,8 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail
2013 //jsonUnmarshal(chance.SelfChecks, &item.SelfChecks) 2013 //jsonUnmarshal(chance.SelfChecks, &item.SelfChecks)
2014 item.SelfChecks = agg.GetChanceSelfChecks(chance) 2014 item.SelfChecks = agg.GetChanceSelfChecks(chance)
2015 item.FormList = clearEmptyForm(item.FormList) 2015 item.FormList = clearEmptyForm(item.FormList)
2016 - 2016 + item.RelatedDepartmentId = chance.DepartmentId
  2017 + item.RelatedDepartmentInfo = agg.GetDepartment(int(chance.DepartmentId))
2017 if chanceData, err = models.GetChanceDataByChanceId(chance.Id); err == nil { 2018 if chanceData, err = models.GetChanceDataByChanceId(chance.Id); err == nil {
2018 if len(chanceData.Videos) > 0 { 2019 if len(chanceData.Videos) > 0 {
2019 chanceData.Videos = strings.ReplaceAll(chanceData.Videos, "https", "http") 2020 chanceData.Videos = strings.ReplaceAll(chanceData.Videos, "https", "http")
@@ -2089,6 +2090,7 @@ func ChanceDraftDetail(header *protocol.RequestHeader, request *protocol.ChanceD @@ -2089,6 +2090,7 @@ func ChanceDraftDetail(header *protocol.RequestHeader, request *protocol.ChanceD
2089 CreateTime: chance.CreateAt.Unix() * 1000, 2090 CreateTime: chance.CreateAt.Unix() * 1000,
2090 UpdateTime: chance.UpdateAt.Unix() * 1000, 2091 UpdateTime: chance.UpdateAt.Unix() * 1000,
2091 } 2092 }
  2093 + item.RelatedDepartmentId = chance.DepartmentId
2092 item.RelatedDepartmentInfo = agg.GetDepartment(int(chance.DepartmentId)) 2094 item.RelatedDepartmentInfo = agg.GetDepartment(int(chance.DepartmentId))
2093 jsonUnmarshal(chance.SourceContent, &item.FormList) 2095 jsonUnmarshal(chance.SourceContent, &item.FormList)
2094 jsonUnmarshal(chance.SelfChecks, &item.SelfChecks) 2096 jsonUnmarshal(chance.SelfChecks, &item.SelfChecks)