...
|
...
|
@@ -800,6 +800,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
|
// 分离分红订单和退货单
|
|
|
dividendsOrderNumbers := make([]string, 0)
|
|
|
dividendsReturnedOrderNumbers := make([]string, 0)
|
|
|
if len(estimateSuccessfullyDividendsOrders) > 0 {
|
|
|
for k, _ := range estimateSuccessfullyDividendsOrders {
|
|
|
if k[:2] == "RE" { // 分红退货单
|
|
|
dividendsReturnedOrderNumbers = append(dividendsReturnedOrderNumbers, k)
|
...
|
...
|
@@ -807,6 +808,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
|
dividendsOrderNumbers = append(dividendsOrderNumbers, k)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 分红订单仓储初始化
|
|
|
var dividendsOrderRepository domain.DividendsOrderRepository
|
...
|
...
|
@@ -819,6 +821,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
|
}
|
|
|
|
|
|
// 查找分红订单
|
|
|
if len(dividendsOrderNumbers) > 0 {
|
|
|
if countDividendsOrdersFound, dividendsOrdersFound, err := dividendsOrderRepository.Find(map[string]interface{}{
|
|
|
"dividendsOrderNumbers": dividendsOrderNumbers,
|
|
|
"companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
|
...
|
...
|
@@ -848,6 +851,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 分红退货单仓储初始化
|
|
|
var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository
|
...
|
...
|
@@ -860,6 +864,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
|
}
|
|
|
|
|
|
// 查找分红退货单
|
|
|
if len(dividendsReturnedOrderNumbers) > 0 {
|
|
|
if countDividendsReturnedOrdersFound, dividendsReturnedOrdersFound, err := dividendsReturnedOrderRepository.Find(map[string]interface{}{
|
|
|
"dividendsReturnedOrderNumbers": dividendsReturnedOrderNumbers,
|
|
|
"companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
|
...
|
...
|
@@ -889,6 +894,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 完成第二阶段事务提交
|
|
|
if err := newTransactionContext.CommitTransaction(); err != nil {
|
...
|
...
|
|