56661
This commit is contained in:
@@ -6,7 +6,10 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.zlTree.entity.TreeData;
|
||||
import com.adc.da.slrs.zlTree.entity.ZlTree;
|
||||
import com.adc.da.slrs.zlTree.entity.ZlTreeData;
|
||||
import com.adc.da.slrs.zlTree.service.IZlTreeDataService;
|
||||
import com.adc.da.slrs.zlTree.service.IZlTreeService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -33,6 +36,9 @@ public class ZlTreeController extends BaseController<ZlTree> {
|
||||
@Autowired
|
||||
IZlTreeService iZlTreeService;
|
||||
|
||||
@Autowired
|
||||
IZlTreeDataService iZlTreeDataService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增资料中心左侧树节点")
|
||||
public ResponseMessage addFileMaterial(@RequestBody ZlTree material){
|
||||
@@ -46,8 +52,15 @@ public class ZlTreeController extends BaseController<ZlTree> {
|
||||
@ApiOperation("删除树节点")
|
||||
public ResponseMessage deleteMaterial(String id){
|
||||
List<String> idList = Arrays.asList(id.split(","));
|
||||
boolean b = iZlTreeService.removeByIds(idList);
|
||||
return Result.success(b);
|
||||
QueryWrapper<ZlTreeData> wrapper=new QueryWrapper<>();
|
||||
wrapper.in("id",idList);
|
||||
List<ZlTreeData> data=iZlTreeDataService.list(wrapper);
|
||||
if (null!=data && data.size()>0) {
|
||||
return Result.error("节点下存在数据无法删除。");
|
||||
}else {
|
||||
boolean b = iZlTreeService.removeByIds(idList);
|
||||
return Result.success(b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user