xyxie 1 月之前
父节点
当前提交
d5aef573a6
共有 2 个文件被更改,包括 8 次插入1 次删除
  1. 7 0
      models/document_manage_model/outside_report_attachment.go
  2. 1 1
      services/report_approve.go

+ 7 - 0
models/document_manage_model/outside_report_attachment.go

@@ -4,7 +4,9 @@ package document_manage_model
 import (
 	"eta/eta_api/global"
 	"eta/eta_api/utils"
+
 	"github.com/beego/beego/v2/client/orm"
+	"gorm.io/gorm"
 )
 
 type OutsideReportAttachment struct {
@@ -16,6 +18,11 @@ type OutsideReportAttachment struct {
 	FileSize                  int64  `orm:"column(file_size)" description:"附件大小"`
 }
 
+func (o *OutsideReportAttachment) AfterFind(db *gorm.DB) (err error) {
+	o.CreateTime = utils.GormDateStrToDateTimeStr(o.CreateTime)
+	return
+}
+
 // 在 init 函数中注册模型
 func init() {
 	orm.RegisterModel(new(OutsideReportAttachment))

+ 1 - 1
services/report_approve.go

@@ -177,7 +177,7 @@ func SubmitReportApprove(reportType, reportId int, reportTitle string, firstId,
 	flowPars := make([]interface{}, 0)
 	flowPars = append(flowPars, reportType, firstId, secondId, thirdId)
 	flowItem, e := flowOb.GetItemByCondition(flowCond, flowPars, "")
-	if e != nil {
+	if e != nil && !utils.IsErrNoRow(e) {
 		err = fmt.Errorf("ApproveFlow GetItemByCondition err: %s", e.Error())
 		return
 	}