| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得设备") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-machinery:query')") |
| | | public CommonResult<MesDvMachineryRespVO> getMachinery(@RequestParam("id") Long id) { |
| | | MesDvMachineryDO machinery = machineryService.getMachinery(id); |
| | | if (machinery == null) { |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得设备分页") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-machinery:query')") |
| | | public CommonResult<PageResult<MesDvMachineryRespVO>> getMachineryPage(@Valid MesDvMachineryPageReqVO pageReqVO) { |
| | | PageResult<MesDvMachineryDO> pageResult = machineryService.getMachineryPage(pageReqVO); |
| | | return success(new PageResult<>(buildMachineryRespVOList(pageResult.getList()), pageResult.getTotal())); |
| | |
| | | |
| | | @GetMapping("/simple-list") |
| | | @Operation(summary = "获得设备精简列表", description = "主要用于前端的下拉选项") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-machinery:query')") |
| | | public CommonResult<List<MesDvMachineryRespVO>> getMachinerySimpleList() { |
| | | List<MesDvMachineryDO> list = machineryService.getMachineryList(); |
| | | return success(BeanUtils.toBean(list, MesDvMachineryRespVO.class)); |