mirror of https://gitee.com/stylefeng/roses
批量删除字典条目
parent
7db770fdb7
commit
7d41a83849
|
@ -81,6 +81,18 @@ public class DictController {
|
||||||
return new SuccessResponseData<>();
|
return new SuccessResponseData<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除字典条目
|
||||||
|
*
|
||||||
|
* @author liyanjun
|
||||||
|
* @date 2023/07/04 10:29
|
||||||
|
*/
|
||||||
|
@PostResource(name = "批量删除字典条目", path = "/dict/batchDelete")
|
||||||
|
public ResponseData<?> batchDelete(@RequestBody @Validated(DictRequest.batchDelete.class) DictRequest dictRequest) {
|
||||||
|
dictService.batchDelete(dictRequest);
|
||||||
|
return new SuccessResponseData<>();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除字典条目
|
* 删除字典条目
|
||||||
*
|
*
|
||||||
|
|
|
@ -27,6 +27,7 @@ package cn.stylefeng.roses.kernel.dict.modular.pojo.request;
|
||||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
||||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||||
|
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest.batchDelete;
|
||||||
import cn.stylefeng.roses.kernel.validator.api.validators.status.StatusValue;
|
import cn.stylefeng.roses.kernel.validator.api.validators.status.StatusValue;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -36,6 +37,7 @@ import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典请求参数封装
|
* 字典请求参数封装
|
||||||
|
@ -146,6 +148,13 @@ public class DictRequest extends BaseRequest {
|
||||||
@NotEmpty(message = "字典树的整个结构不能为空", groups = updateTree.class)
|
@NotEmpty(message = "字典树的整个结构不能为空", groups = updateTree.class)
|
||||||
private List<SysDict> totalDictStructure;
|
private List<SysDict> totalDictStructure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典id集合,用在批量删除
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "dictId集合不能为空", groups = batchDelete.class)
|
||||||
|
@ChineseDescription("dictId集合,用在批量删除")
|
||||||
|
private Set<Long> dictIdList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取树形列表
|
* 获取树形列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -66,6 +66,16 @@ public interface DictService extends IService<SysDict>, DictApi {
|
||||||
*/
|
*/
|
||||||
void del(DictRequest dictRequest);
|
void del(DictRequest dictRequest);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除字典
|
||||||
|
*
|
||||||
|
* @author liyanjun
|
||||||
|
* @date 2023/07/04 10:29
|
||||||
|
*/
|
||||||
|
void batchDelete(DictRequest dictRequest);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改字典
|
* 修改字典
|
||||||
*
|
*
|
||||||
|
|
|
@ -444,4 +444,9 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchDelete(DictRequest dictRequest) {
|
||||||
|
this.removeBatchByIds(dictRequest.getDictIdList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue