From 619eb055cdc7ce2b2a5d4d64005cdc42582e42ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Tue, 7 Apr 2026 18:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=81=94=E8=AE=BE=E5=A4=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E6=89=B9?= =?UTF-8?q?=E6=AC=A1=E6=B8=85=E5=8D=95=E3=80=81=E8=AE=BE=E5=A4=87=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nu/dto/DevicePreviewMqDto.java | 30 ++ .../java/com/nu/dto/IotSyncPreviewMQDto.java | 9 + .../controller/DeviceConfigController.java | 1 + .../device/config/entity/DeviceConfig.java | 1 + .../config/mapper/xml/DeviceConfigMapper.xml | 1 + .../controller/DeviceManagerController.java | 129 +++---- .../device/manager/entity/DeviceBatch.java | 29 ++ .../device/manager/entity/DeviceBindLog.java | 1 + .../manager/entity/DeviceIntegration.java | 5 +- .../device/manager/entity/DevicePreview.java | 24 +- .../manager/mapper/DeviceManagerMapper.java | 28 +- .../mapper/xml/DeviceManagerMapper.xml | 335 ++++++++++++++---- .../service/IDeviceManagerService.java | 27 +- .../impl/DeviceManagerServiceImpl.java | 245 +++++++++++-- .../nu/modules/syncLog/entity/SyncBizLog.java | 1 + .../syncLog/mapper/xml/SyncBizLogMapper.xml | 20 +- .../device/listener/IotDeviceMQListener.java | 99 +++++- 17 files changed, 783 insertions(+), 202 deletions(-) create mode 100644 nursing-unit-common/src/main/java/com/nu/dto/DevicePreviewMqDto.java create mode 100644 nursing-unit-common/src/main/java/com/nu/dto/IotSyncPreviewMQDto.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/entity/DeviceBatch.java diff --git a/nursing-unit-common/src/main/java/com/nu/dto/DevicePreviewMqDto.java b/nursing-unit-common/src/main/java/com/nu/dto/DevicePreviewMqDto.java new file mode 100644 index 0000000..a2d31da --- /dev/null +++ b/nursing-unit-common/src/main/java/com/nu/dto/DevicePreviewMqDto.java @@ -0,0 +1,30 @@ +package com.nu.dto; + +import lombok.Data; +import java.util.Date; + +@Data +public class DevicePreviewMqDto { + private Integer id; + private String orgCode; + private String departName; + private String nuId; + private String nuName; + private String dimension; + private String sn; + private String deviceType; + private String deviceModel; + private String factory; + private String deviceStatus; + private Date createTime;//更新时间 + private String createBy;//创建人 + private Date updateTime;//更新时间 + private String updateBy;//更新人 + private String izSync;//是否同步 + private Date syncTime;//同步时间 + private String syncBy;//同步人 + private Integer purchaseQuantity; + private String logId;//日志ID + private String remarks;//备注 + private Integer ywId;//运维ID +} diff --git a/nursing-unit-common/src/main/java/com/nu/dto/IotSyncPreviewMQDto.java b/nursing-unit-common/src/main/java/com/nu/dto/IotSyncPreviewMQDto.java new file mode 100644 index 0000000..324c53e --- /dev/null +++ b/nursing-unit-common/src/main/java/com/nu/dto/IotSyncPreviewMQDto.java @@ -0,0 +1,9 @@ +package com.nu.dto; + +import lombok.Data; +import java.util.List; + +@Data +public class IotSyncPreviewMQDto { + private List previewList; +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/controller/DeviceConfigController.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/controller/DeviceConfigController.java index bf36909..bf5f457 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/controller/DeviceConfigController.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/controller/DeviceConfigController.java @@ -65,6 +65,7 @@ public class DeviceConfigController extends JeecgController add(@RequestBody DeviceConfig DeviceConfig) { QueryWrapper emQw = new QueryWrapper<>(); + emQw.eq("device_name",DeviceConfig.getDeviceName()); emQw.eq("device_type",DeviceConfig.getDeviceType()); emQw.eq("device_model",DeviceConfig.getDeviceModel()); emQw.eq("factory",DeviceConfig.getFactory()); diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/entity/DeviceConfig.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/entity/DeviceConfig.java index 91684ad..a50dd65 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/entity/DeviceConfig.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/entity/DeviceConfig.java @@ -19,6 +19,7 @@ public class DeviceConfig implements Serializable { @TableId(type = IdType.AUTO) @ApiModelProperty(value = "ID") private Integer id; + private String deviceName; @Dict(dicCode = "tplink_device_type") private String deviceType; private String deviceModel; diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/mapper/xml/DeviceConfigMapper.xml b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/mapper/xml/DeviceConfigMapper.xml index 5ed8317..f8c07d6 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/mapper/xml/DeviceConfigMapper.xml +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/config/mapper/xml/DeviceConfigMapper.xml @@ -5,6 +5,7 @@ + + + + + insert into nu_iot_device_preview_batch( + batch_no, + org_code, + iz_push, + create_time, + create_by, + remarks + ) + values( + #{batchNo}, + #{orgCode}, + 'N', + now(), + #{createBy}, + #{remarks} + ) + + + + update nu_iot_device_preview_batch + set iz_push = #{izPush}, + remarks = #{remarks}, + update_by = #{updateBy}, + update_time = now() + where id = #{id} + + + + delete from nu_iot_device_preview_batch where id = #{id} + + + + delete from nu_iot_device_preview_plan where batch_no = #{batchNo} + + - select a.org_code, b.depart_name, + a.batch_no, + a.device_name, a.device_type, a.device_model, a.factory, a.dimension, - sum(purchase_quantity) as purchaseQuantity - from nu_iot_device_preview a + sum(a.purchase_quantity) as purchaseQuantity + from nu_iot_device_preview_plan a inner join sys_depart b on a.org_code = b.org_code - where a.org_code = #{params.orgCode} + where a.org_code = #{params.orgCode} and a.batch_no = #{params.batchNo} AND a.dimension = #{params.dimension} AND a.device_type = #{params.deviceType} - group by a.org_code,b.depart_name,a.device_type,a.device_model,a.factory,a.dimension + group by a.org_code,b.depart_name,a.device_name,a.device_type,a.device_model,a.factory,a.dimension order by a.device_type asc - + select + a.id, a.org_code, b.depart_name, a.nu_id, c.nu_name, + a.batch_no, + a.device_name, a.device_type, a.device_model, a.factory, a.dimension, - purchase_quantity - from nu_iot_device_preview a + a.purchase_quantity + from nu_iot_device_preview_plan a inner join sys_depart b on a.org_code = b.org_code left join nu_base_info c on a.nu_id = c.nu_id - where a.org_code = #{params.orgCode} + where a.org_code = #{params.orgCode} and a.batch_no = #{params.batchNo} AND c.nu_name LIKE concat('%',#{params.nuName},'%') @@ -76,20 +138,26 @@ AND a.device_type = #{params.deviceType} - order by a.nu_id,a.device_type,a.id asc + order by a.nu_id,a.device_type asc - select id, + batch_no, org_code, nu_id, + dimension, + device_name, device_type, device_model, factory, - dimension, - purchase_quantity - from nu_iot_device_preview - org_code = #{orgCode} + purchase_quantity, + create_time, + create_by, + update_time, + update_by + from nu_iot_device_preview_plan + org_code = #{orgCode} and batch_no = #{batchNo} AND dimension = #{dimension} @@ -109,51 +177,139 @@ AND nu_id = #{nuId} + + + - - insert into nu_iot_device_preview( + + insert into nu_iot_device_preview_plan( org_code, nu_id, + batch_no, + device_name, device_type, device_model, factory, dimension, + create_time, + create_by, purchase_quantity ) values( - #{orgCode}, - #{nuId}, - #{deviceType}, - #{deviceModel}, - #{factory}, - #{dimension}, - #{purchaseQuantity} + #{orgCode}, + #{nuId}, + #{batchNo}, + #{deviceName}, + #{deviceType}, + #{deviceModel}, + #{factory}, + #{dimension}, + now(), + #{createBy}, + #{purchaseQuantity} ) - - update nu_iot_device_preview - set purchase_quantity = #{purchaseQuantity} + + update nu_iot_device_preview_plan + set nu_id = #{nuId}, + purchase_quantity = #{purchaseQuantity}, + update_time = now() where id = #{id} - + + delete from nu_iot_device_preview_plan where id = #{id} + + + + update nu_iot_device_preview + set iz_sync = 'Y', + sync_time = now() + where id = #{id} + + + delete from nu_iot_device_preview where id = #{id} + + update nu_iot_device_preview + set sn = #{sn} + where id = #{id} + + + + update nu_iot_device_preview + set nu_id = #{nuId}, + device_status = #{deviceStatus}, + update_time = now() + where id = #{id} + + @@ -161,14 +317,16 @@ @@ -176,42 +334,51 @@ @@ -233,4 +400,32 @@ order by org_code asc ,factory asc ,device_type asc ,device_model asc ,sn asc,opt_date desc + + insert into nu_iot_device_bind_log( + org_code, + nu_id, + nu_name, + dimension, + device_type, + device_model, + sn, + factory, + opt_date, + opt_type, + remarks + )values( + #{orgCode}, + #{nuId}, + #{nuName}, + #{dimension}, + #{deviceType}, + #{deviceModel}, + #{sn}, + #{factory}, + now(), + #{optType}, + #{remarks} + ) + + diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/IDeviceManagerService.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/IDeviceManagerService.java index 8fabf46..d3b3790 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/IDeviceManagerService.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/IDeviceManagerService.java @@ -3,10 +3,7 @@ package com.nu.modules.device.manager.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; -import com.nu.modules.device.manager.entity.DeviceBindLog; -import com.nu.modules.device.manager.entity.DeviceIntegration; -import com.nu.modules.device.manager.entity.DeviceManager; -import com.nu.modules.device.manager.entity.DevicePreview; +import com.nu.modules.device.manager.entity.*; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -18,17 +15,27 @@ import java.util.List; * @Version: V1.0 */ public interface IDeviceManagerService extends IService { - IPage findPage(Page page, DeviceManager deviceManager); + IPage findPlanPage(Page page, DeviceManager deviceManager); + IPage findBatchPage(Page page, DeviceBatch deviceBatch); + String getBatchNo(DeviceBatch deviceBatch); + void saveBatch(DeviceBatch deviceBatch); + void updateBatch(DeviceBatch deviceBatch); + void removeBatch(DeviceBatch deviceBatch); List queryNuList(DevicePreview devicePreview); - IPage findDepartPreviewPage(Page page, DevicePreview devicePreview); - IPage findNuPreviewPage(Page page, DevicePreview devicePreview); - void addPreview(DevicePreview devicePreview); - void updatePreview(DevicePreview devicePreview); - void deletePreview(DevicePreview devicePreview); + IPage findDepartPreviewPlanPage(Page page, DevicePreview devicePreview); + IPage findNuPreviewPlanPage(Page page, DevicePreview devicePreview); + void addPreviewPlan(DevicePreview devicePreview); + void updatePreviewPlan(DevicePreview devicePreview); + void deletePreviewPlan(DevicePreview devicePreview); + void syncPreview(String id); + void deletePreviewById(String id); + void editPreviewSn(DevicePreview devicePreview); + void bindPreview(DevicePreview devicePreview); IPage findCameraPage(Page page, DeviceIntegration deviceIntegration); IPage findNetworkPage(Page page, DeviceIntegration deviceIntegration); IPage findElectricityPage(Page page, DeviceIntegration deviceIntegration); IPage findWaterPage(Page page, DeviceIntegration deviceIntegration); IPage findHumidPage(Page page, DeviceIntegration deviceIntegration); IPage findBingLogPage(Page page, DeviceBindLog deviceBindLog); + void addBindPreview(DeviceBindLog deviceBindLog); } diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/impl/DeviceManagerServiceImpl.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/impl/DeviceManagerServiceImpl.java index 2fb698c..a34fb9a 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/impl/DeviceManagerServiceImpl.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/device/manager/service/impl/DeviceManagerServiceImpl.java @@ -1,17 +1,34 @@ package com.nu.modules.device.manager.service.impl; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.nu.modules.device.manager.entity.DeviceBindLog; -import com.nu.modules.device.manager.entity.DeviceIntegration; -import com.nu.modules.device.manager.entity.DeviceManager; -import com.nu.modules.device.manager.entity.DevicePreview; +import com.nu.dto.DevicePreviewMqDto; +import com.nu.dto.IotSyncPreviewMQDto; +import com.nu.modules.device.manager.entity.*; import com.nu.modules.device.manager.mapper.DeviceManagerMapper; import com.nu.modules.device.manager.service.IDeviceManagerService; +import com.nu.modules.syncLog.entity.SyncBizLog; +import com.nu.modules.syncLog.service.ISyncBizLogService; +import com.nu.utils.RabbitMQUtil; import lombok.extern.slf4j.Slf4j; +import me.zhyd.oauth.utils.UuidUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.shiro.SecurityUtils; +import org.jeecg.common.system.api.ISysBaseAPI; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.beans.BeanUtils; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -24,9 +41,60 @@ import java.util.List; @Slf4j public class DeviceManagerServiceImpl extends ServiceImpl implements IDeviceManagerService { + @Autowired + private RabbitMQUtil rabbitMQUtil; + + @Autowired + private ISyncBizLogService logService; + @Override - public IPage findPage(Page page, DeviceManager deviceManager){ - return baseMapper.findPage(page,deviceManager); + public IPage findPlanPage(Page page, DeviceManager deviceManager){ + return baseMapper.findPlanPage(page,deviceManager); + } + + @Override + public IPage findBatchPage(Page page, DeviceBatch deviceBatch){ + IPage records = baseMapper.findBatchPage(page,deviceBatch); + List list = records.getRecords(); + for(int i=0;i dpList = baseMapper.getPreviewPlanList(dp); + entity.setChildrenCn(dpList.size()); + } + return records; + } + + @Override + public String getBatchNo(DeviceBatch deviceBatch){ + // 机构编码 + 年月日时分秒 + return deviceBatch.getOrgCode() + DateUtil.format(new Date(),"yyMMddHHmmss"); + } + + @Override + public void saveBatch(DeviceBatch deviceBatch){ + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser != null) { + deviceBatch.setCreateBy(sysUser.getRealname()); + } + baseMapper.saveBatch(deviceBatch); + } + + @Override + public void updateBatch(DeviceBatch deviceBatch){ + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser != null) { + deviceBatch.setUpdateBy(sysUser.getRealname()); + } + baseMapper.updateBatch(deviceBatch); + } + + @Override + public void removeBatch(DeviceBatch deviceBatch){ + + baseMapper.removeBatch(deviceBatch); } @Override @@ -35,40 +103,139 @@ public class DeviceManagerServiceImpl extends ServiceImpl findDepartPreviewPage(Page page, DevicePreview devicePreview){ - return baseMapper.findDepartPreviewPage(page,devicePreview); + public IPage findDepartPreviewPlanPage(Page page, DevicePreview devicePreview){ + return baseMapper.findDepartPreviewPlanPage(page,devicePreview); } @Override - public IPage findNuPreviewPage(Page page, DevicePreview devicePreview){ - return baseMapper.findNuPreviewPage(page,devicePreview); + public IPage findNuPreviewPlanPage(Page page, DevicePreview devicePreview){ + return baseMapper.findNuPreviewPlanPage(page,devicePreview); } @Override - public void addPreview(DevicePreview devicePreview){ - DevicePreview entity = baseMapper.getPreview(devicePreview); - if(entity!=null){ - int purchaseQuantity = devicePreview.getPurchaseQuantity()+entity.getPurchaseQuantity(); - DevicePreview vo = new DevicePreview(); - vo.setId(entity.getId()); - vo.setPurchaseQuantity(purchaseQuantity); - baseMapper.updatePreview(vo); - }else{ - baseMapper.addPreview(devicePreview); + public void addPreviewPlan(DevicePreview devicePreview){ +// List iotList = new ArrayList<>(); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser != null) { + devicePreview.setCreateBy(sysUser.getRealname()); } - //需同步到业务 +// int quantity = devicePreview.getPurchaseQuantity(); +// for(int i=0;i iotList = new ArrayList<>(); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (sysUser != null) { + devicePreview.setUpdateBy(sysUser.getRealname()); + } + baseMapper.updatePreviewPlan(devicePreview); + +// List list = baseMapper.getPreviewList(devicePreview); +// int quantity = devicePreview.getPurchaseQuantity(); +// if(quantity>list.size()){ +// int cn = quantity - list.size(); +// for(int i=0;i emptyList = new ArrayList<>(); +// for(int i=0;i=cn){ +// delCn = cn; +// }else{ +// delCn = emptyList.size(); +// } +// for(int i=0;i iotList = new ArrayList<>(); +// List list = baseMapper.getPreviewList(devicePreview); +// for(int i=0;i findBingLogPage(Page page, DeviceBindLog deviceBindLog){ return baseMapper.findBingLogPage(page,deviceBindLog); } + + @Override + public void addBindPreview(DeviceBindLog deviceBindLog){ + baseMapper.addBindPreview(deviceBindLog); + } + + public String addLog(String orgCode,String orgName,String json,String type,String iotType){ + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + String logId = UuidUtils.getUUID(); + SyncBizLog log = new SyncBizLog(); + log.setLogId(logId); + log.setOrgCode(orgCode); + log.setOrgName(orgName); + log.setContent(json); + log.setSyncType(type); + log.setStatus("同步中"); + log.setServerType(iotType); + if (sysUser != null) { + log.setCreateBy(sysUser.getRealname()); + } + logService.addLog(log); + return logId; + } } diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/entity/SyncBizLog.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/entity/SyncBizLog.java index b315977..e23fcd6 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/entity/SyncBizLog.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/entity/SyncBizLog.java @@ -38,6 +38,7 @@ public class SyncBizLog implements Serializable { private String syncType; private String status; private String serverType; + private String createBy; @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date createTime; diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/mapper/xml/SyncBizLogMapper.xml b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/mapper/xml/SyncBizLogMapper.xml index 09ffa6d..f85ce35 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/mapper/xml/SyncBizLogMapper.xml +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/syncLog/mapper/xml/SyncBizLogMapper.xml @@ -10,17 +10,19 @@ sync_type, status, server_type, - create_time + create_time, + create_by ) values ( - #{logId}, - #{orgCode}, - #{orgName}, - #{content}, - #{syncType}, - #{status}, - #{serverType}, - now() + #{logId}, + #{orgCode}, + #{orgName}, + #{content}, + #{syncType}, + #{status}, + #{serverType}, + now(), + #{createBy} ) diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/mq/device/listener/IotDeviceMQListener.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/mq/device/listener/IotDeviceMQListener.java index 0f0f600..a4c40b6 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/mq/device/listener/IotDeviceMQListener.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/mq/device/listener/IotDeviceMQListener.java @@ -1,8 +1,12 @@ package com.nu.mq.device.listener; +import com.nu.dto.DevicePreviewMqDto; import com.nu.dto.IotNuBaseInfoMQDto; import com.nu.dto.StatusListMQDto; import com.nu.dto.StatusMQDto; +import com.nu.modules.device.manager.entity.DeviceBindLog; +import com.nu.modules.device.manager.entity.DevicePreview; +import com.nu.modules.device.manager.service.IDeviceManagerService; import com.nu.modules.dingshuo.electricity.entity.DsElectricityMeter; import com.nu.modules.dingshuo.electricity.service.IDsElectricityMeterService; import com.nu.modules.manager.entity.IotDeviceInfo; @@ -29,6 +33,7 @@ import org.springframework.amqp.rabbit.annotation.Exchange; import org.springframework.amqp.rabbit.annotation.Queue; import org.springframework.amqp.rabbit.annotation.QueueBinding; import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -66,6 +71,9 @@ public class IotDeviceMQListener { @Autowired private IIotDeviceInfoService iotDeviceInfoService; + @Autowired + private IDeviceManagerService deviceManagerService; + @RabbitListener( bindings = @QueueBinding( value = @Queue(name = "iotsyncbiz.async.result", durable = "true"), @@ -250,7 +258,6 @@ public class IotDeviceMQListener { if(statusList.size()>0){ for(int i=0;i statusList = dto.getStatusList(); + if(statusList.size()>0){ + for(int i=0;i statusList = dto.getStatusList(); + if(statusList.size()>0){ + for(int i=0;i