映射表设备测点排序修改

This commit is contained in:
huguanghan 2025-01-17 10:32:15 +08:00
parent 80952ac7f4
commit 8bd6cec89d
2 changed files with 10 additions and 6 deletions

View File

@ -275,6 +275,8 @@ public class SysNodeServiceImpl implements SysNodeService {
@Override
public void bindDevices(List<BindEquipmentInfoDto> 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);

View File

@ -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
</select>