作者 陈志颖

fix:金额激励分红名单

... ... @@ -159,12 +159,16 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
}
// 校验承接人是否属于承接对象,1员工,2共创用户,4公开
typeExist := false
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 3) {
for _, userType := range createCooperationContractCommand.CooperationContractUndertakerTypes {
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
if utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
typeExist = true
}
}
if !typeExist {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
}
}
// 获取推荐人
... ... @@ -1027,12 +1031,16 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
}
// 校验:判断用户类型是否属于承接对象
typeExist := false
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
for _, userType := range cooperationContract.CooperationContractUndertakerTypes {
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
if utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
typeExist = true
}
}
if !typeExist {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
}
}
// 获取推荐人
... ...
... ... @@ -1432,7 +1432,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesE
} else {
if countDividendsEstimates > 0 { // 已有分红
for _, dividendsEstimate := range dividendsEstimates {
if dividendsEstimate.DividendsAccountStatus == 1 || dividendsEstimate.IsCanceled { // 分红预算单状态为待结算或已取消
if dividendsEstimate.IsCanceled { // 分红预算单状态为已取消
stageUndertakerMap[dividendsEstimate.DividendsStage] = append(stageUndertakerMap[dividendsEstimate.DividendsStage], undertaker)
}
}
... ...