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
a7c917a9
Commit
a7c917a9
authored
Feb 22, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
policyTypeQuery
parent
a86fdf00
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
3 deletions
+58
-3
center-order/app/base/api/impl/action/policy.js
+3
-0
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+45
-1
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
+10
-2
No files found.
center-order/app/base/api/impl/action/policy.js
View file @
a7c917a9
...
@@ -39,6 +39,9 @@ class PolicyAPI extends APIBase {
...
@@ -39,6 +39,9 @@ class PolicyAPI extends APIBase {
case
"policyQuery"
:
//政策检索
case
"policyQuery"
:
//政策检索
opResult
=
await
this
.
policyinfoSve
.
policyQuery
(
pobj
);
opResult
=
await
this
.
policyinfoSve
.
policyQuery
(
pobj
);
break
;
break
;
case
"policyTypeQuery"
:
//政策检索(根据政策类型检索)
opResult
=
await
this
.
policyinfoSve
.
policyTypeQuery
(
pobj
);
break
;
case
"submitPolicyNeed"
:
//政策申请提报
case
"submitPolicyNeed"
:
//政策申请提报
// opResult = system.getResult(null, "接口开发中");
// opResult = system.getResult(null, "接口开发中");
opResult
=
this
.
policyneedSve
.
submitPolicyNeed
(
pobj
);
opResult
=
this
.
policyneedSve
.
submitPolicyNeed
(
pobj
);
...
...
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
View file @
a7c917a9
...
@@ -13,6 +13,21 @@ class PolicyinfoService extends ServiceBase {
...
@@ -13,6 +13,21 @@ class PolicyinfoService extends ServiceBase {
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
var
attributes
=
[
"id"
,
"policyType"
,
"policyTypeName"
,
"policyDate"
,
"policyCity"
,
"policyProvince"
,
var
attributes
=
[
"id"
,
"policyType"
,
"policyTypeName"
,
"policyDate"
,
"policyCity"
,
"policyProvince"
,
"policyLinkUrl"
,
"policySource"
,
"policyName"
,
"policyNo"
];
"policyLinkUrl"
,
"policySource"
,
"policyName"
,
"policyNo"
];
if
(
obj
){
if
(
obj
.
policyProvince
){
paramObj
[
"policyProvince"
]
=
obj
.
policyProvince
;
if
(
obj
.
policyCity
){
paramObj
[
"policyCity"
]
=
obj
.
policyCity
;
}
}
if
(
obj
.
policyName
){
paramObj
[
this
.
db
.
Op
.
or
]
=
[
{
policyName
:{
[
this
.
db
.
Op
.
like
]:
"%"
+
obj
.
policyName
+
"%"
}},
{
policyContent
:{
[
this
.
db
.
Op
.
like
]:
"%"
+
obj
.
policyName
+
"%"
}}
];
}
console
.
log
(
paramObj
);
}
var
result
=
{};
var
result
=
{};
//"policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'扶持措施','ssjm':'税收优惠','rlzy':'人力资源'},
//"policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'扶持措施','ssjm':'税收优惠','rlzy':'人力资源'},
var
rlzy
=
await
this
.
findByParams
(
"rlzy"
,
paramObj
,
attributes
);
var
rlzy
=
await
this
.
findByParams
(
"rlzy"
,
paramObj
,
attributes
);
...
@@ -58,10 +73,39 @@ class PolicyinfoService extends ServiceBase {
...
@@ -58,10 +73,39 @@ class PolicyinfoService extends ServiceBase {
result
[
"ssjm"
]
=
await
this
.
findByParams
(
"ssjm"
,
paramObj
,
attributes
);
result
[
"ssjm"
]
=
await
this
.
findByParams
(
"ssjm"
,
paramObj
,
attributes
);
return
system
.
getResultSuccess
(
result
);
return
system
.
getResultSuccess
(
result
);
}
}
//政策检索(根据政策类型检索)
async
policyTypeQuery
(
pobj
){
var
obj
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
var
attributes
=
[
"id"
,
"policyType"
,
"policyTypeName"
,
"policyDate"
,
"policyCity"
,
"policyProvince"
,
"policyLinkUrl"
,
"policySource"
,
"policyName"
,
"policyNo"
];
if
(
!
obj
||
!
obj
.
policyType
){
return
system
.
getResult
(
null
,
"政策类型不能为空"
);
}
if
(
obj
.
policyProvince
){
paramObj
[
"policyProvince"
]
=
obj
.
policyProvince
;
if
(
obj
.
policyCity
){
paramObj
[
"policyCity"
]
=
obj
.
policyCity
;
}
}
if
(
obj
.
policyName
){
paramObj
[
this
.
db
.
Op
.
or
]
=
[
{
policyName
:{
[
this
.
db
.
Op
.
like
]:
"%"
+
obj
.
policyName
+
"%"
}},
{
policyContent
:{
[
this
.
db
.
Op
.
like
]:
"%"
+
obj
.
policyName
+
"%"
}}
];
}
console
.
log
(
paramObj
);
var
result
=
null
;
//"policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'扶持措施','ssjm':'税收优惠','rlzy':'人力资源'},
result
=
await
this
.
findByParams
(
obj
.
policyType
,
paramObj
,
attributes
);
return
system
.
getResultSuccess
(
result
);
}
async
findByParams
(
type
,
paramObj
,
attributes
){
async
findByParams
(
type
,
paramObj
,
attributes
){
paramObj
.
policyType
=
type
;
paramObj
.
policyType
=
type
;
return
await
this
.
dao
.
model
.
findAll
({
return
await
this
.
dao
.
model
.
findAll
({
where
:
paramObj
,
raw
:
true
,
attributes
:
attributes
where
:
paramObj
,
raw
:
true
,
attributes
:
attributes
,
order
:[[
"id"
,
"DESC"
]]
});
});
}
}
...
...
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
a7c917a9
...
@@ -56,10 +56,10 @@ class PolicyneedService extends ServiceBase {
...
@@ -56,10 +56,10 @@ class PolicyneedService extends ServiceBase {
}
}
var
sql
=
"select need.*,policy.policyNo,policy.policyName,policy.policyType,policy.policyTypeName,policy.policySource,"
+
var
sql
=
"select need.*,policy.policyNo,policy.policyName,policy.policyType,policy.policyTypeName,policy.policySource,"
+
"policy.policyLinkUrl,policy.policyDate,policy.policyProvince,policy.policyCity from "
+
"policy.policyLinkUrl,policy.policyDate,policy.policyProvince,policy.policyCity from "
+
"(select id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"(select
created_at,
id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"' "
;
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"' "
;
var
sqlCount
=
"select count(1) as dataCount from "
+
var
sqlCount
=
"select count(1) as dataCount from "
+
"(select id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"(select
created_at,
id,uapp_id,contacts,customerIntention,customerIntentionName,company,industry,region,mobile,policy_id,applyDate,opNotes,popularizeUserCode "
+
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"' "
;
"from b_policy_need where uapp_id="
+
app
.
uapp_id
+
" and (popularizeUserCode='"
+
user
.
channel_userid
+
"' "
;
if
(
user
.
channel_userid
==
"18611219500"
){
if
(
user
.
channel_userid
==
"18611219500"
){
sql
=
sql
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
sql
=
sql
+
" or popularizeUserCode is null or popularizeUserCode='' "
;
...
@@ -96,6 +96,14 @@ class PolicyneedService extends ServiceBase {
...
@@ -96,6 +96,14 @@ class PolicyneedService extends ServiceBase {
sql
=
sql
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
sql
=
sql
+
" and customerIntention = '"
+
obj
.
customerIntention
+
"'"
;
sqlCount
=
sqlCount
+
" 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
+
""
;
sql
=
sql
+
" order by need.id desc LIMIT "
+
pageSize
+
" OFFSET "
+
from
+
""
;
console
.
log
(
sql
);
console
.
log
(
sql
);
// var sqlCount = "SELECT count(1) as dataCount FROM b_policy_need where " +
// var sqlCount = "SELECT count(1) as dataCount FROM b_policy_need where " +
...
...
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