| | |
| | | stockInRecordDto.setQualitity(stockInRecord.getStockInNum()); |
| | | stockInventoryMapper.updateSubtractStockInventory(stockInRecordDto); |
| | | } |
| | | }else if (stockInRecord.getType().equals("1")) { |
| | | String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getRecordType()); |
| | | }else if (stockInRecord.getType().equals("1") || stockInRecord.getType().equals("2")) { |
| | | String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getType()); |
| | | LambdaQueryWrapper<StockUninventory> eq = new LambdaQueryWrapper<StockUninventory>() |
| | | .eq(StockUninventory::getProductModelId, stockInRecord.getProductModelId()) |
| | | .eq(StockUninventory::getType, uninventoryType); |
| | |
| | | } else { |
| | | stockInventoryMapper.updateAddStockInventory(stockInventoryDto); |
| | | } |
| | | } else if ("1".equals(stockInRecord.getType())) { |
| | | } else if ("1".equals(stockInRecord.getType()) || "2".equals(stockInRecord.getType())) { |
| | | // 不合格入库 -> 先查库存,存在则更新,不存在则新增 |
| | | String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getRecordType()); |
| | | String uninventoryType = resolveUninventoryTypeByInRecordType(stockInRecord.getType()); |
| | | StockUninventory stockUninventory = getStockUninventory(stockInRecord.getProductModelId(), stockInRecord.getBatchNo(), uninventoryType); |
| | | StockUninventoryDto stockUninventoryDto = new StockUninventoryDto(); |
| | | stockUninventoryDto.setProductModelId(stockInRecord.getProductModelId()); |
| | |
| | | return items.size(); |
| | | } |
| | | |
| | | private String resolveUninventoryTypeByInRecordType(String recordType) { |
| | | if (StockInQualifiedRecordTypeEnum.PRODUCTION_SCRAP.getCode().equals(recordType)) { |
| | | private String resolveUninventoryTypeByInRecordType(String stockInType) { |
| | | if ("2".equals(stockInType)) { |
| | | return WASTE_TYPE; |
| | | } |
| | | return UNQUALIFIED_TYPE; |