Commit 622133ca by unknown

Merge branch 'f-6.6.4' into f-6.6.5

parents 383d3e67 2bad988d
......@@ -250,6 +250,7 @@ public abstract class AbstractOpOrderController<H extends AbstractOrderQueryForm
@RequestParam(value = "manual", required = true) int manual, // 1、手动退款 0、确认退款
@RequestParam(value = "quantityLimit", required = false) int quantityLimit, // 退单人数
@RequestParam(value = "quantity", required = false) int quantity, // 退单人数
@RequestParam(value = "playerNum", required = false) String playerNum, // 退单人数
@RequestParam(value = "orderStatus") String orderStatus, ModelMap map);
/*
......
......@@ -217,7 +217,7 @@ public class OpCommuneOrderController extends AbstractOpOrderController<CommuneO
@Override
public String confirmRefund(HttpServletRequest request, int orderId, String operator, String processDesc, Double cashRebate, int type, String refundAmount,
String prePayCardRefundAmount, String prePayRefundAmount, String voucherId, String refundUpperLimit_voucher, int manual, int quantityLimit, int quantity, String orderStatus,
String prePayCardRefundAmount, String prePayRefundAmount, String voucherId, String refundUpperLimit_voucher, int manual, int quantityLimit, int quantity, String playerNum, String orderStatus,
ModelMap map) {
// TODO Auto-generated method stub
return null;
......
......@@ -597,6 +597,7 @@ public class OpCourseOrderController extends AbstractOpOrderController<CourseOrd
@RequestParam(value = "manual", required = true) int manual, // 1、手动退款 0、确认退款
@RequestParam(value = "quantityLimit", required = false) int quantityLimit, // 退单人数
@RequestParam(value = "quantity", required = false) int quantity, // 退单人数
@RequestParam(value = "playerNum", required = false) String playerNum, // 退单人数
@RequestParam(value = "orderStatus") String orderStatus, ModelMap map) {
String result = null;
OpCourseOrderBean orderBean = opCourseOrderService.getDetail("", orderId);
......
......@@ -5,6 +5,7 @@ import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
......@@ -52,6 +53,7 @@ import com.ctrip.fun.common.vo.order.OrderStatusEnum;
import com.ctrip.fun.common.vo.product.ProductPaymentTypeEnum;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.utility.StringUtil;
/**
* @author thshi
......@@ -378,6 +380,7 @@ public class OpEventActivityOrderController extends AbstractOpOrderController<Ev
@RequestParam(value = "manual", required = true) int manual, // 1、手动退款 0、确认退款
@RequestParam(value = "quantityLimit", required = false) int quantityLimit, // 退单人数
@RequestParam(value = "quantity", required = false) int quantity, // 退单人数
@RequestParam(value = "playerNum", required = false) String playerNum, // 退单打球人序号
@RequestParam(value = "orderStatus") String orderStatus, ModelMap map) {
String result = null;
OpEventActivityOrderBean orderBean = opEventActivityOrderService.getDetail("", orderId);
......@@ -407,13 +410,55 @@ public class OpEventActivityOrderController extends AbstractOpOrderController<Ev
}
}
}
if(StringUtils.isEmpty(playerNum)){
/*map.addAttribute("message", "退款打球人序号不能为空");
return "error";*/
quantity = 0;
processBean.setPlayerNum("");
}else{
List<Integer> players = new ArrayList<Integer>();
String[] playerNumArray = playerNum.trim().split(",");
boolean invalidNum=false;
if(playerNumArray.length == 0){
if(playerNum.trim() != null && !"".equals(playerNum.trim())){
players.add(Integer.valueOf(playerNum.trim()));
}
}else{
for (String playerNumStr : playerNumArray) {
if(playerNumStr.trim() != null && !"".equals(playerNumStr.trim())){
players.add(Integer.valueOf(playerNumStr.trim()));
}
}
}
for (Integer player : players) {
if(player.intValue() <= 0){
invalidNum = true;
break;
}
}
quantity = players.size();
boolean exceed = (quantityLimit<quantity);
if(invalidNum || exceed){
map.addAttribute("message", "退款打球人序号不正确,请检查!");
return "error";
}
processBean.setPlayerNum(playerNum.trim());
}
BigDecimal refundTotalAmount = orderBean.getPrePayCardRefundAmount().add(orderBean.getRefundAmount());
BigDecimal requestTotalAmount = BigDecimal.valueOf(Double.parseDouble(refundAmount)).add(BigDecimal.valueOf(Double.parseDouble(prePayCardRefundAmount)));
BigDecimal enableRefundAmount = orderBean.getPrePayAmount().subtract(orderBean.getVoucherAmount());
if(requestTotalAmount.add(refundTotalAmount).compareTo(enableRefundAmount)==1){
map.addAttribute("message", "退款金额超出限制!");
return "error";
}
if (type == 1) {
processBean.setOperateType(OrderProcessEnum.REFUND_ALL.getOperationCode()); // 全部退款
processDesc = processDesc + "退款金额: " + refundAmount + "元,预付卡退款金额: " + prePayCardRefundAmount + "元,优惠券退款金额: " + thisRefundVoucherAmount + "元";
processBean.setQuantity(quantityLimit);
} else {
processBean.setOperateType(OrderProcessEnum.REFUND_PART.getOperationCode()); // 部分退款
processDesc = processDesc + "退款金额: " + refundAmount + "元,预付卡退款金额: " + prePayCardRefundAmount + "元,优惠券退款金额: " + thisRefundVoucherAmount + "元";
processDesc = processDesc + "退款金额: " + refundAmount + "元,预付卡退款金额: " + prePayCardRefundAmount + "元,优惠券退款金额: "
+ thisRefundVoucherAmount + "元,退款打球人序号:"+playerNum;
processBean.setQuantity(quantityLimit - quantity);
}
processBean.setOperator(operator);
......
......@@ -209,7 +209,7 @@ public class OpRechargeOrderController extends AbstractOpOrderController<Recharg
@Override
public String confirmRefund(HttpServletRequest request, int orderId, String operator, String processDesc, Double cashRebate, int type, String refundAmount,
String prePayCardRefundAmount, String prePayRefundAmount, String voucherId, String refundUpperLimit_voucher, int manual, int quantityLimit,
int quantity, String orderStatus, ModelMap map) {
int quantity, String playerNum, String orderStatus, ModelMap map) {
// TODO Auto-generated method stub
return null;
}
......
......@@ -521,6 +521,7 @@ public class OpTourOrderController extends AbstractOpOrderController<TourOrderQu
@RequestParam(value = "manual", required = true) int manual, // 1、手动退款 0、确认退款
@RequestParam(value = "quantityLimit", required = false) int quantityLimit, // 退单人数
@RequestParam(value = "quantity", required = false) int quantity, // 退单人数
@RequestParam(value = "playerNum", required = false) String playerNum, // 退单人数
@RequestParam(value = "orderStatus") String orderStatus, ModelMap map) {
String result = null;
OpTourOrderBean orderBean = opTourOrderService.getDetail("", orderId);
......
......@@ -5,23 +5,34 @@
<input name = "operator" type="hidden" value="${Session['SPRING_SECURITY_CONTEXT'].authentication.name}"/>
<input id="manualConfirm" name = "manual" type="hidden" value="0"/>
<input name="orderStatus" type="hidden" value="${orderBean.orderStatus}"/>
<#if orderBean.payMode=="G">
<!-- 银行卡退款金额上限 -->
<#assign refundUpperLimit=orderBean.preAuthAmount-orderBean.refundAmount!>
<!-- 预付卡退款金额上限 -->
<#assign refundUpperLimit_prePayCard=orderBean.prePayCardAmount-orderBean.prePayCardRefundAmount!>
<!-- 抵用券退款金额上限 -->
<#assign refundUpperLimit_voucher=(orderBean.voucherAmount)!0-(orderBean.voucherRefundAmount)!0>
<#-- 银行卡退款金额上限 -->
<#assign refundUpperLimit=orderBean.preAuthAmount-orderBean.refundAmount!>
<#-- 预付卡退款金额上限 -->
<#assign refundUpperLimit_prePayCard=orderBean.prePayAmount + orderBean.prePayCardAmount - ((orderBean.refundAmount)!0)- ((orderBean.prePayCardRefundAmount)!0)>
<#-- 抵用券退款金额上限 -->
<#assign refundUpperLimit_voucher=(orderBean.voucherAmount)!0-(orderBean.voucherRefundAmount)!0>
<#else>
<#assign refundUpperLimit=orderBean.prePayAmount-orderBean.refundAmount!0>
<#if (refundUpperLimit<0)>
<#assign refundUpperLimit=orderBean.prePayAmount-orderBean.refundAmount!0>
<#if (refundUpperLimit<0)>
<#assign refundUpperLimit=0>
</#if>
<#assign refundUpperLimit_prePayCard= orderBean.prePayAmount + orderBean.prePayCardAmount - ((orderBean.refundAmount)!0)- ((orderBean.prePayCardRefundAmount)!0)>
<#assign refundUpperLimit_voucher=((orderBean.voucherAmount)!0)-((orderBean.voucherRefundAmount)!0)>
<#assign refundUpperLimit_prepayAmount=(orderBean.orderPayinfoBean.prePayAmount)!0>
</#if>
<#assign refundUpperLimit_prePayCard=orderBean.prePayCardAmount-orderBean.prePayCardRefundAmount!>
<#assign refundUpperLimit_voucher=((orderBean.voucherAmount)!0)-((orderBean.voucherRefundAmount)!0)>
<#assign refundUpperLimit_prepayAmount=(orderBean.orderPayinfoBean.prePayAmount)!0>
<#-- 保险不退款 -->
<#if orderBean.insuranceAmount?? && orderBean.insuranceStatus == 1 && orderBean.insuranceDate?? && .now?string('yyyyMMdd')?date('yyyyMMdd') gte orderBean.insuranceDate?string('yyyyMMdd')?date('yyyyMMdd') >
<#assign refundUpperLimit_prePayCard = refundUpperLimit_prePayCard - orderBean.insuranceAmount >
<#if refundUpperLimit_prePayCard < 0>
<#assign refundUpperLimit = refundUpperLimit + refundUpperLimit_prePayCard >
<#assign refundUpperLimit_prePayCard = 0 >
</#if>
</#if>
<input id="refundUpperLimit" type="hidden" value="${refundUpperLimit}"/>
<input id="refundUpperLimit_prePayCard" type="hidden" value="${refundUpperLimit_prePayCard}"/>
<input id="refundUpperLimit_voucher" name="refundUpperLimit_voucher" type="hidden" value="${refundUpperLimit_voucher}"/>
......@@ -34,11 +45,15 @@
<tr>
<td>退单类型</td>
<td>
<input type="radio" name="type" checked = "checked" value="1" "/>全部退款
<input type="radio" name="type" checked = "checked" value="1" onclick="changeRadio()"/>全部退款
<#if (orderBean.quantity > 0)>
<input type="radio" name="type" value="2" onclick="changeRadio()"/>部分退款
</#if>
</td>
</tr>
<tr>
<td>退单金额(含礼品卡)</td>
<td>¥<input class="input-width" style="height:30px" id = "refund" type = "text" name="refundAmount" value="${refundUpperLimit}" readonly="randonly" />
<td>¥<input class="input-width" style="height:30px" id = "refund" type = "text" name="refundAmount" value="" readonly="randonly" />
已退:${orderBean.refundAmount!}&nbsp;|&nbsp;可退:${refundUpperLimit}</td>
</tr>
<tr id="quantity" style="display:none">
......@@ -47,17 +62,23 @@
可退:${orderBean.quantity-1}</td>
<input id="orderQuantityLimit" type="hidden" name="quantityLimit" value="${orderBean.quantity}"/>
</tr>
<tr id="playernum" style="display:none">
<td>退单打球人序号</td>
<td style="color:red"> <input class="input-width" style="height:30px" type = "text" id = "playerNum" name="playerNum" value="" />
请正确填写退款打球人序号,多人以逗号分开</td>
</tr>
<tr>
<td>预付卡</td>
<td>¥<input class="input-width" style="height:30px" id = "prePayCard" type = "text" name="prePayCardRefundAmount" value="${refundUpperLimit_prePayCard}" readonly="randonly" />
<td>预付卡(建议)</td>
<td>¥<input class="input-width" style="height:30px" id = "prePayCard" type = "text" name="prePayCardRefundAmount" value="" readonly="randonly" />
已退:${orderBean.prePayCardRefundAmount!}&nbsp;|&nbsp;可退:${refundUpperLimit_prePayCard}</td>
</tr>
<#if (orderBean.quantity > 0)>
<tr id="partCashRebate" style="display:none">
<td>返现金额</td>
<td>¥<input class="input-width" style="height:30px" type = "text" name="cashRebate" />
人均返现:${orderBean.cashRebate/orderBean.quantity}/人&nbsp;|&nbsp;总返现:${orderBean.cashRebate}</td>
</tr>
</#if>
<tr>
<td>兑换券</td>
<td>
......
......@@ -36,9 +36,7 @@
<a href="javascript:;" onclick="refund()" class="btn btn-primary btn-large">退单</a>
</div>
</script>
<!-- 退款处理模板:退款信息填写表格 -->
<script id="refund-template" type="text/x-handlebars-template">
<form id= "confirmRefund" action = "/eventActivityOrder/confirmRefund" method="post">
<#include "../common/refundPay.ftl">
......
......@@ -89,7 +89,9 @@
var refundUpperLimit_prePayCard = $("#refundUpperLimit_prePayCard").attr("value"); //预付卡退款金额上限
var quantity = $("#orderQuantity").attr("value"); //退单人数
var quantityLimit = $("#orderQuantityLimit").attr("value") //退单人数上限
var quantityLimit = $("#orderQuantityLimit").attr("value"); //退单人数上限
var playerNum = $("#playerNum").attr("value"); //退单打球人序号
if(isNaN(amount)){
alert("退款金额请填入数字");
......@@ -103,6 +105,15 @@
alert("退单人数请填入数字");
}else if(parseInt(quantityLimit)<=parseInt(quantity)){
alert("退单人数大于退单人数上限");
}else if($("#playerNum").is(':visible')){
if(!playerNum){
var bool = window.confirm("退款打球人序号没有填写 ,不需要取消客户的球位吗?");
if(bool){
$("#confirmRefund").submit();
}
}else{
$("#confirmRefund").submit();
}
}else{
$("#confirmRefund").submit();
}
......@@ -203,6 +214,7 @@
$("input[type='checkbox'][name='voucherId']").attr("readonly","readonly");
$("#partCashRebate").hide();
$("#quantity_tr").hide();
$("#playernum").hide();
$("#prepayAmt").attr("readonly","readonly");
}else{
//如果是部分退款,取消默认值设置,置为可操作状态
......@@ -214,6 +226,7 @@
$("input[type='checkbox'][name='voucherId']").removeAttr("readonly");
$("#partCashRebate").show();
$("#quantity_tr").show();
$("#playernum").show();
// $("#prepayAmt").removeAttr("readonly");
}
}
......
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