| | |
| | | |
| | | @Override |
| | | public int add(StockOutRecordDto stockOutRecordDto) { |
| | | if (stockOutRecordDto.getCreateTime() == null) { |
| | | stockOutRecordDto.setCreateTime(LocalDateTime.now()); |
| | | } |
| | | String no = OrderUtils.countTodayByCreateTime(stockOutRecordMapper, "CK","outbound_batches", stockOutRecordDto.getCreateTime() != null ? stockOutRecordDto.getCreateTime() : LocalDateTime.now()); |
| | | stockOutRecordDto.setOutboundBatches(no); |
| | | if (StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode().equals(stockOutRecordDto.getRecordType())){ |
| | |
| | | public void exportStockOutRecord(HttpServletResponse response, StockOutRecordDto stockOutRecordDto) { |
| | | List<StockOutRecordExportData> list = stockOutRecordMapper.listStockOutRecordExportData(stockOutRecordDto); |
| | | for (StockOutRecordExportData stockInRecordExportData : list) { |
| | | if (stockInRecordExportData.getType().equals("0")) { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | }else { |
| | | stockInRecordExportData.setRecordType(EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())).getValue()); |
| | | if (StringUtils.isEmpty(stockInRecordExportData.getRecordType())) { |
| | | continue; |
| | | } |
| | | StockOutQualifiedRecordTypeEnum outRecordTypeEnum = |
| | | EnumUtil.fromCode(StockOutQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())); |
| | | if (outRecordTypeEnum != null) { |
| | | stockInRecordExportData.setRecordType(outRecordTypeEnum.getValue()); |
| | | continue; |
| | | } |
| | | StockInQualifiedRecordTypeEnum inRecordTypeEnum = |
| | | EnumUtil.fromCode(StockInQualifiedRecordTypeEnum.class, Integer.parseInt(stockInRecordExportData.getRecordType())); |
| | | if (inRecordTypeEnum != null) { |
| | | stockInRecordExportData.setRecordType(inRecordTypeEnum.getValue()); |
| | | } |
| | | } |
| | | ExcelUtil<StockOutRecordExportData> util = new ExcelUtil<>(StockOutRecordExportData.class); |