| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.TechnologyDto; |
| | | import com.yuanchu.mom.service.TechnologyService; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 江苏鵷雏网络科技有限公司 |
| | |
| | | @Autowired |
| | | private TechnologyService technologyService; |
| | | |
| | | @ApiOperation("右上角新增-->工艺路线-->选择设备组") |
| | | @GetMapping("/chooseDevice") |
| | | public Result<?> chooseDevice() { |
| | | return Result.success(technologyService.chooseDevice()); |
| | | } |
| | | |
| | | @ApiOperation("右上角新增-->工艺路线-->选择工序") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "版本", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseFather") |
| | | public Result<?> chooseFather(Integer specificationsId,Integer version) { |
| | | return Result.success(technologyService.chooseFather(specificationsId,version)); |
| | | } |
| | | |
| | | @ApiOperation("右上角新增-->工艺路线") |
| | | @PostMapping("/add") |
| | | public Result<?> addTechnology(@Validated @RequestBody TechnologyDto technologyDto) { |
| | | return Result.success(technologyService.addTechnology(technologyDto)); |
| | | } |
| | | |
| | | @ApiOperation("填写生产定额,鼠标移开保存") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "productionQuota", value = "生产定额(个/天)", dataTypeClass = Integer.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | public Result<?> write(Integer id, Integer productionQuota) { |
| | | Integer write = technologyService.write(id, productionQuota); |
| | | if (write >= 1) { |
| | | return Result.success("更新成功"); |
| | | } |
| | | return Result.fail("更新失败"); |
| | | } |
| | | |
| | | @ApiOperation("选择设备组,鼠标移开保存") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "deviceGroup", value = "设备组", dataTypeClass = String.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/writeDevice") |
| | | public Result<?> writeDevice(Integer id, String deviceGroup) { |
| | | Integer write = technologyService.writeDevice(id, deviceGroup); |
| | | if (write >= 1) { |
| | | return Result.success("更新成功"); |
| | | } |
| | | return Result.fail("更新失败"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delTechById") |
| | | public Result delTechById(Integer id) { |
| | | technologyService.delTechById(id); |
| | | return Result.success("删除"+id+"成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "工艺路线id", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllTech") |
| | | public Result delAllTech(String ids) { |
| | | technologyService.delAllTech(ids); |
| | | return Result.success("批量删除成功!"); |
| | | } |
| | | } |
| | | |