Просмотр исходного кода

汇总,提供备注数据,不重复合并

MaiXinRong 10 лет назад
Родитель
Сommit
ebcba08944

+ 2 - 1
ProjGather/ProjGather.pas

@@ -189,7 +189,7 @@ function TProjGather.FindBillsNode(ANode: TBillsIDTreeNode;
 var
   iCompareType: Integer;
 begin
-  if ANode.ID > 100 then
+  if ANode.ID >= 100 then
   begin
     if ANode.Rec.B_Code.AsString <> '' then
       iCompareType := FGclCompare
@@ -261,6 +261,7 @@ begin
   Result := FindBillsNode(ANode, AParent);
   if not Assigned(Result) then
     Result := CreateBillsNode(ANode, AParent);
+  Result.AddMemoStr(ANode.Rec.MemoStr.AsString);
   AddProjCalcData(Result.GatherCalc, ANode);
   AddProjCalcData(Result.Proj[AProjIndex], ANode);
 end;

+ 25 - 1
ProjGather/ProjGatherTree.pas

@@ -19,10 +19,12 @@ type
     FMuCode: string;
     FJieCode: string;
     FXiMuCode: string;
-    FIndexCode: string;  
+    FIndexCode: string;
     FB_CodeChapter: Integer;
     FChapterParentID: Integer;
 
+    FMemoStrs: TStringList;
+
     FGatherCalc: TProjCalc;
     FProjs: TList;
     FSpecialProjs: TList;
@@ -32,6 +34,7 @@ type
     function GetLevel: Integer;
     function GetSpecialProj(AIndex: Integer): TProjCalc;
     function GetSpecialProjCount: Integer;
+    function GetMemoStr: string;
   public
     constructor Create(ACacheTree: TCacheTree; AID: Integer; AProjCount, ASpeicalProjCount: Integer);
     destructor Destroy; override;
@@ -44,6 +47,8 @@ type
     procedure AddCalcData(ANode: TProjGatherTreeNode);
     procedure MinusCalcData(ANode: TProjGatherTreeNode);
 
+    procedure AddMemoStr(const AMemoStr: string);
+
     property Code: string read FCode write FCode;
     property B_Code: string read FB_Code write FB_Code;
     property Name: string read FName write FName;
@@ -60,6 +65,8 @@ type
     property IndexCode: string read FIndexCode write FIndexCode;
     property B_CodeChapter: Integer read FB_CodeChapter write FB_CodeChapter;
 
+    property MemoStr: string read GetMemoStr;
+
     property Level: Integer read GetLevel;
     property ChapterParentID: Integer read GetChapterParentID;
 
@@ -123,6 +130,15 @@ begin
     Proj[iProj].AddCalcData(ANode.Proj[iProj]);
 end;
 
+procedure TProjGatherTreeNode.AddMemoStr(const AMemoStr: string);
+begin
+  if AMemoStr <> '' then
+  begin
+    if FMemoStrs.IndexOf(AMemoStr) = -1 then
+      FMemoStrs.Add(AMemoStr);
+  end;
+end;
+
 procedure TProjGatherTreeNode.CalcTotalPrice_Rc;
 var
   iProj: Integer;
@@ -139,6 +155,8 @@ var
 begin
   inherited Create(ACacheTree, AID);
   FGatherCalc := TProjCalc.Create;
+  FMemoStrs := TStringList.Create;
+  FMemoStrs.Delimiter := ';';
   FProjs := TList.Create;
   for i := 0 to AProjCount - 1 do
   begin
@@ -156,6 +174,7 @@ end;
 destructor TProjGatherTreeNode.Destroy;
 begin
   FGatherCalc.free;
+  FMemoStrs.Clear;
   ClearObjects(FProjs);
   FProjs.Free;
   ClearObjects(FSpecialProjs);
@@ -185,6 +204,11 @@ begin
     Result := 1;
 end;
 
+function TProjGatherTreeNode.GetMemoStr: string;
+begin
+  Result := FMemoStrs.DelimitedText;
+end;
+
 function TProjGatherTreeNode.GetProj(AIndex: Integer): TProjCalc;
 begin
   Result := TProjCalc(FProjs.Items[AIndex]);

+ 5 - 2
Report/ProjGather/rProjGatherTables.pas

@@ -30,7 +30,7 @@ const
   );
 
   SBills = 'r_Bills';
-  tdBills: array [0..16] of TScFieldDef =(
+  tdBills: array [0..17] of TScFieldDef =(
     (FieldName: 'ID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
     (FieldName: 'ParentID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: False; ForceUpdate: False),
     (FieldName: 'NextSiblingID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: False; ForceUpdate: False),
@@ -65,8 +65,11 @@ const
     // 覽섬만淃ID
     (FieldName: 'ChapterParentID'; FieldType: ftInteger; size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 헌데긍뵀杰橄覽섬
-    (FieldName: 'B_CodeChapter'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+    (FieldName: 'B_CodeChapter'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     //--8
+
+    // 구鬧
+    (FieldName: 'MemoStr'; FieldType: ftMemo; Size: 60535; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
   );
 
   SBills_Gather = 'r_Bills_Gather'; // 북셕, 칵훰ProjID槨 -2

+ 4 - 1
Report/ProjGather/rpgBillsDm.dfm

@@ -67,6 +67,9 @@ object rpgBillsData: TrpgBillsData
       0453697A6502000001044E616D65060D425F436F646543686170746572094669
       656C644E616D65060D425F436F64654368617074657208446174615479706502
       03084461746153697A6502040549734B6579080F4E65656450726F636573734E
-      616D650909507265636973696F6E02000453697A6502000000}
+      616D650909507265636973696F6E02000453697A6502000001044E616D650607
+      4D656D6F537472094669656C644E616D6506074D656D6F537472084461746154
+      7970650210084461746153697A650477EC00000549734B6579080F4E65656450
+      726F636573734E616D650909507265636973696F6E02000453697A6502000000}
   end
 end

+ 2 - 0
Report/ProjGather/rpgBillsDm.pas

@@ -63,6 +63,8 @@ begin
   Rec.ValueByName('IndexCode').AsString := ANode.IndexCode;
   Rec.ValueByName('ChapterParentID').AsInteger := ANode.ChapterParentID;
   Rec.ValueByName('B_CodeChapter').AsInteger := ANode.B_CodeChapter;
+
+  Rec.ValueByName('MemoStr').AsString := ANode.MemoStr;
 end;
 
 procedure TrpgBillsData.SaveDataTo(ATree: TProjGatherTree; const ATableName: string);