feat:优化项目信息,待测试修改

This commit is contained in:
henry
2022-02-06 18:01:32 +08:00
parent c8578940bf
commit a25464289f
25 changed files with 404 additions and 483 deletions

View File

@ -64,7 +64,6 @@ func (this *Instance) Handle() {
&synchronized{iModel: model.NewSysPatent(), iValues: func() interface{} {
return nil
}},
&synchronized{iModel: model.NewSysPatentClassify()},
&synchronized{iModel: model.NewSysIdentity(), iValues: func() interface{} {
out := make([]*model.SysIdentity, 0)
@ -127,8 +126,7 @@ func (this *Instance) Handle() {
&synchronized{iModel: model.NewSysUserExamineLog()},
// 用户管理
&synchronized{iModel: model.NewUserInstance()}, &synchronized{iModel: model.NewUserIdentity()},
&synchronized{iModel: model.NewUserAssets()},
&synchronized{iModel: model.NewUserPatent()}, &synchronized{iModel: model.NewUserBank()},
&synchronized{iModel: model.NewUserAssets()}, &synchronized{iModel: model.NewUserBank()},
&synchronized{iModel: model.NewUserCompany()}, &synchronized{iModel: model.NewUserExpert()},
&synchronized{iModel: model.NewUserLaboratory()}, &synchronized{iModel: model.NewUserResearch()},
&synchronized{iModel: model.NewUserAgent()},
@ -142,6 +140,7 @@ func (this *Instance) Handle() {
&synchronized{iModel: model.NewTechnologyPaper()}, &synchronized{iModel: model.NewTechnologyProduct()},
&synchronized{iModel: model.NewTechnologyProject()}, &synchronized{iModel: model.NewTechnologyTopic()},
&synchronized{iModel: model.NewTechnologyDemandService()}, &synchronized{iModel: model.NewTechnologyDemandServiceProgress()},
&synchronized{iModel: model.NewTechnologyPatent()}, &synchronized{iModel: model.NewTechnologyPatentClassify()},
&synchronized{iModel: model.NewServiceDocking()},
&synchronized{iModel: model.NewServiceMessage()}, &synchronized{iModel: model.NewServiceMessageLog()},
&synchronized{iModel: model.NewServiceSolutionCase()}, &synchronized{iModel: model.NewServiceSolutionCaseKind()},

View File

@ -4,6 +4,7 @@ package model
type SysPatent struct {
Model
ModelTenant
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Kind SysParentKind `gorm:"column:kind;index:idx_sys_patent_kind;type:tinyint(1);default:0;comment:专利类型" json:"kind"`
Title string `gorm:"column:title;type:varchar(100);default:'';comment:名称标题" json:"title"`
FileUrl string `gorm:"column:file_url;type:varchar(255);default:'';comment:文件地址" json:"file_url"`

View File

@ -0,0 +1,68 @@
package model
// TechnologyPatent 专利信息数据模型
type TechnologyPatent struct {
Model
ModelTenant
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
Kind SysParentKind `gorm:"column:kind;index:idx_sys_patent_kind;type:tinyint(1);default:0;comment:专利类型" json:"kind"`
Title string `gorm:"column:title;type:varchar(100);default:'';comment:名称标题" json:"title"`
FileUrl string `gorm:"column:file_url;type:varchar(255);default:'';comment:文件地址" json:"file_url"`
ApplyCode string `gorm:"column:apply_code;type:varchar(30);default:'';comment:申请号" json:"apply_code"`
ApplyAt string `gorm:"column:apply_at;type:varchar(10);default:'';comment:申请日" json:"apply_at"`
OpenCode string `gorm:"column:open_code;type:varchar(30);default:'';comment:公开(公告)号" json:"open_code"`
OpenAt string `gorm:"column:open_at;type:varchar(10);default:'';comment:公开(公告)日" json:"open_at"`
ApplyName string `gorm:"column:apply_name;type:varchar(255);default:'';comment:申请(专利权)人" json:"apply_name"`
ApplyAddress string `gorm:"column:apply_address;type:varchar(255);default:'';comment:申请人地址" json:"apply_address"`
Inventor string `gorm:"column:inventor;type:varchar(255);default:'';comment:发明人" json:"inventor"`
Description string `gorm:"column:description;type:text;comment:摘要" json:"description"`
PrincipalClaim string `gorm:"column:principal_claim;type:text;comment:主权项" json:"principal_claim"`
IPCCode string `gorm:"column:ipc_code;index:idx_sys_patent_ipc_code;type:varchar(30);default:'';comment:IPC主分类号" json:"ipc_code"`
Shelf
Status SysParentStatus `gorm:"column:status;type:tinyint(1);default:1;comment:专利状态(1授权2实审3公开)" json:"-"`
ModelDeleted
ModelAt
}
// TechnologyPatentKind 专利类型
type TechnologyPatentKind int
const (
// TechnologyPatentKindForInvent 发明专利
TechnologyPatentKindForInvent TechnologyPatentKind = iota + 1
// TechnologyPatentKindForDesign 外观设计
TechnologyPatentKindForDesign
// TechnologyPatentKindForNewPractical 实用新型
TechnologyPatentKindForNewPractical
)
// TechnologyPatentStatus 专利状态
type TechnologyPatentStatus int
const (
// TechnologyPatentStatusForAuthorize 授权
TechnologyPatentStatusForAuthorize TechnologyPatentStatus = iota + 1
// TechnologyPatentStatusForActualTrial 实审
TechnologyPatentStatusForActualTrial
// TechnologyPatentStatusForPublic 公开
TechnologyPatentStatusForPublic
)
func (m *TechnologyPatent) TableName() string {
return "technology_patent"
}
func (m *TechnologyPatent) KindTitle() string {
if m.Kind == SysParentKindForInvent {
return "发明专利"
} else if m.Kind == SysParentKindForDesign {
return "外观设计"
} else if m.Kind == SysParentKindForNewPractical {
return "实用新型"
}
return "未知"
}
func NewTechnologyPatent() *TechnologyPatent {
return &TechnologyPatent{}
}

View File

@ -4,8 +4,8 @@ import (
"encoding/json"
)
// SysPatentClassify 专利分类信息数据模型
type SysPatentClassify struct {
// TechnologyPatentClassify 专利分类信息数据模型
type TechnologyPatentClassify struct {
Model
ParentID uint64 `gorm:"column:parent_id;type:int;default:0;comment:父级ID" json:"parent_id"`
IPC string `gorm:"column:ipc;type:varchar(18);default:'';comment:IPC主分类号" json:"ipc"`
@ -15,32 +15,32 @@ type SysPatentClassify struct {
ModelAt
}
func (m *SysPatentClassify) TableName() string {
return "sys_patent_classify"
func (m *TechnologyPatentClassify) TableName() string {
return "technology_patent_classify"
}
func (m *SysPatentClassify) GetIndustryAttribute() []string {
func (m *TechnologyPatentClassify) GetIndustryAttribute() []string {
out := make([]string, 0)
_ = json.Unmarshal([]byte(m.Industry), &out)
return out
}
func (m *SysPatentClassify) SetIndustryAttribute(value []string) {
func (m *TechnologyPatentClassify) SetIndustryAttribute(value []string) {
_bytes, _ := json.Marshal(value)
m.Industry = string(_bytes)
}
func (m *SysPatentClassify) GetIndustryDetailAttribute() []string {
func (m *TechnologyPatentClassify) GetIndustryDetailAttribute() []string {
out := make([]string, 0)
_ = json.Unmarshal([]byte(m.IndustryDetail), &out)
return out
}
func (m *SysPatentClassify) SetIndustryDetailAttribute(value []string) {
func (m *TechnologyPatentClassify) SetIndustryDetailAttribute(value []string) {
_bytes, _ := json.Marshal(value)
m.IndustryDetail = string(_bytes)
}
func NewSysPatentClassify() *SysPatentClassify {
return &SysPatentClassify{}
func NewTechnologyPatentClassify() *TechnologyPatentClassify {
return &TechnologyPatentClassify{}
}

View File

@ -1,18 +0,0 @@
package model
// UserPatent 用户专利信息数据模型
type UserPatent struct {
Model
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
PatentID uint64 `gorm:"column:patent_id;type:int(11);default:0;comment:专利ID" json:"-"`
ModelDeleted
ModelAt
}
func (m *UserPatent) TableName() string {
return "user_patent"
}
func NewUserPatent() *UserPatent {
return &UserPatent{}
}