Commit e3d9764a94780f00ee16017397427b68327aec7c

Authored by liuye
1 parent a39f9aed

feat<card>:支持扣点收费

支持一个按钮同时刷园区卡银行卡,新增账户转账、王卡业务菜单
central_clearing_system/Config/menu_res_auth_cfg.json
1 [ 1 [
2 - {"res_id":1, "auth_id":1000, "icon":"", "index":[0]},  
3 - {"res_id":10001, "auth_id":100001, "icon":"trade.ico", "index":[0, 0]}, 2 + {"res_id":1, "auth_id":1000, "icon":"", "index":[0]},
  3 + {"res_id":10001, "auth_id":100001, "icon":"trade.ico", "index":[0, 0]},
4 {"res_id":10002, "auth_id":100002, "icon":"place_an_order.ico", "index":[0, 1]}, 4 {"res_id":10002, "auth_id":100002, "icon":"place_an_order.ico", "index":[0, 1]},
5 - {"res_id":10003, "auth_id":100003, "icon":"statement_manage.ico", "index":[0, 2]},  
6 - {"res_id":2, "auth_id":1010, "icon":"", "index":[1]}, 5 + {"res_id":10003, "auth_id":100003, "icon":"statement_manage.ico", "index":[0, 2]},
  6 + {"res_id":2, "auth_id":1010, "icon":"", "index":[1]},
7 {"res_id":20001, "auth_id":101001, "icon":"user_manage.ico", "index":[1, 0]}, 7 {"res_id":20001, "auth_id":101001, "icon":"user_manage.ico", "index":[1, 0]},
8 {"res_id":20002, "auth_id":101002, "icon":"role_manage.ico", "index":[1, 1]}, 8 {"res_id":20002, "auth_id":101002, "icon":"role_manage.ico", "index":[1, 1]},
9 - {"res_id":20003, "auth_id":101002, "icon":"role_manage.ico", "index":[1, 1]}, 9 + {"res_id":20003, "auth_id":101003, "icon":"role_manage.ico", "index":[1, 2]},
10 {"res_id":30001, "auth_id":103001, "icon":"role_manage.ico", "index":[2]}, 10 {"res_id":30001, "auth_id":103001, "icon":"role_manage.ico", "index":[2]},
11 - {"res_id":4, "auth_id":1020, "icon":"", "index":[3]}, 11 + {"res_id":4, "auth_id":1020, "icon":"", "index":[3]},
12 {"res_id":40001, "auth_id":102001, "icon":"user_manage.ico", "index":[3, 0]}, 12 {"res_id":40001, "auth_id":102001, "icon":"user_manage.ico", "index":[3, 0]},
13 {"res_id":40002, "auth_id":102002, "icon":"user_manage.ico", "index":[3, 1]}, 13 {"res_id":40002, "auth_id":102002, "icon":"user_manage.ico", "index":[3, 1]},
14 {"res_id":40003, "auth_id":102003, "icon":"user_manage.ico", "index":[3, 2]}, 14 {"res_id":40003, "auth_id":102003, "icon":"user_manage.ico", "index":[3, 2]},
15 {"res_id":40004, "auth_id":102004, "icon":"user_manage.ico", "index":[3, 3]}, 15 {"res_id":40004, "auth_id":102004, "icon":"user_manage.ico", "index":[3, 3]},
16 {"res_id":40005, "auth_id":102005, "icon":"user_manage.ico", "index":[3, 4]}, 16 {"res_id":40005, "auth_id":102005, "icon":"user_manage.ico", "index":[3, 4]},
17 - {"res_id":5, "auth_id":1040, "icon":"", "index":[4]}, 17 + {"res_id":5, "auth_id":1040, "icon":"", "index":[4]},
18 {"res_id":50001, "auth_id":104001, "icon":"user_manage.ico", "index":[4, 0]}, 18 {"res_id":50001, "auth_id":104001, "icon":"user_manage.ico", "index":[4, 0]},
19 {"res_id":50002, "auth_id":104002, "icon":"user_manage.ico", "index":[4, 1]}, 19 {"res_id":50002, "auth_id":104002, "icon":"user_manage.ico", "index":[4, 1]},
20 {"res_id":50003, "auth_id":104003, "icon":"user_manage.ico", "index":[4, 2]}, 20 {"res_id":50003, "auth_id":104003, "icon":"user_manage.ico", "index":[4, 2]},
21 {"res_id":50004, "auth_id":104004, "icon":"user_manage.ico", "index":[4, 3]}, 21 {"res_id":50004, "auth_id":104004, "icon":"user_manage.ico", "index":[4, 3]},
22 - {"res_id":11001, "auth_id":0, "icon":"exit.ico", "index":[]},  
23 - {"res_id":11002, "auth_id":0, "icon":"modify_account_pwd.ico", "index":[]} 22 + {"res_id":11001, "auth_id":0, "icon":"exit.ico", "index":[]},
  23 + {"res_id":11002, "auth_id":0, "icon":"modify_account_pwd.ico","index":[]}
24 ] 24 ]
25 \ No newline at end of file 25 \ No newline at end of file
central_clearing_system/ETradeClient/hardware/dili_card_device.cpp
@@ -417,23 +417,6 @@ namespace DILICard @@ -417,23 +417,6 @@ namespace DILICard
417 //------Private Implementations---------------- 417 //------Private Implementations----------------
418 void RWDevice::Init() 418 void RWDevice::Init()
419 { 419 {
420 - //const std::wstring kDLLFile = L"./dyn.dll";  
421 - //HINSTANCE dll_handle = LoadLibrary(kDLLFile.c_str());  
422 - //if (NULL != dll_handle)  
423 - //{  
424 - // m_fn_open = (OpenFn)GetProcAddress(dll_handle, "open");  
425 - // m_fn_beep = (BeepFn)GetProcAddress(dll_handle, "beep");  
426 - // m_fn_close = (CloseFn)GetProcAddress(dll_handle, "close");  
427 - // m_fn_find_card = (FindCardFn)GetProcAddress(dll_handle, "findCard");  
428 - // m_fn_write_bin_data = (WriteBinaryDataFn)GetProcAddress(dll_handle, "write_bin_file");  
429 - // m_fn_get_value = (GetValueFn)GetProcAddress(dll_handle, "get_value_char"); // Don't use "get_value" version!!!  
430 - // m_fn_ch_dir = (ChangeDirFn)GetProcAddress(dll_handle, "chang_dir");  
431 - // m_fn_read_bin_data = (ReadBinaryDataFn)GetProcAddress(dll_handle, "read_bin_file");  
432 - // m_fn_ex_auth = (ExternalAuthFn)GetProcAddress(dll_handle, "External_Authentication");  
433 - // m_fn_install_key = (InstallKeyFn)GetProcAddress(dll_handle, "InstallKey");  
434 - //}  
435 - //else  
436 - // throw std::exception(("Fail to load the DILI card device DLL from path : " + wstr_2_str(kDLLFile)).c_str());  
437 } 420 }
438 421
439 std::string RWDevice::GetValue() const 422 std::string RWDevice::GetValue() const
central_clearing_system/ETradeClient/mfc_ui/ETradeClient.cpp
@@ -18,9 +18,7 @@ @@ -18,9 +18,7 @@
18 #include "./ExLib/mfc/dbghelp.h" 18 #include "./ExLib/mfc/dbghelp.h"
19 #include "./ETradeClient/utility/win_msg_define.h" 19 #include "./ETradeClient/utility/win_msg_define.h"
20 20
21 -//for test  
22 -#include "place_order_dlg.h"  
23 -// 21 +
24 22
25 #ifdef _DEBUG 23 #ifdef _DEBUG
26 #define new DEBUG_NEW 24 #define new DEBUG_NEW
@@ -191,14 +189,6 @@ BOOL CETradeClientApp::InitInstance() @@ -191,14 +189,6 @@ BOOL CETradeClientApp::InitInstance()
191 // such as the name of your company or organization 189 // such as the name of your company or organization
192 SetRegistryKey(APP_ID); 190 SetRegistryKey(APP_ID);
193 191
194 - //for test  
195 - //PlaceOrderDlg dlg;  
196 - /*if (dlg.DoModal())  
197 - {  
198 - return FALSE;  
199 - }*/  
200 - //  
201 -  
202 // First, do login job. 192 // First, do login job.
203 if (!CLoginDialog(L"欢迎使用综合业务系统!").Launch()) 193 if (!CLoginDialog(L"欢迎使用综合业务系统!").Launch())
204 { 194 {
etrade_card_client/Config/menu_res_auth_cfg.json
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
23 {"res_id":50150, "auth_id":5508, "icon":"cash_withdraw.ico", "index":[3, 1]}, 23 {"res_id":50150, "auth_id":5508, "icon":"cash_withdraw.ico", "index":[3, 1]},
24 {"res_id":50160, "auth_id":5512, "icon":"fee_payment.ico", "index":[3, 2]}, 24 {"res_id":50160, "auth_id":5512, "icon":"fee_payment.ico", "index":[3, 2]},
25 {"res_id":50170, "auth_id":5516, "icon":"settle_accounts_apply.ico", "index":[3, 3]}, 25 {"res_id":50170, "auth_id":5516, "icon":"settle_accounts_apply.ico", "index":[3, 3]},
  26 + {"res_id":50190, "auth_id":5517, "icon":"about.ico", "index":[3, 4]},
26 {"res_id":4, "auth_id":60, "icon":"", "index":[4]}, 27 {"res_id":4, "auth_id":60, "icon":"", "index":[4]},
27 {"res_id":50180, "auth_id":6004, "icon":"customer_query.ico", "index":[4, 0]}, 28 {"res_id":50180, "auth_id":6004, "icon":"customer_query.ico", "index":[4, 0]},
28 {"res_id":50190, "auth_id":6008, "icon":"oper_log_query.ico", "index":[4, 1]}, 29 {"res_id":50190, "auth_id":6008, "icon":"oper_log_query.ico", "index":[4, 1]},
@@ -30,6 +31,7 @@ @@ -30,6 +31,7 @@
30 {"res_id":5, "auth_id":70, "icon":"", "index":[5]}, 31 {"res_id":5, "auth_id":70, "icon":"", "index":[5]},
31 {"res_id":50182, "auth_id":7002, "icon":"about.ico", "index":[5, 0]}, 32 {"res_id":50182, "auth_id":7002, "icon":"about.ico", "index":[5, 0]},
32 {"res_id":50183, "auth_id":7004, "icon":"about.ico", "index":[5, 1]}, 33 {"res_id":50183, "auth_id":7004, "icon":"about.ico", "index":[5, 1]},
  34 + {"res_id":50184, "auth_id":7005, "icon":"about.ico", "index":[5, 2]},
33 {"res_id":6, "auth_id":0, "icon":"", "index":[6]}, 35 {"res_id":6, "auth_id":0, "icon":"", "index":[6]},
34 {"res_id":32807, "auth_id":0, "icon":"modify_cfg.ico", "index":[6, 0]}, 36 {"res_id":32807, "auth_id":0, "icon":"modify_cfg.ico", "index":[6, 0]},
35 {"res_id":32782, "auth_id":0, "icon":"exit.ico", "index":[]}, 37 {"res_id":32782, "auth_id":0, "icon":"exit.ico", "index":[]},
etrade_card_client/ETradeClient.rc
@@ -117,17 +117,19 @@ BEGIN @@ -117,17 +117,19 @@ BEGIN
117 MENUITEM "提现", ID_CASH_WITHDRAW 117 MENUITEM "提现", ID_CASH_WITHDRAW
118 MENUITEM "缴费", ID_FEE_PAYMENT 118 MENUITEM "缴费", ID_FEE_PAYMENT
119 MENUITEM "结账申请", ID_SETTLE_ACCOUNTS_APPLY 119 MENUITEM "结账申请", ID_SETTLE_ACCOUNTS_APPLY
  120 + MENUITEM "账户转账", ID_ACCOUNT_TRANSFER
120 END 121 END
121 POPUP "查询业务(&C)" 122 POPUP "查询业务(&C)"
122 BEGIN 123 BEGIN
123 MENUITEM "客户查询", ID_CUSTOMER_QUERY 124 MENUITEM "客户查询", ID_CUSTOMER_QUERY
124 - MENUITEM "操作记录", ID_OPER_LOG_QUERY 125 + MENUITEM "操作记录", ID_ACCOUNT_TRANSFER
125 MENUITEM "客户管理", ID_CUS_MANAGE 126 MENUITEM "客户管理", ID_CUS_MANAGE
126 END 127 END
127 POPUP "市场业务(&F)" 128 POPUP "市场业务(&F)"
128 BEGIN 129 BEGIN
129 MENUITEM "ETC业务查询", ID_ETC_QUERY 130 MENUITEM "ETC业务查询", ID_ETC_QUERY
130 MENUITEM "ETC业务办理", ID_ETC_SERVICE 131 MENUITEM "ETC业务办理", ID_ETC_SERVICE
  132 + MENUITEM "王卡业务", ID_KING_CARD
131 END 133 END
132 POPUP "设置(&S)" 134 POPUP "设置(&S)"
133 BEGIN 135 BEGIN
@@ -243,8 +245,8 @@ END @@ -243,8 +245,8 @@ END
243 // 245 //
244 246
245 VS_VERSION_INFO VERSIONINFO 247 VS_VERSION_INFO VERSIONINFO
246 - FILEVERSION 1,0,0,2  
247 - PRODUCTVERSION 1,0,0,2 248 + FILEVERSION 1,0,0,3
  249 + PRODUCTVERSION 1,0,0,3
248 FILEFLAGSMASK 0x3fL 250 FILEFLAGSMASK 0x3fL
249 #ifdef _DEBUG 251 #ifdef _DEBUG
250 FILEFLAGS 0x1L 252 FILEFLAGS 0x1L
@@ -261,12 +263,12 @@ BEGIN @@ -261,12 +263,12 @@ BEGIN
261 BEGIN 263 BEGIN
262 VALUE "CompanyName", "地利集团【DILI GROUP】" 264 VALUE "CompanyName", "地利集团【DILI GROUP】"
263 VALUE "FileDescription", "电子交易结算柜员系统【ETradeClient】" 265 VALUE "FileDescription", "电子交易结算柜员系统【ETradeClient】"
264 - VALUE "FileVersion", "1.0.0.2" 266 + VALUE "FileVersion", "1.0.0.3"
265 VALUE "InternalName", "ETradeClient.exe" 267 VALUE "InternalName", "ETradeClient.exe"
266 VALUE "LegalCopyright", "(C) 地利集团。 保留所有权利。" 268 VALUE "LegalCopyright", "(C) 地利集团。 保留所有权利。"
267 VALUE "OriginalFilename", "ETradeClient.exe" 269 VALUE "OriginalFilename", "ETradeClient.exe"
268 VALUE "ProductName", "电子交易结算柜员系统" 270 VALUE "ProductName", "电子交易结算柜员系统"
269 - VALUE "ProductVersion", "1.0.1.180808_Beta" 271 + VALUE "ProductVersion", "1.0.1.181015_Release"
270 END 272 END
271 END 273 END
272 BLOCK "VarFileInfo" 274 BLOCK "VarFileInfo"
etrade_card_client/ETradeClient/hardware/dili_card_device.cpp
@@ -417,23 +417,6 @@ namespace DILICard @@ -417,23 +417,6 @@ namespace DILICard
417 //------Private Implementations---------------- 417 //------Private Implementations----------------
418 void RWDevice::Init() 418 void RWDevice::Init()
419 { 419 {
420 - //const std::wstring kDLLFile = L"./dyn.dll";  
421 - //HINSTANCE dll_handle = LoadLibrary(kDLLFile.c_str());  
422 - //if (NULL != dll_handle)  
423 - //{  
424 - // m_fn_open = (OpenFn)GetProcAddress(dll_handle, "open");  
425 - // m_fn_beep = (BeepFn)GetProcAddress(dll_handle, "beep");  
426 - // m_fn_close = (CloseFn)GetProcAddress(dll_handle, "close");  
427 - // m_fn_find_card = (FindCardFn)GetProcAddress(dll_handle, "findCard");  
428 - // m_fn_write_bin_data = (WriteBinaryDataFn)GetProcAddress(dll_handle, "write_bin_file");  
429 - // m_fn_get_value = (GetValueFn)GetProcAddress(dll_handle, "get_value_char"); // Don't use "get_value" version!!!  
430 - // m_fn_ch_dir = (ChangeDirFn)GetProcAddress(dll_handle, "chang_dir");  
431 - // m_fn_read_bin_data = (ReadBinaryDataFn)GetProcAddress(dll_handle, "read_bin_file");  
432 - // m_fn_ex_auth = (ExternalAuthFn)GetProcAddress(dll_handle, "External_Authentication");  
433 - // m_fn_install_key = (InstallKeyFn)GetProcAddress(dll_handle, "InstallKey");  
434 - //}  
435 - //else  
436 - // throw std::exception(("Fail to load the DILI card device DLL from path : " + wstr_2_str(kDLLFile)).c_str());  
437 } 420 }
438 421
439 std::string RWDevice::GetValue() const 422 std::string RWDevice::GetValue() const
etrade_card_client/ETradeClient/hardware/hardware_cmd.cpp
@@ -1182,3 +1182,75 @@ ReadPINPadCmd::Reply ReadBankCardNumCmd::Execute(const std::string&amp; input) @@ -1182,3 +1182,75 @@ ReadPINPadCmd::Reply ReadBankCardNumCmd::Execute(const std::string&amp; input)
1182 reply.data.put("chipNo", bank_card_no); 1182 reply.data.put("chipNo", bank_card_no);
1183 return reply; 1183 return reply;
1184 } 1184 }
  1185 +
  1186 +ReadPINPadCmd::Reply ReadDILIAndBankCardNumCmd::Execute(const std::string& input)
  1187 +{
  1188 + LOG_TRACE(L"读取园区卡或银行卡。");
  1189 + Reply reply;
  1190 + auto& dili_card_device = DILICardRWDevice();
  1191 + DILICard::BasicInfo card_basic_info;
  1192 + std::string sCardNum;
  1193 + do
  1194 + {
  1195 + try
  1196 + {
  1197 + dili_card_device.Connect();
  1198 + }
  1199 + catch (std::exception& ex)
  1200 + {
  1201 + LOG_FATAL(L"连接读卡器失败,错误信息: " + str_2_wstr(ex.what()));
  1202 + reply.error_code = StatusCode::CPU_CARD_DEVICE_CONNECT_FAILED;
  1203 + break;
  1204 + }
  1205 + try
  1206 + {
  1207 + dili_card_device.FindCard();
  1208 + }
  1209 + catch (std::exception& ex)
  1210 + {
  1211 + LOG_FATAL(L"寻卡失败,错误信息: " + str_2_wstr(ex.what()));
  1212 + reply.error_code = StatusCode::CPU_CARD_DEVICE_CANNOT_FIND_CARD;
  1213 + break;
  1214 + }
  1215 +
  1216 + try
  1217 + {
  1218 + card_basic_info = dili_card_device.ReadCardBasicInfo();
  1219 + sCardNum = card_basic_info.chip_num;
  1220 + }
  1221 + catch (std::exception& ex)
  1222 + {
  1223 + LOG_FATAL(L"读取园区卡卡片基本信息失败,错误信息: " + str_2_wstr(ex.what()));
  1224 + try
  1225 + {
  1226 + LOG_TRACE(L"读取银行卡号。");
  1227 + auto& bank_card_reader = BankCardReader_();
  1228 + if (!bank_card_reader.Connect())
  1229 + {
  1230 + LOG_ERROR(L"连接银行卡读卡器失败。");
  1231 + reply.error_code = StatusCode::CPU_CARD_DEVICE_CONNECT_FAILED;
  1232 + break;
  1233 + }
  1234 + sCardNum = bank_card_reader.ReadBankCardNum();
  1235 + }
  1236 + catch (std::exception& ex)
  1237 + {
  1238 + LOG_FATAL(L"读取银行卡号失败,错误信息: " + str_2_wstr(ex.what()));
  1239 + reply.error_code = StatusCode::BANK_CARD_READ_CARD_NUM_FAILED;
  1240 + break;
  1241 + }
  1242 +
  1243 + }
  1244 + } while (0);
  1245 + dili_card_device.Disconnect();
  1246 + if (boost::iequals(reply.error_code, StatusCode::OK))
  1247 + LOG_TRACE(L"读取卡片基本信息成功。");
  1248 +
  1249 + reply.data.put("chipNo", sCardNum);
  1250 + reply.data.put("deviceId", card_basic_info.device_id);
  1251 + reply.data.put("type", card_basic_info.type_code);
  1252 + reply.data.put("issuerCode", card_basic_info.issuer_code);
  1253 + reply.data.put("verifyCode", card_basic_info.verify_code);
  1254 +
  1255 + return reply;
  1256 +}
