作者 陈志颖

refactor:优化分红预算

@@ -8,6 +8,7 @@ import ( @@ -8,6 +8,7 @@ import (
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
10 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" 10 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
  11 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
11 rawlog "log" 12 rawlog "log"
12 ) 13 )
13 14
@@ -69,7 +70,7 @@ func (hook SqlGeneratePrintHook) AfterQuery(c context.Context, q *pg.QueryEvent) @@ -69,7 +70,7 @@ func (hook SqlGeneratePrintHook) AfterQuery(c context.Context, q *pg.QueryEvent)
69 if constant.LOG_FRAMEWORK == "logrus" { 70 if constant.LOG_FRAMEWORK == "logrus" {
70 rawlog.Println(string(sqlStr)) 71 rawlog.Println(string(sqlStr))
71 } else { 72 } else {
72 - //log.Logger.Debug(string(sqlStr)) 73 + log.Logger.Debug(string(sqlStr))
73 } 74 }
74 75
75 return nil 76 return nil
@@ -271,15 +271,16 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []* @@ -271,15 +271,16 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []*
271 if _, err := tx.Model(&dividendsEstimateModels).WherePK().Update(); err != nil { 271 if _, err := tx.Model(&dividendsEstimateModels).WherePK().Update(); err != nil {
272 return nil, err 272 return nil, err
273 } 273 }
274 - var dividendsEstimatesUpdated []*domain.DividendsEstimate  
275 - for _, dividendsEstimateModel := range dividendsEstimateModels {  
276 - if dividendsEstimate, err := transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel); err != nil {  
277 - return dividendsEstimates, err  
278 - } else {  
279 - dividendsEstimatesUpdated = append(dividendsEstimatesUpdated, dividendsEstimate)  
280 - }  
281 - }  
282 - return dividendsEstimatesUpdated, nil 274 + //var dividendsEstimatesUpdated []*domain.DividendsEstimate
  275 + //for _, dividendsEstimateModel := range dividendsEstimateModels {
  276 + // if dividendsEstimate, err := transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel); err != nil {
  277 + // return dividendsEstimates, err
  278 + // } else {
  279 + // dividendsEstimatesUpdated = append(dividendsEstimatesUpdated, dividendsEstimate)
  280 + // }
  281 + //}
  282 + //return dividendsEstimatesUpdated, nil
  283 + return dividendsEstimates, nil
283 } 284 }
284 285
285 func (repository *DividendsEstimateRepository) Remove(dividendsEstimate *domain.DividendsEstimate) (*domain.DividendsEstimate, error) { 286 func (repository *DividendsEstimateRepository) Remove(dividendsEstimate *domain.DividendsEstimate) (*domain.DividendsEstimate, error) {