| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private TaskItemServiceImpl taskItemService; |
| | | @Autowired |
| | | private CheckOrderService checkOrderService; |
| | | private BasStationTypeMapper basStationTypeMapper; |
| | | @Autowired |
| | | private BasStationTypeServiceImpl basStationTypeService; |
| | | @Autowired |
| | | private BasStationServiceImpl basStationService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | } |
| | | if (!items.isEmpty()) { |
| | | double purQty = items.stream().mapToDouble(WkOrderItem::getAnfme).sum(); |
| | | if (!this.update(new LambdaUpdateWrapper<WkOrder>() |
| | | .set(WkOrder::getExceStatus, CheckExceStatus.CHECK_ORDER_STATUS_UN_EXCE.val) |
| | | .set(WkOrder::getAnfme, purQty).eq(WkOrder::getId, order.getId()))) { |
| | | WkOrder savedOrder = this.getById(order.getId()); |
| | | if (Objects.isNull(savedOrder)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | savedOrder.setExceStatus(CheckExceStatus.CHECK_ORDER_STATUS_UN_EXCE.val) |
| | | .setAnfme(purQty); |
| | | if (!this.updateById(savedOrder)) { |
| | | throw new CoolException("单据数量修改失败!!"); |
| | | } |
| | | } |
| | |
| | | @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); |
| | | } |