浏览代码

Merge branch 'master' of http://192.168.1.41:3000/MaiXinRong/Measure

builder 5 年之前
父节点
当前提交
c760f08a5f

+ 2 - 1
DataModules/PHPWebDm.pas

@@ -152,7 +152,7 @@ function ExeCategoryName: string;
 implementation
 
 uses
-  MD5Unit, IdMultipartFormData, VCLUnZip, VCLZip,
+  MD5Unit, IdMultipartFormData, VCLUnZip, VCLZip, Globals,
   IniFiles, Forms, UtilMethods, Variants, ConstUnit, ScUtils, superobject;{, Controls, Windows}
 
 var g_PHPWeb: TPHPWeb;
@@ -455,6 +455,7 @@ var
   vJson: TCslJson;
   vIdHTTP: TIdHTTP;
 begin
+  MeasureLog.AppendLogTo(AURL);
   Result := -1;
   postList := TStringList.Create;
   ssResponse := TStringStream.Create('');

+ 11 - 2
DataModules/ReportMemoryDm/rmGridHeaderDm.dfm

@@ -66,6 +66,11 @@ object rmGridHeaderData: TrmGridHeaderData
         Name = 'CurTime'
         DataType = ftWideString
         Size = 10
+      end
+      item
+        Name = 'DeadlineFormat'
+        DataType = ftWideString
+        Size = 20
       end>
     IndexDefs = <>
     Params = <>
@@ -73,7 +78,7 @@ object rmGridHeaderData: TrmGridHeaderData
     Left = 56
     Top = 40
     Data = {
-      680100009619E0BD01000000180000000C00000000000300000068010B50726F
+      8B0100009619E0BD01000000180000000D0000000000030000008B010B50726F
       6A6563744E616D6501004A000000010005574944544802000200640008446561
       6C436F646501004A000000010005574944544802000200280005434E616D6501
       004A000000010005574944544802000200640005534E616D6501004A00000001
@@ -84,7 +89,8 @@ object rmGridHeaderData: TrmGridHeaderData
       02004A000000010005574944544802000200FE01084465616C5479706501004A
       000000010005574944544802000200640008506861736553747201004A000000
       01000557494454480200020014000743757254696D6501004A00000001000557
-      494454480200020014000000}
+      494454480200020014000E446561646C696E65466F726D617401004A00000001
+      000557494454480200020028000000}
     object cdsGridHeaderProjectName: TWideStringField
       FieldName = 'ProjectName'
       Size = 50
@@ -131,5 +137,8 @@ object rmGridHeaderData: TrmGridHeaderData
       FieldName = 'CurTime'
       Size = 10
     end
+    object cdsGridHeaderDeadlineFormat: TWideStringField
+      FieldName = 'DeadlineFormat'
+    end
   end
 end

+ 3 - 0
DataModules/ReportMemoryDm/rmGridHeaderDm.pas

@@ -20,6 +20,7 @@ type
     cdsGridHeaderDealType: TWideStringField;
     cdsGridHeaderPhaseStr: TWideStringField;
     cdsGridHeaderCurTime: TWideStringField;
+    cdsGridHeaderDeadlineFormat: TWideStringField;
   private
   public
     function AssginData(AProjectData: TProjectData): TDataSet;
@@ -51,6 +52,8 @@ begin
   cdsGridHeaderDealType.AsString := AProjectData.Projproperties.DealType;
   cdsGridHeaderPhaseStr.AsString := Format('%.2d', [AProjectData.PhaseIndex]);
   cdsGridHeaderCurTime.AsString := FormatDateTime('yyyymm', Now);
+  cdsGridHeaderDeadlineFormat.AsString := FormatDateTime('yyyymm',
+    StrToDateDef(AProjectData.ProjProperties.Deadline, Now));
   cdsGridHeader.Post;
   Result := cdsGridHeader;
 end;

+ 2 - 2
Units/GclBillsGatherModel.pas

@@ -568,7 +568,6 @@ begin
   for i := 0 to FGcls.Count - 1 do
   begin
     vGcl := TGclNode(FGcls.Items[i]);
-    if (PriceRoundTo(vGcl.Price) = 0) then Continue;
 
     FGather.TotalPrice := FGather.TotalPrice + vGcl.TotalPrice;
 
@@ -592,7 +591,8 @@ begin
     FGather.AddQcTotalPrice := FGather.AddQcTotalPrice + vGcl.AddQcTotalPrice;
     FGather.AddGatherTotalPrice := FGather.AddGatherTotalPrice + vGcl.AddGatherTotalPrice;
 
