55 lines
2.3 KiB
Go
55 lines
2.3 KiB
Go
package model
|
||
|
||
// TechnologyDemandService 技术需求服务信息
|
||
type TechnologyDemandService struct {
|
||
Model
|
||
AgentID uint64 `gorm:"column:agent_id;type:int(11);default:0;comment:经纪人模型ID" json:"-"`
|
||
DemandID uint64 `gorm:"column:demand_id;type:int(11);default:0;comment:需求ID" json:"-"`
|
||
Progress TechnologyDemandServiceProgressKind `gorm:"column:progress;type:tinyint(1);default:0;comment:进度类型" json:"progress"`
|
||
Status TechnologyDemandServiceStatus `gorm:"column:status;type:tinyint(1);default:0;comment:进度状态(0:进行中,1:已结题,2:未结题)" json:"status"`
|
||
ModelDeleted
|
||
ModelAt
|
||
}
|
||
|
||
// TechnologyDemandServiceProgressKind 技术需求服务进度类型
|
||
type TechnologyDemandServiceProgressKind int
|
||
|
||
const (
|
||
// TechnologyDemandServiceProgressKindForMemorandum 合作备忘录
|
||
TechnologyDemandServiceProgressKindForMemorandum TechnologyDemandServiceProgressKind = iota + 101
|
||
// TechnologyDemandServiceProgressKindForConfirmation 确认解决方案
|
||
TechnologyDemandServiceProgressKindForConfirmation
|
||
// TechnologyDemandServiceProgressKindForSign 签署合同
|
||
TechnologyDemandServiceProgressKindForSign
|
||
// TechnologyDemandServiceProgressKindForComplete 流程结束
|
||
TechnologyDemandServiceProgressKindForComplete
|
||
)
|
||
|
||
type TechnologyDemandServiceStatus int
|
||
|
||
const (
|
||
// TechnologyDemandServiceStatusForOngoing 进行中
|
||
TechnologyDemandServiceStatusForOngoing TechnologyDemandServiceStatus = iota
|
||
// TechnologyDemandServiceStatusForClosedQuestions 已结题
|
||
TechnologyDemandServiceStatusForClosedQuestions
|
||
// TechnologyDemandServiceStatusForOpenQuestions 未结题
|
||
TechnologyDemandServiceStatusForOpenQuestions
|
||
)
|
||
|
||
func (m *TechnologyDemandService) TableName() string {
|
||
return "technology_demand_service"
|
||
}
|
||
|
||
func (m *TechnologyDemandService) NextProgress() TechnologyDemandServiceProgressKind {
|
||
if m.Progress == TechnologyDemandServiceProgressKindForMemorandum {
|
||
return TechnologyDemandServiceProgressKindForConfirmation
|
||
} else if m.Progress == TechnologyDemandServiceProgressKindForConfirmation {
|
||
return TechnologyDemandServiceProgressKindForSign
|
||
}
|
||
return TechnologyDemandServiceProgressKindForComplete
|
||
}
|
||
|
||
func NewTechnologyDemandService() *TechnologyDemandService {
|
||
return &TechnologyDemandService{}
|
||
}
|