Commit 283e3ccb by wuyang.zou

fix CMakeList.txt For SUSE Linux Enterprise 10 64

Support Built 32 Bit App

Version: 1.3.2
parent f2e6ab1f
# CMake 最低版本要求
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.0)
# 指定gcc
SET(CMAKE_C_COMPILER "/usr/local/bin/gcc")
......@@ -14,6 +14,10 @@ SET(TARGET_NAME takeaway)
#支持C++11
add_compile_options(-std=c++11)
# 在 X86_64 机器上编译支持 32位系统的运行程序
SET(CMAKE_C_FLAGS -m32)
SET(CMAKE_CXX_FLAGS -m32)
#设置执行文件输出目录
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
......
cat /proc/verison
Linux version 2.6.16.46-0.12-default (geeko@buildhost) (gcc version 4.1.2 20070115 (prerelease) (SUSE Linux)) #2 Mon Jul 29 16:43:21 CST 2013
uname --all
Linux pos4 2.6.16.46-0.12-default #2 Mon Jul 29 16:43:21 CST 2013 i686 i686 i386 GNU/Linux
lsb_release -a
LSB Version: core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32:desktop-3.1-ia32:desktop-3.1-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: SUSE LINUX
Description: SUSE Linux Enterprise Desktop 10 (i586)
Release: 10
Codename: n/a
cat /etc/issue
Welcome to SUSE Linux Enterprise Desktop 10 SP1 (i586) - Kernel \r (\l).
===============================================================================================================================
Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-89-generic x86_64)
Linux version 5.4.0-89-generic (buildd@lgw01-amd64-034) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #100~18.04.1-Ubuntu SMP Wed Sep 29 10:59:42 UTC 2021
Linux pos1 5.4.0-89-generic #100~18.04.1-Ubuntu SMP Wed Sep 29 10:59:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Linux pos1 5.4.0-89-generic #100~18.04.1-Ubuntu SMP Wed Sep 29 10:59:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@pos1:~# Linux pos1 5.4.0-89-generic #100~18.04.1-Ubuntu SMP Wed Sep 29 10:59:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
Ubuntu 18.04.6 LTS
......@@ -41,7 +41,7 @@ struct productAttr
struct paymentDetail
{
int amount=0; //支付金额
int type=0; //支付类型
std::string type; //支付类型(int -> string)
std::string trans_id; //支付交易号
std::string account_id; //支付账户号
std::string pay_code; //支付码
......
{"fm_cmd":1000,"listen_port":24445,"storeId":"208888","pos_id":"6","operator_id":"zouwuyang","is_master":false,"plugin_comment":"123.60.107.183","ver":1,"version":"1.3.1 RC"}
\ No newline at end of file
{"fm_cmd":1000,"listen_port":24445,"storeId":"208888","pos_id":"5","operator_id":"zouwuyang","is_master":false,"plugin_comment":"123.60.107.183","ver":1,"version":"1.3.1 RC"}
\ No newline at end of file
......@@ -22,8 +22,8 @@ port=24445
;Windows 模拟程序 新增可配置功能:
;配置门店号, POS号, 是否主POS标识, 插件模拟角色: 默认是插件(可控制是否自动登录) / simulatorRole=pos 标识模拟POS发送登录请求;
;storeId=2077777
;posId=1
;isMaster=false
storeId=208888
posId=15
isMaster=false
;simulatorRole=pos
;autoLogin=true
autoLogin=true
{"channel":"214","cityId":"","delivery":{"basicPrice":0,"customerAddress":"","customerName":"","customerPhone":"13244445555","deliveryId":"","deliveryTime":"","distancePrice":0,"logisticsPhysicalCompany":"","name":"","phone":"","type":""},"invoice":{"companyName":"","invoiceType":0,"taxNum":"","title":"","transNum":"07212088889997000000619"},"offlinePoints":false,"orderContent":{"appointmentVO":{"appointmentTime":"20210721151000","isAppointment":1},"createTime":"20210721150320","customer":[{"accountId":"5849a3d494ae4ceb946ee9df83bb434c","accountType":"0","cardNo":"8820210002000005021","dyCode":"","level":"","mobileNo":""}],"deliveryFee":0,"ecoupons":[],"extendedAttributes":{"activities":[],"amountMax":18100,"discountAmount":0,"discountMax":0,"discountRate":100,"discountThreshold":0,"memberDay":0,"memberDayPoint":95,"performanceServiceFee":0,"platformServiceFee":0,"pointMemberDay":0,"pointsMax":0,"pointsMultiple":5.3,"pointsSumMax":0,"source":8},"ignorePoints":0,"orderCoupons":[ {"couponId":"123456","discount":0,"ebcode":"ebcode1234","securitiesTrader":"234", "totalAmount":1000, "transNum":"12344321","type":"P","useAmount":800, "remainingAmt":0,"price":1000, "sku":"234432", "campaignAmt":200,"paid":0,"remainingAmt":0, "supplierNo":"","activityId":"","bonusDayBusinessType":"S","bonusDayBusinessAmt":300} ],"orders":{"cancelStatus":"","deliveryStatus":"","deliveryStatusDesc":"","id":213977221039128893,"orderId":"214213992792753493255","orderType":"002","parentId":"","pickupCode":"A0011","pickupPoint":"002","products":[{"additionalProducts":[],"attributes":"","catgId":"994001","couponQty":0,"groupIndex":"","groupName":"","name":"早餐活动加价换购","originalPrice":900,"price":900,"productCode":"10_20850869","productType":"21","qty":1,"sku":"20850869","source":"","specs":[{"extraPrice":100,"name":"香卤蛋(带壳)","originalPrice":200,"price":200,"qty":1,"sku":"20708443"},{"extraPrice":100,"name":"奥尔良鸡腿割包","originalPrice":590,"price":300,"qty":1,"sku":"20374693"},{"extraPrice":0,"name":"日光现磨豆浆(原味)","originalPrice":300,"price":300,"qty":1,"sku":"20186647"}],"status":""},{"additionalProducts":[],"attributes":"","catgId":"994001","couponQty":0,"groupIndex":"","groupName":"","name":"早餐10元套餐1","originalPrice":1000,"price":1000,"productCode":"10_0600521","productType":"21","qty":1,"sku":"20852344","source":"","specs":[{"extraPrice":0,"name":"味全严选牧场牛奶(小)","originalPrice":680,"price":600,"qty":1,"sku":"20402754"},{"extraPrice":0,"name":"梅菜烧肉包(新)","originalPrice":320,"price":100,"qty":1,"sku":"20660673"},{"extraPrice":0,"name":"孜然烤鸡大口饭团","originalPrice":580,"price":300,"qty":1,"sku":"20342883"}],"status":""},{"additionalProducts":[],"attributes":"","catgId":"726006","couponQty":0,"groupIndex":"","groupName":"","name":"全家生物降解大号购物袋","originalPrice":90,"price":90,"productCode":"10_0571517","productType":"1","qty":1,"sku":"20823436","source":"","specs":[],"status":""}],"reason":"地址信息填写错误","reasonForFailure":"","remark":"","status":"40005","statusDesc":"用户退款申请成功","storeType":0},"payInfos":[{"accountId":"8820210002000005021","amount":1990,"fmId":"TZHLC1O2566496104","payCode":"","payType":"10036","performanceServiceFee":0,"platformServiceFee":0,"transNum":"2021072122001473981458298876"}],"payType":"10036","points":{"basicPoint":0,"extraPoint":0,"familyRice":0,"nkbBasicPoint":95,"nkbExtraPoint":0,"pointDetails":[],"totalPoint":95,"zhxPoint":0},"promotions":null,"sessionId":"2142088882139927919020495420","totalAmount":1990,"totalCouponDiscount":0,"totalDiscount":0,"totalExcessiveCharge":0,"wmDiscount":0,"wmPtSharedDiscount":0,"wmSjSharedDiscount":0},"orderIds":[],"pcId":"10","sellerInfo":null,"shopInfo":{"barCounter":"","child_store_id":"","operator":"","posId":"4","selfHelpMac":{"id":"","shelf":""},"storeId":"208888","store_type":"null"},"token":"","ver":0}
\ No newline at end of file
{"channel":"219","cityId":"003","delivery":{"basicPrice":0,"customerAddress":"","customerName":"","customerPhone":"13119867445","deliveryFinishTime":"","deliveryId":"","deliveryTime":"","distancePrice":0,"logisticsPhysicalCompany":"","name":"","phone":"","provinceName":"","sendOutTime":"","type":""},"invoice":{"companyName":"","invoiceType":0,"taxNum":"","title":"","transNum":"11014034019997000000501"},"offlinePoints":false,"orderContent":{"appointmentVO":{"appointmentTime":"20221101124000","isAppointment":1},"createTime":"20221101123427","customer":[{"accountId":"256334928765024804","accountType":"1","cardNo":"8610212009008790358","dyCode":"","level":"1","mobileNo":"13119867445"}],"deliveryFee":0,"ecoupons":[],"extendedAttributes":{"activities":[],"amountMax":0,"discountAmount":0,"discountMax":0,"discountRate":100,"discountThreshold":0,"memberDay":0,"memberDayPoint":0,"performanceServiceFee":0,"platformServiceFee":0,"pointMemberDay":0,"pointsMax":0,"pointsMultiple":0,"pointsSumMax":0,"source":4,"storehouseId":""},"ignorePoints":0,"orderCoupons":[{"activityId":"FM2210249003","bonusDayBusinessAmt":0,"bonusDayBusinessType":"","campaignAmt":0,"couponId":"7100028567","couponName":"每月礼包20-5元劵","couponProduct":[],"discount":-500,"ebcode":"1000000001","orderId":"219256353427933669163","paid":0,"price":0,"remainingAmt":0,"securitiesTrader":"N","sku":"","supplierNo":"1000000001","totalAmount":500,"transNum":"801101000008","type":"C","useAmount":500,"usedNum":1}],"orders":{"cancelStatus":"","deliveryStatus":"","deliveryStatusDesc":"","id":256354541336824349,"orderId":"219256353427933669163","orderType":"002","parentId":"","pickupCode":"A0002","pickupPoint":"002","products":[{"activityId":"","additionalProducts":[],"attributes":"","catgId":"181003","couponQty":0,"givePointApportion":3,"groupIndex":"","groupName":"","id":256354541336824350,"moneyApportion":269,"name":"冷冻烤红薯","originalPrice":650,"price":520,"productCode":"20_0724500","productType":"1","qty":4,"realQty":0,"refundQty":0,"sku":"26046561","source":"","specs":[],"status":"","useCouponApportion":124,"usePointApportion":124,"usePromotionApportion":130,"virtualCouponApportion":0,"weight":180}],"reason":"支付已完成","reasonForFailure":"","remark":"","status":"40004","statusDesc":"已支付","storeType":0},"payInfos":[{"accountId":"8610212009008790358","amount":500,"fmId":"","payCode":"","payType":"1010004","performanceServiceFee":0,"platformServiceFee":0,"transNum":"801101000008"},{"accountId":"8610212009008790358","amount":500,"fmId":"SXA1O37568633025","payCode":"","payType":"1010005","performanceServiceFee":0,"platformServiceFee":0,"transNum":"223051234321"},{"accountId":"8610212009008790358","amount":1080,"fmId":"SXA1O37568625625","payCode":"","payType":"20071","performanceServiceFee":0,"platformServiceFee":0,"transNum":"2022110122001429921440751223"}],"payType":"20071","points":{"basicPoint":15,"extraPoint":0,"familyRice":1,"nkbBasicPoint":15,"nkbExtraPoint":0,"pointDetails":[{"desc":"","name":"消费1元送1积分","pcode":"202001010001","point":20,"qty":0,"sku":"20383916","type":"00"}],"totalPoint":30,"zhxPoint":0},"promotions":{"promtionDetails":[{"couponId":"","desc":"","discount":130,"giftQty":0,"giftSku":"","name":"","originalPrice":650,"parentSku":"","pcode":"202210140079","proType":"","promotionPrice":520,"sku":"26046561","type":"40"},{"couponId":"","desc":"","discount":130,"giftQty":0,"giftSku":"","name":"","originalPrice":650,"parentSku":"","pcode":"202210140079","proType":"","promotionPrice":520,"sku":"26046561","type":"40"},{"couponId":"","desc":"","discount":130,"giftQty":0,"giftSku":"","name":"","originalPrice":650,"parentSku":"","pcode":"202210140079","proType":"","promotionPrice":520,"sku":"26046561","type":"40"},{"couponId":"","desc":"","discount":130,"giftQty":0,"giftSku":"","name":"","originalPrice":650,"parentSku":"","pcode":"202210140079","proType":"","promotionPrice":520,"sku":"26046561","type":"40"}],"totalDiscount":520,"totalOriginalPrice":2600,"totalPromotionPrice":2080},"sessionId":"2194034012563534266449692570","totalAmount":2080,"totalCouponDiscount":0,"totalDiscount":520,"totalExcessiveCharge":0,"wmDiscount":0,"wmPtSharedDiscount":0,"wmSjSharedDiscount":0},"orderIds":[],"orderStatusList":[{"channel":"219","createTime":1667277274514,"id":0,"modifyTime":1667277274514,"orderId":"219256353427933669163","orderStatus":"40004","reason":"支付已完成","reasonForFailure":""},{"channel":"219","createTime":1667277267832,"id":0,"modifyTime":1667277267832,"orderId":"219256353427933669163","orderStatus":"40001","reason":"","reasonForFailure":""}],"pcId":"20","sellerInfo":null,"shopInfo":{"barCounter":"","child_store_id":"","operator":"","posId":"","selfHelpMac":null,"storeId":"403401","store_type":""},"token":"","ver":1,"fm_cmd":1001,"pk_id":42348,"order_unique_id":111}
\ No newline at end of file
{"fm_cmd":1000,"listen_port":24445,"storeId":"208888","pos_id":"6","operator_id":"zouwuyang","is_master":false,"plugin_comment":"123.60.107.183","ver":1,"version":"1.3.1 RC"}
\ No newline at end of file
[SYS]
port=24446
#<<贝瑞>>
#config.ini 文件 中 [ODS] 模块中的
#(生产环境外网 IP)
#ip: 103.13.247.77
#(测试环境外网 IP [内网IP:10.0.103.116] )
#ip: 103.13.247.78
#<<全家>
#config.ini 文件 中 [ODS] 模块中的
#(生产环境外网 IP [内网IP:10.0.100.70] )
#ip: 103.13.247.72
#(测试环境外网 IP [内网IP:10.0.102.14] )
#ip: 103.13.247.73
#(生产环境外网 IP [内网IP:10.251.100.70] )
#ip: 123.60.107.182
#(测试环境外网 IP [内网IP:10.251.102.14] )
#ip: 123.60.107.183
[ODS]
ip=api.ods.chinafamilymart.com.cn
# ip=api.ods.chinafamilymart.com.cn
ip =123.60.107.183
pushPort=30001
recvPort=30002
......@@ -28,8 +22,8 @@ port=24445
;Windows 模拟程序 新增可配置功能:
;配置门店号, POS号, 是否主POS标识, 插件模拟角色: 默认是插件(可控制是否自动登录) / simulatorRole=pos 标识模拟POS发送登录请求;
;storeId=2077777
;posId=1
;isMaster=false
;simulatorRole=pos
storeId=208888
posId=6
isMaster=false
simulatorRole=pos
;autoLogin=true
* GLOBAL:
ENABLED = true
TO_FILE = true
TO_STANDARD_OUTPUT = true
FORMAT = "[%level | %datetime] | %msg"
FILENAME = "./logs/log.log"
MILLISECONDS_WIDTH = 3
PERFORMANCE_TRACKING = false
MAX_LOG_FILE_SIZE = 20485760
LOG_FLUSH_THRESHOLD = 10
* TRACE:
FILENAME = "./logs/trace_log.log"
* DEBUG:
FILENAME = "./logs/debug_log.log"
* FATAL:
ENABLED = false
* ERROR:
FILENAME = "./logs/error_log.log"
* WARNING:
FILENAME = "./logs/warning_log.log"
* INFO:
FILENAME = "./logs/info_log.log"
* VERBOSE:
ENABLED = false
@echo OFF
if not "%~1"=="p" start /min cmd.exe /c %0 p&exit
set _selfAppName=cmd
set _task=takeaway_d.exe
set _svr=E:\zouwuyang\FamilyMart\PosPluginClient\familyMart_takeaway\bin\takeaway_d.exe
set _svrWorkDir=E:\zouwuyang\FamilyMart\PosPluginClient\familyMart_takeaway\bin\
echo ******** %time% Daemon - Daemon Plugin Bat Begin Running ...******** >nul
rem 检查 Daemon Script Running Or Not[ Can't gt 1, Will Been Call More 2];
for /f "delims=" %%a in ('tasklist /nh^|find /i "%_selfAppName%" /c') do set _daemonCount=%%a
echo ******** %time% CheckOrStart:: %_daemonCount% ******** >nul
if %_daemonCount% geq 3 (
echo ******** %time% CheckOrStart:: Daemon Second Running, Count geq 3 [first equ 2] Then Exit ...******** >nul
exit
) else (
echo ******** %time% CheckOrStart:: Daemon Fist Running, Then Go ...******** >nul
)
:CheckOrStart
rem 检查 Plugin App Running Or Not;
ping 127.0.0.257 -n 30 >nul & tasklist /nh | findstr /i %_task% >nul
:: echo %ERRORLEVEL% >nul
if ERRORLEVEL 1 (
echo %ERRORLEVEL%
echo ******** %time% CheckOrStart:: App Not Running ...******** >nul & goto StartSvr
) else (
echo %ERRORLEVEL%
echo ******** %time% CheckOrStart:: App Running ...******** >nul & goto CheckAgain
)
:StartSvr
echo ******** %time% StartSvr:: Restart Plugin Begin...******** >nul
cd %_svrWorkDir%
start %_svr%
echo ******** %time% StartSvr:: Restart Plugin End ...******** >nul
ping 127.0.0.257 -n 20 >nul & goto CheckOrStart
:CheckAgain
echo ******** %time% CheckAgain:: Plugin App Running, Keep Check After 200s ...******** >nul
ping 127.0.0.257 -n 20 >nul & goto CheckOrStart
\ No newline at end of file
[SYS]
port=24446
#<<全家>
#config.ini 文件 中 [ODS] 模块中的
#(生产环境外网 IP [内网IP:10.251.100.70] )
#ip: 123.60.107.182
#(测试环境外网 IP [内网IP:10.251.102.14] )
#ip: 123.60.107.183
[ODS]
# ip=api.ods.chinafamilymart.com.cn
ip =123.60.107.183
pushPort=30001
recvPort=30002
socketTimeout=120
[POS]
ip=127.0.0.1
port=24445
;Windows 模拟程序 新增可配置功能:
;配置门店号, POS号, 是否主POS标识, 插件模拟角色: 默认是插件(可控制是否自动登录) / simulatorRole=pos 标识模拟POS发送登录请求;
storeId=208888
posId=5
isMaster=false
simulatorRole=pos
;autoLogin=true
* GLOBAL:
ENABLED = true
TO_FILE = true
TO_STANDARD_OUTPUT = true
FORMAT = "[%level | %datetime] | %msg"
FILENAME = "./logs/log.log"
MILLISECONDS_WIDTH = 3
PERFORMANCE_TRACKING = false
MAX_LOG_FILE_SIZE = 20485760
LOG_FLUSH_THRESHOLD = 10
* TRACE:
FILENAME = "./logs/trace_log.log"
* DEBUG:
FILENAME = "./logs/debug_log.log"
* FATAL:
ENABLED = false
* ERROR:
FILENAME = "./logs/error_log.log"
* WARNING:
FILENAME = "./logs/warning_log.log"
* INFO:
FILENAME = "./logs/info_log.log"
* VERBOSE:
ENABLED = false
#!/bin/sh
cd /opt/pos/zhclient
nohup /opt/pos/zhclient/zh_client > /dev/null &
nohup /opt/pos/fmtakeout/takeaway_d.exe > /dev/null &
export LANG=zh_CN.GBK
export LC_ALL=zh_CN.GBK
CREAM_JAR_DIR=/opt/pos/cream
CREAM_JAR_BAK_DIR=/opt/pos/cream_bak
GROOVY_HOME=/opt/pos/groovy-1.7
POS_HOME=/opt/pos
cd $POS_HOME
export DISPLAY=:0.0
/usr/X11R6/bin/xhost +
/usr/bin/x11vnc -forever -shared -ncache 10 -clip 800x600+0+0 -display :0 &
sh bin/setvolume.sh
sh bin/deploy_sandini.sh
/bin/chmod a+rw /dev/ttyS*
#/bin/chmod a+x bin/catAdapter
/sbin/modprobe lp
# Classpath for Cream --
if test -n "$CLASSPATH" ; then
CLASSPATH="${CREAM_JAR_DIR}/cream.jar:${POS_HOME}/conf:${CLASSPATH}"
else
CLASSPATH="${CREAM_JAR_DIR}/cream.jar:${POS_HOME}/conf"
fi
CLASSPATH="${CLASSPATH}:${GROOVY_HOME}/embeddable/groovy-all-1.7.10.jar"
for n in ${POS_HOME}/lib/*.jar ; do
CLASSPATH="${n}:${CLASSPATH}"
done
# Upgrade cream --
if [ -f cream_hot.jar ]; then
/bin/cp -f cream_hot.jar ${CREAM_JAR_DIR}/cream.jar
/bin/mv -f cream_hot.jar ${CREAM_JAR_BAK_DIR}/cream_hot.jar.`date +%Y-%m-%d`
fi
if [ -f cream.jar.pack.gz ]; then
/usr/bin/unpack200 cream.jar.pack.gz ${CREAM_JAR_DIR}/cream.jar
/bin/mv -f cream.jar.pack.gz ${CREAM_JAR_BAK_DIR}/cream.jar.pack.gz.`date +%Y-%m-%d`
fi
# Run Cream POS --
LD_LIBRARY_PATH=${POS_HOME}/native:${POS_HOME}
export LD_LIBRARY_PATH
MAIN_CLASS=hyi.cream.POSTerminalApplication
#MAIN_CLASS=hyi.cream.Bootstrapper
/usr/bin/java -Duser.language="zh" -Duser.region="CN" -DuseFakeCAT=false -DskipConnectServer=true \
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=192.168.0.207 \
-Djava.library.path=${POS_HOME}/native -Dfile.encoding=GBK -cp $CLASSPATH ${MAIN_CLASS} \
-screensize 800x600 \
>> log/stdout.log 2>> log/stderr.log
# Shrink log files
tail -c 50240000 log/stdout.log > log/stdout_.log; mv -f log/stdout_.log log/stdout.log
tail -c 50240000 log/stderr.log > log/stderr_.log; mv -f log/stderr_.log log/stderr.log
tail -c 50240000 log/player.log > log/player_.log; mv -f log/player_.log log/player.log
tail -c 50240000 log/trace_state.log > log/trace_state_.log; mv -f log/trace_state_.log log/trace_state.log
rm -f /root/.serverauth*
pkill x11vnc
......@@ -270,8 +270,14 @@ bool JsonModule::getPushOrders(IN const char* json,OUT orderObj &order)
//咖啡小程序订单,需要单独处理.支付类型为"10101"的金额,减去配送费
std::string payType = GetJsonStringSafe(payInfos_obj, "payType");
//支付类型需要拼接 channel+payType
std::string _strType=order.channel+GetJsonStringSafe(payInfos_obj,"payType");
detail.type = atoi(_strType.data());
std::string _strType = order.channel+GetJsonStringSafe(payInfos_obj,"payType");
detail.type = _strType; // detail.type = atoi(_strType.data());
/*
LOG(INFO) << "PayInfo: " << payType.c_str() << " channel: " << order.channel.c_str()
<< " channel+paytype: " << _strType.c_str() << " detail.type: " << detail.type.c_str()
<< " atol " << atol(_strType.data())
<< " atoll " << atoll(_strType.data());
*/
detail.trans_id = GetJsonStringSafe(payInfos_obj,"transNum");
detail.account_id=GetJsonStringSafe(payInfos_obj,"accountId");
detail.pay_code= GetJsonStringSafe(payInfos_obj, "payCode");
......@@ -1176,7 +1182,7 @@ std::string JsonModule::_convertToNewOrderJson(orderObj &obj)
writer.Key("amount");
writer.Int(obj.payInfo.vecDetail[i].amount);
writer.Key("type");
writer.Int(obj.payInfo.vecDetail[i].type);
writer.String(obj.payInfo.vecDetail[i].type.c_str());
writer.Key("trans_id");
writer.String(obj.payInfo.vecDetail[i].trans_id.c_str());
writer.Key("account_id");
......@@ -2270,7 +2276,7 @@ std::string JsonModule::getLocalPosInitData()
std::string JsonModule::getTestOrderJson() {
std::string strBinPath = GetProcDir();
std::string strTestOrderFile = strBinPath + "testOrderJson.json";
std::string strTestOrderFile = strBinPath + "TestOrderJson.json";
std::ifstream fileStream(strTestOrderFile.c_str(), std::ios::binary | std::ios::in | std::ios::ate );
if (!fileStream.is_open()) {
......
......@@ -21,7 +21,7 @@ bool TCPSocket::create() {
return false;
//查看默认 发送/接收 缓存区大小
int rcvbuf_len;
// int rcvbuf_len;
#ifdef WIN32
int len;
#else
......
......@@ -36,7 +36,7 @@ std::string g_plugin_auto_login_init;
TCPClient g_simulator_pos_client;
#endif
std::string g_plugin_version = "1.3.1 RC"; //插件版本号;
std::string g_plugin_version = "1.3.2 RC"; //插件版本号;
std::string g_init_data;
std::string g_init_data_ods_back;
std::string g_local_pos_init_data; // 上一次 POS 初始化请求报文 本地化数据;
......@@ -207,7 +207,6 @@ int main(int argc,char *argv[])
}
#endif
#ifdef WIN32
// Test Add New Feature Convert Result: Column Field
std::string testOrderJson = jsonToolTemp.getTestOrderJson();
if (testOrderJson.length()) {
......@@ -218,12 +217,15 @@ int main(int argc,char *argv[])
LOG(INFO) << charset_u2g(convertTestOrderJson);
LOG(INFO) << "----------No charset_u2g(*)-------------";
LOG(INFO) << convertTestOrderJson;
LOG(INFO) << "----------- Plugin Read & Convert Local Test Order File End -----------";
}
else {
LOG(INFO) << "----------- Plugin Read&Convert Local Test Order File Failed------------";
}
}
#ifdef WIN32
HANDLE hTakeway = CreateThread(NULL, 0, PosHandle::listen_pos_func, NULL, 0, NULL);
#else
// 监听POS请求的线程
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment