...
|
...
|
@@ -246,10 +246,27 @@ func (cooperationModeService *CooperationModeService) SearchCooperationMode(sear |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
var cooperationModeRepository domain.CooperationModeRepository
|
|
|
if value, err := factory.CreateCooperationModeRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
cooperationModeRepository = value
|
|
|
}
|
|
|
if count, cooperationModes, err := cooperationModeRepository.Find(tool_funs.SimpleStructToMap(searchCooperationModeQuery)); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
"grid": map[string]interface{}{
|
|
|
"list": cooperationModes,
|
|
|
"total": count,
|
|
|
},
|
|
|
}, nil
|
|
|
}
|
|
|
return nil, nil
|
|
|
}
|
|
|
|
|
|
// UpdateCooperationMode 更新共创模式服务
|
...
|
...
|
@@ -280,7 +297,7 @@ func (cooperationModeService *CooperationModeService) UpdateCooperationMode(upda |
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if cooperationMode == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateCooperationModeCommand.CooperationModeId)))
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", strconv.FormatInt(updateCooperationModeCommand.CooperationModeId, 10)))
|
|
|
}
|
|
|
if err := cooperationMode.Update(tool_funs.SimpleStructToMap(updateCooperationModeCommand)); err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
|