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);
|
}
|
|
}
|