Commit 2adadaf6 authored by 赵啸非's avatar 赵啸非

设备列表导出优化

parent 3f4b9d74
......@@ -131,9 +131,11 @@ public class TbRabbitMqConsumerTemplate<T extends TbQueueMsg> extends AbstractTb
log.info("message is empty");
return null;
}
Map<String, Object> map = JSON.parseObject(new String(message.getBody()), HashMap.class);
msg.setKey((String)map.get("key"));
String payloadStr = (String)map.get("data");
log.info("payloadStr:{}",payloadStr);
byte[] payloadDecodeByte = Base64.getDecoder().decode(payloadStr);
msg.setData(payloadDecodeByte);
......
This diff is collapsed.
......@@ -521,6 +521,11 @@ public class DeviceApiController {
deviceStop(req);
break;
}
} catch (AppException e) {
log.error("接收数据失败", e);
rsp.setCode(e.getCode());
rsp.setMsg(e.getMessage());
return JSON.toJSONString(rsp);
} catch (Exception e) {
log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
......@@ -607,7 +612,7 @@ public class DeviceApiController {
deviceEntity.setUpdateUserId(1L);
deviceEntity.setUpdateTime(new Date());
deviceEntity.setSwitchSend(false);
deviceService.save(deviceEntity);
deviceService.update(deviceEntity);
}
......
......@@ -71,7 +71,7 @@ public class DownMsgTask implements Runnable {
header.put(MessageHeader.MESSAGETYPE, item.getMessageType());
header.put(MessageHeader.DEVICECODE, item.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, item.getTimestamp().toString());
deviceService.sendDeviceMessage(deviceEntity, info, header, JSON.toJSONString(item.getData()), null);
deviceService.sendDeviceMessage(deviceEntity, info, header, item.getData(), null);
//下行业务消息保存日志
if (!Constant.MESSAGETYPE_HEARTBEAT.equals(item.getMessageType())) {
......
......@@ -121,18 +121,3 @@ queue:
x-message-ttl: 86400000
x-max-length-bytes: 1048576000
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: 026db82420614469897fcc2dc1b4ce38
# 令牌有效期(一天)
expireTime: 1440
# 令牌前缀
prefix:
# 基础服务平台用户名与密码
baseplatform:
httpUrl: http://192.168.0.98:11071/base/
loginName: admin
password: admin
......@@ -130,6 +130,7 @@ deviceInfo|Object|设备基础信息|-
&emsp;productId|Long|设备产品类型Id|-
&emsp;productName|String|设备产品类型|-
&emsp;enabled|Integer|设备启用状态 (0.停止,1.启用)|-
&emsp;source|Integer|设备来源,默认1(0.旧设备,1.新设备)|-
**响应消息样例:**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment