作者 陈志颖

合并分支 'dev' 到 'test'

Dev



查看合并请求 !20
@@ -80,7 +80,6 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea @@ -80,7 +80,6 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea
80 organization = data 80 organization = data
81 } 81 }
82 82
83 - // 获取项目合约信息  
84 var cooperationContractRepository domain.CooperationContractRepository 83 var cooperationContractRepository domain.CooperationContractRepository
85 if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{ 84 if value, err := factory.CreateCooperationContractRepository(map[string]interface{}{
86 "transactionContext": transactionContext, 85 "transactionContext": transactionContext,
@@ -89,7 +88,13 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea @@ -89,7 +88,13 @@ func (contractUndertakerFeedbackService *ContractUndertakerFeedbackService) Crea
89 } else { 88 } else {
90 cooperationContractRepository = value 89 cooperationContractRepository = value
91 } 90 }
92 - cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{"cooperationContractNumber": createContractUndertakerFeedbackCommand.CooperationContractNumber}) 91 +
  92 + // 获取项目合约信息
  93 + cooperationContract, err := cooperationContractRepository.FindOne(map[string]interface{}{
  94 + "cooperationContractNumber": createContractUndertakerFeedbackCommand.CooperationContractNumber,
  95 + "companyId": createContractUndertakerFeedbackCommand.CompanyId,
  96 + "orgId": createContractUndertakerFeedbackCommand.OrgId,
  97 + })
93 if err != nil { 98 if err != nil {
94 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在") 99 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "共创合约不存在")
95 } 100 }
@@ -63,8 +63,8 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do @@ -63,8 +63,8 @@ func (domainService *ConfirmMoneyIncentivesEstimateService) Confirm(contract *do
63 if undertakerEstimated { 63 if undertakerEstimated {
64 return nil, fmt.Errorf("用户 " + undertaker.UserName + " 已分红") 64 return nil, fmt.Errorf("用户 " + undertaker.UserName + " 已分红")
65 } else { 65 } else {
66 - undertakerDividendsAmount, _ := decimal.NewFromFloat(moneyIncentivesRuleMatched.MoneyIncentivesAmount).  
67 - Mul(decimal.NewFromFloat(1).Sub(decimal.NewFromFloat(moneyIncentivesRuleMatched.SalesmanPercentage).Add(decimal.NewFromFloat(moneyIncentivesRuleMatched.ReferrerPercentage)).Div(decimal.NewFromFloat(100)))).Float64() 66 + undertakerDividendsAmount, _ := decimal.NewFromFloat(moneyIncentivesRuleMatched.MoneyIncentivesAmount).Float64()
  67 + //Mul(decimal.NewFromFloat(1).Sub(decimal.NewFromFloat(moneyIncentivesRuleMatched.SalesmanPercentage).Add(decimal.NewFromFloat(moneyIncentivesRuleMatched.ReferrerPercentage)).Div(decimal.NewFromFloat(100)))).Float64()
68 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{ 68 dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
69 DividendsUser: &domain.User{ 69 DividendsUser: &domain.User{
70 UserId: undertaker.UserId, 70 UserId: undertaker.UserId,
@@ -154,7 +154,10 @@ func (repository *ContractUndertakerFeedbackRepository) Find(queryOptions map[st @@ -154,7 +154,10 @@ func (repository *ContractUndertakerFeedbackRepository) Find(queryOptions map[st
154 contractUndertakerFeedbacks := make([]*domain.ContractUndertakerFeedback, 0) 154 contractUndertakerFeedbacks := make([]*domain.ContractUndertakerFeedback, 0)
155 query := sqlbuilder.BuildQuery(tx.Model(&contractUndertakerFeedbackModels), queryOptions) 155 query := sqlbuilder.BuildQuery(tx.Model(&contractUndertakerFeedbackModels), queryOptions)
156 if cooperationContractName, ok := queryOptions["cooperationContractName"]; ok && cooperationContractName != "" { 156 if cooperationContractName, ok := queryOptions["cooperationContractName"]; ok && cooperationContractName != "" {
157 - query.Where("cooperation_contract_number like ?", fmt.Sprintf("%%%s%%", cooperationContractName)) 157 + query.Where("cooperation_contract_name like ?", fmt.Sprintf("%%%s%%", cooperationContractName))
  158 + }
  159 + if cooperationContractNumber, ok := queryOptions["cooperationContractNumber"]; ok && cooperationContractNumber != "" {
  160 + query.Where("cooperation_contract_number = ?", cooperationContractNumber)
158 } 161 }
159 if undertakerName, ok := queryOptions["undertakerName"]; ok && undertakerName != "" { 162 if undertakerName, ok := queryOptions["undertakerName"]; ok && undertakerName != "" {
160 query.Where("contract_undertaker->>'userName' like ?", fmt.Sprintf("%%%s%%", undertakerName)) 163 query.Where("contract_undertaker->>'userName' like ?", fmt.Sprintf("%%%s%%", undertakerName))