浏览代码

Merge remote-tracking branch 'remotes/origin/ProjGather-beforeReportManagement'

Conflicts:
	Dprs/GSZG/Measure_Cloud.dof
	Dprs/GSZG/Measure_Cloud.dpr
	Dprs/GSZG/Measure_Cloud.res
	Dprs/Pro/Measure.dof
	Dprs/Pro/Measure.dpr
	Dprs/Pro/Measure.res
	Dprs/Pro/Measure_Cloud.dof
	Dprs/Pro/Measure_Cloud.dpr
	Dprs/Pro/Measure_Cloud.res
	Dprs/Pro/Measure_GuangDong.dof
	Dprs/Pro/Measure_GuangDong.dpr
	Dprs/Pro/Measure_GuangDong.res
	Dprs/Pro/Measure_GuangDong_Cloud.dof
	Dprs/Pro/Measure_GuangDong_Cloud.dpr
	Dprs/Pro/Measure_GuangDong_Cloud.res
	Dprs/Pro/Measure_GuangDong_TZ.dpr
	Dprs/Pro/Measure_TZ.dof
	Dprs/Pro/Measure_TZ.dpr
	Dprs/Pro/Measure_TZ.res
	Dprs/Trail/Measure.dof
	Dprs/Trail/Measure.dpr
	Dprs/Trail/Measure.res
	Dprs/Trail/Measure_GuangDong.dof
	Dprs/Trail/Measure_GuangDong.dpr
	Dprs/Trail/Measure_GuangDong.res
MaiXinRong 7 年之前
父节点
当前提交
6e96923a50

+ 4 - 1
DataModules/BillsDm.dfm

@@ -261,6 +261,9 @@ object BillsData: TBillsData
       6D6506094E6F64654C6576656C094669656C644E616D6506094E6F64654C6576
       656C0844617461547970650203084461746153697A6502040549734B6579080F
       4E65656450726F636573734E616D650909507265636973696F6E02000453697A
-      6502000000}
+      6502000001044E616D65060D425F436F646543686170746572094669656C644E
+      616D65060D425F436F6465436861707465720844617461547970650203084461
+      746153697A6502040549734B6579080F4E65656450726F636573734E616D6509
+      09507265636973696F6E02000453697A6502000000}
   end
 end

+ 13 - 0
DataModules/BillsDm.pas

@@ -176,6 +176,16 @@ procedure TBillsData.Save;
     end;
   end;
 
+  function GetB_CodeChapter(const AB_Code: string): Integer;
+  var
+    iValue, iError: Integer;
+  begin
+    Result := -1;
+    Val(AB_Code, iValue, iError);
+    if iValue > 0 then
+      Result := iValue div 100;
+  end;
+
   procedure SaveReportsRela;
   var
     iIndex: Integer;
@@ -218,6 +228,9 @@ procedure TBillsData.Save;
           end;
 
           stnNode.Rec.SetIntValue(stnNode.Rec.NodeLevel, stnNode.Level);
+
+          // ¹¤³ÌÁ¿Çåµ¥ËùÊôÕ¼¶
+          stnNode.Rec.SetIntValue(stnNode.Rec.B_CodeChapter, GetB_CodeChapter(stnNode.Rec.B_Code.AsString));
         end;
     finally
       sddBills.EndUpdate;

+ 2 - 1
DataModules/PHPWebDm.pas

@@ -848,10 +848,11 @@ begin
     for i := Low(AUpFileFields) to High(AUpFileFields) do
       IdDataStream.AddFile(AUpFileFields[i], AUpFileNames[i], 'text/plain');
     IdDataStream.Position := 0;
+
+    J := TCslJson.Create;
     try
       sPostResult := vIdHTTP.Post(MeasureURL + AUrl, IdDataStream);
 
-      J := TCslJson.Create;
       J.Text := Utf8ToAnsi(sPostResult);
       Result := SameText(J.Value['status'], 'true');
       if not Result then

+ 4 - 1
Dprs/GSZG/Measure_Cloud.dpr

@@ -224,7 +224,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 317 - 0
Dprs/PWFree/Measure_Cloud.dpr

@@ -0,0 +1,317 @@
+program Measure_Cloud;
+
+{$R '..\..\res\uac.res' '..\..\res\uac.rc'}
+
+uses
+  Windows,
+  ShareMem,
+  HttpApp,
+  Forms,
+  Controls,
+  MainFrm in '..\..\Forms\MainFrm.pas' {MainForm},
+  ProjectManagerFme in '..\..\Frames\ProjectManagerFme.pas' {ProjectManagerFrame: TFrame},
+  UtilMethods in '..\..\Units\UtilMethods.pas',
+  ProjectManagerDm in '..\..\DataModules\ProjectManagerDm.pas' {ProjectManagerData: TDataModule},
+  Connections in '..\..\Units\Connections.pas',
+  TransFile in '..\..\Units\TransFile.pas',
+  ZhAPI in '..\..\Units\ZhAPI.pas',
+  CompactDB in '..\..\Units\CompactDB.pas',
+  OpenProjectManager in '..\..\Units\OpenProjectManager.pas',
+  ProjectData in '..\..\Units\ProjectData.pas',
+  UpdateDataBase in '..\..\Units\UpdateDataBase.pas',
+  DataBaseTables in '..\..\Units\DataBaseTables.pas',
+  ConfigDoc in '..\..\Units\ConfigDoc.pas',
+  SupportUnit in '..\..\Units\SupportUnit.pas',
+  StandardLibs in '..\..\Units\StandardLibs.pas',
+  StandardLib in '..\..\Units\StandardLib.pas',
+  NewProjectFrm in '..\..\Forms\NewProjectFrm.pas' {NewProjectForm},
+  ProjectFme in '..\..\Frames\ProjectFme.pas' {ProjectFrame: TFrame},
+  StandardBillsDm in '..\..\DataModules\StandardBillsDm.pas' {StandardBillsData: TDataModule},
+  StandardBillsFme in '..\..\Frames\StandardBillsFme.pas' {StandardBillsFrame: TFrame},
+  StandardLibsFme in '..\..\Frames\StandardLibsFme.pas' {StandardLibsFrame: TFrame},
+  BillsDm in '..\..\DataModules\BillsDm.pas' {BillsData: TDataModule},
+  Globals in '..\..\Units\Globals.pas',
+  StageDm in '..\..\DataModules\StageDm.pas' {StageData: TDataModule},
+  ExcelImport in '..\..\Units\ExcelImport.pas',
+  CacheTree in '..\..\Units\CacheTree.pas',
+  MCacheTree in '..\..\Units\MCacheTree.pas',
+  ProjectPropertiesFrm in '..\..\Forms\ProjectPropertiesFrm.pas' {ProjectPropertiesForm},
+  ProjectProperty in '..\..\Units\ProjectProperty.pas',
+  FormulaCalc in '..\..\Units\FormulaCalc.pas',
+  BillsCommand in '..\..\Units\BillsCommand.pas',
+  PhaseData in '..\..\Units\PhaseData.pas',
+  PhaseProperty in '..\..\Units\PhaseProperty.pas',
+  BillsClipboard in '..\..\Units\BillsClipboard.pas',
+  BillsTree in '..\..\Units\BillsTree.pas',
+  ProjectCommands in '..\..\Units\ProjectCommands.pas',
+  PhaseCompareDm in '..\..\DataModules\PhaseCompareDm.pas' {PhaseCompareData: TDataModule},
+  PhaseCompareFme in '..\..\Frames\PhaseCompareFme.pas' {PhaseCompareFrame: TFrame},
+  OptionFrm in '..\..\Forms\OptionFrm.pas' {OptionForm},
+  DealPaymentDm in '..\..\DataModules\DealPaymentDm.pas' {DealPaymentData: TDataModule},
+  DealPaymentFme in '..\..\Frames\DealPaymentFme.pas' {DealPaymentFrame: TFrame},
+  PhasePayDm in '..\..\DataModules\PhasePayDm.pas' {PhasePayData: TDataModule},
+  ZJJLDm in '..\..\DataModules\ZJJLDm.pas' {ZJJLData: TDataModule},
+  BillsGatherDm in '..\..\DataModules\BillsGatherDm.pas' {BillsGatherData: TDataModule},
+  BillsGatherFme in '..\..\Frames\BillsGatherFme.pas' {BillsGatherFrame: TFrame},
+  LoginFrm in '..\..\Forms\LoginFrm.pas' {LoginFrm},
+  PHPWebDm in '..\..\DataModules\PHPWebDm.pas' {PHPWeb: TDataModule},
+  MD5Unit in '..\..\Units\MD5Unit.pas',
+  ConstUnit in '..\..\Units\ConstUnit.pas',
+  ExportExcel in '..\..\Units\ExportExcel.pas',
+  mEncryptEditions in '..\..\Encrypt\mEncryptEditions.pas',
+  mEncryptUnit in '..\..\Encrypt\mEncryptUnit.pas',
+  CryptUtils in '..\..\Encrypt\CryptUtils.pas',
+  EncryptDog in '..\..\Encrypt\EncryptDog.pas',
+  mEncryptPWD in '..\..\Encrypt\mEncryptPWD.pas',
+  mEncryptTypes in '..\..\Encrypt\mEncryptTypes.pas',
+  mR1Encrypt in '..\..\Encrypt\mR1Encrypt.pas',
+  mS4Utils in '..\..\Encrypt\mS4Utils.pas',
+  mSNSEncrypt in '..\..\Encrypt\mSNSEncrypt.pas',
+  Rockey1 in '..\..\Encrypt\Rockey1.pas',
+  mConnectEncrypt in '..\..\Encrypt\NetClient\mConnectEncrypt.pas',
+  FindUserFrm in '..\..\Forms\FindUserFrm.pas' {FindUserForm},
+  CslJson in '..\..\Units\CslJson.pas',
+  OrderCheckerFme in '..\..\Frames\OrderCheckerFme.pas' {OrderCheckerFrame: TFrame},
+  CheckerFme in '..\..\Frames\CheckerFme.pas' {CheckerFrame: TFrame},
+  WebNewTenderFrm in '..\..\Forms\WebNewTenderFrm.pas' {WebNewTenderForm},
+  ScFileArchiver in '..\..\Encrypt\ScFileArchiver.pas',
+  SearchDm in '..\..\DataModules\SearchDm.pas' {SearchData: TDataModule},
+  DealBillsDm in '..\..\DataModules\DealBillsDm.pas' {DealBillsData: TDataModule},
+  BGLDm in '..\..\DataModules\BGLDm.pas' {BGLData: TDataModule},
+  StaffDm in '..\..\DataModules\StaffDm.pas' {StaffData: TDataModule},
+  BillsCompileDm in '..\..\DataModules\BillsCompileDm.pas' {BillsCompileData: TDataModule},
+  BillsMeasureDm in '..\..\DataModules\BillsMeasureDm.pas' {BillsMeasureData: TDataModule},
+  ReportManager in '..\..\Units\ReportManager.pas',
+  BGLSelectFrm in '..\..\Forms\BGLSelectFrm.pas' {BGLSelectForm},
+  BillsCompileFme in '..\..\Frames\BillsCompileFme.pas' {BillsCompileFrame: TFrame},
+  BillsMeasureFme in '..\..\Frames\BillsMeasureFme.pas' {BillsMeasureFrame: TFrame},
+  BatchReplaceBillsFrm in '..\..\Forms\BatchReplaceBillsFrm.pas' {BatchReplaceBillsForm},
+  ZJJLFme in '..\..\Frames\ZJJLFme.pas' {ZJJLFrame: TFrame},
+  BGLFme in '..\..\Frames\BGLFme.pas' {BGLFrame: TFrame},
+  MergeTextFrm in '..\..\Forms\MergeTextFrm.pas' {MergeTextForm},
+  ReportsFrm in '..\..\Forms\ReportsFrm.pas' {ReportsForm},
+  ReportAdjustFrm in '..\..\Forms\ReportAdjustFrm.pas' {ReportAdjustForm},
+  SearchFme in '..\..\Frames\SearchFme.pas' {SearchFrame: TFrame},
+  AuthFrm in '..\..\Forms\AuthFrm.pas' {AuthorizeForm},
+  AboutFrm in '..\..\Forms\AboutFrm.pas' {AboutForm},
+  ImportExcelHintFrm in '..\..\Forms\ImportExcelHintFrm.pas' {ImportExcelHintForm},
+  PasswordInputFrm in '..\..\Forms\PasswordInputFrm.pas' {PasswordInputForm},
+  BatchInsertBillsFrm in '..\..\Forms\BatchInsertBillsFrm.pas' {BatchInsertBillsForm},
+  MainDataListDm in '..\..\DataModules\MainDataListDm.pas' {MainListData: TDataModule},
+  mProgressFrm in '..\..\Forms\mProgressFrm.pas' {mProgress},
+  rmGclBillsBGDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsBGDm.pas' {rmGclBillsBGData: TDataModule},
+  rmGclBillsCompareDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsCompareDm.pas' {rmGclBillsCompareData: TDataModule},
+  rmBGLExecutionDm in '..\..\DataModules\ReportMemoryDm\rmBGLExecutionDm.pas' {rmBGLExecutionData: TDataModule},
+  rmBillsGatherDm in '..\..\DataModules\ReportMemoryDm\rmBillsGatherDm.pas' {rmBillsGatherData: TDataModule},
+  rmFxBillsAddDm in '..\..\DataModules\ReportMemoryDm\rmFxBillsAddDm.pas' {rmFxBillsAddData: TDataModule},
+  rmFxBillsCompareDm in '..\..\DataModules\ReportMemoryDm\rmFxBillsCompareDm.pas' {rmFxBillsCompareData: TDataModule},
+  rmGclBillsAddDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsAddDm.pas' {rmGclBillsAddData: TDataModule},
+  rmGridHeaderDm in '..\..\DataModules\ReportMemoryDm\rmGridHeaderDm.pas' {rmGridHeaderData: TDataModule},
+  rmCacheData in '..\..\DataModules\ReportMemoryDm\rmCacheData.pas',
+  rmSelectProjectFrm in '..\..\Forms\rmSelectProjectFrm.pas' {ProjectSelectForm},
+  ConditionalDefines in '..\..\Units\ConditionalDefines.pas',
+  ProgressHintFrm in '..\..\Forms\ProgressHintFrm.pas' {ProgressHintForm},
+  CheckAndClearFrm in '..\..\Forms\CheckAndClearFrm.pas' {CheckAndClearForm},
+  rmGclBillsAuditCompareDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsAuditCompareDm.pas' {rmGclBillsAuditCompareData: TDataModule},
+  rmTestFrm in '..\..\DataModules\ReportMemoryDm\rmTestFrm.pas' {rmTestForm},
+  DealBillsFrm in '..\..\Forms\DealBillsFrm.pas' {DealBillsForm},
+  TenderBackupFrm in '..\..\Forms\TenderBackupFrm.pas' {TenderBackupForm},
+  TenderBackupDm in '..\..\DataModules\TenderBackupDm.pas' {TenderBackupData: TDataModule},
+  BillsBookmarkDm in '..\..\DataModules\BillsBookmarkDm.pas' {BillsBookmarkData: TDataModule},
+  BookmarkFme in '..\..\Frames\BookmarkFme.pas' {BookmarkFrame: TFrame},
+  rmDealInfosDm in '..\..\DataModules\ReportMemoryDm\rmDealInfosDm.pas' {rmDealInfosData: TDataModule},
+  rmXmjBGLDetailDm in '..\..\DataModules\ReportMemoryDm\rmXmjBGLDetailDm.pas' {rmXmjBGLDetailData: TDataModule},
+  WelcomeFrm in '..\..\Forms\WelcomeFrm.pas' {WelcomeForm},
+  rmOtherReport1Dm in '..\..\DataModules\ReportMemoryDm\rmOtherReport1Dm.pas' {rmOtherReport1Data: TDataModule},
+  CheckerMemoFrm in '..\..\Forms\CheckerMemoFrm.pas' {CheckerMemoForm},
+  CslHint in '..\..\Units\CslHint.pas',
+  IPFrm in '..\..\Forms\IPFrm.pas' {IPForm},
+  TenderBackupManager in '..\..\Units\TenderBackupManager.pas',
+  UpFileManageUnit in '..\..\Units\UpFileManageUnit.pas',
+  UpFileFrame in '..\..\Forms\UpFileFrame.pas',
+  UpFileManageFrame in '..\..\Forms\UpFileManageFrame.pas',
+  SheetSelectFrm in '..\..\Forms\SheetSelectFrm.pas' {SheetSelectForm},
+  ReportInteractInfo in '..\..\Units\ReportInteractInfo.pas',
+  Checker in '..\..\Units\Checker.pas',
+  AuditSelectFrm in '..\..\Forms\ReportInteractFrms\AuditSelectFrm.pas' {AuditSelctForm},
+  DealBillsFme in '..\..\Frames\DealBillsFme.pas' {DealBillsFrame: TFrame},
+  rmGclBillsPlaneDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsPlaneDm.pas' {rmGclBillsPlaneData: TDataModule},
+  StageCompareDm in '..\..\DataModules\StageCompareDm.pas' {StageCompareData: TDataModule},
+  mDataRecord in '..\..\Units\mDataRecord.pas',
+  BGLClipboard in '..\..\Units\BGLClipboard.pas',
+  rmMentalCustomized1Dm in '..\..\DataModules\ReportMemoryDm\rmMentalCustomized1Dm.pas' {rmMentalCustomized1Data: TDataModule},
+  rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
+  rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
+  CalcDecimal in '..\..\Units\CalcDecimal.pas',
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
+  mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm},
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  ProjectGLDm in '..\..\DataModules\ProjectGLDm.pas' {ProjectGLData: TDataModule},
+  PriceMarginBillsDm in '..\..\DataModules\PriceMarginBillsDm.pas' {PriceMarginBillsData: TDataModule},
+  GclBillsGatherModel in '..\..\Units\GclBillsGatherModel.pas',
+  DetailGLDm in '..\..\DataModules\DetailGLDm.pas' {DetailGLData: TDataModule},
+  PriceMarginFme in '..\..\Frames\PriceMarginFme.pas' {PriceMarginFrame: TFrame},
+  ProjectGLFme in '..\..\Frames\ProjectGLFme.pas' {ProjectGLFrame: TFrame},
+  SelectDetailGLsFrm in '..\..\Forms\SelectDetailGLsFrm.pas' {SelectDetailGLsForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm},
+  BaseClipboard in '..\..\Units\BaseClipboard.pas',
+  mPegFilter in '..\..\Units\mPegFilter.pas',
+  tpBaseGatherData in '..\..\TenderPartition\tpBaseGatherData.pas',
+  tpGatherGcl in '..\..\TenderPartition\tpGatherGcl.pas',
+  tpGatherTree in '..\..\TenderPartition\tpGatherTree.pas',
+  tpMainData in '..\..\TenderPartition\tpMainData.pas',
+  tpMainFrm in '..\..\TenderPartition\tpMainFrm.pas' {tpMainForm},
+  tpNoPegDm in '..\..\TenderPartition\tpNoPegDm.pas' {tpNoPegData: TDataModule},
+  tpPartTender in '..\..\TenderPartition\tpPartTender.pas',
+  tpPartTenderFme in '..\..\TenderPartition\tpPartTenderFme.pas' {tpPartTenderFrame: TFrame},
+  tpPartTenderSet in '..\..\TenderPartition\tpPartTenderSet.pas',
+  tpPartTenderSetFme in '..\..\TenderPartition\tpPartTenderSetFme.pas' {tpPartTenderSetFrame: TFrame},
+  tpPeg in '..\..\TenderPartition\tpPeg.pas',
+  tpPeg_GclDm in '..\..\TenderPartition\tpPeg_GclDm.pas' {tpPeg_GclData: TDataModule},
+  tpPeg_GclFme in '..\..\TenderPartition\tpPeg_GclFme.pas' {tpPeg_GclFrame: TFrame},
+  tpPegBlock in '..\..\TenderPartition\tpPegBlock.pas',
+  tpPegGclGatherDm in '..\..\TenderPartition\tpPegGclGatherDm.pas' {tpPegGclGatherData: TDataModule},
+  tpPegGclGatherFme in '..\..\TenderPartition\tpPegGclGatherFme.pas' {tpPegGclGatherFrame: TFrame},
+  tpPegPartSettingFrm in '..\..\TenderPartition\tpPegPartSettingFrm.pas' {tpPegPartSettingForm},
+  tpPricePartSettingFrm in '..\..\TenderPartition\tpPricePartSettingFrm.pas' {tpPricePartSettingForm},
+  tpSelectTenderDm in '..\..\TenderPartition\tpSelectTenderDm.pas' {tpSelectTenderData: TDataModule},
+  tpSelectTenderNode in '..\..\TenderPartition\tpSelectTenderNode.pas',
+  tpSelectTendersFrm in '..\..\TenderPartition\tpSelectTendersFrm.pas' {SelectTendersForm},
+  tpTrialPegInputFrm in '..\..\TenderPartition\tpTrialPegInputFrm.pas' {TrialPegInputForm},
+  PriceMarginBillsFme in '..\..\Frames\PriceMarginBillsFme.pas' {PriceMarginBillsFrame: TFrame},
+  ReportPrepare in '..\..\Report\ReportPrepare.pas',
+  rdpBillsGatherDm in '..\..\Report\DataPrepare\rdpBillsGatherDm.pas' {rdpBillsGatherData: TDataModule},
+  rdpTables in '..\..\Report\DataPrepare\rdpTables.pas',
+  ColVisibleManager in '..\..\Units\ColVisibleManager.pas',
+  ReportConnection in '..\..\Report\ReportConnection.pas',
+  rgpGatherControl in '..\..\Report\ProjGather\rgpGatherControl.pas',
+  rpgBillsCalcDm in '..\..\Report\ProjGather\rpgBillsCalcDm.pas' {rpgBillsCalcData: TDataModule},
+  rpgBillsDm in '..\..\Report\ProjGather\rpgBillsDm.pas' {rpgBillsData: TDataModule},
+  rpgGatherControl in '..\..\Report\ProjGather\rpgGatherControl.pas',
+  rpgGatherData in '..\..\Report\ProjGather\rpgGatherData.pas',
+  rpgGatherProjDm in '..\..\Report\ProjGather\rpgGatherProjDm.pas' {rpgGatherProjData: TDataModule},
+  rProjGatherTables in '..\..\Report\ProjGather\rProjGatherTables.pas',
+  ProjGatherTree in '..\..\ProjGather\ProjGatherTree.pas',
+  ProjGather in '..\..\ProjGather\ProjGather.pas',
+  CalcData in '..\..\Units\CalcData.pas',
+  GatherProjInfo in '..\..\ProjGather\GatherProjInfo.pas',
+  ProjGatherCalcData in '..\..\ProjGather\ProjGatherCalcData.pas',
+  ProjGatherSelectFrm in '..\..\ProjGather\ProjGatherSelectFrm.pas' {ProjGatherSelectForm},
+  DealBillsExcelImport in '..\..\Units\DealBillsExcelImport.pas',
+  ExcelImport_Bills in '..\..\Units\ExcelImport_Bills.pas',
+  ExcelImport_GclBills in '..\..\Units\ExcelImport_GclBills.pas',
+  DbTreeImport in '..\..\Units\DbTreeImport.pas',
+  DbTreeDm in '..\..\DataModules\DbTreeDm.pas' {DbTreeData: TDataModule},
+  DebugUsers in '..\..\Units\DebugUsers.pas',
+  OtherMeasurePhaseDm in '..\..\DataModules\OtherMeasurePhaseDm.pas' {OtherMeasurePhaseData: TDataModule},
+  OtherMeasureOnceDm in '..\..\DataModules\OtherMeasureOnceDm.pas' {OtherMeasureOnceData: TDataModule},
+  OMPhaseRecord in '..\..\Units\DataRecord\OMPhaseRecord.pas',
+  OtherMeasureFme in '..\..\Frames\OtherMeasureFme.pas' {OtherMeasureFrame: TFrame},
+  ProjGatherSelectFme in '..\..\ProjGather\ProjGatherSelectFme.pas' {ProjGatherSelectFrame: TFrame},
+  rpgZoneGatherControl in '..\..\Report\ProjGather\Zone\rpgZoneGatherControl.pas',
+  rpgZoneProjGatherSelectFrm in '..\..\Report\ProjGather\Zone\rpgZoneProjGatherSelectFrm.pas' {rpgZoneProjGatherSelectForm},
+  UpFileSelectOnLineFrm in '..\..\Forms\UpFileSelectOnLineFrm.pas' {UpFileSelectOnLineForm},
+  LogUtils in '..\..\Units\LogUtils.pas',
+  ReportPdfHelper in '..\..\Units\ReportPdfHelper.pas',
+  SelectOnlineSignPhaseFrm in '..\..\Forms\SelectOnlineSignPhaseFrm.pas' {SelectOnlineSignPhaseForm},
+  SignOnlineReportsFrm in '..\..\Forms\SignOnlineReportsFrm.pas' {SignOnlineReportsForm},
+  SignReports in '..\..\Units\SignReports.pas',
+  VirtualTrees in '..\..\..\SmartCost\Components\virtualtree\VirtualTrees.pas',
+  TemplateManagerHelper in '..\..\Units\TemplateManagerHelper.pas',
+  RenameSignReportFrm in '..\..\Forms\RenameSignReportFrm.pas' {RenameSignReportForm},
+  rmWeiWuZjjlGatherDm in '..\..\DataModules\ReportMemoryDm\rmWeiWuZjjlGatherDm.pas' {rmWeiWuZjjlGatherData: TDataModule},
+  SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
+
+{$R *.res}
+
+var
+  Mutex: THandle;
+  IPForm: TIPForm;
+  sInfo, sURL, sName: string;
+
+begin
+  Mutex := CreateMutex(nil, True, G_AppHandleName);
+
+  if GetLastError = ERROR_ALREADY_EXISTS then
+    Application.MessageBox('程序正在运行, 请勿重复打开该软件!', '系统提示', MB_OK + MB_ICONINFORMATION)
+  else
+  begin
+    Application.CreateHandle;
+    Application.Initialize;
+    Application.Title := '纵横公路工程结算决算计量一体化软件云版';
+    {$IFDEF _mCloud}
+      IPForm := TIPForm.Create(nil);
+      try
+        if not IPForm.HasIP then
+        begin
+          IPForm.ShowModal;
+          if IPForm.ModalResult <> mrOK then
+          begin
+            Application.Terminate;
+            Exit;
+          end;
+        end;
+      finally
+        IPForm.Free;
+      end;
+
+      {$IFDEF _mLoginNoPW}
+      sName := PHPWeb.GetNameFromURLProtocol(ParamStr(1));
+
+         
+      if sName = '' then         // 表示手工运行的
+      begin
+        Application.MessageBox('请从 项目管理信息平台 打开软件。', '系统提示', MB_OK + MB_ICONINFORMATION);
+        Application.Terminate;
+      end
+      else
+
+      begin
+        // For Test only!
+//        Application.MessageBox(PChar(ParamStr(1) + #10#13 + sName), '系统提示', MB_OK + MB_ICONINFORMATION);
+//        Application.Terminate;
+        if sName[1]= '%' then
+           sName:=UTF8Decode(HttpDecode(sName));
+
+        case PHPWeb.Login(sName, '', 2, sInfo, sURL) of
+          ltLoginFail:
+          begin
+            Application.MessageBox('该用户尚未注册不能登录!', '操作提醒', MB_OK + MB_ICONWARNING);
+            Application.Terminate;
+          end;
+
+          ltDisCon:
+          begin
+            Application.MessageBox('网络错误,请稍后重试!', '操作提醒', MB_OK + MB_ICONWARNING);
+            Application.Terminate;
+          end;
+
+        else
+          ;
+        end;  
+      end;
+
+      {$ELSE}
+      if not LoginForm then
+      begin
+        Application.Terminate;
+        Exit;
+      end;
+      {$ENDIF}
+      
+    {$ENDIF}
+
+    if CheckDogExists then
+    begin
+      Application.CreateForm(TMainForm, MainForm);
+  Application.CreateForm(TSetGuestForm, SetGuestForm);
+  end;
+    Application.Run;
+  end;
+
+  ReleaseMutex(Mutex);
+end.

