月报标题删除--验证
This commit is contained in:
+16
@@ -134,6 +134,22 @@ public class LawsMonthlyReportTitleTemplateEOController extends JeroController<L
|
|||||||
return Result.OK("批量删除成功!");
|
return Result.OK("批量删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目录删除验证
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "月报标题模板-批量删除")
|
||||||
|
@ApiOperation(value="月报标题模板-批量删除", notes="月报标题模板-批量删除")
|
||||||
|
@GetMapping(value = "/verifyDelete")
|
||||||
|
public Result<?> verifyDelete(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
String flag = this.lawsMonthlyReportTitleTemplateEOService.verifyDelete(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
|
|||||||
+7
@@ -48,6 +48,13 @@ public interface ILawsMonthlyReportTitleTemplateEOService extends IService<LawsM
|
|||||||
*/
|
*/
|
||||||
void deleteByIds(List<String> ids);
|
void deleteByIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目录删除验证
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String verifyDelete(List<String> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
|
|||||||
+26
@@ -121,6 +121,32 @@ public class LawsMonthlyReportTitleTemplateEOServiceImpl extends ServiceImpl<Law
|
|||||||
removeByIds(ids);
|
removeByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目录删除验证
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String verifyDelete(List<String> ids) {
|
||||||
|
//标题下存在内容或子标题时不能删除
|
||||||
|
//1. 判断是否存在子标题
|
||||||
|
LambdaQueryWrapper<LawsMonthlyReportTitleTemplateEO> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.in(LawsMonthlyReportTitleTemplateEO::getParentId,ids);
|
||||||
|
List<LawsMonthlyReportTitleTemplateEO> list = this.list(wrapper);
|
||||||
|
if(list.size() != 0){
|
||||||
|
//不能删除
|
||||||
|
return "false";
|
||||||
|
}
|
||||||
|
//2. 判断是否存在内容 memories_chapter
|
||||||
|
LambdaQueryWrapper<LawsMonthlyReportWriteEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(LawsMonthlyReportWriteEO::getMemoriesChapter,ids);
|
||||||
|
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = lawsMonthlyReportWriteEOService.list(lambdaQueryWrapper);
|
||||||
|
if(lawsMonthlyReportWriteEOS.size() != 0){
|
||||||
|
//不能删除
|
||||||
|
return "false";
|
||||||
|
}
|
||||||
|
return "true";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user