提交 5d63f49b authored 作者: zjm's avatar zjm

fix(单位模块): 添加下拉单位的接口

添加下拉单位的接口
上级 f4807ed6
......@@ -175,11 +175,20 @@ public class UnitsController {
* 查询添加单位中所有单位的下拉列表
*/
@GetMapping("/belongsUnits/{unitId}")
@ApiOperation(value = "[单位管理]查询添加单位中所属单位的下拉列表", notes = "查询添加单位中所属单位的下拉列表")
@ApiOperation(value = "[单位管理]查询添加单位中所属单位的下拉列表去除自己", notes = "查询添加单位中所属单位的下拉列表")
public ResponseEntity belongsUnits(@PathVariable Integer unitId){
return ResponseEntity.ok(unitsService.belongsUnits(unitId));
}
/**
* 查询添加单位中所有单位的下拉列表
*/
@GetMapping("/belongsUnits")
@ApiOperation(value = "[单位管理]查询添加单位中所属单位的下拉列表", notes = "查询添加单位中所属单位的下拉列表")
public ResponseEntity belongsUnits2(){
return ResponseEntity.ok(unitsService.belongsUnits1());
}
/**
* 单位管理修改单位接口
*/
......
......@@ -201,10 +201,15 @@ public interface UnitsService extends PublicService<Units> {
List<Units> saveUnits(UnitsAddVo unitsAddVo);
/**
* 添加单位所有单位列表
* 添加单位所有单位列表去掉自己
*/
List<Units> belongsUnits(Integer unitId);
/**
* 添加单位所有单位列表
*/
List<Units> belongsUnits1();
/**
* 更新单位对象
*/
......
......@@ -513,6 +513,11 @@ public class UnitsServiceImpl implements UnitsService {
return unitsDao.findAll().stream().filter(units -> (units.getLevel()==1 || units.getLevel()==2)&& !units.getUnitId().equals(unitId)).sorted(Comparator.comparing(Units::getShowOrder)).collect(Collectors.toList());
}
@Override
public List<Units> belongsUnits1() {
return unitsDao.findAll().stream().filter(units -> (units.getLevel()==1 || units.getLevel()==2)).sorted(Comparator.comparing(Units::getShowOrder)).collect(Collectors.toList());
}
private Units findByParentUnit(Units units){
Area area=areaCache.findById(units.getAreaId());
if (area.getFatherId()!=null){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论