作者 陈志颖

合并分支 'dev' 到 'test'

Dev



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