zss
2023-08-09 e06fe535194cb73db903548f0e0750f508ebe5aa
standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyTemplateController.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto;
import com.yuanchu.mom.pojo.vo.TechnologyTemplateVo1;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -46,24 +47,56 @@
        return Result.success(technologyTemplateService.seleType());
    }
    @ApiOperation(value = "查询工序模版列表")
    @ApiOperation(value = "查询工序模版列表(二级树)")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "countSize", value = "条数/页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "element", value = "元件", dataTypeClass = String.class),
            @ApiImplicitParam(name = "father", value = "工序(父类)", dataTypeClass = String.class),
            @ApiImplicitParam(name = "type", value = "类型", dataTypeClass = Integer.class,required = true)
    })
    @GetMapping("/selTech")
    public Result selTech(Integer pageSize,Integer countSize,String element,String father,Integer type){
        IPage<Map<String, Object>> salePage = technologyTemplateService.selTech(new Page<Object>(pageSize, countSize), element, father, type);
        Map<String, Object> map = new HashMap<>();
        map.put("total", salePage.getTotal());
        map.put("row", salePage.getRecords());
    public Result selTech(String element,String father,Integer type){
        List<TechnologyTemplateVo1> map = technologyTemplateService.selTech(element, father, type);
        return Result.success(map);
    }
    @ApiOperation(value = "查询工序模版详情")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "工序id", dataTypeClass = Integer.class,required = true)
    })
    @GetMapping("/selTechById")
    public Result selTechById(Integer id){
        return Result.success(technologyTemplateService.selTechById(id));
    }
    @ApiOperation(value = "编辑")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "工序id", dataTypeClass = Integer.class,required = true)
    })
    @PostMapping("/updaTechById")
    public Result updaTechById(Integer id,@RequestBody TechnologyTemplateDto technologyTemplateDto){
        technologyTemplateService.updaTechById(id,technologyTemplateDto);
        return Result.success("修改成功!");
    }
    @ApiOperation(value = "根据销售单id删除")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "工序id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/delTech")
    public Result delTech(Integer id) {
        technologyTemplateService.delTech(id);
        return Result.success("删除成功!");
    }
    @ApiOperation(value = "批量删除")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "ids", value = "销售单id", dataTypeClass = String.class, dataType = "List", required = true)
    })
    @PostMapping("/delAllTech")
    public Result delAllTech( List<Integer> ids) {
        technologyTemplateService.delAllTech(ids);
        return Result.success("批量删除成功!");
    }