Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
f32e91f7
Commit
f32e91f7
authored
Dec 06, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单详情 申请按钮校验
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
bf2c3c4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
36 deletions
+42
-36
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+38
-4
order-application-service/src/main/java/cn/freemud/entities/dto/coupon/CheckAndCancelRequest.java
+3
-0
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
+1
-32
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
f32e91f7
...
...
@@ -1143,10 +1143,6 @@ public class OrderAdapter {
responseVo
.
setEnableRefund
(
true
);
}
responseVo
.
setBizType
(
ordersBean
.
getBizType
());
//6:卖券虚拟商品 暂不能申请退款
if
(
ordersBean
.
getBizType
()
==
6
)
{
responseVo
.
setButtonRefund
(
false
);
}
List
<
Integer
>
enableRefundCodes
=
Lists
.
newArrayList
(
Arrays
.
asList
(
OrderStatus
.
RECEIPT
.
getCode
(),
OrderStatus
.
COMPLETE_MAKE
.
getCode
()));
if
(
enableRefundCodes
.
contains
(
ordersBean
.
getStatus
())
&&
PayStatus
.
HAVE_PAID
.
getCode
().
equals
(
ordersBean
.
getPayStatus
()))
{
...
...
@@ -1747,6 +1743,7 @@ public class OrderAdapter {
/**
* 是否支持退款
* fisherman 虚拟券是否可退款 在这里进行操作判断 【ID1039143】 1.已完成状态,2.配置的属性值>0&&时间范围内
*
* @param orderBean 订单详情
* @param wxAppId wxappId
...
...
@@ -1778,6 +1775,11 @@ public class OrderAdapter {
}
}
}
// fisherman 虚拟券商品是否可退款配置校验
if
(
orderBean
.
getBizType
().
compareTo
(
BizTypeEnum
.
SALE_COUPON
.
getBizType
())
==
0
)
{
return
this
.
checkRefundButtionBizTypeIs6
(
orderBean
.
getCompanyId
(),
orderBean
.
getBizType
(),
orderBean
.
getStatus
(),
wxAppId
,
new
Date
(
orderBean
.
getGmtCreate
()));
}
boolean
canRefund
=
false
;
// 查询小程序配置的退款设置
...
...
@@ -1851,6 +1853,38 @@ public class OrderAdapter {
}
/**
* 校验是否配置了 虚拟券 bizTYpe=6 可以退款
*
* @param partnerId
* @param bizType
* @param orderState
* @param wxAppId
* @param createTime
* @return
*/
public
boolean
checkRefundButtionBizTypeIs6
(
String
partnerId
,
Integer
bizType
,
Integer
orderState
,
String
wxAppId
,
Date
createTime
)
{
if
(
bizType
.
compareTo
(
BizTypeEnum
.
SALE_COUPON
.
getBizType
())
!=
0
||
orderState
.
compareTo
(
OrderStatusV1
.
COMPLETE
.
getV1Code
())
!=
0
)
{
return
false
;
}
String
redisKey
=
MessageFormat
.
format
(
OrderRedisKeyConstant
.
ORDER_REFUND_CONFIG
,
partnerId
,
wxAppId
);
String
hashKey
=
OrderRedisKeyConstant
.
HashKeyForOrderRefundConfig
.
EAT_IN
;
String
configStr
=
redisCache
.
hashGet
(
redisKey
,
hashKey
);
if
(
StringUtils
.
isNotEmpty
(
configStr
))
{
OrderRefundConfigEntity
config
=
JSON
.
parseObject
(
configStr
,
OrderRefundConfigEntity
.
class
);
Integer
couponOrderRefundDayLimit
=
config
.
getCouponOrderRefundDayLimit
();
// 必须配置了, 而且创建时间 不大于 这个时间
if
(
couponOrderRefundDayLimit
!=
null
&&
couponOrderRefundDayLimit
.
compareTo
(
0
)
>
0
)
{
Date
date
=
DateUtil
.
addDays
(
createTime
,
couponOrderRefundDayLimit
);
// 当前时间在 配置时间前面 才可以申请退款
if
(
new
Date
().
before
(
date
))
{
return
true
;
}
}
}
return
false
;
}
/**
* 预约时间
* @param gmtExpect
* @return true 可退 false不可操作
...
...
order-application-service/src/main/java/cn/freemud/entities/dto/coupon/CheckAndCancelRequest.java
View file @
f32e91f7
...
...
@@ -21,4 +21,7 @@ public class CheckAndCancelRequest {
@ApiModelProperty
(
value
=
"券号列表"
,
required
=
true
)
private
List
<
String
>
couponCodeList
;
@ApiModelProperty
(
value
=
"作废原因"
,
required
=
true
)
private
String
cancelReason
=
"用户申请退款,订单作废券请求"
;
}
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
View file @
f32e91f7
...
...
@@ -3488,7 +3488,7 @@ public class OrderServiceImpl implements Orderservice {
// fisherman 查询配置是否能退款 未完成
boolean
isTrue
=
this
.
checkRefundButtionBizTypeIs6
(
orderBean
.
getCompanyId
(),
orderBean
.
getBizType
(),
boolean
isTrue
=
orderAdapter
.
checkRefundButtionBizTypeIs6
(
orderBean
.
getCompanyId
(),
orderBean
.
getBizType
(),
orderBean
.
getStatus
(),
userLoginInfoDto
.
getWxAppId
(),
new
Date
(
orderBean
.
getGmtCreate
()));
if
(
isTrue
)
{
return
ResponseUtil
.
success
();
...
...
@@ -3496,37 +3496,6 @@ public class OrderServiceImpl implements Orderservice {
return
ResponseUtil
.
error
(
ResponseResult
.
OPERATE_NOT_SUPPORT
.
getCode
(),
"虚拟券退款配置未启用,请联系客服"
);
}
/**
* 校验是否配置了 虚拟券 bizTYpe=6 可以退款
*
* @param partnerId
* @param bizType
* @param orderState
* @param wxAppId
* @param createTime
* @return
*/
private
boolean
checkRefundButtionBizTypeIs6
(
String
partnerId
,
Integer
bizType
,
Integer
orderState
,
String
wxAppId
,
Date
createTime
)
{
if
(
bizType
.
compareTo
(
BizTypeEnum
.
SALE_COUPON
.
getBizType
())
!=
0
||
orderState
.
compareTo
(
OrderStatusV1
.
COMPLETE
.
getV1Code
())
!=
0
)
{
return
false
;
}
String
redisKey
=
MessageFormat
.
format
(
OrderRedisKeyConstant
.
ORDER_REFUND_CONFIG
,
partnerId
,
wxAppId
);
String
hashKey
=
OrderRedisKeyConstant
.
HashKeyForOrderRefundConfig
.
EAT_IN
;
String
configStr
=
redisCache
.
hashGet
(
redisKey
,
hashKey
);
if
(
StringUtils
.
isNotEmpty
(
configStr
))
{
OrderRefundConfigEntity
config
=
JSON
.
parseObject
(
configStr
,
OrderRefundConfigEntity
.
class
);
Integer
couponOrderRefundDayLimit
=
config
.
getCouponOrderRefundDayLimit
();
// 必须配置了, 而且创建时间 不大于 这个时间
if
(
couponOrderRefundDayLimit
!=
null
&&
couponOrderRefundDayLimit
.
compareTo
(
0
)
>
0
)
{
Date
date
=
DateUtil
.
addDays
(
createTime
,
couponOrderRefundDayLimit
);
// 当前时间在 配置时间前面 才可以申请退款
if
(
new
Date
().
before
(
date
))
{
return
true
;
}
}
}
return
false
;
}
/**
* 调用基础服务 获取订单信息
...
...
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