Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit db353bbc
authored
Sep 14, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[fix] 处理解析合同文件 Json 数据异常
1 parent
60d82bad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
src/main/java/vion/service/impl/ContractServiceImpl.java
src/main/java/vion/service/impl/ContractServiceImpl.java
View file @
db353bb
...
@@ -651,7 +651,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
...
@@ -651,7 +651,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
var
jsonArrR
=
jobR
.
path
(
"result"
).
withArray
(
"list"
);
var
jsonArrR
=
jobR
.
path
(
"result"
).
withArray
(
"list"
);
var
fileListR
=
StreamSupport
.
stream
(
jsonArrR
.
spliterator
(),
false
)
var
fileListR
=
StreamSupport
.
stream
(
jsonArrR
.
spliterator
(),
false
)
.
map
(
v
->
{
.
map
(
v
->
{
var
fileArr
=
v
.
path
(
"data"
).
withArray
(
"file_1"
);
var
fileArr
=
JsonUtil
.
parseTree
(
v
.
path
(
"data"
).
path
(
"file_1"
).
asText
()
);
var
contractNo
=
v
.
path
(
"data"
).
path
(
"serialNo"
).
asText
();
var
contractNo
=
v
.
path
(
"data"
).
path
(
"serialNo"
).
asText
();
return
(
JsonNode
)
JsonUtil
.
createObj
().
put
(
"contractNo"
,
contractNo
).
set
(
"fileArr"
,
fileArr
);
return
(
JsonNode
)
JsonUtil
.
createObj
().
put
(
"contractNo"
,
contractNo
).
set
(
"fileArr"
,
fileArr
);
}).
toList
();
}).
toList
();
...
@@ -670,7 +670,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
...
@@ -670,7 +670,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
for
(
JsonNode
entries
:
fileList
)
{
for
(
JsonNode
entries
:
fileList
)
{
var
contractNo
=
entries
.
path
(
"contractNo"
).
asText
();
var
contractNo
=
entries
.
path
(
"contractNo"
).
asText
();
ArrayNode
fileArr
=
entries
.
withArray
(
"fileArr"
);
var
fileArr
=
entries
.
path
(
"fileArr"
);
if
(
ObjUtil
.
isNull
(
fileArr
)
||
fileArr
.
isEmpty
())
{
if
(
ObjUtil
.
isNull
(
fileArr
)
||
fileArr
.
isEmpty
())
{
log
.
info
(
"合同:{},没有文件"
,
contractNo
);
log
.
info
(
"合同:{},没有文件"
,
contractNo
);
continue
;
continue
;
...
@@ -689,7 +689,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
...
@@ -689,7 +689,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
try
{
try
{
bytes
=
HttpDownloader
.
downloadBytes
(
o
.
path
(
"attachIndex"
).
asText
());
bytes
=
HttpDownloader
.
downloadBytes
(
o
.
path
(
"attachIndex"
).
asText
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"合同:{},[{}] 文件同步失败"
,
contractNo
,
filename
);
log
.
error
(
"合同:{},[{}] 文件同步失败"
,
contractNo
,
filename
,
e
);
continue
;
continue
;
}
}
var
sha256
=
SecureUtil
.
sha256
().
digestHex
(
bytes
).
toUpperCase
();
var
sha256
=
SecureUtil
.
sha256
().
digestHex
(
bytes
).
toUpperCase
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment