作者 陈志颖

合并分支 'dev' 到 'test'

fix:分红退货单分红状态更新



查看合并请求 !33
... ... @@ -893,6 +893,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent
dividendsGoodCount = dividendsGoodCount + 1
}
}
if dividendsGoodCount == len(dividendsReturnedOrderFound.Goods) { // 2已分红
dividendsReturnedOrdersFound[i].DividendStatus = 2
} else if dividendsGoodCount > 0 && dividendsGoodCount < len(dividendsReturnedOrderFound.Goods) { // 3部分分红
... ...
... ... @@ -60,24 +60,36 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
"orgId": orderGood.OrgId,
})
if err != nil {
var orderNumber string
if orderGood.DividendsOrderNumber != "" {
orderNumber = orderGood.DividendsOrderNumber
} else {
orderNumber = orderGood.DividendsReturnedOrderNumber
}
dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
DividendsUser: nil,
DividendsParticipateType: 0,
DividendsStage: 0,
DividendsAmount: 0,
OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber,
OrderOrReturnedOrderNumber: orderNumber,
IsSuccessfully: false,
Reason: "共创合约错误",
})
continue
}
if cooperationContract == nil {
var orderNumber string
if orderGood.DividendsOrderNumber != "" {
orderNumber = orderGood.DividendsOrderNumber
} else {
orderNumber = orderGood.DividendsReturnedOrderNumber
}
dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
DividendsUser: nil,
DividendsParticipateType: 0,
DividendsStage: 0,
DividendsAmount: 0,
OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber,
OrderOrReturnedOrderNumber: orderNumber,
IsSuccessfully: false,
Reason: "共创合约" + orderGood.CooperationContractNumber + "不存在",
})
... ... @@ -92,12 +104,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
//"notPause": true,
})
if err != nil {
var orderNumber string
if orderGood.DividendsOrderNumber != "" {
orderNumber = orderGood.DividendsOrderNumber
} else {
orderNumber = orderGood.DividendsReturnedOrderNumber
}
dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
DividendsUser: nil,
DividendsParticipateType: 0,
DividendsStage: 0,
DividendsAmount: 0,
OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber,
OrderOrReturnedOrderNumber: orderNumber,
IsSuccessfully: false,
Reason: "共创项目" + orderGood.CooperationContractNumber + "查询错误",
})
... ... @@ -105,12 +123,18 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
//return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if cooperationProject == nil {
var orderNumber string
if orderGood.DividendsOrderNumber != "" {
orderNumber = orderGood.DividendsOrderNumber
} else {
orderNumber = orderGood.DividendsReturnedOrderNumber
}
dividendsEstimateDetails = append(dividendsEstimateDetails, &service.DividendsEstimateDetail{
DividendsUser: nil,
DividendsParticipateType: 0,
DividendsStage: 0,
DividendsAmount: 0,
OrderOrReturnedOrderNumber: orderGood.DividendsOrderNumber,
OrderOrReturnedOrderNumber: orderNumber,
IsSuccessfully: false,
Reason: "共创项目" + orderGood.CooperationContractNumber + "已结束或不存在",
})
... ... @@ -316,7 +340,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
DividendsParticipateType: domain.UNDERTAKER,
DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage,
DividendsAmount: -undertakerDividendsAmount,
OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsOrderNumber,
OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsReturnedOrderNumber,
IsSuccessfully: true,
})
}
... ... @@ -342,7 +366,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
DividendsParticipateType: domain.REFERRER,
DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage,
DividendsAmount: -referrerDividendsAmount,
OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsOrderNumber,
OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsReturnedOrderNumber,
IsSuccessfully: true,
})
}
... ... @@ -369,7 +393,7 @@ func (domainService *ConfirmDividendsIncentivesEstimateService) Confirm(orderGoo
DividendsParticipateType: domain.SALESMAN,
DividendsStage: dividendsIncentivesRuleMatched.DividendsIncentivesStage,
DividendsAmount: -salesmanDividendsAmount,
OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsOrderNumber,
OrderOrReturnedOrderNumber: dividendsReturnedOrder.DividendsReturnedOrderNumber,
IsSuccessfully: true,
})
}
... ...