|
@@ -16,11 +16,13 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
|
@@ -16,11 +16,13 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
16
|
OrderGoodName: good.OrderGoodName,
|
16
|
OrderGoodName: good.OrderGoodName,
|
17
|
OrderGoodPrice: good.OrderGoodPrice,
|
17
|
OrderGoodPrice: good.OrderGoodPrice,
|
18
|
OrderGoodQuantity: good.OrderGoodQuantity,
|
18
|
OrderGoodQuantity: good.OrderGoodQuantity,
|
19
|
- DividendsOrderNumber: good.DividendsReturnedOrderNumber,
|
|
|
20
|
- DividendsReturnedOrderNumber: good.DividendsOrderNumber,
|
19
|
+ DividendsOrderNumber: good.DividendsOrderNumber,
|
|
|
20
|
+ DividendsReturnedOrderNumber: good.DividendsReturnedOrderNumber,
|
21
|
CooperationContractNumber: good.CooperationContractNumber,
|
21
|
CooperationContractNumber: good.CooperationContractNumber,
|
22
|
OrderGoodDividendsStatus: good.OrderGoodDividendsStatus,
|
22
|
OrderGoodDividendsStatus: good.OrderGoodDividendsStatus,
|
23
|
OrderGoodExpense: good.OrderGoodExpense,
|
23
|
OrderGoodExpense: good.OrderGoodExpense,
|
|
|
24
|
+ OrgId: good.OrgId,
|
|
|
25
|
+ CompanyId: good.CompanyId,
|
24
|
CreatedAt: good.CreatedAt,
|
26
|
CreatedAt: good.CreatedAt,
|
25
|
DeletedAt: good.DeletedAt,
|
27
|
DeletedAt: good.DeletedAt,
|
26
|
UpdatedAt: good.UpdatedAt,
|
28
|
UpdatedAt: good.UpdatedAt,
|
|
@@ -42,7 +44,6 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
|
@@ -42,7 +44,6 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
42
|
Region: dividendsOrderModel.Region,
|
44
|
Region: dividendsOrderModel.Region,
|
43
|
CustomerName: dividendsOrderModel.CustomerName,
|
45
|
CustomerName: dividendsOrderModel.CustomerName,
|
44
|
Org: dividendsOrderModel.Org,
|
46
|
Org: dividendsOrderModel.Org,
|
45
|
- Goods: make([]*domain.OrderGood, 0),
|
|
|
46
|
Company: dividendsOrderModel.Company,
|
47
|
Company: dividendsOrderModel.Company,
|
47
|
CreatedAt: dividendsOrderModel.CreatedAt,
|
48
|
CreatedAt: dividendsOrderModel.CreatedAt,
|
48
|
DeletedAt: dividendsOrderModel.DeletedAt,
|
49
|
DeletedAt: dividendsOrderModel.DeletedAt,
|
|
@@ -51,11 +52,13 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
|
@@ -51,11 +52,13 @@ func TransformToDividendsOrderDomainModelFromPgModels(dividendsOrderModels []*mo |
51
|
Operator: dividendsOrderModel.Operator,
|
52
|
Operator: dividendsOrderModel.Operator,
|
52
|
Remarks: dividendsOrderModel.Remarks,
|
53
|
Remarks: dividendsOrderModel.Remarks,
|
53
|
}
|
54
|
}
|
|
|
55
|
+ var newOrderGoods []*domain.OrderGood
|
54
|
for _, orderGood := range orderGoods {
|
56
|
for _, orderGood := range orderGoods {
|
55
|
if orderGood.CompanyId == dividendsOrder.Company.CompanyId && orderGood.DividendsOrderNumber == dividendsOrder.DividendsOrderNumber {
|
57
|
if orderGood.CompanyId == dividendsOrder.Company.CompanyId && orderGood.DividendsOrderNumber == dividendsOrder.DividendsOrderNumber {
|
56
|
- dividendsOrder.Goods = append(dividendsOrder.Goods, orderGood)
|
58
|
+ newOrderGoods = append(newOrderGoods, orderGood)
|
57
|
}
|
59
|
}
|
58
|
}
|
60
|
}
|
|
|
61
|
+ dividendsOrder.Goods = newOrderGoods
|
59
|
dividendsOrders = append(dividendsOrders, dividendsOrder)
|
62
|
dividendsOrders = append(dividendsOrders, dividendsOrder)
|
60
|
}
|
63
|
}
|
61
|
|
64
|
|