Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sbkclient
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
sbkclient
Commits
253d5ac2
Commit
253d5ac2
authored
Apr 24, 2018
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
防止两次添加partnerOrderId字段
parent
a56f48b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
ZH_Client.suo
+0
-0
ZH_Client/ZH_Client.vcxproj
+1
-1
ZH_Client/sbk_client.cpp
+13
-5
No files found.
ZH_Client.suo
View file @
253d5ac2
No preview for this file type
ZH_Client/ZH_Client.vcxproj
View file @
253d5ac2
...
...
@@ -18,7 +18,7 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>
Application
</ConfigurationType>
<ConfigurationType>
DynamicLibrary
</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
...
...
ZH_Client/sbk_client.cpp
View file @
253d5ac2
...
...
@@ -21,7 +21,7 @@ using namespace std;
#include "fmtool.h"
#include "fmdatabase.h"
#define FM_TEST
//
#define FM_TEST
//#define FM_TESTS
#include "testdataprocess.h"
...
...
@@ -561,9 +561,9 @@ int ProcessPosReqData(const char *indata, int /**needrbk*/*needcheck, int *reqTy
LOG
()
<<
"partnerOrderId code : "
<<
tmps
.
str
();
if
(
type
!=
3
)
if
(
type
!=
3
&&
!
tmproot
.
HasMember
(
JSON_KEY_ONLY
)
)
//json_object_set(root, JSON_KEY_ONLY, json_string(tmps.str().c_str()));
tmproot
.
AddMember
(
JSON_KEY_ONLY
,
Value
().
SetString
(
tmps
.
str
().
c_str
(),
strlen
(
tmps
.
str
().
c_str
()),
root
.
GetAllocator
()),
root
.
GetAllocator
());
tmproot
.
AddMember
(
JSON_KEY_ONLY
,
Value
().
SetString
(
tmps
.
str
().
c_str
(),
strlen
(
tmps
.
str
().
c_str
()),
root
.
GetAllocator
()),
tmp
root
.
GetAllocator
());
in
=
Tool
::
DocumentToString
(
tmproot
);
...
...
@@ -1024,6 +1024,14 @@ __declspec(dllexport) int __stdcall GetValue(char *indata, char *outdata)
}
}
//第一步查询超时,直接返回信息给pos
if
(
ssign
==
-
1
&&
needcheck
==
0
)
{
strcpy
(
outdata
,
global_info
.
error
.
c_str
());
LOG
()
<<
"return error message to pos :"
<<
outdata
;
return
0
;
}
LOG
()
<<
global_info
.
recvbuf
.
c_str
();
Document
root
;
root
.
Parse
(
global_info
.
recvbuf
.
c_str
());
...
...
@@ -1582,10 +1590,10 @@ void testinitclient()
//char a[] = "{\r\n \"pay_transId\":\"2017052600001162504297\",\r\n \"total_amount\":1,\r\n \"mcoupon_amount\":0,\r\n \"alipay_amount\":1,\r\n \"pay_ebcode\":\"10010\",\r\n \"ver\":1,\r\n \"fmId\":\"SXA1377O27012186844\",\r\n \"pay_date\":\"2017-05-26 17:01:16.004\",\r\n \"statusCode\":100\r\n}";
//char a[] = "{\"businessDate\":\"20170526\",\"code\":\"7310180009462033\",\"operatorId\":\"90001\",\"partnerId\":1443,\"products\":[{\"consume_num\":1,\"discount\":0,\"name\":\"Coffee\",\"number\":0,\"payment\":null,\"pid\":\"3488\",\"price\":3100,\"priceAct\":0,\"salesType\":\"Normal\",\"scope\":null}],\"promotionTag\":null,\"reqType\":71,\"stationId\":\"3\",\"storeId\":\"1713\",\"transAmount\":3100,\"transId\":\"6460\",\"undiscountAmount\":0,\"ver\":1}";
//char a[] = "{\r\n \"ver\": 1,\r\n \"reqType\": 0,\r\n \"partnerId\": 1443,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"16171\",\r\n \"operatorId\": \"9\",\r\n \"code\": \"120520219319771\"\r\n}";
char
a
[]
=
"{
\r\n
\"
ver
\"
: 1,
\r\n
\"
reqType
\"
: 62,
\r\n
\"
partnerId
\"
: 1443,
\r\n
\"
storeId
\"
:
\"
16171
\"
,
\r\n
\"
stationId
\"
:
\"
1
\"
,
\r\n
\"
refundId
\"
:
\"
1
\"
,
\r\n
\"
partnerOrderId
\"
:
\"
73101800094636814
\"
,
\r\n
\"
operatorId
\"
:
\"
2
\"
,
\r\n
\"
code
\"
:
\"
7310180009463684
\"
,
\r\n
\"
fmId
\"
:
\"
3684180423Z00000001
\"
,
\r\n
\"
businessDate
\"
:
\"
20180423
\"
,
\r\n
\"
refundAmount
\"
: 100
\r\n
}"
;
//
char a[] = "{\r\n \"ver\": 1,\r\n \"reqType\": 62,\r\n \"partnerId\": 1443,\r\n \"storeId\": \"16171\",\r\n \"stationId\": \"1\",\r\n \"refundId\": \"1\",\r\n \"partnerOrderId\": \"73101800094636814\",\r\n \"operatorId\": \"2\",\r\n \"code\": \"7310180009463684\",\r\n \"fmId\": \"3684180423Z00000001\",\r\n \"businessDate\": \"20180423\",\r\n \"refundAmount\": 100\r\n}";
//char a[] = "{\r\n \"transAmount\": 100,\r\n \"ver\": 1,\r\n \"reqType\": 0,\r\n \"partnerId\": 1446,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"160205\",\r\n \"operatorId\": \"9\",\r\n \"code\": \"231911841939438065993\",\r\n \"action\":\"101\",\r\n \"products\":[\r\n {\r\n \"number\":0,\r\n \"priceAct\": 0,\r\n \"price\": 1,\r\n \"name\":\"Coffee\",\r\n \"discount\": 0,\r\n \"pid\":\"1112134\",\r\n \"consumeNum\":0,\r\n \"categoryId\":\"11\",\r\n \"selected\":\"1\"\r\n }\r\n ]\r\n}";
//
char a[] = "{\r\n \"ver\": \"1\",\r\n \"reqType\": 71,\r\n \"partnerId\": 1443,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"16171\",\r\n \"operatorId\": \"9\",\r\n \"code\": \"120884658694630\",\r\n \"transId\":\"333388\",\r\n \"businessDate\":\"20180402\",\r\n \"partnerOrderId\":\"144316171120180402094813\"\r\n}";
char
a
[]
=
"{
\r\n
\"
ver
\"
:
\"
1
\"
,
\r\n
\"
reqType
\"
: 71,
\r\n
\"
partnerId
\"
: 1443,
\r\n
\"
stationId
\"
:
\"
1
\"
,
\r\n
\"
storeId
\"
:
\"
16171
\"
,
\r\n
\"
operatorId
\"
:
\"
9
\"
,
\r\n
\"
code
\"
:
\"
120884658694630
\"
,
\r\n
\"
transId
\"
:
\"
333388
\"
,
\r\n
\"
businessDate
\"
:
\"
20180402
\"
,
\r\n
\"
partnerOrderId
\"
:
\"
144316171120180402094813
\"\r\n
}"
;
//char a[] = "{\r\n \"ver\": \"1\",\r\n \"reqType\": 100,\r\n \"partnerId\": 1446,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"160205\",\r\n \"operatorId\": \"9\",\r\n \"code\": \"120884658694630\",\r\n \"transId\":\"144316171920180402061907\",\r\n \"businessDate\":\"20180402\"\r\n}";
//char a[] = "{\r\n \"businessDate\": \"20170601\",\r\n \"code\": \"120522852861225\",\r\n \"operatorId\": \"90001\",\r\n \"partnerId\": 1438,\r\n \"partnerOrderId\": \"1443171223323\",\r\n \"products\": [\r\n {\r\n \"consume_num\": 1,\r\n \"discount\": 0,\r\n \"name\": \"Coffee\",\r\n \"number\": 0,\r\n \"payment\": null,\r\n \"pid\": \"3488\",\r\n \"price\": 3100,\r\n \"priceAct\": 0,\r\n \"salesType\": \"Normal\",\r\n \"scope\": null\r\n }\r\n ],\r\n \"promotionTag\": null,\r\n \"reqType\": 0,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"16171\",\r\n \"transAmount\": 29,\r\n \"transId\": \"1\",\r\n \"undiscountAmount\": 0,\r\n \"ver\": 1\r\n}";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment