浏览代码

Merge branch 'master' of http://192.168.1.12:3000/maixinrong/measure

builder 8 年之前
父节点
当前提交
63a578ba78

+ 145 - 0
DataModules/ReportMemoryDm/rmWeiWuZjjlGatherDm.dfm

@@ -0,0 +1,145 @@
+object rmWeiWuZjjlGatherData: TrmWeiWuZjjlGatherData
+  OldCreateOrder = False
+  Left = 192
+  Top = 123
+  Height = 150
+  Width = 215
+  object cdsZjjl: TClientDataSet
+    Active = True
+    Aggregates = <>
+    Params = <>
+    Left = 64
+    Top = 32
+    Data = {
+      930300009619E0BD01000000180000001C000000000003000000930304436F64
+      6501004A00000001000557494454480200020064000F43657274696669636174
+      65436F646501004A00000001000557494454480200020064000742474C436F64
+      6504004B00000002000753554254595045020049000500546578740005574944
+      54480200020077EC075065674E616D6502004A00000001000557494454480200
+      0200FE0108426567696E50656702004A000000010005574944544802000200FE
+      0106456E6450656702004A000000010005574944544802000200FE0108464246
+      584E616D6502004A000000010005574944544802000200FE0108556E69744E61
+      6D6502004A000000010005574944544802000200FE010B44726177696E67436F
+      646501004A00000001000557494454480200020064000B466F726D756C614D65
+      6D6F04004B000000020007535542545950450200490005005465787400055749
+      4454480200020077EC0852656C6146696C6504004B0000000200075355425459
+      504502004900050054657874000557494454480200020077EC0942696C6C7343
+      6F646501004900000001000557494454480200020032000942696C6C734E616D
+      6502004A000000010005574944544802000200FE010A42696C6C73556E697473
+      01004A00000001000557494454480200020028000A42696C6C73507269636508
+      000400000000001146696C74657244726177696E67436F646501004A00000001
+      000557494454480200020064001442696C6C734375724465616C5175616E7469
+      747908000400000000001642696C6C734375724465616C546F74616C50726963
+      6508000400000000001242696C6C7343757251635175616E7469747908000400
+      000000001442696C6C734375725163546F74616C507269636508000400000000
+      001642696C6C734375724761746865725175616E746974790800040000000000
+      1842696C6C73437572476174686572546F74616C507269636508000400000000
+      001442696C6C73456E644465616C5175616E7469747908000400000000001642
+      696C6C73456E644465616C546F74616C50726963650800040000000000124269
+      6C6C73456E6451635175616E7469747908000400000000001442696C6C73456E
+      645163546F74616C507269636508000400000000001642696C6C73456E644761
+      746865725175616E7469747908000400000000001842696C6C73456E64476174
+      686572546F74616C507269636508000400000000000000}
+    object cdsZjjlCode: TWideStringField
+      FieldName = 'Code'
+      Size = 50
+    end
+    object cdsZjjlCertificateCode: TWideStringField
+      FieldName = 'CertificateCode'
+      Size = 50
+    end
+    object cdsZjjlBGLCode: TMemoField
+      FieldName = 'BGLCode'
+      BlobType = ftMemo
+      Size = 60535
+    end
+    object cdsZjjlPegName: TWideStringField
+      FieldName = 'PegName'
+      Size = 255
+    end
+    object cdsZjjlBeginPeg: TWideStringField
+      FieldName = 'BeginPeg'
+      Size = 255
+    end
+    object cdsZjjlEndPeg: TWideStringField
+      FieldName = 'EndPeg'
+      Size = 255
+    end
+    object cdsZjjlFBFXName: TWideStringField
+      FieldName = 'FBFXName'
+      Size = 255
+    end
+    object cdsZjjlUnitName: TWideStringField
+      FieldName = 'UnitName'
+      Size = 255
+    end
+    object cdsZjjlDrawingCode: TWideStringField
+      FieldName = 'DrawingCode'
+      Size = 50
+    end
+    object cdsZjjlFormulaMemo: TMemoField
+      FieldName = 'FormulaMemo'
+      BlobType = ftMemo
+      Size = 60535
+    end
+    object cdsZjjlRelaFile: TMemoField
+      FieldName = 'RelaFile'
+      BlobType = ftMemo
+      Size = 60535
+    end
+    object cdsZjjlBillsCode: TStringField
+      FieldName = 'BillsCode'
+      Size = 50
+    end
+    object cdsZjjlBillsName: TWideStringField
+      FieldName = 'BillsName'
+      Size = 255
+    end
+    object cdsZjjlBillsUnits: TWideStringField
+      FieldName = 'BillsUnits'
+    end
+    object cdsZjjlBillsPrice: TFloatField
+      FieldName = 'BillsPrice'
+    end
+    object cdsZjjlFilterDrawingCode: TWideStringField
+      FieldName = 'FilterDrawingCode'
+      Size = 50
+    end
+    object cdsZjjlBillsCurDealQuantity: TFloatField
+      FieldName = 'BillsCurDealQuantity'
+    end
+    object cdsZjjlBillsCurDealTotalPrice: TFloatField
+      FieldName = 'BillsCurDealTotalPrice'
+    end
+    object cdsZjjlBillsCurQcQuantity: TFloatField
+      FieldName = 'BillsCurQcQuantity'
+    end
+    object cdsZjjlBillsCurQcTotalPrice: TFloatField
+      FieldName = 'BillsCurQcTotalPrice'
+    end
+    object cdsZjjlBillsCurGatherQuantity: TFloatField
+      FieldName = 'BillsCurGatherQuantity'
+    end
+    object cdsZjjlBillsCurGatherTotalPrice: TFloatField
+      FieldName = 'BillsCurGatherTotalPrice'
+    end
+    object cdsZjjlBillsEndDealQuantity: TFloatField
+      FieldName = 'BillsEndDealQuantity'
+    end
+    object cdsZjjlBillsEndDealTotalPrice: TFloatField
+      FieldName = 'BillsEndDealTotalPrice'
+    end
+    object cdsZjjlBillsEndQcQuantity: TFloatField
+      FieldName = 'BillsEndQcQuantity'
+    end
+    object cdsZjjlBillsEndQcTotalPrice: TFloatField
+      FieldName = 'BillsEndQcTotalPrice'
+    end
+    object cdsZjjlBillsEndGatherQuantity: TFloatField
+      FieldName = 'BillsEndGatherQuantity'
+    end
+    object cdsZjjlBillsEndGatherTotalPrice: TFloatField
+      FieldName = 'BillsEndGatherTotalPrice'
+    end
+  end
+end

