2021-10-09 11:55:54 +08:00
|
|
|
|
package model
|
|
|
|
|
|
2021-10-12 11:40:02 +08:00
|
|
|
|
import "SciencesServer/utils"
|
|
|
|
|
|
|
|
|
|
// TechnologyInstance 技术文档数据模型
|
2021-10-09 11:55:54 +08:00
|
|
|
|
type TechnologyInstance struct {
|
2021-10-12 11:40:02 +08:00
|
|
|
|
Model
|
|
|
|
|
ModelTenant
|
|
|
|
|
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
|
|
|
|
PatentID uint64 `gorm:"column:patent_id;type:int;default:0;comment:代表专利" json:"patent_id"`
|
|
|
|
|
Title string `gorm:"column:title;type:varchar(30);default:null;comment:名称" json:"title"`
|
|
|
|
|
Company string `gorm:"column:company;type:varchar(30);default:null;comment:单位" json:"company"`
|
|
|
|
|
Maturity TechnologyInstanceMaturity `gorm:"column:maturity;type:tinyint(1);default:0;comment:成熟度" json:"maturity"`
|
|
|
|
|
Prototype int `gorm:"column:prototype;type:tinyint(1);default:0;comment:样机(0:无,1:有)" json:"prototype"`
|
|
|
|
|
Product string `gorm:"column:product;type:varchar(255);default:null;comment:应用产品" json:"product"`
|
|
|
|
|
Source TechnologyInstanceSource `gorm:"column:source;type:tinyint(1);default:0;comment:来源" json:"source"`
|
|
|
|
|
Keyword string `gorm:"column:keyword;type:varchar(255);default:null;comment:关键词" json:"keyword"`
|
|
|
|
|
Territory uint64 `gorm:"column:territory;type:int(11);default:0;comment:技术领域" json:"territory"`
|
|
|
|
|
Transaction int `gorm:"column:transaction;type:tinyint(3);default:0;comment:交易方式" json:"transaction"`
|
|
|
|
|
Images
|
|
|
|
|
ProveImages string `gorm:"column:prove_images;type:text;default:null;comment:证明材料图片" json:"prove_images"`
|
|
|
|
|
Introduce string `gorm:"column:introduce;type:text;comment:介绍描述" json:"introduce"`
|
|
|
|
|
Purpose string `gorm:"column:purpose;type:text;comment:意图-承担科研项目" json:"purpose"`
|
|
|
|
|
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
|
|
|
|
|
ShelfStatus
|
|
|
|
|
Status TechnologyInstanceStatus `gorm:"column:status;type:tinyint(1);default:0;comment:状态" json:"status"`
|
|
|
|
|
ModelDeleted
|
|
|
|
|
ModelAt
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TechnologyInstanceMaturity 技术文档成熟度
|
|
|
|
|
type TechnologyInstanceMaturity int
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// TechnologyInstanceMaturityForDev 正在研发
|
|
|
|
|
TechnologyInstanceMaturityForDev TechnologyInstanceMaturity = iota + 1
|
|
|
|
|
// TechnologyInstanceMaturityForTest 小试阶段
|
|
|
|
|
TechnologyInstanceMaturityForTest
|
|
|
|
|
// TechnologyInstanceMaturityForTestFinish 通过小试
|
|
|
|
|
TechnologyInstanceMaturityForTestFinish
|
|
|
|
|
// TechnologyInstanceMaturityForModerateTest 中试阶段
|
|
|
|
|
TechnologyInstanceMaturityForModerateTest
|
|
|
|
|
// TechnologyInstanceMaturityForModerateTestFinish 通过中试
|
|
|
|
|
TechnologyInstanceMaturityForModerateTestFinish
|
|
|
|
|
// TechnologyInstanceMaturityForProduce 可规模生产
|
|
|
|
|
TechnologyInstanceMaturityForProduce
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// TechnologyInstanceSource 技术来源
|
|
|
|
|
type TechnologyInstanceSource int
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// TechnologyInstanceSourceForCompany 企业
|
|
|
|
|
TechnologyInstanceSourceForCompany TechnologyInstanceSource = iota
|
|
|
|
|
// TechnologyInstanceSourceForSchool 院校
|
|
|
|
|
TechnologyInstanceSourceForSchool
|
|
|
|
|
// TechnologyInstanceSourceForResearch 科研机构
|
|
|
|
|
TechnologyInstanceSourceForResearch
|
|
|
|
|
// TechnologyInstanceSourceForPerson 个人
|
|
|
|
|
TechnologyInstanceSourceForPerson
|
|
|
|
|
// TechnologyInstanceSourceForOther 其他
|
|
|
|
|
TechnologyInstanceSourceForOther
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// TechnologyInstanceStatus 技术文档状态
|
|
|
|
|
type TechnologyInstanceStatus int
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// TechnologyInstanceStatusForDraft 草稿箱
|
|
|
|
|
TechnologyInstanceStatusForDraft TechnologyInstanceStatus = iota
|
|
|
|
|
// TechnologyInstanceStatusForExamining 审核中
|
|
|
|
|
TechnologyInstanceStatusForExamining
|
|
|
|
|
// TechnologyInstanceStatusForAgree 审核通过
|
|
|
|
|
TechnologyInstanceStatusForAgree
|
|
|
|
|
// TechnologyInstanceStatusForRefuse 审核拒绝
|
|
|
|
|
TechnologyInstanceStatusForRefuse
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (m *TechnologyInstance) TableName() string {
|
|
|
|
|
return m.NewTableName("technology_instance")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *TechnologyInstance) GetKeywordAttribute() []string {
|
|
|
|
|
keywords := make([]string, 0)
|
|
|
|
|
_ = utils.FromJSON(m.Keyword, &keywords)
|
|
|
|
|
return keywords
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *TechnologyInstance) SetKeywordAttribute(keywords []string) {
|
|
|
|
|
m.Keyword = utils.AnyToJSON(keywords)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *TechnologyInstance) GetProductAttribute() []string {
|
|
|
|
|
products := make([]string, 0)
|
|
|
|
|
_ = utils.FromJSON(m.Product, &products)
|
|
|
|
|
return products
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *TechnologyInstance) SetProductAttribute(products []string) {
|
|
|
|
|
m.Product = utils.AnyToJSON(products)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewTechnologyInstance() *TechnologyInstance {
|
|
|
|
|
return &TechnologyInstance{}
|
2021-10-09 11:55:54 +08:00
|
|
|
|
}
|