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
6c6e1e23
Commit
6c6e1e23
authored
Jun 11, 2024
by
chengwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用友项目查询接口
parent
9c45f24e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
14 deletions
+41
-14
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/WagesServiceImpl.java
.../java/com/ruoyi/system/service/impl/WagesServiceImpl.java
+41
-14
No files found.
ruoyi-wages/src/main/java/com/ruoyi/system/service/impl/WagesServiceImpl.java
View file @
6c6e1e23
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.system.common.ReturnResult
;
import
com.ruoyi.system.constant.ApiConstant
;
import
com.ruoyi.system.listener.ExcelListener
;
import
com.ruoyi.system.mapper.WagesDetailsMapper
;
import
com.ruoyi.system.mapper.WagesMapper
;
...
...
@@ -152,21 +153,27 @@ public class WagesServiceImpl implements WagesService {
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
);
}
//用友项目接口查询
String
xmCode
=
getCodeByName
(
lbname
,
"010101"
);
if
(
xmCode
!=
null
){
jsonObject1
.
put
(
"auxiliary_item_b"
,
lbname2
+
":"
+
xmCode
+
"/"
+
lbname
);
}
// //用友接口取数
// 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);
// }
//
// }
}
}
...
...
@@ -255,4 +262,24 @@ public class WagesServiceImpl implements WagesService {
}
return
code
;
}
//用友接口获取项目
private
String
getCodeByName
(
String
name
,
String
mineId
)
{
String
code
=
null
;
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"pageIndex"
,
1L
);
jsonObject
.
put
(
"pageSize"
,
1000L
);
jsonObject
.
put
(
"name"
,
name
);
ReturnResult
accSubject
=
VoucherUtils
.
callVoucherQuery
(
jsonObject
,
ApiConstant
.
YFXM_URL
);
JSONObject
data
=
(
JSONObject
)
accSubject
.
getData
().
get
(
0
);
JSONArray
recordList
=
data
.
getJSONArray
(
"recordList"
);
for
(
Object
o
:
recordList
)
{
JSONObject
object
=
(
JSONObject
)
o
;
String
orgid_code
=
object
.
getString
(
"orgid_code"
);
if
(
orgid_code
.
equals
(
mineId
))
{
code
=
object
.
getString
(
"code"
);
break
;
}
}
return
code
;
}
}
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