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
bef298c7
Commit
bef298c7
authored
Aug 03, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志修改
parent
c45aeed3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
60 deletions
+64
-60
order-application-service/src/main/java/cn/freemud/annotations/LogIgnore.java
+45
-45
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreAspect.java
+0
-0
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreFeignAspect.java
+0
-1
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
+6
-6
order-application-service/src/main/java/cn/freemud/service/impl/MallOrderServiceImpl.java
+1
-1
order-application-service/src/main/java/cn/freemud/utils/AppLogUtil.java
+5
-4
order-application-service/src/test/java/cn.freemud/service/CouponActivityServiceTest.java
+3
-3
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/util/LogUtil.java
+4
-0
No files found.
order-application-service/src/main/java/cn/freemud/annotations/LogIgnore.java
View file @
bef298c7
package
cn
.
freemud
.
annotations
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
/**
* @author wanghanghang
*/
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
LogIgnore
{
/**
* 是否打印日志,true打印,false不打印,注意设置成false状态码和状态码信息都不会打印
*
* @return
*/
boolean
printLog
()
default
true
;
/**
* printLog 设置成true的时候,可以排除哪些状态码的响应不用打印响应报文,只会打印状态码
* 默认成功100
* @return
*/
String
[]
excludeSuccessCodes
()
default
"100"
;
/**
* statusCodeFieldName 默认返回状态码字段为code
*
* @return
*/
String
codeFieldName
()
default
"code"
;
/**
* statusCodeFieldName 默认返回状态码字段为message
*
* @return
*/
String
messageFieldName
()
default
"message"
;
/**
* logMessage 日志打印
* @return
*/
String
logMessage
()
default
""
;
}
//
package cn.freemud.annotations;
//
//
import java.lang.annotation.Retention;
//
import java.lang.annotation.RetentionPolicy;
//
/
//
**
//
* @author wanghanghang
//
*/
//
//
@Retention(RetentionPolicy.RUNTIME)
//
public @interface LogIgnore {
//
/**
//
* 是否打印日志,true打印,false不打印,注意设置成false状态码和状态码信息都不会打印
//
*
//
* @return
//
*/
//
boolean printLog() default true;
//
//
/**
//
* printLog 设置成true的时候,可以排除哪些状态码的响应不用打印响应报文,只会打印状态码
//
* 默认成功100
//
* @return
//
*/
//
String[] excludeSuccessCodes() default "100";
//
//
/**
//
* statusCodeFieldName 默认返回状态码字段为code
//
*
//
* @return
//
*/
//
String codeFieldName() default "code";
//
//
/**
//
* statusCodeFieldName 默认返回状态码字段为message
//
*
//
* @return
//
*/
//
String messageFieldName() default "message";
//
//
/**
//
* logMessage 日志打印
//
* @return
//
*/
//
String logMessage() default "";
//
}
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreAspect.java
View file @
bef298c7
This diff is collapsed.
Click to expand it.
order-application-service/src/main/java/cn/freemud/aop/LogIgnoreFeignAspect.java
View file @
bef298c7
package
cn
.
freemud
.
aop
;
import
cn.freemud.annotations.LogIgnore
;
import
cn.freemud.annotations.LogIgnoreFeign
;
import
cn.freemud.entities.vo.ThirdPartLogVo
;
import
cn.freemud.utils.AppLogUtil
;
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
View file @
bef298c7
...
...
@@ -507,16 +507,16 @@ public class CheckMCCafeOrder {
McdNetBatchQueryResponse
mcdNetBatchQueryResponse
=
couponClientService
.
batchQuery
(
mcCafeCouponRequest
);
if
(
mcdNetBatchQueryResponse
==
null
||
!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getStatusCode
())
||
CollectionUtils
.
isEmpty
(
mcdNetBatchQueryResponse
.
getCouponlist
()))
{
AppLogUtil
.
error
Log
(
"部分优惠券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
"部分优惠券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"部分优惠券当前不可用"
);
}
else
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getCouponlist
().
get
(
0
).
getStatusCode
()))
{
mcdNetBatchQueryResponse
.
getCouponlist
().
forEach
(
o
->
{
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
o
.
getStatusCode
()))
{
if
(
o
.
getCodeInfo
()
!=
null
)
{
AppLogUtil
.
error
Log
(
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
);
}
else
{
AppLogUtil
.
error
Log
(
"部分优惠券暂时不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
"部分优惠券暂时不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"部分优惠券暂时不可用"
);
}
}
...
...
@@ -604,16 +604,16 @@ public class CheckMCCafeOrder {
McdNetBatchQueryResponse
mcdNetBatchQueryResponse
=
couponClientService
.
batchQuery
(
mcCafeCouponRequest
);
if
(
mcdNetBatchQueryResponse
==
null
||
!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getStatusCode
())
||
CollectionUtils
.
isEmpty
(
mcdNetBatchQueryResponse
.
getCouponlist
()))
{
AppLogUtil
.
error
Log
(
"部分优惠券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
"部分优惠券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"部分优惠券当前不可用"
);
}
else
{
mcdNetBatchQueryResponse
.
getCouponlist
().
forEach
(
o
->
{
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
o
.
getStatusCode
()))
{
if
(
o
.
getCodeInfo
()
!=
null
)
{
AppLogUtil
.
error
Log
(
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
);
}
else
{
AppLogUtil
.
error
Log
(
"部分优惠券暂时不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
"部分优惠券暂时不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"部分优惠券暂时不可用"
);
}
}
...
...
order-application-service/src/main/java/cn/freemud/service/impl/MallOrderServiceImpl.java
View file @
bef298c7
...
...
@@ -564,7 +564,7 @@ public class MallOrderServiceImpl implements MallOrderService {
try
{
com
.
freemud
.
application
.
sdk
.
api
.
ordercenter
.
response
.
BaseResponse
baseResponse
=
orderSdkService
.
acceptOrder
(
acceptOrderReq
,
LogThreadLocal
.
getTrackingNo
());
if
(
baseResponse
==
null
||
!
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
baseResponse
.
getCode
()))
{
AppLogUtil
.
error
Log
(
"paySuccessCallback_acceptOrder_faild"
,
gson
.
toJson
(
confirmOrderDto
),
gson
.
toJson
(
payAccessResponse
));
AppLogUtil
.
info
Log
(
"paySuccessCallback_acceptOrder_faild"
,
gson
.
toJson
(
confirmOrderDto
),
gson
.
toJson
(
payAccessResponse
));
}
}
catch
(
Exception
e
){
AppLogUtil
.
errorLog
(
"paySuccessCallback_acceptOrder_error"
,
orderId
,
e
);
...
...
order-application-service/src/main/java/cn/freemud/utils/AppLogUtil.java
View file @
bef298c7
...
...
@@ -69,12 +69,13 @@ public class AppLogUtil implements BeanFactoryAware {
public
void
info
(
String
message
,
Object
...
params
)
{
logUtil
.
info
(
message
,
params
);
}
public
void
error
(
String
message
,
Exception
e
,
String
...
params
)
{
logUtil
.
error
(
message
,
e
,
params
);
}
public
void
error
(
String
message
,
Object
...
params
)
{
ErrorLog
.
errorDev
(
message
,
params
);
logUtil
.
errorDev
(
""
,
message
,
e
,
params
);
}
// public void error(String message, Object... params) {
// ErrorLog.errorDev(message, params);
// }
public
void
errorSe
(
String
message
,
Exception
e
,
String
...
params
)
{
...
...
order-application-service/src/test/java/cn.freemud/service/CouponActivityServiceTest.java
View file @
bef298c7
...
...
@@ -221,16 +221,16 @@ public class CouponActivityServiceTest {
System
.
out
.
println
(
JSON
.
toJSONString
(
mcdNetBatchQueryResponse
));
if
(
mcdNetBatchQueryResponse
==
null
||
!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
mcdNetBatchQueryResponse
.
getStatusCode
())
||
CollectionUtils
.
isEmpty
(
mcdNetBatchQueryResponse
.
getCouponlist
()))
{
AppLogUtil
.
error
Log
(
"部分优惠券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
"部分优惠券当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"部分优惠券当前不可用"
);
}
else
{
mcdNetBatchQueryResponse
.
getCouponlist
().
forEach
(
o
->
{
if
(!
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
o
.
getStatusCode
()))
{
if
(
o
.
getCodeInfo
()
!=
null
)
{
AppLogUtil
.
error
Log
(
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
o
.
getCodeInfo
().
getAct_name
()+
"当前不可用"
);
}
else
{
AppLogUtil
.
error
Log
(
"部分优惠券暂时不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
AppLogUtil
.
info
Log
(
"部分优惠券暂时不可用"
,
mcCafeCouponRequest
,
mcdNetBatchQueryResponse
);
throw
new
ServiceException
(
ResponseResult
.
COUPON_SHOP_NOTSUPPORT
,
"部分优惠券暂时不可用"
);
}
}
...
...
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/util/LogUtil.java
View file @
bef298c7
...
...
@@ -62,6 +62,10 @@ public class LogUtil {
ErrorLog
.
errorDev
(
message
,
e
,
params
);
}
public
void
errorDev
(
String
statusCode
,
String
message
,
Exception
e
,
Object
...
params
)
{
ErrorLog
.
errorDev
(
statusCode
,
message
,
e
,
params
);
}
public
void
errorSe
(
String
message
,
Exception
e
,
Object
...
params
)
{
ErrorLog
.
errorSe
(
message
,
e
,
params
);
}
...
...
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