客户端日志上传、前端增加按钮处理
This commit is contained in:
@@ -214,6 +214,23 @@ public class DeviceService extends BaseServiceImpl {
|
||||
}
|
||||
}
|
||||
|
||||
public void uploadLog(Integer deviceId){
|
||||
try {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(null,headers);
|
||||
ResponseDTO responseDTO = null;
|
||||
responseDTO = restTemplate.postForObject("http://127.0.0.1:8093/uplaod/log/"+deviceId, request, ResponseDTO.class);
|
||||
Integer code = (Integer) responseDTO.get(ResponseDTO.ERR_CODE);
|
||||
if(0 != code){
|
||||
throw new OmsException("上传日志失败,设备离线或者门禁异常!");
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("设备离线或者门禁异常",e);
|
||||
throw new OmsException("上传日志失败,设备离线或者门禁异常!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* find by DeviceName
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user