1185 \ No newline at end of file 1257 \ No newline at end of file
etrade_card_client/ETradeClient/hardware/hardware_cmd.h
@@ -86,4 +86,12 @@ class ReadBankCardNumCmd : public HardwareCmd @@ -86,4 +86,12 @@ class ReadBankCardNumCmd : public HardwareCmd
86 public: 86 public:
87 virtual Reply Execute(const std::string& input) override; 87 virtual Reply Execute(const std::string& input) override;
88 }; 88 };
  89 +
  90 +//中央结算特殊需求,一个接口先刷园区卡再刷银行卡
  91 +class ReadDILIAndBankCardNumCmd : public HardwareCmd
  92 +{
  93 +public:
  94 + virtual Reply Execute(const std::string& input) override;
  95 +};
  96 +//
89 #endif // ETRADECLIENT_HARDWARE_HARDWARE_CMD_H_INCLUDED 97 #endif // ETRADECLIENT_HARDWARE_HARDWARE_CMD_H_INCLUDED
etrade_card_client/resource.h
@@ -58,11 +58,13 @@ @@ -58,11 +58,13 @@
58 #define ID_CASH_WITHDRAW 50150 58 #define ID_CASH_WITHDRAW 50150
59 #define ID_FEE_PAYMENT 50160 59 #define ID_FEE_PAYMENT 50160
60 #define ID_SETTLE_ACCOUNTS_APPLY 50170 60 #define ID_SETTLE_ACCOUNTS_APPLY 50170
  61 +#define ID_ACCOUNT_TRANSFER 50190
