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
512607ee
Commit
512607ee
authored
Aug 03, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LogUtil重复修改
parent
91455e8d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
81 deletions
+80
-81
call-back-service/src/main/java/cn/freemud/amp/service/OrderCallBackMQService.java
+2
-3
call-back-service/src/main/java/cn/freemud/utils/LogUtil.java
+78
-78
No files found.
call-back-service/src/main/java/cn/freemud/amp/service/OrderCallBackMQService.java
View file @
512607ee
...
...
@@ -23,9 +23,7 @@ import cn.freemud.entities.dto.OrderStatusChangeRequestDto;
import
cn.freemud.entities.dto.UserLoginInfoDto
;
import
cn.freemud.entities.dto.WechatReportOrderDto
;
import
cn.freemud.entities.vo.OrderCallBackRequestVo
;
import
cn.freemud.entities.vo.OrderInfo
;
import
cn.freemud.redis.RedisCache
;
import
cn.freemud.utils.LogUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformWxapp
;
import
com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformWxappManager
;
...
...
@@ -37,6 +35,7 @@ import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoR
import
com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderItemResp
;
import
com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderPayItemReqs
;
import
com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderSettlementResp
;
import
com.freemud.application.sdk.api.ordercenter.util.LogUtil
;
import
com.freemud.sdk.api.assortment.orderdistributor.request.DisRequest
;
import
com.freemud.sdk.api.assortment.orderdistributor.service.OrderDistributionService
;
import
com.google.common.collect.Lists
;
...
...
@@ -375,7 +374,7 @@ public class OrderCallBackMQService {
mqService
.
convertAndSend
(
OrderCallBackConfig
.
TOPIC_EXCHANGE_NAME
,
OrderCallBackConfig
.
ZFB_ORDER_SEND_QUEUE_ROUTING_KEY
,
message
);
}
}
catch
(
Exception
e
){
logUtil
.
error
(
"sendzfbOrderMQ orderCode:{} "
,
e
,
body
.
getOrderCode
());
logUtil
.
error
(
"
"
,
"
sendzfbOrderMQ orderCode:{} "
,
e
,
body
.
getOrderCode
());
}
}
}
call-back-service/src/main/java/cn/freemud/utils/LogUtil.java
View file @
512607ee
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: LogUtil
* @Package cn.freemud.utils
* @Description:
* @author: liming.guo
* @date: 2018/7/3 12:01
* @version V1.0
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
package
cn
.
freemud
.
utils
;
import
cn.freemud.base.ApplicationContextWare
;
import
com.alibaba.fastjson.JSON
;
import
com.freemud.application.sdk.api.log.ApiLog
;
import
com.freemud.application.sdk.api.log.ErrorLog
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.helpers.MessageFormatter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
LogUtil
{
@Value
(
"${print-debug-log:false}"
)
private
boolean
printDebug
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
LogUtil
.
class
);
private
static
volatile
String
appName
=
"NO_APP_NAME"
;
public
void
debug
(
String
message
,
Object
...
params
)
{
if
(
logger
.
isDebugEnabled
())
{
this
.
info
(
message
,
params
);
}
}
public
void
info
(
String
message
,
Object
...
params
)
{
if
(
printDebug
)
{
Object
[]
clone
=
params
!=
null
?
params
.
clone
()
:
new
String
[]{};
String
param1
=
""
,
param2
=
""
,
param3
=
""
;
if
(
params
.
length
>
0
)
{
param1
=
clone
[
0
]
instanceof
String
?
(
String
)
clone
[
0
]
:
JSON
.
toJSONString
(
clone
[
0
]);
}
if
(
params
.
length
>
1
)
{
param2
=
clone
[
1
]
instanceof
String
?
(
String
)
clone
[
1
]
:
JSON
.
toJSONString
(
clone
[
1
]);
}
if
(
params
.
length
>
2
)
{
param3
=
clone
[
2
]
instanceof
String
?
(
String
)
clone
[
2
]
:
JSON
.
toJSONString
(
clone
[
2
]);
}
try
{
ApiLog
.
printLog
(
MessageFormatter
.
arrayFormat
(
message
,
params
).
getMessage
(),
param1
,
param2
,
param3
);
}
catch
(
Exception
e
)
{
ErrorLog
.
errorDev
(
""
,
"LogUtil.printLog "
.
concat
(
message
),
e
,
params
);
}
}
}
public
void
error
(
String
message
,
Exception
e
,
String
...
params
)
{
ErrorLog
.
errorDev
(
""
,
message
,
e
,
params
);
}
private
static
String
getAppName
()
{
if
(
appName
==
null
)
{
appName
=
ApplicationContextWare
.
getAppName
();
if
(
appName
==
null
)
{
appName
=
"NO_APP_NAME"
;
}
}
return
appName
;
}
public
void
errorSe
(
String
message
,
Exception
e
,
String
...
params
)
{
ErrorLog
.
errorSe
(
message
,
e
,
params
);
}
}
/
//
**
//
* All rights Reserved, Designed By www.freemud.cn
//
*
//
* @Title: LogUtil
//
* @Package cn.freemud.utils
//
* @Description:
//
* @author: liming.guo
//
* @date: 2018/7/3 12:01
//
* @version V1.0
//
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
*/
//
package cn.freemud.utils;
//
//
import cn.freemud.base.ApplicationContextWare;
//
import com.alibaba.fastjson.JSON;
//
import com.freemud.application.sdk.api.log.ApiLog;
//
import com.freemud.application.sdk.api.log.ErrorLog;
//
import org.slf4j.Logger;
//
import org.slf4j.LoggerFactory;
//
import org.slf4j.helpers.MessageFormatter;
//
import org.springframework.beans.factory.annotation.Value;
//
import org.springframework.stereotype.Component;
//
//
@Component
//
public class LogUtil {
//
//
@Value("${print-debug-log:false}")
//
private boolean printDebug;
//
//
private static Logger logger = LoggerFactory.getLogger(LogUtil.class);
//
//
private static volatile String appName = "NO_APP_NAME";
//
//
public void debug(String message, Object... params) {
//
if (logger.isDebugEnabled()) {
//
this.info(message, params);
//
}
//
}
//
public void info(String message, Object... params) {
//
if (printDebug) {
//
Object[] clone = params != null ? params.clone() : new String[]{};
//
String param1 = "", param2 = "", param3 = "";
//
if (params.length > 0) {
//
param1 = clone[0] instanceof String ? (String) clone[0] : JSON.toJSONString(clone[0]);
//
}
//
if (params.length > 1) {
//
param2 = clone[1] instanceof String ? (String) clone[1] : JSON.toJSONString(clone[1]);
//
}
//
if (params.length > 2) {
//
param3 = clone[2] instanceof String ? (String) clone[2] : JSON.toJSONString(clone[2]);
//
}
//
try {
//
ApiLog.printLog(MessageFormatter.arrayFormat(message, params).getMessage(), param1, param2, param3);
//
} catch (Exception e) {
//
ErrorLog.errorDev("","LogUtil.printLog ".concat(message), e, params);
//
}
//
}
//
}
//
public void error(String message, Exception e, String... params) {
//
ErrorLog.errorDev("",message, e, params);
//
}
//
//
private static String getAppName() {
//
if (appName == null) {
//
appName = ApplicationContextWare.getAppName();
//
if (appName == null) {
//
appName = "NO_APP_NAME";
//
}
//
}
//
return appName;
//
}
//
//
//
public void errorSe(String message, Exception e, String... 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