+ 278 - 0
Dprs/PWFree/Measure_GuangDong_Cloud.dpr

@@ -0,0 +1,278 @@
+program Measure_GuangDong_Cloud;
+
+{$R '..\..\res\uac.res' '..\..\res\uac.rc'}
+
+uses
+  Windows,
+  ShareMem,
+  Forms,
+  Controls,
+  MainFrm in '..\..\Forms\MainFrm.pas' {MainForm},
+  ProjectManagerFme in '..\..\Frames\ProjectManagerFme.pas' {ProjectManagerFrame: TFrame},
+  UtilMethods in '..\..\Units\UtilMethods.pas',
+  ProjectManagerDm in '..\..\DataModules\ProjectManagerDm.pas' {ProjectManagerData: TDataModule},
+  Connections in '..\..\Units\Connections.pas',
+  TransFile in '..\..\Units\TransFile.pas',
+  ZhAPI in '..\..\Units\ZhAPI.pas',
+  CompactDB in '..\..\Units\CompactDB.pas',
+  OpenProjectManager in '..\..\Units\OpenProjectManager.pas',
+  ProjectData in '..\..\Units\ProjectData.pas',
+  UpdateDataBase in '..\..\Units\UpdateDataBase.pas',
+  DataBaseTables in '..\..\Units\DataBaseTables.pas',
+  ConfigDoc in '..\..\Units\ConfigDoc.pas',
+  SupportUnit in '..\..\Units\SupportUnit.pas',
+  StandardLibs in '..\..\Units\StandardLibs.pas',
+  StandardLib in '..\..\Units\StandardLib.pas',
+  NewProjectFrm in '..\..\Forms\NewProjectFrm.pas' {NewProjectForm},
+  ProjectFme in '..\..\Frames\ProjectFme.pas' {ProjectFrame: TFrame},
+  StandardBillsDm in '..\..\DataModules\StandardBillsDm.pas' {StandardBillsData: TDataModule},
+  StandardBillsFme in '..\..\Frames\StandardBillsFme.pas' {StandardBillsFrame: TFrame},
+  StandardLibsFme in '..\..\Frames\StandardLibsFme.pas' {StandardLibsFrame: TFrame},
+  BillsDm in '..\..\DataModules\BillsDm.pas' {BillsData: TDataModule},
+  Globals in '..\..\Units\Globals.pas',
+  StageDm in '..\..\DataModules\StageDm.pas' {StageData: TDataModule},
+  ExcelImport in '..\..\Units\ExcelImport.pas',
+  CacheTree in '..\..\Units\CacheTree.pas',
+  MCacheTree in '..\..\Units\MCacheTree.pas',
+  ProjectPropertiesFrm in '..\..\Forms\ProjectPropertiesFrm.pas' {ProjectPropertiesForm},
+  ProjectProperty in '..\..\Units\ProjectProperty.pas',
+  FormulaCalc in '..\..\Units\FormulaCalc.pas',
+  BillsCommand in '..\..\Units\BillsCommand.pas',
+  PhaseData in '..\..\Units\PhaseData.pas',
+  PhaseProperty in '..\..\Units\PhaseProperty.pas',
+  BillsClipboard in '..\..\Units\BillsClipboard.pas',
+  BillsTree in '..\..\Units\BillsTree.pas',
+  ProjectCommands in '..\..\Units\ProjectCommands.pas',
+  PhaseCompareDm in '..\..\DataModules\PhaseCompareDm.pas' {PhaseCompareData: TDataModule},
+  PhaseCompareFme in '..\..\Frames\PhaseCompareFme.pas' {PhaseCompareFrame: TFrame},
+  OptionFrm in '..\..\Forms\OptionFrm.pas' {OptionForm},
+  DealPaymentDm in '..\..\DataModules\DealPaymentDm.pas' {DealPaymentData: TDataModule},
+  DealPaymentFme in '..\..\Frames\DealPaymentFme.pas' {DealPaymentFrame: TFrame},
+  PhasePayDm in '..\..\DataModules\PhasePayDm.pas' {PhasePayData: TDataModule},
+  ZJJLDm in '..\..\DataModules\ZJJLDm.pas' {ZJJLData: TDataModule},
+  BillsGatherDm in '..\..\DataModules\BillsGatherDm.pas' {BillsGatherData: TDataModule},
+  BillsGatherFme in '..\..\Frames\BillsGatherFme.pas' {BillsGatherFrame: TFrame},
+  LoginFrm in '..\..\Forms\LoginFrm.pas' {LoginFrm},
+  PHPWebDm in '..\..\DataModules\PHPWebDm.pas' {PHPWeb: TDataModule},
+  MD5Unit in '..\..\Units\MD5Unit.pas',
+  ConstUnit in '..\..\Units\ConstUnit.pas',
+  ExportExcel in '..\..\Units\ExportExcel.pas',
+  mEncryptEditions in '..\..\Encrypt\mEncryptEditions.pas',
+  mEncryptUnit in '..\..\Encrypt\mEncryptUnit.pas',
+  CryptUtils in '..\..\Encrypt\CryptUtils.pas',
+  EncryptDog in '..\..\Encrypt\EncryptDog.pas',
+  mEncryptPWD in '..\..\Encrypt\mEncryptPWD.pas',
+  mEncryptTypes in '..\..\Encrypt\mEncryptTypes.pas',
+  mR1Encrypt in '..\..\Encrypt\mR1Encrypt.pas',
+  mS4Utils in '..\..\Encrypt\mS4Utils.pas',
+  mSNSEncrypt in '..\..\Encrypt\mSNSEncrypt.pas',
+  Rockey1 in '..\..\Encrypt\Rockey1.pas',
+  mConnectEncrypt in '..\..\Encrypt\NetClient\mConnectEncrypt.pas',
+  FindUserFrm in '..\..\Forms\FindUserFrm.pas' {FindUserForm},
+  CslJson in '..\..\Units\CslJson.pas',
+  OrderCheckerFme in '..\..\Frames\OrderCheckerFme.pas' {OrderCheckerFrame: TFrame},
+  CheckerFme in '..\..\Frames\CheckerFme.pas' {CheckerFrame: TFrame},
+  WebNewTenderFrm in '..\..\Forms\WebNewTenderFrm.pas' {WebNewTenderForm},
+  ScFileArchiver in '..\..\Encrypt\ScFileArchiver.pas',
+  SearchDm in '..\..\DataModules\SearchDm.pas' {SearchData: TDataModule},
+  DealBillsDm in '..\..\DataModules\DealBillsDm.pas' {DealBillsData: TDataModule},
+  BGLDm in '..\..\DataModules\BGLDm.pas' {BGLData: TDataModule},
+  StaffDm in '..\..\DataModules\StaffDm.pas' {StaffData: TDataModule},
+  BillsCompileDm in '..\..\DataModules\BillsCompileDm.pas' {BillsCompileData: TDataModule},
+  BillsMeasureDm in '..\..\DataModules\BillsMeasureDm.pas' {BillsMeasureData: TDataModule},
+  ReportManager in '..\..\Units\ReportManager.pas',
+  BGLSelectFrm in '..\..\Forms\BGLSelectFrm.pas' {BGLSelectForm},
+  BillsCompileFme in '..\..\Frames\BillsCompileFme.pas' {BillsCompileFrame: TFrame},
+  BillsMeasureFme in '..\..\Frames\BillsMeasureFme.pas' {BillsMeasureFrame: TFrame},
+  BatchReplaceBillsFrm in '..\..\Forms\BatchReplaceBillsFrm.pas' {BatchReplaceBillsForm},
+  ZJJLFme in '..\..\Frames\ZJJLFme.pas' {ZJJLFrame: TFrame},
+  BGLFme in '..\..\Frames\BGLFme.pas' {BGLFrame: TFrame},
+  MergeTextFrm in '..\..\Forms\MergeTextFrm.pas' {MergeTextForm},
+  ReportsFrm in '..\..\Forms\ReportsFrm.pas' {ReportsForm},
+  ReportAdjustFrm in '..\..\Forms\ReportAdjustFrm.pas' {ReportAdjustForm},
+  SearchFme in '..\..\Frames\SearchFme.pas' {SearchFrame: TFrame},
+  AuthFrm in '..\..\Forms\AuthFrm.pas' {AuthorizeForm},
+  AboutFrm in '..\..\Forms\AboutFrm.pas' {AboutForm},
+  ImportExcelHintFrm in '..\..\Forms\ImportExcelHintFrm.pas' {ImportExcelHintForm},
+  PasswordInputFrm in '..\..\Forms\PasswordInputFrm.pas' {PasswordInputForm},
+  BatchInsertBillsFrm in '..\..\Forms\BatchInsertBillsFrm.pas' {BatchInsertBillsForm},
+  MainDataListDm in '..\..\DataModules\MainDataListDm.pas' {MainListData: TDataModule},
+  mProgressFrm in '..\..\Forms\mProgressFrm.pas' {mProgress},
+  rmGclBillsBGDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsBGDm.pas' {rmGclBillsBGData: TDataModule},
+  rmGclBillsCompareDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsCompareDm.pas' {rmGclBillsCompareData: TDataModule},
+  rmBGLExecutionDm in '..\..\DataModules\ReportMemoryDm\rmBGLExecutionDm.pas' {rmBGLExecutionData: TDataModule},
+  rmBillsGatherDm in '..\..\DataModules\ReportMemoryDm\rmBillsGatherDm.pas' {rmBillsGatherData: TDataModule},
+  rmFxBillsAddDm in '..\..\DataModules\ReportMemoryDm\rmFxBillsAddDm.pas' {rmFxBillsAddData: TDataModule},
+  rmFxBillsCompareDm in '..\..\DataModules\ReportMemoryDm\rmFxBillsCompareDm.pas' {rmFxBillsCompareData: TDataModule},
+  rmGclBillsAddDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsAddDm.pas' {rmGclBillsAddData: TDataModule},
+  rmGridHeaderDm in '..\..\DataModules\ReportMemoryDm\rmGridHeaderDm.pas' {rmGridHeaderData: TDataModule},
+  rmCacheData in '..\..\DataModules\ReportMemoryDm\rmCacheData.pas',
+  rmSelectProjectFrm in '..\..\Forms\rmSelectProjectFrm.pas' {ProjectSelectForm},
+  ConditionalDefines in '..\..\Units\ConditionalDefines.pas',
+  ProgressHintFrm in '..\..\Forms\ProgressHintFrm.pas' {ProgressHintForm},
+  rmGclBillsAuditCompareDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsAuditCompareDm.pas' {rmGclBillsAuditCompareData: TDataModule},
+  rmTestFrm in '..\..\DataModules\ReportMemoryDm\rmTestFrm.pas' {rmTestForm},
+  CheckAndClearFrm in '..\..\Forms\CheckAndClearFrm.pas' {CheckAndClearForm},
+  DealBillsFrm in '..\..\Forms\DealBillsFrm.pas' {DealBillsForm},
+  TenderBackupFrm in '..\..\Forms\TenderBackupFrm.pas' {TenderBackupForm},
+  TenderBackupDm in '..\..\DataModules\TenderBackupDm.pas' {TenderBackupData: TDataModule},
+  BillsBookmarkDm in '..\..\DataModules\BillsBookmarkDm.pas' {BillsBookmarkData: TDataModule},
+  BookmarkFme in '..\..\Frames\BookmarkFme.pas' {BookmarkFrame: TFrame},
+  rmDealInfosDm in '..\..\DataModules\ReportMemoryDm\rmDealInfosDm.pas' {rmDealInfosData: TDataModule},
+  rmXmjBGLDetailDm in '..\..\DataModules\ReportMemoryDm\rmXmjBGLDetailDm.pas' {rmXmjBGLDetailData: TDataModule},
+  WelcomeFrm in '..\..\Forms\WelcomeFrm.pas' {Form1},
+  rmOtherReport1Dm in '..\..\DataModules\ReportMemoryDm\rmOtherReport1Dm.pas' {rmOtherReport1Data: TDataModule},
+  CheckerMemoFrm in '..\..\Forms\CheckerMemoFrm.pas' {CheckerMemoForm},
+  CslHint in '..\..\Units\CslHint.pas',
+  IPFrm in '..\..\Forms\IPFrm.pas' {IPForm},
+  TenderBackupManager in '..\..\Units\TenderBackupManager.pas',
+  UpFileFrame in '..\..\Forms\UpFileFrame.pas',
+  UpFileManageFrame in '..\..\Forms\UpFileManageFrame.pas',
+  UpFileManageUnit in '..\..\Units\UpFileManageUnit.pas',
+  SheetSelectFrm in '..\..\Forms\SheetSelectFrm.pas' {SheetSelectForm},
+  Checker in '..\..\Units\Checker.pas',
+  ReportInteractInfo in '..\..\Units\ReportInteractInfo.pas',
+  AuditSelectFrm in '..\..\Forms\ReportInteractFrms\AuditSelectFrm.pas' {AuditSelctForm},
+  DealBillsFme in '..\..\Frames\DealBillsFme.pas' {DealBillsFrame: TFrame},
+  rmGclBillsPlaneDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsPlaneDm.pas' {rmGclBillsPlaneData: TDataModule},
+  StageCompareDm in '..\..\DataModules\StageCompareDm.pas' {StageCompareData: TDataModule},
+  mDataRecord in '..\..\Units\mDataRecord.pas',
+  BGLClipboard in '..\..\Units\BGLClipboard.pas',
+  rmMentalCustomized1Dm in '..\..\DataModules\ReportMemoryDm\rmMentalCustomized1Dm.pas' {rmMentalCustomized1Data: TDataModule},
+  rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
+  rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
+  CalcDecimal in '..\..\Units\CalcDecimal.pas',
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
+  mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm},
+  BaseClipboard in '..\..\Units\BaseClipboard.pas',
+  PriceMarginBillsDm in '..\..\DataModules\PriceMarginBillsDm.pas' {PriceMarginBillsData: TDataModule},
+  ProjectGLDm in '..\..\DataModules\ProjectGLDm.pas' {ProjectGLData: TDataModule},
+  GclBillsGatherModel in '..\..\Units\GclBillsGatherModel.pas',
+  DetailGLDm in '..\..\DataModules\DetailGLDm.pas' {DetailGLData: TDataModule},
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  PriceMarginBillsFme in '..\..\Frames\PriceMarginBillsFme.pas' {PriceMarginBillsFrame: TFrame},
+  PriceMarginFme in '..\..\Frames\PriceMarginFme.pas' {PriceMarginFrame: TFrame},
+  ProjectGLFme in '..\..\Frames\ProjectGLFme.pas' {ProjectGLFrame: TFrame},
+  SelectDetailGLsFrm in '..\..\Forms\SelectDetailGLsFrm.pas' {SelectDetailGLsForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm},
+  tpBaseGatherData in '..\..\TenderPartition\tpBaseGatherData.pas',
+  tpGatherGcl in '..\..\TenderPartition\tpGatherGcl.pas',
+  tpGatherTree in '..\..\TenderPartition\tpGatherTree.pas',
+  tpMainData in '..\..\TenderPartition\tpMainData.pas',
+  tpMainFrm in '..\..\TenderPartition\tpMainFrm.pas' {tpMainForm},
+  tpNoPegDm in '..\..\TenderPartition\tpNoPegDm.pas' {tpNoPegData: TDataModule},
+  tpPartTender in '..\..\TenderPartition\tpPartTender.pas',
+  tpPartTenderFme in '..\..\TenderPartition\tpPartTenderFme.pas' {tpPartTenderFrame: TFrame},
+  tpPartTenderSet in '..\..\TenderPartition\tpPartTenderSet.pas',
+  tpPartTenderSetFme in '..\..\TenderPartition\tpPartTenderSetFme.pas' {tpPartTenderSetFrame: TFrame},
+  tpPeg in '..\..\TenderPartition\tpPeg.pas',
+  tpPeg_GclDm in '..\..\TenderPartition\tpPeg_GclDm.pas' {tpPeg_GclData: TDataModule},
+  tpPeg_GclFme in '..\..\TenderPartition\tpPeg_GclFme.pas' {tpPeg_GclFrame: TFrame},
+  tpPegBlock in '..\..\TenderPartition\tpPegBlock.pas',
+  tpPegGclGatherDm in '..\..\TenderPartition\tpPegGclGatherDm.pas' {tpPegGclGatherData: TDataModule},
+  tpPegGclGatherFme in '..\..\TenderPartition\tpPegGclGatherFme.pas' {tpPegGclGatherFrame: TFrame},
+  tpPegPartSettingFrm in '..\..\TenderPartition\tpPegPartSettingFrm.pas' {tpPegPartSettingForm},
+  tpPricePartSettingFrm in '..\..\TenderPartition\tpPricePartSettingFrm.pas' {tpPricePartSettingForm},
+  tpSelectTenderDm in '..\..\TenderPartition\tpSelectTenderDm.pas' {tpSelectTenderData: TDataModule},
+  tpSelectTenderNode in '..\..\TenderPartition\tpSelectTenderNode.pas',
+  tpSelectTendersFrm in '..\..\TenderPartition\tpSelectTendersFrm.pas' {SelectTendersForm},
+  tpTrialPegInputFrm in '..\..\TenderPartition\tpTrialPegInputFrm.pas' {TrialPegInputForm},
+  mPegFilter in '..\..\Units\mPegFilter.pas',
+  ReportPrepare in '..\..\Report\ReportPrepare.pas',
+  rdpBillsGatherDm in '..\..\Report\DataPrepare\rdpBillsGatherDm.pas' {rdpBillsGatherData: TDataModule},
+  rdpTables in '..\..\Report\DataPrepare\rdpTables.pas',
+  ColVisibleManager in '..\..\Units\ColVisibleManager.pas',
+  ReportConnection in '..\..\Report\ReportConnection.pas',
+  rgpGatherControl in '..\..\Report\ProjGather\rgpGatherControl.pas',
+  rpgBillsCalcDm in '..\..\Report\ProjGather\rpgBillsCalcDm.pas' {rpgBillsCalcData: TDataModule},
+  rpgBillsDm in '..\..\Report\ProjGather\rpgBillsDm.pas' {rpgBillsData: TDataModule},
+  rpgGatherControl in '..\..\Report\ProjGather\rpgGatherControl.pas',
+  rpgGatherData in '..\..\Report\ProjGather\rpgGatherData.pas',
+  rpgGatherProjDm in '..\..\Report\ProjGather\rpgGatherProjDm.pas' {rpgGatherProjData: TDataModule},
+  rProjGatherTables in '..\..\Report\ProjGather\rProjGatherTables.pas',
+  ProjGatherTree in '..\..\ProjGather\ProjGatherTree.pas',
+  ProjGather in '..\..\ProjGather\ProjGather.pas',
+  CalcData in '..\..\Units\CalcData.pas',
+  GatherProjInfo in '..\..\ProjGather\GatherProjInfo.pas',
+  ProjGatherCalcData in '..\..\ProjGather\ProjGatherCalcData.pas',
+  ProjGatherSelectFrm in '..\..\ProjGather\ProjGatherSelectFrm.pas' {ProjGatherSelectForm},
+  DealBillsExcelImport in '..\..\Units\DealBillsExcelImport.pas',
+  ExcelImport_Bills in '..\..\Units\ExcelImport_Bills.pas',
+  ExcelImport_GclBills in '..\..\Units\ExcelImport_GclBills.pas',
+  DbTreeImport in '..\..\Units\DbTreeImport.pas',
+  DbTreeDm in '..\..\DataModules\DbTreeDm.pas',
+  DebugUsers in '..\..\Units\DebugUsers.pas',
+  OtherMeasurePhaseDm in '..\..\DataModules\OtherMeasurePhaseDm.pas' {OtherMeasurePhaseData: TDataModule},
+  OtherMeasureOnceDm in '..\..\DataModules\OtherMeasureOnceDm.pas' {OtherMeasureOnceData: TDataModule},
+  OMPhaseRecord in '..\..\Units\DataRecord\OMPhaseRecord.pas',
+  OtherMeasureFme in '..\..\Frames\OtherMeasureFme.pas' {OtherMeasureFrame: TFrame},
+  ProjGatherSelectFme in '..\..\ProjGather\ProjGatherSelectFme.pas' {ProjGatherSelectFrame: TFrame},
+  rpgZoneGatherControl in '..\..\Report\ProjGather\Zone\rpgZoneGatherControl.pas',
+  rpgZoneProjGatherSelectFrm in '..\..\Report\ProjGather\Zone\rpgZoneProjGatherSelectFrm.pas' {rpgZoneProjGatherSelectForm},
+  UpFileSelectOnLineFrm in '..\..\Forms\UpFileSelectOnLineFrm.pas' {UpFileSelectOnLineForm},
+  LogUtils in '..\..\Units\LogUtils.pas',
+  ReportPdfHelper in '..\..\Units\ReportPdfHelper.pas',
+  SelectOnlineSignPhaseFrm in '..\..\Forms\SelectOnlineSignPhaseFrm.pas' {SelectOnlineSignPhaseForm},
+  SignOnlineReportsFrm in '..\..\Forms\SignOnlineReportsFrm.pas' {SignOnlineReportsForm},
+  SignReports in '..\..\Units\SignReports.pas',
+  VirtualTrees in '..\..\..\SmartCost\Components\virtualtree\VirtualTrees.pas',
+  TemplateManagerHelper in '..\..\Units\TemplateManagerHelper.pas',
+  RenameSignReportFrm in '..\..\Forms\RenameSignReportFrm.pas' {RenameSignReportForm},
+  rmWeiWuZjjlGatherDm in '..\..\DataModules\ReportMemoryDm\rmWeiWuZjjlGatherDm.pas' {rmWeiWuZjjlGatherData: TDataModule},
+  SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
+
+{$R *.res}
+
+var
+  Mutex: THandle;
+  IPForm: TIPForm;
+
+begin
+  Mutex := CreateMutex(nil, True, G_AppHandleName);
+
+  if GetLastError = ERROR_ALREADY_EXISTS then
+    Application.MessageBox('程序正在运行, 请勿重复打开该软件!', '系统提示', MB_OK + MB_ICONINFORMATION)
+  else
+  begin
+    Application.CreateHandle;
+    Application.Initialize;
+    Application.Title := '纵横公路工程结算决算计量一体化软件广东云版';
+
+    {$IFDEF _mCloud}
+      IPForm := TIPForm.Create(nil);
+      try
+        if not IPForm.HasIP then
+        begin
+          IPForm.ShowModal;
+          if IPForm.ModalResult <> mrOK then
+          begin
+            Application.Terminate;
+            Exit;
+          end;
+        end;
+      finally
+        IPForm.Free;
+      end;
+
+      if not LoginForm then
+      begin
+        Application.Terminate;
+        Exit;
+      end;
+    {$ENDIF}
+
+
+    if CheckDogExists then
+    begin
+      Application.CreateForm(TMainForm, MainForm);
+  Application.CreateForm(TSetGuestForm, SetGuestForm);
+  end;
+    Application.Run;
+  end;
+
+  ReleaseMutex(Mutex);
+end.

