udmfunc.pas

来自「ProviceSystem-公积金监管系统中心端」· PAS 代码 · 共 2,156 行 · 第 1/5 页

PAS
2,156
字号
  var dtRunTime: TDateTime): Smallint;

//设置定时选项
function SaveTimingOption(const bPrompt: Boolean; const nPrompt: Smallint;
  const bTiming: Boolean; const nTimingForm: Smallint;
  const dtRunTime: TDateTime): Smallint;

//统计省监管结果
function StatProviceResult(DBGrid: TDBGrid): smallint;

//银行单位住处
function BankDptInfo(const nLabel: smallint; var aDpt: TStringDynArray): smallint;

//统计银行资金流动
function StatBankroolFlow(const sCommDB:String; const nForm: Smallint; const aCity,
  aDpt, aMonth: TStringDynArray; var aData: TArray2D): Smallint;

//银行资金流动明细
function BankroolFlowDetail(const sCommDB, sCity, sDpt: String; const dtBDate,
  dtEDate: TDateTime; DBGrid : TDBGrid): Smallint;

//查询国债
function SearchGZ(const sURL, sDate, sPz,nQx, fGmje: string;  DBGrid: TDBGrid): Smallint;
//查询国债明细
function SearchGZDetail(const sURL,sGzpzh:string;DBGrid: TDBGrid):Smallint;

//查询往来单位
function OpenYwdw(const sDwmc,sDwzh: String;const nGzcd: Smallint; DBGrid: TDBGrid): Smallint;
// 删除业务往来单位
function DelYwdw(const sDwmc,sDwzh: String): Smallint;
// 保存业务往来单位
function SaveYwdw(const sDwmc,sDwzh: string; const nGzcd: smallint): Smallint;
//导入业务往来单位
function DrYwdw(): Smallint;
//检查是否存在此记录
function IsExistYwdw(const sDwmc,sDwzh: String): Boolean;
//计算关注的总数
function CommonQuery(const sSql: String): Integer;

//查询预警结果
function SearchSurveillance(var aCityPrompt: TCityPromptDynArray): Smallint;
//点修改时赋值
procedure FillOneYwdwRec(var sDwmc,sDwzh: String;var nGzcd: smallint);

//转换指标
function ConvertZbN(const S:String):smallint;
function ConvertZbC(const N:smallint):String;

//计算财务指标
function CalcFinanceGuideLine(const sCity,sMonth: String;
  var aData: TDoubleDynArray):smallint;

//查询科目对照
function SearchSubjectCollate(const sCity, sBank: String;
      DBGrid: TDBGrid): Smallint;
//取当前记录内容,必须先执行SearchSubJectCollate;
function SubjectCollateRec(var sCity, sBank, sSubject, sAccount,
      sSummary: String): Smallint;
//帐号是否已存在
function IsExistSubjectCollate(const sCity, sBank, sAccount: String): Boolean;
//删除科目对照
function DelSubjectCollate(const sCity, sBank, sSubject,
     sAccount: String): Smallint;
//存科目对照
function SaveSubjectCollate(const sCity, sBank, sSubject, sAccount,
      sSummary: String): Smallint;

//取报表目录表信息
procedure BbmlInfo(DBGrid: TDBGrid);
//取报表目录表信息1
procedure BbmlInfo1(DBGrid: TDBGrid);
//取报表目录表一条纪录
procedure Bbml(var bbbh, bbdm, bbmc: string);
//保存报表目录表信息
function BbmlSave(const bbbh, bbdm, bbmc: string):smallint;
//删除报表目录表信息
function BbmlDel(const bbbh: string): smallint;
//保存报表文件
function BbSav(const dsbh,bbbh: string; const wj: TByteDynArray): smallint;
//读取报表文件
function F_BbWj(const dsbh,bbbh: string; var wj: TByteDynArray): smallint;


procedure CwBbGsInfo(const dsbh, bbbh: string; const gslx: smallint);
procedure CwBbGsInfo1(const dsbh, bbbh: string);
function CwBbgsSave(const dsbh, bbbh, gs: string; const row, col, gslx:
      smallint): smallint;
function CwBbgsDel(const dsbh, bbbh: string; const gslx: smallint):
      smallint;

//查询预警结果明细信息  (暂时不能用)
function SearchSurveillanceDetailed(const sURL, sDate: String; nType,
  nTypeItem: Smallint; const sOther: String; nOther: Double;
  DBGrid: TDBGrid): Smallint;
