Parcourir la source

文档管理-添加唯一编码字段

gmy il y a 8 mois
Parent
commit
c244ea20f8

+ 2 - 0
models/document_manage_model/outside_report.go

@@ -20,6 +20,7 @@ type OutsideReport struct {
 	ReportUpdateTime string `orm:"column(report_update_time)" description:"报告更新时间,如果来源于邮件,那么取邮件的收件时间"`
 	ModifyTime       string `orm:"column(modify_time)" description:"最近一次修改时间"`
 	CreateTime       string `orm:"column(create_time)" description:"创建时间"`
+	ReportCode       string `orm:"column(report_code)" description:"报告唯一编码"`
 }
 
 type OutsideReportPage struct {
@@ -37,6 +38,7 @@ type OutsideReportBO struct {
 	Content         string `orm:"column(content)" description:"报告富文本内容"`
 	SysUserId       int    `orm:"column(sys_user_id)" description:"创建人id"`
 	SysUserName     string `orm:"column(sys_user_name)" description:"创建人姓名"`
+	ReportCode      string `orm:"column(report_code)" description:"报告唯一编码"`
 	AttachmentList  []*OutsideReportAttachment
 }
 

+ 2 - 0
services/document_manage_service/document_manage_service.go

@@ -7,6 +7,7 @@ import (
 	"eta/eta_api/utils"
 	"fmt"
 	"github.com/beego/beego/v2/core/logs"
+	"github.com/google/uuid"
 	"github.com/rdlucklib/rdluck_tools/paging"
 )
 
@@ -253,6 +254,7 @@ func DocumentSave(outsideReport *document_manage_model.OutsideReportBO) error {
 		ReportUpdateTime: utils.GetCurrentTime(),
 		ModifyTime:       utils.GetCurrentTime(),
 		CreateTime:       utils.GetCurrentTime(),
+		ReportCode:       uuid.New().String(),
 	}
 	id, err := document_manage_model.SaveOutsideReport(report)
 	if err != nil {