...
|
...
|
@@ -63,38 +63,48 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
|
// 自定义查询
|
|
|
queryOptions := make(map[string]interface{})
|
|
|
|
|
|
//参与分红类型,1承接人,2推荐人,3关联业务员
|
|
|
if dividendsEstimate.DividendsParticipateType == 1 { // 当前取消的是承接人的分红预算单
|
|
|
queryOptions = map[string]interface{}{
|
|
|
"companyId": dividendsEstimate.Company.CompanyId,
|
|
|
"orgId": dividendsEstimate.Org.OrgId,
|
|
|
"orderOrReturnedOrderNum": dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
"dividendsParticipateTypes": []int32{2, 3},
|
|
|
"offsetLimit": false,
|
|
|
"dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
"dividendsTypes": []int32{1, 2},
|
|
|
}
|
|
|
} else if dividendsEstimate.DividendsParticipateType == 2 { // 当前取消的是推荐人的分红预算单
|
|
|
queryOptions = map[string]interface{}{
|
|
|
"companyId": dividendsEstimate.Company.CompanyId,
|
|
|
"orgId": dividendsEstimate.Org.OrgId,
|
|
|
"orderOrReturnedOrderNum": dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
"dividendsParticipateTypes": []int32{1, 3},
|
|
|
"offsetLimit": false,
|
|
|
"dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
"dividendsTypes": []int32{1, 2},
|
|
|
}
|
|
|
} else if dividendsEstimate.DividendsParticipateType == 3 { // 当前取消的是关联业务员的分红预算单
|
|
|
queryOptions = map[string]interface{}{
|
|
|
"companyId": dividendsEstimate.Company.CompanyId,
|
|
|
"orgId": dividendsEstimate.Org.OrgId,
|
|
|
"orderOrReturnedOrderNum": dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
"dividendsParticipateTypes": []int32{1, 2},
|
|
|
"dividendsParticipateTypes": []int32{1, 2, 3},
|
|
|
"offsetLimit": false,
|
|
|
"dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
"dividendsTypes": []int32{1, 2},
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//参与分红类型,1承接人,2推荐人,3关联业务员
|
|
|
//if dividendsEstimate.DividendsParticipateType == 1 { // 当前取消的是承接人的分红预算单
|
|
|
// queryOptions = map[string]interface{}{
|
|
|
// "companyId": dividendsEstimate.Company.CompanyId,
|
|
|
// "orgId": dividendsEstimate.Org.OrgId,
|
|
|
// "orderOrReturnedOrderNum": dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
// "dividendsParticipateTypes": []int32{1, 2, 3},
|
|
|
// "offsetLimit": false,
|
|
|
// "dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
// "dividendsTypes": []int32{1, 2},
|
|
|
// }
|
|
|
//} else if dividendsEstimate.DividendsParticipateType == 2 { // 当前取消的是推荐人的分红预算单
|
|
|
// queryOptions = map[string]interface{}{
|
|
|
// "companyId": dividendsEstimate.Company.CompanyId,
|
|
|
// "orgId": dividendsEstimate.Org.OrgId,
|
|
|
// "orderOrReturnedOrderNum": dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
// "dividendsParticipateTypes": []int32{1, 3},
|
|
|
// "offsetLimit": false,
|
|
|
// "dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
// "dividendsTypes": []int32{1, 2},
|
|
|
// }
|
|
|
//} else if dividendsEstimate.DividendsParticipateType == 3 { // 当前取消的是关联业务员的分红预算单
|
|
|
// queryOptions = map[string]interface{}{
|
|
|
// "companyId": dividendsEstimate.Company.CompanyId,
|
|
|
// "orgId": dividendsEstimate.Org.OrgId,
|
|
|
// "orderOrReturnedOrderNum": dividendsEstimate.OrderOrReturnedOrderNum,
|
|
|
// "dividendsParticipateTypes": []int32{1, 2},
|
|
|
// "offsetLimit": false,
|
|
|
// "dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
// "dividendsTypes": []int32{1, 2},
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
// 根据当前分红预算单的分红订单号或退货单号获取相关的分红预算单
|
|
|
if countRelative, dividendsEstimatesRelative, err2 := dividendsEstimateRepository.Find(queryOptions); err2 != nil {
|
...
|
...
|
@@ -118,38 +128,48 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
|
// 自定义查询
|
|
|
queryOptions := make(map[string]interface{})
|
|
|
|
|
|
//参与分红类型,1承接人,2推荐人,3关联业务员
|
|
|
if dividendsEstimate.DividendsParticipateType == 1 { // 当前取消的是承接人的分红预算单
|
|
|
queryOptions = map[string]interface{}{
|
|
|
"companyId": dividendsEstimate.Company.CompanyId,
|
|
|
"orgId": dividendsEstimate.Org.OrgId,
|
|
|
"cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
"dividendsParticipateTypes": []int32{2, 3},
|
|
|
"offsetLimit": false,
|
|
|
"dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
"dividendsType": int32(3),
|
|
|
}
|
|
|
} else if dividendsEstimate.DividendsParticipateType == 2 { // 当前取消的是推荐人的分红预算单
|
|
|
queryOptions = map[string]interface{}{
|
|
|
"companyId": dividendsEstimate.Company.CompanyId,
|
|
|
"orgId": dividendsEstimate.Org.OrgId,
|
|
|
"cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
"dividendsParticipateTypes": []int32{1, 3},
|
|
|
"offsetLimit": false,
|
|
|
"dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
"dividendsType": int32(3),
|
|
|
}
|
|
|
} else if dividendsEstimate.DividendsParticipateType == 3 { // 当前取消的是关联业务员的分红预算单
|
|
|
queryOptions = map[string]interface{}{
|
|
|
"companyId": dividendsEstimate.Company.CompanyId,
|
|
|
"orgId": dividendsEstimate.Org.OrgId,
|
|
|
"cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
"dividendsParticipateTypes": []int32{1, 2},
|
|
|
"dividendsParticipateTypes": []int32{1, 2, 3},
|
|
|
"offsetLimit": false,
|
|
|
"dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
"dividendsType": int32(3),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//参与分红类型,1承接人,2推荐人,3关联业务员
|
|
|
//if dividendsEstimate.DividendsParticipateType == 1 { // 当前取消的是承接人的分红预算单
|
|
|
// queryOptions = map[string]interface{}{
|
|
|
// "companyId": dividendsEstimate.Company.CompanyId,
|
|
|
// "orgId": dividendsEstimate.Org.OrgId,
|
|
|
// "cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
// "dividendsParticipateTypes": []int32{2, 3},
|
|
|
// "offsetLimit": false,
|
|
|
// "dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
// "dividendsType": int32(3),
|
|
|
// }
|
|
|
//} else if dividendsEstimate.DividendsParticipateType == 2 { // 当前取消的是推荐人的分红预算单
|
|
|
// queryOptions = map[string]interface{}{
|
|
|
// "companyId": dividendsEstimate.Company.CompanyId,
|
|
|
// "orgId": dividendsEstimate.Org.OrgId,
|
|
|
// "cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
// "dividendsParticipateTypes": []int32{1, 3},
|
|
|
// "offsetLimit": false,
|
|
|
// "dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
// "dividendsType": int32(3),
|
|
|
// }
|
|
|
//} else if dividendsEstimate.DividendsParticipateType == 3 { // 当前取消的是关联业务员的分红预算单
|
|
|
// queryOptions = map[string]interface{}{
|
|
|
// "companyId": dividendsEstimate.Company.CompanyId,
|
|
|
// "orgId": dividendsEstimate.Org.OrgId,
|
|
|
// "cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
// "dividendsParticipateTypes": []int32{1, 2},
|
|
|
// "offsetLimit": false,
|
|
|
// "dividendsStage": dividendsEstimate.DividendsStage,
|
|
|
// "dividendsType": int32(3),
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
// 根据当前分红预算单的分红订单号或退货单号获取相关的分红预算单
|
|
|
if countRelative, dividendsEstimatesRelative, err2 := dividendsEstimateRepository.Find(queryOptions); err2 != nil {
|
...
|
...
|
|