|
@@ -400,7 +400,7 @@ func (this *ReportOpenController) ReportApprove() {
|
|
|
if req.ApproveType == 1 {
|
|
|
// 审批通过,将PPT或研报加入报告库中
|
|
|
go func() {
|
|
|
- msg, err := knowledge.ReportKnowledgeResourceAdd(v.Title, []string{v.DetailPdfUrl}, v.AdminId, v.AdminRealName, "市场研究报告/内部报告/日常报告", "市场信息研究所", time.Now())
|
|
|
+ msg, err := knowledge.ReportKnowledgeResourceAdd(v.Title, []string{v.DetailPdfUrl}, v.AdminId, v.AdminRealName, "市场研究报告/内部报告/日常报告", "市场信息研究所", time.Now(), "")
|
|
|
if err != nil {
|
|
|
utils.FileLog.Error(fmt.Sprintf("ReportKnowledgeResourceAdd-报告知识资源库添加失败,reportId:%d,msg:%s,err: %v", v.Id, msg, err))
|
|
|
return
|
|
@@ -519,7 +519,7 @@ func (this *ReportOpenController) ReportApprove() {
|
|
|
if req.ApproveType == 1 {
|
|
|
// 审批通过,将PPT或研报加入报告库中
|
|
|
go func() {
|
|
|
- msg, err := knowledge.ReportKnowledgeResourceAdd(v.Title, []string{v.PptxUrl}, v.AdminId, v.AdminRealName, "市场研究报告/内部报告/日常报告", "市场信息研究所", time.Now())
|
|
|
+ msg, err := knowledge.ReportKnowledgeResourceAdd(v.Title, []string{v.PptxUrl}, v.AdminId, v.AdminRealName, "市场研究报告/内部报告/日常报告", "市场信息研究所", time.Now(), "")
|
|
|
if err != nil {
|
|
|
utils.FileLog.Error(fmt.Sprintf("ReportKnowledgeResourceAdd-PPT知识资源报告库添加失败,pptId:%d,msg:%s,err: %v", v.PptId, msg, err))
|
|
|
return
|
|
@@ -821,6 +821,27 @@ func (this *ReportOpenController) ReportKnowledgeUpload() {
|
|
|
br.Msg = "发布时间格式不正确"
|
|
|
return
|
|
|
}
|
|
|
+ fmt.Printf("ReportKnowledgeUpload EmailUid: %s\n", req.EmailUid)
|
|
|
+
|
|
|
+ // 校验邮件UID是否已存在,若已存在那么不再重复上传和生成
|
|
|
+ if req.EmailUid != "" {
|
|
|
+ resourceOb := new(models.KnowledgeResource)
|
|
|
+ var cond string
|
|
|
+ var pars []interface{}
|
|
|
+ cond += ` AND email_uid = ?`
|
|
|
+ pars = append(pars, req.EmailUid)
|
|
|
+ count, e := resourceOb.GetCountByCondition(cond, pars)
|
|
|
+ if e != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if count > 0 {
|
|
|
+ br.Ret = 200
|
|
|
+ br.Msg = "邮件资源已上传,忽略"
|
|
|
+ br.Success = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
fileUrls, msg, err := knowledge.UploadFormFile(this.Ctx.Request.MultipartForm.File)
|
|
|
if err != nil {
|
|
|
if msg == "" {
|
|
@@ -830,7 +851,7 @@ func (this *ReportOpenController) ReportKnowledgeUpload() {
|
|
|
br.ErrMsg = fmt.Sprintf("上传失败, %v", err)
|
|
|
return
|
|
|
}
|
|
|
- msg, err = knowledge.ReportKnowledgeResourceAdd(req.Title, fileUrls, 0, "", req.ClassifyPath, req.Source, pushTime)
|
|
|
+ msg, err = knowledge.ReportKnowledgeResourceAdd(req.Title, fileUrls, 0, "", req.ClassifyPath, req.Source, pushTime, req.EmailUid)
|
|
|
if err != nil {
|
|
|
if msg == "" {
|
|
|
msg = "保存失败"
|