作者 陈志颖

feat:分红预算增加查询方法

... ... @@ -392,6 +392,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsEstimate(
defer func() {
_ = transactionContext.RollbackTransaction()
}()
// 分红预算仓储初始化
var dividendsEstimateRepository domain.DividendsEstimateRepository
if value, err := factory.CreateDividendsEstimateRepository(map[string]interface{}{
"transactionContext": transactionContext,
... ... @@ -470,10 +471,28 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat
defer func() {
_ = transactionContext.RollbackTransaction()
}()
// 分红预算仓储初始化
var dividendsEstimateRepository domain.DividendsEstimateRepository
if value, err := factory.CreateDividendsEstimateRepository(map[string]interface{}{
"transactionContext": transactionContext,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
dividendsEstimateRepository = value
}
if count, dividendsEstimates, err := dividendsEstimateRepository.Find(tool_funs.SimpleStructToMap(searchDividendsEstimateQuery)); 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 nil, nil
return map[string]interface{}{
"grid": map[string]interface{}{
"total": count,
"list": dividendsEstimates,
},
}, nil
}
}
// SearchDividendsIncentivesEstimate 查询业绩激励分红预算
... ...