...
|
...
|
@@ -833,7 +833,7 @@ func (rs *EvaluationProjectService) generateEvaluationItemUsed(transactionContex |
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
var err error
|
|
|
cnt, _, err := itemUsedRepo.Find(map[string]interface{}{"projectId": project.Id})
|
|
|
cnt, _, err := itemUsedRepo.Find(map[string]interface{}{"evaluationProjectId": project.Id})
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, "检查评估选项"+err.Error())
|
|
|
}
|
...
|
...
|
@@ -878,3 +878,31 @@ func (rs *EvaluationProjectService) generateEvaluationItemUsed(transactionContex |
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// 修复数据用
|
|
|
func (rs *EvaluationProjectService) FixEvaluationItemUsed(id int) error {
|
|
|
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
project, err := projectRepository.FindOne(map[string]interface{}{"id": id})
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
err = rs.generateEvaluationItemUsed(transactionContext, project)
|
|
|
if err != nil {
|
|
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return nil
|
|
|
} |
...
|
...
|
|