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
a86fdf00
Commit
a86fdf00
authored
Feb 21, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
policyTypeCount
parent
1c29c073
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
center-order/app/base/api/impl/action/policy.js
+3
-0
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+24
-4
No files found.
center-order/app/base/api/impl/action/policy.js
View file @
a86fdf00
...
@@ -59,6 +59,9 @@ class PolicyAPI extends APIBase {
...
@@ -59,6 +59,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 @
a86fdf00
...
@@ -6,7 +6,28 @@ class PolicyinfoService extends ServiceBase {
...
@@ -6,7 +6,28 @@ 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"
];
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,7 +58,6 @@ class PolicyinfoService extends ServiceBase {
...
@@ -37,7 +58,6 @@ 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
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
({
...
@@ -46,7 +66,7 @@ class PolicyinfoService extends ServiceBase {
...
@@ -46,7 +66,7 @@ class PolicyinfoService extends ServiceBase {
}
}
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 +80,7 @@ class PolicyinfoService extends ServiceBase {
...
@@ -60,7 +80,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
[
'政策类型'
];
...
...
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