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
5e14e691
Commit
5e14e691
authored
Mar 01, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order
parents
70082e7b
0e713377
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
0 deletions
+122
-0
center-order/app/base/api/impl/action/policy.js
+6
-0
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
+116
-0
No files found.
center-order/app/base/api/impl/action/policy.js
View file @
5e14e691
...
@@ -68,6 +68,12 @@ class PolicyAPI extends APIBase {
...
@@ -68,6 +68,12 @@ class PolicyAPI extends APIBase {
case
"policySubscribeQuery"
:
//政策订阅检索列表(通过订阅信息查询订阅的政策信息)
case
"policySubscribeQuery"
:
//政策订阅检索列表(通过订阅信息查询订阅的政策信息)
opResult
=
this
.
policysubscribeSve
.
policySubscribeQuery
(
pobj
);
opResult
=
this
.
policysubscribeSve
.
policySubscribeQuery
(
pobj
);
break
;
break
;
case
"getPolicyBusinessFq"
:
//政策商机(蜂擎)
opResult
=
this
.
policyneedSve
.
getPolicyBusinessFq
(
pobj
);
break
;
case
"getPolicyNeedInfo"
:
//政策需求信息(icompany)
opResult
=
this
.
policyneedSve
.
getPolicyNeedInfo
(
pobj
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
5e14e691
...
@@ -164,5 +164,121 @@ class PolicyneedService extends ServiceBase {
...
@@ -164,5 +164,121 @@ class PolicyneedService extends ServiceBase {
var
newPolicyNeed
=
await
this
.
dao
.
update
(
paramObj
);
var
newPolicyNeed
=
await
this
.
dao
.
update
(
paramObj
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
//政策商机(蜂擎)
async
getPolicyBusinessFq
(
pobj
){
var
app
=
pobj
.
appInfo
;
var
obj
=
pobj
.
actionBody
||
{};
var
pageSize
=
Number
(
obj
.
pageSize
||
20
);
var
pageIndex
=
Number
(
obj
.
pageIndex
||
1
);
var
from
=
pageIndex
==
1
?
0
:
Number
((
pageIndex
-
1
)
*
pageSize
);
if
(
pageSize
>
200
)
{
pageSize
=
200
;
}
var
sql
=
"select need.created_at,need.region,need.mobile,need.industry,need.contacts,policy.policyNo,policy.policyName,policy.policyType,policy.policyTypeName,"
+
"need.company,need.popularizeUserCode,policy.policyLinkUrl,policy.policyProvince from "
+
"(select created_at,id,contacts,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where 1=1 "
;
var
sqlCount
=
"select count(1) as dataCount from "
+
"(select created_at,id,contacts,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where 1=1 "
;
if
(
obj
.
salesmanMobile
){
sql
=
sql
+
" and popularizeUserCode='"
+
obj
.
salesmanMobile
+
"' "
;
sqlCount
=
sqlCount
+
" and popularizeUserCode='"
+
obj
.
salesmanMobile
+
"' "
;
}
sql
=
sql
+
" ) as need "
+
"LEFT JOIN "
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"policyDate,policyProvince,policyCity from b_policy_info) as policy "
+
"on need.policy_id=policy.id where 1=1 "
;
sqlCount
=
sqlCount
+
" ) as need "
+
"LEFT JOIN "
+
"(select id, policyNo,policyName,policyType,policyTypeName,policySource,policyLinkUrl,"
+
"policyDate,policyProvince,policyCity from b_policy_info) as policy "
+
"on need.policy_id=policy.id where 1=1 "
;
if
(
obj
.
policyName
){
sql
=
sql
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
sqlCount
=
sqlCount
+
" and policyName like '%"
+
obj
.
policyName
+
"%'"
;
}
if
(
obj
.
policyProvince
){
sql
=
sql
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
sqlCount
=
sqlCount
+
" and policyProvince ='"
+
obj
.
policyProvince
+
"'"
;
if
(
obj
.
policyCity
){
sql
=
sql
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
sqlCount
=
sqlCount
+
" and policyCity ='"
+
obj
.
policyCity
+
"'"
;
}
}
if
(
obj
.
policyType
){
sql
=
sql
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
sqlCount
=
sqlCount
+
" and policyType = '"
+
obj
.
policyType
+
"'"
;
}
if
(
obj
.
customerIntention
){
sql
=
sql
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
sqlCount
=
sqlCount
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
}
if
(
obj
.
startDate
){
sql
=
sql
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
}
if
(
obj
.
endDate
){
sql
=
sql
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
}
sql
=
sql
+
" order by need.id desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
console
.
log
(
sql
);
var
tmpResult
=
await
this
.
customQuery
(
sql
,{});
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,{});
var
result
=
system
.
getResultSuccess
(
tmpResult
);
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
return
result
;
}
//政策需求信息(icompany)
async
getPolicyNeedInfo
(
pobj
){
var
obj
=
pobj
.
actionBody
||
{};
var
pageSize
=
Number
(
obj
.
pageSize
||
20
);
var
pageIndex
=
Number
(
obj
.
pageIndex
||
1
);
var
from
=
pageIndex
==
1
?
0
:
Number
((
pageIndex
-
1
)
*
pageSize
);
if
(
pageSize
>
200
)
{
pageSize
=
200
;
}
var
sql
=
"select contacts,company,industry,region,mobile,created_at "
+
"from b_policy_need where 1=1 "
;
var
sqlCount
=
"select count(1) as dataCount from b_policy_need where 1=1 "
;
if
(
obj
.
contacts
){
sql
=
sql
+
" and contacts = '"
+
obj
.
contacts
+
"'"
;
sqlCount
=
sqlCount
+
" and contacts = '"
+
obj
.
contacts
+
"'"
;
}
if
(
obj
.
mobile
){
sql
=
sql
+
" and mobile = '"
+
obj
.
mobile
+
"'"
;
sqlCount
=
sqlCount
+
" and mobile = '"
+
obj
.
mobile
+
"'"
;
}
if
(
obj
.
industry
){
sql
=
sql
+
" and industry = '"
+
obj
.
industry
+
"'"
;
sqlCount
=
sqlCount
+
" and industry = '"
+
obj
.
industry
+
"'"
;
}
if
(
obj
.
region
){
sql
=
sql
+
" and region = '"
+
obj
.
region
+
"'"
;
sqlCount
=
sqlCount
+
" and region = '"
+
obj
.
region
+
"'"
;
}
if
(
obj
.
company
){
sql
=
sql
+
" and company = '"
+
obj
.
company
+
"'"
;
sqlCount
=
sqlCount
+
" and company = '"
+
obj
.
company
+
"'"
;
}
if
(
obj
.
startDate
){
sql
=
sql
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at >= '"
+
obj
.
startDate
+
"'"
;
}
if
(
obj
.
endDate
){
sql
=
sql
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
sqlCount
=
sqlCount
+
" and created_at <= '"
+
obj
.
endDate
+
"'"
;
}
sql
=
sql
+
" order by created_at desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
console
.
log
(
sql
);
var
tmpResult
=
await
this
.
customQuery
(
sql
,{});
var
tmpResultCount
=
await
this
.
customQuery
(
sqlCount
,{});
var
result
=
system
.
getResultSuccess
(
tmpResult
);
result
.
dataCount
=
tmpResultCount
&&
tmpResultCount
.
length
>
0
?
tmpResultCount
[
0
].
dataCount
:
0
;
return
result
;
}
}
}
module
.
exports
=
PolicyneedService
;
module
.
exports
=
PolicyneedService
;
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