Commit 7fed966e6d5438c4873c6091dd8b8e4018a32664

Authored by liuye
1 parent 229f3ca3

bugfix<central>解决打印时数据解析异常的问题

1.69boost解析中文时有问题,在最后打印时再解析成宽字符

Signed-off-by: liuye <liuye@diligrp.com>
central_clearing_system/ETradeClient.rc
... ... @@ -288,8 +288,8 @@ END
288 288 //
289 289  
290 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 293 FILEFLAGSMASK 0x3fL
294 294 #ifdef _DEBUG
295 295 FILEFLAGS 0x1L
... ... @@ -306,12 +306,12 @@ BEGIN
306 306 BEGIN
307 307 VALUE "CompanyName", "地利集团【DILI GROUP】"
308 308 VALUE "FileDescription", "电子交易结算综合业务系统"
309   - VALUE "FileVersion", "4.0.4.0"
  309 + VALUE "FileVersion", "4.0.5.0"
310 310 VALUE "InternalName", "电子交易结算综合业务系统"
311 311 VALUE "LegalCopyright", "(C) 地利集团保留所有权利。"
312 312 VALUE "OriginalFilename", "电子交易结算综合业务系统"
313 313 VALUE "ProductName", "电子交易结算综合业务系统"
314   - VALUE "ProductVersion", "4.0.4.0"
  314 + VALUE "ProductVersion", "4.0.5.0"
315 315 END
316 316 END
317 317 BLOCK "VarFileInfo"
... ...
central_clearing_system/ETradeClient/browser/async_js_callback_handler.cpp
... ... @@ -78,8 +78,7 @@ namespace HW
78 78 PT::ptree data_child = ptree.get_child(JSON_TAG_DATA);
79 79 std::ostringstream os;
80 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 83 else
85 84 {
... ...
central_clearing_system/ETradeClient/hardware/hardware_cmd.cpp
... ... @@ -1373,8 +1373,7 @@ std::string StylusPrinterCmd::Print(std::vector&lt;OrderInfo&gt; &amp;order_vector)
1373 1373  
1374 1374 y_point += TitleCtrlVI;
1375 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 &amp;input, std::vector&lt;OrderIn
1535 1534 BOOST_FOREACH(PT::ptree::value_type &v, order_tree)
1536 1535 {
1537 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 1545 PT::ptree products_ptree = v.second.get_child(JSON_TAG_TRADE_PRODUCTS);
1547 1546 BOOST_FOREACH(PT::ptree::value_type &v, products_ptree)
1548 1547 {
1549 1548 CommInfo comm_info;
1550 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 1554 order.comm_vector.push_back(comm_info);
1556 1555 }
1557 1556 order_vector.push_back(order);
... ... @@ -1566,7 +1565,7 @@ std::string StylusPrinterCmd::ParseInput(std::string &amp;input, std::vector&lt;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 1570 std::string result = StatusCode::OK;
1572 1571  
... ... @@ -1598,22 +1597,22 @@ std::string DistributePrinterCmd::ParseInput(std::string &amp;input, std::vector&lt;Ord
1598 1597 BOOST_FOREACH(PT::ptree::value_type &v, order_tree)
1599 1598 {
1600 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 1608 PT::ptree products_ptree = v.second.get_child(JSON_TAG_PRODUCTS);
1610 1609 BOOST_FOREACH(PT::ptree::value_type &v, products_ptree)
1611 1610 {
1612 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 1616 order.comm_vector.push_back(comm_info);
1618 1617 }
1619 1618 order_vector.push_back(order);
... ... @@ -1745,8 +1744,7 @@ std::string DistributePrinterCmd::Print(std::vector&lt;OrderInfo&gt; &amp;order_vector)
1745 1744  
1746 1745 y_point += TitleCtrlVI;
1747 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 154 virtual Reply Execute(const std::string& input) override;
155 155  
156 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 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 252 PT::ptree data_child = ptree.get_child("data");
253 253 std::ostringstream os;
254 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 257 else
259 258 {
... ...
dlcm/.vs/dlcm/v15/Browse.VC.db 0 → 100644
No preview for this file type
dlcm/dlcm/dlcm.vcxproj
1 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 3 <ItemGroup Label="ProjectConfigurations">
4 4 <ProjectConfiguration Include="Debug|Win32">
5 5 <Configuration>Debug</Configuration>
... ... @@ -14,19 +14,20 @@
14 14 <ProjectGuid>{8256469C-3B17-4009-93A8-448F7A56DDEC}</ProjectGuid>
15 15 <Keyword>Win32Proj</Keyword>
16 16 <RootNamespace>dlcm</RootNamespace>
  17 + <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
17 18 </PropertyGroup>
18 19 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19 20 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20 21 <ConfigurationType>Application</ConfigurationType>
21 22 <UseDebugLibraries>true</UseDebugLibraries>
22   - <PlatformToolset>v120</PlatformToolset>
  23 + <PlatformToolset>v141</PlatformToolset>
23 24 <CharacterSet>Unicode</CharacterSet>
24 25 <UseOfMfc>Static</UseOfMfc>
25 26 </PropertyGroup>
26 27 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
27 28 <ConfigurationType>DynamicLibrary</ConfigurationType>
28 29 <UseDebugLibraries>false</UseDebugLibraries>
29   - <PlatformToolset>v120</PlatformToolset>
  30 + <PlatformToolset>v141</PlatformToolset>
30 31 <WholeProgramOptimization>true</WholeProgramOptimization>
31 32 <CharacterSet>Unicode</CharacterSet>
32 33 <UseOfMfc>Static</UseOfMfc>
... ...