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
c442ea95
Commit
c442ea95
authored
Feb 29, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
policy
parent
a1be3adc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
+1
-2
center-order/app/base/service/impl/dbpolicy/policysubscribeSve.js
+21
-2
No files found.
center-order/app/base/service/impl/dbpolicy/policyinfoSve.js
View file @
c442ea95
...
@@ -110,11 +110,10 @@ class PolicyinfoService extends ServiceBase {
...
@@ -110,11 +110,10 @@ class PolicyinfoService extends ServiceBase {
}
}
async
addPolicyByExcel
(){
async
addPolicyByExcel
(){
var
workbook
=
xl
.
readFile
(
"policy
7.xlsx
"
);
var
workbook
=
xl
.
readFile
(
"policy
8.xls
"
);
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
);
var
arr
=
[];
var
arr
=
[];
var
that
=
this
;
var
that
=
this
;
await
this
.
db
.
transaction
(
async
function
(
t
)
{
await
this
.
db
.
transaction
(
async
function
(
t
)
{
...
...
center-order/app/base/service/impl/dbpolicy/policysubscribeSve.js
View file @
c442ea95
...
@@ -112,6 +112,8 @@ class PolicysubscribeService extends ServiceBase {
...
@@ -112,6 +112,8 @@ class PolicysubscribeService extends ServiceBase {
if
(
!
obj
.
policySubscribeId
){
if
(
!
obj
.
policySubscribeId
){
return
system
.
getResult
(
null
,
"policySubscribeId不能为空"
);
return
system
.
getResult
(
null
,
"policySubscribeId不能为空"
);
}
}
var
currentPage
=
obj
.
currentPage
||
1
;
var
pageSize
=
obj
.
pageSize
||
100
;
var
ps
=
await
this
.
dao
.
model
.
findOne
({
var
ps
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
obj
.
policySubscribeId
,
openid
:
obj
.
openid
},
where
:{
id
:
obj
.
policySubscribeId
,
openid
:
obj
.
openid
},
raw
:
true
raw
:
true
...
@@ -135,10 +137,27 @@ class PolicysubscribeService extends ServiceBase {
...
@@ -135,10 +137,27 @@ class PolicysubscribeService extends ServiceBase {
}
}
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
var
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
order
:[[
"id"
,
"DESC"
]]
order
:[[
"id"
,
"DESC"
]],
offset
:(
currentPage
-
1
)
*
pageSize
,
limit
:
pageSize
});
if
(
!
pis
||
pis
.
length
<
1
){
delete
whereObj
[
"created_at"
];
pis
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
where
:
whereObj
,
raw
:
true
,
attributes
:
attributes
,
order
:[[
"id"
,
"DESC"
]],
offset
:(
currentPage
-
1
)
*
pageSize
,
limit
:
pageSize
});
}
var
picount
=
await
this
.
policyinfoDao
.
model
.
findAll
({
//获取该订阅下的政策数据
where
:
whereObj
,
raw
:
true
,
attributes
:[
"id"
],
});
});
picount
=
picount
.
length
;
var
res
=
system
.
getResultSuccess
(
pis
);
res
.
dataCount
=
picount
;
await
this
.
dao
.
update
({
id
:
obj
.
policySubscribeId
,
releaseDate
:
new
Date
()});
//修改订阅发布日期
await
this
.
dao
.
update
({
id
:
obj
.
policySubscribeId
,
releaseDate
:
new
Date
()});
//修改订阅发布日期
return
system
.
getResultSuccess
(
pis
)
;
return
res
;
}
}
}
}
...
...
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