feat:完善项目信息

This commit is contained in:
henry
2022-01-21 14:16:48 +08:00
parent 1c027dd2d1
commit adb5bd7283
9 changed files with 158 additions and 8 deletions

View File

@ -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()