diff --git a/manager/src/main/java/org/jiayunet/controller/IndustryController.java b/manager/src/main/java/org/jiayunet/controller/IndustryController.java index 897562c..c4aa23e 100644 --- a/manager/src/main/java/org/jiayunet/controller/IndustryController.java +++ b/manager/src/main/java/org/jiayunet/controller/IndustryController.java @@ -4,10 +4,7 @@ import org.jiayunet.pojo.vo.IndustryTreeVo; import org.jiayunet.pojo.vo.IndustryVo; import org.jiayunet.service.IndustryService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -47,4 +44,13 @@ public class IndustryController { public List searchIndustries(@RequestParam String keyword) { return industryService.searchIndustries(keyword); } + + /** + * 批量查询行业 + * @param ids 行业ID列表 + */ + @PostMapping("/batch") + public List getIndustriesByIds(@RequestBody List ids) { + return industryService.getIndustriesByIds(ids); + } } diff --git a/manager/src/main/java/org/jiayunet/controller/JobCategoryController.java b/manager/src/main/java/org/jiayunet/controller/JobCategoryController.java index c461a9b..4002590 100644 --- a/manager/src/main/java/org/jiayunet/controller/JobCategoryController.java +++ b/manager/src/main/java/org/jiayunet/controller/JobCategoryController.java @@ -4,10 +4,7 @@ import org.jiayunet.pojo.vo.JobCategoryTreeVo; import org.jiayunet.pojo.vo.JobCategoryVo; import org.jiayunet.service.JobCategoryService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -47,4 +44,13 @@ public class JobCategoryController { public List searchCategories(@RequestParam String keyword) { return categoryService.searchCategories(keyword); } + + /** + * 批量查询岗位分类 + * @param ids 分类ID列表 + */ + @PostMapping("/batch") + public List getCategoriesByIds(@RequestBody List ids) { + return categoryService.getCategoriesByIds(ids); + } } diff --git a/manager/src/main/java/org/jiayunet/controller/RegionController.java b/manager/src/main/java/org/jiayunet/controller/RegionController.java index 753e81d..c8653a4 100644 --- a/manager/src/main/java/org/jiayunet/controller/RegionController.java +++ b/manager/src/main/java/org/jiayunet/controller/RegionController.java @@ -4,10 +4,7 @@ import org.jiayunet.pojo.vo.RegionTreeVo; import org.jiayunet.pojo.vo.RegionVo; import org.jiayunet.service.RegionService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -47,4 +44,13 @@ public class RegionController { public List searchRegions(@RequestParam String keyword) { return regionService.searchRegions(keyword); } + + /** + * 批量查询地区 + * @param codes 地区编码列表 + */ + @PostMapping("/batch") + public List getRegionsByCodes(@RequestBody List codes) { + return regionService.getRegionsByCodes(codes); + } } diff --git a/manager/src/main/java/org/jiayunet/service/IndustryService.java b/manager/src/main/java/org/jiayunet/service/IndustryService.java index 64b698e..ae34cc8 100644 --- a/manager/src/main/java/org/jiayunet/service/IndustryService.java +++ b/manager/src/main/java/org/jiayunet/service/IndustryService.java @@ -90,4 +90,23 @@ public class IndustryService { return vo; }).collect(Collectors.toList()); } + + /** + * 批量查询行业 + *

根据ID列表批量查询行业详情

+ */ + public List getIndustriesByIds(List ids) { + if (ids == null || ids.isEmpty()) { + return new ArrayList<>(); + } + List industries = industryMapper.selectList(new LambdaQueryWrapper().in(Industry::getId, ids)); + return industries.stream().map(i -> { + IndustryVo vo = new IndustryVo(); + vo.setId(i.getId()); + vo.setName(i.getName()); + vo.setLevel(i.getLevel()); + vo.setParentId(i.getParentId()); + return vo; + }).collect(Collectors.toList()); + } } diff --git a/manager/src/main/java/org/jiayunet/service/JobCategoryService.java b/manager/src/main/java/org/jiayunet/service/JobCategoryService.java index 19d08d8..2bfe6e1 100644 --- a/manager/src/main/java/org/jiayunet/service/JobCategoryService.java +++ b/manager/src/main/java/org/jiayunet/service/JobCategoryService.java @@ -99,4 +99,23 @@ public class JobCategoryService { return vo; }).collect(Collectors.toList()); } + + /** + * 批量查询岗位分类 + *

根据ID列表批量查询分类详情

+ */ + public List getCategoriesByIds(List ids) { + if (ids == null || ids.isEmpty()) { + return new ArrayList<>(); + } + List categories = categoryMapper.selectList(new LambdaQueryWrapper().in(JobCategory::getId, ids)); + return categories.stream().map(c -> { + JobCategoryVo vo = new JobCategoryVo(); + vo.setId(c.getId()); + vo.setName(c.getName()); + vo.setLevel(c.getLevel()); + vo.setParentId(c.getParentId()); + return vo; + }).collect(Collectors.toList()); + } } diff --git a/manager/src/main/java/org/jiayunet/service/RegionService.java b/manager/src/main/java/org/jiayunet/service/RegionService.java index 5938484..0ef4494 100644 --- a/manager/src/main/java/org/jiayunet/service/RegionService.java +++ b/manager/src/main/java/org/jiayunet/service/RegionService.java @@ -95,4 +95,21 @@ public class RegionService { return vo; }).collect(Collectors.toList()); } + + /** + * 批量查询地区 + *

根据code列表批量查询地区详情

+ */ + public List getRegionsByCodes(List codes) { + if (codes == null || codes.isEmpty()) { + return new ArrayList<>(); + } + List regions = regionMapper.selectList(new LambdaQueryWrapper().in(ChinaRegionsCode::getCode, codes)); + return regions.stream().map(r -> { + RegionVo vo = new RegionVo(); + vo.setCode(r.getCode()); + vo.setName(r.getName()); + return vo; + }).collect(Collectors.toList()); + } }