+ 4 - 1
Dprs/Pro/Measure.dpr

@@ -218,7 +218,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 4 - 1
Dprs/Pro/Measure_Cloud.dpr

@@ -224,7 +224,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 4 - 1
Dprs/Pro/Measure_GuangDong.dpr

@@ -218,7 +218,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm}
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 4 - 1
Dprs/Pro/Measure_GuangDong_Cloud.dpr

@@ -223,7 +223,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 2 - 2
Dprs/Pro/Measure_GuangDong_TZ.dof

@@ -115,7 +115,7 @@ AutoIncBuild=0
 MajorVer=3
 MinorVer=1
 Release=7
-Build=140
+Build=150
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +126,7 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横0号台账广东专业版
-FileVersion=3.1.7.140
+FileVersion=3.1.7.150
 InternalName=
 LegalCopyright=版权所有(C)珠海纵横创新软件有限公司2003-2016
 LegalTrademarks=Measure

+ 4 - 1
Dprs/Pro/Measure_GuangDong_TZ.dpr

@@ -218,7 +218,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm}
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

二进制
Dprs/Pro/Measure_GuangDong_TZ.res


+ 4 - 1
Dprs/Pro/Measure_TZ.dpr

@@ -218,7 +218,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 4 - 1
Dprs/Trail/Measure.dpr

