Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
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
d89920c9
authored
Sep 20, 2022
by
caosy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员专享抵扣劵
parent
3ec0d3af
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
965 additions
and
25 deletions
src/main/java/com/ctrip/fun/admin/controller/basic/BuyVoucherActivityController.java
src/main/java/com/ctrip/fun/admin/controller/basic/VoucherRuleController.java
src/main/java/com/ctrip/fun/admin/service/system/UserService.java
src/main/java/com/ctrip/fun/admin/vo/basic/VoucherRuleDto.java
src/main/webapp/WEB-INF/templates/basic/buyVoucherActivity/form.ftl
src/main/webapp/WEB-INF/templates/basic/buyVoucherActivity/list.ftl
src/main/webapp/WEB-INF/templates/basic/buyVoucherActivity/view.ftl
src/main/webapp/WEB-INF/templates/basic/voucherRule/form.ftl
src/main/webapp/WEB-INF/templates/basic/voucherRule/view.ftl
src/main/webapp/WEB-INF/templates/voucherOrder/list/voucherOrderListAll.ftl
src/main/java/com/ctrip/fun/admin/controller/basic/BuyVoucherActivityController.java
View file @
d89920c9
...
...
@@ -2,13 +2,16 @@ package com.ctrip.fun.admin.controller.basic;
import
java.io.IOException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
...
...
@@ -16,17 +19,25 @@ import org.springframework.validation.BindingResult;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.ctrip.fun.admin.form.PaginationForm
;
import
com.ctrip.fun.admin.form.golf.CourseProductQueryForm
;
import
com.ctrip.fun.admin.service.basic.BuyVoucherActivityService
;
import
com.ctrip.fun.admin.service.basic.BuyVoucherCommExcelService
;
import
com.ctrip.fun.common.core.util.BeanConverter
;
import
com.ctrip.fun.common.core.util.DateUtil
;
import
com.ctrip.fun.common.vo.PagedResponseBean
;
import
com.ctrip.fun.common.vo.SortDirectionEnum
;
import
com.ctrip.fun.common.vo.basic.ActivityTypeCodeEnum
;
import
com.ctrip.fun.common.vo.basic.BuyVoucherActivityBean
;
import
com.ctrip.fun.common.vo.basic.BuyVoucherActivityQuery
;
import
com.ctrip.fun.common.vo.basic.BuyVoucherActivityStatisticsBean
;
import
com.ctrip.fun.common.vo.basic.VoucherItemDTO
;
import
com.ctrip.fun.common.vo.basic.VoucherQueryFormDTO
;
import
com.ctrip.fun.common.vo.basic.VoucherTypeEnum
;
import
com.ctrip.fun.common.vo.product.CourseProductBean
;
import
com.ctrip.fun.common.vo.product.CourseProductQuery
;
import
com.ctrip.fun.common.vo.user.CommuneExtBean
;
...
...
@@ -162,4 +173,57 @@ public class BuyVoucherActivityController {
}
@ResponseBody
@RequestMapping
(
value
=
"/listToJson"
,
method
=
RequestMethod
.
GET
)
public
Object
listToJson
(
HttpServletRequest
request
,
@ModelAttribute
(
"form"
)
BuyVoucherActivityQuery
form
)
{
BuyVoucherActivityQuery
query
=
new
BuyVoucherActivityQuery
();
int
currentPage
=
0
;
int
pageSize
;
int
total
;
int
pageCount
;
if
(
null
!=
request
.
getParameter
(
"page"
))
{
currentPage
=
Integer
.
parseInt
(
request
.
getParameter
(
"page"
));
}
if
(!
StringUtils
.
isBlank
(
form
.
getActivityName
()))
{
form
.
setActivityName
(
form
.
getActivityName
().
trim
());
}
BeanConverter
.
copyProperties
(
query
,
form
);
if
(
form
.
getVoucherType
()!=
null
&&
form
.
getVoucherType
().
equals
(
VoucherTypeEnum
.
PHYSICAL_VOUCHER
.
getValue
())
){
// 实物
query
.
setActivityType
(
Integer
.
valueOf
(
ActivityTypeCodeEnum
.
PHYSICAL
.
getValue
()));
}
else
if
(
form
.
getVoucherType
()!=
null
&&
form
.
getVoucherType
().
equals
(
VoucherTypeEnum
.
VIP_VOUCHER
.
getValue
())
){
// 会员
query
.
setActivityType
(
Integer
.
valueOf
(
ActivityTypeCodeEnum
.
SVIP
.
getValue
()));
}
else
if
(
form
.
getVoucherType
()!=
null
&&
form
.
getVoucherType
().
equals
(
VoucherTypeEnum
.
TICKET_VOUCHER
.
getValue
())
){
// 套票
query
.
setActivityType
(
Integer
.
valueOf
(
ActivityTypeCodeEnum
.
PACKAGE
.
getValue
())
);
}
else
if
(
form
.
getVoucherType
()!=
null
&&
form
.
getVoucherType
().
equals
(
VoucherTypeEnum
.
TRAIN_VOUCHER
.
getValue
())
){
// 培训
query
.
setActivityType
(
Integer
.
valueOf
(
ActivityTypeCodeEnum
.
TRAIN
.
getValue
())
);
}
query
.
setVoucherType
(
null
);
query
.
setSortField
(
"id"
);
query
.
setSortDirection
(
SortDirectionEnum
.
DESC
);
query
.
setPagerOffset
(
currentPage
*
query
.
getPagerPerPage
());
PagedResponseBean
<
BuyVoucherActivityBean
>
response
=
buyVoucherActivityService
.
queryList
(
query
);
pageSize
=
query
.
getPagerPerPage
();
total
=
response
.
getCount
();
pageCount
=
(
0
==
total
%
pageSize
)
?
(
total
/
pageSize
)
:
(
total
/
pageSize
+
1
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
List
<
BuyVoucherActivityBean
>
activitys
=
(
List
<
BuyVoucherActivityBean
>)
response
.
getResult
();
for
(
BuyVoucherActivityBean
activity
:
activitys
){
if
(
activity
.
getActivityType
()
!=
0
&&
activity
.
getActivityType
()
!=
null
)
{
activity
.
setActivityTypeMsg
(
ActivityTypeCodeEnum
.
valueOf
(
activity
.
getActivityType
()).
getMsg
());
}
}
map
.
put
(
"list"
,
response
.
getResult
());
map
.
put
(
"paginationData"
,
new
PaginationForm
(
currentPage
,
pageSize
,
pageCount
,
total
));
return
map
;
}
}
src/main/java/com/ctrip/fun/admin/controller/basic/VoucherRuleController.java
View file @
d89920c9
...
...
@@ -40,9 +40,14 @@ import com.ctrip.fun.common.vo.basic.AbstractRuleConditionBean;
import
com.ctrip.fun.common.vo.basic.ConditionMultipleElement
;
import
com.ctrip.fun.common.vo.basic.CourseRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.EventActivityRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.GeneralVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.MallProductRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.MultipleCourseConditionBean
;
import
com.ctrip.fun.common.vo.basic.PhysicalVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.TicketVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.TrainVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.UserGradeAndVipGradeEnum
;
import
com.ctrip.fun.common.vo.basic.VipVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.VoucherRuleBean
;
import
com.ctrip.fun.common.vo.basic.VoucherRuleQuery
;
import
com.ctrip.fun.common.vo.basic.VoucherRuleSendToUserTypeEnum
;
...
...
@@ -165,6 +170,28 @@ public class VoucherRuleController {
VoucherTypeEnum
voucherTypeEnum
=
VoucherTypeEnum
.
valueOf
(
dto
.
getVoucherType
());
if
(
dto
.
getConditionJson
()
!=
null
)
{
if
(
voucherTypeEnum
!=
null
&&
voucherTypeEnum
.
isVipVoucherRuleConditionBean
())
{
AbstractRuleConditionBean
ruleConditionBean
=
JsonUtil
.
readValue
(
dto
.
getConditionJson
(),
VipVoucherRuleConditionBean
.
class
);
dto
.
setVipVoucherRuleConditionBean
((
VipVoucherRuleConditionBean
)
ruleConditionBean
);
}
else
if
(
voucherTypeEnum
!=
null
&&
voucherTypeEnum
.
isPhysicalVoucherRuleConditionBean
())
{
AbstractRuleConditionBean
ruleConditionBean
=
JsonUtil
.
readValue
(
dto
.
getConditionJson
(),
PhysicalVoucherRuleConditionBean
.
class
);
dto
.
setPhysicalVoucherRuleConditionBean
((
PhysicalVoucherRuleConditionBean
)
ruleConditionBean
);
}
else
if
(
voucherTypeEnum
!=
null
&&
voucherTypeEnum
.
isTicketVoucherRuleConditionBean
())
{
AbstractRuleConditionBean
ruleConditionBean
=
JsonUtil
.
readValue
(
dto
.
getConditionJson
(),
TicketVoucherRuleConditionBean
.
class
);
dto
.
setTicketVoucherRuleConditionBean
((
TicketVoucherRuleConditionBean
)
ruleConditionBean
);
}
else
if
(
voucherTypeEnum
!=
null
&&
voucherTypeEnum
.
isTrainVoucherRuleConditionBean
())
{
AbstractRuleConditionBean
ruleConditionBean
=
JsonUtil
.
readValue
(
dto
.
getConditionJson
(),
TrainVoucherRuleConditionBean
.
class
);
dto
.
setTrainVoucherRuleConditionBean
((
TrainVoucherRuleConditionBean
)
ruleConditionBean
);
}
else
if
(
voucherTypeEnum
!=
null
&&
voucherTypeEnum
.
isGeneralVoucherRuleConditionBean
())
{
AbstractRuleConditionBean
ruleConditionBean
=
JsonUtil
.
readValue
(
dto
.
getConditionJson
(),
GeneralVoucherRuleConditionBean
.
class
);
dto
.
setGeneralVoucherRuleConditionBean
((
GeneralVoucherRuleConditionBean
)
ruleConditionBean
);
}
if
(
dto
.
getMultiple
()==
0
){
if
(
voucherTypeEnum
!=
null
&&
voucherTypeEnum
.
isCourseRuleConditionBean
())
{
AbstractRuleConditionBean
ruleConditionBean
=
JsonUtil
.
readValue
(
...
...
@@ -345,8 +372,7 @@ public class VoucherRuleController {
// =========================== 针对不同现金券类型的check =============================
// 球场预定 check or 赛事预定 check
if
(
voucherTypeEnum
!=
null
&&
(
voucherTypeEnum
.
isCourseRuleConditionBean
()
||
voucherTypeEnum
.
isEventActivityRuleConditionBean
()))
{
&&
(
voucherTypeEnum
.
isCourseRuleConditionBean
()
||
voucherTypeEnum
.
isEventActivityRuleConditionBean
()
))
{
if
(
dto
.
getCourseRuleConditionBean
().
getType
()
==
2
)
{
List
<
Integer
>
productValueList
=
new
ArrayList
<
Integer
>();
List
<
Integer
>
resourceValueList
=
new
ArrayList
<
Integer
>();
...
...
@@ -403,7 +429,182 @@ public class VoucherRuleController {
BeanConverter
.
copyProperties
(
dto
.
getEventActivityRuleConditionBean
(),
dto
.
getCourseRuleConditionBean
());
}
}
// =========================== 针对不同现金券类型的check 套票 会员 实物 通用 培训 =============================
if
(
voucherTypeEnum
!=
null
&&
(
voucherTypeEnum
.
isVipVoucherRuleConditionBean
()
||
voucherTypeEnum
.
isPhysicalVoucherRuleConditionBean
()
||
voucherTypeEnum
.
isTicketVoucherRuleConditionBean
()||
voucherTypeEnum
.
isGeneralVoucherRuleConditionBean
()
||
voucherTypeEnum
.
isTrainVoucherRuleConditionBean
()
))
{
if
(
dto
.
getVipVoucherRuleConditionBean
().
getType
()
==
2
)
{
List
<
Integer
>
activityValueList
=
new
ArrayList
<
Integer
>();
String
activityValue
=
dto
.
getVipVoucherRuleConditionBean
().
getValue
();
if
(
StringUtils
.
hasText
(
activityValue
))
{
this
.
stringToCollection
(
activityValue
,
activityValueList
,
","
);
if
(
CollectionUtils
.
isEmpty
(
activityValueList
))
{
FieldError
fieldError
=
new
FieldError
(
"dto"
,
"courseRuleConditionBean.value"
,
activityValue
,
false
,
null
,
null
,
"会员产品ID格式不正确!"
);
bindingResult
.
addError
(
fieldError
);
}
}
dto
.
getVipVoucherRuleConditionBean
().
setValue
(
StringUtils
.
collectionToCommaDelimitedString
(
activityValueList
));
if
(
dto
.
getVipVoucherRuleConditionBean
().
getProductStartDate
()
!=
null
&&
dto
.
getVipVoucherRuleConditionBean
().
getProductEndDate
()
!=
null
)
{
if
(
dto
.
getVipVoucherRuleConditionBean
().
getProductStartDate
()
.
compareTo
(
dto
.
getVipVoucherRuleConditionBean
().
getProductEndDate
())
>
0
)
{
FieldError
fieldError1
=
new
FieldError
(
"dto"
,
"vipVoucherRuleConditionBean.productStartDate"
,
dto
.
getVipVoucherRuleConditionBean
().
getProductStartDate
(),
false
,
null
,
null
,
"结束时间不能小于开始时间!"
);
FieldError
fieldError2
=
new
FieldError
(
"dto"
,
"vipVoucherRuleConditionBean.productEndDate"
,
dto
.
getVipVoucherRuleConditionBean
().
getProductEndDate
(),
false
,
null
,
null
,
""
);
bindingResult
.
addError
(
fieldError1
);
bindingResult
.
addError
(
fieldError2
);
}
}
}
if
(
voucherTypeEnum
.
isPhysicalVoucherRuleConditionBean
())
{
BeanConverter
.
copyProperties
(
dto
.
getPhysicalVoucherRuleConditionBean
(),
dto
.
getVipVoucherRuleConditionBean
());
}
else
if
(
voucherTypeEnum
.
isTicketVoucherRuleConditionBean
())
{
BeanConverter
.
copyProperties
(
dto
.
getTicketVoucherRuleConditionBean
(),
dto
.
getVipVoucherRuleConditionBean
());
}
else
if
(
voucherTypeEnum
.
isGeneralVoucherRuleConditionBean
())
{
BeanConverter
.
copyProperties
(
dto
.
getGeneralVoucherRuleConditionBean
(),
dto
.
getVipVoucherRuleConditionBean
());
}
else
if
(
voucherTypeEnum
.
isTrainVoucherRuleConditionBean
())
{
BeanConverter
.
copyProperties
(
dto
.
getTrainVoucherRuleConditionBean
(),
dto
.
getVipVoucherRuleConditionBean
());
}
// else if (dto.getTicketVoucherRuleConditionBean().getType() == 2 ) {
// List<Integer> activityValueList = new ArrayList<Integer>();
// String activityValue = dto.getTicketVoucherRuleConditionBean().getValue();
// if (StringUtils.hasText(activityValue)) {
// this.stringToCollection(activityValue, activityValueList, ",");
// if (CollectionUtils.isEmpty(activityValueList)) {
// FieldError fieldError = new FieldError("dto",
// "courseRuleConditionBean.value", activityValue, false, null, null,
// "会员产品ID格式不正确!");
// bindingResult.addError(fieldError);
// }
// }
// dto.getVipVoucherRuleConditionBean().setValue(
// StringUtils.collectionToCommaDelimitedString(activityValueList));
//
// if (dto.getTicketVoucherRuleConditionBean().getProductStartDate() != null
// && dto.getTicketVoucherRuleConditionBean().getProductEndDate() != null) {
// if (dto.getTicketVoucherRuleConditionBean().getProductStartDate()
// .compareTo(dto.getTicketVoucherRuleConditionBean().getProductEndDate()) > 0) {
// FieldError fieldError1 = new FieldError("dto",
// "TicketVoucherRuleConditionBean.productStartDate", dto
// .getTicketVoucherRuleConditionBean().getProductStartDate(), false,
// null, null, "结束时间不能小于开始时间!");
// FieldError fieldError2 = new FieldError("dto",
// "TicketVoucherRuleConditionBean.productEndDate", dto
// .getTicketVoucherRuleConditionBean().getProductEndDate(), false,
// null, null, "");
// bindingResult.addError(fieldError1);
// bindingResult.addError(fieldError2);
// }
// }
// }else if (dto.getTrainVoucherRuleConditionBean().getType() == 2 ) {
// List<Integer> activityValueList = new ArrayList<Integer>();
// String activityValue = dto.getTrainVoucherRuleConditionBean().getValue();
// if (StringUtils.hasText(activityValue)) {
// this.stringToCollection(activityValue, activityValueList, ",");
// if (CollectionUtils.isEmpty(activityValueList)) {
// FieldError fieldError = new FieldError("dto",
// "courseRuleConditionBean.value", activityValue, false, null, null,
// "会员产品ID格式不正确!");
// bindingResult.addError(fieldError);
// }
// }
// dto.getVipVoucherRuleConditionBean().setValue(
// StringUtils.collectionToCommaDelimitedString(activityValueList));
//
// if (dto.getTrainVoucherRuleConditionBean().getProductStartDate() != null
// && dto.getTrainVoucherRuleConditionBean().getProductEndDate() != null) {
// if (dto.getTrainVoucherRuleConditionBean().getProductStartDate()
// .compareTo(dto.getTrainVoucherRuleConditionBean().getProductEndDate()) > 0) {
// FieldError fieldError1 = new FieldError("dto",
// "TrainVoucherRuleConditionBean.productStartDate", dto
// .getTrainVoucherRuleConditionBean().getProductStartDate(), false,
// null, null, "结束时间不能小于开始时间!");
// FieldError fieldError2 = new FieldError("dto",
// "TrainVoucherRuleConditionBean.productEndDate", dto
// .getTrainVoucherRuleConditionBean().getProductEndDate(), false,
// null, null, "");
// bindingResult.addError(fieldError1);
// bindingResult.addError(fieldError2);
// }
// }
// }else if (dto.getGeneralVoucherRuleConditionBean().getType() == 2 ) {
// List<Integer> activityValueList = new ArrayList<Integer>();
// String activityValue = dto.getGeneralVoucherRuleConditionBean().getValue();
// if (StringUtils.hasText(activityValue)) {
// this.stringToCollection(activityValue, activityValueList, ",");
// if (CollectionUtils.isEmpty(activityValueList)) {
// FieldError fieldError = new FieldError("dto",
// "courseRuleConditionBean.value", activityValue, false, null, null,
// "会员产品ID格式不正确!");
// bindingResult.addError(fieldError);
// }
// }
// dto.getVipVoucherRuleConditionBean().setValue(
// StringUtils.collectionToCommaDelimitedString(activityValueList));
//
// if (dto.getGeneralVoucherRuleConditionBean().getProductStartDate() != null
// && dto.getGeneralVoucherRuleConditionBean().getProductEndDate() != null) {
// if (dto.getGeneralVoucherRuleConditionBean().getProductStartDate()
// .compareTo(dto.getGeneralVoucherRuleConditionBean().getProductEndDate()) > 0) {
// FieldError fieldError1 = new FieldError("dto",
// "GeneralVoucherRuleConditionBean.productStartDate", dto
// .getGeneralVoucherRuleConditionBean().getProductStartDate(), false,
// null, null, "结束时间不能小于开始时间!");
// FieldError fieldError2 = new FieldError("dto",
// "GeneralVoucherRuleConditionBean.productEndDate", dto
// .getGeneralVoucherRuleConditionBean().getProductEndDate(), false,
// null, null, "");
// bindingResult.addError(fieldError1);
// bindingResult.addError(fieldError2);
// }
// }
// }else if (dto.getPhysicalVoucherRuleConditionBean().getType() == 2 ) {
// List<Integer> activityValueList = new ArrayList<Integer>();
// String activityValue = dto.getPhysicalVoucherRuleConditionBean().getValue();
// if (StringUtils.hasText(activityValue)) {
// this.stringToCollection(activityValue, activityValueList, ",");
// if (CollectionUtils.isEmpty(activityValueList)) {
// FieldError fieldError = new FieldError("dto",
// "courseRuleConditionBean.value", activityValue, false, null, null,
// "会员产品ID格式不正确!");
// bindingResult.addError(fieldError);
// }
// }
// dto.getPhysicalVoucherRuleConditionBean().setValue(
// StringUtils.collectionToCommaDelimitedString(activityValueList));
//
// if (dto.getPhysicalVoucherRuleConditionBean().getProductStartDate() != null
// && dto.getPhysicalVoucherRuleConditionBean().getProductEndDate() != null) {
// if (dto.getPhysicalVoucherRuleConditionBean().getProductStartDate()
// .compareTo(dto.getPhysicalVoucherRuleConditionBean().getProductEndDate()) > 0) {
// FieldError fieldError1 = new FieldError("dto",
// "PhysicalVoucherRuleConditionBean.productStartDate", dto
// .getPhysicalVoucherRuleConditionBean().getProductStartDate(), false,
// null, null, "结束时间不能小于开始时间!");
// FieldError fieldError2 = new FieldError("dto",
// "PhysicalVoucherRuleConditionBean.productEndDate", dto
// .getPhysicalVoucherRuleConditionBean().getProductEndDate(), false,
// null, null, "");
// bindingResult.addError(fieldError1);
// bindingResult.addError(fieldError2);
// }
// }
// }
}
}
...
...
@@ -465,7 +666,73 @@ public class VoucherRuleController {
// int type=dto.getMultipleCourseConditionBean().getType();
}
}
else
if
(
voucherTypeEnum
.
isVipVoucherRuleConditionBean
()){
// 会员
int
type
=
dto
.
getVipVoucherRuleConditionBean
().
getType
();
ruleConditionBean
.
setType
(
type
);
if
(
type
==
2
)
{
ruleConditionBean
.
setValue
(
dto
.
getVipVoucherRuleConditionBean
().
getValue
());
ruleConditionBean
.
setResourceIds
(
dto
.
getVipVoucherRuleConditionBean
().
getResourceIds
());
ruleConditionBean
.
setProductStartDate
(
dto
.
getVipVoucherRuleConditionBean
()
.
getProductStartDate
());
ruleConditionBean
.
setProductEndDate
(
DateUtil
.
getEndTime4Day
(
dto
.
getVipVoucherRuleConditionBean
().
getProductEndDate
()));
ruleConditionBean
.
setOnlyMe
(
dto
.
getOnlyMe
());
}
}
else
if
(
voucherTypeEnum
.
isTicketVoucherRuleConditionBean
()){
// 套票券
int
type
=
dto
.
getTicketVoucherRuleConditionBean
().
getType
();
ruleConditionBean
.
setType
(
type
);
if
(
type
==
2
)
{
ruleConditionBean
.
setValue
(
dto
.
getTicketVoucherRuleConditionBean
().
getValue
());
ruleConditionBean
.
setResourceIds
(
dto
.
getTicketVoucherRuleConditionBean
().
getResourceIds
());
ruleConditionBean
.
setProductStartDate
(
dto
.
getTicketVoucherRuleConditionBean
()
.
getProductStartDate
());
ruleConditionBean
.
setProductEndDate
(
DateUtil
.
getEndTime4Day
(
dto
.
getTicketVoucherRuleConditionBean
().
getProductEndDate
()));
ruleConditionBean
.
setOnlyMe
(
dto
.
getOnlyMe
());
}
}
else
if
(
voucherTypeEnum
.
isTrainVoucherRuleConditionBean
()){
// 培训券
int
type
=
dto
.
getTrainVoucherRuleConditionBean
().
getType
();
ruleConditionBean
.
setType
(
type
);
if
(
type
==
2
)
{
ruleConditionBean
.
setValue
(
dto
.
getTrainVoucherRuleConditionBean
().
getValue
());
ruleConditionBean
.
setResourceIds
(
dto
.
getTrainVoucherRuleConditionBean
().
getResourceIds
());
ruleConditionBean
.
setProductStartDate
(
dto
.
getTrainVoucherRuleConditionBean
()
.
getProductStartDate
());
ruleConditionBean
.
setProductEndDate
(
DateUtil
.
getEndTime4Day
(
dto
.
getTrainVoucherRuleConditionBean
().
getProductEndDate
()));
ruleConditionBean
.
setOnlyMe
(
dto
.
getOnlyMe
());
}
}
else
if
(
voucherTypeEnum
.
isGeneralVoucherRuleConditionBean
()){
// 通用券
int
type
=
dto
.
getGeneralVoucherRuleConditionBean
().
getType
();
ruleConditionBean
.
setType
(
type
);
if
(
type
==
2
)
{
ruleConditionBean
.
setValue
(
dto
.
getGeneralVoucherRuleConditionBean
().
getValue
());
ruleConditionBean
.
setResourceIds
(
dto
.
getGeneralVoucherRuleConditionBean
().
getResourceIds
());
ruleConditionBean
.
setProductStartDate
(
dto
.
getGeneralVoucherRuleConditionBean
()
.
getProductStartDate
());
ruleConditionBean
.
setProductEndDate
(
DateUtil
.
getEndTime4Day
(
dto
.
getGeneralVoucherRuleConditionBean
().
getProductEndDate
()));
ruleConditionBean
.
setOnlyMe
(
dto
.
getOnlyMe
());
}
}
else
if
(
voucherTypeEnum
.
isPhysicalVoucherRuleConditionBean
()){
// 实物券
int
type
=
dto
.
getPhysicalVoucherRuleConditionBean
().
getType
();
ruleConditionBean
.
setType
(
type
);
if
(
type
==
2
)
{
ruleConditionBean
.
setValue
(
dto
.
getPhysicalVoucherRuleConditionBean
().
getValue
());
ruleConditionBean
.
setResourceIds
(
dto
.
getPhysicalVoucherRuleConditionBean
().
getResourceIds
());
ruleConditionBean
.
setProductStartDate
(
dto
.
getPhysicalVoucherRuleConditionBean
()
.
getProductStartDate
());
ruleConditionBean
.
setProductEndDate
(
DateUtil
.
getEndTime4Day
(
dto
.
getPhysicalVoucherRuleConditionBean
().
getProductEndDate
()));
ruleConditionBean
.
setOnlyMe
(
dto
.
getOnlyMe
());
}
}
if
(
dto
.
getMultiple
()==
1
){
MultipleCourseConditionBean
multiConditionBean
=
dto
.
getMultipleCourseConditionBean
();
multiConditionBean
.
setOnlyMe
(
dto
.
getOnlyMe
());
...
...
@@ -508,17 +775,25 @@ public class VoucherRuleController {
nameIdBean3
.
setId
(
VoucherTypeEnum
.
TOUR
.
getValue
());
result
.
add
(
nameIdBean3
);
NameIdBean
<
Integer
>
nameIdBean4
=
new
NameIdBean
<
Integer
>();
nameIdBean4
.
setName
(
VoucherTypeEnum
.
TOUR
_VOUCHER
.
getMsg
());
nameIdBean4
.
setId
(
VoucherTypeEnum
.
TOUR
_VOUCHER
.
getValue
());
nameIdBean4
.
setName
(
VoucherTypeEnum
.
PHYSICAL
_VOUCHER
.
getMsg
());
nameIdBean4
.
setId
(
VoucherTypeEnum
.
PHYSICAL
_VOUCHER
.
getValue
());
result
.
add
(
nameIdBean4
);
NameIdBean
<
Integer
>
nameIdBean5
=
new
NameIdBean
<
Integer
>();
nameIdBean5
.
setName
(
VoucherTypeEnum
.
TRAIN
_VOUCHER
.
getMsg
());
nameIdBean5
.
setId
(
VoucherTypeEnum
.
TRAIN
_VOUCHER
.
getValue
());
nameIdBean5
.
setName
(
VoucherTypeEnum
.
VIP
_VOUCHER
.
getMsg
());
nameIdBean5
.
setId
(
VoucherTypeEnum
.
VIP
_VOUCHER
.
getValue
());
result
.
add
(
nameIdBean5
);
NameIdBean
<
Integer
>
nameIdBean6
=
new
NameIdBean
<
Integer
>();
nameIdBean6
.
setName
(
VoucherTypeEnum
.
VIP
_VOUCHER
.
getMsg
());
nameIdBean6
.
setId
(
VoucherTypeEnum
.
VIP
_VOUCHER
.
getValue
());
nameIdBean6
.
setName
(
VoucherTypeEnum
.
TICKET
_VOUCHER
.
getMsg
());
nameIdBean6
.
setId
(
VoucherTypeEnum
.
TICKET
_VOUCHER
.
getValue
());
result
.
add
(
nameIdBean6
);
NameIdBean
<
Integer
>
nameIdBean7
=
new
NameIdBean
<
Integer
>();
nameIdBean7
.
setName
(
VoucherTypeEnum
.
TRAIN_VOUCHER
.
getMsg
());
nameIdBean7
.
setId
(
VoucherTypeEnum
.
TRAIN_VOUCHER
.
getValue
());
result
.
add
(
nameIdBean7
);
NameIdBean
<
Integer
>
nameIdBean8
=
new
NameIdBean
<
Integer
>();
nameIdBean8
.
setName
(
VoucherTypeEnum
.
GENERAL_VOUCHER
.
getMsg
());
nameIdBean8
.
setId
(
VoucherTypeEnum
.
GENERAL_VOUCHER
.
getValue
());
result
.
add
(
nameIdBean8
);
return
result
;
...
...
src/main/java/com/ctrip/fun/admin/service/system/UserService.java
View file @
d89920c9
...
...
@@ -161,7 +161,7 @@ public class UserService extends BaseService {
//是系统管理用户详情中的抵用券列表
if
(
3
==
used
){
vourcherQueryRequestDTO
.
setPagerPerPage
(
1
000
);
vourcherQueryRequestDTO
.
setPagerPerPage
(
3
000
);
}
request
.
setBody
(
vourcherQueryRequestDTO
);
...
...
src/main/java/com/ctrip/fun/admin/vo/basic/VoucherRuleDto.java
View file @
d89920c9
...
...
@@ -12,8 +12,14 @@ import org.springframework.format.annotation.DateTimeFormat;
import
com.ctrip.fun.common.vo.basic.CourseRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.EventActivityRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.GeneralVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.MallProductRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.MultipleCourseConditionBean
;
import
com.ctrip.fun.common.vo.basic.PhysicalVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.TicketVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.TrainVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.VipVoucherRuleConditionBean
;
/**
* @author zgsong
...
...
@@ -137,13 +143,26 @@ public class VoucherRuleDto {
private
MallProductRuleConditionBean
mallProductRuleConditionBean
=
new
MallProductRuleConditionBean
();
private
MultipleCourseConditionBean
multipleCourseConditionBean
=
new
MultipleCourseConditionBean
();
private
PhysicalVoucherRuleConditionBean
physicalVoucherRuleConditionBean
=
new
PhysicalVoucherRuleConditionBean
();
private
VipVoucherRuleConditionBean
vipVoucherRuleConditionBean
=
new
VipVoucherRuleConditionBean
();
private
TicketVoucherRuleConditionBean
ticketVoucherRuleConditionBean
=
new
TicketVoucherRuleConditionBean
();
private
TrainVoucherRuleConditionBean
trainVoucherRuleConditionBean
=
new
TrainVoucherRuleConditionBean
();
private
GeneralVoucherRuleConditionBean
generalVoucherRuleConditionBean
=
new
GeneralVoucherRuleConditionBean
();
/**
* 操作人
*/
private
String
operater
;
/**
/**
* 创建时间
*/
private
Date
createdTime
;
...
...
@@ -550,4 +569,52 @@ public class VoucherRuleDto {
this
.
fullCutAmount
=
fullCutAmount
;
}
public
PhysicalVoucherRuleConditionBean
getPhysicalVoucherRuleConditionBean
()
{
return
physicalVoucherRuleConditionBean
;
}
public
void
setPhysicalVoucherRuleConditionBean
(
PhysicalVoucherRuleConditionBean
physicalVoucherRuleConditionBean
)
{
this
.
physicalVoucherRuleConditionBean
=
physicalVoucherRuleConditionBean
;
}
public
VipVoucherRuleConditionBean
getVipVoucherRuleConditionBean
()
{
return
vipVoucherRuleConditionBean
;
}
public
void
setVipVoucherRuleConditionBean
(
VipVoucherRuleConditionBean
vipVoucherRuleConditionBean
)
{
this
.
vipVoucherRuleConditionBean
=
vipVoucherRuleConditionBean
;
}
public
TicketVoucherRuleConditionBean
getTicketVoucherRuleConditionBean
()
{
return
ticketVoucherRuleConditionBean
;
}
public
void
setTicketVoucherRuleConditionBean
(
TicketVoucherRuleConditionBean
ticketVoucherRuleConditionBean
)
{
this
.
ticketVoucherRuleConditionBean
=
ticketVoucherRuleConditionBean
;
}
public
TrainVoucherRuleConditionBean
getTrainVoucherRuleConditionBean
()
{
return
trainVoucherRuleConditionBean
;
}
public
void
setTrainVoucherRuleConditionBean
(
TrainVoucherRuleConditionBean
trainVoucherRuleConditionBean
)
{
this
.
trainVoucherRuleConditionBean
=
trainVoucherRuleConditionBean
;
}
public
GeneralVoucherRuleConditionBean
getGeneralVoucherRuleConditionBean
()
{
return
generalVoucherRuleConditionBean
;
}
public
void
setGeneralVoucherRuleConditionBean
(
GeneralVoucherRuleConditionBean
generalVoucherRuleConditionBean
)
{
this
.
generalVoucherRuleConditionBean
=
generalVoucherRuleConditionBean
;
}
}
src/main/webapp/WEB-INF/templates/basic/buyVoucherActivity/form.ftl
View file @
d89920c9
...
...
@@ -293,18 +293,22 @@
<div class="controls">
<#if dto.activityType??>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="1" <#if dto.activityType == 1>checked</#if>>
<span style="padding-right: 20px;">套票</span>
<span style="padding-right: 20px;">套票
产品
</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="2" <#if dto.activityType == 2>checked</#if>>
<span style="padding-right: 20px;">培训产品</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="3" <#if dto.activityType == 3>checked</#if>>
<span style="padding-right: 20px;">超级会员</span>
<span style="padding-right: 20px;">会员产品</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="4" <#if dto.activityType == 4>checked</#if>>
<span style="padding-right: 20px;">实物产品</span>
<#else>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="1" checked>
<span style="padding-right: 20px;">套票</span>
<span style="padding-right: 20px;">套票
产品
</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="2" >
<span style="padding-right: 20px;">培训产品</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="3" >
<span style="padding-right: 20px;">超级会员</span>
<span style="padding-right: 20px;">会员产品</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="4" >
<span style="padding-right: 20px;">实物产品</span>
</#if>
</div>
</div>
...
...
src/main/webapp/WEB-INF/templates/basic/buyVoucherActivity/list.ftl
View file @
d89920c9
...
...
@@ -118,14 +118,17 @@
</#switch>
<#switch item.activityType>
<#case 1>
<td>套票</td>
<td>套票
产品
</td>
<#break>
<#case 2>
<td>培训产品</td>
<#break>
<#case 3>
<td>
超级会员
</td>
<td>
会员产品
</td>
<#break>
<#case 4>
<td>实物产品</td>
<#break>
<#default>
未知
</#switch>
...
...
src/main/webapp/WEB-INF/templates/basic/buyVoucherActivity/view.ftl
View file @
d89920c9
...
...
@@ -228,11 +228,13 @@
<label class="control-label" for="type">买劵活动类型</label>
<div class="controls">
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="1" checked>
<span style="padding-right: 20px;">套票</span>
<span style="padding-right: 20px;">套票
产品
</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="2">
<span style="padding-right: 20px;">培训产品</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="3" >
<span style="padding-right: 20px;">超级会员</span>
<span style="padding-right: 20px;">会员产品</span>
<input style="margin-bottom: 5px;" type="radio" name="activityType" value="4" >
<span style="padding-right: 20px;">实物产品</span>
</div>
</div>
...
...
src/main/webapp/WEB-INF/templates/basic/voucherRule/form.ftl
View file @
d89920c9
...
...
@@ -42,6 +42,26 @@
{{/each}}
</script>
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9>
<script id="table_template_activityList" type="text/x-handlebars-template">
{{#each list}}
<tr>
<td style="text-align: center;"><input type="checkbox" name="checked" value="{{id}}"/></td>
<td>{{id}}</td>
<td>{{activityName}}</td>
<td>{{activityStart}}</td>
<td>{{activityEnd}}</td>
<td>{{activityTypeMsg}}</td>
</tr>
{{/each}}
</script>
</#if>
<script src="${staticServer}/js/app/paginationForJson.js"></script>
<script src="https://cdn.bootcss.com/jquery.serializeJSON/2.8.1/jquery.serializejson.js"></script>
<script>
...
...
@@ -95,8 +115,33 @@ function getResourceList(page){
});
}
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9>
//获取专享产品数据 page为第几页
function getActivityList(page){
$('#activityList').html("");
$.ajax({
url: "/buyVoucherActivity/listToJson",
type: "get",
data: {
id: $("#activityIds").val(),
activityName:$("#activityName").val(),
voucherType:$("#voucherType").val(),
showPaths:3,
valid:1,
page: page
},
success: function (obj) {
var templateActivityList = Handlebars.compile($("#table_template_activityList").html());
$('#activityList').html(templateActivityList(obj));
//获取分页组件
getPagination(obj.paginationData,$('#activityListPage'),"getActivityList");
}
});
}
</#if>
...
...
@@ -211,7 +256,80 @@ $(function(){
sendToUserTypeJQ.trigger("click");
}
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
//产品类型选择
$("input[type=radio][name='vipVoucherRuleConditionBean.type']").click(function(){
if($(this).val()==1){
$("#vipVoucherRuleConditionType2value").hide();
$("#vipVoucherRuleCondition_value").val("");
}else{
$("#vipVoucherRuleConditionType2value").show();
}
});
var vipVoucherRuleConditionBean_typeJQ=$("input[type=radio][name='vipVoucherRuleConditionBean.type']:checked");
if(vipVoucherRuleConditionBean_typeJQ && vipVoucherRuleConditionBean_typeJQ.length>0){
if(vipVoucherRuleConditionBean_typeJQ.val()==1){
vipVoucherRuleConditionBean_typeJQ.trigger("click");
}
}
$("#vipVoucherRuleCondition_value").next().click(function (e) {
$(e.currentTarget).prev().addClass("activeProduct");
$('#activityListModal').modal('show');
getActivityList(0);
});
$("#activityButton").click(function(){
getActivityList(0);
})
$("#selectActivity").click(function(){
var selectActivityId = getselectActivityId();
if(!selectActivityId){
return false;
}
var selectedIds = selectActivityId.join(',');
console.log(selectActivityId)
//var oldValue = $("#vipVoucherRuleCondition_value").val();
var oldValue = $(".activeProduct").val();
console.log(oldValue)
if(oldValue.length>0){
//$("#courseRuleCondition_value").val(oldValue+","+selectedIds);
$(".activeProduct").val(oldValue+","+selectedIds);
}else{
//$("#courseRuleCondition_value").val(selectedIds);
$(".activeProduct").val(selectedIds);
}
$('#activityListModal').modal('hide');
});
//获取选择的活动 activityId
function getselectActivityId(){
var selectedIds = new Array();
var i = 0;
$("#activityList input[type=checkbox][name='checked']").each(function(){
if(this.checked){
selectedIds[i] = this.value;
i++;
}
});
if(i==0){
alert("您未选择任何活动产品!");
return false;
}else{
return selectedIds;
}
}
$("#activity_checkedAll").click(function(){
if(this.checked){
$("#activityList input[type=checkbox][name='checked']").attr("checked",true);
}else{
$("#activityList input[type=checkbox][name='checked']").removeAttr("checked");
}
});
</#if>
<#if dto.voucherType == 1 || dto.voucherType == 4 || dto.voucherType == 2>
//=============================球场预定/赛事=================================START
...
...
@@ -342,6 +460,7 @@ $(function(){
$(".activeProduct").removeClass("activeProduct");
});
//===============================球场预定/赛事=====================================END
</#if>
...
...
@@ -389,11 +508,11 @@ $(function(){
<div class="feature_content">
<@form.singleSelect path="dto.voucherRuleType" options=enums["com.ctrip.fun.common.vo.basic.VoucherRuleTypeEnum"] attributes="required" label="发放类型" required=true/>
<@form.singleSelect path="dto.voucherType" options=VoucherTypeList attributes="required" label="现金券类型" required=true/>
<@form.singleSelect path="dto.multiple" options=enums["com.ctrip.fun.common.vo.basic.VoucherRuleMultiEnum"] attributes="required" label="多球场现金券" required=true/>
<#if dto.voucherType == 1 || dto.voucherType == 4 || dto.voucherType==2>
<@form.singleSelect path="dto.multiple" options=enums["com.ctrip.fun.common.vo.basic.VoucherRuleMultiEnum"] attributes="required" label="多球场现金券" required=true/>
<div id="courseRuleConditionBeanId">
<div class="long_content_div control-group">
<label class="control-label" for="type"></label>
...
...
@@ -469,7 +588,33 @@ $(function(){
</div>
</#if>
<#if dto.voucherType == 5 || dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
<div id="vipVoucherRuleConditionBeanId">
<div class="long_content_div control-group">
<label class="control-label" for="type">产品类型使用</label>
<div class="controls">
<#if !dto.vipVoucherRuleConditionBean.type?? || dto.vipVoucherRuleConditionBean.type==6>
<input style="margin-bottom: 5px;" type="radio" id="vipVoucherRuleConditionBean1" name="vipVoucherRuleConditionBean.type" value="1" checked="">
<#else>
<input style="margin-bottom: 5px;" type="radio" id="vipVoucherRuleConditionBean1" name="vipVoucherRuleConditionBean.type" value="1">
</#if>
<span style="padding-right: 20px;">全部适用</span>
<#if dto.vipVoucherRuleConditionBean.type?? && dto.vipVoucherRuleConditionBean.type==2>
<input style="margin-bottom: 5px;" type="radio" id="vipVoucherRuleConditionBean2" name="vipVoucherRuleConditionBean.type" value="2" checked="">
<#else>
<input style="margin-bottom: 5px;" type="radio" id="vipVoucherRuleConditionBean2" name="vipVoucherRuleConditionBean.type" value="2">
</#if>
<span style="padding-right: 20px;">限定产品使用</span>
</div>
</div>
<div id="vipVoucherRuleConditionType2value">
<@form.addonTextInput2 path="dto.vipVoucherRuleConditionBean.value" attributes="class=\"input-medium\"" label="排除产品ID" addon="选择" addonType="button" type="text" required = false id="vipVoucherRuleCondition_value"/>
</div>
</div>
</#if>
<@form.textArea path="dto.description" attributes="class=\"input-medium\" rows=\"3\" required" label="描述" required = true />
<@form.textArea path="dto.remark" attributes="class=\"input-medium\" required rows=\"3\"" label="使用规则" required = false />
...
...
@@ -696,4 +841,57 @@ $(function(){
</div>
</div>
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
<div class="modal hide fade" id="activityListModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>查询会员专享产品</h3>
</div>
<div class="modal-body">
<div class="input-append">
<div class="form-inline">
<div class="short_content_div">
<label class="control-label" for="activityIds">活动ID</label>
<input type="text" id="activityIds" name="activityIds" value="" placeholder="活动ID" class="input-medium">
</div>
<div class="short_content_div">
<label class="control-label" for="activityName">活动产品名称</label>
<input type="text" id="activityName" name="activityName" value="" placeholder="活动产品名称" class="input-medium">
</div>
<button id="activityButton" type="button" class="btn btn-primary">查询</button>
</div>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align: center;"><input type="checkbox" id="activity_checkedAll" /></th>
<th>会员活动产品ID</th>
<th>会员活动产品名称</th>
<th>动产品开始时间</th>
<th>会员活结束时间</th>
<th>买劵活动类型</th>
</tr>
</thead>
<tbody id="activityList"></tbody>
</table>
<div class="paginationJson paginationJson-right">
<ul id="activityListPage">
</ul>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" id="selectActivity">选择</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
</div>
</div>
</#if>
</@com.layout>
src/main/webapp/WEB-INF/templates/basic/voucherRule/view.ftl
View file @
d89920c9
...
...
@@ -44,8 +44,103 @@
</script>
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
<script id="table_template_activityList" type="text/x-handlebars-template">
{{#each list}}
<tr>
<td style="text-align: center;"><input type="checkbox" name="checked" value="{{id}}"/></td>
<td>{{id}}</td>
<td>{{activityName}}</td>
<td>{{activityStart}}</td>
<td>{{activityEnd}}</td>
<td>{{activityTypeMsg}}</td>
</tr>
{{/each}}
</script>
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9>
<script>
//获取专享产品数据 page为第几页
function getActivityList(page){
$('#activityList').html("");
$.ajax({
url: "/buyVoucherActivity/listToJson",
type: "get",
data: {
id: $("#activityIds").val(),
activityName:$("#activityName").val(),
voucherType:$("#newVoucherType").val(),
showPaths:3,
valid:1,
page: page
},
success: function (obj) {
var templateActivityList = Handlebars.compile($("#table_template_activityList").html());
$('#activityList').html(templateActivityList(obj));
//获取分页组件
getPagination(obj.paginationData,$('#activityListPage'),"getActivityList");
}
});
}
</script>
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
<script>
$("#selectActivity").click(function(){
var selectActivityId = getselectActivityId();
if(!selectActivityId){
return false;
}
var selectedIds = selectActivityId.join(',');
var oldValue = $("#produtIds").val();
if(oldValue.length>0){
$("#produtIds").val(oldValue+","+selectedIds);
}else{
$("#produtIds").val(selectedIds);
}
$('#activityListModal').modal('hide');
});
//获取选择的活动 activityId
function getselectActivityId(){
var selectedIds = new Array();
var i = 0;
$("#activityList input[type=checkbox][name='checked']").each(function(){
if(this.checked){
selectedIds[i] = this.value;
i++;
}
});
if(i==0){
alert("您未选择任何活动产品!");
return false;
}else{
return selectedIds;
}
}
$("#activity_checkedAll").click(function(){
if(this.checked){
$("#activityList input[type=checkbox][name='checked']").attr("checked",true);
}else{
$("#activityList input[type=checkbox][name='checked']").removeAttr("checked");
}
});
$("#activityChooseBtn").click(function(){
$('#activityListModal').modal('show');
getActivityList(0);
});
//搜索按钮
$("#activityButton").click(function(){
getActivityList(0);
})
</script>
</#if>
<#if dto.voucherType == 1 || dto.voucherType == 4 >
<script>
...
...
@@ -279,6 +374,7 @@ function getResourceList(page){
<td style="text-align:left;width:12% ">发放类型</td>
<td style="text-align:left;width:88%">${dto.voucherRuleTypeMsg!}</td>
</tr>
<tr>
<td style="text-align:left">现金券类型</td>
<td style="text-align:left">${dto.voucherTypeMsg!}</td>
...
...
@@ -287,12 +383,144 @@ function getResourceList(page){
<td style="text-align:left">状态</td>
<td style="text-align:left">${dto.statusMsg!}</td>
</tr>
<#if dto.voucherType == 1 || dto.voucherType == 4 >
<tr>
<td style="text-align:left">多球场抵用券</td>
<td style="text-align:left">
<#if dto.multiple==0 > 否 <#elseif dto.multiple==1> 是 </#if>
</td>
</tr>
</#if>
<#if dto.voucherType == 5 >
<tr>
<td style="text-align:left">产品类型使用</td>
<td style="text-align:left">
<#if dto.physicalVoucherRuleConditionBean.type==1 > 全部类型适用
<#elseif dto.physicalVoucherRuleConditionBean.type==2> 限定产品使用 </#if>
</td>
</tr>
</#if>
<#if dto.voucherType == 6 >
<tr>
<td style="text-align:left">产品类型使用</td>
<td style="text-align:left">
<#if dto.vipVoucherRuleConditionBean.type==1 > 全部类型适用
<#elseif dto.vipVoucherRuleConditionBean.type==2> 限定产品使用 </#if>
</td>
</tr>
</#if>
<#if dto.voucherType == 7 >
<tr>
<td style="text-align:left">产品类型使用</td>
<td style="text-align:left">
<#if dto.ticketVoucherRuleConditionBean.type==1 > 全部类型适用
<#elseif dto.ticketVoucherRuleConditionBean.type==2> 限定产品使用 </#if>
</td>
</tr>
</#if>
<#if dto.voucherType == 8 >
<tr>
<td style="text-align:left">产品类型使用</td>
<td style="text-align:left">
<#if dto.trainVoucherRuleConditionBean.type==1 > 全部类型适用
<#elseif dto.trainVoucherRuleConditionBean.type==2> 限定产品使用 </#if>
</td>
</tr>
</#if>
<#if dto.voucherType == 9 >
<tr>
<td style="text-align:left">产品类型使用</td>
<td style="text-align:left">
<#if dto.generalVoucherRuleConditionBean.type==1 > 全部类型适用
<#elseif dto.generalVoucherRuleConditionBean.type==2> 限定产品使用 </#if>
</td>
</tr>
</#if>
<#if dto.voucherType == 5 >
<#if dto.physicalVoucherRuleConditionBean.type == 2>
<tr>
<td style="text-align:left">产品ID</td>
<td style="text-align:left">
<div class="long_content_div control-group ">
<div class="controls">
<span class="input-append ">
<input type="text" id="produtIds" name="produtIds" value="${dto.physicalVoucherRuleConditionBean.value!}" placeholder="产品ID" class="input-medium">
<button class="btn" type="button" id="activityChooseBtn">选择</button>
</span>
</div>
</div>
</td>
</tr>
</#if>
</#if>
<#if dto.voucherType == 6 >
<#if dto.vipVoucherRuleConditionBean.type == 2>
<tr>
<td style="text-align:left">产品ID</td>
<td style="text-align:left">
<div class="long_content_div control-group ">
<div class="controls">
<span class="input-append ">
<input type="text" id="produtIds" name="produtIds" value="${dto.vipVoucherRuleConditionBean.value!}" placeholder="产品ID" class="input-medium">
<button class="btn" type="button" id="activityChooseBtn">选择</button>
</span>
</div>
</div>
</td>
</tr>
</#if>
</#if>
<#if dto.voucherType == 7 >
<#if dto.ticketVoucherRuleConditionBean.type == 2>
<tr>
<td style="text-align:left">产品ID</td>
<td style="text-align:left">
<div class="long_content_div control-group ">
<div class="controls">
<span class="input-append ">
<input type="text" id="produtIds" name="produtIds" value="${dto.ticketVoucherRuleConditionBean.value!}" placeholder="产品ID" class="input-medium">
<button class="btn" type="button" id="activityChooseBtn">选择</button>
</span>
</div>
</div>
</td>
</tr>
</#if>
</#if>
<#if dto.voucherType == 8 >
<#if dto.trainVoucherRuleConditionBean.type == 2>
<tr>
<td style="text-align:left">产品ID</td>
<td style="text-align:left">
<div class="long_content_div control-group ">
<div class="controls">
<span class="input-append ">
<input type="text" id="produtIds" name="produtIds" value="${dto.trainVoucherRuleConditionBean.value!}" placeholder="产品ID" class="input-medium">
<button class="btn" type="button" id="activityChooseBtn">选择</button>
</span>
</div>
</div>
</td>
</tr>
</#if>
</#if>
<#if dto.voucherType == 9 >
<#if dto.generalVoucherRuleConditionBean.type == 2>
<tr>
<td style="text-align:left">产品ID</td>
<td style="text-align:left">
<div class="long_content_div control-group ">
<div class="controls">
<span class="input-append ">
<input type="text" id="produtIds" name="produtIds" value="${dto.generalVoucherRuleConditionBean.value!}" placeholder="产品ID" class="input-medium">
<button class="btn" type="button" id="activityChooseBtn">选择</button>
</span>
</div>
</div>
</td>
</tr>
</#if>
</#if>
<#if dto.voucherType == 1 && dto.multiple==0 && dto.courseRuleConditionBean.type == 1>
<tr>
<td style="text-align:left">适用范围</td>
...
...
@@ -305,7 +533,7 @@ function getResourceList(page){
<td style="text-align:left">全部类型适用</td>
</tr>
</#if>
<#if dto.multiple==1 >
<#if dto.multiple==1
&& dto.voucherType != 6 && dto.voucherType != 5 && dto.voucherType != 7 && dto.voucherType != 8 && dto.voucherType != 9
>
<tr>
<td style="text-align:left">适用范围</td>
<td style="text-align:left;word-break: break-all;">
...
...
@@ -354,6 +582,7 @@ function getResourceList(page){
</td>
</tr>
</#if>
<#if dto.voucherType == 2 && dto.multiple==0 && dto.courseRuleConditionBean.type != 1 >
<tr>
...
...
@@ -432,7 +661,7 @@ function getResourceList(page){
<tr>
<td style="text-align:left">适用范围</td>
<#if dto.multiple==0>
<#if dto.multiple==0
>
<#if dto.voucherType == 1>
<#if dto.courseRuleConditionBean.type == 1>
<td style="text-align:left">全部类型适用</td>
...
...
@@ -486,6 +715,46 @@ function getResourceList(page){
产品ID:[${dto.mallProductRuleConditionBean.value!}]
满减金额:${dto.mallProductRuleConditionBean.fullCutAmount!}元
</td>
<#elseif dto.voucherType == 5 >
<#if dto.physicalVoucherRuleConditionBean.type == 1>
<td style="text-align:left">同类型全适用</td>
<#else>
<td style="text-align:left;word-break: break-all;">
限制产品ID:[${dto.physicalVoucherRuleConditionBean.value!}]
</td>
</#if>
<#elseif dto.voucherType == 6 >
<#if dto.vipVoucherRuleConditionBean.type == 1>
<td style="text-align:left">同类型全适用</td>
<#else>
<td style="text-align:left;word-break: break-all;">
限制产品ID:[${dto.vipVoucherRuleConditionBean.value!}]
</td>
</#if>
<#elseif dto.voucherType == 7 >
<#if dto.ticketVoucherRuleConditionBean.type == 1>
<td style="text-align:left">同类型全适用</td>
<#else>
<td style="text-align:left;word-break: break-all;">
限制产品ID:[${dto.ticketVoucherRuleConditionBean.value!}]
</td>
</#if>
<#elseif dto.voucherType == 8 >
<#if dto.trainVoucherRuleConditionBean.type == 1>
<td style="text-align:left">同类型全适用</td>
<#else>
<td style="text-align:left;word-break: break-all;">
限制产品ID:[${dto.trainVoucherRuleConditionBean.value!}]
</td>
</#if>
<#elseif dto.voucherType == 9 >
<#if dto.generalVoucherRuleConditionBean.type == 1>
<td style="text-align:left">全部类型适用</td>
<#else>
<td style="text-align:left;word-break: break-all;">
限制产品ID:[${dto.generalVoucherRuleConditionBean.value!}]
</td>
</#if>
</#if>
<#elseif dto.multiple == 1>
<td style="text-align:left">
...
...
@@ -606,6 +875,7 @@ function getResourceList(page){
</#if>
</form>
</#if>
<#if dto.voucherType == 1 || dto.voucherType == 4 >
<div class="modal hide fade" id="productListModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
...
...
@@ -740,7 +1010,62 @@ function getResourceList(page){
</div>
</div>
</div>
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
<div class="modal hide fade" id="activityListModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>查询会员专享产品</h3>
</div>
<div class="modal-body">
<div class="input-append">
<div class="form-inline">
<div class="short_content_div">
<label class="control-label" for="activityIds">活动ID</label>
<input type="text" id="activityIds" name="activityIds" value="" placeholder="活动ID" class="input-medium">
</div>
<div class="short_content_div">
<label class="control-label" for="activityName">活动产品名称</label>
<input type="text" id="activityName" name="activityName" value="" placeholder="活动产品名称" class="input-medium">
</div>
<div class="short_content_div">
<input type="hidden" id="newVoucherType" name="newVoucherType" value="${dto.voucherType}" class="input-medium">
</div>
<button id="activityButton" type="button" class="btn btn-primary">查询</button>
</div>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="text-align: center;"><input type="checkbox" id="activity_checkedAll" /></th>
<th>会员活动产品ID</th>
<th>会员活动产品名称</th>
<th>动产品开始时间</th>
<th>会员活结束时间</th>
<th>买劵活动类型</th>
</tr>
</thead>
<tbody id="activityList"></tbody>
</table>
<div class="paginationJson paginationJson-right">
<ul id="activityListPage">
</ul>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" id="selectActivity">选择</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
</div>
</div>
</#if>
<div class="modal hide fade" id="add_voucher_user_modal" style="width:500px;left:65%;top:30%">
<div class="modal-header">
...
...
src/main/webapp/WEB-INF/templates/voucherOrder/list/voucherOrderListAll.ftl
View file @
d89920c9
...
...
@@ -82,7 +82,8 @@ function updateMobilePhone(){
<th>订单号</th>
<th>订单名称</th>
<th>下单时间</th>
<th>订单金额</th>
<th>订单总金额</th>
<th>劵金额</th>
<th>下单人</th>
<th>下单手机号</th>
<th>订单来源</th>
...
...
@@ -97,6 +98,7 @@ function updateMobilePhone(){
<td>${item.orderName!}</td>
<td><#if item.orderDate??>${item.orderDate?string("yyyy-MM-dd HH:mm:ss")}<#else></#if></td>
<td>${item.actualAmount!}</td>
<td>${item.voucherAmount!}</td>
<td>${item.orderUserName!}</td>
<td>${item.orderPhone!}</td>
<td>${item.platform!}</td>
...
...
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