//国债汇总
function SearchNationalDebt(const aCity, aVariety: TStringDynArray;const sDate, sMoney,
  sCount: String; DBGrid: TDBGrid): Smallint;
//国债品种
function SearchNationalDebtVariety(var aData: TStringDynArray): Smallint;
//国债明细
function SearchNationalDebtDetailed(const sCity, sVariety, sDate,
  sGzPzh: String; DBGrid: TDBGrid): Smallint;
//国债信息
function SearchNationalDebtInfo(const sCity, sVariety: String;
  DBGrid: TDBGrid): Smallint;
//当前记录信息
procedure NationalDebtRec(var sCity,sVariety,sDate,sGzPzh: String); overload;
procedure NationalDebtRec(var sCity,sVariety: String); overload;
//
procedure NationalDebtData(const sField:String; const aDs,aPz:TStringDynArray; var aData:TArray2D);

implementation

function ConnectWS(const sWSDir: string): Boolean;
var
  iPJgWs: IPJgWsServer;
begin
  Result := True;
  try
    DM.rioPJg.URL := sWsDir;
    iPJgWs := DM.rioPJg as IPJgWsServer;
    iPJgWs.Connected;
    iPJgWs := nil;
  except
    Result := False;
  end;
end;

function Login(const sUid, sPwd: string; var sName, sQx,
  sSsds: string; var lSys: Boolean): Smallint;
var
  iPJgWs: IPJgWsServer;
begin
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.Login(sUid, sPwd, sName, sQx, sSsds, lSys);
      sName := trim(sName);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function UserInfo(DBGrid: TDBGrid): Smallint;
var
  iPJgWs: IPJgWsServer;
  vData: Variant;
begin
  DBGrid.DataSource := DM.ds_cds;
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.UserInfo(vData);
      DM.cds.XMLData := vData;
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function UserSave(const sUid, sPwd, sName, sQx, sSsds: string;
  const lSys: Boolean = False): Smallint;
var
  iPJgWs: IPJgWsServer;
begin
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.UserSave(sUid, sPwd, sName, sQx, sSsds, lSys);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function UserDelete(const sUid: string): Smallint;
var
  iPJgWs: IPJgWsServer;
begin
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.UserDelete(sUid);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

procedure UserInfoRec(var sUid, sPwd, sName, sQx, sSsds: string;
  var lSys: Boolean);
begin
  sUid := trim(Dm.cds.FieldByName('userid').AsString);
  sPwd := trim(Dm.cds.FieldByName('userpwd').AsString);
  sName := trim(Dm.cds.FieldByName('username').AsString);
  sQx := trim(Dm.cds.FieldByName('userqx').AsString);
  sSsds := trim(Dm.cds.FieldByName('ssds').AsString);
  lSys := Dm.cds.FieldByName('usersys').AsBoolean;
end;

function UserExists(const sUid: string): Boolean;
var
  iR: longint;
begin
  Result := False;
  iR := dm.cds.RecNo;
  while not Dm.cds.Eof do
  begin
    if trim(Dm.cds.FieldByName('userid').AsString) = sUid then
    begin
      Result := True;
      Break;
    end;
    Dm.cds.Next;
  end;
  Dm.cds.RecNo := iR;
end;

function RecordNO: LongInt;
begin
  Result := -1;
  if Dm.cds.Active then
    Result := Dm.cds.RecNo;
end;

procedure RecordNo(const index: Longint);
begin
  if (Dm.cds.Active) and (index > 0) then
    Dm.cds.RecNo := index;
end;

function RecordCount: LongInt;
begin
  Result := 0;
  if Dm.cds.Active then
    Result := Dm.cds.RecordCount;
end;

function ReadMainMap(var sCaption: string; const sFile: string): Smallint;
var
  ams: TMemoryStream;
  v: TByteDynArray;
  iRet: Smallint;
  i: Longint;
  iPJgWs: IPJgWsServer;
begin
  iPJgWs := DM.rioPJg as IPJgWsServer;
  try
    iRet := iPJgWs.ReadMainMap(sCaption, v);
    if iRet = 0 then
    begin
      ams := TMemoryStream.Create;
      try
        i := Length(v);
        ams.SetSize(i);
        move(v[0], ams.memory^, i);
        ams.SaveToFile(sFile);
      finally
        ams.Free;
      end;
    end;
  finally
    iPJgWs := nil;
  end;
  Result := iRet;
end;

function ReadMap(const sDsbh, sFile: string): Smallint;
var
  ams: TMemoryStream;
  v: TByteDynArray;
  iRet: Smallint;
  i: Longint;
  iPJgWs: IPJgWsServer;
begin
  iPJgWs := DM.rioPJg as IPJgWsServer;
  try
    iRet := iPJgWs.ReadMap(sDsbh, v);
    if iRet = 0 then
      ams := TMemoryStream.Create;
    try
      i := Length(v);
      ams.SetSize(i);
      move(v[0], ams.memory^, i);
      ams.SaveToFile(sFile);
    finally
      ams.Free;
    end;
  finally
    iPJgWs := nil;
  end;
  Result := iRet;
end;

function WriteMainMap(const sCaption, sFile: string): Smallint;
var
  ams: TMemoryStream;
  v: TByteDynArray;
  i: Longint;
  iPJgWs: IPJgWsServer;
begin
  ams := TMemoryStream.Create;
  try
    ams.LoadFromFile(sFile);
    i := ams.Size;
    setlength(v, i);
    move(ams.memory^, v[0], i);
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.WriteMainMap(sCaption, v);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function WriteMap(const sDsbh, sFile: string): Smallint;
var
  ams: TMemoryStream;
  v: TByteDynArray;
  i: Longint;
  iPJgWs: IPJgWsServer;
begin
  ams := TMemoryStream.Create;
  try
    ams.LoadFromFile(sFile);
    i := ams.Size;
    setlength(v, i);
    move(ams.memory^, v[0], i);
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.WriteMap(sDsbh, v);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function DsbhDelete(const sDsbh: string): Smallint;
var
  iPJgWs: IPJgWsServer;
begin
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.DsbhDelete(sDsbh);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function DsbhSave(const sDsbh, sDsmc, sDsIP: string; iDsPort: Word;
  const sDsVIP: string; iDsVPort, iDsLeft, iDsTop, iDsPWidth,
  iDsPHeight: Word; const sDsPbh: string;
  lHaveXs,lDataInUpDpt: Boolean; const sDsDB: String;
  const iDsJb: Smallint): Smallint;
var
  iPJgWs: IPJgWsServer;
begin
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.DsbhSave(sDsbh, sDsmc, sDsIP, iDsPort, sDsVIP, iDsVPort,
        iDsLeft, iDsTop, iDsPWidth, iDsPHeight, sDsPbh, lHaveXs,lDataInUpDpt, sDsDB,iDsJb);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function DsYjTimeSave(const sDsbh: string;
  dYjtime: TDateTime): Smallint;
var
  iPJgWs: IPJgWsServer;
begin
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.DsYjTimeSave(sDsbh, dYjTime);
    finally
      iPJgWs := nil;
    end;
  except
    Result := -2
  end;
end;

function DsInfo(var ANL: ANodeLabel; const path: string; parent: TWinControl;
  form: TForm): Smallint;
var
  iPJgWs: IPJgWsServer;
  vData: Variant;
  //  i: Longint;
  Node: TNodeLabel;
  //  sFile, sDsbh: String;
begin
  try
    iPJgWs := DM.rioPJg as IPJgWsServer;
    try
      Result := iPJgWs.DsInfo(vData);
      DM.cds.XMLData := vData;
      while not Dm.cds.Eof do
      begin
        Node := TNodeLabel.Create(Form);
        Node.Number := trim(Dm.cds.FieldByName('dsbh').AsString);
        Node.Caption := trim(Dm.cds.FieldByName('dsmc').AsString);
        Node.X := Dm.cds.FieldByName('dsleft').AsInteger;
        Node.Y := Dm.cds.FieldByName('dstop').AsInteger;
        Node.IP := trim(Dm.cds.FieldByName('dswsip').AsString);
        Node.Port := Dm.cds.FieldByName('dswsport').AsInteger;
        Node.VIP := trim(Dm.cds.FieldByName('dswsvip').AsString);
        Node.VPort := Dm.cds.FieldByName('dswsvport').AsInteger;
        Node.CityDataBase := trim(Dm.cds.FieldByName('dsdb').AsString);
        Node.DataInUpDpt := Dm.cds.FieldByName('datainupdpt').AsBoolean;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?