@@ -218,7 +218,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 4 - 1
Dprs/Trail/Measure_GuangDong.dpr

@@ -218,7 +218,10 @@ uses
   SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
   ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas',
   ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
-  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm};
+  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
+  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
+  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
+  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule};
 
 {$R *.res}
 

+ 20 - 7
Forms/SignOnlineReportsFrm.pas

@@ -8,7 +8,7 @@ uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, sdIDTree, sdDB, ComCtrls, ExtCtrls, VirtualTrees, PrintCom,
   PrintComXML, MScrollBox, StdCtrls, Buttons, PNGButton, ieview,
-  imageenview;
+  imageenview, jpeg;
 
 const
   crNext = -25;
@@ -1000,15 +1000,22 @@ procedure TSignOnlineReportsForm.ExportReports(const AFileName: string);
 
   procedure ExportReportPage(APage: Integer; const APageFileName: string);
   var
-    img: TImage;
+    bmp: TBitmap;
+    img: TJPEGImage;
   begin
-    img := TImage.Create(nil);
+    bmp := TBitmap.Create;
+    img := TJPEGImage.Create;
     try
-      img.Height := PreviewComXML.ReportSize.Y;
-      img.Width := PreviewComXML.ReportSize.X;
-      PreviewComXML.PrintPreviewCanvas(APage, 0, img.Canvas, False);
-      img.Picture.SaveToFile(APageFileName);
+      bmp.Height := PreviewComXML.ReportSize.Y;
+      bmp.Width := PreviewComXML.ReportSize.X;
+      PreviewComXML.PrintPreviewCanvas(APage, 0, bmp.Canvas, False);
+
+      img.Assign(bmp);
+      img.CompressionQuality := 100;
+      img.Compress;
+      img.SaveToFile(APageFileName);
     finally
+      bmp.Free;
       img.Free;
     end;
   end;
@@ -1054,6 +1061,12 @@ var
   vInFields, vInValues: array [0..5] of string;
   vUpFileFields, vUpFileNames: array [0..1] of string;
 begin
+  if PreviewComXML.TotalPages > 200 then
+  begin
+    TipMessage('该报表不支持在线签署功能。');
+    Exit;
+  end;
+
   sReportName := ReportTemplateManager.Current.TemplateName;
   if SafeReportName(sReportName) then
   begin

+ 9 - 3
Frames/BillsMeasureFme.pas

@@ -207,7 +207,7 @@ var
   stnNode: TMeasureBillsIDTreeNode;
   iCreatePhaseID: Integer;
   StageRec: TStageRecord;
-  fDiffer: Double;
+  fDiffer, fCompare: Double;
 begin
   AColor := clWindow;
   if ACoord.Y > stdBillsMeasure.IDTree.Count + 1 then Exit;
@@ -242,10 +242,16 @@ begin
     with stnNode.Rec do
     begin
       if CalcType.AsInteger = 0 then
-        fDiffer := QuantityRoundTo(AddDealQuantity.AsFloat - Quantity.AsFloat)
+      begin
+        fDiffer := QuantityRoundTo(AddDealQuantity.AsFloat - Quantity.AsFloat);
+        fCompare := TProjectData(FBillsMeasureData.ProjectData).ProjProperties.DecimalManager.Common.Quantity.CompareValue;
+      end
       else
+      begin
         fDiffer := TotalPriceRoundTo(AddDealTotalPrice.AsFloat - TotalPrice.AsFloat);
-      if fDiffer > 0 then
+        fCompare := TProjectData(FBillsMeasureData.ProjectData).ProjProperties.DecimalManager.Common.TotalPrice.CompareValue;
+      end;
+      if fDiffer > fCompare then
         AColor := $00646AFE;
     end;
   end;

+ 174 - 12
ProjGather/ProjGather.pas

@@ -4,7 +4,7 @@ interface
 
 uses
   Classes, ProjGatherTree, GatherProjInfo, ProjectData, BillsTree, CalcData,
-  PhaseData;
+  PhaseData, ProjGatherDealPay, sdDB, ProjGatherProperties;
 
 type
   TProjGather = class;
@@ -17,6 +17,12 @@ type
     FGclCompare: Integer;
 
     FTree: TProjGatherTree;
+    FDealPay: TProjGatherDealPayList;
+    FProperties: TProjGatherProperties;
+
+    FDealCurField: string;
+    FDealPreField: string;
+    FDealEndField: string;
 
     FProjs: TList;
     FCommonProjs: TList;
@@ -29,15 +35,22 @@ type
     function FindBillsNode(ANode: TBillsIDTreeNode; AParent: TProjGatherTreeNode): TProjGatherTreeNode;
     function CreateBillsNode(ANode: TBillsIDTreeNode; AParent: TProjGatherTreeNode): TProjGatherTreeNode;
     procedure AddProjCalcData(AProjCalc: TProjCalc; ANode: TMeasureBillsIDTreeNode);
+    procedure AddProjDealPayCalcData(ADealPayCalc: TDealPayCalcData; ARec: TsdDataRecord);
 
     function GatherBillsNode(ANode: TMeasureBillsIDTreeNode; AParent: TProjGatherTreeNode;
       AProjIndex: Integer): TProjGatherTreeNode;
     procedure GatherBills(ANode: TMeasureBillsIDTreeNode; AParent: TProjGatherTreeNode; AProjIndex: Integer);
 
+    procedure GatherDealPays(AProjIndex: Integer);
+    procedure GatherProjProperties;
+
     function GatherSpecialBillsNode(ANode: TMeasureBillsIDTreeNode;
       AParent: TProjGatherTreeNode; AProjType: Integer): TProjGatherTreeNode;
     procedure GatherSpecialBills(ANode: TMeasureBillsIDTreeNode;
       AParent: TProjGatherTreeNode; AProjType: Integer);
+
+    procedure GatherSpecialDealPays(AProjType: Integer);
+
     procedure GatherSpecialProj(AProj: TGatherProjInfo);
 
     procedure FilterProjs;
@@ -45,9 +58,13 @@ type
     procedure OpenProjectData(AProj: TGatherProjInfo); virtual;
     procedure FreeProjectData; virtual;
 
+    procedure BeforeGather;
+    procedure AfterGather;
+
     procedure GatherProj(AProj: TGatherProjInfo; AProjIndex: Integer);
 
     procedure AddProjMeasureCalcData(AProjCalc: TProjCalc; ANode: TMeasureBillsIDTreeNode); virtual;
+    procedure AddProjDealPayPhaseCalcData(ADealPayCalc: TDealPayCalcData; ARec: TsdDataRecord); virtual;
   public
     constructor Create(AWriter: TWriteGatherData; AXmjCompare, AGclCompare: Integer);
     destructor Destroy; override;
@@ -55,7 +72,11 @@ type
     procedure Gather(AProjs: TList; ASpecialProjTypes: TStrings);
 
     property ProjectData: TProjectData read FProjectData;
+
     property Tree: TProjGatherTree read FTree;
+    property DealPay: TProjGatherDealPayList read FDealPay;
+    property Properties: TProjGatherProperties read FProperties;
+
     property Projs: TList read FProjs;
     property CommonProj: TList read FCommonProjs;
     property SpecialProj: TList read FSpecialProjs;
@@ -74,6 +95,7 @@ type
     procedure FreeProjectData; override;
 
     procedure AddProjMeasureCalcData(AProjCalc: TProjCalc; ANode: TMeasureBillsIDTreeNode); override;
+    procedure AddProjDealPayPhaseCalcData(ADealPayCalc: TDealPayCalcData; ARec: TsdDataRecord); override;
   public
     procedure Gather(AProjs: TList; ABeginPhaseIndex, AEndPhaseIndex: Integer); overload;
   end;
@@ -81,8 +103,8 @@ type
 implementation
 
 uses
-  Globals, UtilMethods, sdIDTree, sdDB, mDataRecord, BillsMeasureDm, SysUtils,
-  Math;
+  Globals, UtilMethods, sdIDTree, mDataRecord, BillsMeasureDm, SysUtils,
+  Math, DealPaymentDm;
 
 { TProjGather }
 
@@ -225,11 +247,8 @@ begin
   FProjs := AProjs;
   FilterProjs;
   FSpecialProjTypes := ASpecialProjTypes;
-  if Assigned(ASpecialProjTypes) then
-    FTree := TProjGatherTree.Create(FCommonProjs.Count, ASpecialProjTypes.Count)
-  else
-    FTree := TProjGatherTree.Create(FCommonProjs.Count, 0);
-  FTree.NewNodeID := 101;
+
+  BeforeGather;
   try
     for i := 0 to FCommonProjs.Count - 1 do
       GatherProj(TGatherProjInfo(FCommonProjs.Items[i]), i);
@@ -239,7 +258,7 @@ begin
     if Assigned(FWriter) then
       FWriter(Self);
   finally
-    FTree.Free;
+    AfterGather;
   end;
 end;
 
@@ -271,6 +290,8 @@ begin
   try
     with FProjectData.BillsMeasureData do
       GatherBills(TMeasureBillsIDTreeNode(BillsMeasureTree.FirstNode), nil, AProjIndex);
+    GatherDealPays(AProjIndex);
+    GatherProjProperties;
   finally
     FreeProjectData;
   end;
@@ -284,6 +305,7 @@ begin
     try
       with FProjectData.BillsMeasureData do
         GatherSpecialBills(TMeasureBillsIDTreeNode(BillsMeasureTree.FirstNode), nil, AProj.ProjType);
+      GatherSpecialDealPays(AProj.ProjType);
     finally
       FreeProjectData;
     end;
@@ -353,8 +375,149 @@ begin
   end;
 end;
 
+procedure TProjGather.GatherDealPays(AProjIndex: Integer);
+var
+  idxView: TsdIndex;
+  iRec: Integer;
+  vRec: TsdDataRecord;
+  vDealPay: TProjGatherDealPayNode;
+begin
+  with FProjectData.DealPaymentData do
+  begin
+    idxView := sddDealPayment.FindIndex('idxView');
+
+    if FProjectData.PhaseData.Active then
+    begin
+      FDealCurField := 'TotalPrice' + IntToStr(FProjectData.PhaseData.StageIndex);
+      FDealPreField := 'PreTotalPrice' + IntToStr(FProjectData.PhaseData.StageIndex);
+      FDealEndField := 'EndTotalPrice' + IntToStr(FProjectData.PhaseData.StageIndex);
+    end;
+
+    for iRec := 0 to idxView.RecordCount - 1 do
+    begin
+      vRec := idxView.Records[iRec];
+
+      vDealPay := FDealPay.GetDealPayNode(vRec);
+      AddProjDealPayCalcData(vDealPay.GatherCalc, vRec);
+      AddProjDealPayCalcData(vDealPay.Proj[AProjIndex], vRec);
+    end;
+  end;
+end;
+
+procedure TProjGather.GatherSpecialDealPays(AProjType: Integer);
+var
+  idxView: TsdIndex;
+  iRec: Integer;
+  vRec: TsdDataRecord;
+  vDealPay: TProjGatherDealPayNode;
+begin
+  with FProjectData.DealPaymentData do
+  begin
+    idxView := sddDealPayment.FindIndex('idxView');
+    for iRec := 0 to idxView.RecordCount - 1 do
+    begin
+      vRec := idxView.Records[iRec];
+
+      vDealPay := FDealPay.GetDealPayNode(vRec);
+      AddProjDealPayCalcData(vDealPay.SpecialProj[AProjType - 1], vRec);
+    end;
+  end;
+end;
+
+procedure TProjGather.AddProjDealPayCalcData(ADealPayCalc: TDealPayCalcData;
+  ARec: TsdDataRecord);
+begin
+  ADealPayCalc.AddTotalPrice := ADealPayCalc.AddTotalPrice + ARec.ValueByName('TotalPrice').AsFloat;
+  AddProjDealPayPhaseCalcData(ADealPayCalc, ARec);
+end;
+
+procedure TProjGather.BeforeGather;
+var
+  iSpecial: Integer;
+begin
+  if Assigned(FSpecialProjTypes) then
+    iSpecial := FSpecialProjTypes.Count
+  else
+    iSpecial := 0;
+  FTree := TProjGatherTree.Create(FCommonProjs.Count, iSpecial);
+  FTree.NewNodeID := 101;
+  FDealPay := TProjGatherDealPayList.Create(FCommonProjs.Count, iSpecial);
+  FProperties := TProjGatherProperties.Create;
+end;
+
+procedure TProjGather.AfterGather;
+begin
+  FProperties.Free;
+  FDealPay.Free;
+  FTree.Free;
+end;
+
+procedure TProjGather.GatherProjProperties;
+
+  procedure GatherFloatProjProperty(const AName: string);
+  var
+    fValue: Double;
+    vProperty: TProjGatherProperty;
+  begin
+    vProperty := FProperties.GetProjGatherProperty(AName);
+    fValue := FProjectData.ProjProperties.GetFloatPropertyDef(AName, 0);
+    fValue := fValue + StrToFloatDef(vProperty.Value, 0);
+    vProperty.Value := FloatToStr(fValue);
+  end;
+
+begin
+  GatherFloatProjProperty('ContractPrice');
+  GatherFloatProjProperty('MaterialSubsist');
+  GatherFloatProjProperty('StartedSubsist');
+end;
+
+procedure TProjGather.AddProjDealPayPhaseCalcData(
+  ADealPayCalc: TDealPayCalcData; ARec: TsdDataRecord);
+var
+  vPhaseRec: TsdDataRecord;
+begin
+  if FProjectData.PhaseData.Active then
+    vPhaseRec := FProjectData.PhaseData.PhasePayData.PayRecord(ARec.ValueByName('ID').AsInteger)
+  else
+    vPhaseRec := nil;
+  if Assigned(vPhaseRec) then
+  begin
+    ADealPayCalc.CurTotalPrice := ADealPayCalc.CurTotalPrice + vPhaseRec.ValueByName(FDealCurField).AsFloat;
+    ADealPayCalc.PreTotalPrice := ADealPayCalc.PreTotalPrice + vPhaseRec.ValueByName(FDealPreField).AsFloat;
+    ADealPayCalc.EndTotalPrice := ADealPayCalc.EndTotalPrice + vPhaseRec.ValueByName(FDealEndField).AsFloat;
+  end;
+end;
+
 { TZoneProjGather }
 
