前端完成

main
王宇航 2024-06-26 13:45:55 +08:00
parent 2de1ab46f3
commit 5b49063ab8
5 changed files with 24 additions and 6 deletions

View File

@ -120,9 +120,13 @@ public class AppSkillController extends BaseController
*
*/
@Log(title = "标签信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id)
{
return toAjax(appSkillService.deleteAppSkillByIds(ids));
if (appSkillService.hasChildById(id)) {
return AjaxResult.error(2001,"存在子集数据,不允许删除");
}
return toAjax(appSkillService.deleteAppSkillByIds(id));
}
}

View File

@ -58,4 +58,6 @@ public interface AppSkillMapper
* @return
*/
public int deleteAppSkillByIds(Long[] ids);
int hasChildById(Long id);
}

View File

@ -50,7 +50,7 @@ public interface IAppSkillService
* @param ids
* @return
*/
public int deleteAppSkillByIds(Long[] ids);
public int deleteAppSkillByIds(Long ids);
/**
*
@ -64,4 +64,6 @@ public interface IAppSkillService
List<AppSkillVo> skillList(AppSkill appSkill);
boolean hasChildById(Long id);
}

View File

@ -87,9 +87,9 @@ public class AppSkillServiceImpl implements IAppSkillService
* @return
*/
@Override
public int deleteAppSkillByIds(Long[] ids)
public int deleteAppSkillByIds(Long id)
{
return appSkillMapper.deleteAppSkillByIds(ids);
return appSkillMapper.deleteAppSkillById(id);
}
/**
@ -136,4 +136,10 @@ public class AppSkillServiceImpl implements IAppSkillService
}
return appSkillVos;
}
@Override
public boolean hasChildById(Long id) {
int i = appSkillMapper.hasChildById(id);
return i > 0;
}
}

View File

@ -84,4 +84,8 @@
#{id}
</foreach>
</delete>
<select id="hasChildById" resultType="int">
select count(1) from app_skill where parent_id = #{id}
</select>
</mapper>