作者 tangxvhui

日常保存

@@ -2,6 +2,9 @@ package service @@ -2,6 +2,9 @@ package service
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
  5 + "strconv"
  6 + "time"
  7 +
5 "github.com/linmadan/egglib-go/core/application" 8 "github.com/linmadan/egglib-go/core/application"
6 "github.com/linmadan/egglib-go/utils/tool_funs" 9 "github.com/linmadan/egglib-go/utils/tool_funs"
7 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/evaluation_project/adapter" 10 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/evaluation_project/adapter"
@@ -9,8 +12,6 @@ import ( @@ -9,8 +12,6 @@ import (
9 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" 12 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
10 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" 13 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
11 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/utils" 14 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/utils"
12 - "strconv"  
13 - "time"  
14 ) 15 )
15 16
16 type EvaluationProjectService struct { 17 type EvaluationProjectService struct {
@@ -2,7 +2,7 @@ package adapter @@ -2,7 +2,7 @@ package adapter
2 2
3 //综合评估的周期列表 3 //综合评估的周期列表
4 4
5 -type CycleList struct { 5 +type CycleListAdapter struct {
6 CycleId string `json:"cycleId"` //周期id 6 CycleId string `json:"cycleId"` //周期id
7 CycleName string `json:"cycleName"` // 7 CycleName string `json:"cycleName"` //
8 ExecutorId string `json:"executorId "` 8 ExecutorId string `json:"executorId "`
  1 +package adapter
  2 +
  3 +import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
  4 +
  5 +type EvaluationInfoAdapter struct {
  6 + SummaryEvaluationId int `json:"summaryEvaluationId"` //
  7 + CycleId int `json:"cycleId,string"` //周期id
  8 + CycleName string `json:"cycleName"` //周期名称
  9 + EvaluationProjectId int `json:"evaluationProjectId"` //项目id
  10 + EvaluationProjectName string `json:"evaluationProjectName"` //项目名称
  11 + LinkNodeId int `json:"linkNodeId,string"` //评估环节id
  12 + LinkNodeName string `json:"linkNodeName"` //评估环节名称
  13 + BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05
  14 + EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05
  15 + Status string `json:"status"` //完成状态
  16 + // Content
  17 +}
  18 +
  19 +type EvaluationItemAdapter struct {
  20 + SortBy int //排序
  21 + Category string //类别
  22 + Name string //名称
  23 + PromptTitle string //提示项标题
  24 + PromptText string //提示项正文
  25 + EntryItems []domain.EntryItem //填写的反馈
  26 + RuleType int //评估方式(0评级、1评分)
  27 + Rule domain.EvaluationRule //评估的选项规则
  28 + Weight float64 //"权重"
  29 + Required int // 必填项
  30 + Value string //评估填写的评分
  31 + Score string //评定得分
  32 + Types string //评估类型
  33 + Remark string //填写的内容反馈
  34 +}
1 package adapter 1 package adapter
2 2
3 -type MenuList struct {  
4 - CycleId int `json:"cycleId,string"`  
5 - NodeName string `json:"nodeName"`  
6 - StatusName string `json:"statusName"`  
7 - Types string `json:"types"`  
8 - Child []MenuList `json:"child"` 3 +type MenuListAdapter struct {
  4 + CycleId int `json:"cycleId,string"`
  5 + NodeName string `json:"nodeName"`
  6 + StatusName string `json:"statusName"`
  7 + Types string `json:"types"`
  8 + Child []MenuListAdapter `json:"child"`
9 } 9 }
  1 +package command
  2 +
  3 +type QueryEvaluationInfo struct {
  4 + CycleId int `json:"cycleId,string"`
  5 + CompanyId int `json:"-"`
  6 +}
@@ -2,7 +2,7 @@ package command @@ -2,7 +2,7 @@ package command
2 2
3 // 获取周期列表 3 // 获取周期列表
4 type QueryCycleList struct { 4 type QueryCycleList struct {
5 - UserId int `json:"userId,string"` 5 + UserId int `json:"-"` //当前操作人id
6 PageSize int `json:"pageSize"` 6 PageSize int `json:"pageSize"`
7 PageNumber int `json:"pageNumber"` 7 PageNumber int `json:"pageNumber"`
8 } 8 }
@@ -2,6 +2,7 @@ package command @@ -2,6 +2,7 @@ package command
2 2
3 // QueryMenuCommand 3 // QueryMenuCommand
4 type QueryMenu struct { 4 type QueryMenu struct {
5 - CycleId int `json:"cycleId,string"`  
6 - UserId int `json:"userId,string"` 5 + CycleId int `json:"cycleId,string"` //周期id
  6 + UserId int `json:"userId,string"` //操作人id
  7 + CompanyId int `json:"companyId,string"` //操作人公司id
7 } 8 }
@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
4 "github.com/linmadan/egglib-go/core/application" 4 "github.com/linmadan/egglib-go/core/application"
5 "github.com/linmadan/egglib-go/utils/tool_funs" 5 "github.com/linmadan/egglib-go/utils/tool_funs"
6 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" 6 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
  7 + roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
7 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter" 8 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter"
8 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command" 9 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command"
9 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain" 10 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
@@ -55,9 +56,9 @@ func (srv *SummaryEvaluationServeice) GetCycleList(param *command.QueryCycleList @@ -55,9 +56,9 @@ func (srv *SummaryEvaluationServeice) GetCycleList(param *command.QueryCycleList
55 if err := transactionContext.CommitTransaction(); err != nil { 56 if err := transactionContext.CommitTransaction(); err != nil {
56 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 57 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
57 } 58 }
58 - cycleList := []adapter.CycleList{} 59 + cycleList := []adapter.CycleListAdapter{}
59 for _, v := range cycleData { 60 for _, v := range cycleData {
60 - m := adapter.CycleList{ 61 + m := adapter.CycleListAdapter{
61 CycleId: v.CycleId, 62 CycleId: v.CycleId,
62 CycleName: v.CycleName, 63 CycleName: v.CycleName,
63 ExecutorId: v.ExecutorId, 64 ExecutorId: v.ExecutorId,
@@ -120,28 +121,36 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str @@ -120,28 +121,36 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
120 "limit": 1, 121 "limit": 1,
121 "status": string(domain.EvaluationUncompleted), 122 "status": string(domain.EvaluationUncompleted),
122 }) 123 })
  124 + if err != nil {
  125 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  126 + }
  127 +
  128 + isHrbp, err := roleService.GetHRBP(transactionContext, param.CompanyId, param.UserId)
  129 + if err != nil {
  130 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  131 + }
123 132
124 if err := transactionContext.CommitTransaction(); err != nil { 133 if err := transactionContext.CommitTransaction(); err != nil {
125 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 134 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
126 } 135 }
127 136
128 - menuList := []adapter.MenuList{} 137 + menuList := []adapter.MenuListAdapter{}
129 138
130 //模块-我的绩效 139 //模块-我的绩效
131 - menu1 := adapter.MenuList{ 140 + menu1 := adapter.MenuListAdapter{
132 CycleId: 0, 141 CycleId: 0,
133 NodeName: "我的绩效", 142 NodeName: "我的绩效",
134 StatusName: "", 143 StatusName: "",
135 Types: "", 144 Types: "",
136 - Child: []adapter.MenuList{}, 145 + Child: []adapter.MenuListAdapter{},
137 } 146 }
138 - menu1_1 := adapter.MenuList{ 147 + menu1_1 := adapter.MenuListAdapter{
139 CycleId: param.CycleId, 148 CycleId: param.CycleId,
140 NodeName: "填写综合自评", 149 NodeName: "填写综合自评",
141 StatusName: "", 150 StatusName: "",
142 Types: "填写综合自评", 151 Types: "填写综合自评",
143 } 152 }
144 - menu1_2 := adapter.MenuList{ 153 + menu1_2 := adapter.MenuListAdapter{
145 CycleId: param.CycleId, 154 CycleId: param.CycleId,
146 NodeName: "查看综合自评", 155 NodeName: "查看综合自评",
147 StatusName: "", 156 StatusName: "",
@@ -161,14 +170,14 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str @@ -161,14 +170,14 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
161 } 170 }
162 menu1.Child = append(menu1.Child, menu1_1, menu1_2) 171 menu1.Child = append(menu1.Child, menu1_1, menu1_2)
163 menuList = append(menuList, menu1) 172 menuList = append(menuList, menu1)
164 - menu2 := adapter.MenuList{ 173 + menu2 := adapter.MenuListAdapter{
165 CycleId: 0, 174 CycleId: 0,
166 NodeName: "给他人评估", 175 NodeName: "给他人评估",
167 StatusName: "", 176 StatusName: "",
168 Types: "", 177 Types: "",
169 - Child: []adapter.MenuList{}, 178 + Child: []adapter.MenuListAdapter{},
170 } 179 }
171 - menu2_1 := adapter.MenuList{ 180 + menu2_1 := adapter.MenuListAdapter{
172 CycleId: param.CycleId, 181 CycleId: param.CycleId,
173 NodeName: "360综评", 182 NodeName: "360综评",
174 StatusName: "", 183 StatusName: "",
@@ -181,14 +190,14 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str @@ -181,14 +190,14 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
181 } 190 }
182 menu2.Child = append(menu2.Child, menu2_1) 191 menu2.Child = append(menu2.Child, menu2_1)
183 menuList = append(menuList, menu2) 192 menuList = append(menuList, menu2)
184 - menu3 := adapter.MenuList{ 193 + menu3 := adapter.MenuListAdapter{
185 CycleId: 0, 194 CycleId: 0,
186 NodeName: "人资评估", 195 NodeName: "人资评估",
187 StatusName: "", 196 StatusName: "",
188 Types: "", 197 Types: "",
189 - Child: []adapter.MenuList{}, 198 + Child: []adapter.MenuListAdapter{},
190 } 199 }
191 - menu3_1 := adapter.MenuList{ 200 + menu3_1 := adapter.MenuListAdapter{
192 CycleId: param.CycleId, 201 CycleId: param.CycleId,
193 NodeName: "上级综评", 202 NodeName: "上级综评",
194 StatusName: "", 203 StatusName: "",
@@ -200,16 +209,18 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str @@ -200,16 +209,18 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
200 menu3_1.StatusName = "已完成" 209 menu3_1.StatusName = "已完成"
201 } 210 }
202 menu3.Child = append(menu3.Child, menu3_1) 211 menu3.Child = append(menu3.Child, menu3_1)
203 -  
204 - menuList = append(menuList, menu3)  
205 - menu4 := adapter.MenuList{ 212 + //hrbp 才有这个菜单
  213 + if isHrbp > 0 {
  214 + menuList = append(menuList, menu3)
  215 + }
  216 + menu4 := adapter.MenuListAdapter{
206 CycleId: 0, 217 CycleId: 0,
207 NodeName: "我的团队绩效", 218 NodeName: "我的团队绩效",
208 StatusName: "", 219 StatusName: "",
209 Types: "", 220 Types: "",
210 - Child: []adapter.MenuList{}, 221 + Child: []adapter.MenuListAdapter{},
211 } 222 }
212 - menu4_1 := adapter.MenuList{ 223 + menu4_1 := adapter.MenuListAdapter{
213 CycleId: param.CycleId, 224 CycleId: param.CycleId,
214 NodeName: "上级综评", 225 NodeName: "上级综评",
215 StatusName: "", 226 StatusName: "",
@@ -229,7 +240,7 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str @@ -229,7 +240,7 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
229 } 240 }
230 241
231 // 获取综合自评详情 242 // 获取综合自评详情
232 -func (srv *SummaryEvaluationServeice) GetEvaluationSelf() {} 243 +func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEvaluationInfo) {}
233 244
234 // 编辑综合自评详情 245 // 编辑综合自评详情
235 func (srv *SummaryEvaluationServeice) EditEvaluationSelf() {} 246 func (srv *SummaryEvaluationServeice) EditEvaluationSelf() {}