+ 313 - 0
DataModules/ReportMemoryDm/rmWeiWuZjjlGatherDm.pas

@@ -0,0 +1,313 @@
+unit rmWeiWuZjjlGatherDm;
+
+interface
+
+uses
+  SysUtils, Classes, ProjectData, DB, sdDB, DBClient;
+
+type
+  TZjjl = class
+  private
+    FCode: string;
+    FCertificateCode: string;
+    FBGLCode: string;
+    FPegName: string;
+    FBeginPeg: string;
+    FEndPeg: string;
+    FFBFXName: string;
+    FUnitName: string;
+    FDrawingCode: string;
+    FFormulaMemo: string;
+    FRelaFile: string;
+
+    FBillsCode: string;
+    FBillsName: string;
+    FBillsUnits: string;
+    FBillsPrice: Double;
+    FFilterDrawingCode: string;
+
+    FBillsCurDealQuantity: Double;
+    FBillsCurDealTotalPrice: Double;
+    FBillsCurQcQuantity: Double;
+    FBillsCurQcTotalPrice: Double;
+    FBillsCurGatherQuantity: Double;
+    FBillsCurGatherTotalPrice: Double;
+    FBillsEndDealQuantity: Double;
+    FBillsEndDealTotalPrice: Double;
+    FBillsEndQcQuantity: Double;
+    FBillsEndQcTotalPrice: Double;
+    FBillsEndGatherQuantity: Double;
+    FBillsEndGatherTotalPrice: Double;
+
+    function MergeStr(AStr1, AStr2: string): string;
+  public
+    constructor Create(ARec, ABillsRec, AStageRec: TsdDataRecord);
+
+    procedure Merge(ARec, ABillsRec, AStageRec: TsdDataRecord);
+  end;
+
+  TrmWeiWuZjjlGatherData = class(TDataModule)
+    cdsZjjl: TClientDataSet;
+    cdsZjjlCode: TWideStringField;
+    cdsZjjlCertificateCode: TWideStringField;
+    cdsZjjlBGLCode: TMemoField;
+    cdsZjjlPegName: TWideStringField;
+    cdsZjjlBeginPeg: TWideStringField;
+    cdsZjjlEndPeg: TWideStringField;
+    cdsZjjlFBFXName: TWideStringField;
+    cdsZjjlUnitName: TWideStringField;
+    cdsZjjlDrawingCode: TWideStringField;
+    cdsZjjlFormulaMemo: TMemoField;
+    cdsZjjlRelaFile: TMemoField;
+    cdsZjjlBillsCode: TStringField;
+    cdsZjjlBillsName: TWideStringField;
+    cdsZjjlBillsUnits: TWideStringField;
+    cdsZjjlBillsPrice: TFloatField; 
+    cdsZjjlFilterDrawingCode: TWideStringField;
+    cdsZjjlBillsCurDealQuantity: TFloatField;
+    cdsZjjlBillsCurDealTotalPrice: TFloatField;
+    cdsZjjlBillsCurQcQuantity: TFloatField;
+    cdsZjjlBillsCurQcTotalPrice: TFloatField;
+    cdsZjjlBillsCurGatherQuantity: TFloatField;
+    cdsZjjlBillsCurGatherTotalPrice: TFloatField;
+    cdsZjjlBillsEndDealQuantity: TFloatField;
+    cdsZjjlBillsEndDealTotalPrice: TFloatField;
+    cdsZjjlBillsEndQcQuantity: TFloatField;
+    cdsZjjlBillsEndQcTotalPrice: TFloatField;
+    cdsZjjlBillsEndGatherQuantity: TFloatField;
+    cdsZjjlBillsEndGatherTotalPrice: TFloatField;
+  private
+    FZjjlList: TList;
+    function FindZjjl(ARec, ABillsRec: TsdDataRecord): TZjjl;
+
+    procedure GatherZjjl(AProjectData: TProjectData);
+    procedure WriteData;
+  public
+    function AssignData(AProjectData: TProjectData): TDataSet;
+  end;
+
+implementation
+
+uses
+  ZhAPI, PhaseData, UtilMethods;
+
+{$R *.dfm}
+
+function GetThirdPartString(const AStr: string; AFilter: Char = '-'): string;
+var
+  sgs: TStringList;
+begin
+  sgs := TStringList.Create;
+  try
+    sgs.Delimiter := AFilter;
+    sgs.DelimitedText := AStr;
+
+    while sgs.Count > 2 do
+      sgs.Delete(sgs.Count - 1);
+    Result := sgs.DelimitedText;
+  finally
+    sgs.Free;
+  end;
+end;
+
+{ TZjjl }
+
+constructor TZjjl.Create(ARec, ABillsRec, AStageRec: TsdDataRecord);
+begin
+  FCode := ARec.ValueByName('Code').AsString;
+  FCertificateCode := ARec.ValueByName('CertificateCode').AsString;
+  FBGLCode := ARec.ValueByName('BGLCode').AsString;
+  FPegName := ARec.ValueByName('PegName').AsString;
+  FBeginPeg := ARec.ValueByName('BeginPeg').AsString;
+  FEndPeg := ARec.ValueByName('EndPeg').AsString;
+  FFBFXName := ARec.ValueByName('FBFXName').AsString;
+  FUnitName := ARec.ValueByName('UnitName').AsString;
+  FDrawingCode := ARec.ValueByName('DrawingCode').AsString;
+  FFormulaMemo := ARec.ValueByName('FormulaMemo').AsString;
+  FRelaFile := ARec.ValueByName('RelaFile').AsString;
+
+  FBillsCode := ABillsRec.ValueByName('B_Code').AsString;
+  FBillsName := ABillsRec.ValueByName('Name').AsString;
+  FBillsUnits := ABillsRec.ValueByName('Units').AsString;
+  FBillsPrice := ABillsRec.ValueByName('Price').AsFloat;
+  FFilterDrawingCode := GetThirdPartString(ABillsRec.ValueByName('DrawingCode').AsString);
+
+  if Assigned(AStageRec) then
+  begin
+    FBillsCurDealQuantity := AStageRec.ValueByName('DealQuantity').AsFloat;
+    FBillsCurDealTotalPrice := AStageRec.ValueByName('DealTotalPrice').AsFloat;
+    FBillsCurQcQuantity := AStageRec.ValueByName('QcQuantity').AsFloat;
+    FBillsCurQcTotalPrice := AStageRec.ValueByName('QcTotalPrice').AsFloat;
+    FBillsCurGatherQuantity := AStageRec.ValueByName('GatherQuantity').AsFloat;
+    FBillsCurGatherTotalPrice := AStageRec.ValueByName('GatherTotalPrice').AsFloat;
+
+    FBillsEndDealQuantity := AStageRec.ValueByName('DealQuantity').AsFloat;
+    FBillsEndDealTotalPrice := AStageRec.ValueByName('DealTotalPrice').AsFloat;
+    FBillsEndQcQuantity := AStageRec.ValueByName('QcQuantity').AsFloat;
+    FBillsEndQcTotalPrice := AStageRec.ValueByName('QcTotalPrice').AsFloat;
+    FBillsEndGatherQuantity := AStageRec.ValueByName('GatherQuantity').AsFloat;
+    FBillsEndGatherTotalPrice := AStageRec.ValueByName('GatherTotalPrice').AsFloat;
+  end;
+end;
+
+procedure TZjjl.Merge(ARec, ABillsRec, AStageRec: TsdDataRecord);
+begin
+  FCertificateCode := MergeStr(FCertificateCode, ARec.ValueByName('CertificateCode').AsString);
+  FBGLCode := MergeRelaBGL(FBGLCode, ARec.ValueByName('BGLCode').AsString);
+  FDrawingCode := MergeStr(FDrawingCode, ARec.ValueByName('DrawingCode').AsString);
+  FFormulaMemo := MergeStr(FFormulaMemo, ARec.ValueByName('FormulaMemo').AsString);
+  FRelaFile := MergeStr(FRelaFile, ARec.ValueByName('RelaFile').AsString);
+
+  if Assigned(AStageRec) then
+  begin
+    FBillsCurDealQuantity := FBillsCurDealQuantity + AStageRec.ValueByName('DealQuantity').AsFloat;
+    FBillsCurDealTotalPrice := FBillsCurDealTotalPrice + AStageRec.ValueByName('DealTotalPrice').AsFloat;
+    FBillsCurQcQuantity := FBillsCurQcQuantity + AStageRec.ValueByName('QcQuantity').AsFloat;
+    FBillsCurQcTotalPrice := FBillsCurQcTotalPrice + AStageRec.ValueByName('QcTotalPrice').AsFloat;
+    FBillsCurGatherQuantity := FBillsCurGatherQuantity + AStageRec.ValueByName('GatherQuantity').AsFloat;
+    FBillsCurGatherTotalPrice := FBillsCurGatherTotalPrice + AStageRec.ValueByName('GatherTotalPrice').AsFloat;
+
+    FBillsEndDealQuantity := FBillsEndDealQuantity + AStageRec.ValueByName('DealQuantity').AsFloat;
+    FBillsEndDealTotalPrice := FBillsEndDealTotalPrice + AStageRec.ValueByName('DealTotalPrice').AsFloat;
+    FBillsEndQcQuantity := FBillsEndQcQuantity + AStageRec.ValueByName('QcQuantity').AsFloat;
+    FBillsEndQcTotalPrice := FBillsEndQcTotalPrice + AStageRec.ValueByName('QcTotalPrice').AsFloat;
+    FBillsEndGatherQuantity := FBillsEndGatherQuantity + AStageRec.ValueByName('GatherQuantity').AsFloat;
+    FBillsEndGatherTotalPrice := FBillsEndGatherTotalPrice + AStageRec.ValueByName('GatherTotalPrice').AsFloat;
+  end;
+end;
+
+function TZjjl.MergeStr(AStr1, AStr2: string): string;
+begin
+  if (AStr1 <> '') then
+  begin
+    if (AStr2 <> '') then
+      Result := AStr1 + ';' + AStr2
+    else
+      Result := AStr1;
+  end
+  else
+  begin
+    if (AStr2 <> '') then
+      Result := AStr2
+    else
+      Result := '';
+  end;
+end;
+
+{ TrmWeiWuZjjlGatherData }
+
+function TrmWeiWuZjjlGatherData.AssignData(
+  AProjectData: TProjectData): TDataSet;
+begin
+  FZjjlList := TList.Create;
+  try
+    if AProjectData.PhaseData.Active then
+    begin
+      GatherZjjl(AProjectData);
+      WriteData;
+    end;
+    Result := cdsZjjl;
+  finally
+    ClearObjects(FZjjlList);
+    FZjjlList.Free;
+  end;
+end;
+
+function TrmWeiWuZjjlGatherData.FindZjjl(ARec, ABillsRec: TsdDataRecord): TZjjl;
+var
+  sCode, sName, sUnits, sDrawingCode: string;
+  fPrice: Double;
+  i: Integer;
+  vZ: TZjjl;
+begin
+  sCode := ABillsRec.ValueByName('B_Code').AsString;
+  sName := ABillsRec.ValueByName('Name').AsString;
+  sUnits := ABillsRec.ValueByName('Units').AsString;
+  sDrawingCode := GetThirdPartString(ABillsRec.ValueByName('DrawingCode').AsString);
+  fPrice := ABillsRec.valueByName('Price').AsFloat;
+
+  Result := nil;
+  for i := 0 to FZjjlList.Count - 1 do
+  begin
+    vZ := TZjjl(FZjjlList.Items[i]);
+    if SameText(vZ.FBillsCode, sCode) and SameText(vZ.FBillsName, sName) and SameText(vZ.FBillsUnits, sUnits) and
+       (PriceRoundTo(fPrice - vZ.FBillsPrice) < 0.00001) and
+       SameText(sDrawingCode, vZ.FFilterDrawingCode) then
+    begin
+      Result := vZ;
+      Break;
+    end;
+  end;
+end;
+
+procedure TrmWeiWuZjjlGatherData.GatherZjjl(AProjectData: TProjectData);
+var
+  i: Integer;
+  Rec, BillsRec, StageRec: TsdDataRecord;
+  vZ: TZjjl;
+begin
+  for i := 0 to AProjectData.PhaseData.ZJJLData.sddZJJL.RecordCount - 1 do
+  begin
+    Rec := AProjectData.PhaseData.ZJJLData.sddZJJL.Records[I];
+    BillsRec := AProjectData.BillsData.sddBills.FindKey('idxID', Rec.ValueByName('BillsID').AsInteger);
+    StageRec := AProjectData.PhaseData.StageData.StageRecord(Rec.ValueByName('BillsID').AsInteger);
+    if Assigned(Rec) and Assigned(BillsRec) then
+    begin
+      vZ := FindZjjl(Rec, BillsRec);
+      if not Assigned(vZ) then
+      begin
+        vZ := TZjjl.Create(Rec, BillsRec, StageRec);
+        FZjjlList.Add(vZ);
+      end
+      else
+        vZ.Merge(Rec, BillsRec, StageRec);
+    end;
+  end;
+end;
+
+procedure TrmWeiWuZjjlGatherData.WriteData;
+var
+  i: Integer;
+  vZ: TZjjl;
+begin       
+  cdsZjjl.Active := True;
+  cdsZjjl.EmptyDataSet;
+  for i := 0 to FZjjlList.Count - 1 do
+  begin
+    vZ := TZjjl(FZjjlList.Items[i]);
+
+    cdsZjjl.Append;
+    cdsZjjlCode.AsString := vZ.FCode;
+    cdsZjjlCertificateCode.AsString := vZ.FCertificateCode;
+    cdsZjjlBGLCode.AsString := vZ.FBGLCode;
+    cdsZjjlPegName.AsString := vZ.FPegName;
+    cdsZjjlBeginPeg.AsString := vZ.FBeginPeg;
+    cdsZjjlEndPeg.AsString := vZ.FEndPeg;
+    cdsZjjlFBFXName.AsString := vZ.FFBFXName;
+    cdsZjjlUnitName.AsString := vZ.FUnitName;
+    cdsZjjlDrawingCode.AsString := vZ.FDrawingCode;
+
+    cdsZjjlBillsCode.AsString := vZ.FBillsCode;
+    cdsZjjlBillsName.AsString := vZ.FBillsName;
+    cdsZjjlBillsUnits.AsString := vZ.FBillsUnits;
+    cdsZjjlBillsPrice.AsFloat := vZ.FBillsPrice;
+    cdsZjjlFilterDrawingCode.AsString := vZ.FFilterDrawingCode;
+
+    cdsZjjlBillsCurDealQuantity.AsFloat := vZ.FBillsCurDealQuantity;
+    cdsZjjlBillsCurDealTotalPrice.AsFloat := vZ.FBillsCurDealTotalPrice;
+    cdsZjjlBillsCurQcQuantity.AsFloat := vZ.FBillsCurQcQuantity;
+    cdsZjjlBillsCurQcTotalPrice.AsFloat := vZ.FBillsCurQcTotalPrice;
+    cdsZjjlBillsCurGatherQuantity.AsFloat := vZ.FBillsCurGatherQuantity;
+    cdsZjjlBillsCurGatherTotalPrice.AsFloat := vZ.FBillsCurGatherTotalPrice;
+
+    cdsZjjlBillsEndDealQuantity.AsFloat := vZ.FBillsEndDealQuantity;
+    cdsZjjlBillsEndDealTotalPrice.AsFloat := vZ.FBillsEndDealTotalPrice;
+    cdsZjjlBillsEndQcQuantity.AsFloat := vZ.FBillsEndQcQuantity;
+    cdsZjjlBillsEndQcTotalPrice.AsFloat := vZ.FBillsEndQcTotalPrice;
+    cdsZjjlBillsEndGatherQuantity.AsFloat := vZ.FBillsEndGatherQuantity;
+    cdsZjjlBillsEndGatherTotalPrice.AsFloat := vZ.FBillsEndGatherTotalPrice;
+    cdsZjjl.Post;
+  end;
+end;
+
+end.