-    FGather.DealTotalPrice := FGather.DealTotalPrice + vGcl.DealTotalPrice;
+    if (PriceRoundTo(vGcl.Price) <> 0) then
+      FGather.DealTotalPrice := FGather.DealTotalPrice + vGcl.DealTotalPrice;
     FGather.BGLTotalPrice := FGather.BGLTotalPrice + vGcl.BGLTotalPrice;
   end;
 

+ 37 - 45
Units/UpFileManageUnit.pas

@@ -127,7 +127,7 @@ type
 implementation
 
 uses ProjectData, Forms, PHPWebDm, CslJson, ConstUnit, UtilMethods,
-  StdConvs;
+  StdConvs, superobject;
 
 { TUpFile }
 
@@ -262,54 +262,46 @@ begin
 end;
 
 procedure TUpFiles.LoadDatas;
-var vArrFile: TOVArr;
-  i, iBillID: Integer;
-  vFile: TUpFile;
+
+  procedure LoadData(AFile: ISuperObject);
+  var
+    vFile: TUpFile;
+  begin
+    vFile := Add(AFile.I['itemid']);
+    vFile.DownURL := AFile.S['downurl'];
+    vFile.DisplayName := AFile.S['filename'];
+    vFile.LocalFile := FPath + vFile.DisplayName;
+    vFile.UperName := AFile.S['ownerName'];
+    vFile.Category := AFile.S['Category'];
+    vFile.Memo := AFile.S['Memo'];
+    vFile.UperID := AFile.I['owmerid'];
+    vFile.UpTime := AFile.S['uptime'];
+    vFile.ID := AFile.I['fileid'];
+    vFile.Phase := AFile.I['phase'];
+    vFile.WebID := TProjectData(FProjectData).WebID;
+    vFile.Status := ufsNormal;
+  end;
+
+var
+  i, iCount: Integer;
+  sUrl, sInfo: string;
+  vJ: ISuperObject;
 begin
-  if G_IsCloud then
+  if not G_IsCloud then Exit;
+
+  sUrl := Format('%stender/attachment/%d/list', [PHPWeb.MeasureURL, TProjectData(FProjectData).WebID]);
+  if PHPWeb.UrlGet(sUrl, nil, sInfo) = 1 then
   begin
-    if PHPWeb.GetAttachmentList(TProjectData(FProjectData).WebID, vArrFile) then
-    begin
-      for i := Low(vArrFile) to High(vArrFile) do
-      begin
-        iBillID := StrToInt(vArrFile[i, 4]);
-        vFile := Add(iBillID);    // AAAAA
-        vFile.DownURL := vArrFile[i, 0];
-        vFile.DisplayName := vArrFile[i, 1];
-        vFile.LocalFile := FPath + vArrFile[i, 1];
-        vFile.UperName := vArrFile[i, 3];
-        vFile.Category := vArrFile[i, 5];
-        vFile.Memo := vArrFile[i, 6];
-        vFile.UperID := StrToInt(vArrFile[i, 7]);
-        vFile.UpTime := vArrFile[i, 8];
-        vFile.ID := StrToInt(vArrFile[i, 9]);
-        vFile.Phase := StrToInt(vArrFile[i, 10]);     // vArrFile[i, 2] ÎļþÀ©Õ¹Ãû
-        vFile.WebID := TProjectData(FProjectData).WebID;
-        vFile.Status := ufsNormal;
-      end;
+    vJ := SO(sInfo);
+    try
+      if not Assigned(vJ.AsArray) then Exit;
+      iCount := vJ.AsArray.Length;
+      for i := 0 to iCount - 1 do
+        LoadData(vJ.AsArray.O[i]);
+    finally
+      vJ := nil;
     end;
   end;
-//  else
-//  begin
-//    FLocalQue.Close;
-//    FLocalQue.SQL.Text := 'Select * from AttachmentFile order by ID';
-//    FLocalQue.Open;
-//    FLocalQue.First;
-//
-//    while not FLocalQue.Eof do
-//    begin
-//      iBillID := FLocalQue.FieldByName('BillID').AsInteger;
-//      iPhase := FLocalQue.FieldByName('Phase').AsInteger;
-//      vFile := Add(iBillID, iPhase);
-//      vFile.ID := FLocalQue.FieldByName('ID').AsInteger;
-//      vFile.LocalFile := FPath + FLocalQue.FieldByName('FileName').AsString;
-//      vFile.DisplayName := FLocalQue.FieldByName('FileName').AsString;
-//
-//      FLocalQue.Next;
-//    end;
-//
-//    FLocalCon.Close;
-//  end;
 end;
 
 procedure TUpFile.SetID(const Value: Integer);