Compare commits

...

2 Commits

Author SHA1 Message Date
2f04a305be Merge remote-tracking branch 'origin/feature/iot' into iot 2025-01-08 11:31:29 +08:00
bc82a1bfd1 refactor(iot): 调整设备映射和数据库脚本
- 修改 DeviceMapper.xml 中 name 字段的属性映射,从 name 改为 productName
-移除 gateway.sql 中的冗余数据插入和表删除语句- 优化 RoleServiceImpl 中的角色权限更新逻辑
2025-01-08 11:30:36 +08:00
3 changed files with 4 additions and 28 deletions

View File

@ -86,8 +86,10 @@ public class RoleServiceImpl extends ServiceImpl<RoleRepository, Role> implement
throw new ConstraintException("name", dto.getName(), "同名角色已存在");
}
mapper.convert(dto, existingRole);
if (existingRole.getAuthorities() != null) {
roleAuthService.remove(new LambdaQueryWrapper<RoleAuthority>().eq(RoleAuthority::getRoleId, id));
saveRoleAuths(id, dto.getAuthorities());
saveRoleAuths(id, dto.getAuthorities());
}
return updateById(existingRole);
}

View File

@ -688,29 +688,3 @@ comment on column sys_user.enable_state is '状态';
alter table sys_user
owner to gitea;
-- 插入备份的数据
INSERT INTO sys_user (dept_id, role_id, username, password, phone, email, name, avatar, address, create_by, update_by,
create_time, update_time, remark, enable_state)
SELECT dept_id,
role_id,
username,
password,
phone,
email,
name,
avatar,
address,
create_by,
update_by,
create_time,
update_time,
remark,
enable_state
FROM sys_user_backup;
-- 删除备份表
DROP TABLE sys_user_backup;
ALTER TABLE iot_property
ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY;

View File

@ -22,7 +22,7 @@
<result column="create_time" jdbcType="DATE" property="deviceCreateTime"/>
<result column="update_time" jdbcType="DATE" property="deviceUpdateTime"/>
<result column="remark" jdbcType="VARCHAR" property="deviceRemark"/>
<result column="name" property="name"/>
<result column="name" property="productName"/>
<result column="product_type" jdbcType="VARCHAR" property="productType"/>
<result column="model" property="model"/>
<result column="link" property="link"/>