Merge branch 'dev-V0.4.5' of https://gitee.com/iotkit-open-source/iotkit-parent into dev-V0.4.5
commit
8ec34a286e
|
@ -9,7 +9,7 @@ import io.github.linpeilie.annotations.MapperConfig;
|
|||
* @Version: V1.0
|
||||
* @Description: mapperstruct 配置
|
||||
*/
|
||||
@MapperConfig(mapperPackage = "cc.iotkit.data.model",
|
||||
@MapperConfig(mapperPackage = "cc.iotkit.mapstruct",
|
||||
adapterPackage="cc.iotkit.data.adapter", adapterClassName = "dataAdapter")
|
||||
|
||||
public class AutoMapperConfig3 {
|
||||
|
|
|
@ -193,7 +193,7 @@ public class SysMenuDataImpl implements ISysMenuData, IJPACommData<SysMenu, Long
|
|||
@Override
|
||||
public boolean hasChildByMenuId(Long menuId) {
|
||||
TbSysMenu tbSysMenu = jpaQueryFactory.select(QTbSysMenu.tbSysMenu).from(QTbSysMenu.tbSysMenu)
|
||||
.where(QTbSysMenu.tbSysMenu.parentId.eq(menuId)).fetchOne();
|
||||
.where(QTbSysMenu.tbSysMenu.parentId.eq(menuId)).limit(1).fetchOne();
|
||||
return Objects.nonNull(tbSysMenu);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cc.iotkit.data.service;
|
||||
|
||||
import cc.iotkit.common.utils.MapstructUtils;
|
||||
import cc.iotkit.data.dao.IJPACommData;
|
||||
import cc.iotkit.data.dao.SysRoleDeptRepository;
|
||||
import cc.iotkit.data.model.TbSysDept;
|
||||
|
@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cc.iotkit.data.model.QTbSysRoleDept.tbSysRoleDept;
|
||||
|
||||
|
@ -39,7 +41,7 @@ public class SysRoleDeptDataImpl implements ISysRoleDeptData, IJPACommData<SysRo
|
|||
|
||||
@Override
|
||||
public long insertBatch(List<SysRoleDept> list) {
|
||||
return 0;
|
||||
return sysRoleDeptRepository.saveAll(MapstructUtils.convert(list,TbSysRoleDept.class)).size();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -60,7 +60,7 @@ public class SysUserRoleDataImpl implements ISysUserRoleData, IJPACommData<SysUs
|
|||
|
||||
@Override
|
||||
public long insertBatch(List<SysUserRole> list) {
|
||||
return jpaQueryFactory.insert(tbSysRole).values(List.of(Objects.requireNonNull(MapstructUtils.convert(list, TbSysUserRole.class)))).execute();
|
||||
return sysUserRoleRepository.saveAll(MapstructUtils.convert(list,TbSysUserRole.class)).size();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ import io.github.linpeilie.annotations.MapperConfig;
|
|||
* @Version: V1.0
|
||||
* @Description: mapperstruct 配置
|
||||
*/
|
||||
@MapperConfig(mapperPackage = "cc.iotkit.manager.dto",
|
||||
@MapperConfig(mapperPackage = "cc.iotkit.mapstruct",
|
||||
adapterPackage="cc.iotkit.manager.adapter", adapterClassName = "managerAdapter")
|
||||
public class AutoMapperConfig2 {
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import io.github.linpeilie.annotations.MapperConfig;
|
|||
* @Version: V1.0
|
||||
* @Description: mapperstruct 配置
|
||||
*/
|
||||
@MapperConfig(mapperPackage = "cc.iotkit.data.model"
|
||||
@MapperConfig(mapperPackage = "cc.iotkit.mapstruct"
|
||||
,adapterPackage="cc.iotkit.system.adapter", adapterClassName="SysAdapter")
|
||||
public class AutoMapperConfig {
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ public class SysMenuController extends BaseController {
|
|||
fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
fail("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
} else if (menu.getMenuId().equals(menu.getParentId())) {
|
||||
} else if (menu.getId().equals(menu.getParentId())) {
|
||||
fail("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
|
||||
}
|
||||
menuService.updateMenu(menu);
|
||||
|
|
|
@ -27,7 +27,7 @@ public class SysMenuBo extends BaseDto {
|
|||
* 菜单ID
|
||||
*/
|
||||
@NotNull(message = "菜单ID不能为空", groups = { EditGroup.class })
|
||||
private Long menuId;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 父菜单ID
|
||||
|
|
|
@ -353,6 +353,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAuthUser(SysUserRole userRole) {
|
||||
long rows = iSysUserRoleData.delete(userRole.getRoleId(), List.of(userRole.getUserId()));
|
||||
if (rows > 0) {
|
||||
|
@ -368,6 +369,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAuthUsers(Long roleId, Long[] userIds) {
|
||||
long rows = iSysUserRoleData.delete(roleId, Arrays.asList(userIds));
|
||||
if (rows > 0) {
|
||||
|
|
Loading…
Reference in New Issue