+procedure TZoneProjGather.AddProjDealPayPhaseCalcData(
+  ADealPayCalc: TDealPayCalcData; ARec: TsdDataRecord);
+var
+  vPhaseRec: TsdDataRecord;
+begin
+  if Assigned(FEndPhaseData) then
+    vPhaseRec := FEndPhaseData.PhasePayData.PayRecord(ARec.ValueByName('ID').AsInteger)
+  else
+    vPhaseRec := nil;
+  if Assigned(vPhaseRec) then
+  begin
+    ADealPayCalc.CurTotalPrice := ADealPayCalc.CurTotalPrice + vPhaseRec.ValueByName(FDealCurField).AsFloat;
+    ADealPayCalc.PreTotalPrice := ADealPayCalc.PreTotalPrice + vPhaseRec.ValueByName(FDealPreField).AsFloat;
+    ADealPayCalc.EndTotalPrice := ADealPayCalc.EndTotalPrice + vPhaseRec.ValueByName(FDealEndField).AsFloat;
+
+    ADealPayCalc.ZoneTotalPrice := ADealPayCalc.ZoneTotalPrice + vPhaseRec.ValueByName(FDealEndField).AsFloat;
+  end;
+
+  if Assigned(FBeginPhaseData) then
+    vPhaseRec := FBeginPhaseData.PhasePayData.PayRecord(ARec.ValueByName('ID').AsInteger)
+  else
+    vPhaseRec := nil;
+  if Assigned(vPhaseRec) then
+  begin
+    ADealPayCalc.ZoneTotalPrice := ADealPayCalc.ZoneTotalPrice - vPhaseRec.ValueByName(FDealPreField).AsFloat;
+  end;
+end;
+
 procedure TZoneProjGather.AddProjMeasureCalcData(AProjCalc: TProjCalc;
   ANode: TMeasureBillsIDTreeNode);
 var
@@ -429,8 +592,7 @@ begin
   FBeginPhaseIndex := ABeginPhaseIndex;
   FEndPhaseIndex := AEndPhaseIndex;
 
-  FTree := TProjGatherTree.Create(FProjs.Count, 0);
-  FTree.NewNodeID := 101;
+  BeforeGather;
   try
     for i := 0 to FProjs.Count - 1 do
       GatherProj(TGatherProjInfo(FProjs.Items[i]), i);
@@ -438,7 +600,7 @@ begin
     if Assigned(FWriter) then
       FWriter(Self);
   finally
-    FTree.Free;
+    AfterGather;
   end;
 end;
 

+ 253 - 0
ProjGather/ProjGatherDealPay.pas

@@ -0,0 +1,253 @@
+unit ProjGatherDealPay;
+
+interface
+
+uses
+  Classes, sdDB;
+
+type
+  TDealPayCalcData = class
+  private
+    FCurTotalPrice: Double;
+    FPreTotalPrice: Double;
+    FEndTotalPrice: Double;
+    FAddTotalPrice: Double;
+
+    FZoneTotalPrice: Double;
+  public
+    property CurTotalPrice: Double read FCurTotalPrice write FCurTotalPrice;
+    property PreTotalPrice: Double read FPreTotalPrice write FPreTotalPrice;
+    property EndTotalPrice: Double read FEndTotalPrice write FEndTotalPrice;
+    property AddTotalPrice: Double read FAddTotalPrice write FAddTotalPrice;
+
+    property ZoneTotalPrice: Double read FZoneTotalPrice write FZoneTotalPrice;
+  end;
+
+  TProjGatherDealPayNode = class
+  private
+    FID: Integer;
+    FName: string;
+    FCalcType: Integer;
+    FIsMinus: Boolean;
+
+    FSerialNo: Integer;
+    FLinkSerialNo: Integer;
+
+    FGatherCalc: TDealPayCalcData;
+    FProjs: TList;
+    FSpecialProjs: TList;
+    function GetProj(AIndex: Integer): TDealPayCalcData;
+    function GetProjCount: Integer;
+    function GetSpecialProjCount: Integer;
+    function GetSpecialProj(AIndex: Integer): TDealPayCalcData;
+  public
+    constructor Create(AID: Integer; AProjCount, ASpeicalProjCount: Integer);
+    destructor Destroy; override;
+
+    property ID: Integer read FID;
+    property Name: string read FName;
+    property CalcType: Integer read FCalcType;
+    property IsMinus: Boolean read FIsMinus;
+
+    property SerialNo: Integer read FSerialNo;
+    property LinkSerialNo: Integer read FLinkSerialNo;
+
+    property GatherCalc: TDealPayCalcData read FGatherCalc;
+
+    property ProjCount: Integer read GetProjCount;
+    property Proj[AIndex: Integer]: TDealPayCalcData read GetProj;
+
+    property SpecialProjCount: Integer read GetSpecialProjCount;
+    property SpecialProj[AIndex: Integer]: TDealPayCalcData read GetSpecialProj;
+  end;
+
+  TProjGatherDealPayList = class
+  private
+    FProjCount: Integer;
+    FSpecialProjCount: Integer;
+
+    FNewID: Integer;
+
+    FList: TList;
+
+    function FindDealPayNode(ARec: TsdDataRecord): TProjGatherDealPayNode;
+    function CreateDealPayNode(ARec: TsdDataRecord): TProjGatherDealPayNode;
+
+    function GetCount: Integer;
+    function GetDealPay(AIndex: Integer): TProjGatherDealPayNode;
+  public
+    constructor Create(AProjCount, ASpeicalProjCount: Integer);
+    destructor Destroy; override;
+
+    function GetDealPayNode(ARec: TsdDataRecord): TProjGatherDealPayNode;
+
+    procedure UpdateLinkSerialNo;
+
+    property DealPay[AIndex: Integer]: TProjGatherDealPayNode read GetDealPay;
+    property Count: Integer read GetCount;
+  end;
+
+implementation
+
+uses
+  ZhAPI, SysUtils;
+
+{ TProjGatherDealPayNode }
+
+constructor TProjGatherDealPayNode.Create(AID: Integer; AProjCount,
+  ASpeicalProjCount: Integer);
+var
+  i: Integer;
+  DealPayCalc: TDealPayCalcData;
+begin
+  FID := AID;
+
+  FGatherCalc :=  TDealPayCalcData.Create;
+  FProjs := TList.Create;
+  for i := 0 to AProjCount - 1 do
+  begin
+    DealPayCalc := TDealPayCalcData.Create;
+    FProjs.Add(DealPayCalc);
+  end;
+  FSpecialProjs := TList.Create;
+  for i := 0 to ASpeicalProjCount - 1 do
+  begin
+    DealPayCalc := TDealPayCalcData.Create;
+    FSpecialProjs.Add(DealPayCalc);
+  end;
+end;
+
+destructor TProjGatherDealPayNode.Destroy;
+begin
+  FGatherCalc.Free;
+  ClearObjects(FSpecialProjs);
+  FSpecialProjs.Free;
+  ClearObjects(FProjs);
+  FProjs.Free;
+  inherited;
+end;
+
+function TProjGatherDealPayNode.GetProj(AIndex: Integer): TDealPayCalcData;
+begin
+  Result := TDealPayCalcData(FProjs.Items[AIndex]);
+end;
+
+function TProjGatherDealPayNode.GetProjCount: Integer;
+begin
+  Result := FProjs.Count;
+end;
+
+function TProjGatherDealPayNode.GetSpecialProj(
+  AIndex: Integer): TDealPayCalcData;
+begin
+  Result := TDealPayCalcData(FProjs.Items[AIndex]);
+end;
+
+function TProjGatherDealPayNode.GetSpecialProjCount: Integer;
+begin
+  Result := FSpecialProjs.Count;
+end;
+
+{ TProjGatherDealPayList }
+
+constructor TProjGatherDealPayList.Create(AProjCount,
+  ASpeicalProjCount: Integer);
+begin
+  FProjCount := AProjCount;
+  FSpecialProjCount := ASpeicalProjCount;
+  FList := TList.Create;
+  FNewID := 1;
+end;
+
+function TProjGatherDealPayList.CreateDealPayNode(ARec: TsdDataRecord): TProjGatherDealPayNode;
+begin
+  Result := TProjGatherDealPayNode.Create(FNewID, FProjCount, FSpecialProjCount);
+  Inc(FNewID);
+  Result.FName := ARec.ValueByName('Name').AsString;
+  Result.FCalcType := ARec.ValueByName('CalcType').AsInteger;
+  Result.FIsMinus := ARec.ValueByName('IsMinus').AsBoolean;
+  Result.FSerialNo := Result.ID;
+  FList.Add(Result); 
+end;
+
+destructor TProjGatherDealPayList.Destroy;
+begin
+  ClearObjects(FList);
+  FList.Free;
+  inherited;
+end;
+
+function TProjGatherDealPayList.FindDealPayNode(ARec: TsdDataRecord): TProjGatherDealPayNode;
+var
+  iDeal: Integer;
+  vDeal: TProjGatherDealPayNode;
+begin
+  Result := nil;
+  for iDeal := 0 to FList.Count - 1 do
+  begin
+    vDeal := DealPay[iDeal];
+    if ARec.ValueByName('CalcType').AsInteger in [0, 3] then
+    begin
+      if SameText(vDeal.Name, ARec.ValueByName('Name').AsString) and
+         (vDeal.IsMinus = ARec.ValueByName('IsMinus').AsBoolean) and
+         (vDeal.CalcType = ARec.ValueByName('CalcType').AsInteger) then
+      begin
+        Result := vDeal;
+        Break;
+      end;
+    end
+    else
+    begin
+      if vDeal.CalcType = ARec.ValueByName('CalcType').AsInteger then
+      begin
+        Result := vDeal;
+        Break;
+      end;
+    end;
+  end;
+end;
+
+function TProjGatherDealPayList.GetCount: Integer;
+begin
+  Result := FList.Count;
+end;
+
+function TProjGatherDealPayList.GetDealPay(AIndex: Integer): TProjGatherDealPayNode;
+begin
+  Result := TProjGatherDealPayNode(FList.Items[AIndex]);
+end;
+
+function TProjGatherDealPayList.GetDealPayNode(ARec: TsdDataRecord): TProjGatherDealPayNode;
+begin
+  Result := FindDealPayNode(ARec);
+  if not Assigned(Result) then
+    Result := CreateDealPayNode(ARec);
+end;
+
+procedure TProjGatherDealPayList.UpdateLinkSerialNo;
+var
+  iPay, iCut, iIndex: Integer;
+  vDealPay: TProjGatherDealPayNode;
+begin
+  iPay := 1;
+  iCut := 1;
+  for iIndex := 0 to Count - 1 do
+  begin
+    vDealPay := DealPay[iIndex];
+    if vDealPay.CalcType in [0, 3] then
+    begin
+      if vDealPay.IsMinus then
+      begin
+        vDealPay.FLinkSerialNo := iCut;
+        Inc(iCut);
+      end
+      else
+      begin
+        vDealPay.FLinkSerialNo := iPay;
+        Inc(iPay);
+      end;
+    end;
+  end;
+end;
+
+end.

+ 114 - 0
ProjGather/ProjGatherProperties.pas

