| | |
| | | @GetMapping("/resolve-type") |
| | | @Operation(summary = "根据编码解析溯源类型:bag / pallet / batch;均不匹配返回空") |
| | | @Parameter(name = "code", description = "编码(二维码内容)", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:pro-bag-code:query')") |
| | | @PreAuthorize("@ss.hasAnyPermissions('mes:pro-bag-code:query', 'mes:pro-pallet:query', 'mes:pro-batch:query')") |
| | | public CommonResult<String> resolveType(@RequestParam("code") String code) { |
| | | if (bagCodeService.getBagCodeByCode(code) != null) { |
| | | if (bagCodeService.getBagCodeByScanCode(code) != null) { |
| | | return success("bag"); |
| | | } |
| | | if (palletService.getPalletByCode(code) != null) { |
| | | if (palletService.getPalletByScanCode(code) != null) { |
| | | return success("pallet"); |
| | | } |
| | | if (batchService.getBatchByCode(code) != null) { |
| | | if (batchService.getBatchByScanCode(code) != null) { |
| | | return success("batch"); |
| | | } |
| | | return success(null); |