|
@@ -800,6 +800,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
@@ -800,6 +800,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
800
|
// 分离分红订单和退货单
|
800
|
// 分离分红订单和退货单
|
801
|
dividendsOrderNumbers := make([]string, 0)
|
801
|
dividendsOrderNumbers := make([]string, 0)
|
802
|
dividendsReturnedOrderNumbers := make([]string, 0)
|
802
|
dividendsReturnedOrderNumbers := make([]string, 0)
|
|
|
803
|
+ if len(estimateSuccessfullyDividendsOrders) > 0 {
|
803
|
for k, _ := range estimateSuccessfullyDividendsOrders {
|
804
|
for k, _ := range estimateSuccessfullyDividendsOrders {
|
804
|
if k[:2] == "RE" { // 分红退货单
|
805
|
if k[:2] == "RE" { // 分红退货单
|
805
|
dividendsReturnedOrderNumbers = append(dividendsReturnedOrderNumbers, k)
|
806
|
dividendsReturnedOrderNumbers = append(dividendsReturnedOrderNumbers, k)
|
|
@@ -807,6 +808,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
@@ -807,6 +808,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
807
|
dividendsOrderNumbers = append(dividendsOrderNumbers, k)
|
808
|
dividendsOrderNumbers = append(dividendsOrderNumbers, k)
|
808
|
}
|
809
|
}
|
809
|
}
|
810
|
}
|
|
|
811
|
+ }
|
810
|
|
812
|
|
811
|
// 分红订单仓储初始化
|
813
|
// 分红订单仓储初始化
|
812
|
var dividendsOrderRepository domain.DividendsOrderRepository
|
814
|
var dividendsOrderRepository domain.DividendsOrderRepository
|
|
@@ -819,6 +821,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
@@ -819,6 +821,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
819
|
}
|
821
|
}
|
820
|
|
822
|
|
821
|
// 查找分红订单
|
823
|
// 查找分红订单
|
|
|
824
|
+ if len(dividendsOrderNumbers) > 0 {
|
822
|
if countDividendsOrdersFound, dividendsOrdersFound, err := dividendsOrderRepository.Find(map[string]interface{}{
|
825
|
if countDividendsOrdersFound, dividendsOrdersFound, err := dividendsOrderRepository.Find(map[string]interface{}{
|
823
|
"dividendsOrderNumbers": dividendsOrderNumbers,
|
826
|
"dividendsOrderNumbers": dividendsOrderNumbers,
|
824
|
"companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
|
827
|
"companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
|
|
@@ -848,6 +851,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
@@ -848,6 +851,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
848
|
}
|
851
|
}
|
849
|
}
|
852
|
}
|
850
|
}
|
853
|
}
|
|
|
854
|
+ }
|
851
|
|
855
|
|
852
|
// 分红退货单仓储初始化
|
856
|
// 分红退货单仓储初始化
|
853
|
var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository
|
857
|
var dividendsReturnedOrderRepository domain.DividendsReturnedOrderRepository
|
|
@@ -860,6 +864,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
@@ -860,6 +864,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
860
|
}
|
864
|
}
|
861
|
|
865
|
|
862
|
// 查找分红退货单
|
866
|
// 查找分红退货单
|
|
|
867
|
+ if len(dividendsReturnedOrderNumbers) > 0 {
|
863
|
if countDividendsReturnedOrdersFound, dividendsReturnedOrdersFound, err := dividendsReturnedOrderRepository.Find(map[string]interface{}{
|
868
|
if countDividendsReturnedOrdersFound, dividendsReturnedOrdersFound, err := dividendsReturnedOrderRepository.Find(map[string]interface{}{
|
864
|
"dividendsReturnedOrderNumbers": dividendsReturnedOrderNumbers,
|
869
|
"dividendsReturnedOrderNumbers": dividendsReturnedOrderNumbers,
|
865
|
"companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
|
870
|
"companyId": confirmDividendsIncentivesEstimateCommand.CompanyId,
|
|
@@ -889,6 +894,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
|
@@ -889,6 +894,7 @@ func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncent |
889
|
}
|
894
|
}
|
890
|
}
|
895
|
}
|
891
|
}
|
896
|
}
|
|
|
897
|
+ }
|
892
|
|
898
|
|
893
|
// 完成第二阶段事务提交
|
899
|
// 完成第二阶段事务提交
|
894
|
if err := newTransactionContext.CommitTransaction(); err != nil {
|
900
|
if err := newTransactionContext.CommitTransaction(); err != nil {
|