12 小时以前 db46314b9c56256a31c9114bd45d9bd63368cbd8
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
package cn.iocoder.yudao.module.srm.service.supplier;
 
import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierCategoryDO;
import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierCategoryMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service
public class SrmSupplierCategoryServiceImpl implements SrmSupplierCategoryService {
 
    @Resource
    private SrmSupplierCategoryMapper supplierCategoryMapper;
 
    @Override
    public void assignCategory(Long supplierId, Long categoryId, String categoryName) {
        SrmSupplierCategoryDO category = SrmSupplierCategoryDO.builder()
                .supplierId(supplierId)
                .categoryId(categoryId)
                .categoryName(categoryName)
                .build();
        supplierCategoryMapper.insert(category);
    }
 
    @Override
    public void removeCategory(Long id) {
        supplierCategoryMapper.deleteById(id);
    }
 
    @Override
    public List<SrmSupplierCategoryDO> getCategoryListBySupplierId(Long supplierId) {
        return supplierCategoryMapper.selectListBySupplierId(supplierId);
    }
 
}