瀏覽代碼

紫光接口基于稳定版本3.1.6 1002。

Chenshilong 9 年之前
父節點
當前提交
1129edbbc9
共有 6 個文件被更改,包括 63 次插入15 次删除
  1. 14 4
      DataModules/PHPWebDm.pas
  2. 1 1
      Dprs/CSL/Measure_Cloud.cfg
  3. 7 6
      Dprs/CSL/Measure_Cloud.dof
  4. 40 3
      Dprs/CSL/Measure_Cloud.dpr
  5. 二進制
      Dprs/CSL/Measure_Cloud.res
  6. 1 1
      Forms/LoginFrm.pas

+ 14 - 4
DataModules/PHPWebDm.pas

@@ -85,7 +85,8 @@ type
     function Search(AURL: string; AInFields, AInValues: array of string; var AOutRecords: TOVArr): Integer; overload;
     function Search(AURL: string; AInFields, AInValues: array of string; var AOutStrs: array of string ; var AOutRecords: TOVArr): Integer; overload;
     function Search(AURL: string; AInFields, AInValues: array of string; AResultType: Integer; var AOutStrs: array of string ; var AOutRecords: TOVArr): Integer; overload;
-    function Login(AAccount, APW: string; var AInfo, ACheckCode: string): TLoginType;
+    // ALoginType, 登录类型,1 正常情况下的用户名密码;2 紫光平台调用仅用户名无密码
+    function Login(AAccount, APW: string; ALoginType: Integer; var AInfo, ACheckCode: string): TLoginType;
     function ConnectServer(AIP: string; var ACompanyName: string): Integer;  // 新装软件,先弹出设置IP窗口
     function UpDataFile(AUserID, ATenderID, APhaseNo: Integer; AFile, AMD5_JL: string;
       AIsSubmit: Boolean; var AResultStr: string; ACheckPassed: Boolean; ACheckerMemo: string): Boolean;
@@ -105,7 +106,7 @@ type
     function NetError(AMid: string): string;
     function PageError(AMid: string): string;
     function ExistInServer(AWebID: Integer): Boolean;
-
+    function GetNameFromURLProtocol(AURLProtocol: string): string;
 
     property Account: string read FAccount write SetAccount;
     property UserID: Integer read FUserID write SetUserID;
@@ -158,11 +159,11 @@ begin
   Result := 'JLZF';
 end;
 
-function TPHPWeb.Login(AAccount, APW: string; var AInfo, ACheckCode: string): TLoginType;
+function TPHPWeb.Login(AAccount, APW: string; ALoginType: Integer; var AInfo, ACheckCode: string): TLoginType;
 var vArr: array of string;
 begin
   vArr := VarArrayOf(['uid', 'name', 'email', 'ucompany', 'jobtitle', 'avatar', 'msg']);
-  case Search(FMeasureURL + 'signin', ['v3name', 'v3pass'], [AnsiToUtf8(AAccount), APW], vArr) of
+  case Search(FMeasureURL + 'signin', ['v3name', 'v3pass', 'logintype'], [AnsiToUtf8(AAccount), APW, IntToStr(ALoginType)], vArr) of
     -1: Result := ltDisCon;
     0:
     begin
@@ -676,6 +677,15 @@ begin
     Result := False;
 end;
 
+// 格式为 Measure:chen
+function TPHPWeb.GetNameFromURLProtocol(AURLProtocol: string): string;
+begin
+  if Trim(AURLProtocol) = '' then
+    Result := ''
+  else
+    Result := Copy(AURLProtocol, 9, Length(AURLProtocol) - 8);
+end;
+
 initialization
 
 finalization

+ 1 - 1
Dprs/CSL/Measure_Cloud.cfg

@@ -35,7 +35,7 @@
 -N"D:\Work\DelphiTemp"
 -LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
 -LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
--D_mCloud;_mEncrypt1;_Test
+-D_mCloud;_mEncrypt1;_Test;_mLoginNoPW
 -w-UNSAFE_TYPE
 -w-UNSAFE_CODE
 -w-UNSAFE_CAST

+ 7 - 6
Dprs/CSL/Measure_Cloud.dof

@@ -96,7 +96,7 @@ PackageDLLOutputDir=
 PackageDCPOutputDir=
 SearchPath=
 Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;ZjGridD7;DPanel;ExTree;JimComboBoxs;JimTab;PrintComRep;XPMenu_tom;ZjGridFereD7;ZjCommon;SmartDataSet;ZjGridActns
-Conditionals=_mCloud;_mEncrypt1;_Test
+Conditionals=_mCloud;_mEncrypt1;_Test;_mLoginNoPW
 DebugSourceDirs=
 UsePackages=0
 [Parameters]
@@ -115,7 +115,7 @@ AutoIncBuild=1
 MajorVer=3
 MinorVer=1
 Release=3
-Build=1091
+Build=1094
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +126,7 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化云版
-FileVersion=3.1.3.1091
+FileVersion=3.1.3.1094
 InternalName=
 LegalCopyright=
 LegalTrademarks=
@@ -134,9 +134,10 @@ OriginalFilename=
 ProductName=
 ProductVersion=1.0.0.0
 [HistoryLists\hlConditionals]
-Count=2
-Item0=_mCloud;_mEncrypt1;_Test
-Item1=_mCloud;_mEncrypt;_Test
+Count=3
+Item0=_mCloud;_mEncrypt1;_Test;_mLoginNoPW
+Item1=_mCloud;_mEncrypt1;_Test
+Item2=_mCloud;_mEncrypt;_Test
 [HistoryLists\hlUnitAliases]
 Count=1
 Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;

+ 40 - 3
Dprs/CSL/Measure_Cloud.dpr

@@ -199,13 +199,17 @@ uses
   ProjGatherCalcData in '..\..\ProjGather\ProjGatherCalcData.pas',
   ProjGatherSelectFrm in '..\..\ProjGather\ProjGatherSelectFrm.pas' {ProjGatherSelectForm},
   ProjGatherTree in '..\..\ProjGather\ProjGatherTree.pas',
-  CalcData in '..\..\Units\CalcData.pas';
+  CalcData in '..\..\Units\CalcData.pas',
+  DealBillsExcelImport in '..\..\Units\DealBillsExcelImport.pas',
+  ExcelImport_Bills in '..\..\Units\ExcelImport_Bills.pas',
+  ExcelImport_GclBills in '..\..\Units\ExcelImport_GclBills.pas';
 
 {$R *.res}
 
 var
   Mutex: THandle;
   IPForm: TIPForm;
+  sInfo, sURL, sName: string;
 
 begin
   Mutex := CreateMutex(nil, True, G_AppHandleName);
@@ -233,18 +237,51 @@ begin
         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;
+
+        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(TProgressProForm, ProgressProForm);
-  end;
+    end;
     Application.Run;
   end;
 

二進制
Dprs/CSL/Measure_Cloud.res


+ 1 - 1
Forms/LoginFrm.pas

@@ -186,7 +186,7 @@ begin
     Exit;
   end;
 
-  case PHPWeb.Login(cbUser.Text, edtPW.Text, sInfo, sCheckCode) of
+  case PHPWeb.Login(cbUser.Text, edtPW.Text, 1, sInfo, sCheckCode) of
     ltCon:
     begin
       if Trim(sInfo) <> '' then