| | |
| | | package com.ruoyi.inventory.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.excel.SupplierManageExcelDto; |
| | | import com.ruoyi.basic.mapper.SupplierManageMapper; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.inventory.dto.StockoutDto; |
| | | import com.ruoyi.inventory.excel.StockOutExcelDto; |
| | | import com.ruoyi.inventory.mapper.StockManagementMapper; |
| | | import com.ruoyi.inventory.mapper.StockOutMapper; |
| | | import com.ruoyi.inventory.pojo.StockManagement; |
| | | import com.ruoyi.inventory.pojo.StockOut; |
| | | import com.ruoyi.inventory.service.StockOutService; |
| | | import inventory.domain.StockOut; |
| | | |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class StockOutServiceImpl implements StockOutService { |
| | | @Autowired |
| | | private StockOutMapper stockOutMapper; |
| | | @Autowired |
| | | private StockManagementMapper stockManagementMapper; |
| | | @Autowired |
| | | private ProductRecordMapper productRecordMapper; |
| | | @Autowired |
| | | private SupplierManageMapper supplierManageMapper; |
| | | |
| | | |
| | | @Override |
| | | public List<StockOut> getStockOuts() { |
| | | List<StockOut> stockOuts = stockOutMapper.selectAll(); |
| | | return stockOuts; |
| | | public int delStockOut(List<Integer> ids) { |
| | | return stockOutMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public StockOut getStockOutById(Long id) { |
| | | StockOut stockOut = stockOutMapper.selectByPrimaryKey(id); |
| | | StockOut stockOut = stockOutMapper.selectById(id); |
| | | return stockOut; |
| | | } |
| | | |
| | | @Override |
| | | public int addStockOut(StockOut stockOut) { |
| | | int i = stockOutMapper.insertSelective(stockOut); |
| | | return i; |
| | | } |
| | | // @Override |
| | | // @Transactional(rollbackFor = Exception.class) |
| | | // public void saveStockout(StockOut stockOut) { |
| | | // |
| | | // } |
| | | |
| | | @Override |
| | | public int updateStockOut(StockOut stockOut) { |
| | | int i = stockOutMapper.updateByPrimaryKeySelective(stockOut); |
| | | return i; |
| | | // 修改出库记录表 |
| | | return stockOutMapper.updateById(stockOut); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStockOut(Long id) { |
| | | int i = stockOutMapper.deleteByPrimaryKey(id); |
| | | return i; |
| | | public IPage<StockoutDto> selectStockOutPage(Page page, StockoutDto stockoutDto) { |
| | | return stockOutMapper.selectStockOutBypage(page, stockoutDto); |
| | | } |
| | | |
| | | @Override |
| | | public void stockoutExport(HttpServletResponse response, StockoutDto stockoutDto) { |
| | | List<StockOutExcelDto> stockoutList = stockOutMapper.stockoutExportList(stockoutDto); |
| | | ExcelUtil<StockOutExcelDto> util = new ExcelUtil<StockOutExcelDto>(StockOutExcelDto.class); |
| | | util.exportExcel(response, stockoutList, "供应商导出"); |
| | | } |
| | | |
| | | } |