1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198 |
- import SystemFunction from "@/views/front/develop/Library.Ext/Function/SystemFunction"
- import { PageBase } from "@/views/front/develop/Constract/ContractBase/PageBase";
- import Message from "../../Communication/Message";
- import { TradeManagerHandle } from "../../ServiceProxy.Ext/ServiceHelper/TradeManagerHandle";
- import LoginUserInfo from "@/views/front/platfrom/common/RunningParameters/LoginUserInfo";
- import { TradePowerManager } from "../../Library.Ext/TradeExtension/TradeMenu/TradePowerManager";
- import { LoginAuthentication } from "../../Library.Ext/TradeExtension/SSO/LoginAuthentication";
- import { CheckConditionElements } from "../Function/TradeCheck/CheckConditionElements";
- import { AuthConditionElement } from "../Function/TradeAuth/AuthConditionElement";
- import { CheckDataHelper } from "../Function/TradeCheck/CheckDataHelper";
- import { AuthDataHelper } from "../Function/TradeAuth/AuthDataHelper";
- import { WorkFlowHandle } from "@/views/front/platfrom/serviceproxy/ServiceHelper/WorkFlowHandle";
- import { AsksuperResultType, CheckManager } from "../Function/TradeCheck/CheckManager";
- import { TransitType } from "../../Communication/MessageHelper/TransitType";
- import { NotifyMessage } from "../../Library.Ext/Variables/NotifyMessage";
- import TransitErrorCodeMap from "../../Communication/MessageHelper/TransitErrorCodeMap";
- import Result from "../../Library.Ext/Variables/Result";
-
- import { SelectionManager } from "../../Library.Ext/TradeExtension/SelectionManager";
- import UserFunction from "../../Library.Ext/Function/UserFunction";
- import { TradeBusData } from "../../Library.Ext/TradeExtension/TradeInfo/TradeBusData";
- import TradeHandle from "../../ServiceProxy.Ext/ServiceHelper/TradeHandle";
- import { TradeInfoData } from "../../Library.Ext/TradeExtension/TradeInfo/TradeInfoData";
-
-
- class TradeAPIsHelper {
-
- public Page: PageBase;
-
- constructor(page: PageBase) {
- this.Page = page;
- }
-
-
-
- public InitFd(message: Message): void {
- SystemFunction.InitFd(message);
- }
-
- public CommSend(message: Message): void {
- SystemFunction.CommSend(this.Page, message);
- }
-
- public CommSend96(message: Message): void {
- SystemFunction.CommSend(this.Page, message);
- }
-
- public CallServer(message: Message): boolean {
- return SystemFunction.CallServer(message);
- }
-
- public CallAgn(message: Message): boolean {
- return SystemFunction.CallAgn(message);
- }
-
- public CallAgnTips(message: Message): boolean {
- return SystemFunction.CallAgnTips(message);
- }
-
- public CallAgnRun(message: Message): boolean {
- return SystemFunction.CallAgnRun(message);
- }
-
- public CallMobileBanking(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallMobileBanking");
- }
-
- public CallAgnCIS(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnCIS");
- }
-
- public CallAgnCard(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnCard");
- }
-
- public CallAgnHeat01(message: Message): boolean {
- return SystemFunction.DoTransit(message, "ransitType.CallAgnHeat01");
- }
-
- public CallAgnHeat02(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnHeat02");
- }
-
- public CallAgnHeat03(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnHeat03");
- }
-
- public CallAgnIDC(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnIDC");
- }
-
- public CallAgnIBPS(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnIBPS");
- }
-
- public CallAgnSHCZ(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnSHCZ");
- }
-
- public CallAgnIBDW(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnIBDW");
- }
-
- public CallAgnNew(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnNew");
- }
-
- public CallAgnCardEx(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnCardEx");
- }
-
- public CallAgnCartoon(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnCartoon");
- }
-
- public CallAgnHPF(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnHPF");
- }
-
- public CallAgnTV(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnTV");
- }
-
- public CallAgnFSSR(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnFSSR");
- }
-
- public CallAgnCLFJG(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnCLFJG");
- }
-
- public CallAgnHontax(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnHontax");
- }
-
- public CallAgnOrder(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnOrder");
- }
-
- public CallAgnMIS(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnMIS");
- }
-
- public CallAgnWXJJ_LP(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnWXJJ_LP");
- }
-
- public CallAgnWXJJ_CDX(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnWXJJ_CDX");
- }
-
- public CallAgnNetBank(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnNetBank");
- }
-
- public CallAgnMF01(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnMF01");
- }
-
- public CallAgnMF02(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnMF02");
- }
-
- public CallAgnWater(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnWater");
- }
-
- public CallAgnCnaps2(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnCnaps2");
- }
-
- public CallAgn_CZYYSW(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_CZYYSW");
- }
-
- public CallAgn_EasyPay(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_EasyPay");
- }
-
- public CallAgn_Ebill(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_Ebill");
- }
-
- public CallAgn_SDYCT(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_SDYCT");
- }
-
- public CallAgn_GasFee(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_GasFee");
- }
-
- public CallAgn_NJT(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_NJT");
- }
-
- public CallNoFileSys(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallNoFileSys");
- }
-
- public CallAgn_FGJWQ(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_FGJWQ");
- }
-
- public CallAgnNew_WL(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgnNew_WL");
- }
-
- public CallAgn_GGJ(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_GGJ");
- }
-
- public CallAgn_FGJWQ_HH(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_FGJWQ_HH");
- }
-
- public CallAgn_DF(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_DF");
- }
-
- public CallAgn_CW(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_CW");
- }
-
- public CallAgn_ZJJG(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_ZJJG");
- }
-
- public CallAgn_CKXT(message: Message): boolean {
- return SystemFunction.DoTransit(message, "TransitType.CallAgn_CKXT");
- }
-
- public CustomizeTransit(msg: Message, func: (x: any) => boolean | null): void {
-
- if (func === null) {
- msg.CustomizeTransitEntry = null;
- return;
- }
-
-
-
-
-
-
-
-
-
- }
-
-
-
-
-
-
-
-
-
-
-
- public GetError(msg: Message): string {
- return SystemFunction.GetError("");
- }
-
- public GetNotifyMessage(notify: string | NotifyMessage): string {
- if (typeof notify === 'string') {
- return TransitErrorCodeMap.GetInstance().GetErrorMessage(notify, 'notify');
- } else {
- return this.GetNotifyMessage(notify.toString());
- }
- }
-
- public CallComboBoxData(message: Message, formatString: string, defalutCombox: string = "Null"): Result {
- return SystemFunction.CallComboBoxData(message, formatString, defalutCombox);
-
- }
-
-
- public CallComboBoxDataSelector(code: string, tmp?: { [key: string]: string }): boolean {
-
-
-
- let dict: any;
- if (this.Page.TradeInfo.MainCode === undefined || this.Page.TradeInfo.MainCode === '') {
- dict = SelectionManager.Instance.PullSelection(code, tmp);
- } else {
- dict = SelectionManager.Instance.PullSelection(code, tmp, this.Page.TradeInfo.MainCode);
- }
- if (dict === null) return false;
-
- return true;
- }
-
- public SetAssertNotEmpty(flag: boolean): void {
-
- }
-
- public GetSelectedValue(): string {
-
- const combo = "";
- return UserFunction.GetSelectedValue(combo);
- }
-
- public SetSelectedValue(val: any): void {
- const combo = "";
- UserFunction.SetSelectedValue(combo, val);
- }
-
- public SetSelectedKey(key: string): void {
- const combo = "";
- 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 UserFunction.DateToBig("", date);
- }
-
-
-
- public Atoi(number: string): number {
- return SystemFunction.Atoi(number);
- }
-
-
- public Itoa(number: number, format: string): string {
- return SystemFunction.Itoa(this.Page, number, format);
- }
-
-
- public SubStr(sourceData: string, start: number, length: number): string {
- return SystemFunction.SubStr(this.Page, sourceData, start, length);
- }
-
-
- public Len(sourceData: string): number {
- return SystemFunction.Len(sourceData);
- }
-
-
- public Chr(number: number): string {
- return SystemFunction.Chr(number);
- }
-
-
- public Mod(number1: number, number2: number): number {
- return SystemFunction.Mod(number1, number2);
- }
-
-
- public Comma(sourceData: string, length: number): string {
- return SystemFunction.Comma(this.Page, sourceData, length);
- }
-
-
- public Val(sourceData: string, weight: number): number {
- return SystemFunction.Val(this.Page, sourceData, weight);
- }
-
-
- public RTrim(sourceData: string): string {
- return SystemFunction.RTrim(this.Page, sourceData);
- }
-
-
- public LTrim(sourceData: string): string {
- return SystemFunction.RTrim(this.Page, sourceData);
- }
-
-
- public Delspace(sourceData: string): string {
- return SystemFunction.Delspace(this.Page, sourceData);
- }
-
-
- public PadLeft(sourcedata: string, length: number, varChar: string = ' '): string {
- return SystemFunction.PadLeft(this.Page, sourcedata, length, varChar);
- }
-
-
- public PadRight(sourcedata: string, length: number, varChar: string = ' '): string {
- return SystemFunction.PadRight(this.Page, sourcedata, length, varChar);
- }
-
-
- 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));
- }
-
-
- public ChangeToCNY(num: number): string {
- return SystemFunction.ChangeToCNY(this.Page, num);
- }
-
-
- public SetSel(fileData: string, formatString: string): boolean {
- return SystemFunction.SetSel(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;
- }
-
-
- 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;
- }
-
-
- public AnalyzeTxtData(txt_RowSplit: string[], txt_ColumnSlit: string, txt_EnCode: string, isColumnHeader: boolean = true) {
- return SystemFunction.AnalyzeTxtData(txt_RowSplit, txt_ColumnSlit, txt_EnCode, isColumnHeader);
- }
-
- public AnalyseExcelData(RowCount: number = 0, columnCount: number = 0) {
- return SystemFunction.AnalyseExcelData(RowCount, columnCount);
- }
-
- public AnalyseDataTable(txt_RowSplit: string, txt_ColumnSlit: string): string {
- return this.AnalyseDataTable(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);
- }
-
-
-
- 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 {
-
-
-
-
-
-
-
-
-
- return true;
- }
-
-
-
-
-
-
-
-
-
-
- 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 = "";
- return comfirm[ret];
- }
-
-
-
-
-
-
-
-
-
-
-
- public ShowPopueMessageBox(content: any, caption: string = "提示信息"): void {
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 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;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- private FindAncestor<T>(element: any): T | null {
- let obj: any = null;
-
-
-
- return obj as T;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public GetAuthElement(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 = null;
- 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)) {
-
-
- return null;
- }
- if (message.Fd12 !== '0000') {
-
- return null;
- } else {
- result = {
- OperationType: OperationType ? OperationType.trim() : '',
- Txcode: 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 {
- let 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;
|