作者 tangxvhui

调整,弹窗消息输出数据

@@ -571,56 +571,56 @@ func (srv *MessagePersonalService) TodayMessageTaskAnomaly(param *command.GetUse @@ -571,56 +571,56 @@ func (srv *MessagePersonalService) TodayMessageTaskAnomaly(param *command.GetUse
571 } 571 }
572 572
573 // 提醒人员去确认周期评估的成绩 573 // 提醒人员去确认周期评估的成绩
574 -func (srv *MessagePersonalService) SummaartEvaluationScore(userId int) (msg map[string]interface{}, err error) {  
575 - msg = map[string]interface{}{  
576 - "needNotify": false,  
577 - "cycleId": "0",  
578 - "cycleName": "",  
579 - "targetUserId": "0",  
580 - "targetUserName": "",  
581 - }  
582 - transactionContext, err := factory.CreateTransactionContext(nil)  
583 - if err != nil {  
584 - return msg, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
585 - }  
586 - if err := transactionContext.StartTransaction(); err != nil {  
587 - return msg, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
588 - }  
589 - defer func() {  
590 - _ = transactionContext.RollbackTransaction()  
591 - }() 574 +// func (srv *MessagePersonalService) SummaartEvaluationScore(userId int) (msg map[string]interface{}, err error) {
  575 +// msg = map[string]interface{}{
  576 +// "needNotify": false,
  577 +// "cycleId": "0",
  578 +// "cycleName": "",
  579 +// "targetUserId": "0",
  580 +// "targetUserName": "",
  581 +// }
  582 +// transactionContext, err := factory.CreateTransactionContext(nil)
  583 +// if err != nil {
  584 +// return msg, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  585 +// }
  586 +// if err := transactionContext.StartTransaction(); err != nil {
  587 +// return msg, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  588 +// }
  589 +// defer func() {
  590 +// _ = transactionContext.RollbackTransaction()
  591 +// }()
592 592
593 - evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{  
594 - "transactionContext": transactionContext,  
595 - }) 593 +// evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{
  594 +// "transactionContext": transactionContext,
  595 +// })
596 596
597 - _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{  
598 - "targetUserId": userId,  
599 - "checkResult": domain.EvaluationCheckUncompleted,  
600 - "types": 5,  
601 - })  
602 - if err != nil {  
603 - return msg, application.ThrowError(application.TRANSACTION_ERROR, err.Error())  
604 - }  
605 - if len(evaluationList) == 0 {  
606 - return msg, nil  
607 - }  
608 - nowTime := time.Now()  
609 - for _, val := range evaluationList {  
610 - if nowTime.After(val.EndTime) {  
611 - msg = map[string]interface{}{  
612 - "needNotify": true,  
613 - "cycleId": strconv.FormatInt(val.CycleId, 10),  
614 - "cycleName": val.CycleName,  
615 - "targetUserId": strconv.Itoa(val.TargetUser.UserId),  
616 - "targetUserName": val.TargetUser.UserName,  
617 - }  
618 - break  
619 - }  
620 - }  
621 - if err := transactionContext.CommitTransaction(); err != nil {  
622 - return msg, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
623 - } 597 +// _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{
  598 +// "targetUserId": userId,
  599 +// "checkResult": domain.EvaluationCheckUncompleted,
  600 +// "types": 5,
  601 +// })
  602 +// if err != nil {
  603 +// return msg, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  604 +// }
  605 +// if len(evaluationList) == 0 {
  606 +// return msg, nil
  607 +// }
  608 +// nowTime := time.Now()
  609 +// for _, val := range evaluationList {
  610 +// if nowTime.After(val.EndTime) {
  611 +// msg = map[string]interface{}{
  612 +// "needNotify": true,
  613 +// "cycleId": strconv.FormatInt(val.CycleId, 10),
  614 +// "cycleName": val.CycleName,
  615 +// "targetUserId": strconv.Itoa(val.TargetUser.UserId),
  616 +// "targetUserName": val.TargetUser.UserName,
  617 +// }
  618 +// break
  619 +// }
  620 +// }
  621 +// if err := transactionContext.CommitTransaction(); err != nil {
  622 +// return msg, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  623 +// }
624 624
625 - return msg, nil  
626 -} 625 +// return msg, nil
  626 +// }
