hdy
4 天以前 51eb318f6df9ebc7d1ff47522e33b2ee7cea1ba8
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.billion.main.bs.service.impl;
 
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.billion.common.exception.ServiceException;
import com.billion.common.utils.DateUtils;
import com.billion.main.bs.domain.BsBomInfo;
import com.billion.main.bs.mapper.BsBomInfoMapper;
import com.billion.main.bs.service.IBsBomInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * 基础BOMService业务层处理
 * 
 * @author HDY
 * @date 2024-11-25
 */
@Service
public class BsBomInfoServiceImpl extends ServiceImpl<BsBomInfoMapper, BsBomInfo> implements IBsBomInfoService
{
    @Autowired
    private BsBomInfoMapper bsBomInfoMapper;
 
    /**
     * 查询基础BOM
     * 
     * @param id 基础BOM主键
     * @return 基础BOM
     */
    @Override
    public BsBomInfo selectBsBomInfoById(Long id)
    {
        return bsBomInfoMapper.selectBsBomInfoById(id);
    }
 
    /**
     * 查询基础BOM列表
     * 
     * @param bsBomInfo 基础BOM
     * @return 基础BOM
     */
    @Override
    public List<BsBomInfo> selectBsBomInfoList(BsBomInfo bsBomInfo)
    {
        return bsBomInfoMapper.selectBsBomInfoList(bsBomInfo);
    }
 
    /**
     * 新增基础BOM
     * 
     * @param bsBomInfo 基础BOM
     * @return 结果
     */
    @Override
    public  void insertBsBomInfo(BsBomInfo bsBomInfo)
    {
        List<BsBomInfo> checkList = this.list(new LambdaQueryWrapper<BsBomInfo>().eq(BsBomInfo::getBomCode, bsBomInfo.getBomCode()));
        if (CollUtil.isNotEmpty(checkList)){
            throw new ServiceException("已存在工单编号为"+bsBomInfo.getBomCode()+"的数据");
        }
        this.save(bsBomInfo);
    }
 
    /**
     * 修改基础BOM
     * 
     * @param bsBomInfo 基础BOM
     * @return 结果
     */
    @Override
    public int updateBsBomInfo(BsBomInfo bsBomInfo)
    {
        bsBomInfo.setUpdateTime(DateUtils.getNowDate());
        return bsBomInfoMapper.updateBsBomInfo(bsBomInfo);
    }
 
    /**
     * 批量删除基础BOM
     * 
     * @param ids 需要删除的基础BOM主键
     * @return 结果
     */
    @Override
    public int deleteBsBomInfoByIds(Long[] ids)
    {
        return bsBomInfoMapper.deleteBsBomInfoByIds(ids);
    }
 
    /**
     * 删除基础BOM信息
     * 
     * @param id 基础BOM主键
     * @return 结果
     */
    @Override
    public int deleteBsBomInfoById(Long id)
    {
        return bsBomInfoMapper.deleteBsBomInfoById(id);
    }
 
    @Override
    public void insertBatch(List<BsBomInfo> confList) {
 
    }
}