das接口修改

This commit is contained in:
chenhaojie 2024-08-12 14:58:26 +08:00
parent 170b15c5c2
commit c71c03bf55
4 changed files with 10 additions and 13 deletions

View File

@ -165,10 +165,10 @@ public class SysNodeController {
public R<?> getMappingList(@RequestBody SysImptabmappingDto sysImptabmappingDto) {
//判断是否有权限
// boolean hasPermission = StpUtil.hasPermission(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_MGR.toString());
// if(!hasPermission){
// return R.fail("没有节点管理权限");
// }
boolean hasPermission = StpUtil.hasPermission(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_MGR.toString());
if(!hasPermission){
return R.fail("没有节点管理权限");
}
if (sysImptabmappingDto.getLinkId() == null) {
throw new ServiceException("参数缺失");
}

View File

@ -18,9 +18,9 @@ import java.util.List;
@Mapper
public interface SysImptabmappingMapper extends BaseMapperPlus<SysImptabmapping, SysImptabmapping> {
List<ImptabmappingVo> getMappingList(Long linkId, String code);
List<ImptabmappingVo> getMappingList(Long linkId, Integer type);
List<ImptabmappingVo> getMappingControlList(Long linkId, String code);
List<ImptabmappingVo> getMappingControlList(Long linkId, Integer type);
List<SysImptabmappingVo> getBindDevice(Long linkId);

View File

@ -192,13 +192,10 @@ public class SysNodeServiceImpl implements SysNodeService {
Integer type = sysImptabmappingDto.getType();
List<ImptabmappingVo> list = new ArrayList<>();
// 根据类型获取物模型属性或者动作编码
String code = "";
if (type == 138 || type == 139 || type == 140) {
code = sysIotModelMapper.getIotModelFieldCode(type);
list = sysImptabmappingMapper.getMappingList(sysImptabmappingDto.getLinkId(), code);
list = sysImptabmappingMapper.getMappingList(sysImptabmappingDto.getLinkId(), type);
} else if (type == 146 || type == 147) {
code = sysIotModelMapper.getIotModelServiceCode(type);
list = sysImptabmappingMapper.getMappingControlList(sysImptabmappingDto.getLinkId(), code);
list = sysImptabmappingMapper.getMappingControlList(sysImptabmappingDto.getLinkId(), type);
}
return list;

View File

@ -26,7 +26,7 @@
select si.id, se."name" as equipmentName, simf.attribute_name as name,si.params,se.id as equipmentId from sys_imptabmapping si
left join sys_equipment se on si.equipment_id = se.id
left join sys_iot_model_field simf on se.iot_model_id = simf.iot_model_id
where si.link_id = #{linkId} and si.equipment_attribute = #{code}
where si.link_id = #{linkId} and simf.attribute_type = #{type}
order by si.porder
</select>
@ -34,7 +34,7 @@
select si.id, se."name" as equipmentName, sims.service_name as name,si.params,se.id as equipmentId from sys_imptabmapping si
left join sys_equipment se on si.equipment_id = se.id
left join sys_iot_model_service sims on se.iot_model_id = sims.iot_model_id
where si.link_id = #{linkId} and si.equipment_service = #{code}
where si.link_id = #{linkId} and sims.service_type = #{type}
order by si.porder
</select>