...
|
...
|
@@ -84,6 +84,25 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
|
dividendsEstimatesCanceled = append(dividendsEstimatesCanceled, dividendsEstimatesRelativeCanceled...)
|
|
|
}
|
|
|
}
|
|
|
} else if dividendsEstimate.DividendsType == 3 {
|
|
|
// 根据当前分红预算单的分红订单号或退货单号获取相关的分红预算单
|
|
|
if countRelative, dividendsEstimatesRelative, err2 := dividendsEstimateRepository.Find(map[string]interface{}{
|
|
|
"companyId": dividendsEstimate.Company.CompanyId,
|
|
|
"orgId": dividendsEstimate.Org.OrgId,
|
|
|
"cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
"dividendsType": int32(3),
|
|
|
"offsetLimit": false,
|
|
|
}); err2 != nil {
|
|
|
return nil, err2
|
|
|
} else {
|
|
|
if countRelative > 0 {
|
|
|
dividendsEstimatesRelativeCanceled, err3 := dividendsEstimateRepository.UpdateMany(dividendsEstimatesRelative)
|
|
|
if err3 != nil {
|
|
|
return nil, err3
|
|
|
}
|
|
|
dividendsEstimatesCanceled = append(dividendsEstimatesCanceled, dividendsEstimatesRelativeCanceled...)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -102,7 +121,7 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 获取分红订单
|
|
|
// 获取分红订单并更新分红订单产品的状态
|
|
|
if len(orderNums) > 0 {
|
|
|
if countDividendsOrder, orders, err4 := dividendsOrderRepository.Find(map[string]interface{}{
|
|
|
"companyId": dividendsEstimates[0].Company.CompanyId,
|
...
|
...
|
@@ -147,7 +166,7 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 获取分红退货单
|
|
|
// 获取分红退货单并更新订单产品的状态
|
|
|
if len(returnedOrderNums) > 0 {
|
|
|
if countDividendsReturnedOrder, returnedOrders, err5 := dividendsReturnedOrderRepository.Find(map[string]interface{}{
|
|
|
"companyId": dividendsEstimates[0].Company.CompanyId,
|
...
|
...
|
|