| | |
| | | package org.jeecg.modules.lsw.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.lsw.entity.LswMaterial; |
| | | import org.jeecg.modules.lsw.entity.LswMaterialInventory; |
| | | import org.jeecg.modules.lsw.enums.MaterialInventoryStatusEnum; |
| | | import org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialInventoryService; |
| | | import org.jeecg.modules.lsw.service.ILswMaterialService; |
| | | import org.jeecg.modules.lsw.vo.LswMaterialInventoryVo; |
| | | import org.jeecg.modules.lsw.vo.MaterialInventoryStatisticsVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 物料库存信息 |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-30 |
| | | * @Date: 2025-06-30 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class LswMaterialInventoryServiceImpl extends ServiceImpl<LswMaterialInventoryMapper, LswMaterialInventory> implements ILswMaterialInventoryService { |
| | | |
| | | @Autowired |
| | | private LswMaterialInventoryMapper lswMaterialInventoryMapper; |
| | | |
| | | @Autowired |
| | | private LswMaterialInventoryMapper lswMaterialInventoryMapper; |
| | | @Autowired |
| | | private ILswMaterialService materialService; |
| | | |
| | | @Override |
| | | public List<LswMaterialInventoryVo> selectLineSideMaterialInventoryByMaterialNumber(List<String> bomMaterialNumberList, String factoryId) { |
| | | return lswMaterialInventoryMapper.selectLineSideMaterialInventoryByMaterialNumber(bomMaterialNumberList, factoryId); |
| | | return lswMaterialInventoryMapper.selectLineSideMaterialInventoryByMaterialNumber(bomMaterialNumberList, factoryId); |
| | | } |
| | | |
| | | @Override |
| | | public List<MaterialInventoryStatisticsVO> statisticsInventory(String materialId) { |
| | | return lswMaterialInventoryMapper.statisticsInventory(materialId); |
| | | } |
| | | @Override |
| | | public List<MaterialInventoryStatisticsVO> statisticsInventory(String materialId) { |
| | | return lswMaterialInventoryMapper.statisticsInventory(materialId); |
| | | } |
| | | |
| | | @Override |
| | | public LswMaterialInventory queryByMaterialNumberAndBatchNumber(String materialNumber, String batchNumber, String warehouseId) { |
| | | LswMaterial material = materialService.queryByMaterialNumber(materialNumber); |
| | | if (material == null) { |
| | | return null; |
| | | } |
| | | LambdaQueryWrapper<LswMaterialInventory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(LswMaterialInventory::getWarehouseId, warehouseId); |
| | | queryWrapper.eq(LswMaterialInventory::getMaterialId, material.getId()); |
| | | queryWrapper.eq(LswMaterialInventory::getBatchNumber, batchNumber); |
| | | queryWrapper.eq(LswMaterialInventory::getInventoryStatus, MaterialInventoryStatusEnum.NORMAL.name()); |
| | | return lswMaterialInventoryMapper.selectOne(queryWrapper); |
| | | } |
| | | } |