@@ -918,7 +918,11 @@ func (srv *SummaryEvaluationService) GetUnconfirmedCycleList(companyId int, user @@ -918,7 +918,11 @@ func (srv *SummaryEvaluationService) GetUnconfirmedCycleList(companyId int, user
918 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 918 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
919 } 919 }
920 var cycleList []adapter.CycleListAdapter 920 var cycleList []adapter.CycleListAdapter
  921 + nowTime := time.Now()
921 for _, v := range cycles { 922 for _, v := range cycles {
  923 + if nowTime.Before(v.EndTime) {
  924 + continue
  925 + }
922 cycleList = append(cycleList, adapter.CycleListAdapter{ 926 cycleList = append(cycleList, adapter.CycleListAdapter{
923 CycleId: v.CycleId, 927 CycleId: v.CycleId,
924 CycleName: v.CycleName, 928 CycleName: v.CycleName,
@@ -88,6 +88,7 @@ type TargetUserCycle struct { @@ -88,6 +88,7 @@ type TargetUserCycle struct {
88 CycleId string `pg:"cycle_id" ` //周期id 88 CycleId string `pg:"cycle_id" ` //周期id
89 CycleName string `pg:"cycle_name"` //周期名称 89 CycleName string `pg:"cycle_name"` //周期名称
90 BeginTime time.Time `pg:"begin_time"` 90 BeginTime time.Time `pg:"begin_time"`
  91 + EndTime time.Time `pg:"end_time"`
91 } 92 }
92 93
93 // GetExecutorCycleList 获取被评估目标人拥有的周期列表 94 // GetExecutorCycleList 获取被评估目标人拥有的周期列表
@@ -145,6 +146,7 @@ func (d *SummaryEvaluationDao) TargetUnconfirmedCycleList(companyId int, executo @@ -145,6 +146,7 @@ func (d *SummaryEvaluationDao) TargetUnconfirmedCycleList(companyId int, executo
145 sqlStr := `select 146 sqlStr := `select
146 summary_evaluation.cycle_id, 147 summary_evaluation.cycle_id,
147 summary_evaluation.begin_time, 148 summary_evaluation.begin_time,
  149 + summary_evaluation.end_time,
148 summary_evaluation.cycle_name 150 summary_evaluation.cycle_name
149 from summary_evaluation 151 from summary_evaluation
150 where summary_evaluation.deleted_at isnull 152 where summary_evaluation.deleted_at isnull
@@ -49,11 +49,3 @@ func (c *MessagePersonalController) TodayMessageTaskStageModify() { @@ -49,11 +49,3 @@ func (c *MessagePersonalController) TodayMessageTaskStageModify() {
49 data, err := srv.TodayMessageTaskStageModifyV2(&param) 49 data, err := srv.TodayMessageTaskStageModifyV2(&param)
50 c.Response(data, err) 50 c.Response(data, err)
51 } 51 }
52 -  
53 -func (c *MessagePersonalController) TodayMessageSummaryEvaluationFinishScore() {  
54 - srv := service.NewMessagePersonalService()  
55 - userReq := middlewares.GetUser(c.Ctx)  
56 - userId := int(userReq.UserId)  
57 - data, err := srv.SummaartEvaluationScore(userId)  
58 - c.Response(data, err)  
59 -}  
@@ -14,7 +14,6 @@ func init() { @@ -14,7 +14,6 @@ func init() {
14 web.NSCtrlGet("/summary-evaluation/task_stage/today", (*controllers.MessagePersonalController).TodayMessageTaskStageAnomaly), 14 web.NSCtrlGet("/summary-evaluation/task_stage/today", (*controllers.MessagePersonalController).TodayMessageTaskStageAnomaly),
15 web.NSCtrlGet("/summary-evaluation/task_record/today", (*controllers.MessagePersonalController).TodayMessageTaskRecordAnomaly), 15 web.NSCtrlGet("/summary-evaluation/task_record/today", (*controllers.MessagePersonalController).TodayMessageTaskRecordAnomaly),
16 web.NSCtrlGet("/summary-evaluation/task_modify/today", (*controllers.MessagePersonalController).TodayMessageTaskStageModify), 16 web.NSCtrlGet("/summary-evaluation/task_modify/today", (*controllers.MessagePersonalController).TodayMessageTaskStageModify),
17 - web.NSCtrlGet("/summary-evaluation-finish/confim-score", (*controllers.MessagePersonalController).TodayMessageSummaryEvaluationFinishScore),  
18 ) 17 )
19 web.AddNamespace(ns) 18 web.AddNamespace(ns)
20 } 19 }