feat: 标准维护支持按标准分类筛选
- 列表接口新增 industryId 参数,通过标准-分类关联表过滤
| | |
| | | |
| | | @Operation(summary = "获取标准方法列表") |
| | | @GetMapping("/selectStandardMethodList") |
| | | public Result selectStandardMethodList(Page page,StandardMethod standardMethod) { |
| | | return Result.success(standardMethodService.selectStandardMethodList(page, standardMethod)); |
| | | public Result selectStandardMethodList(Page page, StandardMethod standardMethod, |
| | | @RequestParam(value = "industryId", required = false) Integer industryId) { |
| | | return Result.success(standardMethodService.selectStandardMethodList(page, standardMethod, industryId)); |
| | | } |
| | | |
| | | @Operation(summary = "获取标准方法枚举") |
| | |
| | | */ |
| | | public interface StandardMethodService extends IService<StandardMethod> { |
| | | |
| | | IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod); |
| | | IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod, Integer industryId); |
| | | |
| | | List<StandardMethod> selectStandardMethods(); |
| | | |
| | |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import cn.hutool.poi.excel.ExcelUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod) { |
| | | IPage<StandardMethod> result = standardMethodMapper.selectStandardMethodList(page, QueryWrappers.queryWrappers(standardMethod)); |
| | | public IPage<StandardMethod> selectStandardMethodList(Page page, StandardMethod standardMethod, Integer industryId) { |
| | | QueryWrapper<StandardMethod> wrapper = QueryWrappers.queryWrappers(standardMethod); |
| | | if (industryId != null) { |
| | | wrapper.exists("select 1 from standard_method_industry smi where smi.standard_method_id = a.id and smi.industry_id = {0}", industryId); |
| | | } |
| | | IPage<StandardMethod> result = standardMethodMapper.selectStandardMethodList(page, wrapper); |
| | | for (StandardMethod method : result.getRecords()) { |
| | | method.setIndustryIds(selectIndustryIds(method.getId())); |
| | | } |