@@ -0,0 +1,114 @@
+unit ProjGatherProperties;
+
+interface
+
+uses
+  Classes, ZhAPI;
+
+type
+  TProjGatherProperty = class
+  private
+    FName: string;
+    FValue: string;
+  public
+    constructor Create(const AName: string);
+    destructor Destroy; override;
+
+    property Name: string read FName write FName;
+    property Value: string read FValue write FValue;
+  end;
+
+  TProjGatherProperties = class
+  private
+    FList: TList;
+
+    function FindProjGatherProperty(const AName: string): TProjGatherProperty;
+    function AddProjGatherProperty(const AName: string): TProjGatherProperty;
+
+    function GetCount: Integer;
+    function GetPgPropperty(AIndex: Integer): TProjGatherProperty;
+  public
+    constructor Create;
+    destructor Destroy; override;
+
+    function GetProjGatherProperty(const AName: string): TProjGatherProperty;
+
+    property Count: Integer read GetCount;
+    property PgProperty[AIndex: Integer]: TProjGatherProperty read GetPgPropperty;
+  end;
+
+implementation
+
+uses SysUtils;
+
+{ TProjGatherProperty }
+
+constructor TProjGatherProperty.Create(const AName: string);
+begin
+  FName := AName;
+end;
+
+destructor TProjGatherProperty.Destroy;
+begin
+  inherited;
+end;
+
+{ TProjGatherProperties }
+
+function TProjGatherProperties.AddProjGatherProperty(
+  const AName: string): TProjGatherProperty;
+begin
+  Result := TProjGatherProperty.Create(AName);
+  FList.Add(Result);
+end;
+
+constructor TProjGatherProperties.Create;
+begin
+  FList := TList.Create;
+end;
+
+destructor TProjGatherProperties.Destroy;
+begin
+  ClearObjects(FList);
+  FList.Free;
+  inherited;
+end;
+
+function TProjGatherProperties.FindProjGatherProperty(
+  const AName: string): TProjGatherProperty;
+var
+  i: Integer;
+  vProperty: TProjGatherProperty;
+begin
+  Result := nil;
+  for i := 0 to Count - 1 do
+  begin
+    vProperty := PgProperty[i];
+    if vProperty.Name = AName then
+    begin
+      Result := vProperty;
+      Break;
+    end;
+  end;
+end;
+
+function TProjGatherProperties.GetCount: Integer;
+begin
+  Result := FList.Count;
+end;
+
+function TProjGatherProperties.GetPgPropperty(
+  AIndex: Integer): TProjGatherProperty;
+begin
+  Result := TProjGatherProperty(FList.Items[AIndex]);
+end;
+
+function TProjGatherProperties.GetProjGatherProperty(
+  const AName: string): TProjGatherProperty;
+begin
+  Result := FindProjGatherProperty(AName);
+  if not Assigned(Result) then
+    Result := AddProjGatherProperty(AName);
+end;
+
+end.

+ 58 - 0
Report/ProjGather/rProjGatherTables.pas

@@ -298,6 +298,64 @@ const
     (FieldName: 'BGLType'; FieldType: ftString; Size: 10; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
   );
 