+ 7 - 0
Forms/MainFrm.pas

@@ -224,6 +224,8 @@ type
     procedure ChangeLeftSideGlobalView(AIndex: Integer);
     function GetCurProjectFrame: TProjectFrame;
 
+    procedure OnError(ASender: TObject; AE: Exception);
+
     procedure ResetAutoSave;
   public
     procedure UpdateProgress(APos: Integer; const AHint: string);
@@ -860,4 +862,9 @@ begin
   ShellExecute(Application.Handle, nil, PChar(sHelpUrl), nil, nil, SW_SHOWNORMAL);
 end;
 
+procedure TMainForm.OnError(ASender: TObject; AE: Exception);
+begin
+  MeasureLog.AppendLogTo(AE.Message);
+end;
+
 end.

+ 3 - 17
Frames/ZJJLFme.pas

@@ -68,7 +68,6 @@ type
     procedure RefreshTitle;
     procedure GenerateZJJL;
 
-    procedure DetailGridCellTextChanged(Sender: TObject; Col, Row: Integer);
     procedure InitDetailGrid;
   public
     constructor Create(AParent: TFrame; AZJJLData: TZJJLData);
@@ -237,20 +236,6 @@ begin
     TAction(Sender).Enabled := not StageDataReadOnly;
 end;
 
