Browse Source

输出日志显示配置

develop
bin 3 years ago
parent
commit
d9b4764f8c
3 changed files with 39 additions and 3 deletions
  1. +2
    -2
      src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java
  2. +1
    -1
      src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java
  3. +36
    -0
      src/main/java/com/ssjl/zhaobiao/guizhou/utils/Runner.java

+ 2
- 2
src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java View File

@@ -21,8 +21,8 @@ public class GZResponseHandle {
GZHttpUtil gzHttpUtil;

public Object process(String sourceImei, byte[] res) throws IOException {
System.out.println(res[1]);
System.out.println((byte)0xFF);
//System.out.println(res[1]);
//System.out.println((byte)0xFF);
if(res[1] == (byte)0xFF){
// 常规应答



+ 1
- 1
src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java View File

@@ -38,7 +38,7 @@ public class GZSyncSetting extends QuartzJobBean {
GZAskSetting askSetting = new GZAskSetting();
try {
byte[] res = httpUtil.send(device.getImei(), device.getPhone(), askSetting);
System.out.println(ByteUtil.bytesToHexString(res));
//System.out.println(ByteUtil.bytesToHexString(res));
res = (byte[]) responseHandle.process(device.getImei(), res);
// System.out.println(ByteUtil.bytesToHexString(res));
} catch (IOException e) {


+ 36
- 0
src/main/java/com/ssjl/zhaobiao/guizhou/utils/Runner.java View File

@@ -2,10 +2,13 @@ package com.ssjl.zhaobiao.guizhou.utils;

import com.ssjl.zhaobiao.guizhou.netty.NettyClient;
import com.ssjl.zhaobiao.guizhou.netty.NettyServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class Runner implements CommandLineRunner {

@@ -14,6 +17,27 @@ public class Runner implements CommandLineRunner {
@Autowired
NettyClient nettyClient;

@Value("${guizhou.device.zhizhong}")
String zhizhongDevices;
@Value("${guizhou.device.zhanneng}")
String zhannengDevices;
@Value("${guizhou.device.tianbo}")
String tianboDevice;
@Value("${guizhou.http.zhizhong}")
String zhizhongUrl;
@Value("${guizhou.http.zhanneng}")
String zhannengUrl;
@Value("${guizhou.factory}")
String factory;
@Value("${guizhou.device.testList}")
String testList;

@Value("${guizhou.protocol}")
private String gzProtocol;
@Value("${guizhou.device.model}")
private String gzDeviceModel;
@Value("${guizhou.device.version}")
private String deviceVersion;

@Override
public void run(String... args) throws Exception {
@@ -22,5 +46,17 @@ public class Runner implements CommandLineRunner {
// mqManager.init();
// nettyServer.start();
// nettyClient.start();

log.info("zhizhongDevices=" + zhizhongDevices);
log.info("zhannengDevices=" + zhannengDevices);
log.info("tianboDevice=" + tianboDevice);
log.info("zhizhongUrl=" + zhizhongUrl);
log.info("zhannengUrl=" + zhannengUrl);
log.info("factory=" + factory);
log.info("testList=" + testList);

log.info("gzProtocol=" + gzProtocol);
log.info("gzDeviceModel=" + gzDeviceModel);
log.info("deviceVersion=" + deviceVersion);
}
}

Loading…
Cancel
Save