Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
klck
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
位宇华
klck
Commits
d8a95281
Commit
d8a95281
authored
Jun 06, 2024
by
chengwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用友接口空指针异常处理
parent
387c0206
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/WagesServiceImpl.java
.../java/com/ruoyi/system/service/impl/WagesServiceImpl.java
+26
-14
No files found.
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/WagesServiceImpl.java
View file @
d8a95281
...
...
@@ -141,18 +141,24 @@ public class WagesServiceImpl implements WagesService {
if
(
index
==-
1
){
index
=
sourceOfExpenses
.
indexOf
(
")"
);
}
if
(
index
>=
0
){
String
lbname
=
sourceOfExpenses
.
substring
(
index
+
1
);
String
lbname2
=
"项目"
;
//用友取数
CustomDocRequestModel
docRequest
=
new
CustomDocRequestModel
();
docRequest
.
setPageIndex
(
Long
.
valueOf
(
1L
));
docRequest
.
setPageSize
(
Long
.
valueOf
(
500L
));
docRequest
.
setName
(
lbname
);
String
codeFromCustomDoc
=
""
;
JSONArray
customDoc
=
getCustomDoc
(
docRequest
);
codeFromCustomDoc
=
getCodeFromCustomDoc
(
customDoc
,
lbname2
);
jsonObject1
.
put
(
"auxiliary_item_b"
,
lbname2
+
":"
+
codeFromCustomDoc
+
"/"
+
lbname
);
if
(
index
>=
0
)
{
String
lbname
=
sourceOfExpenses
.
substring
(
index
+
1
);
String
lbname2
=
"项目"
;
//用友接口取数
CustomDocRequestModel
docRequest
=
new
CustomDocRequestModel
();
docRequest
.
setPageIndex
(
Long
.
valueOf
(
1L
));
docRequest
.
setPageSize
(
Long
.
valueOf
(
500L
));
docRequest
.
setName
(
lbname
);
String
codeFromCustomDoc
=
""
;
JSONArray
customDoc
=
getCustomDoc
(
docRequest
);
//如果用友返回不为空
if
(
customDoc
!=
null
){
codeFromCustomDoc
=
getCodeFromCustomDoc
(
customDoc
,
lbname2
);
if
(
codeFromCustomDoc
!=
null
){
jsonObject1
.
put
(
"auxiliary_item_b"
,
lbname2
+
":"
+
codeFromCustomDoc
+
"/"
+
lbname
);
}
}
}
}
...
...
@@ -196,8 +202,14 @@ public class WagesServiceImpl implements WagesService {
public
JSONArray
getCustomDoc
(
CustomDocRequestModel
customDocRequestModel
)
{
ReturnResult
customDocument
=
VoucherUtils
.
callVoucherQuery
(
customDocRequestModel
,
"/yonbip/digitalModel/customerdoc/list"
);
JSONObject
customDocumentJsonObj
=
(
JSONObject
)
JSON
.
toJSON
(
customDocument
.
getData
().
get
(
0
));
return
customDocumentJsonObj
.
getJSONArray
(
"recordList"
);
if
(
customDocument
!=
null
){
JSONObject
customDocumentJsonObj
=
(
JSONObject
)
JSON
.
toJSON
(
customDocument
.
getData
().
get
(
0
));
return
customDocumentJsonObj
.
getJSONArray
(
"recordList"
);
}
else
{
return
null
;
}
}
private
String
getCodeFromCustomDoc
(
JSONArray
customDoc
,
String
nameZhCn
)
{
...
...
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