+  SDealPay_Gather = 'r_DealPay_Gather'; // 合计, 默认ProjID为 -2
+  SDealPay_Proj = 'r_DealPay_Proj'; // 存在N个项目则,有r_DealPay_Proj1 ... r_DealPay_ProjN,分别存储个项目数据
+  SDealPay_TransProj = 'r_DealPay_TransProj'; // 合并所有的r_DealPay_Proj
+
+  // 此部分数据不汇总至r_DealPay_Gather
+  SDealPay_SProj = 'r_DealPay_SProj';
+
+  tdDealPay_Calc: array [0..12] of TScFieldDef =(
+    (FieldName: 'ID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
+    // 对应于r_GatherProj中的ID字段
+    (FieldName: 'ProjID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
+    // 项目类型(r_DealPay_SProj使用,用于标记非正常汇总项目)
+    (FieldName: 'ProjType'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+
+    // 名称
+    (FieldName: 'Name'; FieldType: ftString; Size: 50; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 计算类型
+    // 0: 一般项
+    // 1: 本期应付 -- 汇总所有的一般项
+    // 2: 本期实付 -- 输入项
+    (FieldName: 'CalcType'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 是否扣减项
+    (FieldName: 'IsMinus'; FieldType: ftBoolean; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+
+    // 排序
+    (FieldName: 'SerialNo'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 按是否扣减分类,排序
+    (FieldName: 'LinkSerialNo'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+
+    // 累计完成 -- 金额
+    (FieldName: 'AddTotalPrice'; FieldType: ftDouble; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+
+    // 本期完成 -- 金额
+    (FieldName: 'CurTotalPrice'; FieldType: ftDouble; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 截止上期完成 -- 金额
+    (FieldName: 'PreTotalPrice'; FieldType: ftDouble; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 截止本期完成 -- 金额
+    (FieldName: 'EndTotalPrice'; FieldType: ftDouble; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+
+    // 区间 -- 金额
+    (FieldName: 'ZoneTotalPrice'; FieldType: ftDouble; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+  );
+
+  SProjPropertied_Gather = 'r_Projproperties_Gather';
+  SProjProperties_TransProj = 'r_ProjProperties_TransProj';
+  tdProjProperties_TransProj: array [0..4] of TScFieldDef =(
+    (FieldName: 'ID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
+    // 对应于r_GatherProj中的ID字段
+    (FieldName: 'ProjID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
+    // 项目类型(r_Bills_SProj使用,用于标记非正常汇总项目)
+    (FieldName: 'ProjType'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+
+    // 名称
+    (FieldName: 'Name'; FieldType: ftString; Size: 50; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 值
+    (FieldName: 'PropValue'; FieldType: ftString; Size: 50; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+  );
+
 implementation
 
 end.

+ 17 - 0
Report/ProjGather/rpgDealPayDm.dfm

@@ -0,0 +1,17 @@
+object rgpDealPayData: TrgpDealPayData
+  OldCreateOrder = False
+  Left = 192
+  Top = 123
+  Height = 188
+  Width = 177
+  object sdpDealPay: TsdADOProvider
+    Left = 66
+    Top = 16
+  end
+  object sddDealPay: TsdDataSet
+    Active = False
+    Provider = sdpDealPay
+    Left = 66
+    Top = 88
+  end
+end

+ 145 - 0
Report/ProjGather/rpgDealPayDm.pas

@@ -0,0 +1,145 @@
+unit rpgDealPayDm;
+
+interface
+
+uses
+  SysUtils, Classes, sdProvider, sdDB, ProjGatherDealPay, ADODB;
+
+type
+  TrgpDealPayData = class(TDataModule)
+    sdpDealPay: TsdADOProvider;
+    sddDealPay: TsdDataSet;
+  private
+    FProjIndex: Integer;
+    FProjType: Integer;
+
+    procedure SaveDealPayNodeCalc(ADealPay: TProjGatherDealPayNode; ACalc: TDealPayCalcData);
+    procedure SaveDealPayCalc(ADealPays: TProjGatherDealPayList);
+    procedure SaveDealPayGather(ADealPays: TProjGatherDealPayList);
+  public
+    constructor Create(AConnection: TADOConnection);
+
+    procedure SaveSpecialProjDataTo(ADealPays: TProjGatherDealPayList; AProjType: Integer; const ATableName: string);
+    procedure SaveProjDataTo(ADealPays: TProjGatherDealPayList; AProjIndex: Integer; const ATableName: string);
+    procedure SaveGatherDataTo(ADealPays: TProjGatherDealPayList; const ATableName: string);
+  end;
+
+implementation
+
+{$R *.dfm}
+
+{ TrgpDealPayData }
+
+constructor TrgpDealPayData.Create(AConnection: TADOConnection);
+begin
+  inherited Create(nil);
+  sdpDealPay.Connection := AConnection;
+end;
+
+procedure TrgpDealPayData.SaveDealPayCalc(
+  ADealPays: TProjGatherDealPayList);
+var
+  iDeal: Integer;
+  vDealPay: TProjGatherDealPayNode;
+begin
+  for iDeal := 0 to ADealPays.Count - 1 do
+  begin
+    vDealPay := ADealPays.DealPay[iDeal];
+    if FProjType = 0 then
+      SaveDealPayNodeCalc(vDealPay, vDealPay.Proj[FProjIndex])
+    else if FProjType > 0 then
+      SaveDealPayNodeCalc(vDealPay, vDealPay.SpecialProj[FProjType-1]);
+  end;
+end;
+
+procedure TrgpDealPayData.SaveDealPayGather(
+  ADealPays: TProjGatherDealPayList);
+var
+  iDeal: Integer;
+  vDealPay: TProjGatherDealPayNode;
+begin
+  for iDeal := 0 to ADealPays.Count - 1 do
+  begin
+    vDealPay := ADealPays.DealPay[iDeal];
+    SaveDealPayNodeCalc(vDealPay, vDealPay.GatherCalc);
+  end;
+end;
+
+procedure TrgpDealPayData.SaveDealPayNodeCalc(
+  ADealPay: TProjGatherDealPayNode; ACalc: TDealPayCalcData);
+var
+  Rec: TsdDataRecord;
+begin
+  Rec := sddDealPay.Add;
+  Rec.ValueByName('ID').AsInteger := ADealPay.ID;
+  Rec.ValueByName('ProjID').AsInteger := FProjIndex;
+  Rec.ValueByName('ProjType').AsInteger := FProjType;
+
+  Rec.ValueByName('Name').AsString := ADealPay.Name;
+  Rec.ValueByName('CalcType').AsInteger := ADealPay.CalcType;
+  Rec.ValueByName('IsMinus').AsBoolean := ADealPay.IsMinus;
+
+  Rec.ValueByName('SerialNo').AsInteger := ADealPay.SerialNo;
+  Rec.ValueByName('LinkSerialNo').AsInteger := ADealPay.LinkSerialNo;
+
+  Rec.ValueByName('CurTotalPrice').AsFloat := ACalc.CurTotalPrice;
+  Rec.ValueByName('PreTotalPrice').AsFloat := ACalc.PreTotalPrice;
+  Rec.ValueByName('EndTotalPrice').AsFloat := ACalc.EndTotalPrice;
+  Rec.ValueByName('AddTotalPrice').AsFloat := ACalc.AddTotalPrice;
+
+  Rec.ValueByName('ZoneTotalPrice').AsFloat := ACalc.ZoneTotalPrice;
+end;
+
+procedure TrgpDealPayData.SaveGatherDataTo(
+  ADealPays: TProjGatherDealPayList; const ATableName: string);
+begin
+  FProjIndex := -2;
+  FProjType := 0;
+
+  sdpDealPay.TableName := ATableName;
+  sddDealPay.Open;
+  sddDealPay.BeginUpdate;
+  try
+    SaveDealPayGather(ADealPays);
+  finally
+    sddDealPay.EndUpdate;
+    sddDealPay.Save;
+  end;
+end;
+
+procedure TrgpDealPayData.SaveProjDataTo(ADealPays: TProjGatherDealPayList;
+  AProjIndex: Integer; const ATableName: string);
+begin
+  FProjIndex := AProjIndex;
+  FProjType := 0;
+  
+  sdpDealPay.TableName := ATableName;
+  sddDealPay.Open;
+  sddDealPay.BeginUpdate;
+  try
+    SaveDealPayCalc(ADealPays);
+  finally
+    sddDealPay.EndUpdate;
+    sddDealPay.Save;
+  end;
+end;
+
+procedure TrgpDealPayData.SaveSpecialProjDataTo(
+  ADealPays: TProjGatherDealPayList; AProjType: Integer;
+  const ATableName: string);
+begin
+  FProjIndex := -3;
+  FProjType := AProjType;
+
+  sdpDealPay.TableName := ATableName;
+  sddDealPay.Open;
+  sddDealPay.BeginUpdate;
+  try
+    SaveDealPayCalc(ADealPays);
+  finally
+    sddDealPay.EndUpdate;
+    sddDealPay.Save;
+  end;
+end;
+
+end.

+ 3 - 0
Report/ProjGather/rpgGatherControl.pas

@@ -14,6 +14,8 @@ type
     FTemplate: TTemplateNode;
     // »ã×ÜÊý¾Ý
     FGatherData: TrpgGatherData;
+    // GatherProjectRelaData
+    FTempFile: string;
 
     procedure CopyTables(const AFileName, ATableName: string);
     procedure CopyRelaData;
@@ -71,6 +73,7 @@ begin
   try
     FProjectData.SaveTempDataBaseFile(sTempFile);
     CopyTables(sTempFile, 'ProjProperties');
+    CopyTables(sTempFile, 'DealBills');
   finally
     if FileExists(sTempFile) then
       DeleteFile(sTempFile);

+ 109 - 4
Report/ProjGather/rpgGatherData.pas

@@ -3,8 +3,9 @@ unit rpgGatherData;
 interface
 
 uses
-  ADODB, ProjGather, rpgGatherProjDm, rpgBillsDm, rpgBillsCalcDm, Classes,
-  ScAutoUpdateUnit, ProjGatherTree, GatherProjInfo;
+  ADODB, Classes, ProjGather, ScAutoUpdateUnit,
+  ProjGatherTree, GatherProjInfo, ProjGatherDealPay, ProjGatherProperties,
+  rpgGatherProjDm, rpgBillsDm, rpgBillsCalcDm, rpgDealPayDm;
 
 type
   TrpgGatherData = class
@@ -22,6 +23,12 @@ type
     procedure SaveBillsProjCalc(ATree: TProjGatherTree; AProjIndex: Integer);
     procedure SaveBillsSpecialProjCalc(ATree: TProjGatherTree; AProjType: Integer);
 
+    procedure SaveDealPayGatherData(ADealPay: TProjGatherDealPayList);
+    procedure SaveDealPayProjData(ADealPay: TProjGatherDealPayList; AProjIndex: Integer);
+    procedure SaveDealPaySpecialProjData(ADealPay: TProjGatherDealPayList; AProjType: Integer);
+
+    procedure SaveGatherProjProperties(AProperties: TProjGatherProperties);
+
     procedure CalcDgnData(const ATableName: string);
     procedure CalcOtherData(AProjCount, ASProjCount: Integer);
 
@@ -29,6 +36,7 @@ type
 
     function GetCacheProjFile(AProj: TGatherProjInfo): string;
     procedure CopyBGLData(const AFileName: string; AProjIndex, AProjType: Integer);
+    procedure CopyProjProperty(const AFileName: string; AProjIndex, AProjType: Integer);
     procedure CopyProjRelaGatherData(AProj: TGatherProjInfo; AProjIndex: Integer);
 
     function GetCurSpecialProjCount: Integer;
@@ -63,14 +71,27 @@ var
   iProj: Integer;
 begin
   AUpdater.AddTableDef(SGatherProj, @tdGatherProj, Length(tdGatherProj), False, False);
+
   AUpdater.AddTableDef(SBills, @tdBills, Length(tdBills), False, False);
+
   AUpdater.AddTableDef(SBills_Gather, @tdBills_Calc, Length(tdBills_Calc), False, False);
   for iProj := 0 to AProjCount - 1 do
     AUpdater.AddTableDef(SBills_Proj+IntToStr(iProj+1), @tdBills_Calc, Length(tdBills_Calc), False, False);
   AUpdater.AddTableDef(SBills_TransProj, @tdBills_Calc, Length(tdBills_Calc), False, False);
   for iProj := 0 to ASProjCount - 1 do
     AUpdater.AddTableDef(SBills_SProj+IntToStr(iProj+1), @tdBills_Calc, Length(tdBills_Calc), False, False);
+
   AUpdater.AddTableDef(SBGL_TransProj, @tdBGL_TransProj, Length(tdBGL_TransProj), False, False);
+
+  AUpdater.AddTableDef(SDealPay_Gather, @tdDealPay_Calc, Length(tdDealPay_Calc), False, False);
+  for iProj := 0 to AProjCount - 1 do
+    AUpdater.AddTableDef(SDealPay_Proj+IntToStr(iProj+1), @tdDealPay_Calc, Length(tdDealPay_Calc), False, False);
+  AUpdater.AddTableDef(SDealPay_TransProj, @tdDealPay_Calc, Length(tdDealPay_Calc), False, False);
+  for iProj := 0 to ASProjCount - 1 do
+    AUpdater.AddTableDef(SDealPay_SProj+IntToStr(iProj+1), @tdDealPay_Calc, Length(tdDealPay_Calc), False, False);
+
+  AUpdater.AddTableDef(SProjProperties_TransProj, @tdProjProperties_TransProj, Length(tdProjProperties_TransProj), False, False);
+  AUpdater.AddTableDef(SProjPropertied_Gather, @tdProjProperties_TransProj, Length(tdProjProperties_TransProj), False, False);
 end;
 
 procedure TrpgGatherData.CalcDgnData(const ATableName: string);
@@ -146,6 +167,7 @@ begin
   try
     sTempFile := GetCacheProjFile(AProj);
     CopyBGLData(sTempFile, AProjIndex, AProj.ProjType);
+    CopyProjProperty(sTempFile, AProjIndex, AProj.ProjType);
   finally
     if FileExists(sTempFile) then
       DeleteFile(sTempFile);
@@ -295,17 +317,28 @@ var
 begin
   SaveGatherProjInfo(AGather.CommonProj, AGather.SpecialProj);
   SaveBills(AGather.Tree);
+
   SaveBillsGatherCalc(AGather.Tree);
+  SaveDealPayGatherData(AGather.DealPay);
+  SaveGatherProjProperties(AGather.Properties);
+
   for iProj := 0 to AGather.CommonProj.Count - 1 do
   begin
     SaveBillsProjCalc(AGather.Tree, iProj);
     ExecuteSql(FConnection, Format(sInsert, [SBills_TransProj, SBills_Proj+IntToStr(iProj+1)]));
     CopyProjRelaGatherData(TGatherProjInfo(AGather.CommonProj.Items[iProj]), iProj);
+
+    SaveDealPayProjData(AGather.DealPay, iProj);
+    ExecuteSql(FConnection, Format(sInsert, [SDealPay_TransProj, SDealPay_Proj+IntToStr(iProj+1)]));
   end;
+
   for iProj := 0 to AGather.Tree.SpecialProjCount - 1 do
-    SaveBillsSpecialProjCalc(AGather.Tree, iProj+1);
-  for iProj := 0 to AGather.SpecialProj.Count - 1 do
+  begin
+    SaveBillsSpecialProjCalc(AGather.Tree, iProj+1);     
     CopyProjRelaGatherData(TGatherProjInfo(AGather.SpecialProj.Items[iProj]), -3);
+
+    SaveDealPaySpecialProjData(AGather.DealPay, iProj+1);
+  end;
 end;
 
 procedure TrpgGatherData.SaveGatherProjInfo(AProjs, ASProjs: TList);
@@ -327,7 +360,10 @@ var
   iProj: Integer;
 begin
   for iProj := 0 to AProjCount - 1 do
+  begin
     ExecuteSql(FConnection, Format(sInsert, [SBills_TransProj, SBills_Proj+IntToStr(iProj+1)]));
+    ExecuteSql(FConnection, Format(sInsert, [SDealPay_TransProj, SDealPay_Proj+IntToStr(iProj+1)]));
+  end;
 end;
 
 procedure TrpgGatherData.UpdateDataBase(ASpecialProjTypes: TStrings);
@@ -425,6 +461,7 @@ var
 begin
   for iProj := 0 to AGather.CommonProj.Count - 1 do
     CopyProjRelaGatherData(TGatherProjInfo(AGather.CommonProj.Items[iProj]), iProj);
+
   for iProj := 0 to AGather.SpecialProj.Count - 1 do
     CopyProjRelaGatherData(TGatherProjInfo(AGather.SpecialProj.Items[iProj]), -3);
 end;
@@ -446,4 +483,72 @@ begin
     vProjData.SaveTempDataBaseFile(Result);
 end;
 
+procedure TrpgGatherData.SaveDealPayGatherData(
+  ADealPay: TProjGatherDealPayList);
+var
+  vDealPayData: TrgpDealPayData;
+begin
+  vDealPayData := TrgpDealPayData.Create(FConnection);
+  try
+    vDealPayData.SaveGatherDataTo(ADealPay, SDealPay_Gather);
+  finally
+    vDealPayData.Free;
+  end;
+end;
+
+procedure TrpgGatherData.SaveDealPayProjData(
+  ADealPay: TProjGatherDealPayList; AProjIndex: Integer);
+var
+  vDealPayData: TrgpDealPayData;
+begin
+  vDealPayData := TrgpDealPayData.Create(FConnection);
+  try
+    vDealPayData.SaveProjDataTo(ADealPay, AProjIndex, SDealPay_Proj+IntToStr(AProjIndex+1));
+  finally
+    vDealPayData.Free;
+  end;
+end;
+
+procedure TrpgGatherData.SaveDealPaySpecialProjData(
+  ADealPay: TProjGatherDealPayList; AProjType: Integer);
+var
+  vDealPayData: TrgpDealPayData;
+begin
+  vDealPayData := TrgpDealPayData.Create(FConnection);
+  try
+    vDealPayData.SaveSpecialProjDataTo(ADealPay, AProjType, SDealPay_SProj+IntToStr(AProjType));
+  finally
+    vDealPayData.Free;
+  end;
+end;
+
+procedure TrpgGatherData.CopyProjProperty(const AFileName: string;
+  AProjIndex, AProjType: Integer);
+const
+  sCopy = 'Insert Into r_ProjProperties_TransProj' +
+          '  Select ID, %d As ProjID, %d As ProjType,' +
+          '    Name, PropValue' +
+          '  From ProjProperties In ''%s''';
+begin
+  ExecuteSql(FConnection, Format(sCopy, [AProjIndex, AProjType, AFileName]));
+end;
+
+procedure TrpgGatherData.SaveGatherProjProperties(
+  AProperties: TProjGatherProperties);
+
+  procedure SaveProperty(ID: Integer; AProperty: TProjGatherProperty);
+  const
+    sInsertSql = 'Insert Into r_ProjProperties_Gather (ID, ProjID, ProjType, Name, PropValue) ' +
+                 '  Values (%d, -2, 0, ''%s'', ''%s'')';
+  begin
+    ExecuteSql(FConnection, Format(sInsertSql, [ID, UpperCase(AProperty.Name), AProperty.Value]));
+  end;
+
+var
+  i: Integer;
+begin
+  for i := 0 to AProperties.Count - 1 do
+    SaveProperty(i, AProperties.PgProperty[i]);
+end;
+
 end.

+ 1 - 1
Units/Connections.pas

@@ -8,7 +8,7 @@ uses
 const
   ProductName = 'Measure';
   EmptyFileVersion = '1.0.0.0';
-  FileVersion = '1.0.1.11';
+  FileVersion = '1.0.1.12';
   EncryptVersion = 'Auto1.0';
   SAdoConnectStr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;' +
                    'User ID=Admin;Password='''';Persist Security Info=True';

+ 5 - 3
Units/DataBaseTables.pas

@@ -104,7 +104,7 @@ const
 
   {헌데鑒앴 -- 憩瑯긍서썹충}
   SBills = 'Bills';
-  tdBills: array [0..85] of TScFieldDef =(
+  tdBills: array [0..86] 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),
@@ -126,9 +126,11 @@ const
     // 묏넋좆헌데탤埼긍뵀
     (FieldName: 'IndexCode'; FieldType: ftString; Size: 50; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 覽섬만淃ID
-    (FieldName: 'ChapterParentID'; FieldType: ftInteger; size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    (FieldName: 'ChapterParentID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 쌘듐꿔늴
+    (FieldName: 'NodeLevel'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     //
-    (FieldName: 'NodeLevel'; 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),
     // --------- End   괩깊淚痰 -------
     (FieldName: 'Code'; FieldType: ftString; Size: 50; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     (FieldName: 'B_Code'; FieldType: ftString; Size: 50; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),

+ 5 - 5
Units/ProjectProperty.pas

@@ -85,11 +85,6 @@ type
     FReportShowStateText: string;
     FDealPhase: string;
 
-    function GetBoolPropertyDef(const AName: string; ADef: Boolean): Boolean;
-    function GetIntPropertyDef(const AName: string; ADef: Integer): Integer;
-    function GetStrPropertyDef(const AName, ADef: string): string;
-    function GetFloatPropertyDef(const AName: string; ADef: Double): Double;
-
     function GetDisplayFormat(ADigit: Integer): string;
 
     procedure LoadBaseProperties;
@@ -141,6 +136,11 @@ type
     procedure Save;
     procedure Reload;
 
+    function GetBoolPropertyDef(const AName: string; ADef: Boolean): Boolean;
+    function GetIntPropertyDef(const AName: string; ADef: Integer): Integer;
+    function GetStrPropertyDef(const AName, ADef: string): string;
+    function GetFloatPropertyDef(const AName: string; ADef: Double): Double;
+
     {Submit-Audit-Reply}
     // ¹²¼ÆÖÕÉó¼ÆÁ¿ÆÚÊý
     property FinalAuditCount: Integer read GetFinalAuditCount write SetFinalAuditCount;

+ 3 - 0
Units/mDataRecord.pas

@@ -33,6 +33,7 @@ type
     FIndexCode: TsdValue;
     FChapterParentID: TsdValue;
     FNodeLevel: TsdValue;
+    FB_CodeChapter: TsdValue;
     // »ù´¡Êý¾Ý
     FCode: TsdValue;
     FB_Code: TsdValue;
@@ -123,6 +124,7 @@ type
     property IndexCode: TsdValue read FIndexCode;
     property ChapterParentID: TsdValue read FChapterParentID;
     property NodeLevel: TsdValue read FNodeLevel;
+    property B_CodeChapter: TsdValue read FB_CodeChapter;
 
     property Code: TsdValue read FCode;
     property B_Code: TsdValue read FB_Code;
@@ -516,6 +518,7 @@ begin
   FIndexCode := ValueByName('IndexCode');
   FChapterParentID := ValueByName('ChapterParentID');
   FNodeLevel := ValueByName('NodeLevel');
+  FB_CodeChapter := ValueByName('B_CodeChapter');
 
   FCode := ValueByName('Code');
   FB_Code := ValueByName('B_Code');