feat:优化项目信息

This commit is contained in:
henry
2022-02-08 08:56:28 +08:00
parent a25464289f
commit 252182f089
13 changed files with 67 additions and 138 deletions

View File

@ -27,15 +27,15 @@ type (
PatentInfo struct {
*sys.PatentInfo
ShelfStatus model2.ShelfStatusKind
Status model2.SysParentStatus
Status model2.TechnologyPatentStatus
}
// PatentMatchInfo 专利匹配信息
PatentMatchInfo struct {
ID string `json:"id"`
Kind model2.SysParentKind `json:"kind"`
Title string `json:"title"`
Description string `json:"description"`
ApplyAt string `json:"apply_at"`
ID string `json:"id"`
Kind model2.TechnologyPatentKind `json:"kind"`
Title string `json:"title"`
Description string `json:"description"`
ApplyAt string `json:"apply_at"`
}
// PatentDetailInfo 专利详细信息
PatentDetailInfo struct {
@ -67,7 +67,7 @@ func (c *PatentParams) add(tenantID, uid uint64) error {
return errors.New("操作错误,申请号或公开(公告)号已存在")
}
return orm.GetDB().Transaction(func(tx *gorm.DB) error {
mTechnologyPatent.Kind = model2.SysParentKind(c.Kind)
mTechnologyPatent.Kind = model2.TechnologyPatentKind(c.Kind)
mTechnologyPatent.TenantID = tenantID
mTechnologyPatent.UID = uid
mTechnologyPatent.Title = c.Title
@ -82,7 +82,7 @@ func (c *PatentParams) add(tenantID, uid uint64) error {
mTechnologyPatent.Description = c.Description
mTechnologyPatent.PrincipalClaim = c.PrincipalClaim
mTechnologyPatent.IPCCode = c.IPCCode
mTechnologyPatent.Status = model2.SysParentStatus(c.Status)
mTechnologyPatent.Status = model2.TechnologyPatentStatus(c.Status)
if err = model2.Create(mTechnologyPatent.TechnologyPatent, tx); err != nil {
return err
@ -121,7 +121,7 @@ func (c *PatentParams) edit(uid uint64) error {
return errors.New("操作错误,申请号或公开(公告)号已存在")
}
}
mTechnologyPatent.Kind = model2.SysParentKind(c.Kind)
mTechnologyPatent.Kind = model2.TechnologyPatentKind(c.Kind)
mTechnologyPatent.Title = c.Title
mTechnologyPatent.FileUrl = c.FileUrl
mTechnologyPatent.ApplyCode = c.ApplyCode
@ -134,7 +134,7 @@ func (c *PatentParams) edit(uid uint64) error {
mTechnologyPatent.Description = c.Description
mTechnologyPatent.PrincipalClaim = c.PrincipalClaim
mTechnologyPatent.IPCCode = c.IPCCode
mTechnologyPatent.Status = model2.SysParentStatus(c.Status)
mTechnologyPatent.Status = model2.TechnologyPatentStatus(c.Status)
return model2.Updates(mTechnologyPatent.TechnologyPatent, mTechnologyPatent.TechnologyPatent)
}
@ -218,7 +218,7 @@ func (c *Patent) Match(title string, industrys, keywords []string) (*controller.
}
mTechnologyPatent := model.NewTechnologyPatent()
patents := make([]*model2.SysPatent, 0)
patents := make([]*model2.TechnologyPatent, 0)
if err = model2.ScanFields(mTechnologyPatent.TechnologyPatent, &patents, []string{"id", "kind", "title", "description", "apply_at"}, &model2.ModelWhereOrder{
Where: model2.NewWhereIn("id", ids),