Merge remote-tracking branch 'origin/test' into test
正在显示
3 个修改的文件
包含
22 行增加
和
13 行删除
@@ -524,7 +524,7 @@ func (srv StaffAssessServeice) createStaffAssess(transactionContext application. | @@ -524,7 +524,7 @@ func (srv StaffAssessServeice) createStaffAssess(transactionContext application. | ||
524 | // TargetUser: domain.StaffDesc{}, | 524 | // TargetUser: domain.StaffDesc{}, |
525 | // TargetDepartment: nil, | 525 | // TargetDepartment: nil, |
526 | // Executor: domain.StaffDesc{}, | 526 | // Executor: domain.StaffDesc{}, |
527 | - Types: domain.AssessSelf, | 527 | + Types: "", |
528 | // LinkNodeId: v.LinkNodeId, | 528 | // LinkNodeId: v.LinkNodeId, |
529 | Status: domain.StaffAssessUncompleted, | 529 | Status: domain.StaffAssessUncompleted, |
530 | // BeginTime: time.Time{}, | 530 | // BeginTime: time.Time{}, |
@@ -540,6 +540,7 @@ func (srv StaffAssessServeice) createStaffAssess(transactionContext application. | @@ -540,6 +540,7 @@ func (srv StaffAssessServeice) createStaffAssess(transactionContext application. | ||
540 | stepSelfTemp.EndTime = v.EndTime | 540 | stepSelfTemp.EndTime = v.EndTime |
541 | stepSelfTemp.LinkNodeId = v.LinkNodeId | 541 | stepSelfTemp.LinkNodeId = v.LinkNodeId |
542 | stepSelfTemp.LinkNodeName = v.LinkNodeName | 542 | stepSelfTemp.LinkNodeName = v.LinkNodeName |
543 | + stepSelfTemp.Types = domain.AssessSelf | ||
543 | assessListTemp := srv.createStaffAssessSelf(stepSelfTemp, userList, userDepartmentMap) | 544 | assessListTemp := srv.createStaffAssessSelf(stepSelfTemp, userList, userDepartmentMap) |
544 | assessList = append(assessList, assessListTemp...) | 545 | assessList = append(assessList, assessListTemp...) |
545 | } | 546 | } |
@@ -549,6 +550,7 @@ func (srv StaffAssessServeice) createStaffAssess(transactionContext application. | @@ -549,6 +550,7 @@ func (srv StaffAssessServeice) createStaffAssess(transactionContext application. | ||
549 | stepSelfTemp.EndTime = v.EndTime | 550 | stepSelfTemp.EndTime = v.EndTime |
550 | stepSelfTemp.LinkNodeId = v.LinkNodeId | 551 | stepSelfTemp.LinkNodeId = v.LinkNodeId |
551 | stepSelfTemp.LinkNodeName = v.LinkNodeName | 552 | stepSelfTemp.LinkNodeName = v.LinkNodeName |
553 | + stepSelfTemp.Types = domain.AssessSuper | ||
552 | assessListTemp, err := srv.createStaffAssessSupper(transactionContext, stepSelfTemp, userList, userDepartmentMap) | 554 | assessListTemp, err := srv.createStaffAssessSupper(transactionContext, stepSelfTemp, userList, userDepartmentMap) |
553 | if err != nil { | 555 | if err != nil { |
554 | return nil, err | 556 | return nil, err |
@@ -564,15 +566,16 @@ func (srv StaffAssessServeice) createStaffAssessSelf(assessTemp domain.StaffAsse | @@ -564,15 +566,16 @@ func (srv StaffAssessServeice) createStaffAssessSelf(assessTemp domain.StaffAsse | ||
564 | userList []*domain.User, userDepartmentMap map[int64][]*domain.Department) []domain.StaffAssess { | 566 | userList []*domain.User, userDepartmentMap map[int64][]*domain.Department) []domain.StaffAssess { |
565 | result := []domain.StaffAssess{} | 567 | result := []domain.StaffAssess{} |
566 | for _, usr := range userList { | 568 | for _, usr := range userList { |
569 | + | ||
567 | assessTemp.TargetUser = domain.StaffDesc{ | 570 | assessTemp.TargetUser = domain.StaffDesc{ |
568 | UserId: int(usr.Id), | 571 | UserId: int(usr.Id), |
569 | Account: usr.Account, | 572 | Account: usr.Account, |
570 | - UserName: usr.Account, | 573 | + UserName: usr.Name, |
571 | } | 574 | } |
572 | assessTemp.Executor = domain.StaffDesc{ | 575 | assessTemp.Executor = domain.StaffDesc{ |
573 | UserId: int(usr.Id), | 576 | UserId: int(usr.Id), |
574 | Account: usr.Account, | 577 | Account: usr.Account, |
575 | - UserName: usr.Account, | 578 | + UserName: usr.Name, |
576 | } | 579 | } |
577 | if depList, ok := userDepartmentMap[usr.Id]; ok { | 580 | if depList, ok := userDepartmentMap[usr.Id]; ok { |
578 | for _, dep := range depList { | 581 | for _, dep := range depList { |
@@ -2,18 +2,18 @@ package domain | @@ -2,18 +2,18 @@ package domain | ||
2 | 2 | ||
3 | //员工基本信息描述 | 3 | //员工基本信息描述 |
4 | type StaffDesc struct { | 4 | type StaffDesc struct { |
5 | - UserId int `json:"userId"` //用户id | 5 | + UserId int `json:"userId,string"` //用户id |
6 | Account string `json:"account"` //用户的账号 | 6 | Account string `json:"account"` //用户的账号 |
7 | UserName string `json:"userName"` //用户的名称 | 7 | UserName string `json:"userName"` //用户的名称 |
8 | } | 8 | } |
9 | 9 | ||
10 | //员工的部门 | 10 | //员工的部门 |
11 | type StaffDepartment struct { | 11 | type StaffDepartment struct { |
12 | - DepartmentId int `json:"departmentId"` //部门id | 12 | + DepartmentId int `json:"departmentId,string"` //部门id |
13 | DepartmentName string `json:"departmentName"` //部门名称 | 13 | DepartmentName string `json:"departmentName"` //部门名称 |
14 | } | 14 | } |
15 | 15 | ||
16 | type StaffPosition struct { | 16 | type StaffPosition struct { |
17 | - PositionId int `json:"positionId"` | 17 | + PositionId int `json:"positionId,string"` |
18 | PositionName string `json:"positionName"` | 18 | PositionName string `json:"positionName"` |
19 | } | 19 | } |
@@ -28,12 +28,14 @@ func (repo *UserRepository) Insert(user *domain.User) (*domain.User, error) { | @@ -28,12 +28,14 @@ func (repo *UserRepository) Insert(user *domain.User) (*domain.User, error) { | ||
28 | AvatarUrl: user.AvatarUrl, | 28 | AvatarUrl: user.AvatarUrl, |
29 | CompanyId: user.CompanyId, | 29 | CompanyId: user.CompanyId, |
30 | AdminType: user.AdminType, | 30 | AdminType: user.AdminType, |
31 | - DepartmentId: user.DepartmentId, | ||
32 | - PositionId: user.PositionId, | ||
33 | Name: user.Name, | 31 | Name: user.Name, |
32 | + Email: user.Email, | ||
34 | Status: user.Status, | 33 | Status: user.Status, |
35 | - UpdatedAt: user.UpdatedAt, | 34 | + DepartmentId: user.DepartmentId, |
35 | + PositionId: user.PositionId, | ||
36 | + EntryTime: user.EntryTime, | ||
36 | CreatedAt: user.CreatedAt, | 37 | CreatedAt: user.CreatedAt, |
38 | + UpdatedAt: user.UpdatedAt, | ||
37 | DeletedAt: user.DeletedAt, | 39 | DeletedAt: user.DeletedAt, |
38 | } | 40 | } |
39 | tx := repo.transactionContext.PgTx | 41 | tx := repo.transactionContext.PgTx |
@@ -52,13 +54,14 @@ func (repo *UserRepository) Update(user *domain.User) (*domain.User, error) { | @@ -52,13 +54,14 @@ func (repo *UserRepository) Update(user *domain.User) (*domain.User, error) { | ||
52 | AvatarUrl: user.AvatarUrl, | 54 | AvatarUrl: user.AvatarUrl, |
53 | CompanyId: user.CompanyId, | 55 | CompanyId: user.CompanyId, |
54 | AdminType: user.AdminType, | 56 | AdminType: user.AdminType, |
55 | - DepartmentId: user.DepartmentId, | ||
56 | - PositionId: user.PositionId, | ||
57 | Name: user.Name, | 57 | Name: user.Name, |
58 | Email: user.Email, | 58 | Email: user.Email, |
59 | Status: user.Status, | 59 | Status: user.Status, |
60 | - UpdatedAt: user.UpdatedAt, | 60 | + DepartmentId: user.DepartmentId, |
61 | + PositionId: user.PositionId, | ||
62 | + EntryTime: user.EntryTime, | ||
61 | CreatedAt: user.CreatedAt, | 63 | CreatedAt: user.CreatedAt, |
64 | + UpdatedAt: user.UpdatedAt, | ||
62 | DeletedAt: user.DeletedAt, | 65 | DeletedAt: user.DeletedAt, |
63 | } | 66 | } |
64 | tx := repo.transactionContext.PgTx | 67 | tx := repo.transactionContext.PgTx |
@@ -147,8 +150,11 @@ func (repo *UserRepository) TransformToUserDomain(user *models.User) *domain.Use | @@ -147,8 +150,11 @@ func (repo *UserRepository) TransformToUserDomain(user *models.User) *domain.Use | ||
147 | Name: user.Name, | 150 | Name: user.Name, |
148 | Email: user.Email, | 151 | Email: user.Email, |
149 | Status: user.Status, | 152 | Status: user.Status, |
153 | + DepartmentId: user.DepartmentId, | ||
154 | + PositionId: user.PositionId, | ||
155 | + EntryTime: user.EntryTime, | ||
150 | UpdatedAt: user.UpdatedAt, | 156 | UpdatedAt: user.UpdatedAt, |
151 | - CreatedAt: user.CreatedAt, | ||
152 | DeletedAt: user.DeletedAt, | 157 | DeletedAt: user.DeletedAt, |
158 | + CreatedAt: user.CreatedAt, | ||
153 | } | 159 | } |
154 | } | 160 | } |
-
请 注册 或 登录 后发表评论