...
|
...
|
@@ -120,10 +120,37 @@ func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentivesEst |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
// 共创合约仓储初始化
|
|
|
var cooperationContractRepository domain.CooperationContractRepository
|
|
|
if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
cooperationContractRepository = value
|
|
|
}
|
|
|
// 查找共创合约
|
|
|
if count, cooperationContracts, err := cooperationContractRepository.Find(tool_funs.SimpleStructToMap(listMoneyIncentivesEstimateQuery)); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
var moneyIncentivesEstimateDtos []*dto.MoneyIncentivesEstimateDto
|
|
|
for _, cooperationContract := range cooperationContracts {
|
|
|
moneyIncentivesEstimateDto := &dto.MoneyIncentivesEstimateDto{}
|
|
|
if err := moneyIncentivesEstimateDto.LoadDto(cooperationContract); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
moneyIncentivesEstimateDtos = append(moneyIncentivesEstimateDtos, moneyIncentivesEstimateDto)
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
"grid": map[string]interface{}{
|
|
|
"total": count,
|
|
|
"list": moneyIncentivesEstimateDtos,
|
|
|
},
|
|
|
}, nil
|
|
|
}
|
|
|
return nil, nil
|
|
|
}
|
|
|
|
|
|
// CancelDividendsEstimate 取消分红预算单
|
...
|
...
|
|