作者 tangxvhui

调整 个人指标导出的 数据列的排序

@@ -9,16 +9,17 @@ type AssessInfoResp struct { @@ -9,16 +9,17 @@ type AssessInfoResp struct {
9 CycleName string `json:"cycleName"` //周期名称 9 CycleName string `json:"cycleName"` //周期名称
10 EvaluationProjectId int `json:"evaluationProjectId"` //项目id 10 EvaluationProjectId int `json:"evaluationProjectId"` //项目id
11 EvaluationProjectName string `json:"evaluationProjectName"` //项目名称 11 EvaluationProjectName string `json:"evaluationProjectName"` //项目名称
12 - LinkNodeId int `json:"linkNodeId,string"`  
13 - LinkNodeName string `json:"linkNodeName"`  
14 - BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05  
15 - EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05  
16 - Status string `json:"status"` //完成状态  
17 - TargetUserId int `json:"targetUserId,string"` //目标用户  
18 - TargetUserName string `json:"targetUserName"` //目标用户名称  
19 - CompanyId int `json:"companyId,string,"` //  
20 - CompanyName string `json:"companyName"` //公司名称  
21 - SupperUser string `json:"superUser"` //目标用户的上级  
22 - DutyTime string `json:"dutyTime"` //入职时间 //  
23 - AssessContent []*domain.StaffAssessContent `json:"assessContent"` //评估内容 12 + LinkNodeId int `json:"linkNodeId,string"` //评估环节id
  13 + LinkNodeName string `json:"linkNodeName"` //评估环节名称
  14 + BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05
  15 + EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05
  16 + Status string `json:"status"` //完成状态
  17 + TargetUserId int `json:"targetUserId,string"` //目标用户
  18 + TargetUserName string `json:"targetUserName"` //目标用户名称
  19 + CompanyId int `json:"companyId,string,"` //公司id
  20 + CompanyLogo string `json:"companyLogo,string,"` //公司logo
  21 + CompanyName string `json:"companyName"` //公司名称
  22 + SupperUser string `json:"superUser"` //目标用户的上级
  23 + DutyTime string `json:"dutyTime"` //入职时间 //
  24 + AssessContent []*domain.StaffAssessContent `json:"assessContent"` //评估内容
24 } 25 }
@@ -12,6 +12,7 @@ type AssessSelfList struct { @@ -12,6 +12,7 @@ type AssessSelfList struct {
12 12
13 type StaffInfo struct { 13 type StaffInfo struct {
14 UserName string `json:"userName"` //员工名称 14 UserName string `json:"userName"` //员工名称
  15 + CompanyLogo string `json:"companyLogo"` //公司logo
15 CompanyName string `json:"companyName"` //公司名称 16 CompanyName string `json:"companyName"` //公司名称
16 SupperUserName string `json:"supperUserName"` //上级名称 17 SupperUserName string `json:"supperUserName"` //上级名称
17 DutyTime string `json:"dutyTime"` //上岗时间 18 DutyTime string `json:"dutyTime"` //上岗时间
@@ -1598,6 +1598,7 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada @@ -1598,6 +1598,7 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada
1598 if targetUserDesc != nil { 1598 if targetUserDesc != nil {
1599 result.CompanyName = targetUserDesc.CompanyName 1599 result.CompanyName = targetUserDesc.CompanyName
1600 result.SupperUser = targetUserDesc.SupperUserName 1600 result.SupperUser = targetUserDesc.SupperUserName
  1601 + result.CompanyLogo = targetUserDesc.CompanyLogo
1601 result.DutyTime = targetUserDesc.DutyTime 1602 result.DutyTime = targetUserDesc.DutyTime
1602 } 1603 }
1603 return &result, nil 1604 return &result, nil
@@ -1628,40 +1629,11 @@ func (srv *StaffAssessServeice) getStaffDescrip(transactionContext application.T @@ -1628,40 +1629,11 @@ func (srv *StaffAssessServeice) getStaffDescrip(transactionContext application.T
1628 log.Logger.Error("获取公司信息," + err.Error()) 1629 log.Logger.Error("获取公司信息," + err.Error())
1629 return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取公司信息,"+err.Error()) 1630 return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取公司信息,"+err.Error())
1630 } 1631 }
1631 - // departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{  
1632 - // "transactionContext": transactionContext,  
1633 - // })  
1634 - // //查找员工的部门  
1635 - // var departmentList []*domain.Department  
1636 - // if len(userData.DepartmentId) > 0 {  
1637 -  
1638 - // }  
1639 -  
1640 - // var supperUserList []*domain.User  
1641 - // if len(userData.DepartmentId) > 0 {  
1642 - // _, departmentList, err := departmentRepo.Find(map[string]interface{}{  
1643 - // "ids": userData.DepartmentId,  
1644 - // })  
1645 - // if err != nil {  
1646 - // return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error())  
1647 - // }  
1648 - // var chargeUserIds []int64  
1649 - // for _, v := range departmentList {  
1650 - // chargeUserIds = append(chargeUserIds, v.ChargeUserIds...)  
1651 - // }  
1652 - // if len(chargeUserIds) > 0 {  
1653 - // _, supperUserList, err = userRepo.Find(map[string]interface{}{  
1654 - // "ids": chargeUserIds,  
1655 - // })  
1656 - // if err != nil {  
1657 - // return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error())  
1658 - // }  
1659 - // }  
1660 - // }  
1661 supperUserList, _ := srv.getStaffSuper(transactionContext, *userData) 1632 supperUserList, _ := srv.getStaffSuper(transactionContext, *userData)
1662 userInfo := adapter.StaffInfo{ 1633 userInfo := adapter.StaffInfo{
1663 UserName: userData.Name, 1634 UserName: userData.Name,
1664 CompanyName: companyData.Name, 1635 CompanyName: companyData.Name,
  1636 + CompanyLogo: companyData.Logo,
1665 SupperUserName: "", 1637 SupperUserName: "",
1666 DutyTime: userData.EntryTime, 1638 DutyTime: userData.EntryTime,
1667 } 1639 }
@@ -1822,7 +1794,7 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma @@ -1822,7 +1794,7 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma
1822 // return tool_funs.SimpleWrapGridMap(int64(cnt), assessList), nil 1794 // return tool_funs.SimpleWrapGridMap(int64(cnt), assessList), nil
1823 // } 1795 // }
1824 1796
1825 -// 获取员工的上级是谁 ,TODO 1797 +// 获取员工的上级是谁
1826 func (srv StaffAssessServeice) getStaffSuper(transactionContext application.TransactionContext, targetUser domain.User) ([]*domain.User, error) { 1798 func (srv StaffAssessServeice) getStaffSuper(transactionContext application.TransactionContext, targetUser domain.User) ([]*domain.User, error) {
1827 departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{ 1799 departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{
1828 "transactionContext": transactionContext, 1800 "transactionContext": transactionContext,
@@ -14,7 +14,7 @@ import ( @@ -14,7 +14,7 @@ import (
14 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log" 14 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
15 ) 15 )
16 16
17 -//获取我的项目周期列表 17 +// 获取我的项目周期列表
18 func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQuery) (map[string]interface{}, error) { 18 func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQuery) (map[string]interface{}, error) {
19 transactionContext, err := factory.CreateTransactionContext(nil) 19 transactionContext, err := factory.CreateTransactionContext(nil)
20 if err != nil { 20 if err != nil {
@@ -63,7 +63,7 @@ func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQ @@ -63,7 +63,7 @@ func (srv StaffAssessServeice) SearchAssessTaskMeV2(param *query.SearchAssessMeQ
63 return tool_funs.SimpleWrapGridMap(int64(cnt), listData), nil 63 return tool_funs.SimpleWrapGridMap(int64(cnt), listData), nil
64 } 64 }
65 65
66 -//获取我的项目周期进度描述 66 +// 获取我的项目周期进度描述
67 func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Query) (*adapter.AssessCycleDescResp, error) { 67 func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Query) (*adapter.AssessCycleDescResp, error) {
68 transactionContext, err := factory.CreateTransactionContext(nil) 68 transactionContext, err := factory.CreateTransactionContext(nil)
69 if err != nil { 69 if err != nil {
@@ -218,7 +218,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que @@ -218,7 +218,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que
218 return &result, nil 218 return &result, nil
219 } 219 }
220 220
221 -//根据周期获取,我的自评任务添加的邀请人 221 +// 根据周期获取,我的自评任务添加的邀请人
222 func (srv StaffAssessServeice) ListAssessInviteUserV2(param *query.ListInviteUserQuery) (*adapter.AssessInviteUserResp, error) { 222 func (srv StaffAssessServeice) ListAssessInviteUserV2(param *query.ListInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
223 transactionContext, err := factory.CreateTransactionContext(nil) 223 transactionContext, err := factory.CreateTransactionContext(nil)
224 if err != nil { 224 if err != nil {
@@ -690,19 +690,21 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA @@ -690,19 +690,21 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA
690 TargetUserName: assessData.TargetUser.UserName, 690 TargetUserName: assessData.TargetUser.UserName,
691 CompanyId: assessData.CompanyId, 691 CompanyId: assessData.CompanyId,
692 CompanyName: "", 692 CompanyName: "",
  693 + CompanyLogo: "",
693 SupperUser: "", 694 SupperUser: "",
694 DutyTime: "", 695 DutyTime: "",
695 AssessContent: assessContentList, 696 AssessContent: assessContentList,
696 } 697 }
697 if staffDesc != nil { 698 if staffDesc != nil {
698 result.CompanyName = staffDesc.CompanyName 699 result.CompanyName = staffDesc.CompanyName
  700 + result.CompanyLogo = staffDesc.CompanyLogo
699 result.SupperUser = staffDesc.SupperUserName 701 result.SupperUser = staffDesc.SupperUserName
700 result.DutyTime = staffDesc.DutyTime 702 result.DutyTime = staffDesc.DutyTime
701 } 703 }
702 return &result, nil 704 return &result, nil
703 } 705 }
704 706
705 -//根据周期和日期。获取360评估的列表,员工的被其他人评估 707 +// 根据周期和日期。获取360评估的列表,员工的被其他人评估
706 func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) { 708 func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) {
707 709
708 transactionContext, err := factory.CreateTransactionContext(nil) 710 transactionContext, err := factory.CreateTransactionContext(nil)
@@ -744,7 +746,7 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge @@ -744,7 +746,7 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge
744 return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil 746 return tool_funs.SimpleWrapGridMap(int64(cnt), resultList), nil
745 } 747 }
746 748
747 -//根据周期和日期。获取上级评估的列表,员工的被其他人评估 749 +// 根据周期和日期。获取上级评估的列表,员工的被其他人评估
748 func (srv StaffAssessServeice) ListTargetUserSuperAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) { 750 func (srv StaffAssessServeice) ListTargetUserSuperAssess(param *query.ListTargetAssessQuery) (map[string]interface{}, error) {
749 751
750 transactionContext, err := factory.CreateTransactionContext(nil) 752 transactionContext, err := factory.CreateTransactionContext(nil)
@@ -1114,16 +1114,11 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u @@ -1114,16 +1114,11 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u
1114 staff_assess_content.category, 1114 staff_assess_content.category,
1115 staff_assess_content."name" , 1115 staff_assess_content."name" ,
1116 staff_assess_content.weight , 1116 staff_assess_content.weight ,
  1117 + staff_assess_content.sort_by ,
1117 t_staff_assess_1.cycle_id , 1118 t_staff_assess_1.cycle_id ,
1118 t_staff_assess_1.cycle_name, 1119 t_staff_assess_1.cycle_name,
1119 t_staff_assess_1.target_user_id, 1120 t_staff_assess_1.target_user_id,
1120 - t_staff_assess_1.target_user_name,  
1121 - sum(  
1122 - case  
1123 - when staff_assess_content.value isnull then 0  
1124 - when staff_assess_content.value='' then 0  
1125 - ELSE 1  
1126 - END) as cnt 1121 + t_staff_assess_1.target_user_name
1127 from staff_assess_content 1122 from staff_assess_content
1128 join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.assess_id 1123 join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.assess_id
1129 where 1=1 1124 where 1=1
@@ -1133,13 +1128,9 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u @@ -1133,13 +1128,9 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u
1133 condition = append(condition, pg.In(exportUserIds)) 1128 condition = append(condition, pg.In(exportUserIds))
1134 sqlStr += ` and t_staff_assess_1.target_user_id in(?) ` 1129 sqlStr += ` and t_staff_assess_1.target_user_id in(?) `
1135 } 1130 }
1136 - sqlStr += ` group by staff_assess_content.category,  
1137 - staff_assess_content."name" ,  
1138 - t_staff_assess_1.cycle_id ,  
1139 - t_staff_assess_1.cycle_name,  
1140 - staff_assess_content.weight ,  
1141 - target_user_id,target_user_name  
1142 - order by cnt desc,target_user_id ` 1131 + sqlStr += ` group by category,"name" ,cycle_id ,cycle_name,weight ,
  1132 + target_user_id,target_user_name,sort_by
  1133 + order by target_user_id,sort_by `
1143 sqlStr0 := d.useTStaffAssess(companyId, cycleId, userId, "", hrbp, 5000, 0, string(domain.AssessSelf)) 1134 sqlStr0 := d.useTStaffAssess(companyId, cycleId, userId, "", hrbp, 5000, 0, string(domain.AssessSelf))
1144 sqlStr = sqlStr0 + sqlStr 1135 sqlStr = sqlStr0 + sqlStr
1145 tx := d.transactionContext.PgTx 1136 tx := d.transactionContext.PgTx