...
|
...
|
@@ -68,6 +68,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
|
|
}
|
|
|
|
|
|
// 获取订单产品
|
|
|
listDividendsIncentivesEstimateQuery.OrderGoodDividendsStatus = int32(1)
|
|
|
if count, orderGoods, err := orderGoodRepository.Find(tool_funs.SimpleStructToMap(listDividendsIncentivesEstimateQuery)); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
...
|
...
|
@@ -77,8 +78,8 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
|
|
if orderGood.DividendsOrderNumber != "" { // 查询分红订单
|
|
|
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{
|
|
|
"dividendsOrderNumber": orderGood.DividendsOrderNumber,
|
|
|
"companyId": orderGood.CompanyId,
|
|
|
"orgId": orderGood.OrgId,
|
|
|
"companyId": listDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
"orgId": listDividendsIncentivesEstimateQuery.OrgId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -92,8 +93,8 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive |
|
|
dividendsIncentivesEstimateDtos = append(dividendsIncentivesEstimateDtos, dividendsIncentivesEstimateDto)
|
|
|
} else if orderGood.DividendsReturnedOrderNumber != "" { // 查询分红退货单
|
|
|
dividendsReturnedOrder, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{
|
|
|
"companyId": orderGood.CompanyId,
|
|
|
"orgId": orderGood.OrgId,
|
|
|
"companyId": listDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
"orgId": listDividendsIncentivesEstimateQuery.OrgId,
|
|
|
"dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber,
|
|
|
})
|
|
|
if err != nil {
|
...
|
...
|
@@ -1283,6 +1284,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
|
|
}
|
|
|
|
|
|
// 获取订单产品
|
|
|
searchDividendsIncentivesEstimateQuery.OrderGoodDividendsStatus = int32(1) // 查询带分红的产品
|
|
|
if count, orderGoods, err := orderGoodRepository.Find(tool_funs.SimpleStructToMap(searchDividendsIncentivesEstimateQuery)); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
...
|
...
|
@@ -1292,14 +1294,16 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
|
|
if orderGood.DividendsOrderNumber != "" { // 查询分红订单
|
|
|
dividendsOrder, err := dividendsOrderRepository.FindOne(map[string]interface{}{
|
|
|
"dividendsOrderNumber": orderGood.DividendsOrderNumber,
|
|
|
"companyId": orderGood.CompanyId,
|
|
|
"orgId": orderGood.OrgId,
|
|
|
"companyId": searchDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
"orgId": searchDividendsIncentivesEstimateQuery.OrgId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
continue
|
|
|
//return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if dividendsOrder == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber))
|
|
|
continue
|
|
|
//return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsOrderNumber))
|
|
|
}
|
|
|
if err := dividendsIncentivesEstimateDto.LoadDto(orderGood, dividendsOrder.DividendsOrderNumber, dividendsOrder.DividendsOriginalOrderNum, dividendsOrder.CustomerName, dividendsOrder.Region.RegionName, dividendsOrder.OrderTime); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
@@ -1308,14 +1312,16 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti |
|
|
} else if orderGood.DividendsReturnedOrderNumber != "" { // 查询分红退货单
|
|
|
dividendsReturnedOrder, err := dividendsReturnedOrderRepository.FindOne(map[string]interface{}{
|
|
|
"dividendsReturnedOrderNumber": orderGood.DividendsReturnedOrderNumber,
|
|
|
"companyId": orderGood.CompanyId,
|
|
|
"orgId": orderGood.OrgId,
|
|
|
"companyId": searchDividendsIncentivesEstimateQuery.CompanyId,
|
|
|
"orgId": searchDividendsIncentivesEstimateQuery.OrgId,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
continue
|
|
|
//return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
if dividendsReturnedOrder == nil {
|
|
|
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber))
|
|
|
continue
|
|
|
//return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", orderGood.DividendsReturnedOrderNumber))
|
|
|
}
|
|
|
if err := dividendsIncentivesEstimateDto.LoadDto(orderGood, dividendsReturnedOrder.DividendsReturnedOrderNumber, dividendsReturnedOrder.OriginalOrderNum, dividendsReturnedOrder.DividendsReturnedCustomerName, dividendsReturnedOrder.Region.RegionName, dividendsReturnedOrder.OrderTime); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
...
|
...
|
|