正在显示
5 个修改的文件
包含
67 行增加
和
49 行删除
| @@ -17,9 +17,9 @@ type AssessInfoResp struct { | @@ -17,9 +17,9 @@ type AssessInfoResp struct { | ||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | type AssessContent struct { | 19 | type AssessContent struct { |
| 20 | - Category string `json:"category" comment:"类别"` | ||
| 21 | - Name string `json:"name" comment:"名称"` | ||
| 22 | - PromptTitle string `json:"promptTitle" comment:"提示项标题"` | ||
| 23 | - PromptText string `json:"promptText" comment:"提示项正文"` | ||
| 24 | - EntryItems []domain.EntryItem `json:"entryItems" comment:"填写项"` | 20 | + Category string `json:"category" comment:"类别"` |
| 21 | + Name string `json:"name" comment:"名称"` | ||
| 22 | + PromptTitle string `json:"promptTitle" comment:"提示项标题"` | ||
| 23 | + PromptText string `json:"promptText" comment:"提示项正文"` | ||
| 24 | + EntryItems []*domain.EntryItem `json:"entryItems" comment:"填写项"` | ||
| 25 | } | 25 | } |
| @@ -840,6 +840,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfo(param *query.AssessInfoQuery) ( | @@ -840,6 +840,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfo(param *query.AssessInfoQuery) ( | ||
| 840 | Name: v.Name, | 840 | Name: v.Name, |
| 841 | PromptTitle: v.PromptTitle, | 841 | PromptTitle: v.PromptTitle, |
| 842 | PromptText: v.PromptText, | 842 | PromptText: v.PromptText, |
| 843 | + EntryItems: v.EntryItems, | ||
| 843 | }) | 844 | }) |
| 844 | } | 845 | } |
| 845 | result.AssessContent = assessContent | 846 | result.AssessContent = assessContent |
| @@ -2,6 +2,7 @@ package pg | @@ -2,6 +2,7 @@ package pg | ||
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| 5 | + | ||
| 5 | "github.com/go-pg/pg/v10" | 6 | "github.com/go-pg/pg/v10" |
| 6 | "github.com/go-pg/pg/v10/orm" | 7 | "github.com/go-pg/pg/v10/orm" |
| 7 | "github.com/linmadan/egglib-go/persistent/pg/comment" | 8 | "github.com/linmadan/egglib-go/persistent/pg/comment" |
| @@ -38,6 +39,8 @@ func init() { | @@ -38,6 +39,8 @@ func init() { | ||
| 38 | &models.EvaluationCycle{}, | 39 | &models.EvaluationCycle{}, |
| 39 | &models.EvaluationCycleTemplate{}, | 40 | &models.EvaluationCycleTemplate{}, |
| 40 | &models.EvaluationProject{}, | 41 | &models.EvaluationProject{}, |
| 42 | + &models.StaffAssess{}, | ||
| 43 | + &models.StaffAssessTask{}, | ||
| 41 | } | 44 | } |
| 42 | for _, model := range tables { | 45 | for _, model := range tables { |
| 43 | err := DB.Model(model).CreateTable(&orm.CreateTableOptions{ | 46 | err := DB.Model(model).CreateTable(&orm.CreateTableOptions{ |
| @@ -8,20 +8,24 @@ import ( | @@ -8,20 +8,24 @@ import ( | ||
| 8 | 8 | ||
| 9 | // 记录用户需要的评估项 | 9 | // 记录用户需要的评估项 |
| 10 | type StaffAssess struct { | 10 | type StaffAssess struct { |
| 11 | - tableName struct{} `pg:"staff_assess" comment:"记录用户需要的评估项"` | ||
| 12 | - Id int `pg:",pk"` //id | ||
| 13 | - CompanyId int `comment:"公司id"` //公司id | ||
| 14 | - EvaluationProjectId int `comment:"对应的项目id"` //对应的项目id | ||
| 15 | - CycleId int64 `comment:"对应的周期id"` //对应的周期id | ||
| 16 | - TargetUser domain.StaffDesc `comment:"被评估的目标用户"` //被评估的目标用户 | ||
| 17 | - TargetDepartment []domain.StaffDepartment `comment:"被评估的用户所在的部门"` //被评估的用户所在的部门 | ||
| 18 | - Executor domain.StaffDesc `comment:"填写评估的用户"` //填写评估的用户 | ||
| 19 | - Types string `comment:"填写评估对应的类型"` //填写评估对应的类型 | ||
| 20 | - LinkNodeId int `comment:"评估环节id"` | ||
| 21 | - Status string `comment:"评估的填写状态"` //评估的填写状态 | ||
| 22 | - BeginTime time.Time `comment:"开始时间"` //开始时间 | ||
| 23 | - EndTime time.Time `comment:"截止时间"` //截止时间 | ||
| 24 | - CreatedAt time.Time `comment:"数据创建时间"` //数据创建时间 | ||
| 25 | - UpdatedAt time.Time `comment:"数据更新时间"` //数据更新时间 | ||
| 26 | - DeletedAt *time.Time `comment:"数据删除时间"` //数据删除时间 | 11 | + tableName struct{} `pg:"staff_assess" comment:"记录用户需要的评估项"` |
| 12 | + Id int `pg:",pk"` //id | ||
| 13 | + CompanyId int `comment:"公司id"` //公司id | ||
| 14 | + EvaluationProjectId int `comment:"对应的项目id"` //对应的项目id | ||
| 15 | + EvaluationProjectName string | ||
| 16 | + CycleId int64 `comment:"对应的周期id"` //对应的周期id | ||
| 17 | + CycleName string | ||
| 18 | + StaffAssessTaskId int | ||
| 19 | + TargetUser domain.StaffDesc `comment:"被评估的目标用户"` //被评估的目标用户 | ||
| 20 | + TargetDepartment []domain.StaffDepartment `comment:"被评估的用户所在的部门"` //被评估的用户所在的部门 | ||
| 21 | + Executor domain.StaffDesc `comment:"填写评估的用户"` //填写评估的用户 | ||
| 22 | + Types string `comment:"填写评估对应的类型"` //填写评估对应的类型 | ||
| 23 | + LinkNodeId int `comment:"评估环节id"` | ||
| 24 | + LinkNodeName string | ||
| 25 | + Status string `comment:"评估的填写状态"` //评估的填写状态 | ||
| 26 | + BeginTime time.Time `comment:"开始时间"` //开始时间 | ||
| 27 | + EndTime time.Time `comment:"截止时间"` //截止时间 | ||
| 28 | + CreatedAt time.Time `comment:"数据创建时间"` //数据创建时间 | ||
| 29 | + UpdatedAt time.Time `comment:"数据更新时间"` //数据更新时间 | ||
| 30 | + DeletedAt *time.Time `comment:"数据删除时间"` //数据删除时间 | ||
| 27 | } | 31 | } |
| @@ -23,39 +23,49 @@ func NewStaffAssessRepository(transactionContext *pgTransaction.TransactionConte | @@ -23,39 +23,49 @@ func NewStaffAssessRepository(transactionContext *pgTransaction.TransactionConte | ||
| 23 | 23 | ||
| 24 | func (repo *StaffAssessRepository) TransformToDomain(d *models.StaffAssess) *domain.StaffAssess { | 24 | func (repo *StaffAssessRepository) TransformToDomain(d *models.StaffAssess) *domain.StaffAssess { |
| 25 | return &domain.StaffAssess{ | 25 | return &domain.StaffAssess{ |
| 26 | - Id: d.Id, | ||
| 27 | - CompanyId: d.CompanyId, | ||
| 28 | - EvaluationProjectId: d.EvaluationProjectId, | ||
| 29 | - CycleId: d.CycleId, | ||
| 30 | - TargetUser: d.TargetUser, | ||
| 31 | - TargetDepartment: d.TargetDepartment, | ||
| 32 | - Executor: d.Executor, | ||
| 33 | - Types: domain.StaffAssessType(d.Types), | ||
| 34 | - Status: domain.StaffAssessStatus(d.Status), | ||
| 35 | - BeginTime: d.BeginTime, | ||
| 36 | - EndTime: d.EndTime, | ||
| 37 | - CreatedAt: d.EndTime, | ||
| 38 | - UpdatedAt: d.CreatedAt, | ||
| 39 | - DeletedAt: d.DeletedAt, | 26 | + Id: d.Id, |
| 27 | + CompanyId: d.CompanyId, | ||
| 28 | + EvaluationProjectId: d.EvaluationProjectId, | ||
| 29 | + EvaluationProjectName: d.EvaluationProjectName, | ||
| 30 | + CycleId: d.CycleId, | ||
| 31 | + CycleName: d.CycleName, | ||
| 32 | + StaffAssessTaskId: d.StaffAssessTaskId, | ||
| 33 | + TargetUser: d.TargetUser, | ||
| 34 | + TargetDepartment: d.TargetDepartment, | ||
| 35 | + Executor: d.Executor, | ||
| 36 | + Types: domain.StaffAssessType(d.Types), | ||
| 37 | + LinkNodeId: d.LinkNodeId, | ||
| 38 | + LinkNodeName: d.LinkNodeName, | ||
| 39 | + Status: domain.StaffAssessStatus(d.Status), | ||
| 40 | + BeginTime: d.BeginTime, | ||
| 41 | + EndTime: d.EndTime, | ||
| 42 | + CreatedAt: d.EndTime, | ||
| 43 | + UpdatedAt: d.CreatedAt, | ||
| 44 | + DeletedAt: d.DeletedAt, | ||
| 40 | } | 45 | } |
| 41 | } | 46 | } |
| 42 | 47 | ||
| 43 | func (repo *StaffAssessRepository) Save(d *domain.StaffAssess) (*domain.StaffAssess, error) { | 48 | func (repo *StaffAssessRepository) Save(d *domain.StaffAssess) (*domain.StaffAssess, error) { |
| 44 | saveModel := models.StaffAssess{ | 49 | saveModel := models.StaffAssess{ |
| 45 | - Id: d.Id, | ||
| 46 | - CompanyId: d.CompanyId, | ||
| 47 | - EvaluationProjectId: d.EvaluationProjectId, | ||
| 48 | - CycleId: d.CycleId, | ||
| 49 | - TargetUser: d.TargetUser, | ||
| 50 | - TargetDepartment: d.TargetDepartment, | ||
| 51 | - Executor: d.Executor, | ||
| 52 | - Types: string(d.Types), | ||
| 53 | - Status: string(d.Status), | ||
| 54 | - BeginTime: d.BeginTime, | ||
| 55 | - EndTime: d.EndTime, | ||
| 56 | - CreatedAt: d.EndTime, | ||
| 57 | - UpdatedAt: d.CreatedAt, | ||
| 58 | - DeletedAt: d.DeletedAt, | 50 | + Id: d.Id, |
| 51 | + CompanyId: d.CompanyId, | ||
| 52 | + EvaluationProjectId: d.EvaluationProjectId, | ||
| 53 | + EvaluationProjectName: d.EvaluationProjectName, | ||
| 54 | + CycleId: d.CycleId, | ||
| 55 | + CycleName: d.CycleName, | ||
| 56 | + StaffAssessTaskId: d.StaffAssessTaskId, | ||
| 57 | + TargetUser: d.TargetUser, | ||
| 58 | + TargetDepartment: d.TargetDepartment, | ||
| 59 | + Executor: d.Executor, | ||
| 60 | + Types: string(d.Types), | ||
| 61 | + LinkNodeId: d.LinkNodeId, | ||
| 62 | + LinkNodeName: d.LinkNodeName, | ||
| 63 | + Status: string(d.Status), | ||
| 64 | + BeginTime: d.BeginTime, | ||
| 65 | + EndTime: d.EndTime, | ||
| 66 | + CreatedAt: d.EndTime, | ||
| 67 | + UpdatedAt: d.CreatedAt, | ||
| 68 | + DeletedAt: d.DeletedAt, | ||
| 59 | } | 69 | } |
| 60 | tx := repo.transactionContext.PgTx | 70 | tx := repo.transactionContext.PgTx |
| 61 | var err error | 71 | var err error |
-
请 注册 或 登录 后发表评论