| | |
| | | import com.ruoyi.common.enums.StockQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | |
| | | private StockInRecordService stockInRecordService; |
| | | private StockOutRecordService stockOutRecordService; |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | private StockUtils stockUtils; |
| | | @Override |
| | | public IPage<StockInventoryDto> pagestockInventory(Page page, StockInventoryDto stockInventoryDto) { |
| | | return stockInventoryMapper.pagestockInventory(page, stockInventoryDto); |
| | |
| | | salesLedgerProducts.stream().forEach(item->{ |
| | | if (item.getProductCategory().equals(dto.getProductName())&&item.getSpecificationModel().equals(dto.getModel())) { |
| | | //更新库存 |
| | | stockUtils.addStock(item.getId(),dto.getQualitity(), StockQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode(),0L); |
| | | }else { |
| | | StockInventoryDto stockInventoryDto = new StockInventoryDto(); |
| | | stockInventoryDto.setRecordId(0L); |
| | | stockInventoryDto.setRecordType(StockQualifiedRecordTypeEnum.CUSTOMIZATION_STOCK_IN.getCode()); |
| | | stockInventoryDto.setQualitity(dto.getQualitity()); |
| | | stockInventoryDto.setProductModelId(item.getProductModelId()); |
| | | this.addstockInventory(stockInventoryDto); }else { |
| | | errorMsg[0] = errorMsg[0].append("产品名称:"+dto.getProductName()+"规格:"+dto.getModel()+"不存在").append("\n"); |
| | | } |
| | | }); |