提交 c3e989e5 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 c9cfbeda
......@@ -142,10 +142,6 @@ public class AnnexLibraryController {
@ApiOperation(value = "删除" , notes ="删除")
@PostMapping(value = ResourceRequestPath.DELETE_OID)
public CallBack<Boolean> delete(@PathVariable String oid){
AnnexLibrary entity = service.selectByPrimaryKey(oid);
if(entity.getStatus() == LibraryStatusEnum.STATUS_1.getCode()){
throw new BusinessValidateException("不能删除已上架的资源");
}
if (!service.batchDelete(Arrays.asList(oid))) {
throw new BusinessValidateException("操作失败");
}
......
......@@ -135,12 +135,6 @@ public class AnnexLibrarySerivceImpl extends BaseServiceImpl<AnnexLibrary,String
}
Example example = createExample();
example.createCriteria().andIn("id", ids);
List<AnnexLibrary> list = mapper.selectByExample(example);
for (AnnexLibrary entity : list) {
if (entity.getStatus() == LibraryStatusEnum.STATUS_1.getCode()) {
throw new BusinessValidateException("不能删除已上架的资源");
}
}
mapper.deleteByExample(example);
//还需删除与自定义分类关系
example = new Example(AnnexLibraryDiyType.class);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论