作者 tangxvhui

更换路由

package command
type GetUserMessageCommand struct {
UserId int `json:"-"`
}
... ...
package notify
import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
// 个人信息提示
// 周期综合自评下发时 ,添加一条消息用于页面展示
func AddMessageSummaryEvaluation(param []*domain.SummaryEvaluation) error {
return nil
}
type MessageService struct {
}
func NewSummaryEvaluationService() *MessageService {
newService := &MessageService{}
return newService
}
package notify
import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/notify/command"
)
// 个人信息提示
type MessagePersonalService struct {
}
func NewMessagePersonalService() *MessagePersonalService {
newService := &MessagePersonalService{}
return newService
}
// 获取今天的周期综合自评消息提示
func (srv *MessagePersonalService) TodayMessageSummaryEvaluationSelf(param *command.GetUserMessageCommand) (interface{}, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
if err := transactionContext.StartTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
// nowTime := time.Now()
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
return nil, nil
}
... ...
... ... @@ -14,7 +14,7 @@ import (
// 导出数据
// 综合管理-周期评估
func (srv *SummaryEvaluationService) ExportAllEvaluationSuper(param *command.QueryEvaluationList) (*excelize.File, error) {
func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.QueryEvaluationList) (*excelize.File, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -1595,10 +1595,6 @@ func (srv *SummaryEvaluationService) GetTargetUserEvaluationSuper(param *command
return &result, nil
}
func (srv *SummaryEvaluationService) ListAllEvaluationSuper(param *command.QueryEvaluationList) (map[string]interface{}, error) {
return nil, nil
}
// 按周期获取所有员工的评估考核结果
func (srv *SummaryEvaluationService) ListAllEvaluationFinish(param *command.QueryEvaluationList) (map[string]interface{}, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
... ...
... ... @@ -12,7 +12,7 @@ type MessagePersonal struct {
Content string //消息的内容
CreatedAt time.Time
UpdatedAt time.Time
//Payload string //消息的额外承载的数据
Payload string //消息的额外承载的数据
}
type MessageTypes string
... ...
... ... @@ -321,7 +321,7 @@ func (c *SummaryEvaluationController) GetTargetUserEvaluationSuper() {
}
// 按周期获取上级评估列表
func (c *SummaryEvaluationController) ListAllEvaluationSuper() {
func (c *SummaryEvaluationController) ListAllEvaluationFinish() {
srv := service.NewSummaryEvaluationService()
param := &command.QueryEvaluationList{}
err := c.BindJSON(param)
... ... @@ -333,12 +333,12 @@ func (c *SummaryEvaluationController) ListAllEvaluationSuper() {
userReq := middlewares.GetUser(c.Ctx)
param.CompanyId = int(userReq.CompanyId)
param.UserId = int(userReq.UserId)
data, err := srv.ListAllEvaluationSuper(param)
data, err := srv.ListAllEvaluationFinish(param)
c.Response(data, err)
}
// 按周期 导出上级评估列表
func (c *SummaryEvaluationController) ExportAllEvaluationSuper() {
func (c *SummaryEvaluationController) ExportAllEvaluationFinish() {
srv := service.NewSummaryEvaluationService()
param := &command.QueryEvaluationList{}
err := c.BindJSON(param)
... ... @@ -350,7 +350,7 @@ func (c *SummaryEvaluationController) ExportAllEvaluationSuper() {
userReq := middlewares.GetUser(c.Ctx)
param.UserId = int(userReq.UserId)
param.CompanyId = int(userReq.CompanyId)
data, err := srv.ExportAllEvaluationSuper(param)
data, err := srv.ExportAllEvaluationFinish(param)
if err != nil {
c.Response(nil, err)
return
... ...
... ... @@ -29,8 +29,10 @@ func init() {
web.NSCtrlPost("/evaluation-super/list", (*controllers.SummaryEvaluationController).ListExecutorEvaluationSuper),
web.NSCtrlPost("/evaluation-super/confirm", (*controllers.SummaryEvaluationController).ConfirmScoreSuperEvaluation),
web.NSCtrlPost("/target_user/evaluation-super", (*controllers.SummaryEvaluationController).GetTargetUserEvaluationSuper),
web.NSCtrlPost("/evaluation-super/all", (*controllers.SummaryEvaluationController).ListAllEvaluationSuper),
web.NSCtrlPost("/evaluation-super/all/export", (*controllers.SummaryEvaluationController).ExportAllEvaluationSuper),
// web.NSCtrlPost("/evaluation-super/all", (*controllers.SummaryEvaluationController).ListAllEvaluationSuper),
web.NSCtrlPost("/evaluation-finish/all", (*controllers.SummaryEvaluationController).ListAllEvaluationFinish),
// web.NSCtrlPost("/evaluation-super/all/export", (*controllers.SummaryEvaluationController).ExportAllEvaluationSuper),
web.NSCtrlPost("/evaluation-finish/all/export", (*controllers.SummaryEvaluationController).ExportAllEvaluationFinish),
web.NSCtrlGet("/evaluation-self/now", (*controllers.SummaryEvaluationController).ListExecutorEvaluationSelf),
//
)
... ...