Commit 97e06cb92f44a768de4afa35d01e9f53ce952211
1 parent
04171be4
bugfix<card>修复新中新读卡器读取身份证时,性别错误的问题
新中新读卡器读取时,数据会有空格,要把空格去掉 Signed-off-by: liuye <liuye@diligrp.com>
Showing
3 changed files
with
20 additions
and
4 deletions
etrade_card_client/ETradeClient.rc
@@ -246,8 +246,8 @@ END | @@ -246,8 +246,8 @@ END | ||
246 | // | 246 | // |
247 | 247 | ||
248 | VS_VERSION_INFO VERSIONINFO | 248 | VS_VERSION_INFO VERSIONINFO |
249 | - FILEVERSION 4,0,1,0 | ||
250 | - PRODUCTVERSION 4,0,1,0 | 249 | + FILEVERSION 4,0,2,0 |
250 | + PRODUCTVERSION 4,0,2,0 | ||
251 | FILEFLAGSMASK 0x3fL | 251 | FILEFLAGSMASK 0x3fL |
252 | #ifdef _DEBUG | 252 | #ifdef _DEBUG |
253 | FILEFLAGS 0x1L | 253 | FILEFLAGS 0x1L |
@@ -264,12 +264,12 @@ BEGIN | @@ -264,12 +264,12 @@ BEGIN | ||
264 | BEGIN | 264 | BEGIN |
265 | VALUE "CompanyName", "地利集团【DILI GROUP】" | 265 | VALUE "CompanyName", "地利集团【DILI GROUP】" |
266 | VALUE "FileDescription", "电子交易结算柜员系统【ETradeClient】" | 266 | VALUE "FileDescription", "电子交易结算柜员系统【ETradeClient】" |
267 | - VALUE "FileVersion", "4.0.1.0" | 267 | + VALUE "FileVersion", "4.0.2.0" |
268 | VALUE "InternalName", "电子交易结算柜员系统" | 268 | VALUE "InternalName", "电子交易结算柜员系统" |
269 | VALUE "LegalCopyright", "(C) 地利集团保留所有权利。" | 269 | VALUE "LegalCopyright", "(C) 地利集团保留所有权利。" |
270 | VALUE "OriginalFilename", "电子交易结算柜员系统" | 270 | VALUE "OriginalFilename", "电子交易结算柜员系统" |
271 | VALUE "ProductName", "电子交易结算柜员系统" | 271 | VALUE "ProductName", "电子交易结算柜员系统" |
272 | - VALUE "ProductVersion", "4.0.1.0" | 272 | + VALUE "ProductVersion", "4.0.2.0" |
273 | END | 273 | END |
274 | END | 274 | END |
275 | BLOCK "VarFileInfo" | 275 | BLOCK "VarFileInfo" |
etrade_card_client/ETradeClient/hardware/hardware_cmd.cpp
@@ -410,6 +410,8 @@ ReadPINPadCmd::Reply ReadIDCardCmd::Execute(const std::string& input) | @@ -410,6 +410,8 @@ ReadPINPadCmd::Reply ReadIDCardCmd::Execute(const std::string& input) | ||
410 | break; | 410 | break; |
411 | } | 411 | } |
412 | 412 | ||
413 | + //读卡器读出来的数据中可能带空格,要去掉 | ||
414 | + id_card_info.Trim(); | ||
413 | 415 | ||
414 | reply.data.put("id", wstr_2_str(id_card_info.id_code)); | 416 | reply.data.put("id", wstr_2_str(id_card_info.id_code)); |
415 | reply.data.put("name", wstr_2_str(id_card_info.name)); // Use 'wstr_2_str' to convert to UTF-8 string. | 417 | reply.data.put("name", wstr_2_str(id_card_info.name)); // Use 'wstr_2_str' to convert to UTF-8 string. |
etrade_card_client/ETradeClient/hardware/id_card_reader.h
@@ -21,6 +21,20 @@ struct IDCardInfo | @@ -21,6 +21,20 @@ struct IDCardInfo | ||
21 | std::wstring start_date; | 21 | std::wstring start_date; |
22 | std::wstring end_date; | 22 | std::wstring end_date; |
23 | std::wstring portrait_img_path; | 23 | std::wstring portrait_img_path; |
24 | + | ||
25 | + void Trim() | ||
26 | + { | ||
27 | + name = name.substr(name.find_first_not_of(' '), name.find_last_not_of(' ') + 1); | ||
28 | + gender = gender.substr(gender.find_first_not_of(' '), gender.find_last_not_of(' ') + 1); | ||
29 | + nation = nation.substr(nation.find_first_not_of(' '), nation.find_last_not_of(' ') + 1); | ||
30 | + birth_date = birth_date.substr(birth_date.find_first_not_of(' '), birth_date.find_last_not_of(' ') + 1); | ||
31 | + address = address.substr(address.find_first_not_of(' '), address.find_last_not_of(' ') + 1); | ||
32 | + id_code = id_code.substr(id_code.find_first_not_of(' '), id_code.find_last_not_of(' ') + 1); | ||
33 | + depart = depart.substr(depart.find_first_not_of(' '), depart.find_last_not_of(' ') + 1); | ||
34 | + start_date = start_date.substr(start_date.find_first_not_of(' '), start_date.find_last_not_of(' ') + 1); | ||
35 | + end_date = end_date.substr(end_date.find_first_not_of(' '), end_date.find_last_not_of(' ') + 1); | ||
36 | + portrait_img_path = portrait_img_path.substr(portrait_img_path.find_first_not_of(' '), portrait_img_path.find_last_not_of(' ') + 1); | ||
37 | + } | ||
24 | }; | 38 | }; |
25 | 39 | ||
26 | class IDCardReader | 40 | class IDCardReader |