|
@@ -42,6 +42,8 @@ type
|
|
FLastNode: TCacheNode;
|
|
FLastNode: TCacheNode;
|
|
FSeparateChar: Char;
|
|
FSeparateChar: Char;
|
|
FAutoSort: Boolean;
|
|
FAutoSort: Boolean;
|
|
|
|
+
|
|
|
|
+ FFixedIDNodes: TList;
|
|
function GetNewNode(AID: Integer = -1): TBillsCacheNode; overload;
|
|
function GetNewNode(AID: Integer = -1): TBillsCacheNode; overload;
|
|
|
|
|
|
function FindNode(const ACode: string): TBillsCacheNode; overload;
|
|
function FindNode(const ACode: string): TBillsCacheNode; overload;
|
|
@@ -51,6 +53,9 @@ type
|
|
|
|
|
|
procedure SetSeparateChar(const Value: Char);
|
|
procedure SetSeparateChar(const Value: Char);
|
|
public
|
|
public
|
|
|
|
+ constructor Create; override;
|
|
|
|
+ destructor Destroy; override;
|
|
|
|
+
|
|
function AddNode(AParent: TCacheNode; ANextSibling: TCacheNode = nil; AFixedID: Integer = -1): TBillsCacheNode;
|
|
function AddNode(AParent: TCacheNode; ANextSibling: TCacheNode = nil; AFixedID: Integer = -1): TBillsCacheNode;
|
|
function AddNodeByCode(const ACode: string; AFixedID: Integer = -1): TBillsCacheNode;
|
|
function AddNodeByCode(const ACode: string; AFixedID: Integer = -1): TBillsCacheNode;
|
|
function AddLeafBillsNode(const AB_Code: string): TBillsCacheNode;
|
|
function AddLeafBillsNode(const AB_Code: string): TBillsCacheNode;
|
|
@@ -58,11 +63,15 @@ type
|
|
function FindXmjChild(AParent: TBillsCacheNode; const ACode, AName: string): TBillsCacheNode;
|
|
function FindXmjChild(AParent: TBillsCacheNode; const ACode, AName: string): TBillsCacheNode;
|
|
function FindGclChild(AParent: TBillsCacheNode; const AB_Code, AName, AUnits: string; APrice: Double): TBillsCacheNode;
|
|
function FindGclChild(AParent: TBillsCacheNode; const AB_Code, AName, AUnits: string; APrice: Double): TBillsCacheNode;
|
|
|
|
|
|
|
|
+ function FindFixedIDNode(AID: Integer): TBillsCacheNode;
|
|
|
|
+
|
|
// Only for Debugging lot of Data
|
|
// Only for Debugging lot of Data
|
|
procedure SaveTreeToFile(const AFileName: string);
|
|
procedure SaveTreeToFile(const AFileName: string);
|
|
|
|
|
|
property SeparateChar: Char read FSeparateChar write SetSeparateChar;
|
|
property SeparateChar: Char read FSeparateChar write SetSeparateChar;
|
|
property AutoSort: Boolean read FAutoSort write FAutoSort;
|
|
property AutoSort: Boolean read FAutoSort write FAutoSort;
|
|
|
|
+
|
|
|
|
+ property FixedIDNodes: TList read FFixedIDNodes;
|
|
end;
|
|
end;
|
|
|
|
|
|
// 此树仅用于导入工程量清单,禁止作为它用
|
|
// 此树仅用于导入工程量清单,禁止作为它用
|
|
@@ -402,6 +411,8 @@ begin
|
|
else
|
|
else
|
|
Result := TBillsCacheNode.Create(Self, AID);
|
|
Result := TBillsCacheNode.Create(Self, AID);
|
|
CacheNodes.Add(Result);
|
|
CacheNodes.Add(Result);
|
|
|
|
+ if Result.ID < 100 then
|
|
|
|
+ FFixedIDNodes.Add(Result);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TBillsCacheTree.AddNode(AParent, ANextSibling: TCacheNode;
|
|
function TBillsCacheTree.AddNode(AParent, ANextSibling: TCacheNode;
|
|
@@ -508,6 +519,35 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+constructor TBillsCacheTree.Create;
|
|
|
|
+begin
|
|
|
|
+ inherited;
|
|
|
|
+ FFixedIDNodes := TList.Create;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+destructor TBillsCacheTree.Destroy;
|
|
|
|
+begin
|
|
|
|
+ FFixedIDNodes.Free;
|
|
|
|
+ inherited;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TBillsCacheTree.FindFixedIDNode(AID: Integer): TBillsCacheNode;
|
|
|
|
+var
|
|
|
|
+ iNode: Integer;
|
|
|
|
+ vNode: TCacheNode;
|
|
|
|
+begin
|
|
|
|
+ Result := nil;
|
|
|
|
+ for iNode := 0 to FFixedIDNodes.Count - 1 do
|
|
|
|
+ begin
|
|
|
|
+ vNode := TCacheNode(FFixedIDNodes.Items[iNode]);
|
|
|
|
+ if vNode.ID = AID then
|
|
|
|
+ begin
|
|
|
|
+ Result := TBillsCacheNode(vNode);
|
|
|
|
+ Break;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
{ TReportCacheNode }
|
|
{ TReportCacheNode }
|
|
|
|
|
|
constructor TReportCacheNode.Create(ACacheTree: TCacheTree; AID,
|
|
constructor TReportCacheNode.Create(ACacheTree: TCacheTree; AID,
|