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
f8a74900
Commit
f8a74900
authored
Apr 07, 2024
by
roamer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/feature/box/三方券订单退款退券' into develop
parents
3a6702f9
da6f7ab5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
6 deletions
+71
-6
order-application-service/src/main/java/cn/freemud/controller/OrderController.java
+10
-0
order-application-service/src/main/java/cn/freemud/entities/vo/PreValidRefundReq.java
+45
-0
order-application-service/src/main/java/cn/freemud/service/RefundService.java
+3
-3
order-management/src/main/java/cn/freemud/management/service/handle/ThirdCouponOrderHandle.java
+13
-3
No files found.
order-application-service/src/main/java/cn/freemud/controller/OrderController.java
View file @
f8a74900
...
@@ -267,6 +267,16 @@ public class OrderController {
...
@@ -267,6 +267,16 @@ public class OrderController {
return
ResponseUtil
.
success
();
return
ResponseUtil
.
success
();
}
}
/**
* 退款预校验
*/
@ApiAnnotation
(
logMessage
=
"退款预校验"
)
@PostMapping
(
"/preValidRefund"
)
public
BaseResponse
<
Void
>
preValidRefund
(
@Validated
@LogParams
@RequestBody
PreValidRefundReq
reqVo
)
{
refundService
.
preValidRefund
(
reqVo
.
getPartnerId
(),
reqVo
.
getOrderCode
(),
reqVo
.
getRefundMode
());
return
ResponseUtil
.
success
();
}
/**
/**
* 获取订单排队号
* 获取订单排队号
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/PreValidRefundReq.java
0 → 100644
View file @
f8a74900
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: GetProductVo
* @Package cn.freemud.entities.vo
* @Description:
* @author: liming.guo
* @date: 2018/5/16 17:35
* @version V1.0
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
package
cn
.
freemud
.
entities
.
vo
;
import
com.freemud.application.sdk.api.ordercenter.enums.RefundModeEnum
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
/**
* 退款预校验参数
*
* @author haibo.jiang 2019/11/20
* @author shichang.wang 2021/4/15
*/
@ApiModel
(
"退款预校验参数"
)
@Data
public
class
PreValidRefundReq
{
@NotBlank
(
message
=
"商户号为空"
)
private
String
partnerId
;
@NotBlank
(
message
=
"订单号为空"
)
private
String
orderCode
;
/**
* 微商城退款方式
*
* @see RefundModeEnum#getIndex()
*/
@ApiModelProperty
(
value
=
"微商城退款方式"
,
notes
=
RefundModeEnum
.
API_DOC
)
private
Byte
refundMode
;
}
order-application-service/src/main/java/cn/freemud/service/RefundService.java
View file @
f8a74900
...
@@ -96,7 +96,7 @@ public class RefundService {
...
@@ -96,7 +96,7 @@ public class RefundService {
private
final
OrderCouponHandle
orderCouponHandle
;
private
final
OrderCouponHandle
orderCouponHandle
;
private
final
ThirdCouponOrderHandle
thirdCouponOrderHandle
;
private
final
ThirdCouponOrderHandle
thirdCouponOrderHandle
;
p
rivate
OrderInfoReqs
preValidRefund
(
String
partnerId
,
String
orderCode
,
Byte
refundMode
)
{
p
ublic
OrderInfoReqs
preValidRefund
(
String
partnerId
,
String
orderCode
,
Byte
refundMode
)
{
// 查询订单信息
// 查询订单信息
QueryByCodeResponse
orderResp
=
orderSdkService
.
getOrderInfo
(
partnerId
,
orderCode
);
QueryByCodeResponse
orderResp
=
orderSdkService
.
getOrderInfo
(
partnerId
,
orderCode
);
if
(
null
==
orderResp
||
null
==
orderResp
.
getResult
())
throw
new
ServiceException
(
"订单信息不存在"
);
if
(
null
==
orderResp
||
null
==
orderResp
.
getResult
())
throw
new
ServiceException
(
"订单信息不存在"
);
...
@@ -126,7 +126,7 @@ public class RefundService {
...
@@ -126,7 +126,7 @@ public class RefundService {
}
}
// 如果券没有冲正,判断核销时间,默认使用订单的创建时间
// 如果券没有冲正,判断核销时间,默认使用订单的创建时间
if
(!
coupon
.
isCanceled
())
{
if
(!
coupon
.
isCanceled
())
{
if
(
ThirdCouponOrderHandle
.
isCancelTimeout
(
new
Date
(
Long
.
parseLong
(
order
.
getCreateTime
())),
coupon
.
getEcologyChannelType
(
)))
{
if
(
ThirdCouponOrderHandle
.
isCancelTimeout
(
coupon
,
new
Date
(
Long
.
parseLong
(
order
.
getCreateTime
())
)))
{
throw
new
ServiceException
(
"三方券核销时间过长,无法申请退款"
);
throw
new
ServiceException
(
"三方券核销时间过长,无法申请退款"
);
}
}
}
}
...
@@ -457,7 +457,7 @@ public class RefundService {
...
@@ -457,7 +457,7 @@ public class RefundService {
boolean
couponUsed
=
couponQueryHandle
.
isCouponUsed
(
partnerId
,
couponCodes
);
boolean
couponUsed
=
couponQueryHandle
.
isCouponUsed
(
partnerId
,
couponCodes
);
if
(
couponUsed
)
{
if
(
couponUsed
)
{
throw
new
ServiceException
(
"
识别到您已使用过该
券包中的部分或全部券,故不支持退款。"
);
throw
new
ServiceException
(
"
已使用
券包中的部分或全部券,故不支持退款。"
);
}
}
// 冻结券
// 冻结券
boolean
freeze
=
orderCouponHandle
.
freezeCodes
(
partnerId
,
orderInfo
.
getUserId
(),
couponCodes
,
"买券订单退款"
);
boolean
freeze
=
orderCouponHandle
.
freezeCodes
(
partnerId
,
orderInfo
.
getUserId
(),
couponCodes
,
"买券订单退款"
);
...
...
order-management/src/main/java/cn/freemud/management/service/handle/ThirdCouponOrderHandle.java
View file @
f8a74900
...
@@ -113,12 +113,22 @@ public class ThirdCouponOrderHandle {
...
@@ -113,12 +113,22 @@ public class ThirdCouponOrderHandle {
* @param channelTypeEnum
* @param channelTypeEnum
* @return
* @return
*/
*/
public
static
boolean
isCancelTimeout
(
Date
redeemDate
,
@Nullable
EcologyChannelTypeEnum
channelTypeEnum
)
{
public
static
boolean
isCancelTimeout
(
ThirdCouponOrderHandle
.
ThirdCouponDto
couponDto
,
@Nullable
Date
redeemDate
)
{
EcologyChannelTypeEnum
channelTypeEnum
=
couponDto
.
getEcologyChannelType
();
if
(
redeemDate
==
null
)
{
redeemDate
=
couponDto
.
getRedeemTime
();
}
if
(
EcologyChannelTypeEnum
.
MEITUAN
.
equals
(
channelTypeEnum
))
{
if
(
EcologyChannelTypeEnum
.
MEITUAN
.
equals
(
channelTypeEnum
))
{
//
美团券不能超过 60天
//
商家核销的美团券不能超过 60天,自助核销的美团券不能超过 24小时
if
(
DateUtil
.
addDays
(
redeemDate
,
60
).
compareTo
(
new
Date
())
<
0
)
{
if
(
DateUtil
.
addDays
(
redeemDate
,
60
).
compareTo
(
new
Date
())
<
0
)
{
return
true
;
return
true
;
}
}
// 如果不是逗号分隔的纯数字,认为是加密券号(自助核销的券号是加密的)
if
(
couponDto
.
getCouponCodes
().
stream
().
anyMatch
(
code
->
!
code
.
matches
(
"^[0-9,]+$"
)))
{
if
(
redeemDate
.
getTime
()
+
24
*
3600_000
<
System
.
currentTimeMillis
())
{
return
true
;
}
}
}
else
if
(
EcologyChannelTypeEnum
.
TIKTOK
.
equals
(
channelTypeEnum
))
{
}
else
if
(
EcologyChannelTypeEnum
.
TIKTOK
.
equals
(
channelTypeEnum
))
{
// 抖音券不能超过 1 小时(3600秒)
// 抖音券不能超过 1 小时(3600秒)
if
(
redeemDate
.
getTime
()
+
3600_000
<
System
.
currentTimeMillis
())
{
if
(
redeemDate
.
getTime
()
+
3600_000
<
System
.
currentTimeMillis
())
{
...
@@ -192,7 +202,7 @@ public class ThirdCouponOrderHandle {
...
@@ -192,7 +202,7 @@ public class ThirdCouponOrderHandle {
if
(
coupon
.
isCanceled
())
{
if
(
coupon
.
isCanceled
())
{
return
;
return
;
}
}
if
(
ThirdCouponOrderHandle
.
isCancelTimeout
(
coupon
.
getRedeemTime
(),
coupon
.
getEcologyChannelType
()
))
{
if
(
ThirdCouponOrderHandle
.
isCancelTimeout
(
coupon
,
null
))
{
throw
new
RuntimeException
(
"核销时间超过可冲正期限,撤销核销失败"
);
throw
new
RuntimeException
(
"核销时间超过可冲正期限,撤销核销失败"
);
}
}
// 美团、抖音平台三方券
// 美团、抖音平台三方券
...
...
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