这是delphi写的,老板要求转化成JAVA代码,可怜我,对JAVA一点都不懂,请各位高人,出手相助.
老板要求我把此段Delphi写的代码转化成JAVA代码,但我没有学过JAVA,这几天在了解JAVA,感觉头到大啦,而且快到评年终绩效啦,今年感觉绩效会评得不好,当然也不会排除被炒的
可能,我只希望上周老板交待的代码转换,至少能够做成80%左右,就应该有一个交待啦,不然,总是有一把剑在头上悬着,随时,都会掉下来砍头,打工就是难啊.如果那位高人能够帮忙
把此代码转化成JAVA,我可以给点小钱作为辛苦的补偿(50元),这一点,请班主谅解,当然,也不会有很多.老婆的预产期在11月中,很想回家陪老婆,站老婆生小陔安心些,但工作做得如
此艰难,又不敢请多几天假,一言难尽...
里面有一些方法,是DELPHI写的,因为不管它,直接在JAVA使用就行啦,转化成JAVA代码不需要能够运行,因为也运行不了,能够完成80%,就可以啦.
unit DpPressNew;
interface
uses
Classes, SysUtils, StrUtils, DB, ComObj, Variants
const
UNIT_NAME = 'DpPressNew';
CST_MACRO_LEFT_MARK = '<';
CST_MACRO_RIGHT_MARK = '>';
CST_MACRO_KEY_MARK = '$';
CST_MAX_PAGES = 1000000;
CST_MAX_LAYOUT_ROWS = 3;
CST_MAX_LAYOUT_COLS = 3;
CST_MAX_COL_MARGIN = 400;
CST_MAX_ROW_MARGIN = 50;
CST_MAX_TEMPLATE_ROWS = 80;
CST_MAX_TEMPLATE_COLS = 50;
CST_KEY_MAIN = 'MAIN';
CST_KEY_LAYOUT = 'LAYOUT';
CST_KEY_LAYOUT_ROWS = 'LAYOUT ROWS';
CST_KEY_LAYOUT_COLS = 'LAYOUT COLS';
CST_KEY_DIV_BY_ROW = 'DIV BY ROW';
CST_KEY_TEMPLATE = 'TEMPLATE';
CST_KEY_TEMPLATE_ROWS = 'TEMPLATE ROWS';
CST_KEY_TEMPLATE_COLS = 'TEMPLATE COLS';
CST_KEY_MARGIN = 'MARGIN';
CST_KEY_MARGIN_ROW = 'ROW MARGIN';
CST_KEY_MARGIN_COL = 'COLUMN MARGIN';
CST_KEY_AREA = 'AREA';
CST_KEY_AREA_ROW_FROM = 'ROW FROM';
CST_KEY_AREA_ROW_TO = 'ROW TO';
CST_KEY_AREA_COL_FROM = 'COLUMN FROM';
CST_KEY_AREA_COL_TO = 'COLUMN TO';
CST_KEY_AREA_ROW_BY_ROW = 'ROW BY ROW';
CST_KEY_SQL = 'SQL';
CST_KEY_CELLS = 'CELLS';
CST_SHEET_SETTING = 'SETTING';
CST_SHEET_PARAMETER = 'PARAMETER';
CST_SHEET_TEMPLATE = 'TEMPLATE';
CST_SHEET_LOG = 'LOGS';
CST_COL_INDEX = 1;
CST_COL_KEY_LEVEL1 = 2;
CST_COL_KEY_LEVEL2 = 3;
CST_COL_DESCRIPTION = 4;
CST_COL_PARA_VALUE = 5;
type
TDpEventNewPage = procedure(iPage, iTotalPage: Integer
; var lCanceled: Boolean) of object;
iPressData = interface
['{64C3BDEB-6D34-45E8-BC5A-2202B88DD379}']
function _GetEof: Boolean;
function _GetCount: Integer;
function _GetSqlParaCount: Integer;
function _GetErrCode: LongInt;
function _GetErrMess: string;
function AssignSql(cSql: string): Boolean;
function GetSql: string;
function AssignSqlPara(cPara: string; cValue: string): Boolean;
function GetSqlParaKey(iIndex: Integer): string;
function GetSqlParaValue(iIndex: Integer): string;
function ReadData: Boolean;
function Macro(cKey: string; oParas: TStringList): WideString;
property Eof: Boolean read _GetEof;
property Count: Integer read _GetCount;
property SqlParaCount: Integer read _GetSqlParaCount;
property ErrCode: LongInt read _GetErrCode;
property ErrMess: string read _GetErrMess;
procedure MoveRecords(iStep: Integer);
end;
iPresswork = interface
['{F78268D7-329D-450F-A37D-7BFE8517C5C4}']
function _GetID: string;
function _GetType: string;
function _GetErrMess: string;
function _GetErrCode: LongInt;
function _GetCopyNum: Integer;
function _GetPrinter: TDpSfcPrinter;
function _GetPageTo: Integer;
function _GetPageFrom: Integer;
function _GetPressData: iPressData;
function _GetPressDataObj: TDpInterfaceObj;
procedure _SetID(cID: string);
procedure _SetType(cType: string);
procedure _SetPrinter(oPrinter: TDpSfcPrinter);
procedure _SetPressDataObj(oData: TDpInterfaceObj);
procedure _SetCopyNum(iCopyNum: Integer);
procedure _SetOnNewPage(pOnNewPage: TDpEventNewPage);
procedure _SetAutoPrint(lValue: Boolean);
procedure _SetFastPrint(lValue: Boolean);
procedure _SetPageTo(iTo: Integer);
procedure _SetPageFrom(iFrom: Integer);
property ID: string read _GetID write _SetID;
property ErrCode: LongInt read _GetErrCode;
property ErrMess: string read _GetErrMess;
property CopyNum: Integer read _GetCopyNum write _SetCopyNum;
property AutoPrint: Boolean write _SetAutoPrint;
property FastPrint: Boolean write _SetFastPrint;
property PressData: iPressData read _GetPressData;
property PressDataObj: TDpInterfaceObj read _GetPressDataObj;
property Printer: TDpSfcPrinter read _GetPrinter write _SetPrinter;
property OnNewPage: TDpEventNewPage write _SetOnNewPage;
property MyType: string read _GetType write _SetType;
property PageFrom: Integer read _GetPageFrom write _SetPageFrom;
property PageTo: Integer read _GetPageTo write _SetPageTo;
function InitMe(cFile: string; adoCnt: TDpAdoConnect): Boolean;
function Generate: Boolean;
function Print: Boolean;
procedure SetMarginLeft(iMarginLeft: Integer);
procedure SetMarginTop(iMarginTop: Integer);
end;