...
|
...
|
@@ -9,6 +9,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
type EvaluationProjectService struct {
|
...
|
...
|
@@ -177,18 +178,31 @@ func (rs *EvaluationProjectService) UpdateTemplate(in *command.UpdateProjectTemp |
|
|
project.State = domain.ProjectStateEnable
|
|
|
}
|
|
|
|
|
|
start, err := time.ParseInLocation("2006-01-02 15:04:05", in.TimeStart, time.Local)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
end, err := time.ParseInLocation("2006-01-02 15:04:05", in.TimeEnd, time.Local)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
kpiStart, err := time.ParseInLocation("2006-01-02 15:04:05", in.KpiResultStart, time.Local)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
project.Recipients = in.Recipients
|
|
|
project.Template = cycleTemplate.Template
|
|
|
for i := range project.Template.LinkNodes {
|
|
|
node := project.Template.LinkNodes[i]
|
|
|
node.KpiCycle = in.KpiCycle // 设置周期
|
|
|
if node.Type == domain.LinkNodeViewResult {
|
|
|
if in.KpiResultStart != nil {
|
|
|
node.TimeStart = in.KpiResultStart
|
|
|
if len(in.KpiResultStart) > 0 {
|
|
|
node.TimeStart = &kpiStart
|
|
|
}
|
|
|
} else {
|
|
|
node.TimeStart = in.TimeStart
|
|
|
node.TimeEnd = in.TimeEnd
|
|
|
node.TimeStart = &start
|
|
|
node.TimeEnd = &end
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -404,5 +418,5 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo |
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return repeatNum, nil
|
|
|
return map[string]interface{}{"repeatNum": repeatNum}, nil
|
|
|
} |
...
|
...
|
|