|
@@ -84,6 +84,25 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
@@ -84,6 +84,25 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
84
|
dividendsEstimatesCanceled = append(dividendsEstimatesCanceled, dividendsEstimatesRelativeCanceled...)
|
84
|
dividendsEstimatesCanceled = append(dividendsEstimatesCanceled, dividendsEstimatesRelativeCanceled...)
|
85
|
}
|
85
|
}
|
86
|
}
|
86
|
}
|
|
|
87
|
+ } else if dividendsEstimate.DividendsType == 3 {
|
|
|
88
|
+ // 根据当前分红预算单的分红订单号或退货单号获取相关的分红预算单
|
|
|
89
|
+ if countRelative, dividendsEstimatesRelative, err2 := dividendsEstimateRepository.Find(map[string]interface{}{
|
|
|
90
|
+ "companyId": dividendsEstimate.Company.CompanyId,
|
|
|
91
|
+ "orgId": dividendsEstimate.Org.OrgId,
|
|
|
92
|
+ "cooperationContractNumber": dividendsEstimate.CooperationContractNumber,
|
|
|
93
|
+ "dividendsType": int32(3),
|
|
|
94
|
+ "offsetLimit": false,
|
|
|
95
|
+ }); err2 != nil {
|
|
|
96
|
+ return nil, err2
|
|
|
97
|
+ } else {
|
|
|
98
|
+ if countRelative > 0 {
|
|
|
99
|
+ dividendsEstimatesRelativeCanceled, err3 := dividendsEstimateRepository.UpdateMany(dividendsEstimatesRelative)
|
|
|
100
|
+ if err3 != nil {
|
|
|
101
|
+ return nil, err3
|
|
|
102
|
+ }
|
|
|
103
|
+ dividendsEstimatesCanceled = append(dividendsEstimatesCanceled, dividendsEstimatesRelativeCanceled...)
|
|
|
104
|
+ }
|
|
|
105
|
+ }
|
87
|
}
|
106
|
}
|
88
|
}
|
107
|
}
|
89
|
|
108
|
|
|
@@ -102,7 +121,7 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
@@ -102,7 +121,7 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
102
|
}
|
121
|
}
|
103
|
}
|
122
|
}
|
104
|
|
123
|
|
105
|
- // 获取分红订单
|
124
|
+ // 获取分红订单并更新分红订单产品的状态
|
106
|
if len(orderNums) > 0 {
|
125
|
if len(orderNums) > 0 {
|
107
|
if countDividendsOrder, orders, err4 := dividendsOrderRepository.Find(map[string]interface{}{
|
126
|
if countDividendsOrder, orders, err4 := dividendsOrderRepository.Find(map[string]interface{}{
|
108
|
"companyId": dividendsEstimates[0].Company.CompanyId,
|
127
|
"companyId": dividendsEstimates[0].Company.CompanyId,
|
|
@@ -147,7 +166,7 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
|
@@ -147,7 +166,7 @@ func (domainService *CancelDividendsEstimateService) CancelEstimate(dividendsEst |
147
|
}
|
166
|
}
|
148
|
}
|
167
|
}
|
149
|
|
168
|
|
150
|
- // 获取分红退货单
|
169
|
+ // 获取分红退货单并更新订单产品的状态
|
151
|
if len(returnedOrderNums) > 0 {
|
170
|
if len(returnedOrderNums) > 0 {
|
152
|
if countDividendsReturnedOrder, returnedOrders, err5 := dividendsReturnedOrderRepository.Find(map[string]interface{}{
|
171
|
if countDividendsReturnedOrder, returnedOrders, err5 := dividendsReturnedOrderRepository.Find(map[string]interface{}{
|
153
|
"companyId": dividendsEstimates[0].Company.CompanyId,
|
172
|
"companyId": dividendsEstimates[0].Company.CompanyId,
|