Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
f209a373
Commit
f209a373
authored
Oct 13, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
ed5135ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
bpo-admin/app/base/api/impl/ecompanyApi.js
+9
-0
bpo-admin/app/base/service/impl/esettleSve.js
+52
-0
No files found.
bpo-admin/app/base/api/impl/ecompanyApi.js
View file @
f209a373
...
...
@@ -36,6 +36,15 @@ class EcompanyApi {
return
system
.
getResult2
(
list
);
}
async
settleMerchantNameSuggest3
(
queryobj
,
qobj
,
req
)
{
let
name
=
this
.
trim
(
queryobj
.
name
);
if
(
!
name
)
{
return
system
.
getResult2
([])
}
let
list
=
await
this
.
esettleSve
.
suggest3
(
name
);
return
system
.
getResult2
(
list
);
}
trim
(
o
)
{
if
(
!
o
)
{
...
...
bpo-admin/app/base/service/impl/esettleSve.js
View file @
f209a373
...
...
@@ -816,6 +816,58 @@ class EsettleService extends ServiceBase {
return
list
;
}
async
suggest3
(
name
)
{
if
(
!
name
)
{
return
[];
}
let
sql
=
[];
sql
.
push
(
"SELECT t1.id, t1.company_name, t3.invoice_type FROM tbl_busi t1"
);
sql
.
push
(
"INNER JOIN tbl_busi_signed t2 ON t1.id = t2.busi_id"
);
sql
.
push
(
"INNER JOIN tbl_admin_main t3 ON t2.main_id = t3.id"
);
sql
.
push
(
"WHERE t1.company_name LIKE :queryLike LIMIT 50"
);
let
list
=
await
this
.
settledb
.
query
(
sql
.
join
(
" "
),
{
replacements
:
{
queryLike
:
"%"
+
name
+
"%"
}
});
if
(
list
&&
list
.
length
>
0
)
{
list
=
list
[
0
,
0
]
||
[];
}
return
list
;
}
async
setBusiInvoiceType
(
list
)
{
if
(
!
list
||
list
.
length
==
0
)
{
return
;
}
let
ids
=
[];
for
(
let
item
of
list
)
{
ids
.
push
(
item
.
id
);
}
let
map
=
await
this
.
mapInvoiceTypeByIds
(
ids
);
for
(
let
item
of
list
)
{
item
.
invoice_type
=
map
[
item
.
id
];
}
}
async
mapInvoiceTypeByIds
(
ids
)
{
let
result
=
{};
if
(
!
ids
||
ids
.
length
==
0
)
{
return
result
;
}
let
sql
=
[];
sql
.
push
(
"SELECT t1.busi_id, t2.invoice_type"
);
sql
.
push
(
"FROM tbl_busi_signed t1"
);
sql
.
push
(
"INNER JOIN tbl_admin_main t2 ON t1.main_id = t2.id "
);
sql
.
push
(
"WHERE t1.busi_id IN (:busiIds)"
);
let
list
=
await
this
.
settledb
.
query
(
sql
.
join
(
" "
),
{
replacements
:
{
busiIds
:
ids
}
});
if
(
list
&&
list
.
length
>
0
)
{
list
=
list
[
0
,
0
]
||
[];
}
for
(
let
item
of
list
)
{
result
[
item
.
busi_id
]
=
item
.
invoice_type
;
}
return
result
;
}
async
findcompanyid
(
id
)
{
if
(
!
id
)
{
return
[];
...
...
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