Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
48cbf1de
Commit
48cbf1de
authored
Oct 19, 2021
by
季圣华
Browse files
增加往来单位的接口,含供应商和客户
parent
0511976a
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/controller/SupplierController.java
View file @
48cbf1de
...
...
@@ -113,6 +113,50 @@ public class SupplierController {
return
arr
;
}
/**
* 查找往来单位,含供应商和客户信息-下拉框
* @param request
* @return
*/
@PostMapping
(
value
=
"/findBySelect_organ"
)
public
JSONArray
findBySelectOrgan
(
HttpServletRequest
request
)
throws
Exception
{
JSONArray
arr
=
new
JSONArray
();
try
{
JSONArray
dataArray
=
new
JSONArray
();
//1、获取供应商信息
List
<
Supplier
>
supplierList
=
supplierService
.
findBySelectSup
();
if
(
null
!=
supplierList
)
{
for
(
Supplier
supplier
:
supplierList
)
{
JSONObject
item
=
new
JSONObject
();
item
.
put
(
"id"
,
supplier
.
getId
());
item
.
put
(
"supplier"
,
supplier
.
getSupplier
());
//供应商名称
dataArray
.
add
(
item
);
}
}
//2、获取客户信息
String
type
=
"UserCustomer"
;
Long
userId
=
userService
.
getUserId
(
request
);
String
ubValue
=
userBusinessService
.
getUBValueByTypeAndKeyId
(
type
,
userId
.
toString
());
List
<
Supplier
>
customerList
=
supplierService
.
findBySelectCus
();
if
(
null
!=
customerList
)
{
boolean
customerFlag
=
systemConfigService
.
getCustomerFlag
();
for
(
Supplier
supplier
:
customerList
)
{
JSONObject
item
=
new
JSONObject
();
Boolean
flag
=
ubValue
.
contains
(
"["
+
supplier
.
getId
().
toString
()
+
"]"
);
if
(!
customerFlag
||
flag
)
{
item
.
put
(
"id"
,
supplier
.
getId
());
item
.
put
(
"supplier"
,
supplier
.
getSupplier
());
//客户名称
dataArray
.
add
(
item
);
}
}
}
arr
=
dataArray
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
arr
;
}
/**
* 查找会员信息-下拉框
* @param request
...
...
Write
Preview
Supports
Markdown
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