| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.entity.excel.CheckOrderTemplate; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.mapper.BasStationTypeMapper; |
| | | import com.vincent.rsf.server.manager.mapper.CheckOrderMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | private LocServiceImpl locService; |
| | | @Autowired |
| | | private TaskItemServiceImpl taskItemService; |
| | | @Autowired |
| | | private BasStationTypeMapper basStationTypeMapper; |
| | | @Autowired |
| | | private BasStationTypeServiceImpl basStationTypeService; |
| | | @Autowired |
| | | private BasStationServiceImpl basStationService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | @Override |
| | | public R getSiteNos() { |
| | | List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_CHECK_OUT.type, TaskType.TASK_TYPE_CHECK_IN.type); |
| | | List<DeviceSite> sites = deviceSiteService.list(new LambdaQueryWrapper<DeviceSite>().in(DeviceSite::getType, list).groupBy(DeviceSite::getSite)); |
| | | return R.ok().add(sites); |
| | | // List<DeviceSite> sites = deviceSiteService.list(new LambdaQueryWrapper<DeviceSite>().in(DeviceSite::getType, list).groupBy(DeviceSite::getSite)); |
| | | List<BasStationType> basStationTypes = basStationTypeService.list(new LambdaQueryWrapper<BasStationType>().in(BasStationType::getTaskType, list)); |
| | | List<BasStation> basStations = new ArrayList<>(); |
| | | for (BasStationType basStationType : basStationTypes) { |
| | | List<BasStation> basStationList = basStationService.list(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationTypeCode, basStationType.getStationTypeCode())); |
| | | if (basStationList == null || basStationList.isEmpty()) { |
| | | continue; |
| | | } |
| | | basStations.addAll(basStationList); |
| | | } |
| | | |
| | | return R.ok().add(basStations); |
| | | } |
| | | |
| | | /** |
| | |
| | | List<LocItem> locItems = locItemService.listByMatnr(matnrs); |
| | | 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("库口不为空!!"); |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | // .in(DeviceSite::getType, list) |
| | | // .groupBy(DeviceSite::getSite) |
| | | // .last("limit 1")); |
| | | |
| | | List<BasStationType> basStationTypes = basStationTypeService.list(new LambdaQueryWrapper<BasStationType>().in(BasStationType::getTaskType, list)); |
| | | List<BasStation> basStations = new ArrayList<>(); |
| | | for (BasStationType basStationType : basStationTypes) { |
| | | List<BasStation> basStationList = basStationService.list(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationTypeCode, basStationType.getStationTypeCode())); |
| | | if (basStationList == null || basStationList.isEmpty()) { |
| | | continue; |
| | | } |
| | | basStations.addAll(basStationList); |
| | | } |
| | | if (basStations.isEmpty()) { |
| | | throw new CoolException("库口为空!!"); |
| | | } |
| | | locItems.forEach(locItem -> { |
| | | locItem.setSiteNo(deviceSite.getSite()); |
| | | locItem.setSiteNo(basStations.get(0).getStationName()); |
| | | }); |
| | | |
| | | // return R.ok().add(basStations); |
| | | } |
| | | return R.ok().add(locItems); |
| | | } |