| | |
| | | import com.vincent.rsf.server.api.utils.LocUtils; |
| | | import com.vincent.rsf.server.api.utils.SlaveProperties; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.mapper.LocItemMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.LocServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | @Autowired |
| | | private LocServiceImpl locService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | private LocItemMapper locItemMapper; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | |
| | | * 更新库位状态 |
| | | */ |
| | | private void updateLocStatus(String locCode, String barcode) { |
| | | boolean updated = locService.update(new LambdaUpdateWrapper<Loc>() |
| | | .eq(Loc::getCode, locCode) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type) |
| | | .set(Loc::getBarcode, barcode)); |
| | | Loc current = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, locCode)); |
| | | if (Objects.isNull(current)) { |
| | | throw new CoolException("库位预约失败!!"); |
| | | } |
| | | Loc update = new Loc(); |
| | | update.setId(current.getId()); |
| | | update.setVersion(current.getVersion()); |
| | | update.setUseStatus(LocStsType.LOC_STS_TYPE_S.type); |
| | | update.setBarcode(barcode); |
| | | boolean updated = locService.update(update, new LambdaUpdateWrapper<Loc>() |
| | | .eq(Loc::getId, current.getId())); |
| | | if (!updated) { |
| | | throw new CoolException("库位预约失败!!"); |
| | | } |
| | |
| | | * 更新组托状态 |
| | | */ |
| | | private void updateWaitPakinStatus(String barcode, Long loginUserId) { |
| | | boolean updated = waitPakinService.update(new LambdaUpdateWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, barcode) |
| | | .set(WaitPakin::getUpdateBy, loginUserId) |
| | | .set(WaitPakin::getCreateBy, loginUserId) |
| | | .set(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_TASK_EXCE.val)); |
| | | WaitPakin current = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, barcode)); |
| | | if (Objects.isNull(current)) { |
| | | throw new CoolException("组托状态修改失败!!"); |
| | | } |
| | | WaitPakin update = new WaitPakin(); |
| | | update.setId(current.getId()); |
| | | update.setVersion(current.getVersion()); |
| | | update.setUpdateBy(loginUserId); |
| | | update.setCreateBy(loginUserId); |
| | | update.setIoStatus(PakinIOStatus.PAKIN_IO_STATUS_TASK_EXCE.val); |
| | | boolean updated = waitPakinService.update(update, new LambdaUpdateWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getId, current.getId())); |
| | | |
| | | if (!updated) { |
| | | throw new CoolException("组托状态修改失败!!"); |
| | |
| | | //入库靠近摆放 |
| | | if (ioType == 1 && deviceBind.getBeSimilar().equals("1") && !Cools.isEmpty(matnr) && Cools.isEmpty(orgLoc)) { |
| | | if (nearRow != curRow) { |
| | | List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr)); |
| | | List<LocItem> locItems = locItemMapper.selectList(new LambdaQueryWrapper<LocItem>().eq(LocItem::getMatnrCode, matnr)); |
| | | for (LocItem locItem : locItems) { |
| | | Loc loc1 = locService.getById(locItem.getLocId()); |
| | | if (LocUtils.isShallowLoc(loc1.getCode())) { |