getcategory 新增方法用于获取模版类型下面的所属类别
This commit is contained in:
parent
adfb92693a
commit
a3710a37b5
@ -67,6 +67,12 @@ public class InspectTemplateController {
|
||||
InspectTemplateDO template = templateService.getTemplate(id);
|
||||
return success(BeanUtils.toBean(template, InspectTemplateRespVO.class));
|
||||
}
|
||||
@GetMapping("/getcategory")
|
||||
@Operation(summary = "根据模版类型获取所属模版类别")
|
||||
public CommonResult<List<String>> getcategory(@RequestParam("type") String type) {
|
||||
List<String> category = templateService.getcategory(type);
|
||||
return success(category);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得汇总模板分页")
|
||||
|
@ -33,4 +33,7 @@ public class InspectTemplatePageReqVO extends PageParam {
|
||||
@Schema(description = "模板名称", example = "赵六")
|
||||
private String contentName;
|
||||
|
||||
@Schema(description = "模板类别", example = "赵六")
|
||||
private String category;
|
||||
|
||||
}
|
@ -38,4 +38,7 @@ public class InspectTemplateRespVO {
|
||||
@ExcelProperty("模板名称")
|
||||
private String contentName;
|
||||
|
||||
@Schema(description = "模板类别", example = "赵六")
|
||||
private String category;
|
||||
|
||||
}
|
@ -29,4 +29,7 @@ public class InspectTemplateSaveReqVO {
|
||||
@Schema(description = "模板名称", example = "赵六")
|
||||
private String contentName;
|
||||
|
||||
@Schema(description = "模板类别", example = "赵六")
|
||||
private String category;
|
||||
|
||||
}
|
@ -62,4 +62,10 @@ public class InspectTemplateDO {
|
||||
@TableField("contentName")
|
||||
private String contentName;
|
||||
|
||||
/**
|
||||
* 模板类别
|
||||
*/
|
||||
@TableField("category")
|
||||
private String category;
|
||||
|
||||
}
|
@ -44,6 +44,10 @@ public interface InspectTemplateService {
|
||||
* @return 汇总模板
|
||||
*/
|
||||
InspectTemplateDO getTemplate(Integer id);
|
||||
/*
|
||||
* 根据模版类型查询所属模版类别
|
||||
* */
|
||||
List<String> getcategory(String type);
|
||||
|
||||
/**
|
||||
* 获得汇总模板分页
|
||||
|
@ -1,15 +1,13 @@
|
||||
package cn.iocoder.yudao.module.inspect.service.inspecttemplate;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.inspect.controller.admin.inspecttemplate.vo.*;
|
||||
import cn.iocoder.yudao.module.inspect.dal.dataobject.inspecttemplate.InspectTemplateDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.inspect.dal.mysql.inspecttemplate.InspectTemplateMapper;
|
||||
@ -66,6 +64,17 @@ public class InspectTemplateServiceImpl implements InspectTemplateService {
|
||||
public InspectTemplateDO getTemplate(Integer id) {
|
||||
return templateMapper.selectById(id);
|
||||
}
|
||||
@Override
|
||||
public List<String> getcategory(String type){
|
||||
List<String> list1 = new ArrayList<>();
|
||||
QueryWrapper<InspectTemplateDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("category", type);
|
||||
List<InspectTemplateDO> doList=templateMapper.selectList(queryWrapper);
|
||||
for (InspectTemplateDO inspectTemplateDO : doList) {
|
||||
list1.add(inspectTemplateDO.getCategory());
|
||||
}
|
||||
return list1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<InspectTemplateDO> getTemplatePage(InspectTemplatePageReqVO pageReqVO) {
|
||||
|
Loading…
Reference in New Issue
Block a user