Commit be9eca1d authored by 赵啸非's avatar 赵啸非

设备列表导出优化

parent 2adadaf6
...@@ -156,6 +156,7 @@ public class DeviceApiController { ...@@ -156,6 +156,7 @@ public class DeviceApiController {
deviceInfo.setProductId(productEntity.getId()); deviceInfo.setProductId(productEntity.getId());
deviceInfo.setProductName(productEntity.getProductName()); deviceInfo.setProductName(productEntity.getProductName());
deviceInfo.setEnabled(deviceEntity.getEnabled()); deviceInfo.setEnabled(deviceEntity.getEnabled());
deviceInfo.setSource(deviceEntity.getSource());
registerResp.setDeviceInfo(deviceInfo); registerResp.setDeviceInfo(deviceInfo);
String content = EncryptUtil.myEnscrt(JSON.toJSONString(registerResp), 9, DES_STR, ENCRYPT_STR); String content = EncryptUtil.myEnscrt(JSON.toJSONString(registerResp), 9, DES_STR, ENCRYPT_STR);
...@@ -326,8 +327,10 @@ public class DeviceApiController { ...@@ -326,8 +327,10 @@ public class DeviceApiController {
deviceService.update(deviceEntity, null); deviceService.update(deviceEntity, null);
} }
//deviceService.sendThirdParty(deviceEntity, productEntity, platformEntity, DeviceMethodEnum.ACTIVE); if (deviceEntity.getDeviceStatus() == DeviceStatusEnum.未激活.getValue()) {
//deviceService.sendThirdParty(deviceEntity, productEntity, platformEntity, DeviceMethodEnum.ONLINE); throw new AppException(DEVICE_UNACTIVE, DEVICE_UNACTIVE_CONTENT);
}
DeviceQueueAuthInfo authInfo = new DeviceQueueAuthInfo(); DeviceQueueAuthInfo authInfo = new DeviceQueueAuthInfo();
authInfo.setHost(host); authInfo.setHost(host);
authInfo.setPort(port); authInfo.setPort(port);
...@@ -356,14 +359,9 @@ public class DeviceApiController { ...@@ -356,14 +359,9 @@ public class DeviceApiController {
deviceInfo.setProductName(productEntity.getProductName()); deviceInfo.setProductName(productEntity.getProductName());
deviceInfo.setEnabled(deviceEntity.getEnabled()); deviceInfo.setEnabled(deviceEntity.getEnabled());
deviceInfo.setSource(deviceEntity.getSource()); deviceInfo.setSource(deviceEntity.getSource());
registerResp.setDeviceInfo(deviceInfo); registerResp.setDeviceInfo(deviceInfo);
String content = EncryptUtil.myEnscrt(JSON.toJSONString(registerResp), 9, DES_STR, ENCRYPT_STR); String content = EncryptUtil.myEnscrt(JSON.toJSONString(registerResp), 9, DES_STR, ENCRYPT_STR);
log.info("deEncrypt:{}", EncryptUtil.myReEnscrt(content, 9, DES_STR, ENCRYPT_STR));
deviceResp.setContent(content); deviceResp.setContent(content);
rsp.setData(deviceResp); rsp.setData(deviceResp);
} catch (AppException e) { } catch (AppException e) {
log.error("接收数据失败", e); log.error("接收数据失败", e);
......
...@@ -89,7 +89,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi ...@@ -89,7 +89,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
this.consumersExecutor = Executors.newCachedThreadPool(IotThreadFactory.forName("消费queue线程")); this.consumersExecutor = Executors.newCachedThreadPool(IotThreadFactory.forName("消费queue线程"));
consumersExecutor.submit(() -> { consumersExecutor.submit(() -> {
int waitTime = 1000; int waitTime = 10;
while (!stopped) { while (!stopped) {
try { try {
List<TbQueueMsg> messageList = new ArrayList(32); List<TbQueueMsg> messageList = new ArrayList(32);
......
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