feat:完善信息

This commit is contained in:
henry
2021-10-12 13:54:05 +08:00
parent 37fd5abdac
commit 142cbcf5ae
10 changed files with 53 additions and 34 deletions

View File

@ -57,7 +57,7 @@ func (c *SettledParams) pass(uid, mUID uint64, mStatus model2.ExamineStatusKind)
func (c *Settled) Company(params *SettledParams, other *config.IdentityForCompany) error {
mManageCompany := model.NewManageCompany()
err := params.effect(c.UID, mManageCompany.ManageCompany)
err := params.effect(c.TenantUID, mManageCompany.ManageCompany)
if err != nil {
return err
@ -73,10 +73,10 @@ func (c *Settled) Company(params *SettledParams, other *config.IdentityForCompan
mManageCompany.Introduce = params.Introduce
if mManageCompany.ID <= 0 {
mManageCompany.UID = c.UID
mManageCompany.UID = c.TenantUID
return model2.Create(mManageCompany.ManageCompany)
}
if !params.pass(c.UID, mManageCompany.UID, mManageCompany.Status) {
if !params.pass(c.TenantUID, mManageCompany.UID, mManageCompany.Status) {
return errors.New("操作错误,无权限操作")
}
mManageCompany.Status = model2.ExamineStatusForOngoing
@ -87,7 +87,7 @@ func (c *Settled) Company(params *SettledParams, other *config.IdentityForCompan
func (c *Settled) Expert(params *SettledParams, other *config.IdentityForExpert) error {
mManageExpert := model.NewManageExpert()
err := params.effect(c.UID, mManageExpert.ManageExpert)
err := params.effect(c.TenantUID, mManageExpert.ManageExpert)
if err != nil {
return err
@ -108,10 +108,10 @@ func (c *Settled) Expert(params *SettledParams, other *config.IdentityForExpert)
mManageExpert.Research = utils.AnyToJSON(other.Research)
if mManageExpert.ID <= 0 {
mManageExpert.UID = c.UID
mManageExpert.UID = c.TenantUID
return model2.Create(mManageExpert.ManageExpert)
}
if !params.pass(c.UID, mManageExpert.UID, mManageExpert.Status) {
if !params.pass(c.TenantUID, mManageExpert.UID, mManageExpert.Status) {
return errors.New("操作错误,无权限操作")
}
mManageExpert.Status = model2.ExamineStatusForOngoing
@ -122,7 +122,7 @@ func (c *Settled) Expert(params *SettledParams, other *config.IdentityForExpert)
func (c *Settled) Research(params *SettledParams, other *config.IdentityForResearch) error {
mManageResearch := model.NewManageResearch()
err := params.effect(c.UID, mManageResearch.ManageResearch)
err := params.effect(c.TenantUID, mManageResearch.ManageResearch)
if err != nil {
return err
@ -137,10 +137,10 @@ func (c *Settled) Research(params *SettledParams, other *config.IdentityForResea
mManageResearch.Research = other.Research
if mManageResearch.ID <= 0 {
mManageResearch.UID = c.UID
mManageResearch.UID = c.TenantUID
return model2.Create(mManageResearch.ManageResearch)
}
if !params.pass(c.UID, mManageResearch.UID, mManageResearch.Status) {
if !params.pass(c.TenantUID, mManageResearch.UID, mManageResearch.Status) {
return errors.New("操作错误,无权限操作")
}
mManageResearch.Status = model2.ExamineStatusForOngoing
@ -151,7 +151,7 @@ func (c *Settled) Research(params *SettledParams, other *config.IdentityForResea
func (c *Settled) Laboratory(params *SettledParams, other *config.IdentityForLaboratory) error {
mManageLaboratory := model.NewManageLaboratory()
err := params.effect(c.UID, mManageLaboratory.ManageLaboratory)
err := params.effect(c.TenantUID, mManageLaboratory.ManageLaboratory)
if err != nil {
return err
@ -169,10 +169,10 @@ func (c *Settled) Laboratory(params *SettledParams, other *config.IdentityForLab
mManageLaboratory.Research = utils.AnyToJSON(other.Research)
if mManageLaboratory.ID <= 0 {
mManageLaboratory.UID = c.UID
mManageLaboratory.UID = c.TenantUID
return model2.Create(mManageLaboratory.ManageLaboratory)
}
if !params.pass(c.UID, mManageLaboratory.UID, mManageLaboratory.Status) {
if !params.pass(c.TenantUID, mManageLaboratory.UID, mManageLaboratory.Status) {
return errors.New("操作错误,无权限操作")
}
mManageLaboratory.Status = model2.ExamineStatusForOngoing