前端转vue
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserManagerHandle.ts 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. // import { ServiceManager } from './ServiceManager'; // 假设 ServiceManager 已经在项目中定义
  2. // import { TransitEntity, AttachFile } from './TransitEntity'; // 假设 TransitEntity 和 AttachFile 已经在项目中定义
  3. // import { CommonFunction } from './CommonFunction'; // 假设 CommonFunction 已经在项目中定义
  4. // import { THotKeyMessage, TTellerHotKey } from './Entitys'; // 假设 THotKeyMessage 和 TTellerHotKey 已经在项目中定义
  5. // import { CommonParames } from './CommonParames'; // 假设 CommonParames 已经在项目中定义
  6. // export class UserManagerHandle {
  7. // // 快捷键管理模块
  8. // public static async GetKeyByTeller(tellerNum: string): Promise<THotKeyMessage[] | null> {
  9. // try {
  10. // const entity = new TransitEntity();
  11. // entity.ServiceName = 'HotKeyService';
  12. // entity.FuncName = 'GetKeyByTeller';
  13. // entity.Parameters = { '1': tellerNum };
  14. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  15. // if (tmpresult && tmpresult.length === 1) {
  16. // return CommonFunction.ChangeEntityTable<DataTable, THotKeyMessage[]>((tmpresult[0].AttachValue as DataTable));
  17. // }
  18. // return null;
  19. // } catch (e) {
  20. // throw e;
  21. // }
  22. // }
  23. // public static async DelKeyMessage(keyName: string, tellerNum: string): Promise<boolean> {
  24. // try {
  25. // const entity = new TransitEntity();
  26. // entity.ServiceName = 'HotKeyService';
  27. // entity.FuncName = 'DelKeyMessage';
  28. // entity.Parameters = { '1': keyName, '2': tellerNum };
  29. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  30. // if (tmpresult && tmpresult.length === 1) {
  31. // return Boolean(tmpresult[0].AttachValue);
  32. // }
  33. // return false;
  34. // } catch (e) {
  35. // throw e;
  36. // }
  37. // }
  38. // public static async DelKeyValue(keyName: string, tellerNum: string, keyValue: string): Promise<boolean> {
  39. // try {
  40. // const entity = new TransitEntity();
  41. // entity.ServiceName = 'HotKeyService';
  42. // entity.FuncName = 'DelKeyValue';
  43. // entity.Parameters = { '1': keyName, '2': tellerNum, '3': keyValue };
  44. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  45. // if (tmpresult && tmpresult.length === 1) {
  46. // return Boolean(tmpresult[0].AttachValue);
  47. // }
  48. // return false;
  49. // } catch (e) {
  50. // throw e;
  51. // }
  52. // }
  53. // public static async UpdateKeyMessage(tTellerHotkey: TTellerHotKey): Promise<boolean> {
  54. // try {
  55. // const entity = new TransitEntity();
  56. // entity.ServiceName = 'HotKeyService';
  57. // entity.FuncName = 'UpdateKeyMessage';
  58. // const attach = new AttachFile();
  59. // attach.AttachIndex = '1';
  60. // attach.AttachType = 'TableType';
  61. // const tmp = [tTellerHotkey];
  62. // attach.AttachValue = CommonFunction.ChangeEntityTable<TTellerHotKey[], DataTable>(tmp);
  63. // entity.AttachFiles.push(attach);
  64. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  65. // if (tmpresult && tmpresult.length === 1) {
  66. // return Boolean(tmpresult[0].AttachValue);
  67. // }
  68. // return false;
  69. // } catch (e) {
  70. // throw e;
  71. // }
  72. // }
  73. // // 柜员管理模块
  74. // public static async SendMessage(key: string, sender: string, time: string, title: string): Promise<void> {
  75. // try {
  76. // const entity = new TransitEntity();
  77. // entity.ServiceName = 'UtilService';
  78. // entity.FuncName = 'SocketSendMessage';
  79. // entity.Parameters = { '1': key, '2': sender, '3': time, '4': title };
  80. // await ServiceManager.getInstance().Commit(entity);
  81. // } catch (e) {
  82. // throw e;
  83. // }
  84. // }
  85. // public static async SendMessage(sender: string, message: string, TradeNo: string[]): Promise<void> {
  86. // try {
  87. // const entity = new TransitEntity();
  88. // entity.ServiceName = 'UtilService';
  89. // entity.FuncName = 'SendMessage';
  90. // entity.Parameters = { '1': sender, '2': message, '3': CommonFunction.ChangArrayToStr(TradeNo) };
  91. // await ServiceManager.getInstance().Commit(entity);
  92. // } catch (e) {
  93. // throw e;
  94. // }
  95. // }
  96. // public static async GetOutOfData(tradeno: string, tradetype: string, key_words: string, branch_no: string): Promise<string | null> {
  97. // try {
  98. // const entity = new TransitEntity();
  99. // entity.ServiceName = 'TradeService';
  100. // entity.FuncName = 'GetOutOfData';
  101. // entity.Parameters = { '1': tradeno, '2': tradetype, '3': key_words, '4': branch_no };
  102. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  103. // if (tmpresult && tmpresult.length === 1) {
  104. // return tmpresult[0].AttachValue as string;
  105. // }
  106. // return null;
  107. // } catch (e) {
  108. // throw e;
  109. // }
  110. // }
  111. // public static async SetOutOfData(guid: string, tradenum: string, tradetype: string, keywords: string, tradedata: string, tellerno: string, branch_no: string): Promise<boolean> {
  112. // try {
  113. // const entity = new TransitEntity();
  114. // entity.ServiceName = 'TradeService';
  115. // entity.FuncName = 'SetOutOfData';
  116. // entity.Parameters = { '1': guid, '2': tradenum, '3': tradetype, '4': keywords, '5': tradedata, '6': tellerno, '7': branch_no };
  117. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  118. // if (tmpresult && tmpresult.length === 1) {
  119. // return Boolean(tmpresult[0].AttachValue);
  120. // }
  121. // return false;
  122. // } catch (e) {
  123. // throw e;
  124. // }
  125. // }
  126. // public static async UpdateOutOfData(Guid: string, tradedata: string): Promise<boolean> {
  127. // try {
  128. // const entity = new TransitEntity();
  129. // entity.ServiceName = 'TradeService';
  130. // entity.FuncName = 'UpdateOutOfData';
  131. // entity.Parameters = { '1': Guid, '2': tradedata };
  132. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  133. // if (tmpresult && tmpresult.length === 1) {
  134. // return Boolean(tmpresult[0].AttachValue);
  135. // }
  136. // return false;
  137. // } catch (e) {
  138. // throw e;
  139. // }
  140. // }
  141. // public static async InsertBlob(tableName: string, columnName: string, strWhere: string, data: Uint8Array): Promise<boolean> {
  142. // try {
  143. // const entity = new TransitEntity();
  144. // entity.ServiceName = 'UtilService';
  145. // entity.FuncName = 'InsertBlob';
  146. // entity.Parameters = { '1': tableName, '2': columnName, '3': strWhere };
  147. // const files = new AttachFile();
  148. // files.AttachIndex = '4';
  149. // files.AttachType = 'ByteType';
  150. // files.AttachValue = data;
  151. // entity.AttachFiles.push(files);
  152. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  153. // if (tmpresult && tmpresult.length === 1) {
  154. // return Boolean(tmpresult[0].AttachValue);
  155. // }
  156. // return false;
  157. // } catch (e) {
  158. // throw e;
  159. // }
  160. // }
  161. // public static async DeleteFolderOrFile(sPath: string): Promise<boolean> {
  162. // try {
  163. // const entity = new TransitEntity();
  164. // entity.ServiceName = 'UtilService';
  165. // entity.FuncName = 'DeleteFolder';
  166. // entity.Parameters = { '1': sPath };
  167. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  168. // if (tmpresult && tmpresult.length === 1) {
  169. // return Boolean(tmpresult[0].AttachValue);
  170. // }
  171. // return false;
  172. // } catch (e) {
  173. // throw e;
  174. // }
  175. // }
  176. // public static async GetBlob(tableName: string, columnName: string, strWhere: string): Promise<Uint8Array | null> {
  177. // try {
  178. // const entity = new TransitEntity();
  179. // entity.ServiceName = 'UtilService';
  180. // entity.FuncName = 'GetBlobColumn';
  181. // entity.Parameters = { '1': tableName, '2': columnName, '3': strWhere };
  182. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  183. // if (tmpresult && tmpresult.length === 1) {
  184. // return tmpresult[0].AttachValue as Uint8Array;
  185. // }
  186. // return null;
  187. // } catch (e) {
  188. // throw e;
  189. // }
  190. // }
  191. // public static async SaveConfFile(fileName: string, file: Uint8Array, flag: boolean): Promise<boolean> {
  192. // try {
  193. // const entity = new TransitEntity();
  194. // entity.ServiceName = 'UtilService';
  195. // entity.FuncName = 'SaveFile';
  196. // entity.Parameters = { '1': CommonParames.ConfigFilePath + fileName, '3': flag.toString() };
  197. // const files = new AttachFile();
  198. // files.AttachIndex = '2';
  199. // files.AttachType = 'ByteType';
  200. // files.AttachValue = file;
  201. // entity.AttachFiles.push(files);
  202. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  203. // if (tmpresult && tmpresult.length === 1) {
  204. // return Boolean(tmpresult[0].AttachValue);
  205. // }
  206. // return false;
  207. // } catch (e) {
  208. // throw e;
  209. // }
  210. // }
  211. // public static async findReportFile(path: string): Promise<string[] | null> {
  212. // try {
  213. // const entity = new TransitEntity();
  214. // entity.ServiceName = 'UtilService';
  215. // entity.FuncName = 'FindReportFile';
  216. // entity.Parameters = { '1': path };
  217. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  218. // if (tmpresult && tmpresult.length === 1) {
  219. // return CommonFunction.ChangStrToArray(tmpresult[0].AttachValue as string);
  220. // }
  221. // return null;
  222. // } catch (e) {
  223. // throw e;
  224. // }
  225. // }
  226. // public static async GetConfFile(fileName: string): Promise<Uint8Array | null> {
  227. // try {
  228. // const entity = new TransitEntity();
  229. // entity.ServiceName = 'UtilService';
  230. // entity.FuncName = 'GetFile';
  231. // entity.Parameters = { '1': CommonParames.ConfigFilePath + fileName };
  232. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  233. // if (tmpresult && tmpresult.length === 1) {
  234. // return tmpresult[0].AttachValue as Uint8Array;
  235. // }
  236. // return null;
  237. // } catch (e) {
  238. // throw e;
  239. // }
  240. // }
  241. // public static async ExecuteSql(strsql: string): Promise<number> {
  242. // try {
  243. // const entity = new TransitEntity();
  244. // entity.ServiceName = 'UtilService';
  245. // entity.FuncName = 'ExecuteSql';
  246. // entity.Parameters = { '1': strsql };
  247. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  248. // if (tmpresult && tmpresult.length === 1) {
  249. // return Number(tmpresult[0].AttachValue);
  250. // }
  251. // return 0;
  252. // } catch (e) {
  253. // throw e;
  254. // }
  255. // }
  256. // public static async ExecuteQuery(sql: string): Promise<string[] | null> {
  257. // try {
  258. // const entity = new TransitEntity();
  259. // entity.ServiceName = 'UtilService';
  260. // entity.FuncName = 'ExecuteQuery';
  261. // entity.Parameters = { '1': sql };
  262. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  263. // if (tmpresult && tmpresult.length === 1) {
  264. // return CommonFunction.ChangStrToArray(tmpresult[0].AttachValue as string);
  265. // }
  266. // return null;
  267. // } catch (e) {
  268. // throw e;
  269. // }
  270. // }
  271. // public static async ExecuteSQLTran(SQLStringList: string[]): Promise<boolean> {
  272. // try {
  273. // const entity = new TransitEntity();
  274. // entity.ServiceName = 'UtilService';
  275. // entity.FuncName = 'ExecuteSQLTran';
  276. // entity.Parameters = { '1': CommonFunction.ChangArrayToStr(SQLStringList) };
  277. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  278. // if (tmpresult && tmpresult.length === 1) {
  279. // return Boolean(tmpresult[0].AttachValue);
  280. // }
  281. // return false;
  282. // } catch (e) {
  283. // throw e;
  284. // }
  285. // }
  286. // public static async SortSockAddress(Address: string[]): Promise<string | null> {
  287. // try {
  288. // const entity = new TransitEntity();
  289. // entity.ServiceName = 'UtilService';
  290. // entity.FuncName = 'SortSockAddress';
  291. // entity.Parameters = { '1': CommonFunction.ChangArrayToStr(Address) };
  292. // const tmpresult = await ServiceManager.getInstance().Commit(entity);
  293. // if (tmpresult && tmpresult.length === 1) {
  294. // return tmpresult[0].AttachValue as string;
  295. // }
  296. // return null;
  297. // } catch (e) {
  298. // throw e;
  299. // }
  300. // }
  301. // }
  302. //TODO此代码没用