func (obj *Aggregate) HandleTransact(transact *Transaction) bool {
	transact.PrintInfo()
	_, parts, parentID := transact.GetParts()
	if parentID == 0 {
		return obj.SendToDst(transact)
	}
	holdedTr := obj.tb.Item(parentID)
	if holdedTr == nil {
		tr := transact.Copy()
		tr.SetID(parentID)
		tr.SetParts(0, parts-1, 0)
		if parts-1 == 0 {
			return obj.SendToDst(tr)
		}
		obj.tb.Push(tr)
	} else {
		if holdedTr.transact.GetAdvanceTime() < transact.GetAdvanceTime() {
			holdedTr.transact.SetTiсks(transact.GetAdvanceTime())
			holdedTr.transact.SetTiсks(0)
		}
		_, holdedParts, _ := holdedTr.transact.GetParts()
		if holdedParts-1 == 0 {
			holdedTr.transact.SetParts(0, 0, 0)
			return obj.SendToDst(holdedTr.transact)
		}
		holdedTr.transact.SetParts(0, holdedParts-1, 0)
	}
	return true
}
HandleTransact handle transact
package objects
import (
	"fmt"
	"sync"
)
type Aggregate struct {
	BaseObj
	sumTransact float64  
}
func NewAggregate(name string) *Aggregate {
	obj := &Aggregate{}
	obj.BaseObj.Init(name)
	return obj
}
func (obj *Aggregate) SendToDst(transact *Transaction) bool {
	for _, v := range obj.GetDst() {
		if v.AppendTransact(transact) {
			obj.tb.Remove(transact)
			obj.sumTransact++
			return true
		}
	}
	return false
}