Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
b67d986f
Commit
b67d986f
authored
Oct 17, 2020
by
李硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try 提交
parent
10462678
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
83 deletions
+85
-83
awards.controller.js
server/duiba/controller/awards.controller.js
+85
-83
No files found.
server/duiba/controller/awards.controller.js
View file @
b67d986f
...
...
@@ -44,37 +44,38 @@ const findWinnerInfoList = async (context) => {
if
(
!
activityId
)
{
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`缺少activityId`
);
}
let
rankopenprizeService
=
new
RankopenprizeService
(
context
);
let
total
=
await
rankopenprizeService
.
getAwardslistCount
(
activityId
);
console
.
log
(
"totle========="
,
total
);
let
awardslist
=
[];
let
awardMore
=
await
rankopenprizeService
.
getAwardslistByActivityId
(
activityId
,
pageSize
,
pageNo
);
awardslist
=
awardslist
.
concat
(
awardMore
);
// console.log('awardslist>>>>', awardslist)
// awardslist = await rankopenprizeService.getAwardslistByActivityId(
// activityId,
// );
// console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist
.
map
((
item
)
=>
{
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
addressDetail
,
type0
=
item
.
type
;
item
.
prizeId
=
item
.
_id
;
item
.
createTime
=
formatTime
(
new
Date
(
item
.
createTime
+
EIGHT_HOURS
))
||
""
;
item
.
receiveTime
=
item
.
receiveTime
?
formatTime
(
new
Date
(
item
.
receiveTime
+
EIGHT_HOURS
))
:
'未填'
;
item
.
prizeDataType
=
prizePoolType
[
item
.
prizeDataType
];
item
.
type
=
prizeKind
[
item
.
type
];
item
.
receiveName
=
type0
==
3
?
(
item
.
receiveName
||
"未填"
)
:
'/'
;
item
.
phone
=
type0
==
3
?
(
item
.
phone
||
"未填"
)
:
'/'
;
item
.
address
=
type0
==
3
?
(
item
.
province
?
ad
:
"未填"
)
:
'/'
;
item
.
shipStatus
=
type0
==
3
?
(
shipMsg
[
item
.
shipStatus
])
:
'/'
;
item
.
shipCompany
=
type0
==
3
?
(
item
.
shipCompany
||
'/'
)
:
'/'
;
item
.
shipNum
=
type0
==
3
?
(
item
.
shipNum
||
'/'
)
:
'/'
;
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
try
{
let
rankopenprizeService
=
new
RankopenprizeService
(
context
);
let
total
=
await
rankopenprizeService
.
getAwardslistCount
(
activityId
);
console
.
log
(
"totle========="
,
total
);
let
awardslist
=
[];
let
awardMore
=
await
rankopenprizeService
.
getAwardslistByActivityId
(
activityId
,
pageSize
,
pageNo
);
awardslist
=
awardslist
.
concat
(
awardMore
);
// console.log('awardslist>>>>', awardslist)
// awardslist = await rankopenprizeService.getAwardslistByActivityId(
// activityId,
// );
// console.log(`awardslist:》》》 ${JSON.stringify(awardslist)}《《《`);
awardslist
.
map
((
item
)
=>
{
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
addressDetail
,
type0
=
item
.
type
;
item
.
prizeId
=
item
.
_id
;
item
.
createTime
=
formatTime
(
new
Date
(
item
.
createTime
+
EIGHT_HOURS
))
||
""
;
item
.
receiveTime
=
item
.
receiveTime
?
formatTime
(
new
Date
(
item
.
receiveTime
+
EIGHT_HOURS
))
:
'未填'
;
item
.
prizeDataType
=
prizePoolType
[
item
.
prizeDataType
];
item
.
type
=
prizeKind
[
item
.
type
];
item
.
receiveName
=
type0
==
3
?
(
item
.
receiveName
||
"未填"
)
:
'/'
;
item
.
phone
=
type0
==
3
?
(
item
.
phone
||
"未填"
)
:
'/'
;
item
.
address
=
type0
==
3
?
(
item
.
province
?
ad
:
"未填"
)
:
'/'
;
item
.
shipStatus
=
type0
==
3
?
(
shipMsg
[
item
.
shipStatus
])
:
'/'
;
item
.
shipCompany
=
type0
==
3
?
(
item
.
shipCompany
||
'/'
)
:
'/'
;
item
.
shipNum
=
type0
==
3
?
(
item
.
shipNum
||
'/'
)
:
'/'
;
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
return
resultsModel
.
success
({
list
:
awardslist
,
total
});
}
catch
(
e
)
{
console
.
log
(
"上传文件出错"
,
e
);
...
...
@@ -315,60 +316,61 @@ const findWinnerInfoListBySearch = async (context) => {
if
(
!
prizeId
&&
!
userNick
&&
!
timeStart
&&
!
timeEnd
&&
!
shipStatus
&&
!
prizeType
&&
!
prizeDataType
)
{
return
resultsModel
.
error
(
CODE_TYPES
.
PARAMS_ERROR
,
`未填写筛选信息`
);
}
let
rankopenprizeService
=
new
RankopenprizeService
(
context
);
console
.
log
(
"activityId----"
,
activityId
,
"prizeId---"
,
prizeId
,
"userNick---"
,
userNick
,
"timeStart---"
,
timeStart
,
"timeEnd---"
,
timeEnd
,
shipStatus
);
// 获取活动中奖列表
let
total
=
await
rankopenprizeService
.
getTotalObjectCount
(
activityId
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
console
.
log
(
"totle========="
,
total
);
let
awardslist
=
[];
if
(
total
>
10
)
{
let
totalPage
=
Math
.
ceil
(
total
/
pageSize
);
let
awardMore
=
await
rankopenprizeService
.
getUserPrizeByActivityId
(
activityId
,
pageNo
,
pageSize
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
// console.list()
awardslist
=
awardslist
.
concat
(
awardMore
);
}
else
{
awardslist
=
await
rankopenprizeService
.
getUserPrizeByActivityId
(
activityId
,
pageNo
,
pageSize
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
console
.
log
(
'awardslist>>>>'
,
awardslist
)
}
console
.
log
(
`awardslist:》》》
${
JSON
.
stringify
(
awardslist
)}
《《《`
);
awardslist
.
map
((
item
)
=>
{
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
addressDetail
,
type0
=
item
.
type
;
item
.
prizeId
=
item
.
_id
;
item
.
createTime
=
formatTime
(
new
Date
(
item
.
createTime
+
EIGHT_HOURS
))
||
""
;
item
.
receiveTime
=
item
.
receiveTime
?
formatTime
(
new
Date
(
item
.
receiveTime
+
EIGHT_HOURS
))
:
'未填'
;
item
.
prizeDataType
=
prizePoolType
[
item
.
prizeDataType
];
item
.
type
=
prizeKind
[
item
.
type
];
item
.
receiveName
=
type0
==
3
?
(
item
.
receiveName
||
"未填"
)
:
'/'
;
item
.
phone
=
type0
==
3
?
(
item
.
phone
||
"未填"
)
:
'/'
;
item
.
address
=
type0
==
3
?
(
item
.
province
?
ad
:
"未填"
)
:
'/'
;
item
.
shipStatus
=
type0
==
3
?
(
shipMsg
[
item
.
shipStatus
])
:
'/'
;
item
.
shipCompany
=
type0
==
3
?
(
item
.
shipCompany
||
'/'
)
:
'/'
;
item
.
shipNum
=
type0
==
3
?
(
item
.
shipNum
||
'/'
)
:
'/'
;
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
try
{
let
rankopenprizeService
=
new
RankopenprizeService
(
context
);
console
.
log
(
"activityId----"
,
activityId
,
"prizeId---"
,
prizeId
,
"userNick---"
,
userNick
,
"timeStart---"
,
timeStart
,
"timeEnd---"
,
timeEnd
,
shipStatus
);
// 获取活动中奖列表
let
total
=
await
rankopenprizeService
.
getTotalObjectCount
(
activityId
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
console
.
log
(
"totle========="
,
total
);
let
awardslist
=
[];
if
(
total
>
10
)
{
let
totalPage
=
Math
.
ceil
(
total
/
pageSize
);
let
awardMore
=
await
rankopenprizeService
.
getUserPrizeByActivityId
(
activityId
,
pageNo
,
pageSize
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
// console.list()
awardslist
=
awardslist
.
concat
(
awardMore
);
}
else
{
awardslist
=
await
rankopenprizeService
.
getUserPrizeByActivityId
(
activityId
,
pageNo
,
pageSize
,
prizeId
,
userNick
,
timeStart
,
timeEnd
,
shipStatus
,
prizeType
,
prizeDataType
);
console
.
log
(
'awardslist>>>>'
,
awardslist
)
}
console
.
log
(
`awardslist:》》》
${
JSON
.
stringify
(
awardslist
)}
《《《`
);
awardslist
.
map
((
item
)
=>
{
let
ad
=
item
.
province
+
item
.
city
+
item
.
area
+
item
.
addressDetail
,
type0
=
item
.
type
;
item
.
prizeId
=
item
.
_id
;
item
.
createTime
=
formatTime
(
new
Date
(
item
.
createTime
+
EIGHT_HOURS
))
||
""
;
item
.
receiveTime
=
item
.
receiveTime
?
formatTime
(
new
Date
(
item
.
receiveTime
+
EIGHT_HOURS
))
:
'未填'
;
item
.
prizeDataType
=
prizePoolType
[
item
.
prizeDataType
];
item
.
type
=
prizeKind
[
item
.
type
];
item
.
receiveName
=
type0
==
3
?
(
item
.
receiveName
||
"未填"
)
:
'/'
;
item
.
phone
=
type0
==
3
?
(
item
.
phone
||
"未填"
)
:
'/'
;
item
.
address
=
type0
==
3
?
(
item
.
province
?
ad
:
"未填"
)
:
'/'
;
item
.
shipStatus
=
type0
==
3
?
(
shipMsg
[
item
.
shipStatus
])
:
'/'
;
item
.
shipCompany
=
type0
==
3
?
(
item
.
shipCompany
||
'/'
)
:
'/'
;
item
.
shipNum
=
type0
==
3
?
(
item
.
shipNum
||
'/'
)
:
'/'
;
})
// console.log(`xlsxData: ${JSON.stringify(xlsxData)}`);
return
resultsModel
.
success
({
list
:
awardslist
,
total
});
}
catch
(
e
)
{
console
.
log
(
"上传文件出错"
,
e
);
...
...
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