feat:完善项目信息
This commit is contained in:
@ -85,6 +85,27 @@ func (c *Demand) Detail(id uint64) (*DemandDetailInfo, error) {
|
||||
}, err
|
||||
}
|
||||
|
||||
// Examine 审核操作
|
||||
func (c *Demand) Examine(id uint64, status int, remark string) error {
|
||||
mTechnologyDemand := model.NewTechnologyDemand()
|
||||
mTechnologyDemand.ID = id
|
||||
|
||||
isExist, err := model2.FirstField(mTechnologyDemand.TechnologyDemand, []string{"id", "tenant_id", "status"})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
} else if !isExist {
|
||||
return errors.New("操作错误,需求信息不存在或已被删除")
|
||||
}
|
||||
if c.TenantID > 0 && mTechnologyDemand.TenantID != c.TenantID {
|
||||
return errors.New("操作错误,无权限操作")
|
||||
}
|
||||
if mTechnologyDemand.Status != model2.TechnologyStatusKindForExamining {
|
||||
return errors.New("操作错误,当前需求状态不允许审核")
|
||||
}
|
||||
return handleExamine(mTechnologyDemand.TechnologyDemand, c.UID, model2.SysUserExamineLogKindForDemandTechnology, status, remark)
|
||||
}
|
||||
|
||||
// Delete 删除操作
|
||||
func (c *Demand) Delete(id uint64) error {
|
||||
mTechnologyDemand := model.NewTechnologyDemand()
|
||||
|
Reference in New Issue
Block a user