...
|
...
|
@@ -16,11 +16,13 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
|
|
OrderGoodName: good.OrderGoodName,
|
|
|
OrderGoodPrice: good.OrderGoodPrice,
|
|
|
OrderGoodQuantity: good.OrderGoodQuantity,
|
|
|
DividendsOrderNumber: good.DividendsReturnedOrderNumber,
|
|
|
DividendsReturnedOrderNumber: good.DividendsOrderNumber,
|
|
|
DividendsOrderNumber: good.DividendsOrderNumber,
|
|
|
DividendsReturnedOrderNumber: good.DividendsReturnedOrderNumber,
|
|
|
CooperationContractNumber: good.CooperationContractNumber,
|
|
|
OrderGoodDividendsStatus: good.OrderGoodDividendsStatus,
|
|
|
OrderGoodExpense: good.OrderGoodExpense,
|
|
|
OrgId: good.OrgId,
|
|
|
CompanyId: good.CompanyId,
|
|
|
CreatedAt: good.CreatedAt,
|
|
|
DeletedAt: good.DeletedAt,
|
|
|
UpdatedAt: good.UpdatedAt,
|
...
|
...
|
@@ -42,7 +44,6 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
|
|
Region: dividendsOrderModel.Region,
|
|
|
CustomerName: dividendsOrderModel.CustomerName,
|
|
|
Org: dividendsOrderModel.Org,
|
|
|
Goods: make([]*domain.OrderGood, 0),
|
|
|
Company: dividendsOrderModel.Company,
|
|
|
CreatedAt: dividendsOrderModel.CreatedAt,
|
|
|
DeletedAt: dividendsOrderModel.DeletedAt,
|
...
|
...
|
@@ -51,11 +52,13 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
|
|
Operator: dividendsOrderModel.Operator,
|
|
|
Remarks: dividendsOrderModel.Remarks,
|
|
|
}
|
|
|
var newOrderGoods []*domain.OrderGood
|
|
|
for _, orderGood := range orderGoods {
|
|
|
if orderGood.CompanyId == dividendsOrder.Company.CompanyId && orderGood.DividendsOrderNumber == dividendsOrder.DividendsOrderNumber {
|
|
|
dividendsOrder.Goods = append(dividendsOrder.Goods, orderGood)
|
|
|
newOrderGoods = append(newOrderGoods, orderGood)
|
|
|
}
|
|
|
}
|
|
|
dividendsOrder.Goods = newOrderGoods
|
|
|
dividendsOrders = append(dividendsOrders, dividendsOrder)
|
|
|
}
|
|
|
|
...
|
...
|
|