feat:完善项目信息

This commit is contained in:
henry
2022-01-20 11:09:29 +08:00
parent bbbfab5b4d
commit 9348c8970c
7 changed files with 37 additions and 16 deletions

View File

@ -138,6 +138,8 @@ func (c *Company) Form(params *BasicParams, other *config.IdentityForCompany) er
mManageCompany.Name = params.Name
mManageCompany.Code = params.Code
mManageCompany.License = other.FilterLicense()
mManageCompany.ExamineStatus = model2.ExamineStatusForAgree
mManageCompany.ExamineRemark = "主动创建,无需审核"
if isExist, err := params.isExist(mManageCompany.ManageCompany, model2.NewWhere("tenant_id", params.TenantID),
model2.NewWhere("code", params.Code)); err != nil {

View File

@ -167,7 +167,7 @@ func examineAgent(id, tenantID uint64) (*ExamineManageInfo, error) {
}
// Launch 发起审核
func (c *Examine) Launch(id uint64, identity, status int, params map[string]interface{}) error {
func (c *Examine) Launch(id uint64, identity, status int, remark string, params map[string]interface{}) error {
_status := model2.ExamineStatusKind(status)
if _status != model2.ExamineStatusForRefuse && _status != model2.ExamineStatusForAgree {
@ -184,7 +184,7 @@ func (c *Examine) Launch(id uint64, identity, status int, params map[string]inte
return err
}
return orm.GetDB().Transaction(func(tx *gorm.DB) error {
values := map[string]interface{}{"examine_status": status, "updated_at": time.Now()}
values := map[string]interface{}{"examine_status": status, "examine_remark": remark, "updated_at": time.Now()}
if identity == config.TenantUserIdentityForCompany {
for k, v := range params {

View File

@ -21,12 +21,14 @@ type ExpertHandle func(session *session.Admin) *Expert
type (
// ExpertInstance 专家信息
ExpertInstance struct {
ID string `json:"id"`
Name string `json:"name"`
Industrys []string `json:"industrys"`
ResearchName string `json:"research_name"`
LaboratoryName string `json:"laboratory_name"`
Address string `json:"address"`
ID string `json:"id"`
Name string `json:"name"`
Industrys []string `json:"industrys"`
ResearchName string `json:"research_name"`
LaboratoryName string `json:"laboratory_name"`
AchievementCount int `json:"achievement_count"`
PatentCount int `json:"patent_count"`
Address string `json:"address"`
model2.Examine
CreatedAt time.Time `json:"created_at"`
Area string `json:"area"`
@ -78,6 +80,7 @@ func (c *Expert) Instance(tenantID uint64, name string, examineStatus int, page,
}
// 研究机构,实验室
list = append(list, &ExpertInstance{ID: v.GetEncodeID(), Name: v.Name, Industrys: _industrys,
AchievementCount: v.AchievementCount, PatentCount: v.PatentCount,
ResearchName: v.ResearchName, LaboratoryName: v.LaboratoryName, Examine: v.Examine,
Address: v.FormatBasic(), CreatedAt: v.CreatedAt, Area: (&model2.Area{
Province: v.TenantProvince,
@ -173,7 +176,8 @@ func (c *Expert) Form(params *BasicParams, other *config.IdentityForExpert) erro
// 查询手机号码是否在当前租户下是否已经注册了
mManageExpert.Name = params.Name
mManageExpert.Mobile = params.Mobile
mManageExpert.ExamineStatus = model2.ExamineStatusForOngoing
mManageExpert.ExamineStatus = model2.ExamineStatusForAgree
mManageExpert.ExamineRemark = "主动创建,无需审核"
if isExist, err := params.isExist(mManageExpert.ManageExpert, model2.NewWhere("tenant_id", params.TenantID),
model2.NewWhere("mobile", params.Mobile)); err != nil {

View File

@ -165,6 +165,8 @@ func (c *Laboratory) Form(params *BasicParams, other *config.IdentityForLaborato
}
mManageLaboratory.Name = params.Name
mManageLaboratory.Code = params.Code
mManageLaboratory.ExamineStatus = model2.ExamineStatusForAgree
mManageLaboratory.ExamineRemark = "主动创建,无需审核"
if isExist, err := params.isExist(mManageLaboratory.ManageLaboratory, model2.NewWhere("tenant_id", params.TenantID),
model2.NewWhere("code", params.Code)); err != nil {

View File

@ -154,6 +154,8 @@ func (c *Research) Form(params *BasicParams, other *config.IdentityForResearch)
mManageResearch.Name = params.Name
mManageResearch.Code = params.Code
mManageResearch.License = other.FilterLicense()
mManageResearch.ExamineStatus = model2.ExamineStatusForAgree
mManageResearch.ExamineRemark = "主动创建,无需审核"
if isExist, err := params.isExist(mManageResearch.ManageResearch, model2.NewWhere("tenant_id", params.TenantID),
model2.NewWhere("code", params.Code)); err != nil {