Add more than on product to a Route
This commit is contained in:
parent
dc9728eb06
commit
d0f726621f
2 changed files with 14 additions and 6 deletions
6
route.go
6
route.go
|
@ -16,7 +16,7 @@ type Route struct {
|
|||
eaAddressDefinition int
|
||||
topsheetTemplateDirectory int
|
||||
editionName string
|
||||
productReferenceNumber int
|
||||
productReferenceNumbers []int
|
||||
ProductionDrops []*ProductionDrop
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,10 @@ func (r *Route) GetRouteMessage() string {
|
|||
return info
|
||||
}
|
||||
|
||||
func (r *Route) AddProductReferenceNumber(prnr int) {
|
||||
r.productReferenceNumbers = append(r.productReferenceNumbers, prnr)
|
||||
}
|
||||
|
||||
func (r *Route) AddProductionDrop(pd *ProductionDrop) error {
|
||||
r.ProductionDrops = append(r.ProductionDrops, pd)
|
||||
return nil
|
||||
|
|
|
@ -16,7 +16,7 @@ type RouteInfo struct {
|
|||
eaAddressDefinition int
|
||||
topsheetTemplateDirectory int
|
||||
editionName string
|
||||
productReferenceNumber int
|
||||
productReferenceNumbers []int
|
||||
}
|
||||
|
||||
func (ri *RouteInfo) ParameterSz() string {
|
||||
|
@ -27,12 +27,16 @@ func (ri *RouteInfo) SetParameterSz(parameterSz int) {
|
|||
ri.parameterSz = parameterSz
|
||||
}
|
||||
|
||||
func (ri *RouteInfo) ProductReferenceNumber() string {
|
||||
return fmt.Sprintf("+41%02d", ri.productReferenceNumber)
|
||||
func (ri *RouteInfo) ProductReferenceNumbers() string {
|
||||
var prreffmt string
|
||||
for _, pr := range ri.productReferenceNumbers {
|
||||
prreffmt += fmt.Sprintf("+41%02d", pr)
|
||||
}
|
||||
return prreffmt
|
||||
}
|
||||
|
||||
func (ri *RouteInfo) SetProductReferenceNumber(productReferenceNumber int) {
|
||||
ri.productReferenceNumber = productReferenceNumber
|
||||
func (ri *RouteInfo) AddProductReferenceNumber(productReferenceNumber int) {
|
||||
ri.productReferenceNumbers = append(ri.productReferenceNumbers, productReferenceNumber)
|
||||
}
|
||||
|
||||
func (ri *RouteInfo) TopsheetTemplateDirectory() string {
|
||||
|
|
Loading…
Reference in a new issue