From 8bd6cec89d03c3fb1cf474f03d255e18ea1b86cd Mon Sep 17 00:00:00 2001 From: huguanghan Date: Fri, 17 Jan 2025 10:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=A0=E5=B0=84=E8=A1=A8=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=B5=8B=E7=82=B9=E6=8E=92=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../node/service/impl/SysNodeServiceImpl.java | 14 ++++++++++---- .../resources/mapper/SysImpTabMappingMapper.xml | 2 -- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/das/src/main/java/com/das/modules/node/service/impl/SysNodeServiceImpl.java b/das/src/main/java/com/das/modules/node/service/impl/SysNodeServiceImpl.java index 02f1743b..1e4e9808 100644 --- a/das/src/main/java/com/das/modules/node/service/impl/SysNodeServiceImpl.java +++ b/das/src/main/java/com/das/modules/node/service/impl/SysNodeServiceImpl.java @@ -275,6 +275,8 @@ public class SysNodeServiceImpl implements SysNodeService { @Override public void bindDevices(List equipmentList, Long linkId) { SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY); + //记录整体排序 + Integer order = 1; // 如果绑定设备列表为空,则清空映射表 if (CollectionUtils.isEmpty(equipmentList)) { @@ -329,7 +331,8 @@ public class SysNodeServiceImpl implements SysNodeService { SysTabMapping mapping = sysImptabmappingMapper.selectById(item.getId()); mapping.setMeasPointName(iotModelVo.getAttributeName()); mapping.setHighSpeed(iotModelVo.getHighSpeed()); - mapping.setPorder(iotModelVo.getPorder()); + mapping.setPorder(order); + order++; updateList.add(mapping); }else{ @@ -341,7 +344,8 @@ public class SysNodeServiceImpl implements SysNodeService { mapping.setMeasPointCode(iotModelVo.getAttributeCode()); mapping.setMeasPointName(iotModelVo.getAttributeName()); mapping.setHighSpeed(iotModelVo.getHighSpeed()); - mapping.setPorder(iotModelVo.getPorder()); + mapping.setPorder(order); + order++; mapping.setCreatedBy(sysUserVo.getAccount()); mapping.setCreatedTime(new Date()); mapping.setRevision(1); @@ -368,7 +372,8 @@ public class SysNodeServiceImpl implements SysNodeService { SysTabMapping mapping = sysImptabmappingMapper.selectById(item.getId()); mapping.setMeasPointName(iotServiceVo.getServiceName()); - mapping.setPorder(iotServiceVo.getPorder()); + mapping.setPorder(order); + order++; updateList.add(mapping); }else{ SysTabMapping mapping = new SysTabMapping(); @@ -378,7 +383,8 @@ public class SysNodeServiceImpl implements SysNodeService { mapping.setMeasPointType(measType); mapping.setMeasPointCode(iotServiceVo.getServiceCode()); mapping.setMeasPointName(iotServiceVo.getServiceName()); - mapping.setPorder(iotServiceVo.getPorder()); + mapping.setPorder(order); + order++; mapping.setCreatedBy(sysUserVo.getAccount()); mapping.setCreatedTime(new Date()); mapping.setRevision(1); diff --git a/das/src/main/resources/mapper/SysImpTabMappingMapper.xml b/das/src/main/resources/mapper/SysImpTabMappingMapper.xml index b9e2b74d..bf60e775 100644 --- a/das/src/main/resources/mapper/SysImpTabMappingMapper.xml +++ b/das/src/main/resources/mapper/SysImpTabMappingMapper.xml @@ -75,8 +75,6 @@ where t1.link_id = #{linkId} and t1.meas_point_type = #{type} order by - t1.equipment_id , - t1.meas_point_type, t1.porder