-procedure TZJJLFrame.DetailGridCellTextChanged(Sender: TObject; Col,
-  Row: Integer);
-var
-  Rec: TsdDataRecord;
-begin
-  Rec := saZJJL.DataView.Current;
-  if not Assigned(Rec) then Exit;
-
-  if (Row = 8) then
-    Rec.ValueByName('FormulaMemo').AsString := TZJGrid(Sender).Cells[Col, Row].Text
-  else if (Row = 10) then
-    Rec.ValueByName('RelaFile').AsString := TZJGrid(Sender).Cells[Col, Row].Text;
-end;
-
 procedure TZJJLFrame.zgDetailInfoGetCellText(Sender: TObject;
   const ACoord: TPoint; var Value: String; DisplayText: Boolean);
 
@@ -274,7 +259,8 @@ procedure TZJJLFrame.zgDetailInfoGetCellText(Sender: TObject;
   end;
 
 begin
-  Value := GetText(TRowIndex(ACoord.Y));
+  if (ACoord.Y >= 0) and (ACoord.Y <= 10) then
+    Value := GetText(TRowIndex(ACoord.Y));
 end;
 
 procedure TZJJLFrame.InitDetailGrid;
@@ -319,7 +305,7 @@ var
   sFieldName: string;
 begin
   sFieldName := RowFields[TRowIndex(ACoord.Y)];
-  Allow := sFieldName <> '';
+  Allow := (sFieldName <> '') and Assigned(saZJJL.DataView.Current);
 end;
 
 end.

+ 4 - 1
Units/LogUtils.pas

@@ -10,6 +10,7 @@ type
   private
     FLogFolder: string;
     FLogFile: string;
+    FExeVersion: string;
   public
     constructor Create;
     destructor Destroy; override;
@@ -33,7 +34,7 @@ begin
       Append(f)
     else
       Rewrite(f);
-    Writeln(f, Format('%s %s', [DateTimeToStr(Now), ALog]));
+    Writeln(f, Format('[Version: %s] %s %s', [FExeVersion, DateTimeToStr(Now), ALog]));
     Flush(f);
   finally
     CloseFile(f);
@@ -50,6 +51,8 @@ begin
   if not DirectoryExists(FLogFolder) then
     CreateDirectoryInDeep(FLogFolder);
   FLogFile := FLogFolder + '\' + DateToStr(Date, vFormatSetting) + '.log';
+
+  FExeVersion := GetExeFileVersion(ParamStr(0));
 end;
 
 destructor TLogUtils.Destroy;

+ 1 - 1
Units/OpenProjectManager.pas

@@ -117,7 +117,7 @@ end;
 procedure TOpenProjectManager.Save(AIndex: Integer);
 begin
   if CheckIndexAvailable(AIndex) then
-    TProjectData(FProjectList.Items[AIndex]).Save;
+    TProjectData(FProjectList.Items[AIndex]).SaveAndCheck;
 end;
 
 procedure TOpenProjectManager.SaveAll;

+ 7 - 1
Units/ReportManager.pas

@@ -8,6 +8,7 @@ uses
   rmGclBillsAuditCompareDm, rmDealInfosDm, rmXmjBGLDetailDm,
   rmOtherReport1Dm, rmGcl_XmjBillsDm, rmGclBillsPlaneDm,
   rmMentalCustomized1Dm, rmCustomized2Dm, rmHaBaiCustomizedDm,
+  rmWeiWuZjjlGatherDm,
   rmTestFrm,
   ReportInteractInfo,
   Classes, ScFileArchiver, IniFiles, Graphics, DB, ProjectData,
@@ -223,6 +224,7 @@ type
     FrmMentalCustomized1Data: TrmMentalCustomized1Data;
     FrmCustomized2Data: TrmCustomized2Data;
     FrmHaBaiCustomizedData: TrmHaBaiCustomizedData;
+    FrmWeiWuZjjlGatherData: TrmWeiWuZjjlGatherData;
 
     FMemoryQuery: TADOQuery;
 
@@ -655,6 +657,7 @@ begin
   FrmMentalCustomized1Data := TrmMentalCustomized1Data.Create(nil);
   FrmCustomized2Data := TrmCustomized2Data.Create(nil);
   FrmHaBaiCustomizedData := TrmHaBaiCustomizedData.Create(nil);
+  FrmWeiWuZjjlGatherData := TrmWeiWuZjjlGatherData.Create(nil);
 
   FMemoryQuery := TADOQuery.Create(nil);
 
@@ -680,6 +683,7 @@ begin
 
   FMemoryQuery.Free;
 
+  FrmWeiWuZjjlGatherData.Free;
   FrmHaBaiCustomizedData.Free;
   FrmCustomized2Data.Free;
   FrmMentalCustomized1Data.Free;
@@ -723,6 +727,7 @@ end;
 function TMemoryReportManager.GetMemoryDataSet(
   ADataSetID: Integer; AProjectData: TProjectData): TDataSet;
 begin
+  ADataSetID := 56;
   {if FrmHaBaiCustomizedData.hbGatherType = hbgt_CS then
     ADataSetID := 51
   else
@@ -762,9 +767,10 @@ begin
     42: Result := FrmGcl_XmjBillsData.AssignData(AProjectData, gxtFlowGcl); // 云南标准表,台账明细表
     43: Result := FrmGcl_XmjBillsData.AssignData(AProjectData, gxtWithoutXmj); // 云南标准表,单标段清单汇总表
     51: Result := FrmHaBaiCustomizedData.AssignAssistantData(hbgt_CS); //内蒙古哈白、国道306定制表--会签辅助表
+    56: Result := FrmWeiWuZjjlGatherData.AssignData(AProjectData); // 甘肃渭武 -- 单标段、计量支付汇总表
   end;
   // For Inner Test
-  //ShowTestForm(Result);
+  ShowTestForm(Result);
 end;
 
 function TMemoryReportManager.GetSqlResultDataSet(const ASql: string;