mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-17 08:18:34 +08:00
打印日志
This commit is contained in:
@@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.StopWatch;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -122,6 +123,8 @@ public class LoginRequestHandler extends AbstractYkcHandler {
|
|||||||
// 阻止重复帧
|
// 阻止重复帧
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
StopWatch stopWatch = new StopWatch("LoginRequestHandler");
|
||||||
|
stopWatch.start("解析数据");
|
||||||
|
|
||||||
// 获取消息体
|
// 获取消息体
|
||||||
byte[] msgBody = ykcDataProtocol.getMsgBody();
|
byte[] msgBody = ykcDataProtocol.getMsgBody();
|
||||||
@@ -190,10 +193,10 @@ public class LoginRequestHandler extends AbstractYkcHandler {
|
|||||||
.iccid(iccid)
|
.iccid(iccid)
|
||||||
.business(business)
|
.business(business)
|
||||||
.build();
|
.build();
|
||||||
|
stopWatch.stop();
|
||||||
// 结果(默认 0x01:登录失败)
|
// 结果(默认 0x01:登录失败)
|
||||||
byte[] flag = Constants.oneByteArray;
|
byte[] flag = Constants.oneByteArray;
|
||||||
|
stopWatch.start("登录逻辑");
|
||||||
// 通过桩编码SN查询数据库,如果有数据,则登录成功,否则登录失败
|
// 通过桩编码SN查询数据库,如果有数据,则登录成功,否则登录失败
|
||||||
PileBasicInfo pileBasicInfo = null;
|
PileBasicInfo pileBasicInfo = null;
|
||||||
try {
|
try {
|
||||||
@@ -276,7 +279,8 @@ public class LoginRequestHandler extends AbstractYkcHandler {
|
|||||||
log.error("保存报文失败pileSn:{}", pileSn, e);
|
log.error("保存报文失败pileSn:{}", pileSn, e);
|
||||||
}
|
}
|
||||||
}, executor);
|
}, executor);
|
||||||
|
stopWatch.stop();
|
||||||
|
log.info("0x01登录耗时:{}, 详细信息:{}", stopWatch.getTotalTimeMillis(), stopWatch.prettyPrint());
|
||||||
// 消息体
|
// 消息体
|
||||||
byte[] messageBody = Bytes.concat(pileSnByte, flag);
|
byte[] messageBody = Bytes.concat(pileSnByte, flag);
|
||||||
return getResult(ykcDataProtocol, messageBody);
|
return getResult(ykcDataProtocol, messageBody);
|
||||||
|
|||||||
Reference in New Issue
Block a user