Commit ef5217b0 by caosy

抵扣劵领取日起

parent af17ca9c
...@@ -45,6 +45,7 @@ import com.ctrip.fun.common.vo.basic.MallProductRuleConditionBean; ...@@ -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.MultipleCourseConditionBean;
import com.ctrip.fun.common.vo.basic.PhysicalVoucherRuleConditionBean; import com.ctrip.fun.common.vo.basic.PhysicalVoucherRuleConditionBean;
import com.ctrip.fun.common.vo.basic.TicketVoucherRuleConditionBean; 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.TrainVoucherRuleConditionBean;
import com.ctrip.fun.common.vo.basic.UserGradeAndVipGradeEnum; import com.ctrip.fun.common.vo.basic.UserGradeAndVipGradeEnum;
import com.ctrip.fun.common.vo.basic.VipVoucherRuleConditionBean; import com.ctrip.fun.common.vo.basic.VipVoucherRuleConditionBean;
...@@ -211,7 +212,7 @@ public class VoucherRuleController { ...@@ -211,7 +212,7 @@ public class VoucherRuleController {
dto.setMultipleCourseConditionBean(multipleBean); dto.setMultipleCourseConditionBean(multipleBean);
} }
} }
dto.setTimeTypeMsg(TimeTypeEnum.valueOf(dto.getTimeType()).getMsg());
model.addAttribute("dto", dto); model.addAttribute("dto", dto);
model.addAttribute("page", request.getParameter("page")); model.addAttribute("page", request.getParameter("page"));
return "basic/voucherRule/view"; return "basic/voucherRule/view";
...@@ -302,6 +303,7 @@ public class VoucherRuleController { ...@@ -302,6 +303,7 @@ public class VoucherRuleController {
bindingResult.addError(fieldError2); bindingResult.addError(fieldError2);
} }
//验证有效期 //验证有效期
if(dto.getTimeType() == 1){
if (dto.getStartUseDate() != null && dto.getEndUseDate() != null) { if (dto.getStartUseDate() != null && dto.getEndUseDate() != null) {
// 有效期结束时间定为当天结束时间 // 有效期结束时间定为当天结束时间
dto.setEndUseDate(DateUtil.getEndTime4Day(dto.getEndUseDate())); dto.setEndUseDate(DateUtil.getEndTime4Day(dto.getEndUseDate()));
...@@ -326,6 +328,16 @@ public class VoucherRuleController { ...@@ -326,6 +328,16 @@ public class VoucherRuleController {
bindingResult.addError(fieldError1); bindingResult.addError(fieldError1);
bindingResult.addError(fieldError2); 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>类型 //立刻发送--手动输入用户UID, 拼接UID转换成List<String>类型
if (dto.getVoucherRuleType() == VoucherRuleTypeEnum.EXECUTE_RULE.getValue() if (dto.getVoucherRuleType() == VoucherRuleTypeEnum.EXECUTE_RULE.getValue()
&& dto.getSendToUserType() == 2) { && dto.getSendToUserType() == 2) {
......
...@@ -126,6 +126,8 @@ public class VoucherRuleDto { ...@@ -126,6 +126,8 @@ public class VoucherRuleDto {
*/ */
private int status; private int status;
/** /**
* 是否多球场抵用券 * 是否多球场抵用券
*/ */
...@@ -136,6 +138,36 @@ public class VoucherRuleDto { ...@@ -136,6 +138,36 @@ public class VoucherRuleDto {
*/ */
private int validFlag; 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 CourseRuleConditionBean courseRuleConditionBean = new CourseRuleConditionBean();
private EventActivityRuleConditionBean eventActivityRuleConditionBean = new EventActivityRuleConditionBean(); private EventActivityRuleConditionBean eventActivityRuleConditionBean = new EventActivityRuleConditionBean();
...@@ -614,7 +646,28 @@ public class VoucherRuleDto { ...@@ -614,7 +646,28 @@ public class VoucherRuleDto {
this.generalVoucherRuleConditionBean = generalVoucherRuleConditionBean; 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;
}
} }
...@@ -153,6 +153,7 @@ $(function(){ ...@@ -153,6 +153,7 @@ $(function(){
$("#notCanShareInput").click(function(){ $("#notCanShareInput").click(function(){
$("#userGetLimit").css('display','none'); $("#userGetLimit").css('display','none');
}); });
//添加行 //添加行
$("#addRowBtn").click(function(){ $("#addRowBtn").click(function(){
var tableObj = document.getElementById("conditions"); var tableObj = document.getElementById("conditions");
...@@ -255,6 +256,24 @@ $(function(){ ...@@ -255,6 +256,24 @@ $(function(){
if(sendToUserTypeJQ && sendToUserTypeJQ.length>0){ if(sendToUserTypeJQ && sendToUserTypeJQ.length>0){
sendToUserTypeJQ.trigger("click"); 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>
<#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 > <#if dto.voucherType == 5 ||dto.voucherType == 6 ||dto.voucherType == 7 || dto.voucherType == 8 || dto.voucherType == 9 >
...@@ -691,6 +710,8 @@ $(function(){ ...@@ -691,6 +710,8 @@ $(function(){
</div> </div>
</#if> </#if>
<#if dto.voucherRuleType == 2> <#if dto.voucherRuleType == 2>
<input type="hidden" name="sendToUserType" value="3"> <input type="hidden" name="sendToUserType" value="3">
<@form.singleSelect path="dto.sendToUserValue" options=UserGradeAndVipGradeList label="发放用户类型(触发条件)" required=true/> <@form.singleSelect path="dto.sendToUserValue" options=UserGradeAndVipGradeList label="发放用户类型(触发条件)" required=true/>
...@@ -698,7 +719,32 @@ $(function(){ ...@@ -698,7 +719,32 @@ $(function(){
<@form.textInput path="dto.expireDate" attributes="class=\"input-medium\" style='width:207px'" label="过期时间" required = true type="date"/> <@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/> <@form.singleSelect path="dto.validFlag" options=enums["com.ctrip.fun.common.vo.basic.VourcherRuleValidFlagEnum"] label="状态" required=true/>
<#else> <#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/> <@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> </#if>
</div> </div>
<button id="submitCheck" type="button" class="btn btn-primary pull-left bottom_margin">发送</button> <button id="submitCheck" type="button" class="btn btn-primary pull-left bottom_margin">发送</button>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<style> <style>
.table th, .table td{ text-align:center;vertical-align:middle;} .table th, .table td{ text-align:center;vertical-align:middle;}
.widthShow { .widthShow {
width: 1100px; width: 1200px;
} }
</style> </style>
</#assign> </#assign>
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<@com.singleSelectQuery "dto.status" enums["com.ctrip.fun.common.vo.basic.VoucherRuleStatusEnum"] "" "现金券状态"/> <@com.singleSelectQuery "dto.status" enums["com.ctrip.fun.common.vo.basic.VoucherRuleStatusEnum"] "" "现金券状态"/>
<@com.textInput "dto.id" "style=\"margin-left: 5px;\"" "现金券ID"/> <@com.textInput "dto.id" "style=\"margin-left: 5px;\"" "现金券ID"/>
<@com.textInput "dto.description" "style=\"margin-left: 5px;\"" "现金券名称"/> <@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.endUseDateStart" "dto.endUseDateEnd" "style=\"margin-left: 5px;\"" "过期时间"/>
<@com.textInputTwoDate "dto.createdTimeStart" "dto.createdTimeEnd" "style=\"margin-left: 5px;\"" "创建时间"/> <@com.textInputTwoDate "dto.createdTimeStart" "dto.createdTimeEnd" "style=\"margin-left: 5px;\"" "创建时间"/>
<button type="submit" class="btn btn-primary">查询</button> <button type="submit" class="btn btn-primary">查询</button>
...@@ -27,15 +28,16 @@ ...@@ -27,15 +28,16 @@
<thead> <thead>
<tr> <tr>
<th style="width:5%">ID</th> <th style="width:5%">ID</th>
<th style="width:20%">描述</th> <th style="width:18%">描述</th>
<th style="width:15%">发放时间</th> <th style="width:15%">创建时间</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: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: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:8%">操作人</th>
<th style="width:10%">操作</th> <th style="width:10%">操作</th>
</tr> </tr>
...@@ -45,11 +47,12 @@ ...@@ -45,11 +47,12 @@
<tr> <tr>
<td>${item.id!}</td> <td>${item.id!}</td>
<td style="text-align:left">${item.description!}</td> <td style="text-align:left">${item.description!}</td>
<td>${item.createdTime?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>${(item.endUseDate?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
<td style="text-align:left">${item.quantityAll!}</td> <td style="text-align:left">${item.quantityAll!}</td>
<td>${item.amountAll!}</td> <td>${item.amountAll!}</td>
<td>${item.countUser!}</td> <td>${item.countUser!}</td>
<td>${item.timeTypeMsg!}</td>
<td>${item.voucherTypeMsg!}</td> <td>${item.voucherTypeMsg!}</td>
<td>${item.voucherRuleTypeMsg!}</td> <td>${item.voucherRuleTypeMsg!}</td>
<td>${item.statusMsg!}</td> <td>${item.statusMsg!}</td>
......
...@@ -383,6 +383,10 @@ function getResourceList(page){ ...@@ -383,6 +383,10 @@ function getResourceList(page){
<td style="text-align:left">状态</td> <td style="text-align:left">状态</td>
<td style="text-align:left">${dto.statusMsg!}</td> <td style="text-align:left">${dto.statusMsg!}</td>
</tr> </tr>
<tr>
<td style="text-align:left">有效期类型</td>
<td style="text-align:left">${dto.timeTypeMsg!}</td>
</tr>
<#if dto.voucherType == 1 || dto.voucherType == 4 > <#if dto.voucherType == 1 || dto.voucherType == 4 >
<tr> <tr>
<td style="text-align:left">多球场抵用券</td> <td style="text-align:left">多球场抵用券</td>
...@@ -841,6 +845,7 @@ function getResourceList(page){ ...@@ -841,6 +845,7 @@ function getResourceList(page){
<td style="text-align:left">${dto.sendToUserValueMsg!}</td> <td style="text-align:left">${dto.sendToUserValueMsg!}</td>
</#if> </#if>
</tr> </tr>
<#if dto.timeType == 1>
<tr> <tr>
<td style="text-align:left">有效期</td> <td style="text-align:left">有效期</td>
...@@ -849,6 +854,16 @@ function getResourceList(page){ ...@@ -849,6 +854,16 @@ function getResourceList(page){
</td> </td>
</tr> </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> <#if dto.voucherRuleType == 2>
<tr> <tr>
<td style="text-align:left">过期时间</td> <td style="text-align:left">过期时间</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment