|
@@ -18,6 +18,8 @@ import com.jpsoft.smart.modules.lapi.dto.ServerAddrDTO;
|
|
import com.jpsoft.smart.modules.lapi.request.LapiRequest;
|
|
import com.jpsoft.smart.modules.lapi.request.LapiRequest;
|
|
import com.jpsoft.smart.modules.lapi.service.ILapiService;
|
|
import com.jpsoft.smart.modules.lapi.service.ILapiService;
|
|
import com.jpsoft.smart.modules.lapi.vo.*;
|
|
import com.jpsoft.smart.modules.lapi.vo.*;
|
|
|
|
+import com.jpsoft.smart.modules.sys.entity.SysLog;
|
|
|
|
+import com.jpsoft.smart.modules.sys.service.SysLogService;
|
|
import io.netty.handler.codec.http.HttpMethod;
|
|
import io.netty.handler.codec.http.HttpMethod;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -49,6 +51,9 @@ public class LapiServiceImpl implements ILapiService {
|
|
@Autowired
|
|
@Autowired
|
|
private LapiRequest lapiRequest;
|
|
private LapiRequest lapiRequest;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysLogService sysLogService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public DeviceInfo findByIpAddressAndPort(String ipAddress, String port) throws Exception {
|
|
public DeviceInfo findByIpAddressAndPort(String ipAddress, String port) throws Exception {
|
|
JSONObject jsonObject = LApiUtil.getRequest(ipAddress + ":" + port + LApiConstant.DEVICEBASICINFO);
|
|
JSONObject jsonObject = LApiUtil.getRequest(ipAddress + ":" + port + LApiConstant.DEVICEBASICINFO);
|
|
@@ -1035,6 +1040,13 @@ public class LapiServiceImpl implements ILapiService {
|
|
// deviceInfo.setDeviceNo(newDeviceNo);
|
|
// deviceInfo.setDeviceNo(newDeviceNo);
|
|
deviceInfo.setUpdateTime(new Date());
|
|
deviceInfo.setUpdateTime(new Date());
|
|
deviceInfoService.update(deviceInfo);
|
|
deviceInfoService.update(deviceInfo);
|
|
|
|
+
|
|
|
|
+ SysLog sysLog = new SysLog();
|
|
|
|
+ sysLog.setCreateTime(new Date());
|
|
|
|
+ sysLog.setData("ip:"+newAddress+",port:"+newPort);
|
|
|
|
+ sysLog.setPointcut(deviceNo);
|
|
|
|
+ sysLog.setRemark("修改设备ip和端口");
|
|
|
|
+ sysLogService.insert(sysLog);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|