|
@@ -68,6 +68,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
|
@@ -68,6 +68,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
68
|
}
|
68
|
}
|
69
|
|
69
|
|
70
|
// 获取订单产品
|
70
|
// 获取订单产品
|
|
|
71
|
+ listDividendsIncentivesEstimateQuery.OrderGoodDividendsStatus = int32(1)
|
71
|
if count, orderGoods, err := orderGoodRepository.Find(tool_funs.SimpleStructToMap(listDividendsIncentivesEstimateQuery)); err != nil {
|
72
|
if count, orderGoods, err := orderGoodRepository.Find(tool_funs.SimpleStructToMap(listDividendsIncentivesEstimateQuery)); err != nil {
|
72
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
73
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
73
|
} else {
|
74
|
} else {
|
|
@@ -77,8 +78,8 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
|
@@ -77,8 +78,8 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
77
|
if orderGood.DividendsOrderNumber != "" { // 查询分红订单
|
78
|
if orderGood.DividendsOrderNumber != "" { // 查询分红订单
|
78
|
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{
|
79
|
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{
|
79
|
"dividendsOrderNumber": orderGood.DividendsOrderNumber,
|
80
|
"dividendsOrderNumber": orderGood.DividendsOrderNumber,
|
80
|
- "companyId": orderGood.CompanyId,
|
|
|
81
|
- "orgId": orderGood.OrgId,
|
81
|
+ "companyId": listDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
82
|
+ "orgId": listDividendsIncentivesEstimateQuery.OrgId,
|
82
|
})
|
83
|
})
|
83
|
if err != nil {
|
84
|
if err != nil {
|
84
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
85
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
@@ -92,8 +93,8 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
|
@@ -92,8 +93,8 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
92
|
dividendsIncentivesEstimateDtos = append(dividendsIncentivesEstimateDtos, dividendsIncentivesEstimateDto)
|
93
|
dividendsIncentivesEstimateDtos = append(dividendsIncentivesEstimateDtos, dividendsIncentivesEstimateDto)
|
93
|
} else if orderGood.DividendsReturnedOrderNumber != "" { // 查询分红退货单
|
94
|
} else if orderGood.DividendsReturnedOrderNumber != "" { // 查询分红退货单
|
94
|
dividendsReturnedOrder, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{
|
95
|
dividendsReturnedOrder, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{
|
95
|
- "companyId": orderGood.CompanyId,
|
|
|
96
|
- "orgId": orderGood.OrgId,
|
96
|
+ "companyId": listDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
97
|
+ "orgId": listDividendsIncentivesEstimateQuery.OrgId,
|
97
|
"dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber,
|
98
|
"dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber,
|
98
|
})
|
99
|
})
|
99
|
if err != nil {
|
100
|
if err != nil {
|
|
@@ -1283,6 +1284,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
|
@@ -1283,6 +1284,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
1283
|
}
|
1284
|
}
|
1284
|
|
1285
|
|
1285
|
// 获取订单产品
|
1286
|
// 获取订单产品
|
|
|
1287
|
+ searchDividendsIncentivesEstimateQuery.OrderGoodDividendsStatus = int32(1) // 查询带分红的产品
|
1286
|
if count, orderGoods, err := orderGoodRepository.Find(tool_funs.SimpleStructToMap(searchDividendsIncentivesEstimateQuery)); err != nil {
|
1288
|
if count, orderGoods, err := orderGoodRepository.Find(tool_funs.SimpleStructToMap(searchDividendsIncentivesEstimateQuery)); err != nil {
|
1287
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1289
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1288
|
} else {
|
1290
|
} else {
|
|
@@ -1292,14 +1294,16 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
|
@@ -1292,14 +1294,16 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
1292
|
if orderGood.DividendsOrderNumber != "" { // 查询分红订单
|
1294
|
if orderGood.DividendsOrderNumber != "" { // 查询分红订单
|
1293
|
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{
|
1295
|
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{
|
1294
|
"dividendsOrderNumber": orderGood.DividendsOrderNumber,
|
1296
|
"dividendsOrderNumber": orderGood.DividendsOrderNumber,
|
1295
|
- "companyId": orderGood.CompanyId,
|
|
|
1296
|
- "orgId": orderGood.OrgId,
|
1297
|
+ "companyId": searchDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
1298
|
+ "orgId": searchDividendsIncentivesEstimateQuery.OrgId,
|
1297
|
})
|
1299
|
})
|
1298
|
if err != nil {
|
1300
|
if err != nil {
|
1299
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1301
|
+ continue
|
|
|
1302
|
+ //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1300
|
}
|
1303
|
}
|
1301
|
if dividendsOrder == nil {
|
1304
|
if dividendsOrder == nil {
|
1302
|
- return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber))
|
1305
|
+ continue
|
|
|
1306
|
+ //return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber))
|
1303
|
}
|
1307
|
}
|
1304
|
if err := dividendsIncentivesEstimateDto.LoadDto(orderGood, dividendsOrder.DividendsOrderNumber, dividendsOrder.DividendsOriginalOrderNum, dividendsOrder.CustomerName, dividendsOrder.Region.RegionName, dividendsOrder.OrderTime); err != nil {
|
1308
|
if err := dividendsIncentivesEstimateDto.LoadDto(orderGood, dividendsOrder.DividendsOrderNumber, dividendsOrder.DividendsOriginalOrderNum, dividendsOrder.CustomerName, dividendsOrder.Region.RegionName, dividendsOrder.OrderTime); err != nil {
|
1305
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1309
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
@@ -1308,14 +1312,16 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
|
@@ -1308,14 +1312,16 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
1308
|
} else if orderGood.DividendsReturnedOrderNumber != "" { // 查询分红退货单
|
1312
|
} else if orderGood.DividendsReturnedOrderNumber != "" { // 查询分红退货单
|
1309
|
dividendsReturnedOrder, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{
|
1313
|
dividendsReturnedOrder, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{
|
1310
|
"dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber,
|
1314
|
"dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber,
|
1311
|
- "companyId": orderGood.CompanyId,
|
|
|
1312
|
- "orgId": orderGood.OrgId,
|
1315
|
+ "companyId": searchDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
1316
|
+ "orgId": searchDividendsIncentivesEstimateQuery.OrgId,
|
1313
|
})
|
1317
|
})
|
1314
|
if err != nil {
|
1318
|
if err != nil {
|
1315
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1319
|
+ continue
|
|
|
1320
|
+ //return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1316
|
}
|
1321
|
}
|
1317
|
if dividendsReturnedOrder == nil {
|
1322
|
if dividendsReturnedOrder == nil {
|
1318
|
- return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber))
|
1323
|
+ continue
|
|
|
1324
|
+ //return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber))
|
1319
|
}
|
1325
|
}
|
1320
|
if err := dividendsIncentivesEstimateDto.LoadDto(orderGood, dividendsReturnedOrder.DividendsReturnedOrderNumber, dividendsReturnedOrder.OriginalOrderNum, dividendsReturnedOrder.DividendsReturnedCustomerName, dividendsReturnedOrder.Region.RegionName, dividendsReturnedOrder.OrderTime); err != nil {
|
1326
|
if err := dividendsIncentivesEstimateDto.LoadDto(orderGood, dividendsReturnedOrder.DividendsReturnedOrderNumber, dividendsReturnedOrder.OriginalOrderNum, dividendsReturnedOrder.DividendsReturnedCustomerName, dividendsReturnedOrder.Region.RegionName, dividendsReturnedOrder.OrderTime); err != nil {
|
1321
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
1327
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|