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
a56f48b1
Commit
a56f48b1
authored
Apr 24, 2018
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改处理数据后字段为空的bug
parent
9130a764
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
ZH_Client.suo
+0
-0
ZH_Client/ZH_Client.vcxproj
+2
-2
ZH_Client/sbk_client.cpp
+21
-7
No files found.
ZH_Client.suo
View file @
a56f48b1
No preview for this file type
ZH_Client/ZH_Client.vcxproj
View file @
a56f48b1
...
...
@@ -18,10 +18,10 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>
DynamicLibrary
</ConfigurationType>
<ConfigurationType>
Application
</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<UseOfMfc>
false
</UseOfMfc>
<UseOfMfc>
Static
</UseOfMfc>
<PlatformToolset>v100</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
...
...
ZH_Client/sbk_client.cpp
View file @
a56f48b1
...
...
@@ -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"
...
...
@@ -368,7 +368,7 @@ time_t subDay(time_t time1,int days)
//
//}
int
ProcessPosReqData
(
const
char
*
indata
,
int
/**needrbk*/
*
needcheck
,
int
*
reqType_i
)
int
ProcessPosReqData
(
const
char
*
indata
,
int
/**needrbk*/
*
needcheck
,
int
*
reqType_i
,
string
&
in
)
{
LOG
()
<<
"ProcessPosReqData"
<<
indata
;
...
...
@@ -378,7 +378,7 @@ int ProcessPosReqData(const char *indata, int /**needrbk*/*needcheck, int *reqTy
//json_t *root, *reqtype, *partnerId, *storeId, *stationId, *code, *transId, *businessDate;
//json_error_t error;
Document
root
;
Document
root
,
tmproot
;
Value
reqtype
,
partnerId
,
storeId
,
stationId
,
code
,
transId
,
businessDate
;
string
codestr
;
...
...
@@ -397,6 +397,13 @@ int ProcessPosReqData(const char *indata, int /**needrbk*/*needcheck, int *reqTy
// return 0;
//}
tmproot
.
Parse
(
indata
);
if
(
tmproot
.
HasParseError
())
{
LOG
()
<<
"error request json data!"
;
return
0
;
}
root
.
Parse
(
indata
);
if
(
root
.
HasParseError
())
{
...
...
@@ -540,7 +547,7 @@ int ProcessPosReqData(const char *indata, int /**needrbk*/*needcheck, int *reqTy
{
initflag
=
1
;
}
/*
time_t
tt
=
time
(
NULL
);
tm
*
t
=
localtime
(
&
tt
);
tmps
<<
t
->
tm_year
+
1900
<<
std
::
setw
(
2
)
<<
std
::
setfill
(
'0'
)
<<
t
->
tm_mon
+
1
;
...
...
@@ -556,8 +563,12 @@ int ProcessPosReqData(const char *indata, int /**needrbk*/*needcheck, int *reqTy
if
(
type
!=
3
)
//json_object_set(root, JSON_KEY_ONLY, json_string(tmps.str().c_str()));
root.AddMember(JSON_KEY_ONLY, string(tmps.str().c_str()), root.GetAllocator());
tmproot
.
AddMember
(
JSON_KEY_ONLY
,
Value
().
SetString
(
tmps
.
str
().
c_str
(),
strlen
(
tmps
.
str
().
c_str
()),
root
.
GetAllocator
()),
root
.
GetAllocator
());
in
=
Tool
::
DocumentToString
(
tmproot
);
LOG
()
<<
"*****:"
<<
in
;
/*
if(type == 71)
{
tmpkey << codestr << transIdstr << json_integer_value(partnerId) << json_string_value(storeId) << json_string_value(stationId);
...
...
@@ -938,20 +949,23 @@ __declspec(dllexport) int __stdcall GetValue(char *indata, char *outdata)
strcpy_s
(
buf
,
strlen
(
indata
)
+
1
,
indata
);
LOG
()
<<
"BUF: "
<<
buf
;
string
tmpin
(
buf
,
MAX_BUF_LEN
);
string
in
(
buf
,
MAX_BUF_LEN
);
string
tmpin
;
LOG
()
<<
"tmpin: "
<<
tmpin
.
c_str
();
int
needcheck
=
0
;
//POS请求数据的验证
if
(
ProcessPosReqData
(
tmpin
.
c_str
(),
&
needcheck
,
&
reqType_i
)
!=
1
)
if
(
ProcessPosReqData
(
in
.
c_str
(),
&
needcheck
,
&
reqType_i
,
tmpin
)
!=
1
)
{
strcpy
(
outdata
,
ERROR_INDATA
);
LOG
()
<<
"return error message to pos :"
<<
outdata
;
return
0
;
}
LOG
()
<<
"ProcessPosReqData : "
<<
tmpin
;
//验证证书
if
(
global_info
.
useRSA
==
1
&&
(
global_info
.
serverpublickey
.
empty
()
||
global_info
.
localprivatekey
.
empty
()))
{
...
...
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