feat:完善项目信息

This commit is contained in:
henry
2022-01-21 11:42:58 +08:00
parent dda20eb011
commit 1c027dd2d1
23 changed files with 125 additions and 113 deletions

View File

@ -161,8 +161,8 @@ func (c *Achievement) Form(params *AchievementParams) error {
return errors.New("操作错误,成果信息不存在或已被删除")
} else if mTechnologyAchievement.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyAchievement.Status != model2.TechnologyAchievementStatusForRefuse &&
mTechnologyAchievement.Status != model2.TechnologyAchievementStatusForDraft {
} else if mTechnologyAchievement.Status != model2.TechnologyStatusKindForRefuse &&
mTechnologyAchievement.Status != model2.TechnologyStatusKindForDraft {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -180,14 +180,14 @@ func (c *Achievement) Form(params *AchievementParams) error {
mTechnologyAchievement.Source = params.Source
if mTechnologyAchievement.ID > 0 {
mTechnologyAchievement.Status = model2.TechnologyAchievementStatusForExamining
mTechnologyAchievement.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyAchievement.TechnologyAchievement, mTechnologyAchievement.TechnologyAchievement)
}
mTechnologyAchievement.TenantID = c.tenantID
mTechnologyAchievement.UID = c.UID
if params.IsSubmit > 0 {
mTechnologyAchievement.Status = model2.TechnologyAchievementStatusForExamining
mTechnologyAchievement.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyAchievement.TechnologyAchievement)
}

View File

@ -119,8 +119,8 @@ func (c *Demand) Form(params *DemandParams) error {
return errors.New("操作错误,需求信息不存在或已被删除")
} else if mTechnologyDemand.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyDemand.Status != model2.TechnologyDemandStatusForRefuse &&
mTechnologyDemand.Status != model2.TechnologyDemandStatusForDraft {
} else if mTechnologyDemand.Status != model2.TechnologyStatusKindForRefuse &&
mTechnologyDemand.Status != model2.TechnologyStatusKindForDraft {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -145,14 +145,14 @@ func (c *Demand) Form(params *DemandParams) error {
},
})
if mTechnologyDemand.ID > 0 {
mTechnologyDemand.Status = model2.TechnologyDemandStatusForExamining
mTechnologyDemand.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyDemand.TechnologyDemand, mTechnologyDemand.TechnologyDemand)
}
mTechnologyDemand.UID = c.UID
mTechnologyDemand.TenantID = c.tenantID
if params.IsSubmit > 0 {
mTechnologyDemand.Status = model2.TechnologyDemandStatusForExamining
mTechnologyDemand.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyDemand.TechnologyDemand)
}

View File

@ -78,8 +78,8 @@ func (c *Instance) Form(params *InstanceParams) error {
return errors.New("操作错误,技术信息不存在或已被删除")
} else if c.UID != mTechnologyInstance.UID {
return errors.New("操作错误,无权限操作")
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForDraft &&
mTechnologyInstance.Status != model2.TechnologyInstanceStatusForRefuse {
} else if mTechnologyInstance.Status != model2.TechnologyStatusKindForDraft &&
mTechnologyInstance.Status != model2.TechnologyStatusKindForRefuse {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -99,19 +99,19 @@ func (c *Instance) Form(params *InstanceParams) error {
mTechnologyInstance.Purpose = params.Purpose
mTechnologyInstance.Remark = params.Remark
if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForDraft &&
mTechnologyInstance.Status != model2.TechnologyInstanceStatusForExamining {
if mTechnologyInstance.Status != model2.TechnologyStatusKindForDraft &&
mTechnologyInstance.Status != model2.TechnologyStatusKindForExamining {
return errors.New("操作错误,状态参数错误")
}
if params.ID > 0 {
mTechnologyInstance.Status = model2.TechnologyInstanceStatusForExamining
mTechnologyInstance.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyInstance.TechnologyInstance, mTechnologyInstance.TechnologyInstance)
}
mTechnologyInstance.UID = c.UID
mTechnologyInstance.TenantID = c.tenantID
if params.IsSubmit > 0 {
mTechnologyInstance.Status = model2.TechnologyInstanceStatusForExamining
mTechnologyInstance.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyInstance.TechnologyInstance)
}
@ -128,7 +128,7 @@ func (c *Instance) Shelf(id uint64, status int) error {
return errors.New("信息不存在")
} else if c.UID != mTechnologyInstance.UID {
return errors.New("操作错误,无权限操作")
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForAgree {
} else if mTechnologyInstance.Status != model2.TechnologyStatusKindForAgree {
return errors.New("操作错误,当前状态不允许处理上下架")
} else if mTechnologyInstance.Shelf.ShelfStatus == model2.ShelfStatusKind(status) {
return errors.New("操作错误,状态异常")

View File

@ -184,8 +184,8 @@ func (c *Product) Form(params *ProductParams) error {
return errors.New("操作错误,产品信息不存在或已被删除")
} else if mTechnologyProduct.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyProduct.Status != model2.TechnologyProductStatusForRefuse &&
mTechnologyProduct.Status != model2.TechnologyProductStatusForDraft {
} else if mTechnologyProduct.Status != model2.TechnologyStatusKindForRefuse &&
mTechnologyProduct.Status != model2.TechnologyStatusKindForDraft {
return errors.New("操作错误,当前状态不允许修改")
}
}
@ -202,14 +202,14 @@ func (c *Product) Form(params *ProductParams) error {
mTechnologyProduct.Introduce = params.Introduce
if mTechnologyProduct.ID > 0 {
mTechnologyProduct.Status = model2.TechnologyProductStatusForExamining
mTechnologyProduct.Status = model2.TechnologyStatusKindForExamining
return model2.Updates(mTechnologyProduct.TechnologyProduct, mTechnologyProduct.TechnologyProduct)
}
mTechnologyProduct.TenantID = c.tenantID
mTechnologyProduct.UID = c.UID
if params.IsSubmit > 0 {
mTechnologyProduct.Status = model2.TechnologyProductStatusForExamining
mTechnologyProduct.Status = model2.TechnologyStatusKindForExamining
}
return model2.Create(mTechnologyProduct.TechnologyProduct)
}

View File

@ -102,8 +102,8 @@ func (c *Topic) Form(params *TopicParams) error {
return errors.New("操作错误,课题信息不存在")
} else if mTechnologyTopic.UID != c.UID {
return errors.New("无权限操作")
} else if mTechnologyTopic.Status != model2.TechnologyTopicStatusForDraft &&
mTechnologyTopic.Status != model2.TechnologyTopicStatusForRefuse {
} else if mTechnologyTopic.Status != model2.TechnologyStatusKindForDraft &&
mTechnologyTopic.Status != model2.TechnologyStatusKindForRefuse {
return errors.New("操作错误,当前状态不允许修改")
}
}