作者 郑周

Merge branch 'test' into dev-zhengzhou

package notify
import "testing"
func TestXxx(t *testing.T) {
err := appMessageSend()
if err != nil {
t.Error(err)
}
}
... ...
... ... @@ -205,7 +205,10 @@ func (e *exportData3) FormatListValue(param []dao.DataStaffAssessContent2) {
e.data[key] = &strings.Builder{}
e.data[key].WriteString(val.Value + "\n") //填写的等级
for _, vv := range val.Remark {
e.data[key].WriteString(vv.Title + "\n")
vv.Title = strings.TrimSpace(vv.Title)
if vv.Title != "填写自评反馈" {
e.data[key].WriteString(vv.Title + "\n")
}
e.data[key].WriteString(vv.RemarkText + "\n")
}
dayKey := val.TargetUserId + val.EvaluationProjectId + val.BeginDay
... ...
... ... @@ -174,7 +174,10 @@ func (e *exportData2) setData(param []dao.ExportData1) {
e.data[key] = &strings.Builder{}
e.data[key].WriteString(v.Value + "\n")
for _, v2 := range v.Remark {
e.data[key].WriteString(v2.Title + "\n")
v2.Title = strings.TrimSpace(v2.Title)
if v2.Title != "填写自评反馈" {
e.data[key].WriteString(v2.Title + "\n")
}
e.data[key].WriteString(v2.RemarkText + "\n")
}
}
... ...
... ... @@ -50,18 +50,18 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu
positionRepo := factory.CreatePositionRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
limit := param.PageSize
offset := (param.PageNumber - 1) * param.PageSize
// limit := param.PageSize
// offset := (param.PageNumber - 1) * param.PageSize
//获取评估列表信息
condition1 := map[string]interface{}{
"cycleId": param.CycleId,
"types": int(domain.EvaluationFinish),
"limit": limit,
}
if offset > 0 {
condition1["offset"] = offset
"limit": 5000,
}
// if offset > 0 {
// condition1["offset"] = offset
// }
if len(param.TargetUserName) > 0 {
condition1["targetUserName"] = "%" + param.TargetUserName + "%"
}
... ... @@ -147,6 +147,8 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu
firstSheetName := xlsxFile.GetSheetName(sheetIndex)
tableHead := []string{"姓名", "部门", "职位", "最终绩效得分"}
tableHead = append(tableHead, ratingHeader...)
// 最后一列
tableHead = append(tableHead, "备注")
if len(evaluationList) > 0 {
xlsxFile.SetSheetRow(firstSheetName, "A1", &[]string{evaluationList[0].CycleName + "最终成绩"})
if len(tableHead) > 1 {
... ... @@ -171,7 +173,7 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu
}
}
}
dataRaw := []string{
dataRow := []string{
v.TargetUser.UserName,
departmentName,
positinName,
... ... @@ -179,12 +181,18 @@ func (srv *SummaryEvaluationService) ExportAllEvaluationFinish(param *command.Qu
}
for _, v2 := range ratingHeader {
if num, ok := evaluationRatingMap[v.Id][v2]; ok {
dataRaw = append(dataRaw, fmt.Sprintf("%d", num))
dataRow = append(dataRow, fmt.Sprintf("%d", num))
} else {
dataRaw = append(dataRaw, "0")
dataRow = append(dataRow, "0")
}
}
xlsxFile.SetSheetRow(firstSheetName, fmt.Sprintf("A%d", i+firstDataRow), &dataRaw)
if v.CheckResult == domain.EvaluationCheckCompleted {
dataRow = append(dataRow, "已确认")
} else {
dataRow = append(dataRow, "未确认")
}
//最后一列
xlsxFile.SetSheetRow(firstSheetName, fmt.Sprintf("A%d", i+firstDataRow), &dataRow)
}
return xlsxFile, nil
}
... ...
... ... @@ -810,7 +810,11 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSuper(param *domain
if len(evaluationList) > 0 {
//上级评估的结束时间
evaluationList[0].BeginTime = param.EndTime
// evaluationList[0].BeginTime = param.EndTime
nowTime := time.Now()
if evaluationList[0].BeginTime.After(nowTime) {
evaluationList[0].BeginTime = nowTime
}
evaluationList[0].Status = domain.EvaluationCompleted
err = evaluationRepo.Save(evaluationList[0])
if err != nil {
... ...
... ... @@ -104,7 +104,7 @@ where 1=1
and staff_assess.cycle_id =? and "types" ='self'
and staff_assess.evaluation_project_id in (
select t_project_4.project_id from t_project_4
) `
) order by evaluation_item_used.sort_by `
condition := []interface{}{cycleId}
if len(exportUserIds) > 0 {
sqlStr += ` and staff_assess.target_user->>'userId' in(?) `
... ...
... ... @@ -5,7 +5,9 @@ import "testing"
func TestPushInfo(t *testing.T) {
//测试消息推送
c := NewHttplibMmmOpenApiServiceGateway()
resp, err := c.PushInfo(0, "mmm.ability.performance", []int64{3422174102828544}, "ceshi推送一个消息233", "消息内容xxxx332")
//3436890424617728
//3422173870118400
resp, err := c.PushInfo(0, "mmm.ability.performance", []int64{3436890424617728}, "ceshi推送一个消息233", "消息内容xxxx332")
if err != nil {
t.Error(err)
}
... ...