前端完成
parent
2de1ab46f3
commit
5b49063ab8
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,6 @@ public interface AppSkillMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteAppSkillByIds(Long[] ids);
|
||||
|
||||
int hasChildById(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,4 +84,8 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="hasChildById" resultType="int">
|
||||
select count(1) from app_skill where parent_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue