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
622133ca
authored
Dec 01, 2017
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'f-6.6.4' into f-6.6.5
parents
383d3e67
2bad988d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
103 additions
and
23 deletions
src/main/java/com/ctrip/fun/admin/controller/order/AbstractOpOrderController.java
src/main/java/com/ctrip/fun/admin/controller/order/OpCommuneOrderController.java
src/main/java/com/ctrip/fun/admin/controller/order/OpCourseOrderController.java
src/main/java/com/ctrip/fun/admin/controller/order/OpEventActivityOrderController.java
src/main/java/com/ctrip/fun/admin/controller/order/OpRechargeOrderController.java
src/main/java/com/ctrip/fun/admin/controller/order/OpTourOrderController.java
src/main/webapp/WEB-INF/templates/eventActivityOrder/common/refundPay.ftl
src/main/webapp/WEB-INF/templates/eventActivityOrder/detail/orderDetailWithRefund.ftl
src/main/webapp/resource/js/app/op.js
src/main/java/com/ctrip/fun/admin/controller/order/AbstractOpOrderController.java
View file @
622133ca
...
...
@@ -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
);
/*
...
...
src/main/java/com/ctrip/fun/admin/controller/order/OpCommuneOrderController.java
View file @
622133ca
...
...
@@ -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
;
...
...
src/main/java/com/ctrip/fun/admin/controller/order/OpCourseOrderController.java
View file @
622133ca
...
...
@@ -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
);
...
...
src/main/java/com/ctrip/fun/admin/controller/order/OpEventActivityOrderController.java
View file @
622133ca
...
...
@@ -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
);
...
...
src/main/java/com/ctrip/fun/admin/controller/order/OpRechargeOrderController.java
View file @
622133ca
...
...
@@ -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
;
}
...
...
src/main/java/com/ctrip/fun/admin/controller/order/OpTourOrderController.java
View file @
622133ca
...
...
@@ -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
);
...
...
src/main/webapp/WEB-INF/templates/eventActivityOrder/common/refundPay.ftl
View file @
622133ca
...
...
@@ -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=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!} | 可退:${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!} | 可退:${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}/人 | 总返现:${orderBean.cashRebate}</td>
</tr>
</#if>
<tr>
<td>兑换券</td>
<td>
...
...
src/main/webapp/WEB-INF/templates/eventActivityOrder/detail/orderDetailWithRefund.ftl
View file @
622133ca
...
...
@@ -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">
...
...
src/main/webapp/resource/js/app/op.js
View file @
622133ca
...
...
@@ -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");
}
}
...
...
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