新火炬后端单体项目初始化代码
cuilei
5 小时以前 f95d05316d49bcdd31d022a11d0fc4fbafb040da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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.List;
 
/**
 * @Description: 物料库存信息
 * @Author: jeecg-boot
 * @Date: 2025-06-30
 * @Version: V1.0
 */
@Service
public class LswMaterialInventoryServiceImpl extends ServiceImpl<LswMaterialInventoryMapper, LswMaterialInventory> implements ILswMaterialInventoryService {
 
    @Autowired
    private LswMaterialInventoryMapper lswMaterialInventoryMapper;
    @Autowired
    private ILswMaterialService materialService;
 
    @Override
    public List<LswMaterialInventoryVo> selectLineSideMaterialInventoryByMaterialNumber(List<String> bomMaterialNumberList, String factoryId) {
        return lswMaterialInventoryMapper.selectLineSideMaterialInventoryByMaterialNumber(bomMaterialNumberList, factoryId);
    }
 
    @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);
    }
}