| 对比新文件 |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProcessRouteDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.service.ProcessRouteItemService; |
| | | import com.ruoyi.production.service.ProcessRouteService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | @RestController |
| | | @RequestMapping("processRoute") |
| | | @Api(tags = "宸ヨ壓璺嚎") |
| | | public class ProcessRouteController { |
| | | |
| | | @Autowired |
| | | private ProcessRouteService processRouteService; |
| | | |
| | | @Autowired |
| | | private ProcessRouteItemService processRouteItemService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("鍒嗛〉鏌ヨ") |
| | | public R page(Page<ProcessRouteDto> page, ProcessRouteDto processRouteDto) { |
| | | return R.ok(processRouteService.pageProcessRouteDto(page, processRouteDto)); |
| | | } |
| | | |
| | | @ApiOperation("鏂板宸ヨ壓璺嚎") |
| | | @PostMapping () |
| | | public R add(@RequestBody ProcessRoute processRoute) { |
| | | return R.ok(processRouteService.saveProcessRoute(processRoute)); |
| | | } |
| | | @ApiOperation("淇敼宸ヨ壓璺嚎") |
| | | @PutMapping () |
| | | public R update(@RequestBody ProcessRoute processRoute) { |
| | | return R.ok(processRouteService.updateById(processRoute)); |
| | | } |
| | | @ApiOperation("鍒犻櫎宸ヨ壓璺嚎") |
| | | @DeleteMapping("/{ids}") |
| | | public R delete(@PathVariable("ids") Long[] ids) { |
| | | //鍒犻櫎宸ヨ壓璺嚎璇︽儏 |
| | | processRouteItemService.remove(Wrappers.<ProcessRouteItem>lambdaQuery().in(ProcessRouteItem::getRouteId,Arrays.asList(ids))); |
| | | return R.ok(processRouteService.removeBatchByIds(Arrays.asList(ids))); |
| | | } |
| | | } |