作者 郑周

1. 优化

@@ -1281,16 +1281,15 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand) @@ -1281,16 +1281,15 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
1281 } 1281 }
1282 } 1282 }
1283 } 1283 }
1284 -  
1285 - if anomalyState == domain.AnomalyState0 {  
1286 - trimSpace := strings.TrimLeft(it.AssistContent, "\n") // 去掉前换行符  
1287 - trimSpace = strings.TrimRight(trimSpace, "\n") // 去掉后换行符  
1288 - trimSpace = strings.TrimSpace(trimSpace) // 去掉前后空格符  
1289 - // 上级填写内容有值,选项是已辅导,变为正常  
1290 - if !(len(trimSpace) == 0 || trimSpace == "无") && it.AssistLevel >= domain.AssistLevel2 {  
1291 - anomalyState = domain.AnomalyState1  
1292 - }  
1293 - } 1284 + //if anomalyState == domain.AnomalyState0 {
  1285 + // trimSpace := strings.TrimLeft(it.AssistContent, "\n") // 去掉前换行符
  1286 + // trimSpace = strings.TrimRight(trimSpace, "\n") // 去掉后换行符
  1287 + // trimSpace = strings.TrimSpace(trimSpace) // 去掉前后空格符
  1288 + // // 上级填写内容有值,选项是已辅导,变为正常
  1289 + // if !(len(trimSpace) == 0 || trimSpace == "无") && it.AssistLevel >= domain.AssistLevel2 {
  1290 + // anomalyState = domain.AnomalyState1
  1291 + // }
  1292 + //}
1294 it.AnomalyState = anomalyState 1293 it.AnomalyState = anomalyState
1295 1294
1296 // 更新里程碑状态 1295 // 更新里程碑状态
@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
4 "encoding/json" 4 "encoding/json"
5 "fmt" 5 "fmt"
6 "strconv" 6 "strconv"
  7 + "strings"
7 "time" 8 "time"
8 9
9 "github.com/linmadan/egglib-go/core/application" 10 "github.com/linmadan/egglib-go/core/application"
@@ -922,11 +923,18 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction @@ -922,11 +923,18 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction
922 if err != nil { 923 if err != nil {
923 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务里程碑数据"+err.Error()) 924 return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务里程碑数据"+err.Error())
924 } 925 }
925 - if val.AnomalyState == domain.AnomalyState1 {  
926 - taskData.Anomaly = 0  
927 - } else { 926 +
  927 + if val.AnomalyState == domain.AnomalyState0 {
928 taskData.Anomaly += 1 928 taskData.Anomaly += 1
929 } 929 }
  930 + trimSpace := strings.TrimLeft(val.AssistContent, "\n") // 去掉前换行符
  931 + trimSpace = strings.TrimRight(trimSpace, "\n") // 去掉后换行符
  932 + trimSpace = strings.TrimSpace(trimSpace) // 去掉前后空格符
  933 + // 上级填写内容有值,选项是已辅导,变为正常
  934 + if !(len(trimSpace) == 0 || trimSpace == "无") && val.AssistLevel >= domain.AssistLevel2 {
  935 + taskData.Anomaly = 0
  936 + }
  937 +
930 for _, val2 := range stageList { 938 for _, val2 := range stageList {
931 if val2.Id != val.TaskStageCheck.Id { 939 if val2.Id != val.TaskStageCheck.Id {
932 continue 940 continue