package com.yuanchu.mom.controller;
|
|
|
import com.yuanchu.mom.pojo.dto.SelfcheckModelDto;
|
import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
|
import com.yuanchu.mom.vo.Result;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
import com.yuanchu.mom.service.SelfcheckModelService;
|
|
|
/**
|
* 自检项目维护表(SelfcheckModel)表控制层
|
*
|
* @author zss
|
* @since 2023-08-29 14:40:07
|
*/
|
@Api(tags = "基础数据-->自检项目维护")
|
@RestController
|
@RequestMapping("/selfcheckModel")
|
public class SelfcheckModelController {
|
|
@Autowired
|
private SelfcheckModelService selfcheckModelService;
|
|
/*查询自检项目维护列表-->左边二级展示工序和工艺*/
|
//使用技术指标维护的接口
|
|
@ApiOperation(value = "查询自检项目维护列表-->右边展示该工艺下的所有自检项目")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
|
})
|
@GetMapping("/selectAllSelf")
|
public Result selectAllSelf(Integer id) {
|
return Result.success(selfcheckModelService.selectAllSelf(id));
|
}
|
|
/*新增自检项目维护-->选择工序和工艺*/
|
//使用技术指标维护的接口
|
|
@ApiOperation(value = "新增自检项目维护")
|
@PostMapping("/addSelfcheck")
|
public Result addSelfcheck(@Validated @RequestBody SelfcheckModelDto selfcheckModelDto) {
|
Integer id = selfcheckModelService.addSelfcheck(selfcheckModelDto);
|
return Result.success("新增自建项目"+id+"成功!");
|
}
|
|
@ApiOperation(value = "删除")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "自检项目id", dataTypeClass = Integer.class, required = true)
|
})
|
@PostMapping("/delSelfcheckById")
|
public Result delSelfcheckById(Integer id) {
|
selfcheckModelService.delSelfcheckById(id);
|
return Result.success("删除" + id + "成功!");
|
}
|
|
@ApiOperation(value = "批量删除")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "ids", value = "自检项目id", dataTypeClass = String.class, required = true)
|
})
|
@PostMapping("/delAllTech")
|
public Result delAllSelfcheck(String ids) {
|
selfcheckModelService.delAllSelfcheck(ids);
|
return Result.success("批量删除成功!");
|
}
|
|
}
|