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
5f07845b
Commit
5f07845b
authored
Jun 23, 2021
by
王世昌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加挡板用于测试模拟核销券失败
parent
d2b79caf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
order-application-service/src/main/java/cn/freemud/service/coupon/impl/PlatformCouponRelationServiceImpl.java
+15
-10
No files found.
order-application-service/src/main/java/cn/freemud/service/coupon/impl/PlatformCouponRelationServiceImpl.java
View file @
5f07845b
...
@@ -111,28 +111,33 @@ public class PlatformCouponRelationServiceImpl implements CouponRelationService
...
@@ -111,28 +111,33 @@ public class PlatformCouponRelationServiceImpl implements CouponRelationService
couponCodeVerificationDto
.
setOrderDiscountAmount
(
orderBean
.
getOriginalAmount
().
longValue
()
-
orderBean
.
getAmount
());
couponCodeVerificationDto
.
setOrderDiscountAmount
(
orderBean
.
getOriginalAmount
().
longValue
()
-
orderBean
.
getAmount
());
// 核销券新增参数:组织机构ID
// 核销券新增参数:组织机构ID
couponCodeVerificationDto
.
setChannel_codes
(
storeService
.
getOrgIdsArr
(
orderBean
.
getCompanyId
(),
orderBean
.
getShopId
()));
couponCodeVerificationDto
.
setChannel_codes
(
storeService
.
getOrgIdsArr
(
orderBean
.
getCompanyId
(),
orderBean
.
getShopId
()));
boolean
ok
=
false
;
Exception
lastException
=
null
;
CouponCodeResponseDto
couponCodeResponseDto
=
null
;
try
{
try
{
//71.券核销
//71.券核销
// todo 这循环有啥用-.-
for
(
int
i
=
2
;
i
>=
0
;
i
--)
{
for
(
int
i
=
2
;
i
>=
0
;
i
--)
{
LogUtil
.
info
(
"核销券码开始=="
,
JSON
.
toJSONString
(
couponCodeVerificationDto
),
null
);
LogUtil
.
info
(
"核销券码开始=="
,
JSON
.
toJSONString
(
couponCodeVerificationDto
),
null
);
CouponCodeResponseDto
couponCodeResponseDto
=
couponOfflineClient
.
verification
(
couponCodeVerificationDto
);
couponCodeResponseDto
=
couponOfflineClient
.
verification
(
couponCodeVerificationDto
);
LogUtil
.
info
(
"核销券码返回=="
,
JSON
.
toJSONString
(
couponCodeVerificationDto
),
null
);
LogUtil
.
info
(
"核销券码返回=="
,
JSON
.
toJSONString
(
couponCodeVerificationDto
),
null
);
ThirdPartyLog
.
infoConvertJson
(
System
.
currentTimeMillis
(),
System
.
currentTimeMillis
(),
"/api"
,
couponCodeVerificationDto
,
couponCodeResponseDto
);
ThirdPartyLog
.
infoConvertJson
(
System
.
currentTimeMillis
(),
System
.
currentTimeMillis
(),
"/api"
,
couponCodeVerificationDto
,
couponCodeResponseDto
);
if
(
Objects
.
equals
(
couponCodeResponseDto
.
getStatusCode
(),
ResponseResult
.
SUCCESS
.
getCode
())
&&
!
Objects
.
equals
(
baffleOpen
,
true
))
{
if
(
Objects
.
nonNull
(
couponCodeResponseDto
)
&&
Objects
.
equals
(
couponCodeResponseDto
.
getStatusCode
(),
ResponseResult
.
SUCCESS
.
getCode
()))
{
ok
=
true
;
LogUtil
.
info
(
"CouponReverseServiceImpl"
,
JSON
.
toJSONString
(
couponCodeVerificationDto
),
JSON
.
toJSONString
(
couponCodeResponseDto
));
LogUtil
.
info
(
"CouponReverseServiceImpl"
,
JSON
.
toJSONString
(
couponCodeVerificationDto
),
JSON
.
toJSONString
(
couponCodeResponseDto
));
break
;
}
if
(!
Objects
.
equals
(
couponCodeResponseDto
.
getStatusCode
(),
ResponseResult
.
SUCCESS
.
getCode
())
||
Objects
.
equals
(
baffleOpen
,
true
))
{
sendMessage
(
orderBean
,
LogThreadLocal
.
getTrackingNo
(),
couponCodeVerificationDto
,
Objects
.
equals
(
baffleOpen
,
true
)
?
"模拟券核销失败"
:
couponCodeResponseDto
);
emailAlertService
.
sendEmailAlert
(
"核销券码失败"
,
String
.
format
(
"request:%s \r\nresponse:%s"
,
JSONObject
.
toJSONString
(
couponCodeVerificationDto
),
JSONObject
.
toJSONString
(
couponCodeResponseDto
)));
return
ResponseUtil
.
error
(
ResponseResult
.
COUPON_VERIFICATION_FAIL
);
}
}
break
;
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
sendMessage
(
orderBean
,
LogThreadLocal
.
getTrackingNo
(),
couponCodeVerificationDto
,
ex
);
lastException
=
ex
;
emailAlertService
.
sendEmailAlert
(
"核销券码异常"
,
String
.
format
(
"request:%s \r\nexception:%s"
,
JSONObject
.
toJSONString
(
couponCodeVerificationDto
),
Throwables
.
getStackTraceAsString
(
ex
)));
ErrorLog
.
printErrorLog
(
"verification_error"
,
"/api"
,
couponCodeVerificationDto
,
ex
);
ErrorLog
.
printErrorLog
(
"verification_error"
,
"/api"
,
couponCodeVerificationDto
,
ex
);
}
if
(!
ok
||
Objects
.
equals
(
baffleOpen
,
true
)){
sendMessage
(
orderBean
,
LogThreadLocal
.
getTrackingNo
(),
couponCodeVerificationDto
,
Objects
.
equals
(
baffleOpen
,
true
)
?
"模拟券核销失败"
:
couponCodeResponseDto
);
}
if
(!
ok
){
emailAlertService
.
sendEmailAlert
(
"核销券码失败"
,
String
.
format
(
"request:%s \r\nresponse:%s"
,
JSONObject
.
toJSONString
(
couponCodeVerificationDto
),
JSONObject
.
toJSONString
(
lastException
==
null
?
couponCodeResponseDto
:
lastException
)));
return
ResponseUtil
.
error
(
ResponseResult
.
COUPON_VERIFICATION_FAIL
);
return
ResponseUtil
.
error
(
ResponseResult
.
COUPON_VERIFICATION_FAIL
);
}
}
}
}
...
...
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