61 #define ID_CUSTOMER_QUERY 50180 62 #define ID_CUSTOMER_QUERY 50180
62 #define ID_CUS_MANAGE 50181 63 #define ID_CUS_MANAGE 50181
63 -#define ID_OPER_LOG_QUERY 50190  
64 #define ID_ETC_QUERY 50182 64 #define ID_ETC_QUERY 50182
65 #define ID_ETC_SERVICE 50183 65 #define ID_ETC_SERVICE 50183
  66 +#define ID_KING_CARD 50184
  67 +#define ID_OPER_LOG_QUERY 50190
66 #define ID_INDICATOR_TIME 59142 68 #define ID_INDICATOR_TIME 59142
67 69
68 // Next default values for new objects 70 // Next default values for new objects
@@ -70,7 +72,7 @@ @@ -70,7 +72,7 @@
70 #ifdef APSTUDIO_INVOKED 72 #ifdef APSTUDIO_INVOKED
71 #ifndef APSTUDIO_READONLY_SYMBOLS 73 #ifndef APSTUDIO_READONLY_SYMBOLS
72 #define _APS_NEXT_RESOURCE_VALUE 326 74 #define _APS_NEXT_RESOURCE_VALUE 326
73 -#define _APS_NEXT_COMMAND_VALUE 32835 75 +#define _APS_NEXT_COMMAND_VALUE 32840
74 #define _APS_NEXT_CONTROL_VALUE 1018 76 #define _APS_NEXT_CONTROL_VALUE 1018
75 #define _APS_NEXT_SYMED_VALUE 311 77 #define _APS_NEXT_SYMED_VALUE 311
76 #endif 78 #endif