Compare commits

..

No commits in common. "5eec9481ce9ed4d2adb2378c75a6e3fd0abfb420" and "5965e3895f5fc0f802717d44a93409caa97c845c" have entirely different histories.

5 changed files with 6 additions and 24 deletions

View File

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

View File

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

View File

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

View File

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

View File

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