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