package com.yuanchu.mom.controller;
|
|
|
import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
|
import com.yuanchu.mom.pojo.dto.TechniqueModelDto;
|
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.TechniqueModelService;
|
|
|
/**
|
* 生产工艺维护表(TechniqueModel)表控制层
|
*
|
* @author zss
|
* @since 2023-08-29 09:26:37
|
*/
|
@Api(tags = "基础数据-->生产工艺维护")
|
@RestController
|
@RequestMapping("/techniqueModel")
|
public class TechniqueModelController {
|
|
@Autowired
|
private TechniqueModelService techniqueModelService;
|
|
/*查询生产工艺维护列表-->左边二级展示工序和工艺*/
|
//使用技术指标维护的接口
|
|
@ApiOperation(value = "查询生产工艺维护列表-->右边展示该工艺下能使用的设备所能做的项目")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
|
})
|
@GetMapping("/selectAllTeque")
|
public Result selectAllTeque(Integer id) {
|
return Result.success(techniqueModelService.selectAllTeque(id));
|
}
|
|
/*新增生产工艺维护-->选择工序和工艺*/
|
//使用技术指标维护的接口
|
|
@ApiOperation(value = "新增生产工艺维护-->选择项目父类,子类,带出单位")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "techTemId", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
|
})
|
@GetMapping("/choosePro")
|
public Result choosePro(Integer techTemId) {
|
return Result.success(techniqueModelService.choosePro(techTemId));
|
}
|
|
@ApiOperation(value = "新增生产工艺维护-->选择设备")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "techTemId", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
|
})
|
@GetMapping("/chooseDeiv")
|
public Result chooseDeiv(Integer techTemId) {
|
return Result.success(techniqueModelService.chooseDeiv(techTemId));
|
}
|
|
@ApiOperation(value = "新增生产工艺维护")
|
@PostMapping("/addQeMode")
|
public Result addQeMode(@Validated @RequestBody TechniqueModelDto techniqueModelDto) {
|
Integer id = techniqueModelService.addQeMode(techniqueModelDto);
|
return Result.success("新增" + id + "成功!");
|
}
|
|
@ApiOperation(value = "根据id查询详情")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class, required = true)
|
})
|
@GetMapping("/selecQueById")
|
public Result selecQueById(Integer id) {
|
return Result.success(techniqueModelService.selecQueById(id));
|
}
|
|
@ApiOperation(value = "编辑")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class, required = true)
|
})
|
@PostMapping("/writeQueById")
|
public Result writeQueById(Integer id, @Validated @RequestBody TechniqueModelDto techniqueModelDto) {
|
techniqueModelService.writeQueById(id, techniqueModelDto);
|
return Result.success("修改" + id + "成功!");
|
}
|
|
@ApiOperation(value = "删除")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class, required = true)
|
})
|
@PostMapping("/delQueById")
|
public Result delQueById(Integer id) {
|
techniqueModelService.delQueById(id);
|
return Result.success("删除" + id + "成功!");
|
}
|
|
@ApiOperation(value = "批量删除")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "ids", value = "生产工艺id", dataTypeClass = String.class, required = true)
|
})
|
@PostMapping("/delAllQue")
|
public Result delAllQue(String ids) {
|
techniqueModelService.delAllQue(ids);
|
return Result.success("批量删除成功!");
|
}
|
|
|
}
|