提交 | 用户 | 时间
|
f47bd7
|
1 |
package com.billion.main.bs.service.impl; |
H |
2 |
|
3d0e64
|
3 |
import cn.hutool.core.collection.CollUtil; |
H |
4 |
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
f47bd7
|
5 |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
3d0e64
|
6 |
import com.billion.common.exception.ServiceException; |
f47bd7
|
7 |
import com.billion.common.utils.DateUtils; |
H |
8 |
import com.billion.main.bs.domain.BsBomInfo; |
|
9 |
import com.billion.main.bs.mapper.BsBomInfoMapper; |
|
10 |
import com.billion.main.bs.service.IBsBomInfoService; |
|
11 |
import org.springframework.beans.factory.annotation.Autowired; |
|
12 |
import org.springframework.stereotype.Service; |
|
13 |
|
|
14 |
import java.util.List; |
|
15 |
|
|
16 |
/** |
|
17 |
* 基础BOMService业务层处理 |
|
18 |
* |
|
19 |
* @author HDY |
|
20 |
* @date 2024-11-25 |
|
21 |
*/ |
|
22 |
@Service |
|
23 |
public class BsBomInfoServiceImpl extends ServiceImpl<BsBomInfoMapper, BsBomInfo> implements IBsBomInfoService |
|
24 |
{ |
|
25 |
@Autowired |
|
26 |
private BsBomInfoMapper bsBomInfoMapper; |
|
27 |
|
|
28 |
/** |
|
29 |
* 查询基础BOM |
|
30 |
* |
|
31 |
* @param id 基础BOM主键 |
|
32 |
* @return 基础BOM |
|
33 |
*/ |
|
34 |
@Override |
|
35 |
public BsBomInfo selectBsBomInfoById(Long id) |
|
36 |
{ |
|
37 |
return bsBomInfoMapper.selectBsBomInfoById(id); |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* 查询基础BOM列表 |
|
42 |
* |
|
43 |
* @param bsBomInfo 基础BOM |
|
44 |
* @return 基础BOM |
|
45 |
*/ |
|
46 |
@Override |
|
47 |
public List<BsBomInfo> selectBsBomInfoList(BsBomInfo bsBomInfo) |
|
48 |
{ |
|
49 |
return bsBomInfoMapper.selectBsBomInfoList(bsBomInfo); |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* 新增基础BOM |
|
54 |
* |
|
55 |
* @param bsBomInfo 基础BOM |
|
56 |
* @return 结果 |
|
57 |
*/ |
|
58 |
@Override |
3d0e64
|
59 |
public void insertBsBomInfo(BsBomInfo bsBomInfo) |
f47bd7
|
60 |
{ |
3d0e64
|
61 |
List<BsBomInfo> checkList = this.list(new LambdaQueryWrapper<BsBomInfo>().eq(BsBomInfo::getBomCode, bsBomInfo.getBomCode())); |
H |
62 |
if (CollUtil.isNotEmpty(checkList)){ |
|
63 |
throw new ServiceException("已存在工单编号为"+bsBomInfo.getBomCode()+"的数据"); |
|
64 |
} |
|
65 |
this.save(bsBomInfo); |
f47bd7
|
66 |
} |
H |
67 |
|
|
68 |
/** |
|
69 |
* 修改基础BOM |
|
70 |
* |
|
71 |
* @param bsBomInfo 基础BOM |
|
72 |
* @return 结果 |
|
73 |
*/ |
|
74 |
@Override |
|
75 |
public int updateBsBomInfo(BsBomInfo bsBomInfo) |
|
76 |
{ |
|
77 |
bsBomInfo.setUpdateTime(DateUtils.getNowDate()); |
|
78 |
return bsBomInfoMapper.updateBsBomInfo(bsBomInfo); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* 批量删除基础BOM |
|
83 |
* |
|
84 |
* @param ids 需要删除的基础BOM主键 |
|
85 |
* @return 结果 |
|
86 |
*/ |
|
87 |
@Override |
|
88 |
public int deleteBsBomInfoByIds(Long[] ids) |
|
89 |
{ |
|
90 |
return bsBomInfoMapper.deleteBsBomInfoByIds(ids); |
|
91 |
} |
|
92 |
|
|
93 |
/** |
|
94 |
* 删除基础BOM信息 |
|
95 |
* |
|
96 |
* @param id 基础BOM主键 |
|
97 |
* @return 结果 |
|
98 |
*/ |
|
99 |
@Override |
|
100 |
public int deleteBsBomInfoById(Long id) |
|
101 |
{ |
|
102 |
return bsBomInfoMapper.deleteBsBomInfoById(id); |
|
103 |
} |
7737ed
|
104 |
|
H |
105 |
@Override |
|
106 |
public void insertBatch(List<BsBomInfo> confList) { |
|
107 |
|
|
108 |
} |
f47bd7
|
109 |
} |