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
75bfeea8
Commit
75bfeea8
authored
Feb 22, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order
parents
c2f27471
a7c917a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
7 deletions
+85
-7
center-order/app/base/api/impl/action/policy.js
+6
-0
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+69
-5
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 @
75bfeea8
...
@@ -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
);
...
@@ -59,6 +62,9 @@ class PolicyAPI extends APIBase {
...
@@ -59,6 +62,9 @@ class PolicyAPI extends APIBase {
case
"getPolicysubscribeList"
:
//获取政策订阅列表
case
"getPolicysubscribeList"
:
//获取政策订阅列表
opResult
=
this
.
policysubscribeSve
.
getPolicysubscribeList
(
pobj
);
opResult
=
this
.
policysubscribeSve
.
getPolicysubscribeList
(
pobj
);
break
;
break
;
case
"policyTypeCount"
:
//政策类型统计计数
opResult
=
this
.
policyinfoSve
.
policyTypeCount
(
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/policyinfoSve.js
View file @
75bfeea8
...
@@ -6,7 +6,43 @@ class PolicyinfoService extends ServiceBase {
...
@@ -6,7 +6,43 @@ class PolicyinfoService extends ServiceBase {
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicyinfoService
));
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicyinfoService
));
}
}
//政策检索
//政策统计计数
async
policyTypeCount
(
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
){
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
=
{};
//"policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'扶持措施','ssjm':'税收优惠','rlzy':'人力资源'},
var
rlzy
=
await
this
.
findByParams
(
"rlzy"
,
paramObj
,
attributes
);
var
fzbt
=
await
this
.
findByParams
(
"fzbt"
,
paramObj
,
attributes
);
var
jrdk
=
await
this
.
findByParams
(
"jrdk"
,
paramObj
,
attributes
);
var
zdfc
=
await
this
.
findByParams
(
"zdfc"
,
paramObj
,
attributes
);
var
ssjm
=
await
this
.
findByParams
(
"ssjm"
,
paramObj
,
attributes
);
result
[
"rlzy"
]
=
rlzy
.
length
||
0
;
result
[
"fzbt"
]
=
fzbt
.
length
||
0
;
result
[
"jrdk"
]
=
jrdk
.
length
||
0
;
result
[
"zdfc"
]
=
zdfc
.
length
||
0
;
result
[
"ssjm"
]
=
ssjm
.
length
||
0
;
return
system
.
getResultSuccess
(
result
);
}
//政策检索
async
policyQuery
(
pobj
){
async
policyQuery
(
pobj
){
var
obj
=
pobj
.
actionBody
;
var
obj
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
var
app
=
pobj
.
appInfo
;
...
@@ -37,16 +73,44 @@ class PolicyinfoService extends ServiceBase {
...
@@ -37,16 +73,44 @@ 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"
]]
});
});
}
}
async
addPolicyByExcel
(){
async
addPolicyByExcel
(){
var
workbook
=
xl
.
readFile
(
"policy
6.xls
"
);
var
workbook
=
xl
.
readFile
(
"policy
7.xlsx
"
);
const
sheetNames
=
workbook
.
SheetNames
;
// 返回 ['sheet1', 'sheet2']
const
sheetNames
=
workbook
.
SheetNames
;
// 返回 ['sheet1', 'sheet2']
const
worksheet
=
workbook
.
Sheets
[
sheetNames
[
0
]];
const
worksheet
=
workbook
.
Sheets
[
sheetNames
[
0
]];
var
dataa
=
xl
.
utils
.
sheet_to_json
(
worksheet
);
var
dataa
=
xl
.
utils
.
sheet_to_json
(
worksheet
);
...
@@ -60,7 +124,7 @@ class PolicyinfoService extends ServiceBase {
...
@@ -60,7 +124,7 @@ class PolicyinfoService extends ServiceBase {
uapp_id
:
26
,
policyNo
:
data
[
'政策编号'
],
policyName
:
data
[
'政策名称'
],
uapp_id
:
26
,
policyNo
:
data
[
'政策编号'
],
policyName
:
data
[
'政策名称'
],
policySource
:
data
[
'政策出处'
],
policyLinkUrl
:
data
[
'政策链接'
],
policySource
:
data
[
'政策出处'
],
policyLinkUrl
:
data
[
'政策链接'
],
policyProvince
:
data
[
'所属省份'
],
policyCity
:
data
[
'所属城市'
],
policyProvince
:
data
[
'所属省份'
],
policyCity
:
data
[
'所属城市'
],
policyTypeName
:
data
[
'政策类型'
],
policyContent
:
data
[
'
内容'
]
};
policyTypeName
:
data
[
'政策类型'
],
policyContent
:
data
[
'
备注'
]
||
""
};
if
(
data
[
'政策类型'
]){
if
(
data
[
'政策类型'
]){
var
policy_type
=
{
'租金减免'
:
'fzbt'
,
'金融贷款'
:
'jrdk'
,
'行政措施'
:
'zdfc'
,
'税收优惠'
:
'ssjm'
,
'人力资源'
:
'rlzy'
};
var
policy_type
=
{
'租金减免'
:
'fzbt'
,
'金融贷款'
:
'jrdk'
,
'行政措施'
:
'zdfc'
,
'税收优惠'
:
'ssjm'
,
'人力资源'
:
'rlzy'
};
var
typename
=
data
[
'政策类型'
];
var
typename
=
data
[
'政策类型'
];
...
...
center-order/app/base/service/impl/dbpolicy/policyneedSve.js
View file @
75bfeea8
...
@@ -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