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
ef5217b0
authored
Feb 22, 2023
by
caosy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抵扣劵领取日起
parent
af17ca9c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
7 deletions
src/main/java/com/ctrip/fun/admin/controller/basic/VoucherRuleController.java
src/main/java/com/ctrip/fun/admin/vo/basic/VoucherRuleDto.java
src/main/webapp/WEB-INF/templates/basic/voucherRule/form.ftl
src/main/webapp/WEB-INF/templates/basic/voucherRule/list.ftl
src/main/webapp/WEB-INF/templates/basic/voucherRule/view.ftl
src/main/java/com/ctrip/fun/admin/controller/basic/VoucherRuleController.java
View file @
ef5217b0
...
...
@@ -45,6 +45,7 @@ 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.TimeTypeEnum
;
import
com.ctrip.fun.common.vo.basic.TrainVoucherRuleConditionBean
;
import
com.ctrip.fun.common.vo.basic.UserGradeAndVipGradeEnum
;
import
com.ctrip.fun.common.vo.basic.VipVoucherRuleConditionBean
;
...
...
@@ -211,7 +212,7 @@ public class VoucherRuleController {
dto
.
setMultipleCourseConditionBean
(
multipleBean
);
}
}
dto
.
setTimeTypeMsg
(
TimeTypeEnum
.
valueOf
(
dto
.
getTimeType
()).
getMsg
());
model
.
addAttribute
(
"dto"
,
dto
);
model
.
addAttribute
(
"page"
,
request
.
getParameter
(
"page"
));
return
"basic/voucherRule/view"
;
...
...
@@ -302,6 +303,7 @@ public class VoucherRuleController {
bindingResult
.
addError
(
fieldError2
);
}
//验证有效期
if
(
dto
.
getTimeType
()
==
1
){
if
(
dto
.
getStartUseDate
()
!=
null
&&
dto
.
getEndUseDate
()
!=
null
)
{
// 有效期结束时间定为当天结束时间
dto
.
setEndUseDate
(
DateUtil
.
getEndTime4Day
(
dto
.
getEndUseDate
()));
...
...
@@ -326,6 +328,16 @@ public class VoucherRuleController {
bindingResult
.
addError
(
fieldError1
);
bindingResult
.
addError
(
fieldError2
);
}
}
else
{
if
(
dto
.
getTimeDay
()
<=
0
)
{
FieldError
fieldError1
=
new
FieldError
(
"dto"
,
"timeDay"
,
"有效期时间需大于0!"
);
// FieldError fieldError2 = new FieldError("dto", "endUseDate", "");
bindingResult
.
addError
(
fieldError1
);
// bindingResult.addError(fieldError2);
}
}
//立刻发送--手动输入用户UID, 拼接UID转换成List<String>类型
if
(
dto
.
getVoucherRuleType
()
==
VoucherRuleTypeEnum
.
EXECUTE_RULE
.
getValue
()
&&
dto
.
getSendToUserType
()
==
2
)
{
...
...
src/main/java/com/ctrip/fun/admin/vo/basic/VoucherRuleDto.java
View file @
ef5217b0
...
...
@@ -126,6 +126,8 @@ public class VoucherRuleDto {
*/
private
int
status
;
/**
* 是否多球场抵用券
*/
...
...
@@ -136,6 +138,36 @@ public class VoucherRuleDto {
*/
private
int
validFlag
;
/**
* 发放时间类型
* 1 时间段 2领取日起
*/
private
int
timeType
;
/**
* 领取日时间
*/
private
int
timeDay
;
/**
* 发放时间类型msg
*/
private
String
timeTypeMsg
;
// /**
// * 发放用户类型对应value - 发放用户类型
// */
// private String sendToUserValue1;
//
// /**
// * 发放用户类型对应value - 用户UID
// */
// private String sendToUserValue2;
//
private
CourseRuleConditionBean
courseRuleConditionBean
=
new
CourseRuleConditionBean
();
private
EventActivityRuleConditionBean
eventActivityRuleConditionBean
=
new
EventActivityRuleConditionBean
();
...
...
@@ -614,7 +646,28 @@ public class VoucherRuleDto {
this
.
generalVoucherRuleConditionBean
=
generalVoucherRuleConditionBean
;
}
public
int
getTimeType
()
{
return
timeType
;
}
public
void
setTimeType
(
int
timeType
)
{
this
.
timeType
=
timeType
;
}
public
int
getTimeDay
()
{
return
timeDay
;
}
public
void
setTimeDay
(
int
timeDay
)
{
this
.
timeDay
=
timeDay
;
}
public
String
getTimeTypeMsg
()
{
return
timeTypeMsg
;
}
public
void
setTimeTypeMsg
(
String
timeTypeMsg
)
{
this
.
timeTypeMsg
=
timeTypeMsg
;
}
}
src/main/webapp/WEB-INF/templates/basic/voucherRule/form.ftl
View file @
ef5217b0
...
...
@@ -153,6 +153,7 @@ $(function(){
$("#notCanShareInput").click(function(){
$("#userGetLimit").css('display','none');
});
//添加行
$("#addRowBtn").click(function(){
var tableObj = document.getElementById("conditions");
...
...
@@ -255,6 +256,24 @@ $(function(){
if(sendToUserTypeJQ && sendToUserTypeJQ.length>0){
sendToUserTypeJQ.trigger("click");
}
//日期类型选择
$("input[type=radio][name='timeType']").click(function(){
if($(this).val()==1){
$("#timeType2value").hide();
$("#timeValue2").val("");
$("#timeType1value").show();
}else{
$("#timeType1value").hide();
$("#timeType2value").show();
}
});
//发放用户类型radio对象
var timeTypeJQ=$("input[type=radio][name='timeType']:checked");
if(timeTypeJQ && timeTypeJQ.length>0){
timeTypeJQ.trigger("click");
}
</#if>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
...
...
@@ -691,6 +710,8 @@ $(function(){
</div>
</#if>
<#if dto.voucherRuleType == 2>
<input type="hidden" name="sendToUserType" value="3">
<@form.singleSelect path="dto.sendToUserValue" options=UserGradeAndVipGradeList label="发放用户类型(触发条件)" required=true/>
...
...
@@ -698,7 +719,32 @@ $(function(){
<@form.textInput path="dto.expireDate" attributes="class=\"input-medium\" style='width:207px'" label="过期时间" required = true type="date"/>
<@form.singleSelect path="dto.validFlag" options=enums["com.ctrip.fun.common.vo.basic.VourcherRuleValidFlagEnum"] label="状态" required=true/>
<#else>
<div class="long_content_div control-group" id="canTimeDiv">
<label class="control-label" for="type">有效期类型</label>
<div class="controls">
<#if dto.timeType==2>
<input style="margin-bottom: 5px;" type="radio" id="timeType1" name="timeType" value="1">
<span style="padding-right: 20px;">时间段</span>
<input style="margin-bottom: 5px;" type="radio" id="timeType2" name="timeType" value="2" checked="">
<span style="padding-right: 20px;">领取日起</span>
<#else>
<input style="margin-bottom: 5px;" type="radio" id="timeType1" name="timeType" value="1" checked="">
<span style="padding-right: 20px;">时间段</span>
<input style="margin-bottom: 5px;" type="radio" id="timeType2" name="timeType" value="2">
<span style="padding-right: 20px;">领取日起</span>
</#if>
</div>
</div>
<div id="timeType1value">
<@form.textInputTwoDate path1="dto.startUseDate" path2="dto.endUseDate" attributes="" label="有效期" required = true/>
</div>
<div id="timeType2value">
<@form.textInput path="dto.timeDay" attributes="class=\"input-medium\"" label="有效期(月)" required = true />
</div>
</#if>
</div>
<button id="submitCheck" type="button" class="btn btn-primary pull-left bottom_margin">发送</button>
...
...
src/main/webapp/WEB-INF/templates/basic/voucherRule/list.ftl
View file @
ef5217b0
...
...
@@ -7,7 +7,7 @@
<style>
.table th, .table td{ text-align:center;vertical-align:middle;}
.widthShow {
width: 1
1
00px;
width: 1
2
00px;
}
</style>
</#assign>
...
...
@@ -18,6 +18,7 @@
<@com.singleSelectQuery "dto.status" enums["com.ctrip.fun.common.vo.basic.VoucherRuleStatusEnum"] "" "现金券状态"/>
<@com.textInput "dto.id" "style=\"margin-left: 5px;\"" "现金券ID"/>
<@com.textInput "dto.description" "style=\"margin-left: 5px;\"" "现金券名称"/>
<@com.singleSelectQuery "dto.timeType" enums["com.ctrip.fun.common.vo.basic.TimeTypeEnum"] "" "有效期类型"/>
<@com.textInputTwoDate "dto.endUseDateStart" "dto.endUseDateEnd" "style=\"margin-left: 5px;\"" "过期时间"/>
<@com.textInputTwoDate "dto.createdTimeStart" "dto.createdTimeEnd" "style=\"margin-left: 5px;\"" "创建时间"/>
<button type="submit" class="btn btn-primary">查询</button>
...
...
@@ -27,15 +28,16 @@
<thead>
<tr>
<th style="width:5%">ID</th>
<th style="width:
20
%">描述</th>
<th style="width:15%">
发放
时间</th>
<th style="width:
18
%">描述</th>
<th style="width:15%">
创建
时间</th>
<th style="width:15%">到期时间</th>
<th style="width:5%">张数</th>
<th style="width:5%">金额</th>
<th style="width:5%">人数</th>
<th style="width:10%">有效期类型</th>
<th style="width:10%">现金券类型</th>
<th style="width:10%">发放类型</th>
<th style="width:
7
%">状态</th>
<th style="width:
8
%">状态</th>
<th style="width:8%">操作人</th>
<th style="width:10%">操作</th>
</tr>
...
...
@@ -45,11 +47,12 @@
<tr>
<td>${item.id!}</td>
<td style="text-align:left">${item.description!}</td>
<td>${item.createdTime?string("yyyy-MM-dd HH:mm:ss")
}</td>
<td>${
item.endUseDate?string("yyyy-MM-dd HH:mm:ss")
}</td>
<td>${(item.createdTime?string("yyyy-MM-dd HH:mm:ss"))!''
}</td>
<td>${
(item.endUseDate?string("yyyy-MM-dd HH:mm:ss"))!''
}</td>
<td style="text-align:left">${item.quantityAll!}</td>
<td>${item.amountAll!}</td>
<td>${item.countUser!}</td>
<td>${item.timeTypeMsg!}</td>
<td>${item.voucherTypeMsg!}</td>
<td>${item.voucherRuleTypeMsg!}</td>
<td>${item.statusMsg!}</td>
...
...
src/main/webapp/WEB-INF/templates/basic/voucherRule/view.ftl
View file @
ef5217b0
...
...
@@ -383,6 +383,10 @@ function getResourceList(page){
<td style="text-align:left">状态</td>
<td style="text-align:left">${dto.statusMsg!}</td>
</tr>
<tr>
<td style="text-align:left">有效期类型</td>
<td style="text-align:left">${dto.timeTypeMsg!}</td>
</tr>
<#if dto.voucherType == 1 || dto.voucherType == 4 >
<tr>
<td style="text-align:left">多球场抵用券</td>
...
...
@@ -841,6 +845,7 @@ function getResourceList(page){
<td style="text-align:left">${dto.sendToUserValueMsg!}</td>
</#if>
</tr>
<#if dto.timeType == 1>
<tr>
<td style="text-align:left">有效期</td>
...
...
@@ -849,6 +854,16 @@ function getResourceList(page){
</td>
</tr>
<#elseif dto.timeType == 2>
<tr>
<td style="text-align:left">有效期(月)</td>
<td style="text-align:left">
<@form.textInput path="dto.timeDay" attributes="class=\"input-medium\"" label="" required = true />
</td>
</tr>
</#if>
<#if dto.voucherRuleType == 2>
<tr>
<td style="text-align:left">过期时间</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