作者 tangxvhui

更新

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
}
... ...
... ... @@ -2,6 +2,7 @@ package notify
import "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
// 执行定时任务检查是否发送短信通知
var taskSmsNotify *notifySms
// 检查并发送短信通知
... ... @@ -11,7 +12,6 @@ func RunTaskSmsNotify() {
taskSmsNotify.regist(notifyStaffAssess{})
taskSmsNotify.regist(notifySummaryEvaluation{})
taskSmsNotify.runTask()
}
// 每日自评短信通知 ,预创建待发送的短信消息
... ...
... ... @@ -502,7 +502,6 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app
// 编辑综合自评详情
func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvaluationValue) (map[string][]adapter.EvaluationItemAdapter, error) {
// xredis.NewLockSummaryEvaluation(param.SummaryEvaluationId)
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
... ...
... ... @@ -803,3 +803,45 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu
"evaluationItems": itemValueAdapter,
}, nil
}
func (srv *SummaryEvaluationService) SummaryEvaluationFinishNotUseSuper(
evaluation domain.SummaryEvaluation,
items []*domain.EvaluationItemUsed,
itemValue []*domain.SummaryEvaluationValue,
) []*domain.SummaryEvaluationValue {
typeSelf := map[int]*domain.SummaryEvaluationValue{}
typeHrbp360 := map[int]*domain.SummaryEvaluationValue{}
for _, v := range itemValue {
switch v.Types {
case domain.EvaluationSelf:
typeSelf[v.EvaluationItemId] = v
case domain.Evaluation360, domain.EvaluationHrbp:
typeHrbp360[v.EvaluationItemId] = v
}
}
newItemValue := []*domain.SummaryEvaluationValue{}
nowTime := time.Now()
for _, v := range items {
var itemValueTemp domain.SummaryEvaluationValue
if v.EvaluatorId == 0 {
if v2, ok := typeSelf[v.Id]; ok {
itemValueTemp = *v2
}
} else {
if v2, ok := typeHrbp360[v.Id]; ok {
itemValueTemp = *v2
}
}
if itemValueTemp.Id == 0 {
//360 hrbp,或者自评 都没有填写过
itemValueTemp.SetBlankValue(&evaluation, v)
}
//清理id信息
itemValueTemp.Id = 0
itemValueTemp.CreatedAt = nowTime
itemValueTemp.UpdatedAt = nowTime
newItemValue = append(newItemValue, &itemValueTemp)
}
return newItemValue
}
... ...
package domain
import "time"
// MessagePersonal 个人的消息提示
type MessagePersonal struct {
Id int //
Types string //消息类型
TargetUserId int //消息指向的用户
ReadFlag MessageReadFlag //1:已读、2:未读
Title string //消息的标题
Content string //消息的内容
CreatedAt time.Time
UpdatedAt time.Time
//Payload string //消息的额外承载的数据
}
type MessageTypes string
const (
MessageTypesOther MessageTypes = "other"
)
type MessageReadFlag string
const (
MessageIsRead MessageReadFlag = "read"
MessageUnread MessageReadFlag = "unread"
)
... ...
... ... @@ -37,7 +37,7 @@ func (itemValue *SummaryEvaluationValue) SetBlankValue(evaluation *SummaryEvalua
itemValue.EvaluationItemId = item.Id
itemValue.SummaryEvaluationId = evaluation.Id
itemValue.Value = ""
itemValue.Score = ""
itemValue.Score = "0"
itemValue.Remark = ""
itemValue.Weight = item.Weight
itemValue.CreatedAt = time.Now()
... ...