| | |
| | | @Override |
| | | public R getAllLocByMatnr(List<String> matnrs) { |
| | | List<LocItem> locItems = locItemService.listByMatnr(matnrs); |
| | | if (locItems.isEmpty()) { |
| | | return R.ok(); |
| | | if (!locItems.isEmpty()) { |
| | | List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_CHECK_OUT.type, TaskType.TASK_TYPE_CHECK_IN.type); |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .in(DeviceSite::getType, list) |
| | | .groupBy(DeviceSite::getSite) |
| | | .last("limit 1")); |
| | | if (Objects.isNull(deviceSite)) { |
| | | throw new CoolException("库口不为空!!"); |
| | | } |
| | | locItems.forEach(locItem -> { |
| | | locItem.setSiteNo(deviceSite.getSite()); |
| | | }); |
| | | } |
| | | |
| | | |
| | | return null; |
| | | return R.ok().add(locItems); |
| | | } |
| | | |
| | | /** |