Commit 7fed966e6d5438c4873c6091dd8b8e4018a32664
1 parent
229f3ca3
bugfix<central>解决打印时数据解析异常的问题
1.69boost解析中文时有问题,在最后打印时再解析成宽字符 Signed-off-by: liuye <liuye@diligrp.com>
Showing
7 changed files
with
36 additions
and
39 deletions
central_clearing_system/ETradeClient.rc
@@ -288,8 +288,8 @@ END | @@ -288,8 +288,8 @@ END | ||
288 | // | 288 | // |
289 | 289 | ||
290 | VS_VERSION_INFO VERSIONINFO | 290 | VS_VERSION_INFO VERSIONINFO |
291 | - FILEVERSION 4,0,4,0 | ||
292 | - PRODUCTVERSION 4,0,4,0 | 291 | + FILEVERSION 4,0,5,0 |
292 | + PRODUCTVERSION 4,0,5,0 | ||
293 | FILEFLAGSMASK 0x3fL | 293 | FILEFLAGSMASK 0x3fL |
294 | #ifdef _DEBUG | 294 | #ifdef _DEBUG |
295 | FILEFLAGS 0x1L | 295 | FILEFLAGS 0x1L |
@@ -306,12 +306,12 @@ BEGIN | @@ -306,12 +306,12 @@ BEGIN | ||
306 | BEGIN | 306 | BEGIN |
307 | VALUE "CompanyName", "地利集团【DILI GROUP】" | 307 | VALUE "CompanyName", "地利集团【DILI GROUP】" |
308 | VALUE "FileDescription", "电子交易结算综合业务系统" | 308 | VALUE "FileDescription", "电子交易结算综合业务系统" |
309 | - VALUE "FileVersion", "4.0.4.0" | 309 | + VALUE "FileVersion", "4.0.5.0" |
310 | VALUE "InternalName", "电子交易结算综合业务系统" | 310 | VALUE "InternalName", "电子交易结算综合业务系统" |
311 | VALUE "LegalCopyright", "(C) 地利集团保留所有权利。" | 311 | VALUE "LegalCopyright", "(C) 地利集团保留所有权利。" |
312 | VALUE "OriginalFilename", "电子交易结算综合业务系统" | 312 | VALUE "OriginalFilename", "电子交易结算综合业务系统" |
313 | VALUE "ProductName", "电子交易结算综合业务系统" | 313 | VALUE "ProductName", "电子交易结算综合业务系统" |
314 | - VALUE "ProductVersion", "4.0.4.0" | 314 | + VALUE "ProductVersion", "4.0.5.0" |
315 | END | 315 | END |
316 | END | 316 | END |
317 | BLOCK "VarFileInfo" | 317 | BLOCK "VarFileInfo" |
central_clearing_system/ETradeClient/browser/async_js_callback_handler.cpp
@@ -78,8 +78,7 @@ namespace HW | @@ -78,8 +78,7 @@ namespace HW | ||
78 | PT::ptree data_child = ptree.get_child(JSON_TAG_DATA); | 78 | PT::ptree data_child = ptree.get_child(JSON_TAG_DATA); |
79 | std::ostringstream os; | 79 | std::ostringstream os; |
80 | PT::write_json(os, data_child); | 80 | PT::write_json(os, data_child); |
81 | - CString data_t = str_2_wstr(std::string(os.str())).c_str(); | ||
82 | - data = CT2A(data_t); | 81 | + data = std::string(os.str()); |
83 | } | 82 | } |
84 | else | 83 | else |
85 | { | 84 | { |
central_clearing_system/ETradeClient/hardware/hardware_cmd.cpp
@@ -1373,8 +1373,7 @@ std::string StylusPrinterCmd::Print(std::vector<OrderInfo> &order_vector) | @@ -1373,8 +1373,7 @@ std::string StylusPrinterCmd::Print(std::vector<OrderInfo> &order_vector) | ||
1373 | 1373 | ||
1374 | y_point += TitleCtrlVI; | 1374 | y_point += TitleCtrlVI; |
1375 | dc->MoveTo(LineStartX, y_point); | 1375 | dc->MoveTo(LineStartX, y_point); |
1376 | - x_point += LineLength; | ||
1377 | - dc->LineTo(x_point, y_point); | 1376 | + dc->LineTo(LineLength + LineStartX, y_point); |
1378 | // | 1377 | // |
1379 | 1378 | ||
1380 | //打印商品信息头 | 1379 | //打印商品信息头 |
@@ -1535,23 +1534,23 @@ std::string StylusPrinterCmd::ParseInput(std::string &input, std::vector<OrderIn | @@ -1535,23 +1534,23 @@ std::string StylusPrinterCmd::ParseInput(std::string &input, std::vector<OrderIn | ||
1535 | BOOST_FOREACH(PT::ptree::value_type &v, order_tree) | 1534 | BOOST_FOREACH(PT::ptree::value_type &v, order_tree) |
1536 | { | 1535 | { |
1537 | OrderInfo order; | 1536 | OrderInfo order; |
1538 | - order.doc_name = title.c_str(); | ||
1539 | - order.statements_no = v.second.get<std::string>(JSON_TAG_STATEMENT_ID).c_str(); | ||
1540 | - order.trade_time = v.second.get<std::string>(JSON_TAG_TRADE_TIME).c_str(); | ||
1541 | - order.buyer_name = v.second.get<std::string>(JSON_TAG_TRADE_BUYER_NAME).c_str(); | ||
1542 | - order.seller_name = v.second.get<std::string>(JSON_TAG_TRADE_SELLER_NAME).c_str(); | ||
1543 | - order.settlement_clerk = v.second.get<std::string>(JSON_TAG_TRADE_USER_NAME).c_str(); | ||
1544 | - order.total_money = v.second.get<std::string>(JSON_TAG_TRADE_TOTAL_MONEY).c_str(); | 1537 | + order.doc_name = str_2_wstr(title).c_str(); |
1538 | + order.statements_no = str_2_wstr(v.second.get<std::string>(JSON_TAG_STATEMENT_ID)).c_str(); | ||
1539 | + order.trade_time = str_2_wstr(v.second.get<std::string>(JSON_TAG_TRADE_TIME)).c_str(); | ||
1540 | + order.buyer_name = str_2_wstr(v.second.get<std::string>(JSON_TAG_TRADE_BUYER_NAME)).c_str(); | ||
1541 | + order.seller_name = str_2_wstr(v.second.get<std::string>(JSON_TAG_TRADE_SELLER_NAME)).c_str(); | ||
1542 | + order.settlement_clerk = str_2_wstr(v.second.get<std::string>(JSON_TAG_TRADE_USER_NAME)).c_str(); | ||
1543 | + order.total_money = str_2_wstr(v.second.get<std::string>(JSON_TAG_TRADE_TOTAL_MONEY)).c_str(); | ||
1545 | 1544 | ||
1546 | PT::ptree products_ptree = v.second.get_child(JSON_TAG_TRADE_PRODUCTS); | 1545 | PT::ptree products_ptree = v.second.get_child(JSON_TAG_TRADE_PRODUCTS); |
1547 | BOOST_FOREACH(PT::ptree::value_type &v, products_ptree) | 1546 | BOOST_FOREACH(PT::ptree::value_type &v, products_ptree) |
1548 | { | 1547 | { |
1549 | CommInfo comm_info; | 1548 | CommInfo comm_info; |
1550 | comm_info.comm_id = v.second.get<long>(JSON_TAG_ORDER_ID); | 1549 | comm_info.comm_id = v.second.get<long>(JSON_TAG_ORDER_ID); |
1551 | - comm_info.comm_name = v.second.get<std::string>(JSON_TAG_PRODUCT_NAME).c_str(); | ||
1552 | - comm_info.price = v.second.get<std::string>(JSON_TAG_PRICE).c_str(); | ||
1553 | - comm_info.count = v.second.get<std::string>(JSON_TAG_AMOUNT).c_str(); | ||
1554 | - comm_info.total_money = v.second.get<std::string>(JSON_TAG_MONEY).c_str(); | 1550 | + comm_info.comm_name = str_2_wstr(v.second.get<std::string>(JSON_TAG_PRODUCT_NAME)).c_str(); |
1551 | + comm_info.price = str_2_wstr(v.second.get<std::string>(JSON_TAG_PRICE)).c_str(); | ||
1552 | + comm_info.count = str_2_wstr(v.second.get<std::string>(JSON_TAG_AMOUNT)).c_str(); | ||
1553 | + comm_info.total_money = str_2_wstr(v.second.get<std::string>(JSON_TAG_MONEY)).c_str(); | ||
1555 | order.comm_vector.push_back(comm_info); | 1554 | order.comm_vector.push_back(comm_info); |
1556 | } | 1555 | } |
1557 | order_vector.push_back(order); | 1556 | order_vector.push_back(order); |
@@ -1566,7 +1565,7 @@ std::string StylusPrinterCmd::ParseInput(std::string &input, std::vector<OrderIn | @@ -1566,7 +1565,7 @@ std::string StylusPrinterCmd::ParseInput(std::string &input, std::vector<OrderIn | ||
1566 | } | 1565 | } |
1567 | 1566 | ||
1568 | 1567 | ||
1569 | -std::string DistributePrinterCmd::ParseInput(std::string &input, std::vector<OrderInfo> &order_vector) | 1568 | +std::string DistributePrinterCmd::ParseInput(const std::string &input, std::vector<OrderInfo> &order_vector) |
1570 | { | 1569 | { |
1571 | std::string result = StatusCode::OK; | 1570 | std::string result = StatusCode::OK; |
1572 | 1571 | ||
@@ -1598,22 +1597,22 @@ std::string DistributePrinterCmd::ParseInput(std::string &input, std::vector<Ord | @@ -1598,22 +1597,22 @@ std::string DistributePrinterCmd::ParseInput(std::string &input, std::vector<Ord | ||
1598 | BOOST_FOREACH(PT::ptree::value_type &v, order_tree) | 1597 | BOOST_FOREACH(PT::ptree::value_type &v, order_tree) |
1599 | { | 1598 | { |
1600 | OrderInfo order; | 1599 | OrderInfo order; |
1601 | - order.title = title.c_str(); | ||
1602 | - order.reg_id = v.second.get<std::string>(JSON_TAG_REG_ID).c_str(); | ||
1603 | - order.sheet_id = v.second.get<std::string>(JSON_TAG_SHEET_ID).c_str(); | ||
1604 | - order.entry_fee= v.second.get<std::string>(JSON_TAG_ENTRY_FEE).c_str(); | ||
1605 | - order.seller_name = v.second.get<std::string>(JSON_TAG_SELLER_NAME).c_str(); | ||
1606 | - order.dis_name = v.second.get<std::string>(JSON_TAG_DIS_NAME).c_str(); | ||
1607 | - order.dis_date = v.second.get<std::string>(JSON_TAG_DIS_DATE).c_str(); | 1600 | + order.title = str_2_wstr(title).c_str(); |
1601 | + order.reg_id = str_2_wstr(v.second.get<std::string>(JSON_TAG_REG_ID)).c_str(); | ||
1602 | + order.sheet_id = str_2_wstr(v.second.get<std::string>(JSON_TAG_SHEET_ID)).c_str(); | ||
1603 | + order.entry_fee= str_2_wstr(v.second.get<std::string>(JSON_TAG_ENTRY_FEE)).c_str(); | ||
1604 | + order.seller_name = str_2_wstr(v.second.get<std::string>(JSON_TAG_SELLER_NAME)).c_str(); | ||
1605 | + order.dis_name = str_2_wstr(v.second.get<std::string>(JSON_TAG_DIS_NAME)).c_str(); | ||
1606 | + order.dis_date = str_2_wstr(v.second.get<std::string>(JSON_TAG_DIS_DATE)).c_str(); | ||
1608 | 1607 | ||
1609 | PT::ptree products_ptree = v.second.get_child(JSON_TAG_PRODUCTS); | 1608 | PT::ptree products_ptree = v.second.get_child(JSON_TAG_PRODUCTS); |
1610 | BOOST_FOREACH(PT::ptree::value_type &v, products_ptree) | 1609 | BOOST_FOREACH(PT::ptree::value_type &v, products_ptree) |
1611 | { | 1610 | { |
1612 | CommInfo comm_info; | 1611 | CommInfo comm_info; |
1613 | - comm_info.product_name = v.second.get<std::string>(JSON_TAG_PRODUCT_NAME).c_str(); | ||
1614 | - comm_info.amount = v.second.get<std::string>(JSON_TAG_AMOUNT).c_str(); | ||
1615 | - comm_info.place = v.second.get<std::string>(JSON_TAG_PLACE).c_str(); | ||
1616 | - comm_info.brand = v.second.get<std::string>(JSON_TAG_BRAND).c_str(); | 1612 | + comm_info.product_name = str_2_wstr(v.second.get<std::string>(JSON_TAG_PRODUCT_NAME)).c_str(); |
1613 | + comm_info.amount = str_2_wstr(v.second.get<std::string>(JSON_TAG_AMOUNT)).c_str(); | ||
1614 | + comm_info.place = str_2_wstr(v.second.get<std::string>(JSON_TAG_PLACE)).c_str(); | ||
1615 | + comm_info.brand = str_2_wstr(v.second.get<std::string>(JSON_TAG_BRAND)).c_str(); | ||
1617 | order.comm_vector.push_back(comm_info); | 1616 | order.comm_vector.push_back(comm_info); |
1618 | } | 1617 | } |
1619 | order_vector.push_back(order); | 1618 | order_vector.push_back(order); |
@@ -1745,8 +1744,7 @@ std::string DistributePrinterCmd::Print(std::vector<OrderInfo> &order_vector) | @@ -1745,8 +1744,7 @@ std::string DistributePrinterCmd::Print(std::vector<OrderInfo> &order_vector) | ||
1745 | 1744 | ||
1746 | y_point += TitleCtrlVI; | 1745 | y_point += TitleCtrlVI; |
1747 | dc->MoveTo(LineStartX, y_point); | 1746 | dc->MoveTo(LineStartX, y_point); |
1748 | - x_point += LineLength; | ||
1749 | - dc->LineTo(x_point, y_point); | 1747 | + dc->LineTo(LineStartX + LineLength, y_point); |
1750 | // | 1748 | // |
1751 | 1749 | ||
1752 | //打印商品信息头 | 1750 | //打印商品信息头 |
central_clearing_system/ETradeClient/hardware/hardware_cmd.h
@@ -154,7 +154,7 @@ public: | @@ -154,7 +154,7 @@ public: | ||
154 | virtual Reply Execute(const std::string& input) override; | 154 | virtual Reply Execute(const std::string& input) override; |
155 | 155 | ||
156 | private: | 156 | private: |
157 | - std::string ParseInput(std::string &input, std::vector<OrderInfo> &order_vector); | 157 | + std::string ParseInput(const std::string &input, std::vector<OrderInfo> &order_vector); |
158 | std::string Print(std::vector<OrderInfo> &order_vector); | 158 | std::string Print(std::vector<OrderInfo> &order_vector); |
159 | }; | 159 | }; |
160 | // | 160 | // |
central_clearing_system/ETradeClient/mfc_ui/pay_dlg.cpp
@@ -252,8 +252,7 @@ void PayDlg::OnBnClickedPayButtonPay() | @@ -252,8 +252,7 @@ void PayDlg::OnBnClickedPayButtonPay() | ||
252 | PT::ptree data_child = ptree.get_child("data"); | 252 | PT::ptree data_child = ptree.get_child("data"); |
253 | std::ostringstream os; | 253 | std::ostringstream os; |
254 | PT::write_json(os, data_child); | 254 | PT::write_json(os, data_child); |
255 | - CString data = str_2_wstr(std::string(os.str())).c_str(); | ||
256 | - statement_data = CT2A(data); | 255 | + statement_data = std::string(os.str()); |
257 | } | 256 | } |
258 | else | 257 | else |
259 | { | 258 | { |
dlcm/.vs/dlcm/v15/Browse.VC.db
0 → 100644
No preview for this file type
dlcm/dlcm/dlcm.vcxproj
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 2 | +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | <ItemGroup Label="ProjectConfigurations"> | 3 | <ItemGroup Label="ProjectConfigurations"> |
4 | <ProjectConfiguration Include="Debug|Win32"> | 4 | <ProjectConfiguration Include="Debug|Win32"> |
5 | <Configuration>Debug</Configuration> | 5 | <Configuration>Debug</Configuration> |
@@ -14,19 +14,20 @@ | @@ -14,19 +14,20 @@ | ||
14 | <ProjectGuid>{8256469C-3B17-4009-93A8-448F7A56DDEC}</ProjectGuid> | 14 | <ProjectGuid>{8256469C-3B17-4009-93A8-448F7A56DDEC}</ProjectGuid> |
15 | <Keyword>Win32Proj</Keyword> | 15 | <Keyword>Win32Proj</Keyword> |
16 | <RootNamespace>dlcm</RootNamespace> | 16 | <RootNamespace>dlcm</RootNamespace> |
17 | + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> | ||
17 | </PropertyGroup> | 18 | </PropertyGroup> |
18 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | 19 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
19 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | 20 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
20 | <ConfigurationType>Application</ConfigurationType> | 21 | <ConfigurationType>Application</ConfigurationType> |
21 | <UseDebugLibraries>true</UseDebugLibraries> | 22 | <UseDebugLibraries>true</UseDebugLibraries> |
22 | - <PlatformToolset>v120</PlatformToolset> | 23 | + <PlatformToolset>v141</PlatformToolset> |
23 | <CharacterSet>Unicode</CharacterSet> | 24 | <CharacterSet>Unicode</CharacterSet> |
24 | <UseOfMfc>Static</UseOfMfc> | 25 | <UseOfMfc>Static</UseOfMfc> |
25 | </PropertyGroup> | 26 | </PropertyGroup> |
26 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | 27 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
27 | <ConfigurationType>DynamicLibrary</ConfigurationType> | 28 | <ConfigurationType>DynamicLibrary</ConfigurationType> |
28 | <UseDebugLibraries>false</UseDebugLibraries> | 29 | <UseDebugLibraries>false</UseDebugLibraries> |
29 | - <PlatformToolset>v120</PlatformToolset> | 30 | + <PlatformToolset>v141</PlatformToolset> |
30 | <WholeProgramOptimization>true</WholeProgramOptimization> | 31 | <WholeProgramOptimization>true</WholeProgramOptimization> |
31 | <CharacterSet>Unicode</CharacterSet> | 32 | <CharacterSet>Unicode</CharacterSet> |
32 | <UseOfMfc>Static</UseOfMfc> | 33 | <UseOfMfc>Static</UseOfMfc> |