作者 tangxvhui

日常保存

... ... @@ -2,6 +2,9 @@ package service
import (
"fmt"
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/evaluation_project/adapter"
... ... @@ -9,8 +12,6 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/utils"
"strconv"
"time"
)
type EvaluationProjectService struct {
... ...
... ... @@ -2,7 +2,7 @@ package adapter
//综合评估的周期列表
type CycleList struct {
type CycleListAdapter struct {
CycleId string `json:"cycleId"` //周期id
CycleName string `json:"cycleName"` //
ExecutorId string `json:"executorId "`
... ...
package adapter
import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
type EvaluationInfoAdapter struct {
SummaryEvaluationId int `json:"summaryEvaluationId"` //
CycleId int `json:"cycleId,string"` //周期id
CycleName string `json:"cycleName"` //周期名称
EvaluationProjectId int `json:"evaluationProjectId"` //项目id
EvaluationProjectName string `json:"evaluationProjectName"` //项目名称
LinkNodeId int `json:"linkNodeId,string"` //评估环节id
LinkNodeName string `json:"linkNodeName"` //评估环节名称
BeginTime string `json:"beginTime"` //开始时间 2006-01-02 15:04:05
EndTime string `json:"endTime"` //结束时间 2006-01-02 15:04:05
Status string `json:"status"` //完成状态
// Content
}
type EvaluationItemAdapter struct {
SortBy int //排序
Category string //类别
Name string //名称
PromptTitle string //提示项标题
PromptText string //提示项正文
EntryItems []domain.EntryItem //填写的反馈
RuleType int //评估方式(0评级、1评分)
Rule domain.EvaluationRule //评估的选项规则
Weight float64 //"权重"
Required int // 必填项
Value string //评估填写的评分
Score string //评定得分
Types string //评估类型
Remark string //填写的内容反馈
}
... ...
package adapter
type MenuList struct {
CycleId int `json:"cycleId,string"`
NodeName string `json:"nodeName"`
StatusName string `json:"statusName"`
Types string `json:"types"`
Child []MenuList `json:"child"`
type MenuListAdapter struct {
CycleId int `json:"cycleId,string"`
NodeName string `json:"nodeName"`
StatusName string `json:"statusName"`
Types string `json:"types"`
Child []MenuListAdapter `json:"child"`
}
... ...
package command
type QueryEvaluationInfo struct {
CycleId int `json:"cycleId,string"`
CompanyId int `json:"-"`
}
... ...
... ... @@ -2,7 +2,7 @@ package command
// 获取周期列表
type QueryCycleList struct {
UserId int `json:"userId,string"`
UserId int `json:"-"` //当前操作人id
PageSize int `json:"pageSize"`
PageNumber int `json:"pageNumber"`
}
... ...
... ... @@ -2,6 +2,7 @@ package command
// QueryMenuCommand
type QueryMenu struct {
CycleId int `json:"cycleId,string"`
UserId int `json:"userId,string"`
CycleId int `json:"cycleId,string"` //周期id
UserId int `json:"userId,string"` //操作人id
CompanyId int `json:"companyId,string"` //操作人公司id
}
... ...
... ... @@ -4,6 +4,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
roleService "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/role"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
... ... @@ -55,9 +56,9 @@ func (srv *SummaryEvaluationServeice) GetCycleList(param *command.QueryCycleList
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
cycleList := []adapter.CycleList{}
cycleList := []adapter.CycleListAdapter{}
for _, v := range cycleData {
m := adapter.CycleList{
m := adapter.CycleListAdapter{
CycleId: v.CycleId,
CycleName: v.CycleName,
ExecutorId: v.ExecutorId,
... ... @@ -120,28 +121,36 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
"limit": 1,
"status": string(domain.EvaluationUncompleted),
})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
isHrbp, err := roleService.GetHRBP(transactionContext, param.CompanyId, param.UserId)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
menuList := []adapter.MenuList{}
menuList := []adapter.MenuListAdapter{}
//模块-我的绩效
menu1 := adapter.MenuList{
menu1 := adapter.MenuListAdapter{
CycleId: 0,
NodeName: "我的绩效",
StatusName: "",
Types: "",
Child: []adapter.MenuList{},
Child: []adapter.MenuListAdapter{},
}
menu1_1 := adapter.MenuList{
menu1_1 := adapter.MenuListAdapter{
CycleId: param.CycleId,
NodeName: "填写综合自评",
StatusName: "",
Types: "填写综合自评",
}
menu1_2 := adapter.MenuList{
menu1_2 := adapter.MenuListAdapter{
CycleId: param.CycleId,
NodeName: "查看综合自评",
StatusName: "",
... ... @@ -161,14 +170,14 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
}
menu1.Child = append(menu1.Child, menu1_1, menu1_2)
menuList = append(menuList, menu1)
menu2 := adapter.MenuList{
menu2 := adapter.MenuListAdapter{
CycleId: 0,
NodeName: "给他人评估",
StatusName: "",
Types: "",
Child: []adapter.MenuList{},
Child: []adapter.MenuListAdapter{},
}
menu2_1 := adapter.MenuList{
menu2_1 := adapter.MenuListAdapter{
CycleId: param.CycleId,
NodeName: "360综评",
StatusName: "",
... ... @@ -181,14 +190,14 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
}
menu2.Child = append(menu2.Child, menu2_1)
menuList = append(menuList, menu2)
menu3 := adapter.MenuList{
menu3 := adapter.MenuListAdapter{
CycleId: 0,
NodeName: "人资评估",
StatusName: "",
Types: "",
Child: []adapter.MenuList{},
Child: []adapter.MenuListAdapter{},
}
menu3_1 := adapter.MenuList{
menu3_1 := adapter.MenuListAdapter{
CycleId: param.CycleId,
NodeName: "上级综评",
StatusName: "",
... ... @@ -200,16 +209,18 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
menu3_1.StatusName = "已完成"
}
menu3.Child = append(menu3.Child, menu3_1)
menuList = append(menuList, menu3)
menu4 := adapter.MenuList{
//hrbp 才有这个菜单
if isHrbp > 0 {
menuList = append(menuList, menu3)
}
menu4 := adapter.MenuListAdapter{
CycleId: 0,
NodeName: "我的团队绩效",
StatusName: "",
Types: "",
Child: []adapter.MenuList{},
Child: []adapter.MenuListAdapter{},
}
menu4_1 := adapter.MenuList{
menu4_1 := adapter.MenuListAdapter{
CycleId: param.CycleId,
NodeName: "上级综评",
StatusName: "",
... ... @@ -229,7 +240,7 @@ func (srv *SummaryEvaluationServeice) GetMenu(param *command.QueryMenu) (map[str
}
// 获取综合自评详情
func (srv *SummaryEvaluationServeice) GetEvaluationSelf() {}
func (srv *SummaryEvaluationServeice) GetEvaluationSelf(param *command.QueryEvaluationInfo) {}
// 编辑综合自评详情
func (srv *SummaryEvaluationServeice) EditEvaluationSelf() {}
... ...