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

设备列表导出优化

parent 3f4b9d74
...@@ -131,9 +131,11 @@ public class TbRabbitMqConsumerTemplate<T extends TbQueueMsg> extends AbstractTb ...@@ -131,9 +131,11 @@ public class TbRabbitMqConsumerTemplate<T extends TbQueueMsg> extends AbstractTb
log.info("message is empty"); log.info("message is empty");
return null; return null;
} }
Map<String, Object> map = JSON.parseObject(new String(message.getBody()), HashMap.class); Map<String, Object> map = JSON.parseObject(new String(message.getBody()), HashMap.class);
msg.setKey((String)map.get("key")); msg.setKey((String)map.get("key"));
String payloadStr = (String)map.get("data"); String payloadStr = (String)map.get("data");
log.info("payloadStr:{}",payloadStr);
byte[] payloadDecodeByte = Base64.getDecoder().decode(payloadStr); byte[] payloadDecodeByte = Base64.getDecoder().decode(payloadStr);
msg.setData(payloadDecodeByte); msg.setData(payloadDecodeByte);
......
This diff is collapsed.
...@@ -521,6 +521,11 @@ public class DeviceApiController { ...@@ -521,6 +521,11 @@ public class DeviceApiController {
deviceStop(req); deviceStop(req);
break; break;
} }
} catch (AppException e) {
log.error("接收数据失败", e);
rsp.setCode(e.getCode());
rsp.setMsg(e.getMessage());
return JSON.toJSONString(rsp);
} catch (Exception e) { } catch (Exception e) {
log.error("接收数据失败", e); log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue()); rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
...@@ -607,7 +612,7 @@ public class DeviceApiController { ...@@ -607,7 +612,7 @@ public class DeviceApiController {
deviceEntity.setUpdateUserId(1L); deviceEntity.setUpdateUserId(1L);
deviceEntity.setUpdateTime(new Date()); deviceEntity.setUpdateTime(new Date());
deviceEntity.setSwitchSend(false); deviceEntity.setSwitchSend(false);
deviceService.save(deviceEntity); deviceService.update(deviceEntity);
} }
......
...@@ -71,7 +71,7 @@ public class DownMsgTask implements Runnable { ...@@ -71,7 +71,7 @@ public class DownMsgTask implements Runnable {
header.put(MessageHeader.MESSAGETYPE, item.getMessageType()); header.put(MessageHeader.MESSAGETYPE, item.getMessageType());
header.put(MessageHeader.DEVICECODE, item.getDeviceCode()); header.put(MessageHeader.DEVICECODE, item.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, item.getTimestamp().toString()); 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())) { if (!Constant.MESSAGETYPE_HEARTBEAT.equals(item.getMessageType())) {
......
...@@ -27,7 +27,7 @@ spring: ...@@ -27,7 +27,7 @@ spring:
port: @profiles.redis.port@ port: @profiles.redis.port@
username: @profiles.redis.username@ username: @profiles.redis.username@
password: @profiles.redis.password@ password: @profiles.redis.password@
database: @profiles.redis.database@ database: @profiles.redis.database@
timeout: 30000 timeout: 30000
pool: pool:
max-idle: 30 max-idle: 30
...@@ -121,18 +121,3 @@ queue: ...@@ -121,18 +121,3 @@ queue:
x-message-ttl: 86400000 x-message-ttl: 86400000
x-max-length-bytes: 1048576000 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|设备基础信息|- ...@@ -130,6 +130,7 @@ deviceInfo|Object|设备基础信息|-
&emsp;productId|Long|设备产品类型Id|- &emsp;productId|Long|设备产品类型Id|-
&emsp;productName|String|设备产品类型|- &emsp;productName|String|设备产品类型|-
&emsp;enabled|Integer|设备启用状态 (0.停止,1.启用)|- &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