Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-golf-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a4a70bc8
authored
Nov 21, 2017
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add the flashsale res limite
parent
19988147
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
src/main/java/com/ctrip/fun/golf/service/product/CourseResourceService.java
src/main/java/com/ctrip/fun/golf/service/product/CourseResourceService.java
View file @
a4a70bc8
...
@@ -2,6 +2,8 @@ package com.ctrip.fun.golf.service.product;
...
@@ -2,6 +2,8 @@ package com.ctrip.fun.golf.service.product;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.text.NumberFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.BitSet
;
import
java.util.BitSet
;
import
java.util.Calendar
;
import
java.util.Calendar
;
...
@@ -803,6 +805,11 @@ public class CourseResourceService extends
...
@@ -803,6 +805,11 @@ public class CourseResourceService extends
if
(
startTime
==
null
)
{
if
(
startTime
==
null
)
{
return
FlashSaleStatusEnum
.
INVALID_PARAMETER
.
getValue
();
// 参数非法
return
FlashSaleStatusEnum
.
INVALID_PARAMETER
.
getValue
();
// 参数非法
}
}
if
(
priceDate
!=
null
&&
DateUtil
.
getDistinceDay
(
new
Date
(),
priceDate
)
<
0
){
//已经过期的 资源,打球日期早于今天的资源不能抢购了
return
FlashSaleStatusEnum
.
RESOURCE_NOT_FOUND
.
getValue
();
// 资源不存在
}
long
startSec
=
startTime
.
getTime
();
long
startSec
=
startTime
.
getTime
();
long
now
=
this
.
asmCourseResourceDao
.
getCurrentTime
().
getTime
();
long
now
=
this
.
asmCourseResourceDao
.
getCurrentTime
().
getTime
();
if
(
now
<
startSec
)
if
(
now
<
startSec
)
...
@@ -1001,10 +1008,11 @@ public class CourseResourceService extends
...
@@ -1001,10 +1008,11 @@ public class CourseResourceService extends
//add by caosy:
//add by caosy:
name
=
name
+
"-"
+
DateUtil
.
chineseDayForWeek
(
asmCourseResource
.
getPriceDate
());
name
=
name
+
"-"
+
DateUtil
.
chineseDayForWeek
(
asmCourseResource
.
getPriceDate
());
BigDecimal
priceDelta
=
new
BigDecimal
(
asmCourseResource
.
getMarketPrice
().
toString
()).
subtract
(
new
BigDecimal
(
asmCourseResource
.
getSalePrice
().
toString
()));
BigDecimal
priceDelta
=
new
BigDecimal
(
asmCourseResource
.
getMarketPrice
().
toString
()).
subtract
(
new
BigDecimal
(
asmCourseResource
.
getSalePrice
().
toString
()));
DecimalFormat
nf
=
new
DecimalFormat
(
"#"
);
if
(
asmCourseResource
.
getCashRebate
()
>
0
){
if
(
asmCourseResource
.
getCashRebate
()
>
0
){
name
=
name
+
"爱玩返现"
+
asmCourseResource
.
getCashRebate
(
)+
"元"
;
name
=
name
+
"爱玩返现"
+
nf
.
format
(
asmCourseResource
.
getCashRebate
()
)+
"元"
;
}
else
if
(
priceDelta
.
doubleValue
()
>
0
){
}
else
if
(
priceDelta
.
doubleValue
()
>
0
){
name
=
name
+
"爱玩补贴"
+
priceDelta
.
doubleValue
(
)+
"元"
;
name
=
name
+
"爱玩补贴"
+
nf
.
format
(
priceDelta
.
doubleValue
()
)+
"元"
;
}
}
Date
startDate
=
asmCourseResource
.
getPriceDate
();
Date
startDate
=
asmCourseResource
.
getPriceDate
();
String
startTime
=
asmCourseResource
.
getStartTime
();
String
startTime
=
asmCourseResource
.
getStartTime
();
...
...
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