feat:完善项目信息
This commit is contained in:
@ -28,7 +28,8 @@ type (
|
||||
manageExamineForm struct {
|
||||
api.IDStringForm
|
||||
Identity int
|
||||
Status int `json:"status" form:"status" binding:"required"`
|
||||
Status int `json:"status" form:"status" binding:"required"`
|
||||
Remark string `json:"remark" form:"remark"`
|
||||
}
|
||||
)
|
||||
|
||||
@ -41,7 +42,7 @@ func (c *manageForm) bind() *manage.BasicParams {
|
||||
|
||||
// handle 审核处理
|
||||
func (a *manageExamineForm) handle(session *session.Admin, params map[string]interface{}) error {
|
||||
return manage.NewExamine()(session).Launch(a.Convert(), a.Identity, a.Status, params)
|
||||
return manage.NewExamine()(session).Launch(a.Convert(), a.Identity, a.Status, a.Remark, params)
|
||||
}
|
||||
|
||||
func (*Manage) Company(c *gin.Context) {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -14,11 +14,13 @@ type (
|
||||
// ManageExpertInfo 专家信息
|
||||
ManageExpertInfo struct {
|
||||
*model.ManageExpert
|
||||
Name string `json:"name"`
|
||||
ResearchName string `json:"research_name"`
|
||||
LaboratoryName string `json:"laboratory_name"`
|
||||
TenantProvince string `json:"-"`
|
||||
TenantCity string `json:"-"`
|
||||
Name string `json:"name"`
|
||||
ResearchName string `json:"research_name"`
|
||||
LaboratoryName string `json:"laboratory_name"`
|
||||
AchievementCount int `json:"achievement_count"`
|
||||
PatentCount int `json:"patent_count"`
|
||||
TenantProvince string `json:"-"`
|
||||
TenantCity string `json:"-"`
|
||||
}
|
||||
// ManageExpertDetail 专家信息
|
||||
ManageExpertDetail struct {
|
||||
@ -51,6 +53,14 @@ func (m *ManageExpert) Experts(page, pageSize int, count *int64, where ...*model
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS r ON e.research_id = r.id", model.NewManageResearch().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS l ON e.laboratory_id = l.id", model.NewManageLaboratory().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN %s AS t ON e.tenant_id = t.id", model.NewSysTenant().TableName())).
|
||||
Joins(fmt.Sprintf("LEFT JOIN (SELECT u.expert_id, SUM(t_a.count) AS achievement_count, SUM(u_p.count) AS patent_count FROM %s AS u "+
|
||||
"LEFT JOIN (SELECT uid, COUNT(id) AS count FROM %s WHERE is_deleted = %d AND status = %d GROUP BY uid) AS t_a ON u.uid = t_a.uid "+
|
||||
"LEFT JOIN (SELECT uid, COUNT(id) AS count FROM %s WHERE is_deleted = %d GROUP BY uid) AS u_p ON u.uid = u_p.uid "+
|
||||
" WHERE u.is_deleted = %d AND u.invalid_status = %d GROUP BY u.expert_id) AS u ON e.id = u.expert_id",
|
||||
model.NewUserExpert().TableName(),
|
||||
model.NewTechnologyAchievement().TableName(), model.DeleteStatusForNot, model.TechnologyAchievementStatusForAgree,
|
||||
model.NewUserPatent().TableName(), model.DeleteStatusForNot,
|
||||
model.DeleteStatusForNot, model.InvalidStatusForNot)).
|
||||
Where("e.is_deleted = ?", model.DeleteStatusForNot)
|
||||
|
||||
if len(where) > 0 {
|
||||
|
Reference in New Issue
Block a user