前端转vue
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

TradeAPIsHelper.ts 44KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. import SystemFunction from "@/views/front/develop/Library.Ext/Function/SystemFunction"
  2. import { PageBase } from "@/views/front/develop/Constract/ContractBase/PageBase";
  3. import Message from "../../Communication/Message";
  4. import { TradeManagerHandle } from "../../ServiceProxy.Ext/ServiceHelper/TradeManagerHandle";
  5. import LoginUserInfo from "@/views/front/platfrom/common/RunningParameters/LoginUserInfo";
  6. import { TradePowerManager } from "../../Library.Ext/TradeExtension/TradeMenu/TradePowerManager";
  7. import { LoginAuthentication } from "../../Library.Ext/TradeExtension/SSO/LoginAuthentication";
  8. import { CheckConditionElements } from "../Function/TradeCheck/CheckConditionElements";
  9. import { AuthConditionElement } from "../Function/TradeAuth/AuthConditionElement";
  10. import { CheckDataHelper } from "../Function/TradeCheck/CheckDataHelper";
  11. import { AuthDataHelper } from "../Function/TradeAuth/AuthDataHelper";
  12. import { WorkFlowHandle } from "@/views/front/platfrom/serviceproxy/ServiceHelper/WorkFlowHandle";
  13. import { AsksuperResultType, CheckManager } from "../Function/TradeCheck/CheckManager";
  14. class TradeAPIsHelper {
  15. // ctor & Property
  16. public Page: PageBase;
  17. constructor(page: PageBase) {
  18. this.Page = page;
  19. }
  20. // 封装交易API函数
  21. // Message操作
  22. public InitFd(message: Message): void {
  23. SystemFunction.InitFd(message);
  24. }
  25. public CommSend(message: Message): void {
  26. SystemFunction.CommSend(this.Page, message);
  27. }
  28. public CommSend96(message: Message): void {
  29. SystemFunction.CommSend(this.Page, message);
  30. }
  31. public CallServer(message: Message): boolean {
  32. return SystemFunction.CallServer(message);
  33. }
  34. public CallAgn(message: Message): boolean {
  35. return SystemFunction.CallAgn(message);
  36. }
  37. public CallAgnTips(message: Message): boolean {
  38. return SystemFunction.CallAgnTips(message);
  39. }
  40. public CallAgnRun(message: Message): boolean {
  41. return SystemFunction.CallAgnRun(message);
  42. }
  43. public CallMobileBanking(message: Message): boolean {
  44. return SystemFunction.DoTransit(message, TransitType.CallMobileBanking);
  45. }
  46. public CallAgnCIS(message: Message): boolean {
  47. return this.Page.DoTransit(message, TransitType.CallAgnCIS);
  48. }
  49. public CallAgnCard(message: Message): boolean {
  50. return this.Page.DoTransit(message, TransitType.CallAgnCard);
  51. }
  52. public CallAgnHeat01(message: Message): boolean {
  53. return this.Page.DoTransit(message, TransitType.CallAgnHeat01);
  54. }
  55. public CallAgnHeat02(message: Message): boolean {
  56. return this.Page.DoTransit(message, TransitType.CallAgnHeat02);
  57. }
  58. public CallAgnHeat03(message: Message): boolean {
  59. return this.Page.DoTransit(message, TransitType.CallAgnHeat03);
  60. }
  61. public CallAgnIDC(message: Message): boolean {
  62. return this.Page.DoTransit(message, TransitType.CallAgnIDC);
  63. }
  64. public CallAgnIBPS(message: Message): boolean {
  65. return this.Page.DoTransit(message, TransitType.CallAgnIBPS);
  66. }
  67. public CallAgnSHCZ(message: Message): boolean {
  68. return this.Page.DoTransit(message, TransitType.CallAgnSHCZ);
  69. }
  70. public CallAgnIBDW(message: Message): boolean {
  71. return this.Page.DoTransit(message, TransitType.CallAgnIBDW);
  72. }
  73. public CallAgnNew(message: Message): boolean {
  74. return this.Page.DoTransit(message, TransitType.CallAgnNew);
  75. }
  76. public CallAgnCardEx(message: Message): boolean {
  77. return this.Page.DoTransit(message, TransitType.CallAgnCardEx);
  78. }
  79. public CallAgnCartoon(message: Message): boolean {
  80. return this.Page.DoTransit(message, TransitType.CallAgnCartoon);
  81. }
  82. public CallAgnHPF(message: Message): boolean {
  83. return this.Page.DoTransit(message, TransitType.CallAgnHPF);
  84. }
  85. public CallAgnTV(message: Message): boolean {
  86. return this.Page.DoTransit(message, TransitType.CallAgnTV);
  87. }
  88. public CallAgnFSSR(message: Message): boolean {
  89. return this.Page.DoTransit(message, TransitType.CallAgnFSSR);
  90. }
  91. public CallAgnCLFJG(message: Message): boolean {
  92. return this.Page.DoTransit(message, TransitType.CallAgnCLFJG);
  93. }
  94. public CallAgnHontax(message: Message): boolean {
  95. return this.Page.DoTransit(message, TransitType.CallAgnHontax);
  96. }
  97. public CallAgnOrder(message: Message): boolean {
  98. return this.Page.DoTransit(message, TransitType.CallAgnOrder);
  99. }
  100. public CallAgnMIS(message: Message): boolean {
  101. return this.Page.DoTransit(message, TransitType.CallAgnMIS);
  102. }
  103. public CallAgnWXJJ_LP(message: Message): boolean {
  104. return this.Page.DoTransit(message, TransitType.CallAgnWXJJ_LP);
  105. }
  106. public CallAgnWXJJ_CDX(message: Message): boolean {
  107. return this.Page.DoTransit(message, TransitType.CallAgnWXJJ_CDX);
  108. }
  109. public CallAgnNetBank(message: Message): boolean {
  110. return this.Page.DoTransit(message, TransitType.CallAgnNetBank);
  111. }
  112. public CallAgnMF01(message: Message): boolean {
  113. return this.Page.DoTransit(message, TransitType.CallAgnMF01);
  114. }
  115. public CallAgnMF02(message: Message): boolean {
  116. return this.Page.DoTransit(message, TransitType.CallAgnMF02);
  117. }
  118. public CallAgnWater(message: Message): boolean {
  119. return this.Page.DoTransit(message, TransitType.CallAgnWater);
  120. }
  121. public CallAgnCnaps2(message: Message): boolean {
  122. return this.Page.DoTransit(message, TransitType.CallAgnCnaps2);
  123. }
  124. public CallAgn_CZYYSW(message: Message): boolean {
  125. return this.Page.DoTransit(message, TransitType.CallAgn_CZYYSW);
  126. }
  127. public CallAgn_EasyPay(message: Message): boolean {
  128. return this.Page.DoTransit(message, TransitType.CallAgn_EasyPay);
  129. }
  130. public CallAgn_Ebill(message: Message): boolean {
  131. return this.Page.DoTransit(message, TransitType.CallAgn_Ebill);
  132. }
  133. public CallAgn_SDYCT(message: Message): boolean {
  134. return this.Page.DoTransit(message, TransitType.CallAgn_SDYCT);
  135. }
  136. public CallAgn_GasFee(message: Message): boolean {
  137. return this.Page.DoTransit(message, TransitType.CallAgn_GasFee);
  138. }
  139. public CallAgn_NJT(message: Message): boolean {
  140. return this.Page.DoTransit(message, TransitType.CallAgn_NJT);
  141. }
  142. public CallNoFileSys(message: Message): boolean {
  143. return this.Page.DoTransit(message, TransitType.CallNoFileSys);
  144. }
  145. public CallAgn_FGJWQ(message: Message): boolean {
  146. return this.Page.DoTransit(message, TransitType.CallAgn_FGJWQ);
  147. }
  148. public CallAgnNew_WL(message: Message): boolean {
  149. return this.Page.DoTransit(message, TransitType.CallAgnNew_WL);
  150. }
  151. public CallAgn_GGJ(message: Message): boolean {
  152. return this.Page.DoTransit(message, TransitType.CallAgn_GGJ);
  153. }
  154. public CallAgn_FGJWQ_HH(message: Message): boolean {
  155. return this.Page.DoTransit(message, TransitType.CallAgn_FGJWQ_HH);
  156. }
  157. public CallAgn_DF(message: Message): boolean {
  158. return this.Page.DoTransit(message, TransitType.CallAgn_DF);
  159. }
  160. public CallAgn_CW(message: Message): boolean {
  161. return this.Page.DoTransit(message, TransitType.CallAgn_CW);
  162. }
  163. public CallAgn_ZJJG(message: Message): boolean {
  164. return this.Page.DoTransit(message, TransitType.CallAgn_ZJJG);
  165. }
  166. public CallAgn_CKXT(message: Message): boolean {
  167. return this.Page.DoTransit(message, TransitType.CallAgn_CKXT);
  168. }
  169. public CustomizeTransit(msg: Message, func: (x: any) => boolean | null): void {
  170. // 取消自定义处理
  171. if (func === null) {
  172. msg.CustomizeTransitEntry = null;
  173. return;
  174. }
  175. msg.CustomizeTransitEntry = (x: any) => {
  176. try {
  177. return func(x);
  178. } catch (ex) {
  179. console.error('TradeAPIsHelper.CustomizeTransit:执行异常!', ex);
  180. x.Error = (ex as Error).message;
  181. return false;
  182. }
  183. };
  184. }
  185. // 控件辅助操作
  186. public AddItemOfSelecteAll(element: ComboBox, value: string = ''): boolean {
  187. return SystemFunction.AddItemOfSelecteAll(this.Page, element, value);
  188. }
  189. public RemoveItemOfSelecteAll(element: ComboBox): boolean {
  190. return SystemFunction.RemoveItemOfSelecteAll(this.Page, element);
  191. }
  192. public GetError(msg: Message): string {
  193. return SystemFunction.GetError(this.Page, msg);
  194. }
  195. public GetNotifyMessage(notify: string | NotifyMessage): string {
  196. if (typeof notify === 'string') {
  197. return TransitErrorCodeMap.GetInstance().GetErrorMessage(notify, 'notify');
  198. } else {
  199. return this.GetNotifyMessage(notify.toString());
  200. }
  201. }
  202. public CallComboBoxData(comboBox: ComboBox, message: Message, formatString: string, defalutCombox: string = "Null"): Result {
  203. return SystemFunction.CallComboBoxData(this.Page, comboBox, message, formatString, defalutCombox);
  204. }
  205. public CallComboBoxDataSelector(selector: Selector, code: string, arguments?: { [key: string]: string }): boolean {
  206. if (selector === null) return false;
  207. selector.Items.clear();
  208. let dict: any;
  209. if (this.Page.TradeInfo.MainCode === undefined || this.Page.TradeInfo.MainCode === '') {
  210. dict = SelectionManager.Instance.PullSelection(code, arguments);
  211. } else {
  212. dict = SelectionManager.Instance.PullSelection(code, arguments, this.Page.TradeInfo.MainCode);
  213. }
  214. if (dict === null) return false;
  215. selector.SetItems(dict);
  216. return true;
  217. }
  218. public SetAssertNotEmpty(element: FrameworkElement, flag: boolean): void {
  219. SystemFunction.SetAssertNotEmpty(this.Page, element, flag);
  220. }
  221. public GetSelectedValue(combo: ComboBox): string {
  222. return UserFunction.GetSelectedValue(combo);
  223. }
  224. public SetSelectedValue(combo: ComboBox, val: any): void {
  225. UserFunction.SetSelectedValue(combo, val);
  226. }
  227. public SetSelectedKey(combo: ComboBox, key: string): void {
  228. UserFunction.SetSelectedKey(combo, key);
  229. }
  230. public ToDecimal(src: string): number {
  231. return UserFunction.ToDecimal(src);
  232. }
  233. public ToDateTime(src: string): Date {
  234. return UserFunction.ToDateTime(src);
  235. }
  236. public DateToBig(date: string): string[] {
  237. return this.Page.DateToBig(date);
  238. }
  239. // 字符串数字处理类
  240. // 转换字符串为数字 atoi(string)
  241. public Atoi(number: string): number {
  242. return SystemFunction.Atoi(this.Page, number);
  243. }
  244. // 转换数字为字符串 itoa(number,string)
  245. public Itoa(number: number, format: string): string {
  246. return SystemFunction.Itoa(this.Page, number, format);
  247. }
  248. // 截取一个子串 substr(string,number,number)
  249. public SubStr(sourceData: string, start: number, length: number): string {
  250. return SystemFunction.SubStr(this.Page, sourceData, start, length);
  251. }
  252. // 得到字符串的长度 len(string)
  253. public Len(sourceData: string): number {
  254. return SystemFunction.Len(this.Page, sourceData);
  255. }
  256. // 把指定的ascii码值转换为字符串 chr(number)
  257. public Chr(number: number): string {
  258. return SystemFunction.Chr(this.Page, number);
  259. }
  260. // 求两个整数的余 mod(number1,number)
  261. public Mod(number1: number, number2: number): number {
  262. return SystemFunction.Mod(this.Page, number1, number2);
  263. }
  264. // 把一个数字型字符串转换为','分割的形式 comma(string,[number])
  265. public Comma(sourceData: string, length: number): string {
  266. return SystemFunction.Comma(this.Page, sourceData, length);
  267. }
  268. // 得到数字字符串对应的数值 val(string,[number])
  269. public Val(sourceData: string, weight: number): number {
  270. return SystemFunction.Val(this.Page, sourceData, weight);
  271. }
  272. // 去掉尾部空格 rtrim(string)
  273. public RTrim(sourceData: string): string {
  274. return SystemFunction.RTrim(this.Page, sourceData);
  275. }
  276. // 去掉左边空格 ltrim(string)
  277. public LTrim(sourceData: string): string {
  278. return SystemFunction.LTrim(this.Page, sourceData);
  279. }
  280. // 去掉所有空格,包括字符串中间的空格 delspace(string)
  281. public Delspace(sourceData: string): string {
  282. return SystemFunction.Delspace(this.Page, sourceData);
  283. }
  284. // 左补齐参数字符 PadLeft(string,int,char)
  285. public PadLeft(sourcedata: string, length: number, varChar: string = ' '): string {
  286. return SystemFunction.PadLeft(this.Page, sourcedata, length, varChar);
  287. }
  288. // 右补齐参数字符 PadRight(string,length,var)
  289. public PadRight(sourcedata: string, length: number, varChar: string = ' '): string {
  290. return SystemFunction.PadRight(this.Page, sourcedata, length, varChar);
  291. }
  292. // 以某个字符构建某长度的字符串 Space(lenth,char)
  293. public Space(lenght: number, c: string = ' '): string {
  294. return SystemFunction.Space(this.Page, lenght, c);
  295. }
  296. // 计算两个日期直接的绝对差值(天数)
  297. public Func(fDate: string, sDate: string): number {
  298. const startDate = new Date(
  299. parseInt(fDate.substring(0, 4)),
  300. parseInt(fDate.substring(4, 6)) - 1,
  301. parseInt(fDate.substring(6))
  302. );
  303. const endDate = new Date(
  304. parseInt(sDate.substring(0, 4)),
  305. parseInt(sDate.substring(4, 6)) - 1,
  306. parseInt(sDate.substring(6))
  307. );
  308. const timeSpan = endDate.getTime() - startDate.getTime();
  309. return Math.floor(timeSpan / (1000 * 60 * 60 * 24));
  310. }
  311. // 将数字类型转换成大写金额字符串 ChangeToCNY(decimal)
  312. public ChangeToCNY(num: number): string {
  313. return SystemFunction.ChangeToCNY(this.Page, num);
  314. }
  315. // 按格式解析返回字串,给combox添加项
  316. public SetSel(comboBox: ComboBox, fileData: string, formatString: string): boolean {
  317. return SystemFunction.SetSel(this.Page, comboBox, fileData, formatString);
  318. }
  319. // 非法汉字字符检查
  320. public CheckHalf(str: string): boolean {
  321. return true;
  322. }
  323. // 格式化金额数值:千分位、去空格(左对齐)
  324. public FormatAMT(amtVal: number): string {
  325. return this.Delspace(this.Comma(amtVal.toString(), 17));
  326. }
  327. // 将数字转换成中文
  328. private static unit: string[] = ["", "十", "百", "千", "万", "十万", "百万", "千万", "亿", "十亿", "百亿", "千亿", "万亿"];
  329. private static unit_T: string[] = ["", "拾", "佰", "仟", "萬", "拾萬", "佰萬", "仟萬", "亿", "拾亿", "佰亿", "仟亿", "萬亿"];
  330. public ChangeToCI(value: number, isSimple: boolean = true, hasUnit: boolean = false): string {
  331. let ret = '';
  332. const data = Math.abs(value).toString();
  333. for (let i = 0; i < data.length; i++) {
  334. const item = data[i];
  335. let c = '';
  336. switch (item) {
  337. case '0':
  338. c = isSimple ? "零" : "零";
  339. break;
  340. case '1':
  341. c = isSimple ? "一" : "壹";
  342. break;
  343. case '2':
  344. c = isSimple ? "二" : "贰";
  345. break;
  346. case '3':
  347. c = isSimple ? "三" : "叁";
  348. break;
  349. case '4':
  350. c = isSimple ? "四" : "肆";
  351. break;
  352. case '5':
  353. c = isSimple ? "五" : "伍";
  354. break;
  355. case '6':
  356. c = isSimple ? "六" : "陆";
  357. break;
  358. case '7':
  359. c = isSimple ? "七" : "柒";
  360. break;
  361. case '8':
  362. c = isSimple ? "八" : "捌";
  363. break;
  364. case '9':
  365. c = isSimple ? "九" : "玖";
  366. break;
  367. default:
  368. throw new Error("ChangeToCI:参数异常!");
  369. }
  370. ret += c;
  371. if (hasUnit) {
  372. // 加载单位
  373. ret += isSimple ? TradeAPIsHelper.unit[data.length - i - 1] : TradeAPIsHelper.unit_T[data.length - i - 1];
  374. }
  375. }
  376. return ret;
  377. }
  378. // 将汉字(零,一 ……十二转换为阿拉伯数字1至12)
  379. public ChangeToNum(value: string): number {
  380. let c = -1;
  381. switch (value) {
  382. case "零":
  383. c = 0;
  384. break;
  385. case "一":
  386. c = 1;
  387. break;
  388. case "二":
  389. c = 2;
  390. break;
  391. case "三":
  392. c = 3;
  393. break;
  394. case "四":
  395. c = 4;
  396. break;
  397. case "五":
  398. c = 5;
  399. break;
  400. case "六":
  401. c = 6;
  402. break;
  403. case "七":
  404. c = 7;
  405. break;
  406. case "八":
  407. c = 8;
  408. break;
  409. case "九":
  410. c = 9;
  411. break;
  412. case "十":
  413. c = 10;
  414. break;
  415. case "十一":
  416. c = 11;
  417. break;
  418. case "十二":
  419. c = 12;
  420. break;
  421. default:
  422. break;
  423. }
  424. return c;
  425. }
  426. // 转换证件类型
  427. private static _LicKindList_: { [key: string]: string } | null = null;
  428. public ChgLicKind(kind: string): string {
  429. if (TradeAPIsHelper._LicKindList_ === null) {
  430. TradeAPIsHelper._LicKindList_ = SelectionManager.Instance.PullSelection("C004", null);
  431. const c003Data = SelectionManager.Instance.PullSelection("C003", null);
  432. Object.entries(c003Data).forEach(([key, value]) => {
  433. TradeAPIsHelper._LicKindList_[key] = value;
  434. });
  435. }
  436. if (TradeAPIsHelper._LicKindList_.hasOwnProperty(kind)) {
  437. return TradeAPIsHelper._LicKindList_[kind];
  438. }
  439. const item = Object.entries(TradeAPIsHelper._LicKindList_).find(([_, value]) => value === kind);
  440. return item ? item[0] : kind;
  441. }
  442. // 解析文本文件、excel文件、DataTable文件
  443. public AnalyzeTxtData(txt_RowSplit: string[], txt_ColumnSlit: string, txt_EnCode: string, isColumnHeader: boolean = true): DataTable {
  444. return SystemFunction.AnalyzeTxtData(txt_RowSplit, txt_ColumnSlit, txt_EnCode, isColumnHeader);
  445. }
  446. public AnalyseExcelData(RowCount: number = 0, columnCount: number = 0): DataTable {
  447. return SystemFunction.AnalyseExcelData(RowCount, columnCount);
  448. }
  449. public AnalyseDataTable(data: DataTable, txt_RowSplit: string, txt_ColumnSlit: string): string {
  450. return this.AnalyseDataTable(data, txt_RowSplit, txt_ColumnSlit);
  451. }
  452. // 文件操作相关
  453. public Shell(cmd: string): boolean {
  454. return TradeHandle.ExcuteShell(cmd);
  455. }
  456. public Getfiletxt(fileName: string): string {
  457. return SystemFunction.Getfiletxt(fileName);
  458. }
  459. public Savefiletxt(fileName: string, fileContent: string, append: boolean): boolean {
  460. return SystemFunction.Savefiletxt(fileName, fileContent, append);
  461. }
  462. // MessageBox-弹出消息框
  463. // 消息提示默认值
  464. private static readonly IsCoverAll = true;
  465. private static readonly IsReverse = true;
  466. private static readonly Direction = 3;
  467. private static readonly AnimationEnable = false;
  468. // 输入信息提示
  469. public ShowTip(message: string): boolean {
  470. const current: FrameworkElement = this.Page;
  471. const flag = this.Page.GetEnableFocusControl();
  472. let fm: any;
  473. if (flag) {
  474. fm = this.Page.GetManagerInstance();
  475. if (fm !== null) {
  476. current = fm.CurrentFocusedElement;
  477. }
  478. }
  479. return this.ShowTipElement(current, message);
  480. }
  481. public ShowTipElement(target: UIElement, message: string): boolean {
  482. return target.ShowTip(message);
  483. }
  484. public ShowTipPlacement(target: UIElement, message: string, placement: any = 'Bottom'): boolean {
  485. return target.ShowTip(placement, message);
  486. }
  487. // 功能选择消息提示
  488. public ShowComfirmBox(message: string, comfirm: string[], defaultfocus: string | null = null): string {
  489. let def = 1;
  490. if (comfirm.includes(defaultfocus as string)) {
  491. def = comfirm.indexOf(defaultfocus as string) + 1;
  492. }
  493. const ret = this.Page.ShowComfirmBox(message, comfirm, def);
  494. return comfirm[ret];
  495. }
  496. @Obsolete
  497. public ShowComfirmBoxKey(message: string, comfirm: { [key: string]: string }, defaultfocus: string = 'None'): string {
  498. return this.Page.ShowPageMessageBoxExt(message, comfirm, defaultfocus);
  499. }
  500. public ShowComfirmBoxParams(message: string, ...comfirm: string[]): number {
  501. return this.Page.ShowComfirmBox(message, comfirm);
  502. }
  503. // 推送消息提示
  504. public ShowPopueMessageBox(content: any, caption: string = "提示信息"): void {
  505. // 原函数体为空
  506. }
  507. // 默认选择提示
  508. public ShowQuestionMessageBox(content: any, caption: string = "询问信息", focuResult: string = "Yes", results: string[] = ["Yes", "No"]): string {
  509. const result = this.Page.ShowPageMessageBoxMetro(
  510. content,
  511. caption,
  512. null,
  513. this.ConvertMessageBoxResultToStr(focuResult),
  514. TradeAPIsHelper.Direction,
  515. TradeAPIsHelper.IsReverse,
  516. TradeAPIsHelper.IsCoverAll,
  517. TradeAPIsHelper.AnimationEnable,
  518. this.ConvertMessageBoxButton(results)
  519. );
  520. return this.ConvertStrToMessageBoxResult(result);
  521. }
  522. public ShowQuestionMessageBoxCustom(content: any, results: string[], defaultIndex: number, caption: string = "询问信息"): string {
  523. const defaultValue = results.length > defaultIndex ? results[defaultIndex] : results[0];
  524. return this.Page.ShowPageMessageBoxMetro(
  525. content,
  526. caption,
  527. null,
  528. defaultValue,
  529. TradeAPIsHelper.Direction,
  530. TradeAPIsHelper.IsReverse,
  531. TradeAPIsHelper.IsCoverAll,
  532. TradeAPIsHelper.AnimationEnable,
  533. results
  534. );
  535. }
  536. // 场景信息提醒提示
  537. public ShowSuccessMessageBox(content: any | null = null, caption: string = "业务办理成功"): string {
  538. const image = this.Page.GetResource("MessageBoxMetroSuccess");
  539. const result = this.Page.ShowPageMessageBoxMetro(
  540. content,
  541. caption,
  542. image,
  543. this.ConvertMessageBoxResultToStr("OK"),
  544. TradeAPIsHelper.Direction,
  545. TradeAPIsHelper.IsReverse,
  546. TradeAPIsHelper.IsCoverAll,
  547. TradeAPIsHelper.AnimationEnable,
  548. this.ConvertMessageBoxButton(["OK"])
  549. );
  550. return this.ConvertStrToMessageBoxResult(result);
  551. }
  552. public ShowInfoMessageBox(content: any | null = null, caption: string = "提示信息"): string {
  553. const image = this.Page.GetResource("MessageBoxMetroInfo");
  554. const result = this.Page.ShowPageMessageBoxMetro(
  555. content,
  556. caption,
  557. image,
  558. this.ConvertMessageBoxResultToStr("OK"),
  559. TradeAPIsHelper.Direction,
  560. TradeAPIsHelper.IsReverse,
  561. TradeAPIsHelper.IsCoverAll,
  562. TradeAPIsHelper.AnimationEnable,
  563. this.ConvertMessageBoxButton(["OK"])
  564. );
  565. return this.ConvertStrToMessageBoxResult(result);
  566. }
  567. public ShowErrorMessageBox(content: any | null = null, caption: string = "错误信息"): string {
  568. const image = this.Page.GetResource("MessageBoxMetroError");
  569. const result = this.Page.ShowPageMessageBoxMetro(
  570. content,
  571. caption,
  572. image,
  573. this.ConvertMessageBoxResultToStr("OK"),
  574. TradeAPIsHelper.Direction,
  575. TradeAPIsHelper.IsReverse,
  576. TradeAPIsHelper.IsCoverAll,
  577. TradeAPIsHelper.AnimationEnable,
  578. this.ConvertMessageBoxButton(["OK"])
  579. );
  580. return this.ConvertStrToMessageBoxResult(result);
  581. }
  582. public ShowWarnMessageBox(content: any | null = null, caption: string = "警告信息"): string {
  583. const image = this.Page.GetResource("MessageBoxMetroWarn");
  584. const result = this.Page.ShowPageMessageBoxMetro(
  585. content,
  586. caption,
  587. image,
  588. this.ConvertMessageBoxResultToStr("OK"),
  589. TradeAPIsHelper.Direction,
  590. TradeAPIsHelper.IsReverse,
  591. TradeAPIsHelper.IsCoverAll,
  592. TradeAPIsHelper.AnimationEnable,
  593. this.ConvertMessageBoxButton(["OK"])
  594. );
  595. return this.ConvertStrToMessageBoxResult(result);
  596. }
  597. // 转换方法
  598. private ConvertStrToMessageBoxResult(str: string | null): string {
  599. str = str || '';
  600. switch (str.trim()) {
  601. case "取消":
  602. return "Cancel";
  603. case "否":
  604. return "No";
  605. case "确定":
  606. return "OK";
  607. case "是":
  608. return "Yes";
  609. default:
  610. return "None";
  611. }
  612. }
  613. private ConvertMessageBoxResultToStr(result: string): string {
  614. switch (result) {
  615. case "Cancel":
  616. return "取消";
  617. case "No":
  618. return "否";
  619. case "OK":
  620. return "确定";
  621. case "Yes":
  622. return "是";
  623. default:
  624. return "未知";
  625. }
  626. }
  627. private ConvertMessageBoxButton(msg: string[]): string[] {
  628. return msg;
  629. }
  630. // DataBox相关函数
  631. public InitDataBox(databox: DataBox): void {
  632. databox.InitDataBox();
  633. }
  634. public GetDataForDataTable(databox: DataBox): DataTable {
  635. return databox.GetDataForDataTable();
  636. }
  637. public GetDataForString(databox: DataBox): string {
  638. return databox.GetDataForString();
  639. }
  640. public BindDataTable(databox: DataBox, dtSource: DataTable): void {
  641. databox.BindDataTable(dtSource);
  642. }
  643. public DataBinding(databox: DataBox, fileData: string, ...columnName: string[]): void {
  644. databox.DataBinding(fileData, columnName);
  645. }
  646. public DataBindingXML(databox: DataBox, fileData: string, nodeName: string, ...columnName: string[]): void {
  647. const str = databox.AnalyzeXMLtoStr(fileData, nodeName);
  648. databox.DataBinding(str || fileData, columnName);
  649. }
  650. public DataBindingLevel(databox: DataBox, fileData: string, level: any, ...columnNames: string[]): void {
  651. databox.DataBinding(fileData, level, columnNames);
  652. }
  653. public SetColumnsHeader(databox: DataBox, columnIndex: number, header: string): void {
  654. databox.SetColumnsHeader(columnIndex, header);
  655. }
  656. public SetColumnsWidth(databox: DataBox, columnIndex: number, width: number): void {
  657. databox.SetColumnsWidth(columnIndex, width);
  658. }
  659. public SetColumnsVisible(databox: DataBox, columnIndex: number, visible: boolean): void {
  660. databox.SetColumnsVisible(columnIndex, visible);
  661. }
  662. public SetColumnsFormat(databox: DataBox, columnIndex: number, format: string): void {
  663. databox.SetColumnsFormat(columnIndex, format);
  664. }
  665. public SetColumnsAlign(databox: DataBox, columnIndex: number, align: string): void {
  666. databox.SetColumnsAlign(columnIndex, align);
  667. }
  668. public GetSelectMultiRows(databox: DataBox): any[] {
  669. return databox.GetSelectMultiRows();
  670. }
  671. public GetSelectSingleRow(databox: DataBox): any {
  672. return databox.GetSelectSingleRow();
  673. }
  674. public GetSelectRowValue(databox: DataBox, hasRowIndex: boolean = true): string[] {
  675. let ret = databox.GetSelectRowValue();
  676. if (!hasRowIndex && ret && ret.length > 1) {
  677. ret = ret.slice(1);
  678. }
  679. return ret;
  680. }
  681. public SetSelDataBox(databox: DataBox, colName: string, dic: { [key: string]: string }): void {
  682. databox.SetSel(colName, dic);
  683. }
  684. public AddColumn(databox: DataBox, column: any): void {
  685. databox.AddColumn(column);
  686. }
  687. public AddHyperlinkColumn(databox: DataBox, colName: string, click: (event: any) => void, hotkey: string = 'None'): void {
  688. databox.AddHyperlinkColumn(colName, click, hotkey);
  689. }
  690. public AddRowDataBox(databox: DataBox, newRow: any): boolean {
  691. return databox.AddRow(newRow);
  692. }
  693. public AddRowValues(databox: DataBox, ...values: any[]): boolean {
  694. return databox.AddRow(values);
  695. }
  696. public UpdateRow(databox: DataBox, ...values: any[]): boolean {
  697. return databox.UpdateRow(values);
  698. }
  699. public DeleteSelectRows(databox: DataBox): boolean {
  700. return databox.DeleteSelectRows();
  701. }
  702. // Combobox控件相关
  703. public AddItems(target: any, items: any[]): void {
  704. target.AddItems(items);
  705. }
  706. public SetItems(target: any, items: any[]): void {
  707. target.SetItems(items);
  708. }
  709. public GetSelectedKey(target: any): string {
  710. return target.GetSelectedKey();
  711. }
  712. // 设置焦点相关
  713. public SetFocus(element: FrameworkElement | null = null): void {
  714. this.Page.SetFocus(element);
  715. }
  716. // 检查账号是否是卡
  717. public CheckCardBin(acno: string): boolean {
  718. return this.Page.CheckCardBin(acno);
  719. }
  720. // 打印相关
  721. public CreateSpecialMarkPrint(pt: PrintTypes, left: number, top: number, markText: string): PrintContainer {
  722. const tb = new TemplateBase();
  723. tb.PrintType = pt;
  724. tb.DrawingSpecialMark(left, top, markText);
  725. return tb;
  726. }
  727. public CreateSpecialMarkPrintElement(pt: PrintTypes, left: number, top: number, element: UIElement): PrintContainer {
  728. const tb = new TemplateBase();
  729. tb.PrintType = pt;
  730. tb.DrawingSpecialMarkWithElement(left, top, element);
  731. return tb;
  732. }
  733. public PrintCertificate(authForms: PrintContainer[]): void {
  734. this.Page.PrintCertificate(authForms);
  735. // add by chuhai 清空前端流水,避免交易不关闭导致流水重复。
  736. this.Page.ClearSerialNumber();
  737. }
  738. public PrintAcdtl_1(message: Message): string {
  739. return '';
  740. }
  741. public PrintAcdtl_hst(message: Message): string {
  742. return '';
  743. }
  744. public PrintAcdtl_h(message: Message): string {
  745. return '';
  746. }
  747. public Print_Sq(message: Message): string {
  748. return '';
  749. }
  750. public PrintReport(formatMessage: string, reportURI: string, paraDic: { [key: string]: string } | null): void {
  751. let sb = formatMessage;
  752. if (paraDic) {
  753. sb += '\n[parameters]\n';
  754. for (const [key, value] of Object.entries(paraDic)) {
  755. sb += `${key}=${value}\n`;
  756. }
  757. sb += ';';
  758. }
  759. const re = new ReportEntity(reportURI);
  760. // 补偿PrintAttributes给ReportEntity
  761. let pa = PrintContainerExt.GetPrintElement(this.Page);
  762. if (!pa) pa = this.Page.GetPrintAttributes();
  763. PrintContainerExt.SetPrintElement(re, pa);
  764. re.Analyze(sb);
  765. re.Print();
  766. }
  767. // 查找上层Ipage
  768. private FindAncestor<T>(element: any): T | null {
  769. let obj: any = null;
  770. for (obj = this.Page.VisualTreeHelper.GetParent(element); !(obj instanceof T); obj = this.Page.VisualTreeHelper.GetParent(obj)) {
  771. if (obj === null) break;
  772. }
  773. return obj as T;
  774. }
  775. // 授权/复核
  776. public RestoreTradePage(serialid: string, busData: TradeBusData): void {
  777. this.Page.ShowTradeTab(serialid, (page: IPage) => {
  778. this.Page.Dispatcher.BeginInvoke(() => {
  779. const resultKey = busData.hasOwnProperty('SuperFlag') ? 'SuperFlag' : 'AuthFlag';
  780. let resultflag = false;
  781. if (busData[resultKey]) {
  782. resultflag = busData[resultKey] === 'true';
  783. }
  784. // 没有找到page,说明已经关闭过前端软件
  785. if (page === null) {
  786. // target.ShowErrorMessageBox("此任务的交易已丢失!");
  787. // 如果target是消息推送过来的,用target.ShowErrorMessageBox会报错,暂时用这个代替
  788. this.ShowInfoMessageBox("此任务的交易已丢失,请重新做该交易");
  789. // MessageBox.Show("此任务的交易已丢失,请重新做该交易", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
  790. let deletereason = '';
  791. if (resultKey === 'SuperFlag') {
  792. deletereason = 'SuperFaild';
  793. } else if (resultKey === 'AuthFlag') {
  794. deletereason = 'AuthFaild';
  795. } else {
  796. deletereason = 'TellerDelete';
  797. }
  798. // 如果失败,不管是找没找到能还原的界面,因为工作流配置为不非环形流程,都需要删除流程,tradepage的流水号serialid也不用更新,
  799. // 如果还原了界面,客户还可以使用原来的流水号再提交申请,这个由服务端做了处理。
  800. WorkFlowHandle.deleteProcessInsById(busData['ProcessId'], deletereason); // TellerDelete只是做为删除流程实例原因的描述
  801. } else {
  802. // TabItem item = page.GetCurrentTabItem();
  803. page.GetTradeInfoData().SetTradeBus(busData); // .SetTradeData(data);
  804. // CheckManager c = item as CheckManager;
  805. // AuthManager a = item as AuthManager;
  806. let t: AsksuperResultType = 'Failed';
  807. if (resultflag) {
  808. if (busData.hasOwnProperty('WorkItemId')) {
  809. WorkFlowHandle.CompleteTaskById(busData['WorkItemId']); // 提交任务
  810. }
  811. t = 'Success';
  812. } else {
  813. let deletereason = '';
  814. let processid = '';
  815. if (resultKey === 'SuperFlag') {
  816. const checkdata = new CheckDataHelper(page);
  817. deletereason = 'SuperFaild';
  818. processid = checkdata.ProcessId;
  819. checkdata.ClearCheckData();
  820. } else if (resultKey === 'AuthFlag') {
  821. const authdata = new AuthDataHelper(page);
  822. deletereason = 'AuthFaild';
  823. processid = authdata.ProcessId;
  824. authdata.ClearAuthData();
  825. }
  826. /* 如果失败,不管是找没找到能还原的界面,因为工作流配置为不非环形流程,都需要删除流程,tradepage的流水号serialid也不用更新,
  827. 如果还原了界面,客户还可以使用原来的流水号再提交申请,这个由服务端做了处理。
  828. TellerDelete只是做为删除流程实例原因的描述 */
  829. WorkFlowHandle.deleteProcessInsById(processid, deletereason);
  830. t = 'Failed';
  831. }
  832. // if (c != null)
  833. // c.Result(t, busData);
  834. // else
  835. const c = CheckManager.GetCheckManager(page);
  836. const a = AuthManager.GetAuthManager(page);
  837. if (c && resultKey === 'SuperFlag') {
  838. c.Result(t, busData);
  839. } else if (a && resultKey === 'AuthFlag') {
  840. a.Result(t, busData);
  841. }
  842. }
  843. }, 'Loaded');
  844. });
  845. }
  846. public GetAuthElement(out oepnBranch: string, DeAccount: string = '', CrAccount: string = '', SinAmt: string = '', CTSigns: string = '', OperationType: string = '', DeAccountSeqn: string = ''): AuthConditionElement | null {
  847. oepnBranch = '';
  848. let result: AuthConditionElement | null = null;
  849. const message: Message = {};
  850. this.InitFd(message);
  851. this.CommSend(message);
  852. message.Fd16 = '8980';
  853. message.Fd30 = DeAccount;
  854. message.Fd31 = CrAccount;
  855. message.Fd100_1 = SinAmt;
  856. message.Fd34 = DeAccountSeqn;
  857. if (!this.CallServer(message)) {
  858. this.ShowErrorMessageBox(this.GetError(message));
  859. return null;
  860. }
  861. if (message.Fd12 !== '0000') {
  862. this.ShowErrorMessageBox(this.GetError(message));
  863. return null;
  864. } else {
  865. result = {
  866. OperationType: OperationType ? OperationType.trim() : '',
  867. Txcode: this.Page.TradeInfoData.GetTradeInfo(this.Page).TradeCode,
  868. CTSigns: CTSigns ? CTSigns.trim() : '',
  869. SinAmt: SinAmt ? SinAmt.trim() : '',
  870. } as AuthConditionElement;
  871. const fd125 = Feild8583.SetAuthFd125(message.Fd125);
  872. fd125.CTSigns = CTSigns;
  873. fd125.SinAmt = SinAmt;
  874. oepnBranch = DeAccount ? Feild8583.GetStrBytes(message.Fd125, 176, 5) : Feild8583.GetStrBytes(message.Fd125, 181, 5);
  875. result.DeAccountType = fd125.DeAccountType.trim();
  876. result.CrAccountType = fd125.CrAccountType.trim();
  877. result.DeAccountPro = fd125.DeAccountPro.trim();
  878. result.CrAccountPro = fd125.CrAccountPro.trim();
  879. result.DeIsOwn = fd125.DeIsOwn === 'Y' ? 'true' : 'false';
  880. result.CrIsOwn = fd125.CrIsOwn === 'Y' ? 'true' : 'false';
  881. result.DCIsSameCus = fd125.DCIsSameCus === 'Y' ? 'true' : 'false';
  882. result.DeCaAddAmt = fd125.DeCaAddAmt.trim();
  883. if (!SinAmt.trim()) SinAmt = '0.0';
  884. result.DeCaAddAmt = (parseFloat(fd125.DeCaAddAmt.trim()) + parseFloat(SinAmt)).toString();
  885. result.CrTrAddAmt = (parseFloat(fd125.CrTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
  886. result.DeTrAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
  887. result.SumAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt) + parseFloat(fd125.DeCaAddAmt.trim())).toString();
  888. result.LossMarked = fd125.LossMarked === 'Y' ? 'true' : fd125.LossMarked === 'N' ? 'false' : '';
  889. result.DocumentType = fd125.DocumentType.trim();
  890. result.DeductMarked = fd125.DeductMarked.trim();
  891. result.LongOrShort = fd125.LongOrShort === 'Y' ? 'true' : fd125.LongOrShort === 'N' ? 'false' : '';
  892. result.LegalPerson = LoginAuthentication.Instance.GroupKinbrNo;
  893. }
  894. return result;
  895. }
  896. public GetCheckElement(args: any): CheckConditionElements | null {
  897. let SinAmt = args.SinAmt.toString();
  898. let result: CheckConditionElements | null = null;
  899. const message: Message = {};
  900. this.InitFd(message);
  901. this.CommSend(message);
  902. message.Fd16 = '8980';
  903. message.Fd30 = args.DeAccount;
  904. message.Fd31 = args.CrAccount;
  905. message.Fd100_1 = SinAmt;
  906. message.Fd34 = args.DeAccountSeqn;
  907. if (!this.CallServer(message)) {
  908. this.ShowErrorMessageBox(this.GetError(message));
  909. return null;
  910. }
  911. if (message.Fd12 !== '0000') {
  912. this.ShowErrorMessageBox(this.GetError(message));
  913. return null;
  914. } else {
  915. result = {
  916. Account: args.Account,
  917. Money: args.Amt,
  918. OperationType: args.OperationType ? args.OperationType.trim() : '',
  919. Txcode: this.Page.TradeInfoData.GetTradeInfo(this.Page).TradeCode,
  920. CTSigns: args.CTSigns ? args.CTSigns.trim() : '',
  921. SinAmt: args.Amt.toString() && args.Amt !== 0 ? args.Amt.toString() : SinAmt,
  922. } as CheckConditionElements;
  923. const fd125 = Feild8583.SetAuthFd125(message.Fd125);
  924. fd125.CTSigns = args.CTSigns;
  925. fd125.SinAmt = SinAmt;
  926. result.DeAccountType = fd125.DeAccountType.trim();
  927. result.CrAccountType = fd125.CrAccountType.trim();
  928. result.DeAccountPro = fd125.DeAccountPro.trim();
  929. result.CrAccountPro = fd125.CrAccountPro.trim();
  930. result.DeIsOwn = fd125.DeIsOwn === 'Y' ? 'true' : 'false';
  931. result.CrIsOwn = fd125.CrIsOwn === 'Y' ? 'true' : 'false';
  932. result.DCIsSameCus = fd125.DCIsSameCus === 'Y' ? 'true' : 'false';
  933. result.DeCaAddAmt = fd125.DeCaAddAmt.trim();
  934. if (!SinAmt.trim()) SinAmt = '0.0';
  935. result.DeCaAddAmt = (parseFloat(fd125.DeCaAddAmt.trim()) + parseFloat(SinAmt)).toString();
  936. result.CrTrAddAmt = (parseFloat(fd125.CrTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
  937. result.DeTrAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt)).toString();
  938. result.SumAddAmt = (parseFloat(fd125.DeTrAddAmt.trim()) + parseFloat(SinAmt) + parseFloat(fd125.DeCaAddAmt.trim())).toString();
  939. result.LossMarked = fd125.LossMarked === 'Y' ? 'true' : fd125.LossMarked === 'N' ? 'false' : '';
  940. result.DocumentType = fd125.DocumentType.trim();
  941. result.DeductMarked = fd125.DeductMarked.trim();
  942. result.LongOrShort = fd125.LongOrShort === 'Y' ? 'true' : fd125.LongOrShort === 'N' ? 'false' : '';
  943. result.LegalPerson = LoginAuthentication.Instance.GroupKinbrNo;
  944. }
  945. return result;
  946. }
  947. public SetAuthCheckTitle(element: FrameworkElement, str: string): void {
  948. CheckManager.SetAuthCheckTitle(element, str);
  949. }
  950. // 获取菜单属性
  951. public GetTradeMetadata(name: string): string {
  952. const model = this.Page.TradeModel;
  953. if (!model || !model.Metadata.hasOwnProperty(name)) return '';
  954. return model.Metadata[name];
  955. }
  956. public CheckTradePower(powerCode: string): boolean {
  957. if (!TradePowerManager.Instance.IsPowerCheckByUser) return true;
  958. const list = TradePowerManager.Instance.GetTradePowerByCode(this.Page.TradeInfo.TradeCode);
  959. if (!list || list.length === 0) return false;
  960. return list.some((x: any) => x.RuleNo === powerCode);
  961. }
  962. private static _SignInStateList_: string[] = [
  963. "TellerTransfer",
  964. "TellerChecking",
  965. "TellerChecked",
  966. "TellerSignOut",
  967. ];
  968. public CheckWorkState(defV: boolean | null = null): boolean {
  969. const FLAG = TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("2ea3a7e6cfa04f89a335bf1e363295de");
  970. if (FLAG === "V24") {
  971. // 若给定了默认值,则需要检查当前交易菜单配置
  972. if (defV !== null) {
  973. let flag = false;
  974. if (!Boolean(this.GetTradeMetadata("isCheckWorkState"))) {
  975. flag = defV;
  976. }
  977. if (!flag) return true;
  978. }
  979. const TSGY = TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("TSGY");
  980. if (TSGY.includes(LoginUserInfo.TellerNo)) {
  981. return true;
  982. }
  983. const status = LoginUserInfo.GetUserInfo("WorkState");
  984. if (TradeAPIsHelper._SignInStateList_.includes(status)) return true;
  985. this.ShowWarnMessageBox("当前柜员非签到状态,请先签到...");
  986. return false;
  987. } else {
  988. return true;
  989. }
  990. }
  991. public CheckDFState(defV: boolean | null = null): boolean {
  992. const FLAG = TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("2ea3a7e6cfa04f89a335bf1e363295de");
  993. if (FLAG === "V0" && TradeManagerHandle.TT_SYSCONFIG_GetConfigValueByConfigID("TGJC") !== "true") {
  994. // 若给定了默认值,则需要检查当前交易菜单配置
  995. if (defV !== null) {
  996. let flag = false;
  997. if (!Boolean(this.GetTradeMetadata("isCheckDFState"))) {
  998. flag = defV;
  999. }
  1000. if (!flag) return true;
  1001. }
  1002. const msg: Message = {};
  1003. this.InitFd(msg);
  1004. this.CommSend(msg);
  1005. msg.Fd16 = "K119";
  1006. msg.Fd92 = LoginUserInfo.TellerNo;
  1007. if (!this.CallServer(msg)) {
  1008. // 处理调用失败情况
  1009. }
  1010. // 后续逻辑需要根据实际业务补充
  1011. return true;
  1012. } else {
  1013. return true;
  1014. }
  1015. }
  1016. }
  1017. export default TradeAPIsHelper;