|
|
@ -1,5 +1,6 @@ |
|
|
|
package org.jeecg.modules.demo.base.controller; |
|
|
|
package org.jeecg.modules.demo.base.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
@ -24,6 +25,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @Description: zy_cloths_type |
|
|
|
* @Description: zy_cloths_type |
|
|
@ -147,6 +149,13 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
zyClothsTypeService.removeById(id); |
|
|
|
zyClothsTypeService.removeById(id); |
|
|
|
|
|
|
|
//如果这是父级 连带子集一起删除
|
|
|
|
|
|
|
|
String parentId = zyClothsTypeMapper.getParentId(id); |
|
|
|
|
|
|
|
if (StringUtils.isEmpty(parentId)){ |
|
|
|
|
|
|
|
List<ZyClothsType> zyClothsTypeList = zyClothsTypeService.list(new LambdaQueryWrapper<ZyClothsType>().eq(ZyClothsType::getTypeId,id)); |
|
|
|
|
|
|
|
List<String> collect = zyClothsTypeList.stream().map(ZyClothsType::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
zyClothsTypeService.removeByIds(collect); |
|
|
|
|
|
|
|
} |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|