Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
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
0ec80986
authored
Sep 20, 2022
by
caosy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员专享抵扣劵
parent
4e3866bd
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
401 additions
and
121 deletions
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/ActivityTypeCodeEnum.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/BuyVoucherActivityBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/BuyVoucherActivityQuery.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/GeneralVoucherRuleConditionBaseBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/GeneralVoucherRuleConditionBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TourVoucherRuleConditionBaseBean.java → fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/PhysicalVoucherRuleConditionBaseBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TourVoucherRuleConditionBean.java → fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/PhysicalVoucherRuleConditionBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TicketVoucherRuleConditionBaseBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TicketVoucherRuleConditionBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TrainVoucherRuleConditionBaseBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TrainVoucherRuleConditionBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VipVoucherRuleConditionBaseBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VipVoucherRuleConditionBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VoucherTypeEnum.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/CommuneOrderBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/ActivityTypeCodeEnum.java
View file @
0ec80986
...
...
@@ -8,7 +8,7 @@ public enum ActivityTypeCodeEnum {
/**
* 套票
*/
PACKAGE
(
1
,
"套票"
),
PACKAGE
(
1
,
"套票
产品
"
),
/**
*培训产品
*/
...
...
@@ -16,7 +16,11 @@ public enum ActivityTypeCodeEnum {
/**
*培训产品
*/
SVIP
(
3
,
"超级会员"
),
SVIP
(
3
,
"会员产品"
),
/**
* 实物
*/
PHYSICAL
(
4
,
"实物产品"
),
;
private
Integer
value
;
...
...
@@ -35,6 +39,10 @@ public enum ActivityTypeCodeEnum {
}
}
public
static
ActivityTypeCodeEnum
valueOf
(
int
value
)
{
return
map
.
get
(
value
);
}
public
Integer
getValue
()
{
return
value
;
}
...
...
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/BuyVoucherActivityBean.java
View file @
0ec80986
...
...
@@ -40,7 +40,9 @@ public class BuyVoucherActivityBean implements Serializable {
private
Integer
overdueCanBuy
;
//过期会员购买 1-不可以 2-可以
private
Integer
activityType
;
//产品类型 1-套票 2-培训产品 3-超级会员
private
Integer
activityType
;
//产品类型 1-套票 2-培训产品 3-超级会员 4-实物
private
String
activityTypeMsg
;
public
Integer
getVoucherType
()
{
return
voucherType
;
}
...
...
@@ -269,4 +271,12 @@ public class BuyVoucherActivityBean implements Serializable {
this
.
activityType
=
activityType
;
}
public
String
getActivityTypeMsg
()
{
return
activityTypeMsg
;
}
public
void
setActivityTypeMsg
(
String
activityTypeMsg
)
{
this
.
activityTypeMsg
=
activityTypeMsg
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/BuyVoucherActivityQuery.java
View file @
0ec80986
...
...
@@ -25,7 +25,7 @@ public class BuyVoucherActivityQuery extends AbstractPagedQuery {
private
Integer
voucherType
;
//卷类型 1 -正常卷 2-体验卷需要身份证
private
Integer
showPaths
;
//显示途径 1-App 2-小程序 3-全部
private
Integer
overdueCanBuy
;
//过期会员购买 1-不可以 2-可以
private
Integer
activityType
;
//产品类型 1-套票 2-培训产品 3-超级会员
private
Integer
activityType
;
//产品类型 1-套票 2-培训产品 3-超级会员
4-实物
...
...
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/GeneralVoucherRuleConditionBaseBean.java
0 → 100644
View file @
0ec80986
package
com
.
ctrip
.
fun
.
common
.
vo
.
basic
;
import
java.util.Date
;
/**
* 通用
* @author yuechuan
*
*/
public
class
GeneralVoucherRuleConditionBaseBean
extends
AbstractRuleConditionBaseBean
{
private
static
final
long
serialVersionUID
=
4101212688944997275L
;
/**
* 资源ID
*/
private
int
resourceId
;
/**
* 产品ID
*/
private
int
productId
;
/**
* 购买日期
*/
private
Date
buyDate
;
public
int
getResourceId
()
{
return
resourceId
;
}
public
void
setResourceId
(
int
resourceId
)
{
this
.
resourceId
=
resourceId
;
}
public
int
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
int
productId
)
{
this
.
productId
=
productId
;
}
public
Date
getBuyDate
()
{
return
buyDate
;
}
public
void
setBuyDate
(
Date
buyDate
)
{
this
.
buyDate
=
buyDate
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/GeneralVoucherRuleConditionBean.java
0 → 100644
View file @
0ec80986
package
com
.
ctrip
.
fun
.
common
.
vo
.
basic
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
/**
* 通用劵(会员、套票、培训)
* @author yuechuan
*
*/
public
class
GeneralVoucherRuleConditionBean
extends
AbstractRuleConditionBean
<
GeneralVoucherRuleConditionBaseBean
>{
@Override
public
boolean
isEnableUse
(
GeneralVoucherRuleConditionBaseBean
t
)
{
if
(
this
.
getType
()
==
1
)
{
return
true
;
}
else
if
(
getType
()
==
2
)
{
// 转换数据(产品ID、资源ID)
List
<
Integer
>
productIdList
=
new
ArrayList
<
Integer
>();
if
(
StringUtils
.
hasText
(
this
.
getValue
()))
{
String
[]
productIdArray
=
this
.
getValue
().
split
(
","
);
for
(
String
s
:
productIdArray
)
{
if
(
StringUtils
.
hasText
(
s
))
{
productIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
}
boolean
isEnableProduct
=
true
,
isEnableProductStartDate
=
true
,
isEnableProductEndDate
=
true
;
if
(!
CollectionUtils
.
isEmpty
(
productIdList
)
&&
productIdList
.
contains
(
t
.
getProductId
()))
{
isEnableProduct
=
false
;
}
if
(
getProductStartDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductStartDate
().
after
(
t
.
getBuyDate
()))
{
isEnableProductStartDate
=
false
;
}
if
(
getProductEndDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductEndDate
().
before
(
t
.
getBuyDate
()))
{
isEnableProductEndDate
=
false
;
}
if
(
isEnableProductStartDate
&&
isEnableProductEndDate
&&
isEnableProduct
)
{
return
true
;
}
}
return
false
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/
Tour
VoucherRuleConditionBaseBean.java
→
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/
Physical
VoucherRuleConditionBaseBean.java
View file @
0ec80986
...
...
@@ -11,7 +11,7 @@ import org.springframework.util.StringUtils;
* @author DELL
*
*/
public
class
Tour
VoucherRuleConditionBaseBean
extends
AbstractRuleConditionBaseBean
{
public
class
Physical
VoucherRuleConditionBaseBean
extends
AbstractRuleConditionBaseBean
{
private
static
final
long
serialVersionUID
=
4101212688944997275L
;
/**
...
...
@@ -23,6 +23,11 @@ public class TourVoucherRuleConditionBaseBean extends AbstractRuleConditionBaseB
* 产品ID
*/
private
int
productId
;
/**
* 购买日期
*/
private
Date
buyDate
;
public
int
getResourceId
()
{
...
...
@@ -41,5 +46,12 @@ public class TourVoucherRuleConditionBaseBean extends AbstractRuleConditionBaseB
this
.
productId
=
productId
;
}
public
Date
getBuyDate
()
{
return
buyDate
;
}
public
void
setBuyDate
(
Date
buyDate
)
{
this
.
buyDate
=
buyDate
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/
Tour
VoucherRuleConditionBean.java
→
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/
Physical
VoucherRuleConditionBean.java
View file @
0ec80986
...
...
@@ -6,58 +6,42 @@ import java.util.List;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
/**
*
会员专享
套票
*
实物
套票
* @author DELL
*
*/
public
class
TourVoucherRuleConditionBean
extends
AbstractRuleConditionBean
<
Course
RuleConditionBaseBean
>{
public
class
PhysicalVoucherRuleConditionBean
extends
AbstractRuleConditionBean
<
PhysicalVoucher
RuleConditionBaseBean
>{
@Override
public
boolean
isEnableUse
(
CourseRuleConditionBaseBean
t
)
{
// TODO Auto-generated method stub
return
false
;
public
boolean
isEnableUse
(
PhysicalVoucherRuleConditionBaseBean
t
)
{
if
(
this
.
getType
()
==
1
)
{
return
true
;
}
else
if
(
getType
()
==
2
)
{
// 转换数据(产品ID、资源ID)
List
<
Integer
>
productIdList
=
new
ArrayList
<
Integer
>();
if
(
StringUtils
.
hasText
(
this
.
getValue
()))
{
String
[]
productIdArray
=
this
.
getValue
().
split
(
","
);
for
(
String
s
:
productIdArray
)
{
if
(
StringUtils
.
hasText
(
s
))
{
productIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
}
boolean
isEnableProduct
=
true
,
isEnableProductStartDate
=
true
,
isEnableProductEndDate
=
true
;
if
(!
CollectionUtils
.
isEmpty
(
productIdList
)
&&
productIdList
.
contains
(
t
.
getProductId
()))
{
isEnableProduct
=
false
;
}
if
(
getProductStartDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductStartDate
().
after
(
t
.
getBuyDate
()))
{
isEnableProductStartDate
=
false
;
}
if
(
getProductEndDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductEndDate
().
before
(
t
.
getBuyDate
()))
{
isEnableProductEndDate
=
false
;
}
if
(
isEnableProductStartDate
&&
isEnableProductEndDate
&&
isEnableProduct
)
{
return
true
;
}
}
return
false
;
}
/*@Override
public boolean isEnableUse(CourseRuleConditionBaseBean t) {
if (this.getType() == 1) {
return true;
} else if (getType() == 2) {
// 转换数据(产品ID、资源ID)
List<Integer> productIdList = new ArrayList<Integer>();
List<Integer> resourceIdList = new ArrayList<Integer>();
if (StringUtils.hasText(this.getValue())) {
String[] productIdArray = this.getValue().split(",");
for (String s : productIdArray) {
if (StringUtils.hasText(s)) {
productIdList.add(Integer.valueOf(s));
}
}
}
if (StringUtils.hasText(this.getResourceIds())) {
String[] resourceIdArray = this.getResourceIds().split(",");
for (String s : resourceIdArray) {
if (StringUtils.hasText(s)) {
resourceIdList.add(Integer.valueOf(s));
}
}
}
boolean isEnableProduct = true, isEnableResource = true, isEnableProductStartDate = true, isEnableProductEndDate = true;
if (!CollectionUtils.isEmpty(productIdList) && !productIdList.contains(t.getProductId())) {
isEnableProduct = false;
}
if (!CollectionUtils.isEmpty(resourceIdList) && !resourceIdList.contains(t.getResourceId())) {
isEnableResource = false;
}
if (getProductStartDate() != null && t.getPlayDate() != null && getProductStartDate().after(t.getPlayDate())) {
isEnableProductStartDate = false;
}
if (getProductEndDate() != null && t.getPlayDate() != null && getProductEndDate().before(t.getPlayDate())) {
isEnableProductEndDate = false;
}
if (isEnableProduct && isEnableResource && isEnableProductStartDate && isEnableProductEndDate) {
return true;
}
}
return false;
}*/
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TicketVoucherRuleConditionBaseBean.java
0 → 100644
View file @
0ec80986
package
com
.
ctrip
.
fun
.
common
.
vo
.
basic
;
import
java.util.Date
;
public
class
TicketVoucherRuleConditionBaseBean
extends
AbstractRuleConditionBaseBean
{
private
static
final
long
serialVersionUID
=
4101212688944997275L
;
/**
* 资源ID
*/
private
int
resourceId
;
/**
* 产品ID
*/
private
int
productId
;
/**
* 购买日期
*/
private
Date
buyDate
;
public
int
getResourceId
()
{
return
resourceId
;
}
public
void
setResourceId
(
int
resourceId
)
{
this
.
resourceId
=
resourceId
;
}
public
int
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
int
productId
)
{
this
.
productId
=
productId
;
}
public
Date
getBuyDate
()
{
return
buyDate
;
}
public
void
setBuyDate
(
Date
buyDate
)
{
this
.
buyDate
=
buyDate
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TicketVoucherRuleConditionBean.java
0 → 100644
View file @
0ec80986
package
com
.
ctrip
.
fun
.
common
.
vo
.
basic
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
/**
* 套票券
* @author yuechuan
*
*/
public
class
TicketVoucherRuleConditionBean
extends
AbstractRuleConditionBean
<
TicketVoucherRuleConditionBaseBean
>{
/**
* 暂时不验证
*/
@Override
public
boolean
isEnableUse
(
TicketVoucherRuleConditionBaseBean
t
)
{
if
(
this
.
getType
()
==
1
)
{
return
true
;
}
else
if
(
getType
()
==
2
)
{
// 转换数据(产品ID、资源ID)
List
<
Integer
>
productIdList
=
new
ArrayList
<
Integer
>();
if
(
StringUtils
.
hasText
(
this
.
getValue
()))
{
String
[]
productIdArray
=
this
.
getValue
().
split
(
","
);
for
(
String
s
:
productIdArray
)
{
if
(
StringUtils
.
hasText
(
s
))
{
productIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
}
boolean
isEnableProduct
=
true
,
isEnableProductStartDate
=
true
,
isEnableProductEndDate
=
true
;
if
(!
CollectionUtils
.
isEmpty
(
productIdList
)
&&
productIdList
.
contains
(
t
.
getProductId
()))
{
isEnableProduct
=
false
;
}
if
(
getProductStartDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductStartDate
().
after
(
t
.
getBuyDate
()))
{
isEnableProductStartDate
=
false
;
}
if
(
getProductEndDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductEndDate
().
before
(
t
.
getBuyDate
()))
{
isEnableProductEndDate
=
false
;
}
if
(
isEnableProductStartDate
&&
isEnableProductEndDate
&&
isEnableProduct
)
{
return
true
;
}
}
return
false
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TrainVoucherRuleConditionBaseBean.java
View file @
0ec80986
package
com
.
ctrip
.
fun
.
common
.
vo
.
basic
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
/**
*
培训产品
套票
* @author
DELL
* 套票
* @author
yuechuan
*
*/
public
class
TrainVoucherRuleConditionBaseBean
extends
AbstractRuleConditionBaseBean
{
private
static
final
long
serialVersionUID
=
4101212688944997275L
;
private
static
final
long
serialVersionUID
=
4101212688944997215L
;
/**
* 资源ID
...
...
@@ -24,6 +21,10 @@ public class TrainVoucherRuleConditionBaseBean extends AbstractRuleConditionBase
*/
private
int
productId
;
/**
* 购买日期
*/
private
Date
buyDate
;
public
int
getResourceId
()
{
return
resourceId
;
...
...
@@ -41,5 +42,13 @@ public class TrainVoucherRuleConditionBaseBean extends AbstractRuleConditionBase
this
.
productId
=
productId
;
}
public
Date
getBuyDate
()
{
return
buyDate
;
}
public
void
setBuyDate
(
Date
buyDate
)
{
this
.
buyDate
=
buyDate
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/TrainVoucherRuleConditionBean.java
View file @
0ec80986
...
...
@@ -5,59 +5,44 @@ import java.util.List;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
/**
*
会员专享套票
* @author
DELL
*
培训券
* @author
yuechuan
*
*/
public
class
TrainVoucherRuleConditionBean
extends
AbstractRuleConditionBean
<
TrainVoucherRuleConditionBaseBean
>{
public
class
TrainVoucherRuleConditionBean
extends
AbstractRuleConditionBean
<
TrainVoucherRuleConditionBaseBean
>{
@Override
public
boolean
isEnableUse
(
TrainVoucherRuleConditionBaseBean
t
)
{
// TODO Auto-generated method stub
return
false
;
if
(
this
.
getType
()
==
1
)
{
return
true
;
}
else
if
(
getType
()
==
2
)
{
// 转换数据(产品ID、资源ID)
List
<
Integer
>
productIdList
=
new
ArrayList
<
Integer
>();
if
(
StringUtils
.
hasText
(
this
.
getValue
()))
{
String
[]
productIdArray
=
this
.
getValue
().
split
(
","
);
for
(
String
s
:
productIdArray
)
{
if
(
StringUtils
.
hasText
(
s
))
{
productIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
}
boolean
isEnableProduct
=
true
,
isEnableProductStartDate
=
true
,
isEnableProductEndDate
=
true
;
if
(!
CollectionUtils
.
isEmpty
(
productIdList
)
&&
productIdList
.
contains
(
t
.
getProductId
()))
{
isEnableProduct
=
false
;
}
if
(
getProductStartDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductStartDate
().
after
(
t
.
getBuyDate
()))
{
isEnableProductStartDate
=
false
;
}
if
(
getProductEndDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductEndDate
().
before
(
t
.
getBuyDate
()))
{
isEnableProductEndDate
=
false
;
}
if
(
isEnableProductStartDate
&&
isEnableProductEndDate
&&
isEnableProduct
)
{
return
true
;
}
}
return
false
;
}
/* @Override
public boolean isEnableUse(CourseRuleConditionBaseBean t) {
if (this.getType() == 1) {
return true;
} else if (getType() == 2) {
// 转换数据(产品ID、资源ID)
List<Integer> productIdList = new ArrayList<Integer>();
List<Integer> resourceIdList = new ArrayList<Integer>();
if (StringUtils.hasText(this.getValue())) {
String[] productIdArray = this.getValue().split(",");
for (String s : productIdArray) {
if (StringUtils.hasText(s)) {
productIdList.add(Integer.valueOf(s));
}
}
}
if (StringUtils.hasText(this.getResourceIds())) {
String[] resourceIdArray = this.getResourceIds().split(",");
for (String s : resourceIdArray) {
if (StringUtils.hasText(s)) {
resourceIdList.add(Integer.valueOf(s));
}
}
}
boolean isEnableProduct = true, isEnableResource = true, isEnableProductStartDate = true, isEnableProductEndDate = true;
if (!CollectionUtils.isEmpty(productIdList) && !productIdList.contains(t.getProductId())) {
isEnableProduct = false;
}
if (!CollectionUtils.isEmpty(resourceIdList) && !resourceIdList.contains(t.getResourceId())) {
isEnableResource = false;
}
if (getProductStartDate() != null && t.getPlayDate() != null && getProductStartDate().after(t.getPlayDate())) {
isEnableProductStartDate = false;
}
if (getProductEndDate() != null && t.getPlayDate() != null && getProductEndDate().before(t.getPlayDate())) {
isEnableProductEndDate = false;
}
if (isEnableProduct && isEnableResource && isEnableProductStartDate && isEnableProductEndDate) {
return true;
}
}
return false;
}*/
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VipVoucherRuleConditionBaseBean.java
View file @
0ec80986
...
...
@@ -7,7 +7,7 @@ import java.util.List;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
/**
*
培训
产品套票
*
会员
产品套票
* @author DELL
*
*/
...
...
@@ -24,6 +24,10 @@ public class VipVoucherRuleConditionBaseBean extends AbstractRuleConditionBaseBe
*/
private
int
productId
;
/**
* 购买日期
*/
private
Date
buyDate
;
public
int
getResourceId
()
{
return
resourceId
;
...
...
@@ -41,5 +45,13 @@ public class VipVoucherRuleConditionBaseBean extends AbstractRuleConditionBaseBe
this
.
productId
=
productId
;
}
public
Date
getBuyDate
()
{
return
buyDate
;
}
public
void
setBuyDate
(
Date
buyDate
)
{
this
.
buyDate
=
buyDate
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VipVoucherRuleConditionBean.java
View file @
0ec80986
...
...
@@ -6,18 +6,45 @@ import java.util.List;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
/**
* 会员
专享套票
* 会员
券(入社、续费)
* @author DELL
*
*/
public
class
VipVoucherRuleConditionBean
extends
AbstractRuleConditionBean
<
VipVoucherRuleConditionBaseBean
>{
/**
*
暂时不验证
*
是否可用
*/
@Override
public
boolean
isEnableUse
(
VipVoucherRuleConditionBaseBean
t
)
{
// TODO Auto-generated method stub
return
false
;
if
(
this
.
getType
()
==
1
)
{
return
true
;
}
else
if
(
getType
()
==
2
)
{
// 转换数据(产品ID)
List
<
Integer
>
productIdList
=
new
ArrayList
<
Integer
>();
if
(
StringUtils
.
hasText
(
this
.
getValue
()))
{
String
[]
productIdArray
=
this
.
getValue
().
split
(
","
);
for
(
String
s
:
productIdArray
)
{
if
(
StringUtils
.
hasText
(
s
))
{
productIdList
.
add
(
Integer
.
valueOf
(
s
));
}
}
}
boolean
isEnableProduct
=
true
,
isEnableProductStartDate
=
true
,
isEnableProductEndDate
=
true
;
if
(!
CollectionUtils
.
isEmpty
(
productIdList
)
&&
productIdList
.
contains
(
t
.
getProductId
()))
{
isEnableProduct
=
false
;
}
if
(
getProductStartDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductStartDate
().
after
(
t
.
getBuyDate
()))
{
isEnableProductStartDate
=
false
;
}
if
(
getProductEndDate
()
!=
null
&&
t
.
getBuyDate
()
!=
null
&&
getProductEndDate
().
before
(
t
.
getBuyDate
()))
{
isEnableProductEndDate
=
false
;
}
if
(
isEnableProductStartDate
&&
isEnableProductEndDate
&&
isEnableProduct
)
{
return
true
;
}
}
return
false
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VoucherTypeEnum.java
View file @
0ec80986
...
...
@@ -19,12 +19,16 @@ public enum VoucherTypeEnum {
EVENT_ACTIVITY
(
4
,
"赛事活动"
,
new
EventActivityRuleConditionBean
()),
TOUR_VOUCHER
(
5
,
"套票券"
,
new
TourVoucherRuleConditionBean
()),
PHYSICAL_VOUCHER
(
5
,
"实物劵"
,
new
PhysicalVoucherRuleConditionBean
()),
VIP_VOUCHER
(
6
,
"会员券(入社、续费)"
,
new
VipVoucherRuleConditionBean
()),
T
RAIN_VOUCHER
(
6
,
"培训券"
,
new
Train
VoucherRuleConditionBean
()),
T
ICKET_VOUCHER
(
7
,
"套票券"
,
new
Ticket
VoucherRuleConditionBean
()),
VIP_VOUCHER
(
7
,
"会员券"
,
new
VipVoucherRuleConditionBean
());
TRAIN_VOUCHER
(
8
,
"培训券"
,
new
TrainVoucherRuleConditionBean
()),
GENERAL_VOUCHER
(
9
,
"通用劵(会员、套票、培训)"
,
new
GeneralVoucherRuleConditionBean
());
private
int
value
;
private
String
msg
;
@SuppressWarnings
(
"rawtypes"
)
...
...
@@ -76,11 +80,15 @@ public enum VoucherTypeEnum {
case
4
:
return
new
EventActivityRuleConditionBean
();
case
5
:
return
new
Tour
VoucherRuleConditionBean
();
return
new
Physical
VoucherRuleConditionBean
();
case
6
:
return
new
TrainVoucherRuleConditionBean
();
case
7
:
return
new
VipVoucherRuleConditionBean
();
case
7
:
return
new
TicketVoucherRuleConditionBean
();
case
8
:
return
new
TrainVoucherRuleConditionBean
();
case
9
:
return
new
GeneralVoucherRuleConditionBean
();
default
:
return
null
;
}
...
...
@@ -102,5 +110,25 @@ public enum VoucherTypeEnum {
public
boolean
isMallProductRuleConditionBean
()
{
return
ruleConditionBean
instanceof
MallProductRuleConditionBean
;
}
public
boolean
isPhysicalVoucherRuleConditionBean
()
{
return
ruleConditionBean
instanceof
PhysicalVoucherRuleConditionBean
;
}
public
boolean
isVipVoucherRuleConditionBean
()
{
return
ruleConditionBean
instanceof
VipVoucherRuleConditionBean
;
}
public
boolean
isTicketVoucherRuleConditionBean
()
{
return
ruleConditionBean
instanceof
TicketVoucherRuleConditionBean
;
}
public
boolean
isTrainVoucherRuleConditionBean
()
{
return
ruleConditionBean
instanceof
TrainVoucherRuleConditionBean
;
}
public
boolean
isGeneralVoucherRuleConditionBean
()
{
return
ruleConditionBean
instanceof
GeneralVoucherRuleConditionBean
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/CommuneOrderBean.java
View file @
0ec80986
...
...
@@ -3,6 +3,7 @@
*/
package
com
.
ctrip
.
fun
.
common
.
vo
.
order
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -88,7 +89,9 @@ public class CommuneOrderBean extends
*/
private
Integer
isSend
;
public
String
getRecommendCode
()
{
return
recommendCode
;
...
...
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