作者 tangxvhui

Merge branch '1.3.2-bug' into test

... ... @@ -1280,18 +1280,12 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
}
// 首次提交任务记录(未过期前可以多次编辑提交)
var isFirstSubmit = false
for i := range taskRecords {
it := taskRecords[i]
if v, ok := recordMap[it.Id]; ok {
it.AssistLevel = v.AssistLevel // 更新上级辅导情况
it.AssistContent = v.AssistContent // 更新上级辅导内容
if !isFirstSubmit && it.AnomalyState == domain.AnomalyStateInit {
isFirstSubmit = true
}
var anomalyState = domain.AnomalyState0
key := fmt.Sprintf("%s-%s", v.Category, v.Name)
if item, ok := contentCategoryMap[key]; ok {
... ... @@ -1299,7 +1293,7 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
trimSpace := strings.TrimLeft(remark.RemarkText, "\n") // 去掉前换行符
trimSpace = strings.TrimRight(trimSpace, "\n") // 去掉后换行符
trimSpace = strings.TrimSpace(trimSpace) // 去掉前后空格符
if !(len(trimSpace) == 0 || trimSpace == "无") { // 有一个填写项是正常即可
if !(len(trimSpace) == 0 || trimSpace == "无") { // 有一个填写项就恢复正常状态
anomalyState = domain.AnomalyState1
break
}
... ... @@ -1341,7 +1335,7 @@ func (srv StaffAssessServeice) SaveSelfAssess(in *command.SaveSelfAssessCommand)
}
if len(taskRecords) > 0 {
err := taskService.NewTaskService().ReplyTaskStage(transactionContext, taskRecords, isFirstSubmit)
err := taskService.NewTaskService().ReplyTaskStage(transactionContext, taskRecords)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "更新里程碑数据:"+err.Error())
}
... ...
... ... @@ -733,7 +733,7 @@ func (srv TaskService) CancelAttention(param *command.CancelAttentionCommand) er
}
// ReplyTaskStage 根据每日的任务反馈 ,更新任务里程碑
func (srv TaskService) ReplyTaskStage(transactionContext application.TransactionContext, param []*domain.TaskRecord, isFirstSubmit bool) error {
func (srv TaskService) ReplyTaskStage(transactionContext application.TransactionContext, param []*domain.TaskRecord) error {
taskRepo := factory.CreateTaskRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
... ...