feat:完善入驻信息管理
This commit is contained in:
@ -120,7 +120,7 @@ func (c *Instance) Form(params *InstanceParams) error {
|
||||
func (c *Instance) Shelf(id uint64, status int) error {
|
||||
mTechnologyInstance := model.NewTechnologyInstance()
|
||||
mTechnologyInstance.ID = id
|
||||
isExist, err := model2.FirstField(mTechnologyInstance.TechnologyInstance, []string{"id", "uid", "shelf", "status"})
|
||||
isExist, err := model2.FirstField(mTechnologyInstance.TechnologyInstance, []string{"id", "uid", "shelf_status", "status"})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@ -130,11 +130,11 @@ func (c *Instance) Shelf(id uint64, status int) error {
|
||||
return errors.New("操作错误,无权限操作")
|
||||
} else if mTechnologyInstance.Status != model2.TechnologyInstanceStatusForAgree {
|
||||
return errors.New("操作错误,当前状态不允许处理上下架")
|
||||
} else if mTechnologyInstance.ShelfStatus.Shelf == model2.ShelfStatusKind(status) {
|
||||
} else if mTechnologyInstance.Shelf.ShelfStatus == model2.ShelfStatusKind(status) {
|
||||
return errors.New("操作错误,状态异常")
|
||||
}
|
||||
if err = model2.Updates(mTechnologyInstance.TechnologyInstance, map[string]interface{}{
|
||||
"shelf": status, "updated_at": time.Now(),
|
||||
"shelf_status": status, "updated_at": time.Now(),
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ type (
|
||||
// PatentInfo 专利信息
|
||||
PatentInfo struct {
|
||||
*sys.PatentInfo
|
||||
Shelf model2.ShelfStatusKind
|
||||
Status model2.SysParentStatus
|
||||
ShelfStatus model2.ShelfStatusKind
|
||||
Status model2.SysParentStatus
|
||||
}
|
||||
// PatentDetailInfo 专利详细信息
|
||||
PatentDetailInfo struct {
|
||||
@ -176,7 +176,7 @@ func (c *Patent) List(kind int, title, applyCode, openCode, ipcCode string, page
|
||||
ID: v.GetEncodeID(), Title: v.Title, ApplyCode: v.ApplyCode, ApplyName: v.ApplyName,
|
||||
ApplyAt: v.ApplyAt, Inventor: v.Inventor,
|
||||
},
|
||||
Shelf: v.Shelf, Status: v.Status,
|
||||
ShelfStatus: v.ShelfStatus, Status: v.Status,
|
||||
})
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
|
@ -149,7 +149,7 @@ func (c *Product) Shelf(id uint64, status int) error {
|
||||
mTechnologyProduct := model.NewTechnologyProduct()
|
||||
mTechnologyProduct.ID = id
|
||||
|
||||
isExist, err := model2.FirstField(mTechnologyProduct.TechnologyProduct, []string{"id", "uid", "status"})
|
||||
isExist, err := model2.FirstField(mTechnologyProduct.TechnologyProduct, []string{"id", "uid", "shelf_status", "status"})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@ -157,11 +157,11 @@ func (c *Product) Shelf(id uint64, status int) error {
|
||||
return errors.New("操作错误,产品信息不存在或已被删除")
|
||||
} else if mTechnologyProduct.UID != c.UID {
|
||||
return errors.New("无权限操作")
|
||||
} else if mTechnologyProduct.ShelfStatus.Shelf == model2.ShelfStatusKind(status) {
|
||||
} else if mTechnologyProduct.ShelfStatus == model2.ShelfStatusKind(status) {
|
||||
return errors.New("操作错误,无需变更上下架状态")
|
||||
}
|
||||
return model2.Updates(mTechnologyProduct.TechnologyProduct, map[string]interface{}{
|
||||
"shelf": status, "updated_at": time.Now(),
|
||||
"shelf_status": status, "updated_at": time.Now(),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ func (c *Project) Shelf(id uint64, status int) error {
|
||||
mSysPatent.ID = mUserPatent.PatentID
|
||||
|
||||
return model2.Updates(mSysPatent.SysPatent, map[string]interface{}{
|
||||
"shelf": status, "updated_at": time.Now(),
|
||||
"shelf_status": status, "updated_at": time.Now(),
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user