| | |
| | | public Long add(StockOutRecordDto stockOutRecordDto) { |
| | | String no = OrderUtils.countTodayByCreateTime(stockOutRecordMapper, "CK","outbound_batches"); |
| | | stockOutRecordDto.setOutboundBatches(no); |
| | | if (StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode().equals(stockOutRecordDto.getRecordType())){ |
| | | stockOutRecordDto.setApprovalStatus(3); |
| | | } |
| | | StockInRecord stockInRecord = new StockInRecord(); |
| | | BeanUtils.copyProperties(stockOutRecordDto, stockInRecord); |
| | | stockOutRecordMapper.insert(stockOutRecordDto); |
| | |
| | | if (stockInRecordExportData.getType().equals("0")) { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | }else { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInUnQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | } |
| | | } |
| | | ExcelUtil<StockOutRecordExportData> util = new ExcelUtil<>(StockOutRecordExportData.class); |
| | |
| | | if (stockInventory == null) { |
| | | throw new BaseException("合格库存记录不存在,出库批次:" + stockOutRecord.getOutboundBatches()); |
| | | } |
| | | if (stockInventory.getLocked().equals( true)&&!stockOutRecord.getRecordType().equals(StockOutQualifiedRecordTypeEnum.INVENTORY_CHECK_STOCK_OUT.getCode())) { |
| | | throw new BaseException("正在库存盘点,无法出库,出库批次:" + stockOutRecord.getOutboundBatches()); |
| | | } |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | stockInventoryDto.setProductModelId(stockOutRecord.getProductModelId()); |
| | | stockInventoryDto.setBatchNo(stockOutRecord.getBatchNo()); |