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
8c95cb60
Commit
8c95cb60
authored
Jun 27, 2017
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加如下类型冲正并测试(91,93,96,98, 101, 103)
parent
cef151d2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
12 deletions
+66
-12
.gitignore
+0
-1
ZH_Client.suo
+0
-0
ZH_Client/sbk_client.cpp
+66
-11
bin/sbk-dll.zip
+0
-0
No files found.
.gitignore
View file @
8c95cb60
...
...
@@ -3,7 +3,6 @@
*.pdb
*.obj
Debug/log/
*.zip
*.sdf
*.opensdf
*.user
...
...
ZH_Client.suo
View file @
8c95cb60
No preview for this file type
ZH_Client/sbk_client.cpp
View file @
8c95cb60
...
...
@@ -329,7 +329,7 @@ int ProcessPosReqData(const char *indata, string &in, int *needrbk, int *reqType
type
=
(
int
)
json_integer_value
(
reqtype
);
*
reqType_i
=
type
;
if
(
type
==
72
||
type
==
62
||
type
==
71
)
if
(
type
==
72
||
type
==
62
||
type
==
71
||
type
==
90
||
type
==
92
||
type
==
95
||
type
==
97
||
type
==
100
||
type
==
102
)
*
needrbk
=
1
;
if
(
type
==
71
||
type
==
3
)
...
...
@@ -509,18 +509,73 @@ int SaveRollBackFile(const string text)
int
type
=
json_integer_value
(
reqType
);
if
(
type
==
62
)
switch
(
type
)
{
case
62
:
json_integer_set
(
reqType
,
(
json_int_t
)
83
);
}
else
if
(
type
==
71
||
type
==
72
)
{
break
;
case
71
:
json_integer_set
(
reqType
,
(
json_int_t
)
3
);
}
else
{
break
;
case
72
:
json_integer_set
(
reqType
,
(
json_int_t
)
3
);
break
;
case
90
:
json_integer_set
(
reqType
,
(
json_int_t
)
91
);
break
;
case
92
:
json_integer_set
(
reqType
,
(
json_int_t
)
93
);
break
;
case
95
:
json_integer_set
(
reqType
,
(
json_int_t
)
96
);
break
;
case
97
:
json_integer_set
(
reqType
,
(
json_int_t
)
98
);
break
;
case
100
:
json_integer_set
(
reqType
,
(
json_int_t
)
101
);
break
;
case
102
:
json_integer_set
(
reqType
,
(
json_int_t
)
103
);
break
;
default:
json_decref
(
root
);
return
1
;
}
//if(type == 62)
//{
// json_integer_set(reqType, (json_int_t)83);
//}else if (type == 90)
//{
// json_integer_set(reqType, (json_int_t)91);
//}else if (type == 92)
//{
// json_integer_set(reqType, (json_int_t)93);
//}else if (type == 95)
//{
// json_integer_set(reqType, (json_int_t)96);
//}else if (type == 97)
//{
// json_integer_set(reqType, (json_int_t)98);
//}
//else if (type == 100)
//{
// json_integer_set(reqType, (json_int_t)101);
//}
//else if (type == 102)
//{
// json_integer_set(reqType, (json_int_t)101);
//}
//else if(type == 71 || type == 72)
//{
// json_integer_set(reqType, (json_int_t)3);
//}else
//{
// json_decref(root);
// return 1;
//}
char
*
json
=
json_dumps
(
root
,
JSON_COMPACT
|
JSON_SORT_KEYS
);
strcpy_s
(
inmsg
,
MAX_BUF_LEN
,
json
);
...
...
@@ -1091,8 +1146,8 @@ void testinitclient()
//char a[] = "{\"ver\":1,\"partnerId\":1234,\"reqType\": 62,\"coupon\": \"122222222222\",\"stationId\": \"1\",\"storeId\": \"999999\",\"operator_id\": \"00000002\" }";
//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
\"
:
\"
12344
\"
,
\r\n
\"
operatorId
\"
:
\"
9
\"
,
\r\n
\"
code
\"
:
\"
adadadada
\"\r\n
}"
;
//char a[] = "{\r\n \"businessDate\": \"20170601\",\r\n \"code\": \"7310188850000277\",\r\n \"operatorId\": \"90001\",\r\n \"partnerId\": 1443,\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\": 72,\r\n \"stationId\": \"9\",\r\n \"storeId\": \"12344\",\r\n \"transAmount\": 29,\r\n \"transId\": 1
,\r\n \"undiscountAmount\": 0,\r\n \"ver\": 1\r\n}";
//char a[] = "{\r\n \"ver\": 1,\r\n \"reqType\": 71
,\r\n \"partnerId\": 1443,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"12344\",\r\n \"operatorId\": \"9\",\r\n \"code\": \"adadadada\"\r\n}";
char
a
[]
=
"{
\r\n
\"
businessDate
\"
:
\"
20170601
\"
,
\r\n
\"
code
\"
:
\"
7310188850000277
\"
,
\r\n
\"
operatorId
\"
:
\"
90001
\"
,
\r\n
\"
partnerId
\"
: 1443,
\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
\"
: 102,
\r\n
\"
stationId
\"
:
\"
9
\"
,
\r\n
\"
storeId
\"
:
\"
12344
\"
,
\r\n
\"
transAmount
\"
: 29,
\r\n
\"
transId
\"
:
\"
1
\"
,
\r\n
\"
undiscountAmount
\"
: 0,
\r\n
\"
ver
\"
: 1
\r\n
}"
;
void
testCheckRollbackData
()
{
InitClient
();
...
...
@@ -1119,11 +1174,11 @@ int main()
char
b
[
MAX_BUF_LEN
];
char
c
[
MAX_BUF_LEN
]
=
{
0
};
//
char c[MAX_BUF_LEN] = { 0 };
strcpy
(
c
,
TEST_CG
);
//
strcpy(c, TEST_CG);
LOG
()
<<
c
;
//
LOG() << c;
//TestRETDES();
...
...
bin/sbk-dll.zip
0 → 100644
View file @
8c95cb60
File added
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