12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325 |
- import SystemFunction from '../../Library.Ext/Function/SystemFunction'
-
-
- // 定义一些类型,由于不清楚具体类型,这里先做简单定义,实际使用中需要根据情况完善
- type PageBase = any;
- type Message = {
- Fd16?: string;
- Fd30?: string;
- Fd31?: string;
- Fd100_1?: string;
- Fd34?: string;
- Fd12?: string;
- Fd125?: string;
- CustomizeTransitEntry?: (x: any) => boolean;
- CustomizeTransit?: any;
- };
- type Result = {
- Code?: string;
- Desc?: string;
- };
- type Selector = any;
- type ComboBox = any;
- type DataBox = any;
- type DataTable = any;
- type FrameworkElement = any;
- type UIElement = any;
- type NotifyMessage = any;
- type PrintTypes = any;
- type PrintContainer = any;
- type AuthConditionElement = {
- OperationType?: string;
- Txcode?: string;
- CTSigns?: string;
- SinAmt?: string;
- DeAccountType?: string;
- CrAccountType?: string;
- DeAccountPro?: string;
- CrAccountPro?: string;
- DeIsOwn?: string;
- CrIsOwn?: string;
- DCIsSameCus?: string;
- DeCaAddAmt?: string;
- DeTrAddAmt?: string;
- SumAddAmt?: string;
- LossMarked?: string;
- DocumentType?: string;
- DeductMarked?: string;
- LongOrShort?: string;
- LegalPerson?: string;
- CrTrAddAmt?: string;
- };
- type CheckConditionElements = {
- Account?: any;
- Money?: any;
- OperationType?: string;
- Txcode?: string;
- CTSigns?: string;
- SinAmt?: string;
- DeAccountType?: string;
- CrAccountType?: string;
- DeAccountPro?: string;
- CrAccountPro?: string;
- DeIsOwn?: string;
- CrIsOwn?: string;
- DCIsSameCus?: string;
- DeCaAddAmt?: string;
- DeTrAddAmt?: string;
- SumAddAmt?: string;
- LossMarked?: string;
- DocumentType?: string;
- DeductMarked?: string;
- LongOrShort?: string;
- LegalPerson?: string;
- CrTrAddAmt?: string;
- };
- type TransitType = any;
- type PrintTemplate = any;
- type PrintAttributes = any;
- type TradeBusData = {
- [key: string]: string;
- };
- type IPage = any;
- type WorkFlowHandle = {
- deleteProcessInsById: (processId: string, reason: string) => void;
- CompleteTaskById: (workItemId: string) => void;
- };
- type AuthDataHelper = {
- ProcessId: string;
- ClearAuthData: () => void;
- };
- type CheckDataHelper = {
- ProcessId: string;
- ClearCheckData: () => void;
- };
- type AsksuperResultType = 'Success' | 'Failed';
- type CheckManager = {
- GetCheckManager: (obj: any) => any;
- Result: (t: AsksuperResultType, busData: TradeBusData) => void;
- SetAuthCheckTitle: (element: any, str: string) => void;
- };
- type AuthManager = {
- GetAuthManager: (obj: any) => any;
- Result: (t: AsksuperResultType, busData: TradeBusData) => void;
- };
- type LoginAuthentication = {
- Instance: {
- GroupKinbrNo: string;
- };
- };
- type LoginUserInfo = {
- TellerNo: string;
- GetUserInfo: (key: string) => string;
- };
- type TradePowerManager = {
- Instance: {
- IsPowerCheckByUser: boolean;
- GetTradePowerByCode: (tradeCode: string) => any[];
- };
- };
- type TradeManagerHandle = {
- TT_SYSCONFIG_GetConfigValueByConfigID: (configId: string) => string;
- };
- type Feild8583 = {
- SetAuthFd125: (fd125: string) => any;
- GetStrBytes: (fd125: string, start: number, length: number) => string;
- };
- type TransitErrorCodeMap = {
- GetInstance: () => {
- GetErrorMessage: (notify: string, type: string) => string;
- };
- };
- type SelectionManager = {
- Instance: {
- PullSelection: (code: string, arguments?: any, mainCode?: string) => any;
- };
- };
- type UserFunction = {
- GetSelectedValue: (combo: ComboBox) => string;
- SetSelectedValue: (combo: ComboBox, val: any) => void;
- SetSelectedKey: (combo: ComboBox, key: string) => void;
- ToDecimal: (src: string) => number;
- ToDateTime: (src: string) => Date;
- };
- type TradeHandle = {
- ExcuteShell: (cmd: string) => boolean;
- };
- type TemplateBase = {
- PrintType: PrintTypes;
- DrawingSpecialMark: (left: number, top: number, markText: string) => void;
- DrawingSpecialMarkWithElement: (left: number, top: number, element: UIElement) => void;
- };
- type ReportEntity = {
- new(reportURI: string): ReportEntity;
- Analyze: (data: string) => void;
- Print: () => void;
- };
- type PrintContainerExt = {
- GetPrintElement: (page: PageBase) => PrintAttributes;
- SetPrintElement: (obj: any, pa: PrintAttributes) => void;
- };
-
- class TradeAPIsHelper {
- // ctor & Property
- public Page: PageBase;
-
- constructor(page: PageBase) {
- this.Page = page;
- }
-
- // 封装交易API函数
- // Message操作
- public InitFd(message: Message): void {
- SystemFunction.InitFd(this.Page, message);
- }
-
- public CommSend(message: Message): void {
- SystemFunction.CommSend(this.Page, message);
- }
-
- public CommSend96(message: Message): void {
- SystemFunction.CommSend96(this.Page, message);
- }
-
- public CallServer(message: Message): boolean {
- return this.Page.CallServer(message);
- }
-
- public CallAgn(message: Message): boolean {
- return this.Page.CallAgn(message);
- }
-
- public CallAgnTips(message: Message): boolean {
- return this.Page.CallAgnTips(message);
- }
-
- public CallAgnRun(message: Message): boolean {
- return this.Page.CallAgnRun(message);
- }
-
- public CallMobileBanking(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallMobileBanking);
- }
-
- public CallAgnCIS(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnCIS);
- }
-
- public CallAgnCard(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnCard);
- }
-
- public CallAgnHeat01(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnHeat01);
- }
-
- public CallAgnHeat02(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnHeat02);
- }
-
- public CallAgnHeat03(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnHeat03);
- }
-
- public CallAgnIDC(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnIDC);
- }
-
- public CallAgnIBPS(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnIBPS);
- }
-
- public CallAgnSHCZ(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnSHCZ);
- }
-
- public CallAgnIBDW(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnIBDW);
- }
-
- public CallAgnNew(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnNew);
- }
-
- public CallAgnCardEx(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnCardEx);
- }
-
- public CallAgnCartoon(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnCartoon);
- }
-
- public CallAgnHPF(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnHPF);
- }
-
- public CallAgnTV(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnTV);
- }
-
- public CallAgnFSSR(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnFSSR);
- }
-
- public CallAgnCLFJG(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnCLFJG);
- }
-
- public CallAgnHontax(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnHontax);
- }
-
- public CallAgnOrder(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnOrder);
- }
-
- public CallAgnMIS(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnMIS);
- }
-
- public CallAgnWXJJ_LP(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnWXJJ_LP);
- }
-
- public CallAgnWXJJ_CDX(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnWXJJ_CDX);
- }
-
- public CallAgnNetBank(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnNetBank);
- }
-
- public CallAgnMF01(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnMF01);
- }
-
- public CallAgnMF02(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnMF02);
- }
-
- public CallAgnWater(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnWater);
- }
-
- public CallAgnCnaps2(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnCnaps2);
- }
-
- public CallAgn_CZYYSW(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_CZYYSW);
- }
-
- public CallAgn_EasyPay(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_EasyPay);
- }
-
- public CallAgn_Ebill(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_Ebill);
- }
-
- public CallAgn_SDYCT(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_SDYCT);
- }
-
- public CallAgn_GasFee(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_GasFee);
- }
-
- public CallAgn_NJT(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_NJT);
- }
-
- public CallNoFileSys(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallNoFileSys);
- }
-
- public CallAgn_FGJWQ(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_FGJWQ);
- }
-
- public CallAgnNew_WL(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgnNew_WL);
- }
-
- public CallAgn_GGJ(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_GGJ);
- }
-
- public CallAgn_FGJWQ_HH(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_FGJWQ_HH);
- }
-
- public CallAgn_DF(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_DF);
- }
-
- public CallAgn_CW(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_CW);
- }
-
- public CallAgn_ZJJG(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_ZJJG);
- }
-
- public CallAgn_CKXT(message: Message): boolean {
- return this.Page.DoTransit(message, TransitType.CallAgn_CKXT);
- }
-
- public CustomizeTransit(msg: Message, func: (x: any) => boolean | null): void {
- // 取消自定义处理
- if (func === null) {
- msg.CustomizeTransitEntry = null;
- return;
- }
- msg.CustomizeTransitEntry = (x: any) => {
- try {
- return func(x);
- } catch (ex) {
- console.error('TradeAPIsHelper.CustomizeTransit:执行异常!', ex);
- x.Error = (ex as Error).message;
- return false;
- }
- };
- }
-
- // 控件辅助操作
- public AddItemOfSelecteAll(element: ComboBox, value: string = ''): boolean {
- return SystemFunction.AddItemOfSelecteAll(this.Page, element, value);
- }
-
- public RemoveItemOfSelecteAll(element: ComboBox): boolean {
- return SystemFunction.RemoveItemOfSelecteAll(this.Page, element);
- }
-
- public GetError(msg: Message): string {
- return SystemFunction.GetError(this.Page, msg);
- }
-
- public GetNotifyMessage(notify: string | NotifyMessage): string {
- if (typeof notify === 'string') {
- return TransitErrorCodeMap.GetInstance().GetErrorMessage(notify, 'notify');
- } else {
- return this.GetNotifyMessage(notify.toString());
- }
- }
-
- public CallComboBoxData(comboBox: ComboBox, message: Message, formatString: string, defalutCombox: string = "Null"): Result {
- return SystemFunction.CallComboBoxData(this.Page, comboBox, message, formatString, defalutCombox);
- }
-
- public CallComboBoxDataSelector(selector: Selector, code: string, arguments?: { [key: string]: string }): boolean {
- if (selector === null) return false;
- selector.Items.clear();
- let dict: any;
- if (this.Page.TradeInfo.MainCode === undefined || this.Page.TradeInfo.MainCode === '') {
- dict = SelectionManager.Instance.PullSelection(code, arguments);
- } else {
- dict = SelectionManager.Instance.PullSelection(code, arguments, this.Page.TradeInfo.MainCode);
- }
- if (dict === null) return false;
- selector.SetItems(dict);
- return true;
- }
-
- public SetAssertNotEmpty(element: FrameworkElement, flag: boolean): void {
- SystemFunction.SetAssertNotEmpty(this.Page, element, flag);
- }
-
- public GetSelectedValue(combo: ComboBox): string {
- return UserFunction.GetSelectedValue(combo);
- }
-
- public SetSelectedValue(combo: ComboBox, val: any): void {
- UserFunction.SetSelectedValue(combo, val);
- }
-
- public SetSelectedKey(combo: ComboBox, key: string): void {
- UserFunction.SetSelectedKey(combo, key);
- }
-
- public ToDecimal(src: string): number {
- return UserFunction.ToDecimal(src);
- }
-
- public ToDateTime(src: string): Date {
- return UserFunction.ToDateTime(src);
- }
-
- public DateToBig(date: string): string[] {
- return this.Page.DateToBig(date);
- }
-
- // 字符串数字处理类
- // 转换字符串为数字 atoi(string)
- public Atoi(number: string): number {
- return SystemFunction.Atoi(this.Page, number);
- }
-
- // 转换数字为字符串 itoa(number,string)
- public Itoa(number: number, format: string): string {
- return SystemFunction.Itoa(this.Page, number, format);
- }
-
- // 截取一个子串 substr(string,number,number)
- public SubStr(sourceData: string, start: number, length: number): string {
- return SystemFunction.SubStr(this.Page, sourceData, start, length);
- }
-
- // 得到字符串的长度 len(string)
- public Len(sourceData: string): number {
- return SystemFunction.Len(this.Page, sourceData);
- }
-
- // 把指定的ascii码值转换为字符串 chr(number)
- public Chr(number: number): string {
- return SystemFunction.Chr(this.Page, number);
- }
-
- // 求两个整数的余 mod(number1,number)
- public Mod(number1: number, number2: number): number {
- return SystemFunction.Mod(this.Page, number1, number2);
- }
-
- // 把一个数字型字符串转换为','分割的形式 comma(string,[number])
- public Comma(sourceData: string, length: number): string {
- return SystemFunction.Comma(this.Page, sourceData, length);
- }
-
- // 得到数字字符串对应的数值 val(string,[number])
- public Val(sourceData: string, weight: number): number {
- return SystemFunction.Val(this.Page, sourceData, weight);
- }
-
- // 去掉尾部空格 rtrim(string)
- public RTrim(sourceData: string): string {
- return SystemFunction.RTrim(this.Page, sourceData);
- }
-
- // 去掉左边空格 ltrim(string)
- public LTrim(sourceData: string): string {
- return SystemFunction.LTrim(this.Page, sourceData);
- }
-
- // 去掉所有空格,包括字符串中间的空格 delspace(string)
- public Delspace(sourceData: string): string {
- return SystemFunction.Delspace(this.Page, sourceData);
- }
-
- // 左补齐参数字符 PadLeft(string,int,char)
- public PadLeft(sourcedata: string, length: number, varChar: string = ' '): string {
- return SystemFunction.PadLeft(this.Page, sourcedata, length, varChar);
- }
-
- // 右补齐参数字符 PadRight(string,length,var)
- public PadRight(sourcedata: string, length: number, varChar: string = ' '): string {
- return SystemFunction.PadRight(this.Page, sourcedata, length, varChar);
- }
-
- // 以某个字符构建某长度的字符串 Space(lenth,char)
- public Space(lenght: number, c: string = ' '): string {
- return SystemFunction.Space(this.Page, lenght, c);
- }
-
- // 计算两个日期直接的绝对差值(天数)
- public Func(fDate: string, sDate: string): number {
- const startDate = new Date(
- parseInt(fDate.substring(0, 4)),
- parseInt(fDate.substring(4, 6)) - 1,
- parseInt(fDate.substring(6))
- );
- const endDate = new Date(
- parseInt(sDate.substring(0, 4)),
- parseInt(sDate.substring(4, 6)) - 1,
- parseInt(sDate.substring(6))
- );
- const timeSpan = endDate.getTime() - startDate.getTime();
- return Math.floor(timeSpan / (1000 * 60 * 60 * 24));
- }
-
- // 将数字类型转换成大写金额字符串 ChangeToCNY(decimal)
- public ChangeToCNY(num: number): string {
- return SystemFunction.ChangeToCNY(this.Page, num);
- }
-
- // 按格式解析返回字串,给combox添加项
- public SetSel(comboBox: ComboBox, fileData: string, formatString: string): boolean {
- return SystemFunction.SetSel(this.Page, comboBox, fileData, formatString);
- }
-
- // 非法汉字字符检查
- public CheckHalf(str: string): boolean {
- return true;
- }
-
- // 格式化金额数值:千分位、去空格(左对齐)
- public FormatAMT(amtVal: number): string {
- return this.Delspace(this.Comma(amtVal.toString(), 17));
- }
-
- // 将数字转换成中文
- private static unit: string[] = ["", "十", "百", "千", "万", "十万", "百万", "千万", "亿", "十亿", "百亿", "千亿", "万亿"];
- private static unit_T: string[] = ["", "拾", "佰", "仟", "萬", "拾萬", "佰萬", "仟萬", "亿", "拾亿", "佰亿", "仟亿", "萬亿"];
-
- public ChangeToCI(value: number, isSimple: boolean = true, hasUnit: boolean = false): string {
- let ret = '';
- const data = Math.abs(value).toString();
- for (let i = 0; i < data.length; i++) {
- const item = data[i];
- let c = '';
- switch (item) {
- case '0':
- c = isSimple ? "零" : "零";
- break;
- case '1':
- c = isSimple ? "一" : "壹";
- break;
- case '2':
- c = isSimple ? "二" : "贰";
- break;
- case '3':
- c = isSimple ? "三" : "叁";
- break;
- case '4':
- c = isSimple ? "四" : "肆";
- break;
- case '5':
- c = isSimple ? "五" : "伍";
- break;
- case '6':
- c = isSimple ? "六" : "陆";
- break;
- case '7':
- c = isSimple ? "七" : "柒";
- break;
- case '8':
- c = isSimple ? "八" : "捌";
- break;
- case '9':
- c = isSimple ? "九" : "玖";
- break;
- default:
- throw new Error("ChangeToCI:参数异常!");
- }
- ret += c;
- if (hasUnit) {
- // 加载单位
- ret += isSimple ? TradeAPIsHelper.unit[data.length - i - 1] : TradeAPIsHelper.unit_T[data.length - i - 1];
- }
- }
- return ret;
- }
-
- // 将汉字(零,一 ……十二转换为阿拉伯数字1至12)
- public ChangeToNum(value: string): number {
- let c = -1;
- switch (value) {
- case "零":
- c = 0;
- break;
- case "一":
- c = 1;
- break;
- case "二":
- c = 2;
- break;
- case "三":
- c = 3;
- break;
- case "四":
- c = 4;
- break;
- case "五":
- c = 5;
- break;
- case "六":
- c = 6;
- break;
- case "七":
- c = 7;
- break;
- case "八":
- c = 8;
- break;
- case "九":
- c = 9;
- break;
- case "十":
- c = 10;
- break;
- case "十一":
- c = 11;
- break;
- case "十二":
- c = 12;
- break;
- default:
- break;
- }
- return c;
- }
-
- // 转换证件类型
- private static _LicKindList_: { [key: string]: string } | null = null;
-
- public ChgLicKind(kind: string): string {
- if (TradeAPIsHelper._LicKindList_ === null) {
- TradeAPIsHelper._LicKindList_ = SelectionManager.Instance.PullSelection("C004", null);
- const c003Data = SelectionManager.Instance.PullSelection("C003", null);
- Object.entries(c003Data).forEach(([key, value]) => {
- TradeAPIsHelper._LicKindList_[key] = value;
- });
- }
- if (TradeAPIsHelper._LicKindList_.hasOwnProperty(kind)) {
- return TradeAPIsHelper._LicKindList_[kind];
- }
- const item = Object.entries(TradeAPIsHelper._LicKindList_).find(([_, value]) => value === kind);
- return item ? item[0] : kind;
- }
-
- // 解析文本文件、excel文件、DataTable文件
- public AnalyzeTxtData(txt_RowSplit: string[], txt_ColumnSlit: string, txt_EnCode: string, isColumnHeader: boolean = true): DataTable {
- return SystemFunction.AnalyzeTxtData(txt_RowSplit, txt_ColumnSlit, txt_EnCode, isColumnHeader);
- }
-
- public AnalyseExcelData(RowCount: number = 0, columnCount: number = 0): DataTable {
- return SystemFunction.AnalyseExcelData(RowCount, columnCount);
- }
-
- public AnalyseDataTable(data: DataTable, txt_RowSplit: string, txt_ColumnSlit: string): string {
- return this.AnalyseDataTable(data, txt_RowSplit, txt_ColumnSlit);
- }
-
- // 文件操作相关
- public Shell(cmd: string): boolean {
- return TradeHandle.ExcuteShell(cmd);
- }
-
- public Getfiletxt(fileName: string): string {
- return SystemFunction.Getfiletxt(fileName);
- }
-
- public Savefiletxt(fileName: string, fileContent: string, append: boolean): boolean {
- return SystemFunction.Savefiletxt(fileName, fileContent, append);
- }
-
- // MessageBox-弹出消息框
- // 消息提示默认值
- private static readonly IsCoverAll = true;
- private static readonly IsReverse = true;
- private static readonly Direction = 3;
- private static readonly AnimationEnable = false;
-
- // 输入信息提示
- public ShowTip(message: string): boolean {
- const current: FrameworkElement = this.Page;
- const flag = this.Page.GetEnableFocusControl();
- let fm: any;
- if (flag) {
- fm = this.Page.GetManagerInstance();
- if (fm !== null) {
- current = fm.CurrentFocusedElement;
- }
- }
- return this.ShowTipElement(current, message);
- }
-
- public ShowTipElement(target: UIElement, message: string): boolean {
- return target.ShowTip(message);
- }
-
- public ShowTipPlacement(target: UIElement, message: string, placement: any = 'Bottom'): boolean {
- return target.ShowTip(placement, message);
- }
-
- // 功能选择消息提示
- public ShowComfirmBox(message: string, comfirm: string[], defaultfocus: string | null = null): string {
- let def = 1;
- if (comfirm.includes(defaultfocus as string)) {
- def = comfirm.indexOf(defaultfocus as string) + 1;
- }
- const ret = this.Page.ShowComfirmBox(message, comfirm, def);
- return comfirm[ret];
- }
-
- @Obsolete
- public ShowComfirmBoxKey(message: string, comfirm: { [key: string]: string }, defaultfocus: string = 'None'): string {
- return this.Page.ShowPageMessageBoxExt(message, comfirm, defaultfocus);
- }
-
- public ShowComfirmBoxParams(message: string, ...comfirm: string[]): number {
- return this.Page.ShowComfirmBox(message, comfirm);
- }
-
- // 推送消息提示
- public ShowPopueMessageBox(content: any, caption: string = "提示信息"): void {
- // 原函数体为空
- }
-
- // 默认选择提示
- public ShowQuestionMessageBox(content: any, caption: string = "询问信息", focuResult: string = "Yes", results: string[] = ["Yes", "No"]): string {
- const result = this.Page.ShowPageMessageBoxMetro(
- content,
- caption,
- null,
- this.ConvertMessageBoxResultToStr(focuResult),
- TradeAPIsHelper.Direction,
- TradeAPIsHelper.IsReverse,
- TradeAPIsHelper.IsCoverAll,
- TradeAPIsHelper.AnimationEnable,
- this.ConvertMessageBoxButton(results)
- );
- return this.ConvertStrToMessageBoxResult(result);
- }
-
- public ShowQuestionMessageBoxCustom(content: any, results: string[], defaultIndex: number, caption: string = "询问信息"): string {
- const defaultValue = results.length > defaultIndex ? results[defaultIndex] : results[0];
- return this.Page.ShowPageMessageBoxMetro(
- content,
- caption,
- null,
- defaultValue,
- TradeAPIsHelper.Direction,
- TradeAPIsHelper.IsReverse,
- TradeAPIsHelper.IsCoverAll,
- TradeAPIsHelper.AnimationEnable,
- results
- );
- }
-
- // 场景信息提醒提示
- public ShowSuccessMessageBox(content: any | null = null, caption: string = "业务办理成功"): string {
- const image = this.Page.GetResource("MessageBoxMetroSuccess");
- const result = this.Page.ShowPageMessageBoxMetro(
- content,
- caption,
- image,
- this.ConvertMessageBoxResultToStr("OK"),
- TradeAPIsHelper.Direction,
- TradeAPIsHelper.IsReverse,
- TradeAPIsHelper.IsCoverAll,
- TradeAPIsHelper.AnimationEnable,
- this.ConvertMessageBoxButton(["OK"])
- );
- return this.ConvertStrToMessageBoxResult(result);
- }
-
- public ShowInfoMessageBox(content: any | null = null, caption: string = "提示信息"): string {
- const image = this.Page.GetResource("MessageBoxMetroInfo");
- const result = this.Page.ShowPageMessageBoxMetro(
- content,
- caption,
- image,
- this.ConvertMessageBoxResultToStr("OK"),
- TradeAPIsHelper.Direction,
- TradeAPIsHelper.IsReverse,
- TradeAPIsHelper.IsCoverAll,
- TradeAPIsHelper.AnimationEnable,
- this.ConvertMessageBoxButton(["OK"])
- );
- return this.ConvertStrToMessageBoxResult(result);
- }
-
- public ShowErrorMessageBox(content: any | null = null, caption: string = "错误信息"): string {
- const image = this.Page.GetResource("MessageBoxMetroError");
- const result = this.Page.ShowPageMessageBoxMetro(
- content,
- caption,
- image,
- this.ConvertMessageBoxResultToStr("OK"),
- TradeAPIsHelper.Direction,
- TradeAPIsHelper.IsReverse,
- TradeAPIsHelper.IsCoverAll,
- TradeAPIsHelper.AnimationEnable,
- this.ConvertMessageBoxButton(["OK"])
- );
- return this.ConvertStrToMessageBoxResult(result);
- }
-
- public ShowWarnMessageBox(content: any | null = null, caption: string = "警告信息"): string {
- const image = this.Page.GetResource("MessageBoxMetroWarn");
- const result = this.Page.ShowPageMessageBoxMetro(
- content,
- caption,
- image,
- this.ConvertMessageBoxResultToStr("OK"),
- TradeAPIsHelper.Direction,
- TradeAPIsHelper.IsReverse,
- TradeAPIsHelper.IsCoverAll,
- TradeAPIsHelper.AnimationEnable,
- this.ConvertMessageBoxButton(["OK"])
- );
- return this.ConvertStrToMessageBoxResult(result);
- }
-
- // 转换方法
- private ConvertStrToMessageBoxResult(str: string | null): string {
- str = str || '';
- switch (str.trim()) {
- case "取消":
- return "Cancel";
- case "否":
- return "No";
- case "确定":
- return "OK";
- case "是":
- return "Yes";
- default:
- return "None";
- }
- }
-
- private ConvertMessageBoxResultToStr(result: string): string {
- switch (result) {
- case "Cancel":
- return "取消";
- case "No":
- return "否";
- case "OK":
- return "确定";
- case "Yes":
- return "是";
- default:
- return "未知";
- }
- }
-
- private ConvertMessageBoxButton(msg: string[]): string[] {
- return msg;
- }
-
- // DataBox相关函数
- public InitDataBox(databox: DataBox): void {
- databox.InitDataBox();
- }
-
- public GetDataForDataTable(databox: DataBox): DataTable {
- return databox.GetDataForDataTable();
- }
-
- public GetDataForString(databox: DataBox): string {
- return databox.GetDataForString();
- }
-
- public BindDataTable(databox: DataBox, dtSource: DataTable): void {
- databox.BindDataTable(dtSource);
- }
-
- public DataBinding(databox: DataBox, fileData: string, ...columnName: string[]): void {
- databox.DataBinding(fileData, columnName);
- }
-
- public DataBindingXML(databox: DataBox, fileData: string, nodeName: string, ...columnName: string[]): void {
- const str = databox.AnalyzeXMLtoStr(fileData, nodeName);
- databox.DataBinding(str || fileData, columnName);
- }
-
- public DataBindingLevel(databox: DataBox, fileData: string, level: any, ...columnNames: string[]): void {
- databox.DataBinding(fileData, level, columnNames);
- }
-
- public SetColumnsHeader(databox: DataBox, columnIndex: number, header: string): void {
- databox.SetColumnsHeader(columnIndex, header);
- }
-
- public SetColumnsWidth(databox: DataBox, columnIndex: number, width: number): void {
- databox.SetColumnsWidth(columnIndex, width);
- }
-
- public SetColumnsVisible(databox: DataBox, columnIndex: number, visible: boolean): void {
- databox.SetColumnsVisible(columnIndex, visible);
- }
-
- public SetColumnsFormat(databox: DataBox, columnIndex: number, format: string): void {
- databox.SetColumnsFormat(columnIndex, format);
- }
-
- public SetColumnsAlign(databox: DataBox, columnIndex: number, align: string): void {
- databox.SetColumnsAlign(columnIndex, align);
- }
-
- public GetSelectMultiRows(databox: DataBox): any[] {
- return databox.GetSelectMultiRows();
- }
-
- public GetSelectSingleRow(databox: DataBox): any {
- return databox.GetSelectSingleRow();
- }
-
- public GetSelectRowValue(databox: DataBox, hasRowIndex: boolean = true): string[] {
- let ret = databox.GetSelectRowValue();
- if (!hasRowIndex && ret && ret.length > 1) {
- ret = ret.slice(1);
- }
- return ret;
- }
-
- public SetSelDataBox(databox: DataBox, colName: string, dic: { [key: string]: string }): void {
- databox.SetSel(colName, dic);
- }
-
- public AddColumn(databox: DataBox, column: any): void {
- databox.AddColumn(column);
- }
-
- public AddHyperlinkColumn(databox: DataBox, colName: string, click: (event: any) => void, hotkey: string = 'None'): void {
- databox.AddHyperlinkColumn(colName, click, hotkey);
- }
-
- public AddRowDataBox(databox: DataBox, newRow: any): boolean {
- return databox.AddRow(newRow);
- }
-
- public AddRowValues(databox: DataBox, ...values: any[]): boolean {
- return databox.AddRow(values);
- }
-
- public UpdateRow(databox: DataBox, ...values: any[]): boolean {
- return databox.UpdateRow(values);
- }
-
- public DeleteSelectRows(databox: DataBox): boolean {
- return databox.DeleteSelectRows();
- }
-
- // Combobox控件相关
- public AddItems(target: any, items: any[]): void {
- target.AddItems(items);
- }
-
- public SetItems(target: any, items: any[]): void {
- target.SetItems(items);
- }
-
- public GetSelectedKey(target: any): string {
- return target.GetSelectedKey();
- }
-
- // 设置焦点相关
- public SetFocus(element: FrameworkElement | null = null): void {
- this.Page.SetFocus(element);
- }
-
- // 检查账号是否是卡
- public CheckCardBin(acno: string): boolean {
- return this.Page.CheckCardBin(acno);
- }
-
- // 打印相关
- public CreateSpecialMarkPrint(pt: PrintTypes, left: number, top: number, markText: string): PrintContainer {
- const tb = new TemplateBase();
- tb.PrintType = pt;
- tb.DrawingSpecialMark(left, top, markText);
- return tb;
- }
-
- public CreateSpecialMarkPrintElement(pt: PrintTypes, left: number, top: number, element: UIElement): PrintContainer {
- const tb = new TemplateBase();
- tb.PrintType = pt;
- tb.DrawingSpecialMarkWithElement(left, top, element);
- return tb;
- }
-
- public PrintCertificate(authForms: PrintContainer[]): void {
- this.Page.PrintCertificate(authForms);
- // add by chuhai 清空前端流水,避免交易不关闭导致流水重复。
- this.Page.ClearSerialNumber();
- }
-
- public PrintAcdtl_1(message: Message): string {
- return '';
- }
-
- public PrintAcdtl_hst(message: Message): string {
- return '';
- }
-
- public PrintAcdtl_h(message: Message): string {
- return '';
- }
-
- public Print_Sq(message: Message): string {
- return '';
- }
-
- public PrintReport(formatMessage: string, reportURI: string, paraDic: { [key: string]: string } | null): void {
- let sb = formatMessage;
- if (paraDic) {
- sb += '\n[parameters]\n';
- for (const [key, value] of Object.entries(paraDic)) {
- sb += `${key}=${value}\n`;
- }
- sb += ';';
- }
- const re = new ReportEntity(reportURI);
- // 补偿PrintAttributes给ReportEntity
- let pa = PrintContainerExt.GetPrintElement(this.Page);
- if (!pa) pa = this.Page.GetPrintAttributes();
- PrintContainerExt.SetPrintElement(re, pa);
- re.Analyze(sb);
- re.Print();
- }
-
- // 查找上层Ipage
- private FindAncestor<T>(element: any): T | null {
- let obj: any = null;
- for (obj = this.Page.VisualTreeHelper.GetParent(element); !(obj instanceof T); obj = this.Page.VisualTreeHelper.GetParent(obj)) {
- if (obj === null) break;
- }
- return obj as T;
- }
-
- // 授权/复核
- public RestoreTradePage(serialid: string, busData: TradeBusData): void {
- this.Page.ShowTradeTab(serialid, (page: IPage) => {
- this.Page.Dispatcher.BeginInvoke(() => {
- const resultKey = busData.hasOwnProperty('SuperFlag') ? 'SuperFlag' : 'AuthFlag';
- let resultflag = false;
- if (busData[resultKey]) {
- resultflag = busData[resultKey] === 'true';
- }
- // 没有找到page,说明已经关闭过前端软件
- if (page === null) {
- // target.ShowErrorMessageBox("此任务的交易已丢失!");
- // 如果target是消息推送过来的,用target.ShowErrorMessageBox会报错,暂时用这个代替
- this.ShowInfoMessageBox("此任务的交易已丢失,请重新做该交易");
- // MessageBox.Show("此任务的交易已丢失,请重新做该交易", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
- let deletereason = '';
- if (resultKey === 'SuperFlag') {
- deletereason = 'SuperFaild';
- } else if (resultKey === 'AuthFlag') {
- deletereason = 'AuthFaild';
- } else {
- deletereason = 'TellerDelete';
- }
- // 如果失败,不管是找没找到能还原的界面,因为工作流配置为不非环形流程,都需要删除流程,tradepage的流水号serialid也不用更新,
- // 如果还原了界面,客户还可以使用原来的流水号再提交申请,这个由服务端做了处理。
- WorkFlowHandle.deleteProcessInsById(busData['ProcessId'], deletereason); // TellerDelete只是做为删除流程实例原因的描述
- } else {
- // TabItem item = page.GetCurrentTabItem();
- page.GetTradeInfoData().SetTradeBus(busData); // .SetTradeData(data);
- // CheckManager c = item as CheckManager;
- // AuthManager a = item as AuthManager;
- let t: AsksuperResultType = 'Failed';
- if (resultflag) {
- if (busData.hasOwnProperty('WorkItemId')) {
- WorkFlowHandle.CompleteTaskById(busData['WorkItemId']); // 提交任务
- }
- t = 'Success';
- } else {
- let deletereason = '';
- let processid = '';
- if (resultKey === 'SuperFlag') {
- const checkdata = new CheckDataHelper(page);
- deletereason = 'SuperFaild';
- processid = checkdata.ProcessId;
- checkdata.ClearCheckData();
- } else if (resultKey === 'AuthFlag') {
- const authdata = new AuthDataHelper(page);
- deletereason = 'AuthFaild';
- processid = authdata.ProcessId;
- authdata.ClearAuthData();
- }
- /* 如果失败,不管是找没找到能还原的界面,因为工作流配置为不非环形流程,都需要删除流程,tradepage的流水号serialid也不用更新,
- 如果还原了界面,客户还可以使用原来的流水号再提交申请,这个由服务端做了处理。
- TellerDelete只是做为删除流程实例原因的描述 */
- WorkFlowHandle.deleteProcessInsById(processid, deletereason);
- t = 'Failed';
- }
-
- // if (c != null)
- // c.Result(t, busData);
- // else
- const c = CheckManager.GetCheckManager(page);
- const a = AuthManager.GetAuthManager(page);
- if (c && resultKey === 'SuperFlag') {
- c.Result(t, busData);
- } else if (a && resultKey === 'AuthFlag') {
- a.Result(t, busData);
- }
- }
- }, 'Loaded');
- });
- }
-
- public GetAuthElement(out oepnBranch: string, DeAccount: string = '', CrAccount: string = '', SinAmt: string = '', CTSigns: string = '', OperationType: string = '', DeAccountSeqn: string = ''): AuthConditionElement | null {
- oepnBranch = '';
- let result: AuthConditionElement | null = null;
- const message: Message = {};
- this.InitFd(message);
- this.CommSend(message);
- message.Fd16 = '8980';
- message.Fd30 = DeAccount;
- message.Fd31 = CrAccount;
- message.Fd100_1 = SinAmt;
- message.Fd34 = DeAccountSeqn;
- if (!this.CallServer(message)) {
- this.ShowErrorMessageBox(this.GetError(message));
- return null;
- }
- if (message.Fd12 !== '0000') {
- this.ShowErrorMessageBox(this.GetError(message));
- return null;
- } else {
- result = {
- OperationType: OperationType ? OperationType.trim() : '',
- Txcode: this.Page.TradeInfoData.GetTradeInfo(this.Page).TradeCode,
- CTSigns: CTSigns ? CTSigns.trim() : '',
- SinAmt: SinAmt ? SinAmt.trim() : '',
- } as AuthConditionElement;
- const fd125 = Feild8583.SetAuthFd125(message.Fd125);
- fd125.CTSigns = CTSigns;
- fd125.SinAmt = SinAmt;
- oepnBranch = DeAccount ? Feild8583.GetStrBytes(message.Fd125, 176, 5) : Feild8583.GetStrBytes(message.Fd125, 181, 5);
- result.DeAccountType = fd125.DeAccountType.trim();
- result.CrAccountType = fd125.CrAccountType.trim();
- result.DeAccountPro = fd125.DeAccountPro.trim();
- result.CrAccountPro = fd125.CrAccountPro.trim();
- result.DeIsOwn = fd125.DeIsOwn === 'Y' ? 'true' : 'false';
- result.CrIsOwn = fd125.CrIsOwn === 'Y' ? 'true' : 'false';
- result.DCIsSameCus = fd125.DCIsSameCus === 'Y' ? 'true' : 'false';
- result.DeCaAddAmt = fd125.DeCaAddAmt.trim();
- if (!SinAmt.trim()) SinAmt = '0.0';
- result.DeCaAddAmt = (parseFloat(fd125.DeCaAddAmt.trim()) + parseFloat(SinAmt)).toString();
- result.CrTrAddAmt = (parseFloat(fd125.CrTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
- result.DeTrAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
- result.SumAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt) + parseFloat(fd125.DeCaAddAmt.trim())).toString();
- result.LossMarked = fd125.LossMarked === 'Y' ? 'true' : fd125.LossMarked === 'N' ? 'false' : '';
- result.DocumentType = fd125.DocumentType.trim();
- result.DeductMarked = fd125.DeductMarked.trim();
- result.LongOrShort = fd125.LongOrShort === 'Y' ? 'true' : fd125.LongOrShort === 'N' ? 'false' : '';
- result.LegalPerson = LoginAuthentication.Instance.GroupKinbrNo;
- }
-
- return result;
- }
-
- public GetCheckElement(args: any): CheckConditionElements | null {
- const SinAmt = args.SinAmt.toString();
- let result: CheckConditionElements | null = null;
- const message: Message = {};
- this.InitFd(message);
- this.CommSend(message);
- message.Fd16 = '8980';
- message.Fd30 = args.DeAccount;
- message.Fd31 = args.CrAccount;
- message.Fd100_1 = SinAmt;
- message.Fd34 = args.DeAccountSeqn;
- if (!this.CallServer(message)) {
- this.ShowErrorMessageBox(this.GetError(message));
- return null;
- }
- if (message.Fd12 !== '0000') {
- this.ShowErrorMessageBox(this.GetError(message));
- return null;
- } else {
- result = {
- Account: args.Account,
- Money: args.Amt,
- OperationType: args.OperationType ? args.OperationType.trim() : '',
- Txcode: this.Page.TradeInfoData.GetTradeInfo(this.Page).TradeCode,
- CTSigns: args.CTSigns ? args.CTSigns.trim() : '',
- SinAmt: args.Amt.toString() && args.Amt !== 0 ? args.Amt.toString() : SinAmt,
- } as CheckConditionElements;
- const fd125 = Feild8583.SetAuthFd125(message.Fd125);
- fd125.CTSigns = args.CTSigns;
- fd125.SinAmt = SinAmt;
- result.DeAccountType = fd125.DeAccountType.trim();
- result.CrAccountType = fd125.CrAccountType.trim();
- result.DeAccountPro = fd125.DeAccountPro.trim();
- result.CrAccountPro = fd125.CrAccountPro.trim();
- result.DeIsOwn = fd125.DeIsOwn === 'Y' ? 'true' : 'false';
- result.CrIsOwn = fd125.CrIsOwn === 'Y' ? 'true' : 'false';
- result.DCIsSameCus = fd125.DCIsSameCus === 'Y' ? 'true' : 'false';
- result.DeCaAddAmt = fd125.DeCaAddAmt.trim();
- if (!SinAmt.trim()) SinAmt = '0.0';
- result.DeCaAddAmt = (parseFloat(fd125.DeCaAddAmt.trim()) + parseFloat(SinAmt)).toString();
- result.CrTrAddAmt = (parseFloat(fd125.CrTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
- result.DeTrAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
- result.SumAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt) + parseFloat(fd125.DeCaAddAmt.trim())).toString();
- result.LossMarked = fd125.LossMarked === 'Y' ? 'true' : fd125.LossMarked === 'N' ? 'false' : '';
- result.DocumentType = fd125.DocumentType.trim();
- result.DeductMarked = fd125.DeductMarked.trim();
- result.LongOrShort = fd125.LongOrShort === 'Y' ? 'true' : fd125.LongOrShort === 'N' ? 'false' : '';
- result.LegalPerson = LoginAuthentication.Instance.GroupKinbrNo;
- }
-
- return result;
- }
-
- public SetAuthCheckTitle(element: FrameworkElement, str: string): void {
- CheckManager.SetAuthCheckTitle(element, str);
- }
-
- // 获取菜单属性
- public GetTradeMetadata(name: string): string {
- const model = this.Page.TradeModel;
- if (!model || !model.Metadata.hasOwnProperty(name)) return '';
- return model.Metadata[name];
- }
-
- public CheckTradePower(powerCode: string): boolean {
- if (!TradePowerManager.Instance.IsPowerCheckByUser) return true;
- const list = TradePowerManager.Instance.GetTradePowerByCode(this.Page.TradeInfo.TradeCode);
- if (!list || list.length === 0) return false;
- return list.some((x: any) => x.RuleNo === powerCode);
- }
-
- private static _SignInStateList_: string[] = [
- "TellerTransfer",
- "TellerChecking",
- "TellerChecked",
- "TellerSignOut",
- ];
-
- public CheckWorkState(defV: boolean | null = null): boolean {
- const FLAG = TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("2ea3a7e6cfa04f89a335bf1e363295de");
- if (FLAG === "V24") {
- // 若给定了默认值,则需要检查当前交易菜单配置
- if (defV !== null) {
- let flag = false;
- if (!Boolean(this.GetTradeMetadata("isCheckWorkState"))) {
- flag = defV;
- }
- if (!flag) return true;
- }
- const TSGY = TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("TSGY");
- if (TSGY.includes(LoginUserInfo.TellerNo)) {
- return true;
- }
- const status = LoginUserInfo.GetUserInfo("WorkState");
- if (TradeAPIsHelper._SignInStateList_.includes(status)) return true;
- this.ShowWarnMessageBox("当前柜员非签到状态,请先签到...");
- return false;
- } else {
- return true;
- }
- }
-
- public CheckDFState(defV: boolean | null = null): boolean {
- const FLAG = TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("2ea3a7e6cfa04f89a335bf1e363295de");
- if (FLAG === "V0" && TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("TGJC") !== "true") {
- // 若给定了默认值,则需要检查当前交易菜单配置
- if (defV !== null) {
- let flag = false;
- if (!Boolean(this.GetTradeMetadata("isCheckDFState"))) {
- flag = defV;
- }
- if (!flag) return true;
- }
- const msg: Message = {};
- this.InitFd(msg);
- this.CommSend(msg);
- msg.Fd16 = "K119";
- msg.Fd92 = LoginUserInfo.TellerNo;
- if (!this.CallServer(msg)) {
- // 处理调用失败情况
- }
- // 后续逻辑需要根据实际业务补充
- return true;
- } else {
- return true;
- }
- }
- }
-
- export default TradeAPIsHelper;
|