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
d89054b4
Commit
d89054b4
authored
Feb 25, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
policySubscribe
parent
b4939a85
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletions
+43
-1
center-order/app/base/api/impl/action/policy.js
+3
-0
center-order/app/base/service/impl/dbpolicy/policysubscribeSve.js
+40
-1
No files found.
center-order/app/base/api/impl/action/policy.js
View file @
d89054b4
...
@@ -65,6 +65,9 @@ class PolicyAPI extends APIBase {
...
@@ -65,6 +65,9 @@ class PolicyAPI extends APIBase {
case
"policyTypeCount"
:
//政策类型统计计数
case
"policyTypeCount"
:
//政策类型统计计数
opResult
=
this
.
policyinfoSve
.
policyTypeCount
(
pobj
);
opResult
=
this
.
policyinfoSve
.
policyTypeCount
(
pobj
);
break
;
break
;
case
"policySubscribeQuery"
:
//政策订阅检索列表(通过订阅信息查询订阅的政策信息)
opResult
=
this
.
policysubscribeSve
.
policySubscribeQuery
(
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/policysubscribeSve.js
View file @
d89054b4
...
@@ -3,6 +3,7 @@ const ServiceBase = require("../../sve.base");
...
@@ -3,6 +3,7 @@ const ServiceBase = require("../../sve.base");
class
PolicysubscribeService
extends
ServiceBase
{
class
PolicysubscribeService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicysubscribeService
));
super
(
"dbpolicy"
,
ServiceBase
.
getDaoName
(
PolicysubscribeService
));
this
.
policyinfoDao
=
system
.
getObject
(
"db.dbpolicy.policyinfoDao"
);
}
}
//提交政策订阅
//提交政策订阅
async
submitPolicysubscribe
(
pobj
){
async
submitPolicysubscribe
(
pobj
){
...
@@ -78,9 +79,46 @@ class PolicysubscribeService extends ServiceBase {
...
@@ -78,9 +79,46 @@ class PolicysubscribeService extends ServiceBase {
paramObj
[
"openid"
]
=
obj
.
openid
;
paramObj
[
"openid"
]
=
obj
.
openid
;
var
resList
=
await
this
.
dao
.
model
.
findAll
({
var
resList
=
await
this
.
dao
.
model
.
findAll
({
attributes
:[
"id"
,
"policyProvince"
,
"policyTypes"
,
"created_at"
],
attributes
:[
"id"
,
"policyProvince"
,
"policyTypes"
,
"created_at"
],
where
:
paramObj
,
raw
:
true
where
:
paramObj
,
raw
:
true
,
order
:[[
"id"
,
"DESC"
]]
});
});
return
system
.
getResultSuccess
(
resList
);
return
system
.
getResultSuccess
(
resList
);
}
}
//政策订阅检索列表
async
policySubscribeQuery
(
pobj
){
var
app
=
pobj
.
appInfo
;
var
obj
=
pobj
.
actionBody
;
var
paramObj
=
{
uapp_id
:
app
.
uapp_id
};
if
(
!
obj
.
openid
){
return
system
.
getResult
(
null
,
"openid不能为空"
);
}
if
(
!
obj
.
policySubscribeId
){
return
system
.
getResult
(
null
,
"policySubscribeId不能为空"
);
}
var
ps
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
obj
.
policySubscribeId
,
openid
:
obj
.
openid
},
raw
:
true
});
if
(
!
ps
||
!
ps
.
id
){
return
system
.
getResult
(
null
,
"订阅信息不存在"
);
}
//{ where: { id: { [this.db.Op.in]: ids } } }
var
whereObj
=
{};
var
attributes
=
[
"id"
,
"policyType"
,
"policyTypeName"
,
"policyDate"
,
"policyCity"
,
"policyProvince"
,
"policyLinkUrl"
,
"policySource"
,
"policyName"
,
"policyNo"
];
if
(
ps
.
policyProvince
){
whereObj
[
"policyProvince"
]
=
ps
.
policyProvince
;
}
if
(
ps
.
policyTypes
){
var
types
=
ps
.
policyTypes
.
split
(
","
);
whereObj
[
"policyType"
]
=
{
[
this
.
db
.
Op
.
in
]:
types
};
}
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
order
:[[
"id"
,
"DESC"
]]
});
return
system
.
getResultSuccess
(
pis
);
}
}
}
module
.
exports
=
PolicysubscribeService
;
module
.
exports
=
PolicysubscribeService
;
\ No newline at end of file
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