作者 陈志颖

fix:修复分红退货单批量删除

  1 +package dto
  2 +
  3 +import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
  4 +
  5 +type CooperationContractByUndertakerDto struct {
  6 +}
  7 +
  8 +func (dto *CooperationContractByUndertakerDto) LoadDto(contract *domain.CooperationContract) error {
  9 + return nil
  10 +}
@@ -791,7 +791,7 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC @@ -791,7 +791,7 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC
791 } 791 }
792 } 792 }
793 793
794 -// SearchCooperationContractByUndertaker 根据承接人返回共创项目合约 794 +// SearchCooperationContractByUndertaker TODO 根据承接人返回共创项目合约
795 func (cooperationContractService *CooperationContractService) SearchCooperationContractByUndertaker(searchCooperationContractByUndertakerQuery *query.SearchCooperationContractByUndertakerQuery) (interface{}, error) { 795 func (cooperationContractService *CooperationContractService) SearchCooperationContractByUndertaker(searchCooperationContractByUndertakerQuery *query.SearchCooperationContractByUndertakerQuery) (interface{}, error) {
796 if err := searchCooperationContractByUndertakerQuery.ValidateQuery(); err != nil { 796 if err := searchCooperationContractByUndertakerQuery.ValidateQuery(); err != nil {
797 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 797 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
@@ -34,7 +34,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide @@ -34,7 +34,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDivide
34 _ = transactionContext.RollbackTransaction() 34 _ = transactionContext.RollbackTransaction()
35 }() 35 }()
36 36
37 - // 公司REST服务初始 37 + // 公司REST服务初始
38 var companyService service.CompanyService 38 var companyService service.CompanyService
39 if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil { 39 if value, err := factory.CreateCompanyService(map[string]interface{}{}); err != nil {
40 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 40 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -462,6 +462,10 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) BatchRemoveD @@ -462,6 +462,10 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) BatchRemoveD
462 dividendsReturnedOrderRepository = value 462 dividendsReturnedOrderRepository = value
463 } 463 }
464 464
  465 + if len(batchRemoveDividendsOrderCommand.DividendsReturnedOrderIds) == 0 {
  466 + return nil, nil
  467 + }
  468 +
465 dividendsReturnedOrderIds, err := utils.SliceAtoi(batchRemoveDividendsOrderCommand.DividendsReturnedOrderIds) 469 dividendsReturnedOrderIds, err := utils.SliceAtoi(batchRemoveDividendsOrderCommand.DividendsReturnedOrderIds)
466 if err != nil { 470 if err != nil {
467 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红退货单号错误") 471 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "分红退货单号错误")
@@ -191,7 +191,7 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do @@ -191,7 +191,7 @@ func (repository *DividendsEstimateRepository) SaveMany(dividendsEstimates []*do
191 if _, err := tx.Model(&dividendsEstimateModels).Insert(); err != nil { 191 if _, err := tx.Model(&dividendsEstimateModels).Insert(); err != nil {
192 return nil, err 192 return nil, err
193 } 193 }
194 - dividendsEstimatesSaved := []*domain.DividendsEstimate{} 194 + var dividendsEstimatesSaved []*domain.DividendsEstimate
195 for _, dividendsEstimateModel := range dividendsEstimateModels { 195 for _, dividendsEstimateModel := range dividendsEstimateModels {
196 if dividendsEstimate, err := transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel); err != nil { 196 if dividendsEstimate, err := transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel); err != nil {
197 return dividendsEstimates, err 197 return dividendsEstimates, err