| | |
| | | TaskItem item = taskItemService.getById(taskItem.getId()); |
| | | //判断是否允许超收,不允许超收添加拒收判断 |
| | | if (!Objects.isNull(config)) { |
| | | LocItemWorking serviceOne = locItemWorkingService.getOne(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getFieldsIndex, item.getFieldsIndex())); |
| | | TaskItem serviceOne = taskItemService.getOne(new LambdaQueryWrapper<TaskItem>() |
| | | .eq(TaskItem::getTaskId, task.getId()) |
| | | .eq(TaskItem::getFieldsIndex, item.getFieldsIndex())); |
| | | if (Objects.isNull(serviceOne)) { |
| | | throw new CoolException("缓存数据丢失!!"); |
| | | } |
| | | LocItemWorking workItem = locItemWorkingService.getOne(new LambdaQueryWrapper<LocItemWorking>() |
| | | .eq(LocItemWorking::getTaskId, task.getId()) |
| | | .eq(LocItemWorking::getFieldsIndex, item.getFieldsIndex())); |
| | | if (Objects.isNull(workItem)) { |
| | | throw new CoolException("缓存数据丢失!!"); |
| | | } |
| | | Double v1 = Math.round((workItem.getAnfme() - serviceOne.getQty()) * 1000000) / 1000000.0; |
| | | //不管是否允许超收,都需判断是否超出库存范围 |
| | | if (taskItem.getAnfme().compareTo(serviceOne.getAnfme()) > 0) { |
| | | if (taskItem.getAnfme().compareTo(v1) > 0) { |
| | | throw new CoolException("拣货数量超出当前票号库存数量!!"); |
| | | } |
| | | |
| | | if (!Boolean.parseBoolean(config.getVal())) { |
| | | Double v = Math.round((item.getQty() + taskItem.getAnfme()) * 1000000) / 1000000.0; |
| | | if (item.getAnfme().compareTo(v) < 0.0) { |
| | |
| | | throw new CoolException("任务明细修改失败"); |
| | | } |
| | | LocItemWorking oldOne = locItemWorkingService.getOne(new LambdaQueryWrapper<LocItemWorking>() |
| | | .eq(LocItemWorking::getTaskId, byId.getTaskId()) |
| | | .eq(LocItemWorking::getMatnrCode, byId.getMatnrCode()) |
| | | .eq(LocItemWorking::getFieldsIndex, byId.getFieldsIndex())); |
| | | if (Objects.isNull(oldOne)) { |
| | | throw new CoolException("明细不存在或已出库!!"); |
| | | } |
| | | LocItemWorking one = locItemWorkingService.getOne(new LambdaQueryWrapper<LocItemWorking>() |
| | | .eq(LocItemWorking::getMatnrCode, byId.getMatnrCode()) |
| | | .eq(LocItemWorking::getTaskId, byId.getTaskId()) |
| | | .eq(LocItemWorking::getMatnrCode, byId.getMatnrCode()) |
| | | .eq(LocItemWorking::getFieldsIndex, uuid)); |
| | | if (Objects.isNull(one)) { |
| | | throw new CoolException("明细不存在或已出库!!"); |